Exemplo n.º 1
0
$adminView = false;
if ($isAdmin && !empty(zbase_route_input('id'))) {
    $adminView = true;
    $moduleName = 'admin-user';
    $selectedUser = zbase_user_byid(zbase_route_input('id'));
    if (!$selectedUser instanceof \Zbase\Entity\Laravel\User\User) {
        zbase_abort(404);
        exit;
    }
    $page = [];
    $page['title'] = '<span class="userDisplayName' . $selectedUser->id() . '">' . $selectedUser->roleTitle() . ' - ' . $selectedUser->id() . ': ' . $selectedUser->displayName() . '</span>' . $selectedUser->statusText();
    $page['headTitle'] = $selectedUser->displayName();
    $page['subTitle'] = $selectedUser->email() . '|' . $selectedUser->username() . '|' . $selectedUser->cityStateCountry();
    zbase_view_page_details(['page' => $page]);
    $breadcrumbs = [['label' => 'Users', 'route' => ['name' => 'admin.users']], ['label' => '<span class="userDisplayName' . $selectedUser->id() . '">' . $selectedUser->displayName() . '</span>', 'link' => '#', 'title' => $selectedUser->displayName()]];
    zbase_view_breadcrumb($breadcrumbs);
} else {
    $selectedUser = zbase_auth_user();
}
$accountTabs = [];
$accountContents = [];
$accountContents[] = ['position' => 10, 'groupId' => 'information', 'content' => function () use($selectedUser) {
    return zbase_view_render(zbase_view_file_module('account.views.information', 'account', 'zbase'), ['user' => $selectedUser]);
}];
$accountContents[] = ['position' => 10, 'groupId' => 'notification', 'content' => function () use($selectedUser) {
    return zbase_view_render(zbase_view_file_module('account.views.notifications', 'account', 'zbase'), ['user' => $selectedUser]);
}];
$accountContents = zbase_module_widget_contents('account', 'account', zbase_section(), $adminView, null, $accountContents);
$accountTabs = zbase_module_widget_contents('account', 'account', zbase_section(), $adminView, 'tabs');
$widgetConfig = ['config' => ['entity' => ['entity' => $selectedUser]]];
?>
Exemplo n.º 2
0
/**
 * Extract Page Details from the given $config/array
 * Will check for index: navIndex => nav.front.main.navIndex.meta
 * Will check for index: pageIndex => nav.front.main.navIndex.meta
 * @param array $config
 */
function zbase_view_page_details($config)
{
    if (!empty($config['navIndex'])) {
        $navIndex = $config['navIndex'];
        $meta = zbase_config_get('nav.front.main.' . $navIndex . '.meta', zbase_config_get('nav.main.' . $navIndex . '.meta', false));
    }
    if (!empty($config['pageIndex'])) {
        $pageIndex = $config['pageIndex'];
        $meta = zbase_config_get('page.front.' . $pageIndex . '.meta', zbase_config_get('page.' . $pageIndex . '.meta', false));
    }
    if (!empty($config['page'])) {
        $title = null;
        $headTitle = null;
        $subTitle = null;
        if (!empty($config['page']['title'])) {
            $title = $config['page']['title'];
        }
        if (!empty($config['page']['headTitle'])) {
            $headTitle = $config['page']['headTitle'];
        }
        if (!empty($config['page']['subTitle'])) {
            $subTitle = $config['page']['subTitle'];
        }
        zbase_view_pagetitle_set($headTitle, $title, $subTitle);
        if (!empty($config['page']['breadcrumbs'])) {
            zbase_view_breadcrumb($config['page']['breadcrumbs']);
        }
        $shortUrl = '';
        if (!empty($config['page']['shortUrl'])) {
            $shortUrl = $config['page']['shortUrl'];
        }
        if (!empty($config['page']['canonical'])) {
            zbase_view_canonicalUrl($config['page']['canonical'], $shortUrl);
        }
    }
    if (!empty($meta)) {
        zbase_view_extract_meta($meta);
    }
}
Exemplo n.º 3
0
 /**
  * Set Page Property
  * @param string $action The Controller Action
  * @param array $param some assoc array that can be replace to the string
  * @return void
  */
 public function pageProperties($action)
 {
     $section = zbase_section();
     if (zbase_request_is_post()) {
         $action = str_replace('post-', null, $action);
     }
     $title = $this->_v('controller.' . $section . '.action.' . $action . '.page.title', null);
     $headTitle = $this->_v('controller.' . $section . '.action.' . $action . '.page.headTitle', $title);
     $subTitle = $this->_v('controller.' . $section . '.action.' . $action . '.page.subTitle', null);
     $breadcrumbs = $this->_v('controller.' . $section . '.action.' . $action . '.page.breadcrumbs', $this->_v('controller.' . $section . '.action.index.page.breadcrumbs', []));
     zbase_view_pagetitle_set($headTitle, $title, $subTitle);
     if (!empty($breadcrumbs)) {
         zbase_view_breadcrumb($breadcrumbs);
     }
     return $this;
 }
Exemplo n.º 4
0
 /**
  * Set Page Property
  * @param string $action The Controller Action
  * @param array $param some assoc array that can be replace to the string
  * @return void
  */
 public function pageProperties($action)
 {
     $enable = $this->_v('page.' . $action . '.enable', false);
     if (!empty($enable)) {
         $title = $this->_v('page.' . $action . '.title', null);
         $headTitle = $this->_v('page.' . $action . '.headTitle', $title);
         $subTitle = $this->_v('page.' . $action . '.subTitle', null);
         $breadcrumbs = $this->_v('page.' . $action . '.breadcrumbs', []);
         if (!empty($title)) {
             zbase_view_pagetitle_set($headTitle, $title, $subTitle);
         }
         if (!empty($breadcrumbs)) {
             zbase_view_breadcrumb($breadcrumbs);
         }
     }
     return $this;
 }