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


PHP gpPlugin::GetDataFolder方法代码示例

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


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

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

示例2: SetDataFolder

 /**
  * Set global path variables for the current addon
  * @param string $addon_key Key used to identify a plugin uniquely in the configuration
  *
  */
 function SetDataFolder($addon_key)
 {
     global $dataDir, $config;
     global $addonDataFolder, $addonCodeFolder;
     //deprecated
     global $addonRelativeCode, $addonRelativeData, $addonPathData, $addonPathCode, $addonFolderName, $addon_current_id, $addon_current_version;
     if (!isset($config['addons'][$addon_key])) {
         return;
     }
     gpPlugin::StackPush();
     $data_folder = gpPlugin::GetDataFolder($addon_key);
     $addon_current_id = $addon_current_version = false;
     if (isset($config['addons'][$addon_key]['id'])) {
         $addon_current_id = $config['addons'][$addon_key]['id'];
     }
     if (isset($config['addons'][$addon_key]['version'])) {
         $addon_current_version = $config['addons'][$addon_key]['version'];
     }
     $addonFolderName = $addon_key;
     $addonPathCode = $addonCodeFolder = $dataDir . '/data/_addoncode/' . $addon_key;
     $addonPathData = $addonDataFolder = $dataDir . '/data/_addondata/' . $data_folder;
     $addonRelativeCode = common::GetDir('/data/_addoncode/' . $addon_key);
     $addonRelativeData = common::GetDir('/data/_addondata/' . $data_folder);
 }
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:29,代码来源:Plugins.php


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