当前位置: 首页>>代码示例>>PHP>>正文


PHP Notify::instance方法代码示例

本文整理汇总了PHP中Notify::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Notify::instance方法的具体用法?PHP Notify::instance怎么用?PHP Notify::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Notify的用法示例。


在下文中一共展示了Notify::instance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: instance

 public static function instance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:7,代码来源:Notify.php

示例2: before

 public function before()
 {
     //$this->redirect('http://ehistory.kz/manage');
     parent::before();
     $this->response->headers('cache-control', 'private');
     // creating and attaching page metadata
     $this->metadata = new Model_Metadata();
     $this->metadata->title(__(Application::instance()->get('title')), false);
     $this->set('_metadata', $this->metadata);
     Auth::instance()->auto_login();
     if (!Auth::instance()->logged_in()) {
         $this->redirect('manage/auth/login');
     } else {
         $id = Auth::instance()->get_user()->id;
         $user = ORM::factory('user', $id);
         $input = $user->has('roles', ORM::factory('role', array('name' => 'admin'))) || $user->has('roles', ORM::factory('Role', array('name' => 'moderator')));
         $input_redactor = $user->has('roles', ORM::factory('Role', array('name' => 'redactor')));
         if (!$input && !$input_redactor) {
             $this->redirect('/manage/auth/logout');
         }
         if (!$input && (strtolower($this->request->controller()) != 'ehistory' && strtolower($this->request->controller()) != 'language')) {
             $this->redirect('manage/ehistory');
         }
     }
     $this->user = Auth::instance()->get_user();
     if (Request::$initial === Request::$current) {
         $messages = Notify::instance()->get_all_once();
         $this->set('_notifications', $messages);
     }
     $language = Session::instance()->get('_language', 'ru');
     $this->language = in_array($language, array('ru', 'en', 'kz')) ? $language : 'ru';
     I18n::lang($this->language);
     $rr = Request::initial()->uri() . urlencode(URL::query(null, true));
     $rr = trim($rr, '/');
     //$this->metadata->title('Sharua.kz', false);
     $countcomm = ORM::factory('Comment')->where('status', '=', '0')->count_all();
     //смотрим сколько новых коментов
     $this->set('_user', $this->user)->set('_language', $this->language)->set('_return_url', $rr)->set('_countcomm', $countcomm);
     //вносим в переменную количество новых коментов
     $knigi = ORM::factory('Book')->where('category_id', '=', '0')->find_all();
     //смотрим сколько книг без категории
     if ($knigi) {
         if (count($knigi) > 0) {
             $this->set('_uncatcount', count($knigi));
             //вносим в переменную количество книг без категории
         }
     }
     $this->referrer = Request::initial()->referrer();
     if (Message::get()) {
         $this->set('basic_message', Message::display('/message/basic'));
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:52,代码来源:Core.php

示例3: action_unblock

 public function action_unblock()
 {
     $this->set('cancel_url', Url::media('manage/users/page-' . $this->page));
     $user_id = (int) $this->request->param('id', 0);
     $token = Arr::get($_POST, 'token', false);
     if ($this->request->method() == Request::POST && Security::token() === $token) {
         $user = ORM::factory('User', $user_id);
         if ($user->loaded()) {
             $user->addRole(1, $user_id);
             $this->redirect('manage/users/page-' . $this->page);
         }
     } else {
         $user = ORM::factory('User', $user_id);
         if ($user->loaded()) {
             $this->set('record', $user)->set('token', Security::token(true))->set('cancel_url', Url::media('manage/users/page-' . $this->page));
         } else {
             Notify::instance()->add('Нет такого пользователя для разблокировки')->save();
             $this->redirect('manage/users/page-' . $this->page);
         }
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:21,代码来源:Users.php


注:本文中的Notify::instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。