<?php
namespace bdrem;
-class Renderer_Console
+class Renderer_Console extends Renderer
{
+ protected $httpContentType = 'text/plain; charset=utf-8';
+
/**
* Use ANSI color codes for output coloring
*
* @var boolean
*/
- public $ansi = true;
+ public $ansi = false;
/**
* @var \Console_Color2
public function render($arEvents)
{
+ $this->loadConfig();
if ($this->ansi) {
$this->cc = new \Console_Color2();
}
$tbl = new \Console_Table(
CONSOLE_TABLE_ALIGN_LEFT,
- array('sect' => '', 'rule' => '-', 'vert' => ''),
+ array('intersection' => '', 'horizontal' => '-', 'vertical' => ''),
1, null, $this->ansi
);
$tbl->setAlign(0, CONSOLE_TABLE_ALIGN_RIGHT);
$event->age,
wordwrap($event->title, 30, "\n", true),
wordwrap($event->type, 20, "\n", true),
- $event->date,
+ $this->getLocalDate($event->date),
strftime('%a', strtotime($event->localDate))
),
$colorCode
}
return $data;
}
+
+ protected function loadConfig()
+ {
+ if (isset($this->config->ansi)) {
+ $this->ansi = $this->config->ansi;
+ }
+ }
}
?>