10 defined(
'JPATH_PLATFORM') or die;
30 parent::__construct(
'#__modules',
'id', $db);
44 protected function _getAssetName()
48 return 'com_modules.module.' . (int) $this->$k;
58 protected function _getAssetTitle()
73 protected function _getAssetParentId(JTable $table = null, $id = null)
78 if ($assetId === null)
81 $query = $this->_db->getQuery(
true)
82 ->select($this->_db->quoteName(
'id'))
83 ->from($this->_db->quoteName(
'#__assets'))
84 ->where($this->_db->quoteName(
'name') .
' = ' . $this->_db->quote(
'com_modules'));
87 $this->_db->setQuery($query);
89 if ($result = $this->_db->loadResult())
91 $assetId = (int) $result;
102 return parent::_getAssetParentId($table, $id);
114 public function check()
117 if (trim($this->title) ==
'')
119 $this->setError(
JText::_(
'JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_MODULE'));
125 if ((
int) $this->publish_down > 0 && $this->publish_down < $this->publish_up)
128 $temp = $this->publish_up;
129 $this->publish_up = $this->publish_down;
130 $this->publish_down = $temp;
147 public function bind($array, $ignore =
'')
149 if (isset($array[
'params']) && is_array($array[
'params']))
153 $array[
'params'] = (string) $registry;
157 if (isset($array[
'rules']) && is_array($array[
'rules']))
160 $this->setRules($rules);
163 return parent::bind($array, $ignore);