本文整理汇总了PHP中SessionUtils::getDashboardId方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionUtils::getDashboardId方法的具体用法?PHP SessionUtils::getDashboardId怎么用?PHP SessionUtils::getDashboardId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionUtils
的用法示例。
在下文中一共展示了SessionUtils::getDashboardId方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
try {
$this->getNotifications();
$this->loadDashboardUser();
$view = $this->getView();
$model = $this->getModel();
$view->uploadJS();
if (!is_null(SessionUtils::getError())) {
$view->setResponse(SessionUtils::getError());
SessionUtils::setError(NULL);
} else {
$view->setArg("searchFriendsList", NULL);
}
$userLogged = SessionUtils::getUserLogged();
$userProfile = SessionUtils::getDashboardId() !== $userLogged->getUserId() ? SessionUtils::getDashboardId() : $userLogged->getUserId();
$friendList = $model->getUserFriendsList($userProfile);
$view->setArg('friendsList', $friendList);
SessionUtils::setLastPageVisited(FRIENDS_CONTROLLER);
$view->setArg(LAST_NAV_ITEM_SELECTED, 6);
$view->loadPage();
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (UserNotAuthenticatedExceptionDTO $authExp) {
SessionUtils::logout();
header("Location:" . URL . LOGIN_CONTROLLER);
} catch (Exception $e) {
throw $e;
}
}
示例2: index
public function index()
{
// $responseDTO = NULL) {
try {
$this->getNotifications();
$this->loadDashboardUser();
$view = $this->getView();
$model = $this->getModel();
$view->setArg(LAST_NAV_ITEM_SELECTED, 3);
$view->uploadJS();
if (!is_null(SessionUtils::getError())) {
$view->setResponse(SessionUtils::getError());
SessionUtils::setError(NULL);
}
$userInfo = $model->getUserInfoModel(SessionUtils::getDashboardId());
$view->setArg('userInfo', $userInfo);
SessionUtils::setLastPageVisited(PROFILE_SETTINGS_CONTROLLER);
$view->loadPage();
} catch (UserNotAuthenticatedExceptionDTO $authExp) {
SessionUtils::logout();
header("Location:" . URL . LOGIN_CONTROLLER);
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (Exception $e) {
throw $e;
}
}
示例3: loadProfile
function loadProfile($view, $model)
{
try {
if (!is_null(SessionUtils::getAuthorId()) && !is_null(SessionUtils::getPost()) && !SessionUtils::isAdmin()) {
$postDto = $model->getPostModel(SessionUtils::getPost());
$view->setArg("notificationPost", $postDto);
$commentPostList = $model->getCommentPostList(SessionUtils::getPost());
$commentListIndex = 'notificationCommentList' . SessionUtils::getPost();
$view->setArg($commentListIndex, $commentPostList);
SessionUtils::setPost(NULL);
SessionUtils::setAuthorId(NULL);
} else {
$userAlbumListDTO = $model->getUserAlbumList(SessionUtils::getDashboardId());
$view->setArg('userAlbumList', $userAlbumListDTO);
$postList = $model->getPostsListModel(SessionUtils::getDashboardId());
$view->setArg('postList', $postList);
if (!is_null($postList)) {
for ($i = 0; $i < sizeof($postList); $i++) {
$index = 'post' . $i;
$postId = $postList[$index]->getPostId();
$commentPostList = $model->getCommentPostList($postId);
$commentListIndex = 'commentPostList' . $postId;
$view->setArg($commentListIndex, $commentPostList);
}
}
if (!is_null(SessionUtils::getError())) {
$view->setResponse(SessionUtils::getError());
if (!is_null(SessionUtils::getFormValue())) {
$view->setFormData(SessionUtils::getFormValue(), WRITE_POST_FORM);
}
SessionUtils::setError(NULL);
SessionUtils::setFormValue(NULL);
}
}
$view->loadPage();
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (UserNotAuthenticatedExceptionDTO $authExp) {
throw $authExp;
} catch (Exception $e) {
throw $e;
}
}
示例4: index
function index()
{
try {
$this->getNotifications();
$userLogged = SessionUtils::getUserLogged();
$view = $this->getView();
$model = $this->getModel();
SessionUtils::setDashboardId($userLogged->getUserId());
$view->uploadJS();
if (!is_null(SessionUtils::getError())) {
$view->setResponse(SessionUtils::getError());
SessionUtils::setError(NULL);
}
SessionUtils::setLastPageVisited(HOME_CONTROLLER);
$homePostList = $model->getHomePostsListModel($userLogged->getUserId());
$view->setArg('homePostList', $homePostList);
if (!is_null($homePostList)) {
for ($i = 0; $i < sizeof($homePostList); $i++) {
$index = 'post' . $i;
$postId = $homePostList[$index]->getPostId();
$commentPostList = $model->getCommentPostList($postId);
$commentListIndex = 'commentPostList' . $postId;
$view->setArg($commentListIndex, $commentPostList);
}
}
$userInfo = $model->getUserInfoModel(SessionUtils::getDashboardId());
$view->setArg('userInfo', $userInfo);
$view->setArg(LAST_NAV_ITEM_SELECTED, 0);
$view->loadPage();
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (UserNotAuthenticatedExceptionDTO $authExp) {
SessionUtils::logout();
header("Location:" . URL . LOGIN_CONTROLLER);
} catch (Exception $e) {
throw $e;
}
}
示例5: index
public function index()
{
try {
$this->getNotifications();
$this->loadDashboardUser();
SessionUtils::setLastPageVisited(ALBUM_CONTROLLER);
$view = $this->getView();
$model = $this->getModel();
$view->uploadJS();
$view->setArg('userCanWrite', SessionUtils::userCanWrite());
$view->setArg('albumOwnerId', SessionUtils::getDashboardId());
if (!is_null(SessionUtils::getAlbumId())) {
$albumDTO = $model->getAlbumModel(SessionUtils::getAlbumId());
$view->setArg("notificationAlbum", $albumDTO);
SessionUtils::setAlbumId(NULL);
} else {
$userAlbums = $model->getUserAlbumsModel(SessionUtils::getDashboardId());
$view->setArg('userAlbumList', $userAlbums);
if (!is_null(SessionUtils::getError())) {
$view->setResponse(SessionUtils::getError());
$view->setFormData(SessionUtils::getFormValue(), ADD_ALBUM_FORM);
SessionUtils::setError(NULL);
SessionUtils::setFormValue(NULL);
}
}
$view->setArg(LAST_NAV_ITEM_SELECTED, 5);
$view->loadPage();
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (UserNotAuthenticatedExceptionDTO $authExp) {
SessionUtils::logout();
header("Location:" . URL . LOGIN_CONTROLLER);
} catch (Exception $e) {
throw $e;
}
}
示例6: commentAPostModel
public function commentAPostModel($commentForm, $postId = NULL)
{
$responseDTO = new ResponseDTO(WRITE_COMMENT_FORM);
$formObjRaw = new FormDTO(WRITE_COMMENT_FORM, $commentForm);
$formObjRaw->setSubElementId($postId);
try {
$formDataObj = $formObjRaw->getFormData();
$responseDTO->setSubElementId($formDataObj[WRITE_COMMENT_FORM . POSTID]);
$validator = new FormValidator(WRITE_COMMENT_FORM, $formDataObj);
$validationError = $validator->checkAll();
if (sizeof($validationError) == 0) {
$timestamp = date(DATE_FORMAT);
$userLogged = SessionUtils::getUserLogged();
$newCommentDTO = new CommentDTO(NULL, $formDataObj[WRITE_COMMENT_FORM . TEXT], $timestamp, $formDataObj[WRITE_COMMENT_FORM . POSTID], $userLogged);
$postDAO = new PostDAO();
$commentDTO = $postDAO->insertNewComment($newCommentDTO);
if ($commentDTO->getCommentid() == 0) {
$responseDTO->setResponseSucc("Non è stato possibile inserire il commento del post");
} else {
DataModelUtils::notifyAction($commentDTO->getCommentid() . SEPARATOR . $formDataObj[WRITE_COMMENT_FORM . POSTID] . SEPARATOR . $userLogged->getUserId() . SEPARATOR . SessionUtils::getDashboardId(), WRITE_COMMENT_FORM);
return $commentDTO;
}
} else {
if (array_key_exists(TEXT, $validationError)) {
$responseDTO->setErrField(TEXT, $validationError[TEXT]);
}
return $responseDTO;
}
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (UserNotAuthenticatedExceptionDTO $authExp) {
throw $authExp;
} catch (Exception $e) {
throw $e;
}
}
示例7: userCanReadProfile
public static function userCanReadProfile()
{
$userProfile = SessionUtils::getDashboardId();
$userFriendsList = SessionUtils::getUserLoggedFriendsList();
return array_key_exists($userProfile, $userFriendsList);
}
示例8:
<?php
if (!(SessionUtils::isAdmin() && is_null(SessionUtils::getDashboardId()))) {
?>
<div class="thumbnail">
<nav class="navbar">
<ul id="commonNavBarItem" class="nav nav-pills nav-stacked ">
<?php
$lastNavbarItemSelected = $this->getArg(LAST_NAV_ITEM_SELECTED);
if ($lastNavbarItemSelected == 4) {
?>
<li class="active">
<a href="<?php
echo URL . PROFILE_CONTROLLER;
?>
">
<span class="glyphicon glyphicon-send"></span>
<span class="lateralNavBarItemName">Profile</span>
</a>
</li>
<li>
<a href="<?php
echo URL . ALBUM_CONTROLLER;
?>
">
<span class="glyphicon glyphicon-plane"></span>
<span class="lateralNavBarItemName">Album</span>
</a>
</li>
示例9:
?>
" placeholder="what are you thinking about?"/>
</div>
<div class="errorDiv" id="write_post_text_error">
<span><?php
echo $this->getArg('write_post_text_error');
?>
</span>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-2 col-lg-2">
<input name="write_post_dashboardid" id ="write_post_dashboardid" type="hidden" value="<?php
echo SessionUtils::getDashboardId();
?>
"/>
<input name="write_post_longitude" id ="write_post_longitude" type="hidden"/>
<input name="write_post_latitude" id ="write_post_latitude" type="hidden"/>
<div id="postPhotoDiv">
<label id="write_post_photo_label" for="write_post_photo" class="btn btn-primary btn-group-justified">
<span class="glyphicon glyphicon-picture"></span>
</label>
<input type="file" id="write_post_photo" name="write_post_photo"/>
</div>
<div class="errorDiv" id="write_post_photo_error" >
<?php
echo $this->getArg('write_post_photo_error');
?>
示例10: loadDashboardUser
function loadDashboardUser()
{
if (SessionUtils::getDashboardId() != 1) {
$userDAO = new UserDAO();
$dashboardUser = $userDAO->getUserByUserId(SessionUtils::getDashboardId());
$this->view->setArg('dashboardUser', $dashboardUser);
}
}