From 9f108dd1a969473375341d92a7b1252fa2cedc9a Mon Sep 17 00:00:00 2001 From: mszulecki Date: Thu, 14 Jun 2007 17:09:01 +0000 Subject: Initial import. git-svn-id: http://svn.sukimashita.com/repos/mailadmin/trunk@2 4281df72-ff29-0410-8fee-2d9ac0c5f5a7 --- apps/admin/modules/log/actions/actions.class.php | 46 +++++++++++++++++++++++ apps/admin/modules/log/config/generator.yml | 30 +++++++++++++++ apps/admin/modules/log/config/security.yml | 2 + apps/admin/modules/log/templates/_priority.php | 1 + apps/admin/modules/log/templates/_user_id.php | 1 + apps/admin/modules/log/templates/clearSuccess.php | 12 ++++++ 6 files changed, 92 insertions(+) create mode 100644 apps/admin/modules/log/actions/actions.class.php create mode 100644 apps/admin/modules/log/config/generator.yml create mode 100644 apps/admin/modules/log/config/security.yml create mode 100644 apps/admin/modules/log/templates/_priority.php create mode 100644 apps/admin/modules/log/templates/_user_id.php create mode 100644 apps/admin/modules/log/templates/clearSuccess.php (limited to 'apps/admin/modules/log') 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 @@ +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 @@ +getPriority()<3?"information.gif":($log_entry->getPriority()<4?"warning.gif":"error.gif")),"alt=[!] border=0") ?>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 @@ +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 @@ +