Пример #1
0
 public function prepareView(\Nethgui\View\ViewInterface $view)
 {
     parent::prepareView($view);
     $this->notifications->defineTemplate('adminTodo', self::TEMPLATE, 'bg-yellow');
     $view['todos'] = array_map(function ($todo) use($view) {
         if (isset($todo['action']['url'])) {
             $todo['action']['url'] = $view->getModuleUrl($todo['action']['url']);
         }
         return $todo;
     }, $this->readTodos());
     if ($this->emitNotifications) {
         foreach ($view['todos'] as $todo) {
             $this->notifications->adminTodo($todo);
         }
     }
 }
Пример #2
0
 public function prepareView(\Nethgui\View\ViewInterface $view)
 {
     parent::prepareView($view);
     $this->notifications->defineTemplate('trackerError', strtr(self::TRACKER_ERROR_TEMPLATE, array('{{genericLabel}}' => $view->translate('Tracker_task_error_message'), '{{codeLabel}}' => $view->translate('Tracker_code_label'))), 'bg-red');
     // Define a notification template that opens the first running task details:
     $this->notifications->defineTemplate('trackerRunning', strtr(self::TRACKER_RUNNING_TEMPLATE, array('{{message}}' => $view->translate('Tracker_running_tasks_message'), '{{btnLink}}' => $view->getModuleUrl('/Tracker/{{taskId}}'), '{{btnLabel}}' => $view->translate('Tracker_button_label'))), 'bg-yellow');
     if (!$this->getRequest()->getUser()->isAuthenticated()) {
         return;
     }
     if ($this->taskId === FALSE) {
         $this->prepareInitializationView($view);
     } else {
         $this->prepareRunningTaskView($view);
     }
 }