当前位置: 首页>>代码示例>>PHP>>正文


PHP Helper_Admin::initACL方法代码示例

本文整理汇总了PHP中Helper_Admin::initACL方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper_Admin::initACL方法的具体用法?PHP Helper_Admin::initACL怎么用?PHP Helper_Admin::initACL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Helper_Admin的用法示例。


在下文中一共展示了Helper_Admin::initACL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: clearACL

 public function clearACL($pks)
 {
     require_once JPATH_COMPONENT . '/helpers/helper_admin.php';
     if (count($pks)) {
         return Helper_Admin::initACL(array('table' => 'folder', 'name' => 'folder', 'rules' => '{"core.create":[],"core.delete":[],"core.edit":[],"core.edit.state":[],"core.edit.own":[]}'), $pks);
     }
     return false;
 }
开发者ID:hamby,项目名称:SEBLOD,代码行数:8,代码来源:folder.php

示例2: postflight


//.........这里部分代码省略.........
             $table->bind($category);
             $rules = new JAccessRules('{"core.create":{"1":0},"core.delete":[],"core.edit":[],"core.edit.state":[],"core.edit.own":[]}');
             $table->setRules($rules);
             $table->check();
             $table->extension = 'com_content';
             $table->path .= $table->alias;
             $table->language = '*';
             $table->store();
             $dispatcher = JDispatcher::getInstance();
             JPluginHelper::importPlugin('content');
             $dispatcher->trigger('onContentBeforeSave', array('', &$table, true));
             $table->store();
             $dispatcher->trigger('onContentAfterSave', array('', &$table, true));
             //
             $query = 'SELECT extension_id as id, params FROM #__extensions WHERE type="plugin" AND folder="cck_storage_location" AND element="' . $category['plg_name'] . '"';
             $db->setQuery($query);
             $plugin = $db->loadObject();
             $params = str_replace('"bridge_default-catid":"2"', '"bridge_default-catid":"' . $table->id . '"', $plugin->params);
             $query = 'UPDATE #__extensions SET params = "' . $db->escape($params) . '" WHERE extension_id = ' . (int) $plugin->id;
             $db->setQuery($query);
             $db->execute();
         }
         // Init Default Author
         $res = JCckDatabase::loadResult('SELECT id FROM #__users ORDER BY id ASC');
         $params = JComponentHelper::getParams('com_cck');
         $params->set('integration_user_default_author', (int) $res);
         $db->setQuery('UPDATE #__extensions SET params = "' . $db->escape($params) . '" WHERE name = "com_cck"');
         $db->execute();
         // Init ACL
         require_once JPATH_ADMINISTRATOR . '/components/com_cck/helpers/helper_admin.php';
         $pks = JCckDatabase::loadColumn('SELECT id FROM #__cck_core_folders ORDER BY lft');
         if (count($pks)) {
             $rules = '{"core.create":[],"core.delete":[],"core.delete.own":[],"core.edit":[],"core.edit.state":[],"core.edit.own":[]}';
             Helper_Admin::initACL(array('table' => 'folder', 'name' => 'folder', 'rules' => $rules), $pks);
         }
         $pks = JCckDatabase::loadColumn('SELECT id FROM #__cck_core_types ORDER BY id');
         if (count($pks)) {
             $rules = '{"core.create":[],"core.create.max.parent":{"8":0},"core.create.max.parent.author":{"8":0},"core.create.max.author":{"8":0},' . '"core.delete":[],"core.delete.own":[],"core.edit":[],"core.edit.own":[]}';
             $rules2 = array(8 => '{"core.create":{"1":1,"2":0},"core.create.max.parent":{"8":0},"core.create.max.parent.author":{"8":0},"core.create.max.author":{"8":0},' . '"core.delete":[],"core.delete.own":[],"core.edit":{"4":0},"core.edit.own":{"2":1}}');
             Helper_Admin::initACL(array('table' => 'type', 'name' => 'form', 'rules' => $rules), $pks, $rules2);
         }
     } else {
         $new = $app->cck_core_version;
         $old = $app->cck_core_version_old;
         $root = JPATH_ADMINISTRATOR . '/components/com_cck';
         require_once JPATH_ADMINISTRATOR . '/components/' . CCK_COM . '/helpers/helper_folder.php';
         // ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** //
         $versions = array(0 => '2.0.0', 1 => '2.0.0.RC2', 2 => '2.0.0.RC2-1', 3 => '2.0.0.RC2-2', 4 => '2.0.0.RC2-3', 5 => '2.0.0.RC3', 6 => '2.0.0.RC4', 7 => '2.0.0.GA', 8 => '2.0.5', 9 => '2.0.6', 10 => '2.0.7', 11 => '2.1.0', 12 => '2.1.5', 13 => '2.2.0', 14 => '2.2.5', 15 => '2.3.0', 16 => '2.3.1', 17 => '2.3.5', 18 => '2.3.6', 19 => '2.3.7', 20 => '2.3.8', 21 => '2.3.9', 22 => '2.3.9.2', 23 => '2.4.5', 24 => '2.4.6', 25 => '2.4.7', 26 => '2.4.8', 27 => '2.4.8.5', 28 => '2.4.9', 29 => '2.4.9.1', 30 => '2.4.9.2', 31 => '2.4.9.5', 32 => '2.4.9.6', 33 => '2.4.9.7', 34 => '2.4.9.8', 35 => '2.5.0', 36 => '2.5.1', 37 => '2.5.2', 38 => '2.6.0', 39 => '2.7.0', 40 => '2.8.0', 41 => '2.9.0', 42 => '3.0.0', 43 => '3.0.1', 44 => '3.0.2', 45 => '3.0.3', 46 => '3.0.4', 47 => '3.0.5', 48 => '3.1.0', 49 => '3.1.1', 50 => '3.1.2', 51 => '3.1.3', 52 => '3.1.4', 53 => '3.1.5', 54 => '3.2.0', 55 => '3.2.1', 56 => '3.2.2', 57 => '3.3.0', 58 => '3.3.1', 59 => '3.3.2', 60 => '3.3.3', 61 => '3.3.4', 62 => '3.3.5', 63 => '3.3.6', 64 => '3.3.7', 65 => '3.3.8', 66 => '3.4.0', 67 => '3.4.1', 68 => '3.4.2', 69 => '3.4.3', 70 => '3.5.0', 71 => '3.5.1', 72 => '3.6.0', 73 => '3.6.1', 74 => '3.6.2', 75 => '3.6.3', 76 => '3.6.4', 77 => '3.6.5', 78 => '3.7.0', 79 => '3.7.1', 80 => '3.7.2', 81 => '3.7.3', 82 => '3.7.4', 83 => '3.7.5', 82 => '3.8.0');
         // ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** //
         $i = array_search($old, $versions);
         $i2 = $i;
         $n = array_search($new, $versions);
         if ($i < 7) {
             // ONLY < 2.0 GA
             $prefix = JFactory::getConfig()->get('dbprefix');
             $tables = JCckDatabase::loadColumn('SHOW TABLES');
             if (count($tables)) {
                 foreach ($tables as $table) {
                     if (strpos($table, $prefix . 'cck_item_') !== false) {
                         $replace = str_replace($prefix . 'cck_item_', $prefix . 'cck_store_item_', $table);
                         if ($replace) {
                             JCckDatabase::doQuery('ALTER TABLE ' . $table . ' RENAME ' . $replace);
                         }
                     } elseif (strpos($table, $prefix . 'cck_type_') !== false) {
                         $replace = str_replace($prefix . 'cck_type_', $prefix . 'cck_store_form_', $table);
                         if ($replace) {
开发者ID:kolydart,项目名称:SEBLOD,代码行数:67,代码来源:script.php


注:本文中的Helper_Admin::initACL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。