diff options
Diffstat (limited to 'apps/admin/modules/log')
-rw-r--r-- | apps/admin/modules/log/actions/actions.class.php | 46 | ||||
-rw-r--r-- | apps/admin/modules/log/config/generator.yml | 30 | ||||
-rw-r--r-- | apps/admin/modules/log/config/security.yml | 2 | ||||
-rw-r--r-- | apps/admin/modules/log/templates/_priority.php | 1 | ||||
-rw-r--r-- | apps/admin/modules/log/templates/_user_id.php | 1 | ||||
-rw-r--r-- | apps/admin/modules/log/templates/clearSuccess.php | 12 |
6 files changed, 92 insertions, 0 deletions
diff --git a/apps/admin/modules/log/actions/actions.class.php b/apps/admin/modules/log/actions/actions.class.php new file mode 100644 index 0000000..9eed7c7 --- /dev/null +++ b/apps/admin/modules/log/actions/actions.class.php @@ -0,0 +1,46 @@ +<?php + +/** + * log actions. + * + * @package mailadmin + * @subpackage log + * @author Your name here + * @version SVN: $Id: actions.class.php 2288 2006-10-02 15:22:13Z fabien $ + */ +class logActions extends autologActions +{ + public function executeList() + { + // pageination + if($this->hasRequestParameter("max_per_page")) + $this->getUser()->setResultsPerPage($this->getRequestParameter("max_per_page")); + + return parent::executeList(); + } + + public function executeClear() + { + if($this->getRequest()->getMethod() == sfRequest::POST) + { + if($this->getRequestParameter("commit")=="Yes") + { + LogEntryPeer::doDeleteAll(); + return $this->redirect("log", "list"); + } + + } + + return sfView::SUCCESS; + } + + public function executeCreate() + { + return $this->forward404(); + } + + public function executeEdit() + { + return $this->forward404(); + } +} diff --git a/apps/admin/modules/log/config/generator.yml b/apps/admin/modules/log/config/generator.yml new file mode 100644 index 0000000..553b1c2 --- /dev/null +++ b/apps/admin/modules/log/config/generator.yml @@ -0,0 +1,30 @@ +generator: + class: sfPropelAdminGenerator + param: + model_class: LogEntry + theme: mailadmin + + fields: + created_at: { name: Time } + user_id: { name: User } + host: { name: Host } + priority: { name: Type } + + list: + peer_method: doSelectJoinUser + title: Logs + display: [created_at, _priority, message, _user_id, host] + filters: [created_at, priority, message, user_id, host] + max_per_page: '$this->getUser()->getResultsPerPage("pager")' + sort: [created_at, desc] + fields: + created_at: { params: align=left center } + user_id: { params: align=left } + message: { params: align=left } + host: { params: align=left } + priority: { params: align=left } + object_actions: + delete: { name: Delete, action: delete, icon: trash.gif, params: confirm=Are you sure? } + actions: {} + + edit: {} diff --git a/apps/admin/modules/log/config/security.yml b/apps/admin/modules/log/config/security.yml new file mode 100644 index 0000000..60868c9 --- /dev/null +++ b/apps/admin/modules/log/config/security.yml @@ -0,0 +1,2 @@ +all: + credentials: [superadmin] diff --git a/apps/admin/modules/log/templates/_priority.php b/apps/admin/modules/log/templates/_priority.php new file mode 100644 index 0000000..2427ac7 --- /dev/null +++ b/apps/admin/modules/log/templates/_priority.php @@ -0,0 +1 @@ +<?php echo image_tag(($log_entry->getPriority()<3?"information.gif":($log_entry->getPriority()<4?"warning.gif":"error.gif")),"alt=[!] border=0") ?><?php echo $log_entry->getLevel() ?> diff --git a/apps/admin/modules/log/templates/_user_id.php b/apps/admin/modules/log/templates/_user_id.php new file mode 100644 index 0000000..737a1c7 --- /dev/null +++ b/apps/admin/modules/log/templates/_user_id.php @@ -0,0 +1 @@ +<?php echo ($log_entry->getUser() ? $log_entry->getUser(): "Anonymous") ?> diff --git a/apps/admin/modules/log/templates/clearSuccess.php b/apps/admin/modules/log/templates/clearSuccess.php new file mode 100644 index 0000000..83508eb --- /dev/null +++ b/apps/admin/modules/log/templates/clearSuccess.php @@ -0,0 +1,12 @@ + <div id="context"> + <?php echo use_helper("Asset", "Form", "Object", "Validation") ?> + <?php echo form_tag("log/clear")?> + <h1>Clear Log</h1> + + <hr size="1" /> + + <h2>Do you really want to remove all log entries?</h2> + + <div class="formaction"><?php echo submit_tag("Yes") ?><?php echo button_to("Cancel", "log/list") ?></div> + </form> + </div> |