diff --git a/infinitas/management/controllers/modules_controller.php b/infinitas/management/controllers/modules_controller.php new file mode 100644 index 000000000..7de6787f6 --- /dev/null +++ b/infinitas/management/controllers/modules_controller.php @@ -0,0 +1,48 @@ +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); + } + } + } +?> \ No newline at end of file diff --git a/infinitas/management/models/module.php b/infinitas/management/models/module.php new file mode 100644 index 000000000..2c5d25ab4 --- /dev/null +++ b/infinitas/management/models/module.php @@ -0,0 +1,9 @@ + \ No newline at end of file