Current Path :
/
home
/
develito
/
www
/
administrator
/
components
/
com_abook
/
models
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/develito/www/administrator/components/com_abook/models/editor.php
<?php /** * @package Joomla * @subpackage Abook * @copyright (C) 2010-2019 Federica Ugolotti * @license GNU/GPL, see LICENSE.php * Abook is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License 3 * as published by the Free Software Foundation. * Abook is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with Abook; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ defined( '_JEXEC' ) or die( 'Restricted access' ); jimport('joomla.application.component.modeladmin'); class AbookModelEditor extends JModelAdmin { protected $text_prefix = 'COM_ABOOK'; protected function canDelete($record) { $user = JFactory::getUser(); if ($record->catid) { return $user->authorise('core.delete', 'com_abook.category.'.(int) $record->id); } else { return parent::canDelete($record); } } protected function canEditState($record) { $user = JFactory::getUser(); return $user->authorise('core.edit.state', 'com_abook.category.'.(int) $record->id); } public function getTable($type = 'Editor', $prefix = 'AbookTable', $config = array()) { return JTable::getInstance($type, $prefix, $config); } public function getForm($data = array(), $loadData = true) { $form = $this->loadForm('com_abook.editor', 'editor', array('control' => 'jform', 'load_data' => $loadData)); if (empty($form)) { return false; } return $form; } protected function loadFormData() { // Check the session for previously entered form data. $data = JFactory::getApplication()->getUserState('com_abook.edit.editor.data', array()); if (empty($data)) { $data = $this->getItem(); } return $data; } }