/** * Constructor * * @since 1.5 */ function __construct($config = array()) { parent::__construct(); if (isset($config['table_filename'])) { $this->tableFileName = $config['table_filename']; } else { $this->getTableFilename(); } if (isset($config['table_name'])) { $this->tableName = $config['table_name']; } else { $this->tableName = $this->_db->getPrefix() . strtolower(OSF_TABLE_PREFIX . '_' . OSInflector::pluralize($this->getName())); } $array = JRequest::getVar('cid', array(0), '', 'array'); $edit = JRequest::getVar('edit', true); if ($edit) { $this->setId((int) $array[0]); } }
/** * Unpublish entities * */ function unpublish() { $cid = JRequest::getVar('cid', array(), 'post'); JArrayHelper::toInteger($cid); $model =& $this->getModel($this->entityName); $ret = $model->publish($cid, 0); if ($ret) { $msg = JText::_($this->langPrefix . '_' . OSInflector::pluralize($this->entityName) . '_UNPUBLISHED'); } else { $msg = JText::_($this->langPrefix . '_' . OSInflector::pluralize($this->entityName) . '_UNPUBLISH_ERROR'); } $this->setRedirect($this->viewListUrl, $msg); }