コード例 #1
0
ファイル: FixupController.php プロジェクト: fanqimeng/4tweb
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!Wekit::load('ADMIN:service.srv.AdminFounderService')->isFounder($this->adminUser->username)) {
         $this->showError('APPCENTER:upgrade.founder');
     }
 }
コード例 #2
0
 public function beforeAction($action)
 {
     $this->scanModules('payment');
     $arrModules = Modules::model()->findAllByAttributes(array('category' => 'payment'), array('order' => 'module'));
     $this->_allowAdvancedPayments = CPropertyValue::ensureBoolean(Yii::app()->params['ALLOW_ADVANCED_PAY_METHODS']);
     $menuSidebar = array();
     foreach ($arrModules as $module) {
         $currentModule = Yii::app()->getComponent($module->module);
         if (is_null($currentModule)) {
             continue;
         }
         if ($currentModule->cloudCompatible === false && _xls_get_conf('LIGHTSPEED_CLOUD') > 0) {
             continue;
         }
         if ($currentModule->isDisplayable() === false) {
             continue;
         }
         $menuSidebar[] = array('label' => $currentModule->AdminName, 'url' => array('payments/module', 'id' => $module->module), 'advancedPayment' => $currentModule->advancedMode);
     }
     $advancedPaymentMethods = where($menuSidebar, array('advancedPayment' => true));
     $simplePaymentMethods = where($menuSidebar, array('advancedPayment' => false));
     $this->menuItems = array_merge(array(array('label' => 'Simple Integration Modules', 'linkOptions' => array('class' => 'nav-header'))), $simplePaymentMethods, array(array('label' => 'Advanced Integration Modules', 'linkOptions' => array('class' => 'nav-header'), 'visible' => count($advancedPaymentMethods) > 0)), $advancedPaymentMethods, $this->getPaymentSetupLinks());
     $objModules = Modules::model()->findAllByAttributes(array('category' => 'payment', 'active' => 1));
     if (count($objModules) === 0 && $action->id == "index") {
         $this->noneActive = 1;
         Yii::app()->user->setFlash('error', Yii::t('admin', 'WARNING: You have no payment modules activated. No one can checkout.'));
     }
     return parent::beforeAction($action);
 }
コード例 #3
0
ファイル: StorageController.php プロジェクト: fanqimeng/4tweb
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $config = Wekit::C('site', 'windid');
     if ($config == 'client') {
         $this->showError('WINDID:is.server.config');
     }
 }
コード例 #4
0
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $var = unserialize($this->getInput('var'));
     if (is_array($var)) {
         $this->setOutput($var, 'condition');
     }
 }
コード例 #5
0
 /**
  * Create menu for this controller
  * @param CAction $action
  * @return bool
  */
 public function beforeAction($action)
 {
     $this->menuItems = array(array('label' => '← Back to System Menu', 'url' => array('/admin/system')), array('label' => 'Customers', 'linkOptions' => array('class' => 'nav-header')), array('label' => 'Edit Customers', 'url' => array('databaseadmin/customers')), array('label' => 'Orders', 'linkOptions' => array('class' => 'nav-header')), array('label' => 'Downloaded Orders', 'url' => array('databaseadmin/orders')), array('label' => 'Pending Orders', 'url' => array('databaseadmin/pending')), array('label' => 'Unpaid Orders', 'url' => array('databaseadmin/unpaid')), array('label' => 'Products', 'linkOptions' => array('class' => 'nav-header')), array('label' => 'Product Lookup', 'url' => array('databaseadmin/products')));
     $arrLang = _xls_avail_languages();
     if (count($arrLang) > 1) {
         $this->menuItems[] = array('label' => 'Translations', 'linkOptions' => array('class' => 'nav-header'));
         array_shift($arrLang);
         foreach ($arrLang as $key => $value) {
             $this->menuItems[] = array('label' => 'English' . "=>" . $value, 'url' => array('databaseadmin/translate?dest=' . $key));
         }
     }
     return parent::beforeAction($action);
 }
コード例 #6
0
 public function beforeAction($action)
 {
     date_default_timezone_set(_xls_get_conf('TIMEZONE'));
     if (Multicategory::CheckSetDb() === false) {
         Multicategory::model()->SetDb();
     } else {
         Multicategory::model()->Checkversion($this->InfoModule['router'], $this->InfoModule['version']);
     }
     $this->upgradeDataBase();
     $SelfmenuItems = array();
     $this->menuItems = $this->menuItems = Argoworks::model()->createMenuArgo($SelfmenuItems, $this->InfoModule['router']);
     return parent::beforeAction($action);
 }
コード例 #7
0
 public function beforeAction($action)
 {
     $arrModules = CustomPage::model()->findAll(array('order' => 'title'));
     //Get active and inactive
     $menuSidebar = array();
     foreach ($arrModules as $module) {
         $menuSidebar[] = array('label' => $module->title, 'url' => array('custompage/edit', 'id' => $module->id));
     }
     $this->menuItems = array_merge(array(array('label' => 'Edit Pages', 'linkOptions' => array('class' => 'nav-header'))), $menuSidebar, array(array('label' => 'Custom Pages', 'linkOptions' => array('class' => 'nav-header')), array('label' => 'Create new page', 'url' => array('custompage/add'))));
     //run parent init() after setting menu so highlighting works
     Yii::import('ext.imperavi-redactor-widget.ImperaviRedactorWidget');
     return parent::beforeAction($action);
 }
コード例 #8
0
ファイル: UpgradeController.php プロジェクト: fanqimeng/4tweb
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!Wekit::load('ADMIN:service.srv.AdminFounderService')->isFounder($this->adminUser->username)) {
         $this->showError('APPCENTER:upgrade.founder');
     }
     $this->installService = $this->_loadInstallation();
     $this->upgrade_temp = Wind::getRealPath($this->upgrade_temp, true);
     $action = $handlerAdapter->getAction();
     if (!in_array($action, array('run', 'check', 'select'))) {
         $r = @(include $this->upgrade_temp);
         $this->_checkLegal($action, $r);
     }
 }
コード例 #9
0
 public function beforeAction($action)
 {
     date_default_timezone_set(_xls_get_conf('TIMEZONE'));
     if (Zoomproduct::CheckSetDb() === false) {
         Zoomproduct::model()->SetDb();
     } else {
         Zoomproduct::model()->Checkversion($this->InfoModule['router'], $this->InfoModule['version']);
     }
     $SelfmenuItems = array(array('label' => 'Manage Products', 'url' => array('zoomproduct/list'), 'linkOptions' => array('class' => 'level-1')), array('label' => 'Import Product CSV Zoom Images', 'url' => array('zoomproduct/import'), 'linkOptions' => array('class' => 'level-1')), array('label' => 'Module Settings', 'url' => array('zoomproduct/edit?id=111'), 'linkOptions' => array('class' => 'level-1')));
     $this->menuItems = $this->menuItems = Argoworks::model()->createMenuArgo($SelfmenuItems, $this->InfoModule['router']);
     //run parent init() after setting menu so highlighting works
     $css_file = Yii::app()->getRequest()->getBaseUrl() . '/css/zoomproduct/style.css';
     Yii::app()->clientScript->registerCssFile($css_file);
     return parent::beforeAction($action);
 }
コード例 #10
0
 public function beforeAction($action)
 {
     date_default_timezone_set(_xls_get_conf('TIMEZONE'));
     if (Addimglist::CheckSetDb() === false) {
         Addimglist::model()->SetDb();
     } else {
         Addimglist::model()->Checkversion($this->InfoModule['router'], $this->InfoModule['version']);
     }
     if (!Argoworks::model()->checkLicense($this->InfoModule['router'])) {
         $this->redirect($this->createUrl('argoworks/license?router=' . $this->InfoModule['router']));
         // Check license . If fail will ridirect to activate
     }
     $SelfmenuItems = array(array('label' => 'Thumbnail Products', 'url' => array('addimglist/list'), 'linkOptions' => array('class' => 'level-1')), array('label' => 'Import Dual Thumbnail', 'url' => array('addimglist/import'), 'linkOptions' => array('class' => 'level-1')));
     $this->menuItems = $this->menuItems = Argoworks::model()->createMenuArgo($SelfmenuItems, $this->InfoModule['router']);
     return parent::beforeAction($action);
 }
コード例 #11
0
ファイル: ThemeController.php プロジェクト: hjlan/webstore
 public function beforeAction($action)
 {
     $this->scanModules('theme');
     if (Yii::app()->theme) {
         $this->currentTheme = Yii::app()->theme->name;
         if (Theme::hasAdminForm($this->currentTheme)) {
             $model = Yii::app()->getComponent('wstheme')->getAdminModel($this->currentTheme);
             $this->currentTheme = $model->name;
         }
     } else {
         $this->currentTheme = "unknown";
     }
     $this->menuItems = array(array('label' => 'Manage My Themes', 'url' => array('theme/manage')), array('label' => 'Configure ' . ucfirst($this->currentTheme), 'url' => array('theme/module')), array('label' => 'Edit CSS for ' . ucfirst($this->currentTheme), 'url' => array('theme/editcss'), 'visible' => Theme::hasAdminForm(Yii::app()->theme->name)), array('label' => 'View Theme Gallery', 'url' => array('theme/gallery'), 'visible' => !(Yii::app()->params['LIGHTSPEED_HOSTING'] > 0)), array('label' => 'Upload Theme .Zip', 'url' => array('theme/upload'), 'visible' => !(Yii::app()->params['LIGHTSPEED_MT'] > 0)), array('label' => 'My Header/Image Gallery', 'url' => array('theme/image', 'id' => 1)), array('label' => 'Upload FavIcon', 'url' => array('theme/favicon'), 'visible' => !(Yii::app()->params['LIGHTSPEED_MT'] > 0)));
     //run parent beforeAction() after setting menu so highlighting works
     return parent::beforeAction($action);
 }
コード例 #12
0
 public function beforeAction($action)
 {
     $this->scanModules('theme');
     if (Yii::app()->theme) {
         $this->currentTheme = Yii::app()->theme->name;
         if (Theme::hasAdminForm($this->currentTheme)) {
             $model = Yii::app()->getComponent('wstheme')->getAdminModel($this->currentTheme);
             $this->currentTheme = $model->name;
         }
     } else {
         $this->currentTheme = "unknown";
     }
     // Only old self-hosted customers can download/upgrade themes on their own.
     $canDisplayThemeGallery = CPropertyValue::ensureBoolean(Yii::app()->params['LIGHTSPEED_HOSTING']) === false && CPropertyValue::ensureBoolean(Yii::app()->params['ALLOW_LEGACY_THEMES']);
     $this->menuItems = array(array('label' => 'Manage My Themes', 'url' => array('theme/manage')), array('label' => 'Configure ' . ucfirst($this->currentTheme), 'url' => array('theme/module')), array('label' => 'Edit CSS for ' . ucfirst($this->currentTheme), 'url' => array('theme/editcss'), 'visible' => Theme::hasAdminForm(Yii::app()->theme->name)), array('label' => 'View Theme Gallery', 'url' => array('theme/gallery'), 'visible' => $canDisplayThemeGallery), array('label' => 'Upload Theme .Zip', 'url' => array('theme/upload'), 'visible' => !(Yii::app()->params['LIGHTSPEED_MT'] > 0)), array('label' => 'My Header/Image Gallery', 'url' => array('theme/image', 'id' => 1)), array('label' => 'Upload FavIcon', 'url' => array('theme/favicon'), 'visible' => !(Yii::app()->params['LIGHTSPEED_MT'] > 0)));
     //run parent beforeAction() after setting menu so highlighting works
     return parent::beforeAction($action);
 }
コード例 #13
0
 public function beforeAction($action)
 {
     $this->scanModules('shipping');
     $arrModules = Modules::model()->findAllByAttributes(array('category' => 'shipping'), array('order' => 'module'));
     //Get active and inactive
     $menuSidebar = array();
     foreach ($arrModules as $module) {
         try {
             if (Yii::app()->getComponent($module->module)) {
                 $menuSidebar[] = array('label' => Yii::app()->getComponent($module->module)->AdminName, 'url' => array('shipping/module', 'id' => $module->module));
             }
         } catch (Exception $e) {
             Yii::log("Missing widget " . $e, 'error', 'application.' . __CLASS__ . "." . __FUNCTION__);
         }
     }
     $this->menuItems = array_merge(array(array('label' => 'Shipping Modules', 'linkOptions' => array('class' => 'nav-header'))), $menuSidebar, array(array('label' => 'Shipping Setup', 'linkOptions' => array('class' => 'nav-header')), array('label' => 'Global Settings', 'url' => array('shipping/edit', 'id' => self::GLOBAL_SHIPPING)), array('label' => 'Set Display Order', 'url' => array('shipping/order')), array('label' => 'Destinations and Taxes', 'url' => array('shipping/destinations')), array('label' => 'Edit Countries', 'url' => array('shipping/countries')), array('label' => 'Edit States/Regions', 'url' => array('shipping/states'))));
     if ($action->id == "index") {
         $this->verifyActive();
     }
     return parent::beforeAction($action);
 }
コード例 #14
0
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $isapi = '';
     $isdata = true;
     $moduleid = $this->getInput('moduleid');
     if ($moduleid) {
         $this->bo = new PwDesignModuleBo($moduleid);
         $module = $this->bo->getModule();
         if ($module && $module['module_type'] == PwDesignModule::TYPE_SCRIPT) {
             $isapi = 'api';
         }
         $modelBo = new PwDesignModelBo($module['model_flag']);
         $model = $modelBo->getModel();
         if ($model['tab'] && !in_array('data', $model['tab'])) {
             $isdata = false;
         }
     }
     $this->setOutput($moduleid, 'moduleid');
     $this->setOutput($isapi, 'isapi');
     $this->setOutput($isdata, 'isdata');
 }
コード例 #15
0
 /**
  * (non-PHPdoc)
  * @see src/library/base/PwBaseController::beforeAction()
  */
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $isapi = '';
     $moduleid = $this->getInput('moduleid');
     Wind::import('SRV:design.bo.PwDesignModuleBo');
     $this->bo = new PwDesignModuleBo($moduleid);
     $module = $this->bo->getModule();
     if (!$module) {
         $this->showError('operate.fail');
     }
     if ($module['module_type'] == PwDesignModule::TYPE_SCRIPT) {
         $isapi = 'api';
     }
     $modelBo = new PwDesignModelBo($module['model_flag']);
     $model = $modelBo->getModel();
     $isdata = true;
     if ($model['tab'] && !in_array('data', $model['tab'])) {
         $isdata = false;
     }
     $this->setOutput($moduleid, 'moduleid');
     $this->setOutput($isapi, 'isapi');
     $this->setOutput($isdata, 'isdata');
 }
コード例 #16
0
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     // TODO do something before all the action
 }
コード例 #17
0
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
 }
コード例 #18
0
 public function beforeAction($action)
 {
     $this->verifySSL();
     return parent::beforeAction($action);
 }
コード例 #19
0
 /**
  * Short Description.
  *
  * @param CAction $action
  * @return bool
  */
 public function beforeAction($action)
 {
     $this->menuItems = array(array('label' => 'Store', 'linkOptions' => array('class' => 'nav-header')), array('label' => 'Store Information', 'url' => array('default/edit', 'id' => self::STORE_INFORMATION)), array('label' => 'Email Sending Options', 'url' => array('default/edit', 'id' => self::EMAIL_SENDING_OPTIONS)), array('label' => 'Localization', 'url' => array('default/edit', 'id' => self::LOCALIZATION)), array('label' => 'Customer Registration', 'url' => array('default/edit', 'id' => self::CUSTOMER_REGISTRATION)), array('label' => 'Access Warning', 'url' => array('default/accesswarning')), array('label' => 'Appearance', 'linkOptions' => array('class' => 'nav-header')), array('label' => 'Display Options', 'url' => array('default/edit', 'id' => self::TEMPLATE_OPTIONS)), array('label' => 'Products', 'url' => array('default/edit', 'id' => self::PRODUCTS)), array('label' => 'Inventory', 'url' => array('default/edit', 'id' => self::INVENTORY)), array('label' => 'Product Photos', 'url' => array('default/edit', 'id' => self::PRODUCT_PHOTOS)), array('label' => 'Carts', 'url' => array('default/edit', 'id' => self::CARTS)), array('label' => 'Wish Lists', 'url' => array('default/edit', 'id' => self::WISH_LIST)), array('label' => 'SROs', 'url' => array('default/edit', 'id' => self::SRO), 'visible' => !(_xls_get_conf("LIGHTSPEED_CLOUD") > 0)), array('label' => 'SEO', 'linkOptions' => array('class' => 'nav-header')), array('label' => 'URL Options', 'url' => array('default/edit', 'id' => self::SEO_URL)), array('label' => 'Product Meta Data', 'url' => array('default/edit', 'id' => self::SEO_PRODUCT)), array('label' => 'Category/Custom Title Format', 'url' => array('default/edit', 'id' => self::SEO_CATEGORY)), array('label' => 'Category Meta Data', 'url' => array('default/categorymeta')));
     //run parent init() after setting menu so highlighting works
     return parent::beforeAction($action);
 }
コード例 #20
0
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $this->_bakupDir = $this->_getBackupService()->getSavePath();
 }
コード例 #21
0
 public function beforeAction($action)
 {
     $this->menuItems = self::constructMenuArray();
     return parent::beforeAction($action);
 }
コード例 #22
0
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $this->setOutput($handlerAdapter->getControllerKey(), 'controllerKey');
     $this->setOutput($handlerAdapter->getModuleKey(), 'moduleKey');
 }
コード例 #23
0
 public function beforeAction($action)
 {
     $this->menuItems = array(array('label' => 'Setup', 'linkOptions' => array('class' => 'nav-header')), array('label' => 'System Configuration', 'url' => array('system/edit', 'id' => self::SYSTEM_CONFIGURATION)), array('label' => 'Event Processors', 'url' => array('system/edit', 'id' => self::PROCESSORS)), array('label' => 'Email Servers', 'url' => array('system/edit', 'id' => self::EMAIL_SERVERS)), array('label' => 'Security', 'url' => array('system/edit', 'id' => self::SECURITY), 'visible' => !(Yii::app()->params['LIGHTSPEED_HOSTING'] == '1')), array('label' => 'Tasks', 'linkOptions' => array('class' => 'nav-header')), array('label' => 'Purge Deleted Categories/Families', 'url' => array('system/purge')), array('label' => 'Erase abandoned carts > ' . intval(_xls_get_conf('CART_LIFE', 30)) . ' days', 'url' => array('system/erasecarts')), array('label' => 'Database', 'linkOptions' => array('class' => 'nav-header')), array('label' => 'Database Admin', 'url' => array('/admin/databaseadmin')), array('label' => 'System Log', 'linkOptions' => array('class' => 'nav-header')), array('label' => 'View Log', 'url' => array('system/log')), array('label' => 'About', 'linkOptions' => array('class' => 'nav-header')), array('label' => 'System Information', 'url' => array('system/info')), array('label' => 'Latest Release Notes', 'url' => array('default/releasenotes')));
     //run parent init() after setting menu so highlighting works
     return parent::beforeAction($action);
 }
コード例 #24
0
ファイル: ManageController.php プロジェクト: fanqimeng/4tweb
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $this->file = Wind::getRealPath($this->file, false);
 }