function &getPlaylists($dir) { // Read the videos folder to find playlists jimport('joomla.filesystem.folder'); $candidates = JFolder::files($dir, '\\.xml$'); $rows = array(); $id = 1; foreach ($candidates as $playlist) { $helper = new AvrPlaylistHelper($dir . DS . $playlist); if ($pl =& $helper->read()) { $obj = new stdClass(); $obj->filename = $playlist; $obj->folder = $dir; $obj->title = $pl->title; $obj->id = $id++; $rows[] = $obj; } } return $rows; }
/** * Method to get a playlist object * @return object with data */ function &getData() { // Load the data if (empty($this->_data)) { $helper = new AvrPlaylistHelper($this->_filename); $this->_data =& $helper->read(); $this->_lasterror = $helper->getLastError(); } if (!$this->_data) { $this->_data = new stdClass(); $this->_data->items = array(); $this->_data->filename = $this->_filename; $this->_data->title = null; $this->_data->info = null; $this->_data->creator = null; $this->_data->license = null; $this->_data->annotation = null; $this->_data->attribution = null; } return $this->_data; }