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


PHP admin_tools::SaveAllConfig方法代码示例

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


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

示例1: Install_Step3

 function Install_Step3()
 {
     global $langmessage, $config;
     if (empty($this->install_folder_name)) {
         message($langmessage['OOPS']);
         return false;
     }
     if ($this->upgrade_key && !$this->developer_mode) {
         if (!file_exists($this->install_folder_path)) {
             message($langmessage['OOPS']);
             return false;
         }
         if (empty($this->temp_folder_name) || !file_exists($this->temp_folder_path)) {
             message($langmessage['OOPS']);
             return false;
         }
     }
     $old_config = $config;
     $this->Step3_Links();
     if (!isset($this->config[$this->install_folder_name])) {
         $this->config[$this->install_folder_name] = array();
     }
     echo '<p>';
     echo 'Saving Settings';
     echo '</p>';
     //general configuration
     $this->UpdateConfigInfo('Addon_Name', 'name');
     $this->UpdateConfigInfo('Addon_Version', 'version');
     $this->UpdateConfigInfo('Addon_Unique_ID', 'id');
     $this->UpdateConfigInfo('Addon_Unique_ID', 'id');
     //proof of purchase
     $order = false;
     if (isset($this->ini_contents['Proof of Purchase']) && isset($this->ini_contents['Proof of Purchase']['order'])) {
         $order = $this->ini_contents['Proof of Purchase']['order'];
         $this->config[$this->install_folder_name]['order'] = $order;
     } else {
         // don't delete any purchase id's
         // unset($this->config[$this->install_folder_name]['order']);
     }
     if ($this->can_install_links) {
         $this->UpdateConfigInfo('editable_text', 'editable_text');
         $this->UpdateConfigInfo('html_head', 'html_head');
     }
     if (!$this->Step3_Folders()) {
         message($langmessage['OOPS']);
         $config = $old_config;
         return false;
     }
     if (!admin_tools::SaveAllConfig()) {
         message($langmessage['OOPS']);
         $config = $old_config;
         return false;
     }
     // History
     $history = array();
     $history['name'] = $this->config[$this->install_folder_name]['name'];
     $history['action'] = 'installed';
     if (isset($this->config[$this->install_folder_name]['id'])) {
         $history['id'] = $this->config[$this->install_folder_name]['id'];
     }
     $history['time'] = time();
     $this->addonHistory[] = $history;
     $this->SaveAddonData();
     if ($order) {
         $img_path = common::IdUrl('ci');
         common::IdReq($img_path);
     }
     //completed install, clean up /data/_addoncode/ folder
     $this->CleanInstallFolder();
     return true;
 }
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:71,代码来源:admin_addon_install.php

示例2: DeleteTheme

 /**
  * Delete a remote theme
  *
  */
 function DeleteTheme()
 {
     global $langmessage, $dataDir, $gpLayouts, $config;
     $config_before = $config;
     $gpLayoutsBefore = $gpLayouts;
     $theme_folder_name =& $_POST['folder'];
     $theme_folder = $dataDir . '/data/_themes/' . $theme_folder_name;
     if (empty($theme_folder_name) || !ctype_alnum($theme_folder_name)) {
         message($langmessage['OOPS'] . ' (Invalid Request)');
         return false;
     }
     $order = false;
     if (isset($config['themes'][$theme_folder_name]['order'])) {
         $order = $config['themes'][$theme_folder_name]['order'];
     }
     if (!$this->CanDeleteTheme($theme_folder_name, $message)) {
         message($message);
         return false;
     }
     //remove layouts
     $rm_addon = false;
     foreach ($gpLayouts as $layout_id => $layout_info) {
         if (!isset($layout_info['is_addon']) || !$layout_info['is_addon']) {
             continue;
         }
         $layout_folder = dirname($layout_info['theme']);
         if ($layout_folder != $theme_folder_name) {
             continue;
         }
         if (array_key_exists('addon_key', $layout_info)) {
             $rm_addon = $layout_info['addon_key'];
         }
         $this->RmLayoutPrep($layout_id);
         unset($gpLayouts[$layout_id]);
     }
     //remove from settings
     unset($config['themes'][$theme_folder_name]);
     if ($rm_addon) {
         includeFile('admin/admin_addon_installer.php');
         $installer = new admin_addon_installer();
         if (!$installer->Uninstall($rm_addon)) {
             $gpLayouts = $gpLayoutsBefore;
         }
         $installer->OutputMessages();
     } else {
         if (!admin_tools::SaveAllConfig()) {
             $config = $config_before;
             $gpLayouts = $gpLayoutsBefore;
             message($langmessage['OOPS'] . ' (s1)');
             return false;
         }
         message($langmessage['SAVED']);
         if ($order) {
             $img_path = common::IdUrl('ci');
             common::IdReq($img_path);
         }
     }
     //delete the folder if it hasn't already been deleted by admin_addon_installer
     $dir = $dataDir . '/data/_themes/' . $theme_folder_name;
     if (file_exists($dir)) {
         gpFiles::RmAll($dir);
     }
 }
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:67,代码来源:admin_theme_content.php

示例3: Confirm_Uninstall

 function Confirm_Uninstall()
 {
     global $config, $langmessage, $dataDir, $gp_titles, $gp_menu, $gp_index;
     $addon =& $_POST['addon'];
     if (!isset($config['addons'][$addon])) {
         message($langmessage['OOPS']);
         return;
     }
     $order = false;
     if (isset($config['addons'][$addon]['order'])) {
         $order = $config['addons'][$addon]['order'];
     }
     //tracking
     $history = array();
     $history['name'] = $config['addons'][$addon]['name'];
     $history['action'] = 'uninstalled';
     if (isset($config['addons'][$addon]['id'])) {
         $history['id'] = $config['addons'][$addon]['id'];
     }
     unset($config['addons'][$addon]);
     //remove links
     $installedGadgets = $this->GetInstalledComponents($config['gadgets'], $addon);
     $this->RemoveFromHandlers($installedGadgets);
     //remove from gp_index, gp_menu
     $installedLinks = $this->GetInstalledComponents($gp_titles, $addon);
     foreach ($installedLinks as $index) {
         if (isset($gp_menu[$index])) {
             unset($gp_menu[$index]);
         }
         $title = common::IndexToTitle($index);
         if ($title) {
             unset($gp_index[$title]);
         }
     }
     $this->RemoveFromConfig($config['gadgets'], $addon);
     $this->RemoveFromConfig($config['admin_links'], $addon);
     $this->RemoveFromConfig($gp_titles, $addon);
     $this->CleanHooks($addon);
     if (!admin_tools::SaveAllConfig()) {
         message($langmessage['OOPS']);
         $this->Uninstall();
         return false;
     }
     /*
      * Delete the data folders
      */
     $installFolder = $dataDir . '/data/_addoncode/' . $addon;
     if (file_exists($installFolder)) {
         gpFiles::RmAll($installFolder);
     }
     $data_folder_name = gpPlugin::GetDataFolder($addon);
     $dataFolder = $dataDir . '/data/_addondata/' . $data_folder_name;
     if (file_exists($dataFolder)) {
         gpFiles::RmAll($dataFolder);
     }
     /*
      * Record the history
      */
     $history['time'] = time();
     $this->addonHistory[] = $history;
     $this->SaveAddonData();
     if ($order) {
         $img_path = common::IdUrl('ci');
         common::IdReq($img_path);
     }
     message($langmessage['SAVED']);
 }
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:67,代码来源:admin_addons.php

示例4: DeleteThemeConfirmed

 /**
  * Finalize theme removal
  *
  */
 function DeleteThemeConfirmed()
 {
     global $langmessage, $dataDir, $gpLayouts, $config;
     $gpLayoutsBefore = $gpLayouts;
     $can_delete = true;
     $theme_folder_name =& $_POST['folder'];
     $theme_folder = $dataDir . '/data/_themes/' . $theme_folder_name;
     if (empty($theme_folder_name) || !ctype_alnum($theme_folder_name) || !isset($config['themes'][$theme_folder_name])) {
         message($langmessage['OOPS']);
         return false;
     }
     $order = false;
     if (isset($config['themes'][$theme_folder_name]['order'])) {
         $order = $config['themes'][$theme_folder_name]['order'];
     }
     if (!$this->CanDeleteTheme($theme_folder_name, $message)) {
         message($message);
         return false;
     }
     //remove layouts
     foreach ($gpLayouts as $layout_id => $layout_info) {
         if (!isset($layout_info['is_addon']) || !$layout_info['is_addon']) {
             continue;
         }
         $layout_folder = dirname($layout_info['theme']);
         if ($layout_folder == $theme_folder_name) {
             $this->RmLayout($layout_id);
         }
     }
     //delete the folder
     $dir = $dataDir . '/data/_themes/' . $theme_folder_name;
     gpFiles::RmAll($dir);
     //remove from settings
     unset($config['themes'][$theme_folder_name]);
     if (admin_tools::SaveAllConfig()) {
         message($langmessage['SAVED']);
         if ($order) {
             $img_path = common::IdUrl('ci');
             common::IdReq($img_path);
         }
     } else {
         $gpLayouts = $gpLayoutsBefore;
         message($langmessage['OOPS'] . ' (s1)');
     }
 }
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:49,代码来源:admin_theme_content.php

示例5: MoveToTrash

 /**
  * Move To Trash
  * Hide special pages
  *
  */
 function MoveToTrash($cmd)
 {
     global $gp_titles, $gp_index, $langmessage, $gp_menu;
     includeFile('admin/admin_trash.php');
     admin_trash::PrepFolder();
     $this->CacheSettings();
     $_POST += array('index' => '');
     $indexes = explode(',', $_POST['index']);
     foreach ($indexes as $index) {
         $title = common::IndexToTitle($index);
         // Create file in trash
         if ($title) {
             if (!admin_trash::MoveToTrash_File($title, $index, $trash_data)) {
                 message($langmessage['OOPS']);
                 $this->RestoreSettings();
                 return false;
             }
         }
         // Remove from menu
         if (isset($gp_menu[$index])) {
             if (count($gp_menu) == 1) {
                 continue;
             }
             if (!$this->RmFromMenu($index, false)) {
                 message($langmessage['OOPS']);
                 $this->RestoreSettings();
                 return false;
             }
         }
         unset($gp_titles[$index]);
         unset($gp_index[$title]);
     }
     $this->ResetHomepage();
     if (!admin_trash::ModTrashData($trash_data, null)) {
         message($langmessage['OOPS']);
         $this->RestoreSettings();
         return false;
     }
     if (!admin_tools::SaveAllConfig()) {
         $this->RestoreSettings();
         return false;
     }
     if ($cmd == 'trash_page') {
         $link = common::GetUrl('Admin_Trash');
         message(sprintf($langmessage['MOVED_TO_TRASH'], $link));
     }
     //finally, delete the files in /_pages
     foreach ($indexes as $index) {
         $title = common::IndexToTitle($index);
         if (!$title) {
             continue;
         }
         $file = gpFiles::PageFile($title);
         if (gpFiles::Exists($file)) {
             unlink($file);
         }
     }
     return true;
 }
开发者ID:GedionChang,项目名称:gpEasy-CMS,代码行数:64,代码来源:admin_menu_new.php

示例6: InstallSteps

 /**
  * Run through the installation process
  *
  */
 function InstallSteps()
 {
     global $dataDir;
     $this->GetAddonData();
     // addonHistory
     $this->Init_PT();
     // $this->config
     //get from remote
     if ($this->remote_install && !$this->GetRemote()) {
         return false;
     }
     //check ini contents
     $this->display_name = basename($this->source);
     if (!$this->GetINI($this->source, $error)) {
         //local themes don't need addon.ini files
         if (empty($this->new_layout)) {
             $this->message($error);
             return false;
         }
     }
     // upgrade/destination
     $this->upgrade_key = $this->config_key = admin_addons_tool::UpgradePath($this->ini_contents, $this->config_index);
     if ($this->remote_install) {
         if ($this->config_key) {
             $this->dest = $this->addon_folder . '/' . $this->config_key;
         } else {
             $this->dest = $this->TempFile();
         }
     } else {
         $this->dest = $this->source;
     }
     $this->dest_name = basename($this->dest);
     if (!$this->config_key) {
         $this->config_key = $this->dest_name;
     }
     //the data folder will not always be the same as the addon folder
     if (isset($this->config[$this->config_key]['data_folder'])) {
         $this->data_folder = $this->config[$this->config_key]['data_folder'];
     } elseif ($this->upgrade_key && file_exists($dataDir . '/data/_addondata/' . $this->upgrade_key)) {
         $this->data_folder = $this->upgrade_key;
     } else {
         $this->data_folder = $this->dest_name;
     }
     $this->IniContents();
     if (!$this->PrepConfig()) {
         return false;
     }
     if (!$this->CheckFile()) {
         return false;
     }
     //hooks
     if (!$this->Hooks()) {
         return false;
     }
     //layout
     if (!$this->Layout()) {
         return false;
     }
     //move new addon folder into place
     if (!$this->FinalizeFolder()) {
         return false;
     }
     if (!$this->FinalizeConfig()) {
         return false;
     }
     // Save
     if (!admin_tools::SaveAllConfig()) {
         $this->message($langmessage['OOPS'] . ' (Configuration not saved)');
         return false;
     }
     if ($this->order) {
         $img_path = common::IdUrl('ci');
         common::IdReq($img_path);
     }
     $this->UpdateHistory();
     return true;
 }
开发者ID:barbrick,项目名称:gpEasy-CMS,代码行数:81,代码来源:admin_addon_installer.php

示例7: MoveToTrash

 /**
  * Move To Trash
  * Hide special pages
  *
  */
 function MoveToTrash($cmd)
 {
     global $gp_titles, $gp_index, $langmessage, $gp_menu, $config, $dataDir;
     includeFile('admin/admin_trash.php');
     $this->CacheSettings();
     $_POST += array('index' => '');
     $indexes = explode(',', $_POST['index']);
     $trash_data = array();
     $delete_files = array();
     foreach ($indexes as $index) {
         $title = common::IndexToTitle($index);
         // Create file in trash
         if ($title) {
             if (!admin_trash::MoveToTrash_File($title, $index, $trash_data)) {
                 msg($langmessage['OOPS'] . ' (Not Moved)');
                 $this->RestoreSettings();
                 return false;
             }
         }
         // Remove from menu
         if (isset($gp_menu[$index])) {
             if (count($gp_menu) == 1) {
                 continue;
             }
             if (!$this->RmFromMenu($index, false)) {
                 msg($langmessage['OOPS']);
                 $this->RestoreSettings();
                 return false;
             }
         }
         unset($gp_titles[$index]);
         unset($gp_index[$title]);
     }
     $this->ResetHomepage();
     if (!admin_tools::SaveAllConfig()) {
         $this->RestoreSettings();
         return false;
     }
     $link = common::GetUrl('Admin_Trash');
     msg(sprintf($langmessage['MOVED_TO_TRASH'], $link));
     gpPlugin::Action('MenuPageTrashed', array($indexes));
     return true;
 }
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:48,代码来源:admin_menu_new.php


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