Exemplo n.º 1
0
 public function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('Template Manager'), 'thememanager');
     JToolBarHelper::custom('edit', 'back.png', 'back_f2.png', 'Back', false, false);
     require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'templates.php';
     // Initialise some variables
     $option = JRequest::getCmd('option');
     $id = JRequest::getVar('id', '', 'method', 'int');
     $template = TemplatesHelper::getTemplateName($id);
     $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int'));
     $tp = true;
     $url = $client->id ? JURI::base() : JURI::root();
     if (!$template) {
         return JError::raiseWarning(500, JText::_('Template not specified'));
     }
     // Set FTP credentials, if given
     jimport('joomla.client.helper');
     JClientHelper::setCredentialsFromRequest('ftp');
     $this->assignRef('option', $option);
     $this->assignRef('client', $client);
     $this->assignRef('id', $id);
     $this->assignRef('template', $template);
     $this->assignRef('tp', $tp);
     $this->assignRef('url', $url);
     parent::display($tpl);
 }
Exemplo n.º 2
0
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     require_once JPATH_COMPONENT . '/helpers/templates.php';
     // Initialise some variables
     $this->client = JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int'));
     $this->id = JRequest::getVar('id', '', 'method', 'int');
     $this->option = JRequest::getCmd('option');
     $this->template = TemplatesHelper::getTemplateName($this->id);
     $this->tp = true;
     $this->url = $client->id ? JURI::base() : JURI::root();
     if (!$this->template) {
         return JError::raiseWarning(500, JText::_('COM_TEMPLATES_TEMPLATE_NOT_SPECIFIED'));
     }
     // Set FTP credentials, if given
     JClientHelper::setCredentialsFromRequest('ftp');
     parent::display($tpl);
     $this->addToolbar();
     parent::display($tpl);
 }