示例#1
0
 /**
  * Load application table in memory & cache. All applications as object is available in $this->apps
  */
 private function loadAppsTable()
 {
     if (App::$Memory->get('table.apps') !== null) {
         $this->table = App::$Memory->get('table.apps');
     } else {
         $this->table = AppRecord::all();
         App::$Memory->set('table.apps', $this->table);
     }
 }
示例#2
0
文件: main.php 项目: phpffcms/ffcms
>
                        <a href="#"><i class="fa fa-fire fa-fw"></i> <?php 
echo __('System');
?>
<span class="fa arrow"></span></a>
                        <?php 
echo Listing::display(['type' => 'ul', 'property' => ['class' => 'nav nav-second-level'], 'items' => [['type' => 'link', 'link' => ['main/settings'], 'text' => '<i class="fa fa-cogs"></i> ' . __('Settings'), 'html' => true], ['type' => 'link', 'link' => ['main/files'], 'text' => '<i class="fa fa-file-o"></i> ' . __('Files'), 'html' => true], ['type' => 'link', 'link' => ['main/antivirus'], 'text' => '<i class="fa fa-shield"></i> ' . __('Antivirus'), 'html' => true], ['type' => 'link', 'link' => ['main/routing'], 'text' => '<i class="fa fa-code"></i> ' . __('Routing'), 'html' => true], ['type' => 'link', 'link' => ['main/updates'], 'text' => '<i class="fa fa-gavel"></i> ' . __('Updates'), 'html' => true]]]);
?>
                        <!-- /.nav-second-level -->
                    </li>
                    <?php 
$extTable = null;
if (method_exists($this, 'getTable')) {
    $extTable = $this->getTable();
} else {
    $extTable = \Apps\ActiveRecord\App::all();
}
$appMenuItems = null;
$widgetMenuItems = null;
$appControllers = [];
$widgetControllers = [];
foreach ($extTable as $item) {
    $menuItem = ['type' => 'link', 'link' => [Str::lowerCase($item->sys_name) . '/index'], 'text' => $item->getLocaleName() . (!$item->checkVersion() ? ' <i class="fa fa-wrench" style="color: #ffbd26;"></i>' : null), 'html' => true];
    if ($item->type === 'app') {
        $appControllers[] = $item->sys_name;
        $appMenuItems[] = $menuItem;
    } elseif ($item->type === 'widget') {
        $widgetControllers[] = $item->sys_name;
        $widgetMenuItems[] = $menuItem;
    }
}