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 store a playlist
  *
  * @access	public
  * @return	boolean	True on success
  */
 function store()
 {
     $this->_data->title = JRequest::getVar('title', $this->_data->title);
     $this->_data->info = JRequest::getVar('info', $this->_data->info);
     $this->_data->creator = JRequest::getVar('creator', $this->_data->creator);
     $this->_data->license = JRequest::getVar('license', $this->_data->license);
     $this->_data->annotation = JRequest::getVar('annotation', $this->_data->annotation);
     $this->_data->attribution = JRequest::getVar('attribution', $this->_data->attribution);
     $helper = new AvrPlaylistHelper($this->_data->filename);
     $this->_filename = $this->_data->filename;
     $ret = $helper->write($this->_data);
     $this->_lasterror = $helper->getLastError();
     return $ret;
 }