コード例 #1
0
ファイル: UserProfile.php プロジェクト: rganin/magelight
 /**
  * Forgery constructor
  */
 public function __forge()
 {
     $user = \Magelight\Auth\Models\User::find(\Magelight\Http\Request::getInstance()->getGet('id'));
     if ($user) {
         $this->set('user', $user->asArray());
     }
 }
コード例 #2
0
ファイル: Top.php プロジェクト: rganin/magelight
 /**
  * {@inheritdoc}
  */
 public function initBlock()
 {
     $currentUserId = \Magelight\Http\Session::getInstance()->get('user_id', false);
     if ($currentUserId && ($userData = \Magelight\Auth\Models\User::find($currentUserId)->asArray())) {
         $this->set('user_id', $currentUserId);
         $this->set('user_data', $userData);
     }
     return parent::initBlock();
 }
コード例 #3
0
ファイル: Body.php プロジェクト: rganin/magelight
 /**
  * {@inheritdoc}
  */
 public function initBlock()
 {
     $currentUserId = \Magelight\Http\Session::getInstance()->get('user_id');
     if (!empty($currentUserId)) {
         if ($user = \Magelight\Auth\Models\User::find($currentUserId)) {
             $userData = $user->asArray();
             $this->setGlobal('user_data', $userData);
         }
     }
     $document = \Magelight\Core\Blocks\Document::getInstance();
     $document->addMeta(['http-equiv' => "content-type", 'content' => "text/html; charset=utf-8"]);
     $document->addCss('Magelight/Core/static/css/bootstrap.css');
     $document->addCss('Magelight/Core/static/css/hint.css');
     $document->addJs('Magelight/Core/static/js/jquery.js');
     $document->addJs('Magelight/Core/static/js/bootstrap.min.js');
     return parent::initBlock();
 }