コード例 #1
0
 function __construct()
 {
     parent::__construct(BX_DOL_STUDIO_PAGE_HOME);
     $aClasses = array('BxTemplStudioModules', 'BxTemplStudioDesigns', 'BxTemplStudioLanguages');
     //--- Check actions ---//
     if (($sAction = bx_get('action')) !== false) {
         $sAction = bx_process_input($sAction);
         $aResult = array('code' => 1, 'message' => _t('_adm_err_operation_failed'));
         switch ($sAction) {
             case 'launcher-update-cache':
                 $aResult = $this->updateCache();
                 break;
             case 'launcher-reorder':
                 $sPage = bx_process_input(bx_get('page'));
                 $aItems = bx_process_input(bx_get('items'));
                 BxDolStudioWidgetsQuery::getInstance()->reorder($sPage, $aItems);
                 $aResult = array('code' => 0, 'message' => _t('_adm_scs_operation_done'));
                 break;
         }
         echo json_encode($aResult);
         exit;
     }
     $this->aIncludes = array();
     foreach ($aClasses as $sClass) {
         $this->aIncludes[] = new $sClass();
     }
 }
コード例 #2
0
 public function __construct($mixedPageName)
 {
     parent::__construct($mixedPageName);
     $this->oDb = BxDolStudioWidgetsQuery::getInstance();
     $this->aWidgets = array();
     $this->aWidgetsNotices = array();
     if (!$this->bPageMultiple) {
         $this->oDb->getWidgets(array('type' => 'by_page_id', 'value' => $this->aPage['id']), $this->aWidgets, false);
     } else {
         foreach ($this->aPage as $sPage => $aPage) {
             $this->aWidgets[$sPage] = array();
             $this->oDb->getWidgets(array('type' => 'by_page_id', 'value' => $aPage['id']), $this->aWidgets[$sPage], false);
         }
     }
     //--- Load Cache (Widgets' Notices)
     $oCache = $this->oDb->getDbCacheObject();
     $sCacheKey = $this->oDb->genDbCacheKey($this->sCacheKeyNotices);
     $this->aWidgetsNotices = $oCache->getData($sCacheKey);
 }