move_module() публичный Метод

Move module around the tree
public move_module ( $from_module_id, $to_parent_id )
Пример #1
0
    public function move_prune_users_module()
    {
        $sql = 'SELECT module_id
			FROM ' . MODULES_TABLE . "\n\t\t\tWHERE module_class = 'acp'\n\t\t\t\tAND module_basename = 'acp_prune'\n\t\t\t\tAND module_mode = 'users'";
        $result = $this->db->sql_query($sql);
        $acp_prune_users_id = (int) $this->db->sql_fetchfield('module_id');
        $this->db->sql_freeresult($result);
        $sql = 'SELECT module_id
			FROM ' . MODULES_TABLE . "\n\t\t\tWHERE module_class = 'acp'\n\t\t\t\tAND module_langname = 'ACP_CAT_USERS'";
        $result = $this->db->sql_query($sql);
        $acp_cat_users_id = (int) $this->db->sql_fetchfield('module_id');
        $this->db->sql_freeresult($result);
        if (!class_exists('\\acp_modules')) {
            include $this->src_root_path . 'includes/acp/acp_modules.' . $this->php_ext;
        }
        $module_manager = new \acp_modules();
        $module_manager->module_class = 'acp';
        $module_manager->move_module($acp_prune_users_id, $acp_cat_users_id);
    }
Пример #2
0
 public function move_customise_modules()
 {
     // Move language management to new location in the Customise tab
     // First get language module id
     $sql = 'SELECT module_id FROM ' . MODULES_TABLE . "\n\t\t\tWHERE module_basename = 'acp_language'";
     $result = $this->db->sql_query($sql);
     $language_module_id = $this->db->sql_fetchfield('module_id');
     $this->db->sql_freeresult($result);
     // Next get language management module id of the one just created
     $sql = 'SELECT module_id FROM ' . MODULES_TABLE . "\n\t\t\tWHERE module_langname = 'ACP_LANGUAGE'";
     $result = $this->db->sql_query($sql);
     $language_management_module_id = $this->db->sql_fetchfield('module_id');
     $this->db->sql_freeresult($result);
     if (!class_exists('acp_modules')) {
         include $this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext;
     }
     // acp_modules calls adm_back_link, which is undefined at this point
     if (!function_exists('adm_back_link')) {
         include $this->phpbb_root_path . 'includes/functions_acp.' . $this->php_ext;
     }
     $module_manager = new \acp_modules();
     $module_manager->module_class = 'acp';
     $module_manager->move_module($language_module_id, $language_management_module_id);
 }