public function action_preferences() { $view = View::factory('notice/preferences')->bind('notices', $notices)->bind('pref_email', $pref_email)->bind('pref_sms', $pref_sms)->bind('menu', $menu)->bind('success', $success); if ($this->request->method() === 'POST' && $this->request->post()) { if ($this->request->post('pref')) { $noticesetting = ORM::factory('noticesetting')->where('institution_id', ' = ', 1)->find(); $noticesetting->preferences = serialize($this->request->post('pref')); $noticesetting->save(); Session::instance()->set('success', 'Notice preferences modified successfully'); Request::current()->redirect('notice/preferences'); } } $notices = Kohana::config('notices')->as_array(); $pref_email = Notice::instance()->preferences('email'); $pref_sms = Notice::instance()->preferences('sms'); $menu = $this->menu('preferences'); $success = Session::instance()->get_once('success'); $this->content = $view; }
<?php defined('SYSPATH') or die('No direct script access.'); DynamicMenu::extend(array('sidemenu' => array(array('exam', 'Exam', 5, array())))); // register handler class for sending exam related notices upon various events Notice::instance()->register_handler('exam'); Hook::instance()->register("send_reminder", 'Model_Exam::send_exam_reminder'); Hook::instance()->register("course_count", 'Model_Exam::get_course_exams_count'); Route::set('exam', '(<controller>(/<action>(/<params>)))', array('params' => '.*?'))->defaults(array('controller' => 'exam', 'action' => 'index'));