/**
  * Track 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);}');
     // Get data from the model
     $track =& $this->get('Track');
     $data = JRequest::getVar('data', '');
     $isNew = empty($track->file);
     $text = $isNew ? JText::_('New') : JText::_('Edit');
     JToolBarHelper::title($text . ' ' . JText::_('AVR_TITLE_TRACK') . ' - AllVideos Reloaded', 'avreloaded');
     JToolBarHelper::save();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         // for existing items the button is renamed `close`
         JToolBarHelper::cancel('cancel', 'Close');
     }
     JToolBarHelper::help('track', true);
     $list = array(JHTML::_('select.option', '', '- ' . JText::_('AVR_SELECT_NONE') . ' -'));
     foreach (split(',', 'gif,flv,jpg,mp3,png,rtmp,swf') as $type) {
         $list[] = JHTML::_('select.option', $type, $type);
     }
     $types = JHTML::_('select.genericlist', $list, 'type', 'class="inputbox" size="1" ', 'value', 'text', $track->type);
     $mbutton = JElementInsertButton::fetchElementImplicit('mtext&playlist=1&noplists=1', JText::_('AVR Media'), false);
     $ibutton = $this->_imgButton();
     $root = AvrGenericHelper::rootURI(true) . '/';
     $aloc = AvrGenericHelper::getAloc(true) . '/';
     $vloc = AvrGenericHelper::getVloc(true) . '/';
     $this->assignRef('types', $types);
     $this->assignRef('track', $track);
     $this->assignRef('data', $data);
     $this->assignRef('ibutton', $ibutton);
     $this->assignRef('mbutton', $mbutton);
     $this->assignRef('aloc', $aloc);
     $this->assignRef('vloc', $vloc);
     $this->assignRef('root', $root);
     parent::display($tpl);
 }
 function getAloc($full = false)
 {
     $mparams =& JComponentHelper::getParams('com_media');
     $mloc = AvrGenericHelper::rootURI($full) . '/' . $mparams->get('image_path', 'images' . DS . 'stories');
     $plg =& JPluginHelper::getPlugin('content', 'avreloaded');
     $pparams = new JParameter($plg->params);
     $aloc = $pparams->get('adir', 'audio');
     if (JString::strpos($aloc, '/') === 0) {
         $aloc = AvrGenericHelper::rootURI($full) . $aloc;
     } else {
         $aloc = $mloc . '/' . $aloc;
     }
     return $aloc;
 }