Exemplo n.º 1
0
 function display($cachable = false, $urlparams = false)
 {
     $user = JFactory::getUser();
     $task = $this->getTask();
     switch ($task) {
         case 'edit':
             JRequest::setVar('layout', 'form');
             break;
         case 'config':
             JRequest::setVar('layout', 'config');
             break;
     }
     if ($user->id == 0) {
         JError::raiseWarning(1001, JText::_("YOU_MUST_BE_SIGNED_IN"));
         $this->setRedirect(JRoute::_("index.php?option=com_user&view=login"));
         return;
     }
     parent::display();
 }
Exemplo n.º 2
0
 /**
  * upload file to local repository.
  * The local repository will be used to upgrade extensions via Local Service.
  *
  */
 function doUpload()
 {
     $model = $this->getModel('uploader');
     $result = $model->upload();
     JRequest::setVar('uploadResult', $result, 'post');
     JRequest::setVar('layout', 'uploader');
     parent::display();
 }