class extends AdminController { var $controller_information = ' management area.'; array('id'=>'".AkInflector::humanize($controller_name)."','url'=>array('controller'=>'".AkInflector::underscore($controller_name)."','action'=>'listing')));\n"; echo " var \$controller_menu_options = array("; foreach (array('listing','add') as $k){ echo "'".AkInflector::humanize($k)."'=> array('id'=>'$k','url'=>array('controller'=>'".AkInflector::underscore($controller_name)."','action'=>'$k')),"; } echo ");\n\n"; ?> function index() { $this->redirectToAction('listing'); } function () { } function listing() { $this->_pages = $this->pagination_helper->getPaginator($this->, array('items_per_page' => 10)); $options = $this->pagination_helper->getFindOptions($this->); $this-> =& $this->->find('all', $options); } function show() { if(!empty($this->params['id'])){ if($this->->find(@$this->params['id'])){ $this-> = $this->->find(@$this->params['id']); }else{ $this->flash['error'] = $this->t(' not found.'); $this->redirectToAction('listing'); } }else{ $this->flash['error'] = $this->t(' not found.'); $this->redirectToAction('listing'); } } function add() { if(!empty($this->params[''])){ $this->->setAttributes($this->params['']); if ($this->Request->isPost() && $this->->save()){ $this->flash_options = array('seconds_to_close' => 10); $this->flash['notice'] = $this->t(' was successfully created.'); $this->redirectTo(array('action' => 'show', 'id' => $this->->getId())); } } } function edit() { if(!empty($this->params['id'])){ if($this->->find(@$this->params['id'])){ $this-> =& $this->->find($this->params['id']); if(!empty($this->params[''])){ $this->->setAttributes($this->params['']); if($this->Request->isPost() && $this->->save()){ $this->flash_options = array('seconds_to_close' => 10); $this->flash['notice'] = $this->t(' was successfully updated.'); $this->redirectTo(array('action' => 'show', 'id' => $this->->getId())); } } }else{ $this->flash['error'] = $this->t(' not found.'); $this->redirectToAction('listing'); } }else{ $this->flash['error'] = $this->t(' not found.'); $this->redirectToAction('listing'); } } function destroy() { if(!empty($this->params['id'])){ if($this->->find(@$this->params['id'])){ if($this-> =& $this->->find($this->params['id'])){ if($this->Request->isPost()){ $this->->destroy(); $this->flash_options = array('seconds_to_close' => 10); $this->flash['notice'] = $this->t(' was successfully deleted.'); $this->redirectToAction('listing'); } } }else{ $this->flash['error'] = $this->t(' not found.'); $this->redirectToAction('listing'); } }else{ $this->flash['error'] = $this->t(' not found.'); $this->redirectToAction('listing'); } } } ?>