示例#1
0
 function __construct($filename = "")
 {
     parent::__construct();
     if (!empty($filename)) {
         if (!JFile::exists($filename)) {
             $this->setError("Image does not exist");
             return;
         }
         $this->full_path = $filename;
         $this->setDirectory(substr($this->full_path, 0, strrpos($this->full_path, DS)));
         $this->proper_name = JFile::getName($filename);
         if (!empty($this->full_path)) {
             $image_info = getimagesize($this->full_path);
             $this->type = $image_info[2];
         }
     }
 }
示例#2
0
 /**
  * Creates a List
  * @return array Array of objects containing the data from the database
  */
 public static function getArrayListStorageMethods()
 {
     static $instance;
     if (!is_array($instance)) {
         $instance = array();
         $data = DSCFile::getStorageMethods();
         for ($i = 0; $i < count($data); $i++) {
             $d = $data[$i];
             $instance[] = JHTML::_('select.option', $d->id, JText::_($d->title));
         }
     }
     return $instance;
 }