本文整理汇总了PHP中iaCore::getCustomConfigTable方法的典型用法代码示例。如果您正苦于以下问题:PHP iaCore::getCustomConfigTable方法的具体用法?PHP iaCore::getCustomConfigTable怎么用?PHP iaCore::getCustomConfigTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iaCore
的用法示例。
在下文中一共展示了iaCore::getCustomConfigTable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getUsersSpecificConfig
private function _getUsersSpecificConfig()
{
$sql = 'SELECT c.`name`, c.`value` ' . 'FROM `:prefix:table_custom_config` c, `:prefix:table_members` m ' . "WHERE c.`type` = ':type' AND c.`type_id` = m.`usergroup_id` AND m.`id` = :id";
$sql = iaDb::printf($sql, array('prefix' => $this->_iaDb->prefix, 'table_custom_config' => iaCore::getCustomConfigTable(), 'table_members' => iaUsers::getTable(), 'id' => $this->_typeId));
return ($rows = $this->_iaDb->getKeyValue($sql)) ? $rows : array();
}
示例2: install
public function install($type = self::SETUP_REPLACE)
{
$iaDb =& $this->iaDb;
// TODO: check for relations and deactivate all needed extras
if ($this->_requires) {
$messages = array();
foreach ($this->_requires as $require) {
if ($require['min'] || $require['max']) {
$min = $max = false;
if (isset($extrasList[$require['name']])) {
$info = $extrasList[$require['name']];
$min = $require['min'] ? version_compare($require['min'], $info['version'], '<=') : true;
$max = $require['max'] ? version_compare($require['max'], $info['version'], '>=') : true;
}
if (!$max || !$min) {
$ver = '';
if ($require['min']) {
$ver .= $require['min'];
}
if ($require['max']) {
if ($require['min']) {
$ver .= '-';
}
$ver .= $require['max'];
}
$replace = array(':extra' => $require['type'], ':name' => $require['name'], ':version' => $ver);
$messages[] = iaLanguage::getf('required_template_error', $replace);
$this->error = true;
} else {
// TODO: add relations in database to deactivate when parent is uninstalled
}
}
}
if ($this->error) {
$this->_message = implode('<br>', $messages);
return false;
}
}
if (self::SETUP_REPLACE == $type) {
$template = $iaDb->one('value', "`name` = 'tmpl'", iaCore::getConfigTable());
$tablesList = array('hooks', 'blocks', iaLanguage::getTable(), 'pages', iaCore::getConfigTable(), iaCore::getConfigGroupsTable(), iaCore::getCustomConfigTable());
$iaDb->cascadeDelete($tablesList, "`extras` = '{$template}'");
$iaDb->cascadeDelete($tablesList, "`extras` = '{$this->name}'");
}
$iaDb->update(array('value' => $this->name), "`name` = 'tmpl'", null, iaCore::getConfigTable());
if ($this->_phrases) {
$this->_processPhrases();
}
if ($this->_config) {
$iaDb->setTable(iaCore::getConfigTable());
$maxOrder = $iaDb->one_bind('MAX(`order`) + 1', '`extras` = :extras', array('extras' => $this->name));
$maxOrder = $maxOrder ? (int) $maxOrder : 1;
foreach ($this->_config as $entry) {
$id = $this->iaDb->one(iaDb::ID_COLUMN_SELECTION, iaDb::convertIds($entry['name'], 'name'));
$entry['order'] = isset($entry['order']) ? $entry['order'] : ++$maxOrder;
if (!$id || empty($entry['name'])) {
$this->iaDb->insert($entry);
} elseif ($id) {
if (isset($entry['value'])) {
unset($entry['value']);
}
$this->iaDb->update($entry, iaDb::convertIds($id));
}
}
$iaDb->resetTable();
}
if ($this->_configGroups) {
$iaDb->setTable(iaCore::getConfigGroupsTable());
$maxOrder = $iaDb->getMaxOrder() + 1;
foreach ($this->_configGroups as $title => $entry) {
$iaDb->insert($entry, array('order' => $maxOrder));
$this->_addPhrase('config_group_' . $entry['name'], $title, iaLanguage::CATEGORY_ADMIN);
$maxOrder++;
}
$iaDb->resetTable();
}
if ($this->_hooks) {
$iaDb->setTable('hooks');
$maxOrder = $iaDb->one('MAX(`order`) + 1');
$maxOrder = $maxOrder ? $maxOrder : 1;
foreach ($this->_hooks as $hook) {
$array = explode(',', $hook['name']);
foreach ($array as $hookName) {
if (trim($hookName)) {
$hook['name'] = $hookName;
if (isset($hook['code']) && $hook['code']) {
$hook['code'] = str_replace('{extras}', $this->name, $hook['code']);
}
$iaDb->insert($hook, array('order' => $maxOrder));
$maxOrder++;
}
}
}
$iaDb->resetTable();
}
$positionsList = array();
if ($this->_positions) {
$positionPages = array();
$iaDb->setTable('positions');
$iaDb->truncate();
//.........这里部分代码省略.........
示例3: install
//.........这里部分代码省略.........
}
}
if ($this->itemData['hooks']) {
$iaDb->setTable('hooks');
$maxOrder = $iaDb->getMaxOrder();
foreach ($this->itemData['hooks'] as $hook) {
$array = explode(',', $hook['name']);
foreach ($array as $hookName) {
if (trim($hookName)) {
$hook['name'] = $hookName;
if (isset($hook['code']) && $hook['code']) {
$hook['code'] = str_replace('{extras}', $this->itemData['name'], $hook['code']);
}
$rawValues = array();
if (!isset($hook['order'])) {
$rawValues['order'] = ++$maxOrder;
}
$iaDb->insert($hook, $rawValues);
}
}
}
$iaDb->resetTable();
}
if ($this->itemData['usergroups']) {
$this->iaCore->factory('acl');
$iaDb->setTable(iaUsers::getUsergroupsTable());
foreach ($this->itemData['usergroups'] as $item) {
if (!$iaDb->exists('`name` = :name', array('name' => $item['name']))) {
$configs = $item['configs'];
$permissions = $item['permissions'];
$groupId = $iaDb->insert(array('extras' => $item['extras'], 'name' => $item['name'], 'system' => true, 'assignable' => $item['assignable'], 'visible' => $item['visible']));
// update language records
$this->_addPhrase('usergroup_' . $item['name'], $item['title']);
$iaDb->setTable(iaCore::getCustomConfigTable());
$iaDb->delete('`type` = :type AND `type_id` = :id', null, array('type' => iaAcl::GROUP, 'id' => $groupId));
foreach ($configs as $config) {
$data = array('name' => $config['name'], 'value' => $config['value'], 'type' => iaAcl::GROUP, 'type_id' => $groupId, 'extras' => $this->itemData['name']);
$iaDb->insert($data);
}
$iaDb->resetTable();
$iaDb->setTable('acl_privileges');
$iaDb->delete('`type` = :type AND `type_id` = :id', null, array('type' => iaAcl::GROUP, 'id' => $groupId));
foreach ($permissions as $permission) {
$data = array('object' => $permission['object'], 'object_id' => $permission['object_id'], 'action' => $permission['action'], 'access' => $permission['access'], 'type' => iaAcl::GROUP, 'type_id' => $groupId, 'extras' => $permission['extras']);
$iaDb->insert($data);
}
$iaDb->resetTable();
}
}
$iaDb->resetTable();
}
$extraEntry = array_merge($this->itemData['info'], array('name' => $this->itemData['name'], 'type' => $this->itemData['type']));
unset($extraEntry['date']);
if ($this->itemData['sql']['uninstall']) {
$extraEntry['uninstall_sql'] = serialize($this->itemData['sql']['uninstall']);
}
if ($this->itemData['code']['uninstall']) {
$extraEntry['uninstall_code'] = $this->itemData['code']['uninstall'];
}
if ($this->itemData['sql']['install']) {
$this->_processQueries($this->itemData['sql']['install']);
}
if (self::TYPE_PACKAGE == $this->itemData['type']) {
$extraEntry['url'] = $this->_url;
}
if ($this->itemData['items']) {
示例4: install
//.........这里部分代码省略.........
}
}
if ($this->itemData['hooks']) {
$iaDb->setTable('hooks');
$maxOrder = $iaDb->getMaxOrder();
foreach ($this->itemData['hooks'] as $hook) {
$array = explode(',', $hook['name']);
foreach ($array as $hookName) {
if (trim($hookName)) {
$hook['name'] = $hookName;
if (isset($hook['code']) && $hook['code']) {
$hook['code'] = str_replace('{extras}', $this->itemData['name'], $hook['code']);
}
$rawValues = array();
if (!isset($hook['order'])) {
$rawValues['order'] = ++$maxOrder;
}
$iaDb->insert($hook, $rawValues);
}
}
}
$iaDb->resetTable();
}
if ($this->itemData['usergroups']) {
$this->iaCore->factory('acl');
$iaDb->setTable(iaUsers::getUsergroupsTable());
foreach ($this->itemData['usergroups'] as $item) {
if (!$iaDb->exists('`name` = :name', array('name' => $item['name']))) {
$configs = $item['configs'];
$permissions = $item['permissions'];
$groupId = $iaDb->insert(array('extras' => $item['extras'], 'name' => $item['name'], 'system' => true, 'assignable' => $item['assignable'], 'visible' => $item['visible']));
// update language records
$this->_addPhrase('usergroup_' . $item['name'], $item['title']);
$iaDb->setTable(iaCore::getCustomConfigTable());
$iaDb->delete('`type` = :type AND `type_id` = :id', null, array('type' => iaAcl::GROUP, 'id' => $groupId));
foreach ($configs as $config) {
$data = array('name' => $config['name'], 'value' => $config['value'], 'type' => iaAcl::GROUP, 'type_id' => $groupId, 'extras' => $this->itemData['name']);
$iaDb->insert($data);
}
$iaDb->resetTable();
$iaDb->setTable('acl_privileges');
$iaDb->delete('`type` = :type AND `type_id` = :id', null, array('type' => iaAcl::GROUP, 'id' => $groupId));
foreach ($permissions as $permission) {
$data = array('object' => $permission['object'], 'object_id' => $permission['object_id'], 'action' => $permission['action'], 'access' => $permission['access'], 'type' => iaAcl::GROUP, 'type_id' => $groupId, 'extras' => $permission['extras']);
$iaDb->insert($data);
}
$iaDb->resetTable();
}
}
$iaDb->resetTable();
}
$extraEntry = array_merge($this->itemData['info'], array('name' => $this->itemData['name'], 'type' => $this->itemData['type']));
unset($extraEntry['date']);
if ($this->itemData['sql']['uninstall']) {
$extraEntry['uninstall_sql'] = serialize($this->itemData['sql']['uninstall']);
}
if ($this->itemData['code']['uninstall']) {
$extraEntry['uninstall_code'] = $this->itemData['code']['uninstall'];
}
$this->_processQueries('install', self::SQL_STAGE_MIDDLE);
if (self::TYPE_PACKAGE == $this->itemData['type']) {
$extraEntry['url'] = $this->_url;
}
if ($this->itemData['items']) {
$extraEntry['items'] = serialize($this->itemData['items']);
$iaDb->setTable('items');