Current File : /home/pacjaorg/public_html/km/administrator/components/com_djcfimporter/models/group.php |
<?php
/**
* @version 1.0
* @package DJCF-Importer
* @subpackage DJCF-Importer Component
* @copyright Copyright (C) 2010 DJ-Extensions.com LTD, All rights reserved.
* @license http://www.gnu.org/licenses GNU/GPL
* @author url: http://design-joomla.eu
* @author email contact@design-joomla.eu
* @developer Łukasz Ciastek - lukasz.ciastek@design-joomla.eu
*
*
* DJCF-Importer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DJCF-Importer 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 DJCF-Importer. If not, see <http://www.gnu.org/licenses/>.
*
*/
defined('_JEXEC') or die('Restricted access');
//require_once(JPATH_COMPONENT_ADMINISTRATOR.DS.'lib'.DS.'modeladmin.php');
class DJCFImporterModelGroup extends JModelAdmin
{
protected $text_prefix = 'COM_DJCFIMPORTER';
protected $form_name = 'group';
public function __construct($config = array()) {
parent::__construct($config);
}
public function getTable($type = 'Groups', $prefix = 'DJCFImporterTable', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true)
{
// Initialise variables.
$app = JFactory::getApplication();
// Get the form.
$form = $this->loadForm('com_djcfimporter.'.$this->form_name, $this->form_name, array('control' => 'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
$data = JFactory::getApplication()->getUserState('com_djcfimporter.edit.'.$this->form_name.'.data', array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function _prepareTable(&$table)
{
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
}
protected function getReorderConditions($table = null)
{
$condition = array();
return $condition;
}
/*
public function delete(&$cid) {
if (count( $cid ))
{
$cids = implode(',', $cid);
$this->_db->setQuery("SELECT COUNT(*) FROM #__djrevs_rating_fields WHERE group_id IN ( ".$cids." )");
if ($this->_db->loadResult() > 0) {
$this->setError(JText::_('COM_DJREVIEWS_ERROR_RECORDS_HAVE_ITEMS_GROUP'));
return false;
}
}
return parent::delete($cid);
}
*/
}