Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce4ebe2
commit 85f94b7
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* | ||
* | ||
*/ | ||
class ModulesController extends ManagementAppController{ | ||
var $name = 'Modules'; | ||
|
||
function beforeFilter() { | ||
parent::beforeFilter(); | ||
} | ||
|
||
function admin_index() { | ||
$modules = $this->paginate(); | ||
$this->set(compact('modules')); | ||
} | ||
|
||
function admin_add() { | ||
if (!empty($this->data)) { | ||
$this->Module->create(); | ||
if ($this->Module->saveAll($this->data)) { | ||
$this->Session->setFlash('Your moodule has been saved.'); | ||
$this->redirect(array('action' => 'index')); | ||
} | ||
} | ||
} | ||
|
||
function admin_edit($id = null) { | ||
if (!$id) { | ||
$this->Session->setFlash(__('That module could not be found', true), true); | ||
$this->redirect($this->referer()); | ||
} | ||
|
||
if (!empty($this->data)) { | ||
if ($this->Module->save($this->data)) { | ||
$this->Session->setFlash(__('Your module has been saved.', true)); | ||
$this->redirect(array('action' => 'index')); | ||
} | ||
|
||
$this->Session->setFlash(__('Your module could not be saved.', true)); | ||
} | ||
|
||
if ($id && empty($this->data)) { | ||
$this->data = $this->Module->read(null, $id); | ||
} | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
/** | ||
* | ||
* | ||
*/ | ||
class Module extends ManagementAppModel{ | ||
var $name = 'Module'; | ||
} | ||
?> |