Files
zoneminder/web/app/Controller/LogsController.php
Kyle Johnson 67ad15fdc5 Initial commit of the Logs Controller and View.
The log functionality is similar to that of the classic skin, though
with fewer options.  Initial filtering support is for only component type.
Also displays a fixed last 100 log events, sorted by TimeKey ascending.
2013-07-11 12:06:12 -04:00

31 lines
650 B
PHP

<?php
class LogsController extends AppController {
public function index() {
$conditions = array();
$named = $this->extractNamedParams(
array('Component')
);
if ($named) {
foreach ($named as $key => $value) {
switch ($key) {
case "Component":
$Component = array($key => $value);
array_push($conditions, $Component);
break;
}
}
};
$this->set('loglines', $this->Log->find('all', array(
'limit' => 100,
'order' => array('TimeKey' => 'asc'),
'conditions' => $conditions
)));
$this->set('components', $this->Log->find('all', array(
'fields' => array('DISTINCT Component')
)));
}
}
?>