public function post($f3) { // 权限检查 $this->requirePrivilege('manage_plugin_theme_configure'); // 保存数据 ShopThemePlugin::saveOptionValue('head_nav_json_data', json_encode($f3->get('POST[headNav]'))); // 清除 所有页面 $shopClear = new ShopClear(); $shopClear->clearAllCache(); $this->addFlashMessage('保存设置成功'); RouteHelper::reRoute($this, '/Theme/Shop/HeadNav'); }
public function post($f3) { // 权限检查 $this->requirePrivilege('manage_plugin_theme_adv_configure'); // 参数验证 $validator = new Validator($f3->get('POST')); // 广告设置 json 数据,由 JavaScript 打包发送过来 $shop_index_advblock_json_data = $validator->validate('shop_index_advblock_json_data'); $jsonObject = json_decode($shop_index_advblock_json_data, true); if (empty($jsonObject)) { $shop_index_advblock_json_data = null; } ShopThemePlugin::saveOptionValue('shop_index_advblock_json_data', $shop_index_advblock_json_data); // 清除 /Shop/Index 页面 $shopClear = new ShopClear(); $shopClear->clearHomePage(); $this->addFlashMessage('保存设置成功'); RouteHelper::reRoute($this, '/Theme/Shop/AdvShopBlock'); }
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); } ShopThemePlugin::saveOptionValue($optionKey, $optionValue); } // 清除 /Shop/Index 页面 $shopClear = new ShopClear(); $shopClear->clearAllCache(); $this->addFlashMessage('保存设置成功'); out_display: global $smarty; $smarty->display('theme_shop_basic.tpl', 'post'); }
public function post($f3) { // 权限检查 $this->requirePrivilege('manage_plugin_theme_adv_configure'); // 参数验证 $validator = new Validator($f3->get('POST')); // slider 广告设置 $imageArray = $validator->validate('image'); $urlArray = $validator->validate('url'); $targetArray = $validator->validate('target'); $imageSize = is_array($imageArray) ? count($imageArray) : 0; $shop_index_adv_slider = array(); // 组织数据结构 for ($index = 0; $index < $imageSize; $index++) { $shop_index_adv_slider[] = array('image' => $imageArray[$index], 'url' => $urlArray[$index], 'target' => $targetArray[$index]); } ShopThemePlugin::saveOptionValue('shop_index_adv_slider', json_encode($shop_index_adv_slider)); // 清除 /Shop/Index 页面 $shopClear = new ShopClear(); $shopClear->clearHomePage(); $this->addFlashMessage('保存设置成功'); RouteHelper::reRoute($this, '/Theme/Shop/AdvShopSlider'); }