本文整理汇总了PHP中JCckDevHelper::getRules方法的典型用法代码示例。如果您正苦于以下问题:PHP JCckDevHelper::getRules方法的具体用法?PHP JCckDevHelper::getRules怎么用?PHP JCckDevHelper::getRules使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JCckDevHelper
的用法示例。
在下文中一共展示了JCckDevHelper::getRules方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareTable2
protected function prepareTable2(&$table, &$data)
{
if (is_array($data['elements'])) {
$data['elements'] = implode(',', $data['elements']);
} else {
$data['elements'] = '';
}
if (!$data['jform']['id'] && !$data['jform']['rules']) {
$data['jform']['rules'] = array('core.create' => array(), 'core.delete' => array(), 'core.delete.own' => array(), 'core.edit' => array(), 'core.edit.state' => array(), 'core.edit.own' => array());
}
if ($data['jform']['rules']) {
if (!is_array($data['jform']['rules'])) {
$data['jform']['rules'] = json_decode($data['jform']['rules']);
}
$rules = new JAccessRules(JCckDevHelper::getRules($data['jform']['rules']));
$table->setRules($rules);
}
}
示例2: _core
protected function _core($data, &$config = array(), $pk = 0)
{
if (!$config['id']) {
$isNew = true;
$config['id'] = parent::g_onCCK_Storage_LocationPrepareStore();
} else {
$isNew = false;
}
// Init
$table = self::_getTable($pk);
$isNew = $pk > 0 ? false : true;
if (isset($table->tags)) {
$tags = $table->tags;
unset($table->tags);
} else {
$tags = null;
}
if (isset($data['tags'])) {
if (!empty($data['tags']) && $data['tags'][0] != '') {
$table->newTags = $data['tags'];
}
unset($data['tags']);
}
self::_initTable($table, $data, $config);
// Check Error
if (self::$error === true) {
return false;
}
// Prepare
if (is_array($data)) {
$table->bind($data);
}
if ($isNew && !isset($data['rules'])) {
$data['rules'] = array('core.create' => array(), 'core.delete' => array(), 'core.edit' => array(), 'core.edit.state' => array(), 'core.edit.own' => array());
}
if (isset($data['rules']) && $data['rules']) {
if (!is_array($data['rules'])) {
$data['rules'] = json_decode($data['rules']);
}
$rules = new JAccessRules(JCckDevHelper::getRules($data['rules']));
$table->setRules($rules);
}
$table->check();
self::_completeTable($table, $data, $config);
// Store
$dispatcher = JDispatcher::getInstance();
JPluginHelper::importPlugin('content');
$dispatcher->trigger('onContentBeforeSave', array(self::$context, &$table, $isNew));
if ($isNew === true && parent::g_isMax($table->{self::$author}, $table->{self::$parent}, $config)) {
return;
}
if (!$table->store()) {
JFactory::getApplication()->enqueueMessage($table->getError(), 'error');
if ($isNew) {
parent::g_onCCK_Storage_LocationRollback($config['id']);
}
return false;
}
// Checkin
parent::g_checkIn($table);
self::$pk = $table->{self::$key};
if (!$config['pk']) {
$config['pk'] = self::$pk;
}
$config['author'] = $table->{self::$author};
$config['parent'] = $table->{self::$parent};
parent::g_onCCK_Storage_LocationStore($data, self::$table, self::$pk, $config);
$dispatcher->trigger('onContentAfterSave', array(self::$context, &$table, $isNew));
// Associations
// todo
}
示例3: prepareTable2
protected function prepareTable2(&$table, &$data)
{
if (!$data['jform']['id'] && !$data['jform']['rules']) {
$data['jform']['rules'] = array('core.create' => array(), 'core.create.max.parent' => array('8' => "0"), 'core.create.max.parent.author' => array('8' => "0"), 'core.create.max.author' => array('8' => "0"), 'core.delete' => array(), 'core.delete.own' => array(), 'core.edit' => array(), 'core.edit.own' => array());
}
if ($data['jform']['rules']) {
if (!is_array($data['jform']['rules'])) {
$data['jform']['rules'] = json_decode($data['jform']['rules']);
}
jimport('cck.joomla.access.access');
$rules = new CCKRules(JCckDevHelper::getRules($data['jform']['rules']), 'com_cck', 'form');
$table->setRules($rules);
}
}