public function doUpdate($currentVersion) { // 增加了新的设置选项 MobileThemePlugin::saveOptionValue('goods_after_service', '这里是售后服务说明'); // 设置新的版本 MobileThemePlugin::saveOptionValue('version', $this->targetVersion); return true; }
public function doUpdate($currentVersion) { // 删除旧的设置,由于 JQuery Mobile 本身的特性,不适合用传统的统计代码来做统计 MobileThemePlugin::removeOptionValue('statistics_code'); // 新的统计设置选项 // Google Analytics 的 UA 设置 MobileThemePlugin::saveOptionValue('google_analytics_ua', ''); // 设置新的版本 MobileThemePlugin::saveOptionValue('version', $this->targetVersion); return true; }
public function doUpdate($currentVersion) { // 获得插件的配置 (config.php 里面的信息) $configArray = MobileThemePlugin::$instance->loadConfigFile(); // 删除 smarty_cache_time_goods_category 设置 MobileThemePlugin::removeOptionValue('smarty_cache_time_goods_category'); // 添加一个新的设置 MobileThemePlugin::saveOptionValue('smarty_cache_time_goods_search', $configArray['smarty_cache_time_goods_search']); // 升级版本信息 MobileThemePlugin::saveOptionValue('version', $this->targetVersion); return true; }
public function post($f3) { // 权限检查 $this->requirePrivilege('manage_plugin_theme_configure'); // 参数验证 $validator = new Validator($f3->get('POST')); foreach ($this->optionKeyArray as $optionKey) { if (in_array($optionKey, $this->optionKeyNoFilterArray)) { $optionValue = $f3->get('POST[' . $optionKey . ']'); } else { $optionValue = $validator->validate($optionKey); } MobileThemePlugin::saveOptionValue($optionKey, $optionValue); } // 清除所有缓存 $cacheClear = new MobileClear(); $cacheClear->clearAllCache(); $this->addFlashMessage('保存设置成功'); out_display: global $smarty; $smarty->display('theme_mobile_configure.tpl', 'post'); }
public function doUpdate($currentVersion) { // 简单的把版本设置为 1.0.0 就算完成升级了 MobileThemePlugin::saveOptionValue('version', $this->targetVersion); return true; }