コード例 #1
0
ファイル: events.php プロジェクト: TrinityCore/aowow
 protected function generateContent()
 {
     $condition = [];
     if (!User::isInGroup(U_GROUP_EMPLOYEE)) {
         $condition[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
     }
     if ($this->category) {
         switch ($this->category[0]) {
             case 0:
                 $condition[] = ['e.holidayId', 0];
                 break;
             case 1:
                 $condition[] = ['h.scheduleType', -1];
                 break;
             case 2:
                 $condition[] = ['h.scheduleType', [0, 1]];
                 break;
             case 3:
                 $condition[] = ['h.scheduleType', 2];
                 break;
         }
     }
     $events = new WorldEventList($condition);
     $this->extendGlobalData($events->getJSGlobals());
     $this->deps = [];
     foreach ($events->iterate() as $__) {
         if ($d = $events->getField('requires')) {
             $this->deps[$events->id] = $d;
         }
     }
     $data = array_values($events->getListviewData());
     $this->lvTabs[] = ['event', ['data' => $data]];
     if ($_ = array_filter($data, function ($x) {
         return $x['id'] > 0;
     })) {
         $this->lvTabs[] = ['calendar', array('data' => $_, 'hideCount' => 1)];
     }
 }