コード例 #1
0
 /**
  * 文章详情.
  *
  * @param $id
  *
  * @return mixed
  */
 public function detail($id)
 {
     $article = $this->postRepository->find($id);
     $prevId = $id > 1 ? $id - 1 : 1;
     $nextId = $id > 1 ? $id - 1 : 1;
     return user_view('docment.detail', compact('article', 'prevId', 'nextId'));
 }
コード例 #2
0
 /**
  * 用户中心首页显示.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //       dump( get_user_avatar(1));
     //
     //        exit;
     // 当前用户的全部公众号
     $accounts = $this->accountRepository->all();
     return user_view('dashboard.index', compact('accounts'));
 }
コード例 #3
0
 /**
  * Tests account's available fields.
  */
 function testUserFields()
 {
     // Create the user to test the user fields.
     $user = User::create(['name' => 'foobar', 'mail' => '*****@*****.**']);
     $build = user_view($user);
     $output = \Drupal::service('renderer')->renderRoot($build);
     $this->setRawContent($output);
     $userEmail = $user->getEmail();
     $this->assertText($userEmail, "User's mail field is found in the twig template");
 }
コード例 #4
0
 /**
  * {@inheritdoc}
  */
 public function entityView()
 {
     $configuration = $this->getConfiguration();
     if ($account = user_load($configuration['entity id'])) {
         if ($this->entityAccess()) {
             return user_view($account, $configuration['view mode']);
         }
     }
     return FALSE;
 }
コード例 #5
0
 public function index()
 {
     $email = '*****@*****.**';
     $name = 'tianyong';
     $uid = 123;
     $code = 'abc';
     $data = ['email' => $email, 'name' => $name, 'uid' => $uid, 'activationcode' => $code];
     Mail::send('welcome', $data, function ($message) use($data) {
         $message->to($data['email'], $data['name'])->subject('abadafsl哈哈');
     });
     return user_view('docment.index');
 }
コード例 #6
0
ファイル: term_search.api.php プロジェクト: reasonat/pukka
/**
 * Act on a term being displayed as a search result.
 *
 * This hook is invoked from term_search_search_execute(), after
 * taxonomy_term_load() and taxonomy_term_view() have been called.
 *
 * @param $term
 *   The term object being display in a search result.
 *
 * @return
 *   A string (can include html) that will be added to the rendered search
 *   result for this term.
 */
function hook_term_search_result($term)
{
    $text = '';
    $query = db_select('users', 'u');
    $query->rightJoin('field_data_field_affiliation', 'a', 'a.entity_id=u.uid');
    $uids = $query->addField('u', 'uid')->condition('a.field_affiliation_tid', $term->tid)->countQuery()->execute()->fetchField();
    foreach ($uids as $uid) {
        $account = user_load($uid);
        $text .= user_view($account, 'department_search_result');
    }
    return $text;
}
コード例 #7
0
 /**
  * {@inheritdoc}
  */
 public function hookTokens($type, $tokens, array $data = array(), array $options = array())
 {
     $replacements = array();
     if ($this->isValidTokenType($type)) {
         foreach ($tokens as $name => $original) {
             if ($this->isValidToken($original)) {
                 $render = array();
                 $entity_id = $this->getEntityIdFromToken($original);
                 $view_mode = $this->getViewModeFromToken($original);
                 $render = array();
                 switch ($type) {
                     case 'node':
                         $node = node_load($entity_id);
                         if ($this->canViewNode($node)) {
                             $render = node_view($node, $view_mode);
                         }
                         break;
                     case 'term':
                         $term = taxonomy_term_load($entity_id);
                         $render = taxonomy_term_view($term, $view_mode);
                         break;
                     case 'user':
                         $account = user_load($entity_id);
                         if (user_access('access user profiles')) {
                             $render = user_view($account, $view_mode);
                         }
                         break;
                 }
                 // Remove contextual links for inline rendered entities.
                 if (module_exists('contextual')) {
                     unset($render['#contextual_links']);
                 }
                 $replacements[$original] = $render ? drupal_render($render) : '';
             }
         }
     }
     return $replacements;
 }
コード例 #8
0
 /**
  * @return mixed
  */
 public function getCreate()
 {
     return user_view('fan_group.edit');
 }
コード例 #9
0
 /**
  * 编辑备注表单.
  *
  * @param $id
  *
  * @return mixed
  */
 public function getEditRemark($id)
 {
     //获取旧备注信息
     $remark = $this->fanRepository->find($id)->remark;
     return user_view('fans.editremark')->with(['remark' => $remark]);
 }
コード例 #10
0
 /**
  * 显示创建表单.
  *
  * @return mixed
  */
 public function getCreate()
 {
     return user_view('qrcode.create');
 }
コード例 #11
0
 public function getIndex()
 {
     return user_view('data_stats.index');
 }
コード例 #12
0
 /**
  * 头像设置页面.
  *
  * @return mixed
  */
 public function index()
 {
     return user_view('profile.avatar');
 }
コード例 #13
0
 /**
  * Lockscreen.
  *
  * @return mixed
  */
 public function lock()
 {
     if (Auth::check()) {
         $lockedName = Auth::user()->name;
         $lockedAvatar = Auth::user()->avatar;
         // Store userinfo in session.
         \Session::put('locked_name', $lockedName, 60);
         \Session::put('locked_avatar', $lockedAvatar, 60);
         // logout
         Auth::guard($this->getGuard())->logout();
     } else {
         $lockedName = \Session::get('locked_name');
         $lockedAvatar = \Session::get('locked_avatar');
     }
     if (!$lockedName) {
         return redirect('user/login');
     }
     return user_view('auth.lock', compact('lockedName', 'lockedAvatar'));
 }
コード例 #14
0
 /**
  * 显示更新表单.
  *
  * @param $id
  *
  * @return mixed
  */
 public function getUpdate($id)
 {
     $menuData = $this->menuRepository->find($id);
     $topMenuList = $this->menuService->getTopMenu();
     return user_view('menu.create', compact('menuData', 'topMenuList'));
 }
コード例 #15
0
 public function getIndex()
 {
     return user_view('broadcast_news.index');
 }
コード例 #16
0
ファイル: User.php プロジェクト: saarmstrong/erdiko-drupal
 /**
  * Render user profile via drupal's theming engine
  */
 public function renderProfile($user)
 {
     return \drupal_render(\user_view($user));
 }
コード例 #17
0
 /**
  * 查看公众号对应接口信息.
  *
  * @param int $accountId
  *
  * @return \Illuminate\Http\Response
  */
 public function showInterface($accountId)
 {
     //公众号对应的 token
     $token = $this->accountRepository->find($accountId)->token;
     return user_view('account.interface', compact('token'));
 }
コード例 #18
0
 public function getUpdate($id)
 {
     return user_view('reply.textreplyform');
 }
コード例 #19
0
 /**
  * 显示表单.
  *
  * @return mixed
  */
 public function show()
 {
     // 原默认回复数据
     $replyData = $this->replyRepository->getDefaultReply();
     return user_view('reply.default', compact('replyData'));
 }
コード例 #20
0
 /**
  * @return mixed
  */
 public function getPassword()
 {
     return user_view('profile.password');
 }
コード例 #21
0
 /**
  * 显示表单.
  *
  * @return mixed
  */
 public function show()
 {
     // 原默认回复数据
     $replyData = $this->replyRepository->getSubscribeReply();
     return user_view('reply.subscribe', compact('replyData'));
 }