Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
design_area_custom_image.inc
1 <?php
18 require_once SQ_CORE_PACKAGE_PATH.'/designs/design_area/design_area.inc';
19 
32 {
33 
34 
39  public $allowed_extensions = Array('gif', 'jpg', 'jpeg', 'png');
40 
41 
48  function __construct($assetid=0)
49  {
50  parent::__construct($assetid);
51 
52  }//end constructor
53 
54 
64  protected function _printPaintingCode()
65  {
66  $image_path = $this->data_path_public.'/'.$this->attr('image');
67  // return true because it just means that they haven't uploaded the file yet
68  if (!file_exists($image_path)) return;
69 
70  $image = '<'.'?php echo $DATA_PATH; ?'.'>/'.$this->data_path_suffix.'/'.$this->attr('image');
71  // if they only want us to echo out the filename
72  if ($this->attr('filename_only')) {
73  echo $image;
74 
75  // else print out a full tag
76  } else {
77  $image_size = @getimagesize($image_path);
78  if ($alt = $this->attr('alt')) {
79  $alt = htmlspecialchars($alt);
80  }
81  echo '<img src="', $image, '" ', $this->attr('extra');
82  if ($alt) echo ' alt="', $alt, '"';
83  echo (($image_size) ? ' '.$image_size[3] : ''), ' />';
84  }
85 
86  }//end _printPaintingCode()
87 
88 
89 }//end class
90 ?>