Exemplo n.º 1
0
 public function setTheme()
 {
     $currentTheme = LuLu::getAppParam('adminTheme');
     $moduleId = LuLu::$app->controller->module->id;
     $config = ['pathMap' => ['@app/views' => ['@static/admin/' . $currentTheme . '/views'], '@source/modules/' . $moduleId . '/admin/views' => ['@static/admin/' . $currentTheme . '/modules/' . $moduleId]], 'baseUrl' => '@static/admin/' . $currentTheme];
     $this->theme = new Theme($config);
 }
Exemplo n.º 2
0
 public static function getContentByChannel($channelIds, $other = [])
 {
     $tableName = '';
     $where = '';
     $cachedChannels = LuLu::getAppParam('cachedChannels');
     if (intval($channelIds) > 0) {
         $channel = $cachedChannels[$channelIds];
         $tableName = $channel['table'];
         if (empty($tableName)) {
             return [];
         }
         if ($channel['is_leaf']) {
             $where = 'channel_id=' . $channelIds;
         } else {
             $leafIds = $channel['leaf_ids'];
             if ($leafIds == '') {
                 return [];
             }
             $where = 'channel_id in(' . $leafIds . ')';
         }
     } else {
         $channelIdArray = explode(',', $channelIds);
         $tableName = $channel[$channelIdArray[0]];
         if (empty($tableName)) {
             return [];
         }
         $leafIds = '';
         foreach ($channelIdArray as $id) {
             $leafIds .= $cachedChannels[$id]['leaf_ids'] . ',';
         }
         $leafIdsArray = explode(',', rtrim($leafIds, ','));
         $leafIdsArray = array_unique($leafIdsArray);
         $leafIds = implode(',', $leafIdsArray);
         $where = 'channel_id in(' . $leafIds . ')';
     }
     $query = self::buildContentQuery($tableName, $other, $where);
     return $query->all();
 }
Exemplo n.º 3
0
 public static function getHomeTheme()
 {
     $currentTheme = LuLu::getAppParam('homeTheme');
     return $currentTheme;
 }
Exemplo n.º 4
0
 public static function getContentItemView($content)
 {
     $currentTheme = LuLu::getAppParam('homeTheme');
     $ret = '@webroot/static/themes/' . $currentTheme . '/modules/' . $content['type'] . '/_inc/content_default';
     return $ret;
 }