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


PHP WebModule类代码示例

本文整理汇总了PHP中WebModule的典型用法代码示例。如果您正苦于以下问题:PHP WebModule类的具体用法?PHP WebModule怎么用?PHP WebModule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: initializeForCommand

 public function initializeForCommand()
 {
     switch ($this->command) {
         case 'notice':
             $response = null;
             $responseVersion = 1;
             if ($this->getOptionalModuleVar('BANNER_ALERT', false, 'notice')) {
                 $noticeData = $this->getOptionalModuleSection('notice');
                 if ($noticeData) {
                     $response = array('notice' => '', 'moduleID' => null, 'link' => $this->getOptionalModuleVar('BANNER_ALERT_MODULE_LINK', false, 'notice'));
                     // notice can either take a module or data model class or retriever class. The section is passed on. It must implement the HomeAlertInterface interface
                     if (isset($noticeData['BANNER_ALERT_MODULE'])) {
                         $moduleID = $noticeData['BANNER_ALERT_MODULE'];
                         $controller = WebModule::factory($moduleID);
                         $response['moduleID'] = $moduleID;
                         $string = "Module {$moduleID}";
                     } elseif (isset($noticeData['BANNER_ALERT_MODEL_CLASS'])) {
                         $controller = DataModel::factory($noticeData['BANNER_ALERT_MODEL_CLASS'], $noticeData);
                         $string = $noticeData['BANNER_ALERT_MODEL_CLASS'];
                     } elseif (isset($noticeData['BANNER_ALERT_RETRIEVER_CLASS'])) {
                         $controller = DataRetriever::factory($noticeData['BANNER_ALERT_RETRIEVER_CLASS'], $noticeData);
                         $string = $noticeData['BANNER_ALERT_RETRIEVER_CLASS'];
                     } else {
                         throw new KurogoConfigurationException("Banner alert not properly configured");
                     }
                     if (!$controller instanceof HomeAlertInterface) {
                         throw new KurogoConfigurationException("{$string} does not implement HomeAlertModule interface");
                     }
                     $response['notice'] = $controller->getHomeScreenAlert();
                 }
             }
             $this->setResponse($response);
             $this->setResponseVersion($responseVersion);
             break;
         case 'modules':
             if ($setcontext = $this->getArg('setcontext')) {
                 Kurogo::sharedInstance()->setUserContext($setcontext);
             }
             $responseVersion = 2;
             $response = array('primary' => array(), 'secondary' => array(), 'customize' => $this->getOptionalModuleVar('ALLOW_CUSTOMIZE', true), 'displayType' => $this->getOptionalModuleVar('display_type', 'springboard'));
             $allmodules = $this->getAllModules();
             $navModules = Kurogo::getSiteSections('navigation', Config::APPLY_CONTEXTS_NAVIGATION);
             foreach ($navModules as $moduleID => $moduleData) {
                 if ($module = Kurogo::arrayVal($allmodules, $moduleID)) {
                     $title = Kurogo::arrayVal($moduleData, 'title', $module->getModuleVar('title'));
                     $type = Kurogo::arrayVal($moduleData, 'type', 'primary');
                     $visible = Kurogo::arrayVal($moduleData, 'visible', 1);
                     $response[$type][] = array('tag' => $moduleID, 'title' => $title, 'visible' => (bool) $visible);
                 }
             }
             $this->setResponse($response);
             $this->setResponseVersion($responseVersion);
             break;
         default:
             $this->invalidCommand();
     }
 }
开发者ID:sponto,项目名称:msbm-mobile,代码行数:57,代码来源:HomeAPIModule.php

示例2: getCreditsHTML

 protected function getCreditsHTML()
 {
     //get original device
     $device = Kurogo::deviceClassifier()->getDevice();
     //set browser to unknown so we don't get AppQ HTML
     Kurogo::deviceClassifier()->setBrowser('unknown');
     $module = WebModule::factory($this->configModule, 'credits_html');
     $html = $module->fetchPage();
     //restore device
     Kurogo::deviceClassifier()->setDevice($device);
     return $html;
 }
开发者ID:sponto,项目名称:Kurogo-Mobile-Web,代码行数:12,代码来源:AboutAPIModule.php

示例3: afterUninstall

 public function afterUninstall()
 {
     //Удаляем таблицу модуля
     Yii::app()->db->createCommand()->dropTable(Page::model()->tableName());
     Yii::app()->db->createCommand()->dropTable(PageTranslate::model()->tableName());
     return parent::afterUninstall();
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:7,代码来源:PagesModule.php

示例4: getModuleDefaultData

 protected function getModuleDefaultData()
 {
   return array_merge(parent::getModuleDefaultData(), array(
       'url'=>''
       )
   );
 }
开发者ID:nicosiseng,项目名称:Kurogo-Mobile-Web,代码行数:7,代码来源:FullwebWebModule.php

示例5: afterUninstall

 public function afterUninstall()
 {
     Yii::app()->settings->clear('exchange1c');
     $db = Yii::app()->db;
     $db->createCommand()->dropTable('{{exchange1c}}');
     return parent::afterUninstall();
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:7,代码来源:Exchange1cModule.php

示例6: init

 /**
  * Module constructor - Builds the initial module data
  *
  * @author vadim
  */
 public function init()
 {
     // Set error handler
     Yii::app()->errorHandler->errorAction = 'site/error/error';
     /* Make sure we run the master module init function */
     parent::init();
 }
开发者ID:YiiCoded,项目名称:yii-ecommerce,代码行数:12,代码来源:SiteModule.php

示例7: prepareAdminForSection

  protected function prepareAdminForSection($section, &$adminModule) {
    switch ($section) {
      case 'primary_modules':
      case 'secondary_modules':
        
        $adminModule->setTemplatePage('module_order', $this->id);
        $adminModule->addInternalJavascript("/modules/{$this->id}/javascript/admin.js");
        $adminModule->addInternalCSS("/modules/{$this->id}/css/admin.css");

        $allModules = $this->getAllModules();
        $navigationModules = $this->getNavigationModules();

        foreach ($allModules as $moduleID=>$module) {
          $allModules[$moduleID] = $module->getModuleName();
        }

        foreach ($navigationModules[rtrim($section,'_modules')] as $moduleID=>$module) {
          $sectionModules[$moduleID] = $module['title'];
        }
        
        $adminModule->assign('allModules', $allModules);
        $adminModule->assign('sectionModules', $sectionModules);
        break;
      default:
        return parent::prepareAdminForSection($section, $adminModule);
    }
  }
开发者ID:nicosiseng,项目名称:Kurogo-Mobile-Web,代码行数:27,代码来源:HomeWebModule.php

示例8: beforeControllerAction

 public function beforeControllerAction($controller, $action)
 {
     if (parent::beforeControllerAction($controller, $action)) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:blindest,项目名称:Yii-CMS-2.0,代码行数:8,代码来源:MailerModule.php

示例9: afterUninstall

 public function afterUninstall()
 {
     //Удаляем таблицу модуля
     Yii::app()->settings->clear('news');
     Yii::app()->db->createCommand()->dropTable(News::model()->tableName());
     Yii::app()->db->createCommand()->dropTable(NewsTranslate::model()->tableName());
     return parent::afterUninstall();
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:8,代码来源:NewsModule.php

示例10: afterUninstall

 public function afterUninstall()
 {
     $db = Yii::app()->db;
     $tablesArray = array(Wishlist::model()->tableName(), WishlistProducts::model()->tableName());
     foreach ($tablesArray as $table) {
         $db->createCommand()->dropTable($table);
     }
     return parent::afterUninstall();
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:9,代码来源:WishlistModule.php

示例11: afterInstall

 public function afterInstall()
 {
     if (Yii::app()->hasModule('shop')) {
         return parent::afterInstall();
     } else {
         Yii::app()->controller->addFlashMessage('Ошибка, Модуль интернет-магазин не устрановлен.');
         return false;
     }
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:9,代码来源:CompareModule.php

示例12: afterUninstall

 public function afterUninstall()
 {
     Yii::app()->settings->clear('contacts');
     $db = Yii::app()->db;
     $db->createCommand()->dropTable(ContactsMaps::model()->tableName());
     $db->createCommand()->dropTable(ContactsMarkers::model()->tableName());
     $db->createCommand()->dropTable(ContactsRouter::model()->tableName());
     $db->createCommand()->dropTable(ContactsRouterTranslate::model()->tableName());
     return parent::afterUninstall();
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:10,代码来源:ContactsModule.php

示例13: afterUninstall

 public function afterUninstall()
 {
     $db = Yii::app()->db;
     $tablesArray = array(ShopDiscount::model()->tableName(), $db->tablePrefix . 'shop_discount_category', $db->tablePrefix . 'shop_discount_manufacturer');
     foreach ($tablesArray as $table) {
         $db->createCommand()->dropTable($table);
     }
     GridColumns::model()->deleteAll("grid_id='shopdiscount-grid'");
     return parent::afterUninstall();
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:10,代码来源:DiscountsModule.php

示例14: afterUninstall

 public function afterUninstall()
 {
     Yii::app()->settings->clear($this->id);
     $db = Yii::app()->db;
     $tablesArray = array(PollChoice::model()->tableName(), PollVote::model()->tableName(), Poll::model()->tableName());
     foreach ($tablesArray as $table) {
         $db->createCommand()->truncateTable($table);
         $db->createCommand()->dropTable($table);
     }
     return parent::afterUninstall();
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:11,代码来源:PollModule.php

示例15: afterUninstall

 public function afterUninstall()
 {
     Yii::app()->settings->clear($this->id);
     //Yii::app()->unintallComponent('cart');
     $db = Yii::app()->db;
     $tablesArray = array(Order::model()->tableName(), OrderHistory::model()->tableName(), OrderProduct::model()->tableName(), OrderStatus::model()->tableName(), OrderProductHistroy::model()->tableName(), ShopPaymentMethod::model()->tableName(), ShopPaymentMethodTranslate::model()->tableName(), ShopDeliveryMethod::model()->tableName(), ShopDeliveryMethodTranslate::model()->tableName(), ShopDeliveryPayment::model()->tableName(), ProductNotifications::model()->tableName());
     foreach ($tablesArray as $table) {
         $db->createCommand()->dropTable($table);
     }
     return parent::afterInstall();
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:11,代码来源:CartModule.php


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