From dd9188b7cd28a79ef1ec5e0824cee68f955621f8 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Mon, 1 Dec 2014 16:13:08 +0000 Subject: [PATCH] Remove Logs views, ouput log json via _serialize --- web/api/app/Controller/LogsController.php | 17 +++++-- web/api/app/View/Logs/add.ctp | 23 ---------- web/api/app/View/Logs/edit.ctp | 25 ----------- web/api/app/View/Logs/index.ctp | 52 ---------------------- web/api/app/View/Logs/view.ctp | 54 ----------------------- 5 files changed, 14 insertions(+), 157 deletions(-) delete mode 100644 web/api/app/View/Logs/add.ctp delete mode 100644 web/api/app/View/Logs/edit.ctp delete mode 100644 web/api/app/View/Logs/index.ctp delete mode 100644 web/api/app/View/Logs/view.ctp diff --git a/web/api/app/Controller/LogsController.php b/web/api/app/Controller/LogsController.php index 908c635e2..76d9b7f0f 100644 --- a/web/api/app/Controller/LogsController.php +++ b/web/api/app/Controller/LogsController.php @@ -13,7 +13,11 @@ class LogsController extends AppController { * * @var array */ - public $components = array('Paginator'); + public $components = array('Paginator', 'RequestHandler'); + public $paginate = array( + 'limit' => 100, + 'order' => array( 'Log.TimeKey' => 'asc' ) + ); /** * index method @@ -21,8 +25,15 @@ class LogsController extends AppController { * @return void */ public function index() { - $this->Log->recursive = 0; - $this->set('logs', $this->Paginator->paginate()); + $this->Log->recursive = -1; + $this->Paginator->settings = $this->paginate; + + $logs = $this->Paginator->paginate('Log'); + + $this->set(array( + 'logs' => $logs, + '_serialize' => array('logs') + )); } /** diff --git a/web/api/app/View/Logs/add.ctp b/web/api/app/View/Logs/add.ctp deleted file mode 100644 index a667ae1f1..000000000 --- a/web/api/app/View/Logs/add.ctp +++ /dev/null @@ -1,23 +0,0 @@ -
-Form->create('Log'); ?> -
- - Form->input('Component'); - echo $this->Form->input('Pid'); - echo $this->Form->input('Level'); - echo $this->Form->input('Code'); - echo $this->Form->input('Message'); - echo $this->Form->input('File'); - echo $this->Form->input('Line'); - ?> -
-Form->end(__('Submit')); ?> -
-
-

- -
diff --git a/web/api/app/View/Logs/edit.ctp b/web/api/app/View/Logs/edit.ctp deleted file mode 100644 index cdd5dab2b..000000000 --- a/web/api/app/View/Logs/edit.ctp +++ /dev/null @@ -1,25 +0,0 @@ -
-Form->create('Log'); ?> -
- - Form->input('TimeKey'); - echo $this->Form->input('Component'); - echo $this->Form->input('Pid'); - echo $this->Form->input('Level'); - echo $this->Form->input('Code'); - echo $this->Form->input('Message'); - echo $this->Form->input('File'); - echo $this->Form->input('Line'); - ?> -
-Form->end(__('Submit')); ?> -
-
-

- -
diff --git a/web/api/app/View/Logs/index.ctp b/web/api/app/View/Logs/index.ctp deleted file mode 100644 index 47cbeb57f..000000000 --- a/web/api/app/View/Logs/index.ctp +++ /dev/null @@ -1,52 +0,0 @@ -
-

- - - - - - - - - - - - - - - - - - - - - - - - - -
Paginator->sort('TimeKey'); ?>Paginator->sort('Component'); ?>Paginator->sort('Pid'); ?>Paginator->sort('Level'); ?>Paginator->sort('Code'); ?>Paginator->sort('Message'); ?>Paginator->sort('File'); ?>Paginator->sort('Line'); ?>
         - Html->link(__('View'), array('action' => 'view', $log['Log']['TimeKey'])); ?> - Html->link(__('Edit'), array('action' => 'edit', $log['Log']['TimeKey'])); ?> - Form->postLink(__('Delete'), array('action' => 'delete', $log['Log']['TimeKey']), array(), __('Are you sure you want to delete # %s?', $log['Log']['TimeKey'])); ?> -
-

- Paginator->counter(array( - 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') - )); - ?>

-
- Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled')); - echo $this->Paginator->numbers(array('separator' => '')); - echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled')); - ?> -
-
-
-

- -
diff --git a/web/api/app/View/Logs/view.ctp b/web/api/app/View/Logs/view.ctp deleted file mode 100644 index 7f0b8f15a..000000000 --- a/web/api/app/View/Logs/view.ctp +++ /dev/null @@ -1,54 +0,0 @@ -
-

-
-
-
- -   -
-
-
- -   -
-
-
- -   -
-
-
- -   -
-
-
- -   -
-
-
- -   -
-
-
- -   -
-
-
- -   -
-
-
-
-

- -