Exemplo n.º 1
0
 public function __get($column)
 {
     if ($column == 'name' && empty($this->_data['name'])) {
         $this->_data['name'] = basename($this->_data['path']);
     }
     if ($column == 'title' && empty($this->_data['title'])) {
         if ($this->manifest instanceof SimpleXMLElement) {
             $this->_data['title'] = $this->manifest->name;
         } else {
             $this->_data['title'] = '';
         }
     }
     if ($column == 'manifest' && empty($this->_data['manifest'])) {
         $file = $this->_data['path'] . '/' . basename($this->_data['path']) . '.xml';
         if (file_exists($file)) {
             $this->_data['manifest'] = simplexml_load_file($file);
         } else {
             $this->_data['manifest'] = null;
         }
     }
     if (in_array($column, self::$_manifest_fields) && empty($this->_data[$column])) {
         $this->_data[$column] = $this->manifest->{$column};
     }
     return parent::__get($column);
 }
Exemplo n.º 2
0
 public function __get($column)
 {
     if (in_array($column, $this->_comma_separated->toArray())) {
         if (isset($this->_data[$column]) && is_string($this->_data[$column])) {
             $values = array();
             if (!empty($this->_data[$column])) {
                 $values = explode(',', $this->_data[$column]);
             }
             $this->_data[$column] = $values;
         } else {
             return array();
         }
     }
     return parent::__get($column);
 }
Exemplo n.º 3
0
 public function __get($column)
 {
     if ($column == 'extension') {
         return pathinfo($this->path, PATHINFO_EXTENSION);
     }
     if ($column == 'filename') {
         return pathinfo($this->path, PATHINFO_BASENAME);
     }
     if ($column == 'fullpath') {
         return $this->path;
     }
     if ($column == 'scheme') {
         return parse_url($this->path, PHP_URL_SCHEME);
     }
     return parent::__get($column);
 }
Exemplo n.º 4
0
 /**
  * Get a value by key
  *
  * @param   string  The key name.
  * @return  string  The corresponding value.
  */
 public function __get($column)
 {
     if ($column == 'name' && empty($this->_data['name'])) {
         $this->_data['name'] = basename($this->_data['path']);
     }
     if ($column == 'title' && empty($this->_data['title'])) {
         if ($this->manifest instanceof SimpleXMLElement) {
             $this->_data['title'] = $this->manifest->name;
         } else {
             $this->_data['title'] = '';
         }
     }
     if ($column == 'manifest' && empty($this->_data['manifest'])) {
         $file = $this->_data['path'] . '/templateDetails.xml';
         if (file_exists($file)) {
             $this->_data['manifest'] = simplexml_load_file($file);
         } else {
             $this->_data['manifest'] = null;
         }
     }
     if (in_array($column, self::$_manifest_fields) && empty($this->_data[$column])) {
         $this->_data[$column] = $this->manifest->{$column};
     }
     if ($column == 'params' && !isset($this->_data['params'])) {
         $file = $this->_data['path'] . '/params.ini';
         $params = '';
         if (file_exists($file)) {
             $params = file_get_contents($file);
         }
         $this->_data['params'] = new JParameter($params, $this->_data['path'] . '/templateDetails.xml', 'template');
     }
     if ($column == 'positions' && !isset($this->_data['positions'])) {
         $this->_data['positions'] = array();
         if ($this->manifest && isset($this->manifest->positions)) {
             foreach ($this->manifest->positions->children() as $position) {
                 $this->_data['positions'][] = (string) $position;
             }
         }
     }
     return parent::__get($column);
 }
Exemplo n.º 5
0
	public function __get($column)
	{
		if ($column == 'fullpath' && !isset($this->_data['fullpath'])) {
			return $this->getFullpath();
		}

		if ($column == 'extension' && !isset($this->_data['extension'])) {
			return $this->getExtension();
		}

		if ($column == 'name') {
			return basename($this->_data['path']);
		}

		if ($column == 'size' && !isset($this->_data['size'])) {
			$this->_data['size'] = $this->getSize();
		}

		if ($column == 'relative_folder') {
			$path = $this->fullpath;
			$result = dirname(str_replace($this->basepath.'/', '', $path));
			return $result === '.' ? '' : $result;
		}

		if ($column == 'mimetype' && !isset($this->_data['mimetype'])) {
			$this->_data['mimetype'] = $this->getMimeType();
		}

		if ($column == 'icons' && !isset($this->_data['icons'])) {
			return $this->getIcons();
		}

		if (in_array($column, array('width', 'height', 'thumbnail')) && $this->isImage()) {
			return $this->getImageSize($column);
		}

		return parent::__get($column);
	}
Exemplo n.º 6
0
 public function __get($column)
 {
     if ($column == 'fullpath' && !isset($this->_data['fullpath'])) {
         return $this->getFullpath();
     }
     if ($column == 'name' && !isset($this->_data['name'])) {
         return basename($this->getFullpath());
     }
     if ($column == 'basepath' && !isset($this->_data['basepath'])) {
         $this->_data['basepath'] = $this->getBasepath();
     }
     if ($column == 'children' && !isset($this->_data['children'])) {
         $this->_data['children'] = $this->getService('com://admin/files.database.rowset.folders');
     }
     return parent::__get($column);
 }
Exemplo n.º 7
0
 public function __get($column)
 {
     $result = parent::__get($column);
     if (in_array($column, array('allowed_extensions', 'allowed_mimetypes')) && !is_array($result)) {
         return array();
     }
     return $result;
 }
Exemplo n.º 8
0
 public function __get($column)
 {
     if ($column == 'fullpath' && !isset($this->_data['fullpath'])) {
         return $this->getFullpath();
     }
     if ($column == 'path') {
         return trim(($this->folder ? $this->folder . '/' : '') . $this->name, '/\\');
     }
     if ($column == 'destination_path') {
         $folder = !empty($this->destination_folder) ? $this->destination_folder . '/' : (!empty($this->folder) ? $this->folder . '/' : '');
         $name = !empty($this->destination_name) ? $this->destination_name : $this->name;
         return trim($folder . $name, '/\\');
     }
     if ($column == 'destination_fullpath') {
         return $this->container->path . '/' . $this->destination_path;
     }
     if ($column == 'adapter') {
         return $this->_adapter;
     }
     return parent::__get($column);
 }