| [ Index ] |
PHP Cross Reference of Drupal 6 (gatewave) |
[Summary view] [Print] [Text view]
1 <?php 2 // $Id: image_handler_field_image_size.inc,v 1.1 2009/05/01 22:29:47 sun Exp $ 3 4 /** 5 * @file 6 * Views handler for image size field. 7 */ 8 9 /** 10 * Render the human-readable name of a given image size. 11 * 12 * @return 13 * The human-readable name or an empty string for an invalid image size. 14 */ 15 class image_handler_field_image_size extends views_handler_field { 16 var $image_sizes = array(); 17 18 function init(&$view, $options) { 19 parent::init($view, $options); 20 $this->image_sizes = image_get_sizes(); 21 } 22 23 function render($values) { 24 $image_size = $values->{$this->field_alias}; 25 26 if (!empty($image_size) && isset($this->image_sizes[$image_size])) { 27 return check_plain($this->image_sizes[$image_size]['label']); 28 } 29 30 return ''; 31 } 32 } 33
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Mar 24 11:18:33 2011 | Cross-referenced by PHPXref 0.7 |