layout = 'edit'; // Register Extra tasks //$this->registerTask( 'add' , 'eidt' ); //$view = JFactory::getApplication()->input->get( 'view' ); } //public function display() { //$this->setRedirect(JRoute::_('index.php?option='.$this->option.'&view='.$this->view_list.'&layout='.$this->layout, false)); //} protected function allowAdd($data = array()) { $user = Factory::getUser(); $allow = null; $allow = $user->authorise('core.create', 'com_phocagallery'); if ($allow === null) { return parent::allowAdd($data); } else { return $allow; } } protected function allowEdit($data = array(), $key = 'id') { $user = Factory::getUser(); $allow = null; $allow = $user->authorise('core.edit', 'com_phocagallery'); if ($allow === null) { return parent::allowEdit($data, $key); } else { return $allow; } } /* function save() { Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); $post = Factory::getApplication()->input->get('post'); //$data = JFactory::getApplication()->input->get('jform', array(0), 'post', 'array'); $data = $app->input->post->get('jform', array(), 'array'); if(isset($post['foldercid'])) { $data['foldercid'] = $post['foldercid']; } if(isset($post['cid'])) { $data['cid'] = $post['cid']; } $model = $this->getModel( 'phocagallerym' ); if ($model->save($data)) { $msg = Text::_( 'COM_PHOCAGALLERY_SUCCESS_SAVE_MULTIPLE' ); } else { $msg = Text::_( 'COM_PHOCAGALLERY_ERROR_SAVE_MULTIPLE' ); } $link = 'index.php?option=com_phocagallery&view=phocagalleryimgs'; $this->setRedirect($link, $msg); }*/ function edit($key = NULL, $urlVar = NULL) { //JFactory::getApplication()->input->set( 'view', 'phocagallerym' ); //JFactory::getApplication()->input->set( 'layout', 'Edit' ); //JFactory::getApplication()->input->set( 'hidemainmenu', 1 ); //PhocaGalleryCpControllerPhocaGalleryM::display(); $this->setRedirect(Route::_('index.php?option='.$this->option.'&view='.$this->view_list.'&layout='.$this->layout, false)); } function cancel($key = NULL) { // Checkin the Phoca Gallery //$model = $this->getModel( 'phocagallery' ); //$model->checkin(); $this->setRedirect( 'index.php?option=com_phocagallery&view=phocagalleryimgs' ); } } ?>