Ejemplo n.º 1
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  * @throws  \UnexpectedValueException
  */
 public function render()
 {
     $type = $this->getLogType();
     switch ($type) {
         case 'php':
             $path = $this->getDebugger()->getLogPath('php');
             break;
         case '403':
         case '404':
         case '500':
         case 'app':
         case 'cron':
         case 'database':
         case 'error':
         case 'github_issues':
         case 'github_comments':
         case 'github_pulls':
             $path = $this->getDebugger()->getLogPath('root') . '/' . $type . '.log';
             break;
         default:
             throw new \UnexpectedValueException('Invalid log type');
             break;
     }
     $log = realpath($path) ? $this->processLog($type, $path) : [sprintf(g11n3t('No %s log file found.'), $type)];
     $this->renderer->set('log', $log);
     $this->renderer->set('log_type', $type);
     return parent::render();
 }
Ejemplo n.º 2
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  * @throws  \RuntimeException
  */
 public function render()
 {
     // Set the vars to the template.
     $this->renderer->set('group', ArrayHelper::fromObject($this->model->getItem()));
     $this->renderer->set('project', $this->getProject());
     return parent::render();
 }
Ejemplo n.º 3
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  */
 public function render()
 {
     $this->renderer->set('items', $this->model->getItems());
     $this->renderer->set('pagination', $this->model->getPagination());
     $this->renderer->set('state', $this->model->getState());
     return parent::render();
 }
Ejemplo n.º 4
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  * @throws  \RuntimeException
  */
 public function render()
 {
     // Set the vars to the template.
     $this->renderer->set('state', $this->model->getState());
     $this->renderer->set('project', $this->getProject());
     return parent::render();
 }
Ejemplo n.º 5
0
 /**
  * Method to instantiate the view.
  *
  * @param   ModelInterface     $model     The model object.
  * @param   RendererInterface  $renderer  The renderer interface.
  *
  * @since   1.0
  */
 public function __construct(ModelInterface $model = null, RendererInterface $renderer = null)
 {
     $model = $model ?: new TrackerDefaultModel();
     if (is_null($renderer)) {
         $renderer = new Twig(array('templates_base_dir' => JPATH_TEMPLATES, 'environment' => array('debug' => true)));
     }
     parent::__construct($model, $renderer);
 }
Ejemplo n.º 6
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  * @throws  \RuntimeException
  */
 public function render()
 {
     $this->renderer->set('item', $this->getItem());
     $this->renderer->set('project', $this->getProject());
     $this->renderer->set('statuses', $this->model->getStatuses());
     $this->renderer->set('canEditOwn', $this->canEditOwn());
     return parent::render();
 }
Ejemplo n.º 7
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  */
 public function render()
 {
     $type = trim(getenv('JTRACKER_ENVIRONMENT'));
     $fileName = $type ? 'config.' . $type . '.json' : 'config.json';
     $config = json_decode(file_get_contents(JPATH_CONFIGURATION . '/' . $fileName), true);
     $this->renderer->set('config', $config);
     $this->renderer->set('configFile', $fileName);
     return parent::render();
 }
Ejemplo n.º 8
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  * @throws  RoutingException
  */
 public function render()
 {
     try {
         $item = $this->model->getItem($this->getAlias());
     } catch (\RuntimeException $e) {
         throw new RoutingException($this->getAlias());
     }
     $this->renderer->set('page', $item->getIterator());
     return parent::render();
 }
Ejemplo n.º 9
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  * @throws  \RuntimeException
  */
 public function render()
 {
     $lines = file(JPATH_THEMES . '/jtracker/core/css/template.css');
     $icons = array();
     foreach ($lines as $line) {
         if (preg_match('/.(icon-[a-z0-9\\-]+)/', $line, $matches)) {
             if ('icon-bar' == $matches[1]) {
                 continue;
             }
             $icons[] = $matches[1];
         }
     }
     $this->renderer->set('icons', array_unique($icons));
     return parent::render();
 }
Ejemplo n.º 10
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  * @throws  \RuntimeException
  */
 public function render()
 {
     $this->renderer->set('project', $this->getProject());
     return parent::render();
 }
Ejemplo n.º 11
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  * @throws  \RuntimeException
  */
 public function render()
 {
     $this->renderer->set('projects', $this->model->getItems());
     return parent::render();
 }
Ejemplo n.º 12
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  */
 public function render()
 {
     $item = $this->model->getItem($this->id);
     $this->renderer->set('item', $item)->set('tz_offset', (new \DateTimeZone($item->params->get('timezone', 'UTC')))->getOffset(new \DateTime()) / 3600);
     return parent::render();
 }
Ejemplo n.º 13
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  */
 public function render()
 {
     $this->renderer->set('item', $this->getItem());
     return parent::render();
 }
Ejemplo n.º 14
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  */
 public function render()
 {
     $this->renderer->set('project', $this->model->getByAlias($this->getAlias()));
     return parent::render();
 }
Ejemplo n.º 15
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  */
 public function render()
 {
     $this->renderer->set('routes', $this->getRoutes());
     return parent::render();
 }
Ejemplo n.º 16
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  * @throws  RoutingException
  */
 public function render()
 {
     $this->renderer->set('fullPath', $this->fullPath);
     return parent::render();
 }