Ejemplo n.º 1
0
 /**
  * Playlists view display method
  * @return void
  **/
 function display($tpl = null)
 {
     AvrGenericHelper::addCSS('.icon-48-avreloaded {background-image:url(' . JURI::root() . '/administrator/components/com_avreloaded/assets/avreloaded-48x48.png);}');
     JToolBarHelper::title(JText::_('AVR_TITLE_MANAGE_PLAYLISTS') . ' - AllVideos Reloaded', 'avreloaded');
     $vdir = AvrGenericHelper::getVdir();
     $app =& JFactory::getApplication();
     $folder = $app->getUserStateFromRequest('com_avreloaded.playlists_folder', 'folder', $vdir);
     // Get data from the model
     $fselect = $this->_getFolderSelect($vdir, $folder);
     $lists =& $this->_getViewLists($app, $folder);
     $model =& $this->getModel();
     $items =& $model->getData();
     if (count($items)) {
         JToolBarHelper::deleteList();
         JToolBarHelper::editListX();
     }
     JToolBarHelper::addNewX();
     JToolBarHelper::help('playlists', true);
     $files = '';
     foreach ($items as $i => $item) {
         if ($i > 0) {
             $files .= ',';
         }
         $files .= "'" . basename($item->filename) . "'";
     }
     $this->assignRef('items', $items);
     $this->assignRef('lists', $lists);
     $this->assignRef('fselect', $fselect);
     $this->assignRef('files', $files);
     parent::display($tpl);
 }
Ejemplo n.º 2
0
 /**
  * Build the select list to choose local media
  */
 function _getLocalMedia($name, $active = null)
 {
     $adir = AvrGenericHelper::getAdir();
     $vdir = AvrGenericHelper::getVdir();
     $js = 'onchange="return avri.matchLOC(this.value);"';
     jimport('joomla.filesystem.folder');
     $media = array(JHTML::_('select.option', '', '- ' . JText::_('AVR_SELECT_MEDIA') . ' -'));
     $playlist = JRequest::getInt('playlist', 0);
     $noplists = JRequest::getInt('noplists', 0);
     if ($noplists) {
         $filter = $playlist ? '\\.(3gp|flv|m4v|rbs|swf)$' : '\\.(3gp|avi|divx|flv|m4v|mov|mp4|mpg|mpeg|ram|rbs|rm|swf|wmv)$';
     } else {
         $filter = $playlist ? '\\.(3gp|flv|m4v|rbs|swf|xml)$' : '\\.(3gp|avi|divx|flv|m4v|mov|mp4|mpg|mpeg|ram|rbs|rm|swf|wmv|xml)$';
     }
     $si = JString::strlen($vdir) + 1;
     foreach (JFolder::files($vdir, $filter, true, true) as $file) {
         $media[] = JHTML::_('select.option', JString::substr($file, $si));
     }
     $filter = $playlist ? '\\.mp3$' : '\\.(mp3|ram|rm|wma)$';
     $si = JString::strlen($adir) + 1;
     foreach (JFolder::files($adir, $filter, true, true) as $file) {
         $media[] = JHTML::_('select.option', JString::substr($file, $si));
     }
     return JHTML::_('select.genericlist', $media, $name, 'class="inputbox" size="1" ' . $js, 'value', 'text', $active);
 }