示例#1
0
 /**
  * Before
  */
 public function before()
 {
     parent::before();
     // Local menus
     $this->local_menus = array('index' => array('name' => 'index', 'url' => URL::site("{$this->settings->backend_name}/users", 'http')), 'edit' => array('name' => 'edit', 'url' => URL::site("{$this->settings->backend_name}/users/edit/{$this->request->param('key')}", 'http')), 'detail' => array('name' => 'detail', 'url' => URL::site("{$this->settings->backend_name}/users/detail/{$this->request->param('key')}", 'http')));
     // local menus set current
     foreach ($this->local_menus as $key => &$value) {
         if ($key == strtolower($this->request->action())) {
             $value['current'] = TRUE;
         }
     }
     // Set partial
     $this->partials['local_menu'] = Tpl::get_file('local_menu', $this->settings->back_tpl_dir);
 }
示例#2
0
 /**
  * Before
  */
 public function before()
 {
     parent::before();
     // Local menus
     $this->local_menus = array('form' => array('name' => 'form', 'url' => URL::site("{$this->settings->backend_name}/search/form", 'http')), 'result' => array('name' => 'result', 'url' => URL::site("{$this->settings->backend_name}/search/result", 'http')));
     // local menus set current
     foreach ($this->local_menus as $key => &$value) {
         if ($key == strtolower($this->request->action())) {
             $value['current'] = TRUE;
         }
     }
     // Set partial
     $this->partials['local_menu'] = Tpl::get_file('local_menu', $this->settings->back_tpl_dir);
 }
示例#3
0
 /**
  * Before
  */
 public function before()
 {
     parent::before();
     // Local menus
     $this->local_menus = array('index' => array('name' => 'index', 'url' => URL::site("{$this->settings->backend_name}/home", 'http')), 'syntax' => array('name' => 'syntax', 'url' => URL::site("{$this->settings->backend_name}/home/syntax", 'http')), 'about' => array('name' => 'about', 'url' => URL::site("{$this->settings->backend_name}/home/about", 'http')));
     // local menus set current
     foreach ($this->local_menus as $key => &$value) {
         if ($key == strtolower($this->request->action())) {
             $value['current'] = TRUE;
         }
     }
     // Set partial
     $this->partials['local_menu'] = Tpl::get_file('local_menu', $this->settings->back_tpl_dir);
 }
示例#4
0
 /**
  * Before
  */
 public function before()
 {
     parent::before();
     // Local menus
     $this->local_menus = array('index' => array('name' => 'index', 'url' => URL::site("{$this->settings->backend_name}/settings", 'http')), 'frontend' => array('name' => 'frontend', 'url' => URL::site("{$this->settings->backend_name}/settings/frontend", 'http')));
     // local menus set current
     foreach ($this->local_menus as $key => &$value) {
         if ($key == strtolower($this->request->action())) {
             $value['current'] = TRUE;
         }
     }
     // Set partial
     $this->partials['local_menu'] = Tpl::get_file('local_menu', $this->settings->back_tpl_dir);
     // email types
     $this->email_types = array(array('value' => 'text/plain'), array('value' => 'text/html'));
 }
示例#5
0
 /**
  * Before
  */
 public function before()
 {
     parent::before();
     // Local menus
     $this->local_menus = array('setting' => array('name' => 'setting', 'url' => URL::site("{$this->settings->backend_name}/emails/setting", 'http')), 'index' => array('name' => 'index', 'url' => URL::site("{$this->settings->backend_name}/emails", 'http')), 'edit' => array('name' => 'edit', 'url' => URL::site("{$this->settings->backend_name}/emails/edit/{$this->request->param('key')}", 'http')), 'receive' => array('name' => 'receive', 'url' => URL::site("{$this->settings->backend_name}/emails/receive/{$this->request->param('key')}", 'http')), 'confirm' => array('name' => 'confirm', 'url' => URL::site("{$this->settings->backend_name}/emails/confirm/{$this->request->param('key')}", 'http')), 'rule' => array('name' => 'rule', 'url' => URL::site("{$this->settings->backend_name}/emails/rule/{$this->request->param('key')}", 'http')));
     // local menus set current
     foreach ($this->local_menus as $key => &$value) {
         if ($key == strtolower($this->request->action())) {
             $value['current'] = TRUE;
         }
     }
     // Set partial
     $this->partials['local_menu'] = Tpl::get_file('local_menu', $this->settings->back_tpl_dir);
     // email types
     $this->email_types = array(array('value' => 'text/plain'), array('value' => 'text/html'));
 }
示例#6
0
 /**
  * Before
  */
 public function before()
 {
     parent::before();
     // Local menus
     $this->local_menus = array('setting' => array('name' => 'setting', 'url' => URL::site("{$this->settings->backend_name}/author/setting", 'http')), 'login' => array('name' => 'login', 'url' => URL::site("{$this->settings->backend_name}/author/login", 'http')), 'register' => array('name' => 'register', 'url' => URL::site("{$this->settings->backend_name}/author/register", 'http')), 'activate_mail' => array('name' => 'activate mail', 'url' => URL::site("{$this->settings->backend_name}/author/activate_mail", 'http')), 'activate' => array('name' => 'activate', 'url' => URL::site("{$this->settings->backend_name}/author/activate", 'http')), 'forgot' => array('name' => 'forgot', 'url' => URL::site("{$this->settings->backend_name}/author/forgot", 'http')), 'reset_mail' => array('name' => 'reset mail', 'url' => URL::site("{$this->settings->backend_name}/author/reset_mail", 'http')), 'reset' => array('name' => 'reset', 'url' => URL::site("{$this->settings->backend_name}/author/reset", 'http')), 'resign' => array('name' => 'resign', 'url' => URL::site("{$this->settings->backend_name}/author/resign", 'http')), 'account' => array('name' => 'account', 'url' => URL::site("{$this->settings->backend_name}/author/account", 'http')), 'password' => array('name' => 'password', 'url' => URL::site("{$this->settings->backend_name}/author/password", 'http')), 'detail' => array('name' => 'detail', 'url' => URL::site("{$this->settings->backend_name}/author/detail", 'http')));
     // email types
     $this->email_types = array(array('value' => 'text/plain'), array('value' => 'text/html'));
     // local menus set current
     foreach ($this->local_menus as $key => &$value) {
         if ($key == strtolower($this->request->action())) {
             $value['current'] = TRUE;
         }
     }
     // Set partial
     $this->partials['local_menu'] = Tpl::get_file('local_menu', $this->settings->back_tpl_dir);
 }
示例#7
0
 /**
  * Before
  */
 public function before()
 {
     parent::before();
     // イメージデリートのとき
     if ($this->request->action() == 'image_delete') {
         // logged in userのroleとuser_idをチェックして、editの場合user_idが一致しないと404
         if ($this->logged_in_user->role == 'edit' and !($this->logged_in_user->id == $this->item->user_id)) {
             throw HTTP_Exception::factory(404);
         }
     } elseif ($this->request->action() == 'received_comment_delete') {
         // logged in userのroleとuser_idをチェックして、editの場合user_idが一致しないと404
         if ($this->logged_in_user->role == 'edit' and !($this->logged_in_user->id == $this->item->user_id)) {
             throw HTTP_Exception::factory(404);
         }
     } elseif ($this->request->action() != 'index') {
         // Get id from param, if there is nothing then throw to 404:これをbeforeでおこなう?
         $id = $this->request->param('key');
         if (!$id) {
             throw HTTP_Exception::factory(404);
         }
         // Get item, if there is nothing then throw to 404:これもbeforeでおこなう?
         $this->item = Tbl::factory('items')->get($id);
         if (!$this->item) {
             throw HTTP_Exception::factory(404);
         }
         // logged in userのroleとuser_idをチェックして、editの場合user_idが一致しないと404
         if ($this->logged_in_user->role == 'edit' and !($this->logged_in_user->id == $this->item->user_id)) {
             throw HTTP_Exception::factory(404);
         }
         $this->frontend_link = array('title' => $this->item->segment, 'url' => URL::base('http') . $this->item->segment);
     }
     /**
      * Local menu
      */
     $this->local_menus = array('index' => array('name' => 'index', 'url' => URL::site("{$this->settings->backend_name}/items/{$this->request->param('division')}", 'http')), 'edit' => array('name' => 'edit', 'url' => URL::site("{$this->settings->backend_name}/items/{$this->request->param('division')}/edit/{$this->request->param('key')}", 'http')), 'content' => array('name' => 'content', 'url' => URL::site("{$this->settings->backend_name}/items/{$this->request->param('division')}/content/{$this->request->param('key')}", 'http')), 'images' => array('name' => 'images', 'url' => URL::site("{$this->settings->backend_name}/items/{$this->request->param('division')}/images/{$this->request->param('key')}", 'http')), 'fields' => array('name' => 'fields', 'url' => URL::site("{$this->settings->backend_name}/items/{$this->request->param('division')}/fields/{$this->request->param('key')}", 'http')), 'received_comments' => array('name' => 'received comments', 'url' => URL::site("{$this->settings->backend_name}/items/{$this->request->param('division')}/received-comments/{$this->request->param('key')}", 'http')));
     // local menus set current
     foreach ($this->local_menus as $key => &$value) {
         if ($key == $this->request->action()) {
             $value['current'] = TRUE;
         }
     }
     // Set partial
     $this->partials['local_menu'] = Tpl::get_file('local_menu', $this->settings->back_tpl_dir);
 }