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


PHP Helper::CreateQuerystring方法代码示例

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


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

示例1: Execute

 public function Execute()
 {
     $viewData = array();
     $errors = array();
     if (Helper::IsLoggedInAdmin() && isset($_GET["loginAsUser"])) {
         // login as a certain user and redirect to his page
         if (Helper::LoginUserByUsername($_GET["loginAsUser"])) {
             Helper::Redirect("index.php?" . Helper::CreateQuerystring(getCurrentUser()));
         }
     }
     $viewData["Users"] = DataAccess::GetAllUsers(!Helper::IsLoggedInAdmin());
     $viewData["LastMapForEachUser"] = DataAccess::GetLastMapsForUsers("date");
     // last x maps
     $numberOfMaps = isset($_GET["lastMaps"]) && is_numeric($_GET["lastMaps"]) ? (int) $_GET["lastMaps"] : (isset($_GET["lastMaps"]) && $_GET["lastMaps"] == "all" ? 999999 : 10);
     $viewData["LastMaps"] = DataAccess::GetMaps(0, 0, 0, 0, null, $numberOfMaps, "createdTime", Helper::GetLoggedInUserID());
     // last x comments
     $numberOfComments = isset($_GET["lastComments"]) && is_numeric($_GET["lastComments"]) ? (int) $_GET["lastComments"] : (isset($_GET["lastComments"]) && $_GET["lastComments"] == "all" ? 999999 : 10);
     $viewData["LastComments"] = DataAccess::GetLastComments($numberOfComments, Helper::GetLoggedInUserID());
     $viewData["OverviewMapData"] = null;
     $categories = DataAccess::GetCategoriesByUserID();
     foreach ($viewData["LastMaps"] as $map) {
         $data = Helper::GetOverviewMapData($map, false, true, true, $categories);
         if ($data != null) {
             $viewData["OverviewMapData"][] = $data;
         }
     }
     if (isset($_GET["error"]) && $_GET["error"] == "email") {
         $errors[] = sprintf(__("ADMIN_EMAIL_ERROR"), ADMIN_EMAIL);
     }
     $viewData["Errors"] = $errors;
     return $viewData;
 }
开发者ID:andopor,项目名称:doma-project,代码行数:32,代码来源:users.controller.php

示例2: Execute

 public function Execute()
 {
     $viewData = array();
     $errors = array();
     // no user specified - redirect to user list page
     if (!getCurrentUser()) {
         Helper::Redirect("users.php");
     }
     // user is hidden - redirect to user list page
     if (!getCurrentUser()->Visible) {
         Helper::Redirect("users.php");
     }
     if (isset($_POST["cancel"])) {
         Helper::Redirect("index.php?" . Helper::CreateQuerystring(getCurrentUser()));
     }
     if (isset($_GET["action"]) && $_GET["action"] == "logout") {
         $location = "index.php?" . Helper::CreateQuerystring(getCurrentUser());
         Helper::LogoutUser();
         Helper::Redirect($location);
     }
     if (isset($_POST["login"])) {
         $currentUserID = getCurrentUser()->ID;
         if (Helper::LoginUser(stripslashes($_POST["username"]), stripslashes($_POST["password"]))) {
             if (getCurrentUser()->ID == $currentUserID) {
                 Helper::Redirect("index.php?" . Helper::CreateQuerystring(getCurrentUser()));
             }
         }
         $errors[] = __("INVALID_USERNAME_OR_PASSWORD");
     }
     if (isset($_POST["forgotPassword"])) {
         Helper::Redirect("send_new_password.php?" . Helper::CreateQuerystring(getCurrentUser()));
     }
     $viewData["Errors"] = $errors;
     return $viewData;
 }
开发者ID:andopor,项目名称:doma-project,代码行数:35,代码来源:login.controller.php

示例3: Execute

 public function Execute()
 {
     $viewData = array();
     // no user specified - redirect to user list page
     if (!getCurrentUser()) {
         Helper::Redirect("users.php");
     }
     // user is hidden - redirect to user list page
     if (!getCurrentUser()->Visible) {
         Helper::Redirect("users.php");
     }
     // the requested map
     $map = new Map();
     $map->Load($_GET["map"]);
     if (!$map->ID) {
         die("The map has been removed.");
     }
     DataAccess::UnprotectMapIfNeeded($map);
     if (Helper::MapIsProtected($map)) {
         die("The map is protected until " . date("Y-m-d H:i:s", Helper::StringToTime($map->ProtectedUntil, true)) . ".");
     }
     if ($map->UserID != getCurrentUser()->ID) {
         die;
     }
     $viewData["Comments"] = DataAccess::GetCommentsByMapId($map->ID);
     $viewData["Name"] = $map->Name . ' (' . date(__("DATE_FORMAT"), Helper::StringToTime($map->Date, true)) . ')';
     // previous map in archive
     $previous = DataAccess::GetPreviousMap(getCurrentUser()->ID, $map->ID, Helper::GetLoggedInUserID());
     $viewData["PreviousName"] = $previous == null ? null : $previous->Name . ' (' . date(__("DATE_FORMAT"), Helper::StringToTime($previous->Date, true)) . ')';
     // next map in archive
     $next = DataAccess::GetNextMap(getCurrentUser()->ID, $map->ID, Helper::GetLoggedInUserID());
     $viewData["NextName"] = $next == null ? null : $next->Name . ' (' . date(__("DATE_FORMAT"), Helper::StringToTime($next->Date, true)) . ')';
     $size = $map->GetMapImageSize();
     $viewData["ImageWidth"] = $size["Width"];
     $viewData["ImageHeight"] = $size["Height"];
     DataAccess::IncreaseMapViews($map);
     $viewData["Map"] = $map;
     $viewData["BackUrl"] = isset($_SERVER["HTTP_REFERER"]) && basename($_SERVER["HTTP_REFERER"]) == "users.php" ? "users.php" : "index.php?" . Helper::CreateQuerystring(getCurrentUser());
     $viewData["Previous"] = $previous;
     $viewData["Next"] = $next;
     $viewData["ShowComments"] = isset($_GET["showComments"]) && ($_GET["showComments"] = true) || !__("COLLAPSE_VISITOR_COMMENTS");
     $viewData["FirstMapImageName"] = Helper::GetMapImage($map);
     if ($map->BlankMapImage) {
         $viewData["SecondMapImageName"] = Helper::GetBlankMapImage($map);
     }
     $viewData["QuickRouteJpegExtensionData"] = $map->GetQuickRouteJpegExtensionData();
     if (isset($viewData["QuickRouteJpegExtensionData"]) && $viewData["QuickRouteJpegExtensionData"]->IsValid) {
         $categories = DataAccess::GetCategoriesByUserID(getCurrentUser()->ID);
         $viewData["OverviewMapData"][] = Helper::GetOverviewMapData($map, true, false, false, $categories);
         $viewData["GoogleMapsUrl"] = "http://maps.google.com/maps" . "?q=" . urlencode(Helper::GlobalPath("export_kml.php?id=" . $map->ID . "&format=kml")) . "&language=" . Session::GetLanguageCode();
     }
     if (USE_3DRERUN == '1' && DataAccess::GetSetting("LAST_WORLDOFO_CHECK_DOMA_TIME", "0") + RERUN_FREQUENCY * 3600 < time()) {
         $viewData["RerunMaps"] = Helper::GetMapsForRerunRequest();
         $viewData["TotalRerunMaps"] = count(explode(",", $viewData["RerunMaps"]));
         $viewData["ProcessRerun"] = true;
     }
     return $viewData;
 }
开发者ID:andopor,项目名称:doma-project,代码行数:58,代码来源:show_map.controller.php

示例4: Execute

 public function Execute()
 {
     $viewData = array();
     $errors = array();
     // no user specified - redirect to user list page
     if (!getCurrentUser()) {
         Helper::Redirect("users.php");
     }
     // user is hidden - redirect to user list page
     if (!getCurrentUser()->Visible) {
         Helper::Redirect("users.php");
     }
     // no email address for user is not specified
     if (!getCurrentUser()->Email) {
         Helper::Redirect("users.php");
     }
     if ($_POST["cancel"]) {
         Helper::Redirect("login.php?" . Helper::CreateQuerystring(getCurrentUser()));
     }
     if ($_POST["send"]) {
         $password = Helper::CreatePassword(6);
         $user = getCurrentUser();
         $user->Password = md5($password);
         $user->Save();
         $fromName = __("DOMA_ADMIN_EMAIL_NAME");
         $subject = __("NEW_PASSWORD_EMAIL_SUBJECT");
         $baseAddress = Helper::GlobalPath("");
         $userAddress = Helper::GlobalPath("index.php?user=" . $user->Username);
         $body = sprintf(__("NEW_PASSWORD_EMAIL_BODY"), $user->FirstName, $baseAddress, $userAddress, $user->Username, $password);
         $emailSentSuccessfully = Helper::SendEmail($fromName, $user->Email, $subject, $body);
         if ($emailSentSuccessfully) {
             Helper::Redirect("login.php?" . Helper::CreateQuerystring(getCurrentUser()) . "&action=newPasswordSent");
         }
         $errors[] = __("EMAIL_ERROR");
     }
     $viewData["Errors"] = $errors;
     return $viewData;
 }
开发者ID:andopor,项目名称:doma-project,代码行数:38,代码来源:send_new_password.controller.php

示例5: __

print DOMA_VERSION;
?>
" type="text/javascript"></script>
</head>

<body id="loginBody">
<div id="wrapper">
<?php 
Helper::CreateTopbar();
?>
<div id="content">
<form class="wide" method="post" action="<?php 
print $_SERVER["PHP_SELF"];
?>
?<?php 
print Helper::CreateQuerystring(getCurrentUser());
?>
">

<h1><?php 
print __("LOGIN");
?>
</h1>

<?php 
if (isset($_GET["action"]) && $_GET["action"] == "newPasswordSent") {
    print '<p>' . sprintf(__("NEW_PASSWORD_SENT"), getCurrentUser()->Email) . '</p>';
}
?>

<?php 
开发者ID:andopor,项目名称:doma-project,代码行数:31,代码来源:login.php

示例6: Execute

 public function Execute()
 {
     $viewData = array();
     // check if user is not specified or hidden
     if (!getCurrentUser()) {
         // all maps in archive
         $mode = "all";
         $count = $_GET["count"];
         if (!$count) {
             $count = 30;
         }
         $maps = DataAccess::GetMaps(0, 0, 0, 0, null, $count, "ID");
         $categories = DataAccess::GetCategoriesByUserID();
         $users = DataAccess::GetAllUsers(true);
         $viewData["Title"] = _SITE_TITLE;
         $viewData["LastCreatedTime"] = date("r", DataAccess::GetLastCreatedTime());
         $viewData["Description"] = _SITE_DESCRIPTION;
         $viewData["WebsiteUrl"] = Helper::GlobalPath("index.php");
     } else {
         // specified archive
         $mode = "user";
         if (!getCurrentUser()->Visible) {
             die;
         }
         $users[getCurrentUser()->ID] = getCurrentUser();
         $maps = DataAccess::GetMaps(getCurrentUser()->ID);
         $categories = DataAccess::GetCategoriesByUserID(getCurrentUser()->ID);
         $viewData["Title"] = __("PAGE_TITLE");
         $viewData["LastCreatedTime"] = date("r", DataAccess::GetLastCreatedTime(getCurrentUser()->ID));
         $viewData["Description"] = __("RSS_DESCRIPTION");
         $viewData["WebsiteUrl"] = Helper::GlobalPath("index.php?" . Helper::CreateQuerystring(getCurrentUser()));
     }
     $viewData["Items"] = array();
     foreach ($maps as $map) {
         $item = array();
         $user = $users[$map->UserID];
         $item["Title"] = hsc(Helper::DateToLongString(Helper::StringToTime($map->Date, true)) . ": " . $map->Name);
         $item["URL"] = $map->MapImage ? Helper::GlobalPath('show_map.php?user=' . urlencode($user->Username) . '&amp;map=' . $map->ID) : "";
         $atoms = array();
         if (__("SHOW_MAP_AREA_NAME") && $map->MapName != "") {
             $atoms[] = $map->MapName;
         }
         if (__("SHOW_ORGANISER") && $map->Organiser != "") {
             $atoms[] = $map->Organiser;
         }
         if (__("SHOW_COUNTRY") && $map->Country != "") {
             $atoms[] = $map->Country;
         }
         $atoms2 = array();
         if (__("SHOW_DISCIPLINE") && $map->Discipline != "") {
             $atoms2[] = hsc($map->Discipline);
         }
         if (__("SHOW_RELAY_LEG") && $map->RelayLeg != "") {
             $atoms2[] = __("RELAY_LEG_LOWERCASE") . ' ' . hsc($map->RelayLeg);
         }
         $item["Description"] = ($mode == "all" ? hsc($user->FirstName . " " . $user->LastName . '<br />') : '') . __("CATEGORY") . ": " . hsc($categories[$map->CategoryID]->Name) . hsc('<br />') . hsc(join(", ", $atoms)) . hsc('<br />') . join(", ", $atoms2);
         $item["PubDate"] = hsc(date("r", Helper::StringToTime($map->CreatedTime, true)));
         $viewData["Items"][] = $item;
     }
     return $viewData;
 }
开发者ID:andopor,项目名称:doma-project,代码行数:61,代码来源:rss.controller.php

示例7:

if ($vd["Previous"]) {
    ?>
<a href="show_map.php?<?php 
    print Helper::CreateQuerystring(getCurrentUser(), $vd["Previous"]->ID);
    ?>
"><?php 
    print "&lt;&lt; " . $vd["PreviousName"];
    ?>
</a><?php 
}
?>
  <?php 
if ($vd["Next"]) {
    ?>
<span class="separator">|</span><a href="show_map.php?<?php 
    print Helper::CreateQuerystring(getCurrentUser(), $vd["Next"]->ID);
    ?>
"><?php 
    print $vd["NextName"] . " &gt;&gt;";
    ?>
</a>
  
  <?php 
}
?>
  </div>
  <div class="clear"></div>
</div>

<div id="content">
<form id="frm" method="post" action="<?php 
开发者ID:andopor,项目名称:doma-project,代码行数:31,代码来源:show_map.php

示例8: Execute

 public function Execute()
 {
     $viewData = array();
     $isAdmin = isset($_GET["mode"]) && $_GET["mode"] == "admin" && Helper::IsLoggedInAdmin();
     // no user specified and not admin mode - redirect to user list page
     if (!$isAdmin && !getCurrentUser() && !Session::GetPublicCreationCodeEntered()) {
         Helper::Redirect("users.php");
     }
     $errors = array();
     $user = getCurrentUser();
     $isNewUser = !isset($user) || !$user->ID;
     if ($isNewUser) {
         $user = new User();
     }
     if (isset($_POST["cancel"])) {
         Helper::Redirect($isAdmin ? "users.php" : "index.php?" . Helper::CreateQuerystring($user));
     }
     if ($isAdmin && isset($_POST["deleteConfirmed"])) {
         DataAccess::DeleteUserByID($user->ID);
         Helper::Redirect($isAdmin ? "users.php" : "index.php?" . Helper::CreateQuerystring($user));
     }
     // any category handling button clicked?
     $addCategory = null;
     $deleteCategory = null;
     foreach ($_POST as $key => $value) {
         if (substr($key, 0, 15) == "deleteCategory_") {
             $deleteCategory = substr($key, 15);
             break;
         }
         if ($key == "addCategory") {
             $addCategory = true;
             break;
         }
     }
     if (isset($_POST["save"]) || isset($_POST["delete"]) || $deleteCategory || $addCategory) {
         // populate user object with data from form elements
         $user->Username = stripslashes($_POST["username"]);
         $password = stripslashes($_POST["password"]);
         if ($password) {
             $user->Password = md5($password);
         }
         $user->FirstName = stripslashes($_POST["firstName"]);
         $user->LastName = stripslashes($_POST["lastName"]);
         $user->Email = stripslashes($_POST["email"]);
         if ($isAdmin) {
             $user->Visible = $_POST["visible"] ? 1 : 0;
         }
         if (!$isAdmin && $isNewUser) {
             $user->Visible = 1;
         }
         $defaultCategory = $_POST["defaultCategory"];
         $noOfCategoriesAdded = $_POST["noOfCategoriesAdded"];
         // the category array
         foreach ($_POST as $key => $value) {
             if (substr($key, 0, 17) == "categoryName_new_") {
                 $id = "1_" . sprintf("%08d", substr($key, 17));
                 $categories[$id] = new Category();
                 $categories[$id]->Name = stripslashes($value);
                 $categories[$id]->UserID = $user->ID;
             } elseif (substr($key, 0, 13) == "categoryName_") {
                 $id = "0_" . sprintf("%08d", substr($key, 13));
                 $categories[$id] = new Category();
                 $categories[$id]->Name = stripslashes($value);
                 $categories[$id]->UserID = $user->ID;
                 $categories[$id]->ID = substr($key, 13);
             }
         }
         ksort($categories);
         // shall we delete a category?
         if ($deleteCategory) {
             if (count($categories) <= 1) {
                 $errors[] = __("CAN_NOT_DELETE_ALL_CATEGORIES");
             } else {
                 if (substr($deleteCategory, 0, 4) == "new_") {
                     // unsaved categories can be deleted directly
                     $id = "1_" . sprintf("%08d", substr($deleteCategory, 4));
                     unset($categories[$id]);
                 } else {
                     // for saved categories, we need to check for existing maps
                     $id = "0_" . sprintf("%08d", $deleteCategory);
                     $noOfMapsInCategory = DataAccess::NoOfMapsInCategory($deleteCategory);
                     if ($noOfMapsInCategory > 0) {
                         $errors[] = sprintf(__("CAN_NOT_DELETE_NONEMPTY_CATEGORY"), $categories[$id]->Name, $noOfMapsInCategory);
                     } else {
                         unset($categories[$id]);
                     }
                 }
             }
         }
         if ($addCategory) {
             $id = "1_" . sprintf("%08d", $noOfCategoriesAdded);
             $categories[$id] = new Category();
             $categories[$id]->UserID = $user->ID;
             $noOfCategoriesAdded++;
         }
     } else {
         // first page visit
         if ($isNewUser) {
             $noOfCategoriesAdded = 0;
             if ($isAdmin) {
//.........这里部分代码省略.........
开发者ID:andopor,项目名称:doma-project,代码行数:101,代码来源:edit_user.controller.php

示例9: Execute

 public function Execute()
 {
     $viewData = array();
     $errors = array();
     // no user specified - redirect to user list page
     if (!getCurrentUser()) {
         Helper::Redirect("users.php");
     }
     if (!Helper::IsLoggedInUser()) {
         Helper::Redirect("users.php");
     }
     if (isset($_GET["map"])) {
         $mapID = $_GET["map"];
     }
     foreach ($_GET as $variable => $value) {
         ${$variable} = stripslashes($value);
     }
     foreach ($_POST as $variable => $value) {
         ${$variable} = stripslashes($value);
     }
     if (isset($cancel)) {
         Helper::Redirect("index.php?" . Helper::CreateQuerystring(getCurrentUser()));
     }
     if (isset($save) || isset($delete) || isset($deleteConfirmed)) {
         $map = new Map();
         if (isset($mapID)) {
             $map->Load($mapID);
             if ($map->UserID != getCurrentUser()->ID) {
                 die("Access denied");
             }
             $isNewMap = false;
         } else {
             $isNewMap = true;
         }
         $map->UserID = getCurrentUser()->ID;
         $map->CategoryID = $categoryID;
         $map->Date = $date;
         $map->Name = $name;
         if (__("SHOW_ORGANISER")) {
             $map->Organiser = $organiser;
         }
         if (__("SHOW_COUNTRY")) {
             $map->Country = $country;
         }
         if (__("SHOW_DISCIPLINE")) {
             $map->Discipline = $discipline;
         }
         if (__("SHOW_RELAY_LEG")) {
             $map->RelayLeg = $relayLeg;
         }
         if (__("SHOW_MAP_AREA_NAME")) {
             $map->MapName = $mapName;
         }
         if (__("SHOW_RESULT_LIST_URL")) {
             $map->ResultListUrl = $resultListUrl;
         }
         if (__("SHOW_COMMENT")) {
             $map->Comment = $comment;
         }
         $map->ProtectedUntil = $protectedUntil;
     } else {
         // first page load
         if (isset($_GET["map"])) {
             $map = new Map();
             $map->Load($mapID);
             if ($map->UserID != getCurrentUser()->ID) {
                 die("Access denied");
             }
             $isNewMap = false;
         } else {
             $map = new Map();
             $map->Date = date("Y-m-d");
             $map->CategoryID = getCurrentUser()->DefaultCategoryID;
             $isNewMap = true;
         }
     }
     if (isset($save)) {
         // validate
         // name
         if (trim($map->Name) == "") {
             $errors[] = __("NO_MAP_NAME_ENTERED");
         }
         // date
         if (trim($map->Date) == "") {
             $errors[] = __("NO_DATE_ENTERED");
         }
         if (!Helper::LocalizedStringToTime($map->Date, false)) {
             $errors[] = __("INVALID_DATE");
         } else {
             $map->Date = gmdate("Y-m-d H:i:s", Helper::LocalizedStringToTime($map->Date, false));
         }
         // protected until
         if (trim($map->ProtectedUntil) == "") {
             $map->ProtectedUntil = null;
         } else {
             if (!Helper::LocalizedStringToTime($map->ProtectedUntil, false)) {
                 $errors[] = __("INVALID_PROTECTED_UNTIL");
             } else {
                 $map->ProtectedUntil = gmdate("Y-m-d H:i:s", Helper::LocalizedStringToTime($map->ProtectedUntil, false));
             }
//.........这里部分代码省略.........
开发者ID:andopor,项目名称:doma-project,代码行数:101,代码来源:edit_map.controller.php

示例10: isset

print DOMA_VERSION;
?>
" type="text/javascript"></script>
</head>

<body id="editMapBody">
<div id="wrapper">
<?php 
Helper::CreateTopbar();
?>
<div id="content">
<form class="wide" method="post" action="<?php 
print $_SERVER["PHP_SELF"];
?>
?<?php 
print Helper::CreateQuerystring(getCurrentUser(), isset($vd["MapID"]) ? $vd["MapID"] : null);
?>
" enctype="multipart/form-data">

<h1><?php 
print $vd["Title"];
?>
</h1>

<?php 
if (count($vd["Errors"]) > 0) {
    ?>
<ul class="error">
<?php 
    foreach ($vd["Errors"] as $e) {
        print "<li>{$e}</li>";
开发者ID:andopor,项目名称:doma-project,代码行数:31,代码来源:edit_map.php

示例11: __

        ?>
</th>
    <th><?php 
        print __("UPDATED");
        ?>
</th>
  </tr>
</thead>
<tbody>
      <?php 
        $count = 0;
        foreach ($vd["LastMaps"] as $map) {
            $count++;
            $url = "index.php?" . Helper::CreateQuerystring($map->GetUser());
            $nameLink = Helper::EncapsulateLink(hsc($map->GetUser()->FirstName . " " . $map->GetUser()->LastName), $url);
            $mapLink = '<a href="show_map.php?' . Helper::CreateQuerystring($map->GetUser(), $map->ID) . '" class="thumbnailHoverLink">' . hsc($map->Name) . '</a>';
            $date = date(__("DATE_FORMAT"), Helper::StringToTime($map->Date, true));
            $updated = date(__("DATETIME_FORMAT"), Helper::StringToTime($map->LastChangedTime, true));
            $thumbnailImage = '<img src="' . Helper::GetThumbnailImage($map) . '" alt="' . hsc($map->Name) . '" height="' . THUMBNAIL_HEIGHT . '" width="' . THUMBNAIL_WIDTH . '" />';
            ?>
        <tr class="<?php 
            print $count % 2 == 1 ? "odd" : "even";
            ?>
">
          <td><?php 
            print $nameLink;
            ?>
</td>
          <td>
            <span class="hoverThumbnailContainer">
              <span class="hoverThumbnail hidden">
开发者ID:andopor,项目名称:doma-project,代码行数:31,代码来源:users.php

示例12: CreateTopbar

    public static function CreateTopbar()
    {
        $isLoggedIn = Helper::IsLoggedInUser() && Helper::GetLoggedInUser()->ID == getCurrentUser()->ID;
        ?>
      <div id="topbar">
        <div class="left">
          <a href="index.php?<?php 
        print Helper::CreateQuerystring(getCurrentUser());
        ?>
"><?php 
        printf(__("DOMA_FOR_X"), getCurrentUser()->FirstName . " " . getCurrentUser()->LastName);
        ?>
</a>
          <span class="separator">|</span>
          <?php 
        if (!$isLoggedIn) {
            ?>
            <a href="login.php?<?php 
            print Helper::CreateQuerystring(getCurrentUser());
            ?>
"><?php 
            print __("LOGIN");
            ?>
</a>
          <?php 
        } else {
            ?>
            <a href="edit_map.php?<?php 
            print Helper::CreateQuerystring(getCurrentUser());
            ?>
"><?php 
            print __("ADD_MAP");
            ?>
</a>
            <span class="separator">|</span>
            <a href="edit_user.php?<?php 
            print Helper::CreateQuerystring(getCurrentUser());
            ?>
"><?php 
            print __("USER_PROFILE");
            ?>
</a>
            <span class="separator">|</span>
            <a href="login.php?<?php 
            print Helper::CreateQuerystring(getCurrentUser());
            ?>
&amp;action=logout"><?php 
            print __("LOGOUT");
            ?>
</a>
          <?php 
        }
        ?>
        </div>
        <div class="right">
          <a href="users.php"><?php 
        print __("ALL_USERS");
        ?>
</a>
          <span class="separator">|</span>
          <?php 
        if (SHOW_LANGUAGES_IN_TOPBAR == "1") {
            Helper::ShowLanguages();
            ?>
            <span class="separator">|</span>
          <?php 
        }
        ?>
          <a href="http://www.matstroeng.se/doma/?version=<?php 
        print DOMA_VERSION;
        ?>
"><?php 
        printf(__("DOMA_VERSION_X"), DOMA_VERSION);
        ?>
</a>
        </div>
        <div class="clear"></div>
      </div>
      <?php 
    }
开发者ID:andopor,项目名称:doma-project,代码行数:80,代码来源:helper.php

示例13: Execute

 public function Execute()
 {
     $viewData = array();
     // no user specified - redirect to user list page
     if (!getCurrentUser()) {
         $singleUserID = DataAccess::GetSingleUserID();
         if (!$singleUserID) {
             Helper::Redirect("users.php");
         }
         Helper::SetUser(DataAccess::GetUserByID($singleUserID));
     }
     // user is hidden - redirect to user list page
     if (!getCurrentUser()->Visible) {
         Helper::Redirect("users.php");
     }
     $searchCriteria = Session::GetSearchCriteria(getCurrentUser()->ID);
     if (!isset($searchCriteria)) {
         // default search criteria
         $searchCriteria = array("selectedYear" => date("Y"), "selectedCategoryID" => getCurrentUser()->DefaultCategoryID, "filter" => null);
     }
     $viewData["Errors"] = array();
     if (isset($_GET["error"]) && $_GET["error"] == "thumbnailCreationFailure") {
         // calculate max image size for auto-generation of thumbnail
         $memoryLimit = ini_get("memory_limit");
         if (stripos($memoryLimit, "M")) {
             $memoryLimit = (int) str_replace("M", "", $memoryLimit) * 1024 * 1024;
         }
         $memoryLimit -= memory_get_usage();
         $size = round(sqrt($memoryLimit / 4) / 100) * 100;
         $viewData["Errors"][] = sprintf(__("THUMBNAIL_CREATION_FAILURE"), $size . "x" . $size);
     }
     // get all categories
     $allCategoriesItem = new Category();
     $allCategoriesItem->ID = 0;
     $allCategoriesItem->Name = __("ALL_CATEGORIES");
     $categories = DataAccess::GetCategoriesByUserID(getCurrentUser()->ID);
     $viewData["Categories"] = $categories;
     $viewData["CategoriesWithText"] = array_merge(array(0 => $allCategoriesItem), $categories);
     // get all years
     $years = DataAccess::GetYearsByUserID(getCurrentUser()->ID, Helper::GetLoggedInUserID());
     $years = array_reverse($years);
     $viewData["YearsWithText"][0] = array("value" => 0, "text" => __("ALL_YEARS"));
     foreach ($years as $year) {
         $viewData["YearsWithText"][$year] = array("value" => $year, "text" => $year);
     }
     if (!in_array($searchCriteria["selectedYear"], array_keys($viewData["YearsWithText"])) && count($years) > 0) {
         $searchCriteria["selectedYear"] = $years[0];
     }
     $categoryIds = array_keys($categories);
     if ($searchCriteria["selectedCategoryID"] != 0 && !in_array($searchCriteria["selectedCategoryID"], $categoryIds) && count($categories) > 0) {
         $searchCriteria["selectedCategoryID"] = $categoryIds[0];
     }
     if (isset($_GET["year"])) {
         $searchCriteria["selectedYear"] = $_GET["year"];
     }
     if (isset($_GET["categoryID"])) {
         $searchCriteria["selectedCategoryID"] = $_GET["categoryID"];
     }
     if (isset($_GET["filter"])) {
         $searchCriteria["filter"] = $_GET["filter"];
     }
     if (isset($_GET["displayMode"])) {
         $viewData["DisplayMode"] = $_GET["displayMode"];
     } else {
         $viewData["DisplayMode"] = "list";
     }
     $startDate = $searchCriteria["selectedYear"] == 0 ? 0 : Helper::StringToTime($searchCriteria["selectedYear"] . "-01-01", true);
     $endDate = $searchCriteria["selectedYear"] == 0 ? 0 : Helper::StringToTime($searchCriteria["selectedYear"] . "-12-31", true);
     $viewData["SearchCriteria"] = $searchCriteria;
     // get map data
     $viewData["Maps"] = DataAccess::GetMaps(getCurrentUser()->ID, $startDate, $endDate, $searchCriteria["selectedCategoryID"], $searchCriteria["filter"], 0, "date", Helper::GetLoggedInUserID());
     $viewData["GeocodedMapsExist"] = false;
     foreach ($viewData["Maps"] as $map) {
         $mapInfo = array();
         $mapInfo["URL"] = $map->MapImage ? 'show_map.php?' . Helper::CreateQuerystring(getCurrentUser(), $map->ID) : "";
         $mapInfo["Name"] = $map->Name . ' (' . date(__("DATE_FORMAT"), Helper::StringToTime($map->Date, true)) . ')';
         $mapInfo["MapThumbnailHtml"] = Helper::EncapsulateLink('<img src="' . Helper::GetThumbnailImage($map) . '" alt="' . $mapInfo["Name"] . '" height="' . THUMBNAIL_HEIGHT . '" width="' . THUMBNAIL_WIDTH . '" />', $mapInfo["URL"]);
         $atoms = array();
         if (__("SHOW_MAP_AREA_NAME") && $map->MapName) {
             $atoms[] = $map->MapName;
         }
         if (__("SHOW_ORGANISER") && $map->Organiser) {
             $atoms[] = $map->Organiser;
         }
         if (__("SHOW_COUNTRY") && $map->Country) {
             $atoms[] = $map->Country;
         }
         $mapInfo["MapAreaOrganiserCountry"] = join(", ", $atoms);
         if ($map->Comment) {
             $maxLength = 130;
             $strippedComment = strip_tags($map->Comment);
             $mapInfo["IsExpandableComment"] = !($strippedComment == $map->Comment && strlen($map->Comment) <= $maxLength);
             if ($mapInfo["IsExpandableComment"]) {
                 $mapInfo["ContractedComment"] = substr($strippedComment, 0, $maxLength) . "...";
             }
         }
         $viewData["MapInfo"][$map->ID] = $mapInfo;
         if ($viewData["DisplayMode"] == "overviewMap" && $map->IsGeocoded) {
             $viewData["OverviewMapData"][] = Helper::GetOverviewMapData($map, false, true, false, $categories, $searchCriteria["selectedCategoryID"]);
         }
//.........这里部分代码省略.........
开发者ID:andopor,项目名称:doma-project,代码行数:101,代码来源:index.controller.php

示例14: __

      <?php 
    if (Helper::IsLoggedInUser() && Helper::GetLoggedInUser()->ID == getCurrentUser()->ID) {
        ?>
        <div class="admin">
          <?php 
        print $map->Views;
        ?>
 
          <?php 
        print __("VIEWS");
        ?>
 
          <span class="separator">|</span> 
          <a href="edit_map.php?<?php 
        print Helper::CreateQuerystring(getCurrentUser(), $map->ID);
        ?>
"><?php 
        print __("EDIT_MAP");
        ?>
</a>
        </div>
      <?php 
    }
    ?>
      
      <?php 
    if ($map->ProtectedUntil != null && $map->ProtectedUntil > gmdate("Y-m-d H:i:s")) {
        ?>
        <div class="protected">
          <?php 
开发者ID:andopor,项目名称:doma-project,代码行数:30,代码来源:index_list.php


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