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


PHP common::IdReq方法代码示例

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


在下文中一共展示了common::IdReq方法的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: CheckStatus

 static function CheckStatus()
 {
     switch (self::$update_status) {
         case 'embedcheck':
             $img_path = common::GetUrl('Admin', 'cmd=embededcheck');
             common::IdReq($img_path);
             break;
         case 'checkincompat':
             $img_path = common::IdUrl('ci');
             //check in
             common::IdReq($img_path);
             break;
     }
 }
开发者ID:Bomberus,项目名称:gpEasy-CMS,代码行数:14,代码来源:admin_tools.php

示例4: 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

示例5: 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

示例6: ErrorBuffer

 static function ErrorBuffer($check_user = true, $jquery = true)
 {
     global $wbErrorBuffer, $config, $dataDir, $rootDir;
     if (count($wbErrorBuffer) == 0) {
         return;
     }
     if (isset($config['Report_Errors']) && !$config['Report_Errors']) {
         return;
     }
     if ($check_user && !common::LoggedIn()) {
         return;
     }
     $dataDir_len = strlen($dataDir);
     $rootDir_len = strlen($rootDir);
     $img_path = common::IdUrl('er');
     $i = 0;
     foreach ($wbErrorBuffer as $error) {
         //remove $dataDir or $rootDir from the filename
         $file_name = common::WinPath($error['ef' . $i]);
         if ($dataDir_len > 1 && strpos($file_name, $dataDir) === 0) {
             $file_name = substr($file_name, $dataDir_len);
         } elseif ($rootDir_len > 1 && strpos($file_name, $rootDir) === 0) {
             $file_name = substr($file_name, $rootDir_len);
         }
         $error['ef' . $i] = substr($file_name, -100);
         $new_path = $img_path . '&' . http_build_query($error, '', '&');
         //maximum length of 2000 characters
         if (strlen($new_path) > 2000) {
             break;
         }
         $img_path = $new_path;
         $i++;
     }
     return common::IdReq($img_path, $jquery);
 }
开发者ID:Knuzen,项目名称:gpEasy-CMS,代码行数:35,代码来源:common.php

示例7: 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


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