Example #1
0
function GetLoggedOutPage()
{
    $tpl = new HTML_Template_IT("./");
    $tpl->loadTemplatefile("loggedout.tpl.html", true, true);
    SetCommonLoginStatus($tpl);
    SetCommonToolbar($tpl);
    SetCommonFooter($tpl);
    // return the output
    return $tpl->get();
}
Example #2
0
function GetNotAPowerUserPage()
{
    $tpl = new HTML_Template_IT("./");
    $tpl->loadTemplatefile("not_a_power_user.tpl.html", true, false);
    SetCommonLoginStatus($tpl);
    SetAdminToolbar($tpl);
    SetCommonFooter($tpl);
    // print the output
    return $tpl->get();
}
Example #3
0
function GetLoginFailedPage()
{
    $tpl = new HTML_Template_IT("./");
    $tpl->loadTemplatefile("loginfailed.tpl.html", true, false);
    SetCommonLoginStatus($tpl);
    SetCommonToolbar($tpl);
    SetCommonFooter($tpl);
    // print the output
    return $tpl->get();
}
Example #4
0
function GetNotAllowedPage($reason)
{
    $tpl = new HTML_Template_IT("./");
    $tpl->loadTemplatefile("not_allowed.tpl.html", true, false);
    SetCommonLoginStatus($tpl);
    SetAdminToolbar($tpl);
    SetCommonFooter($tpl);
    $tpl->SetVariable("REASON", $reason);
    // print the output
    return $tpl->get();
}
Example #5
0
function GetLoginSuccessfulPage($originPage)
{
    $tpl = new HTML_Template_IT("./");
    $tpl->loadTemplatefile("loginsuccessful.tpl.html", true, true);
    SetCommonLoginStatus($tpl);
    SetCommonToolbar($tpl);
    SetCommonFooter($tpl);
    $tpl->setVariable("USERNAME", GetLoggedUserName());
    $tpl->setVariable("ORIGIN_PAGE", $originPage);
    // print the output
    return $tpl->get();
}
function GetNoAccessToProjectPage($projectId)
{
    $tpl = new HTML_Template_IT("./");
    $tpl->loadTemplatefile("no_access_to_project.tpl.html", true, false);
    SetCommonLoginStatus($tpl);
    SetAdminToolbar($tpl);
    SetCommonFooter($tpl);
    $projectInfos = GetProjectInfos($projectId);
    $tpl->setVariable("PROJECT_NAME", $projectInfos["Name"]);
    // print the output
    return $tpl->get();
}
Example #7
0
    Logout();
}
// get the page to which we should return to, or default to index.php
if (array_key_exists("returnTo", $_GET)) {
    $returnTo = $_GET["returnTo"];
} else {
    $returnTo = "index.php";
}
// force the check of the currently checked user
GetLoggedUserName();
if ($lastLoginResult == LLR_LOGGED_IN) {
    print GetLoginSuccessfulPage($returnTo);
} elseif ($lastLoginResult == LLR_INVALID_LOGIN) {
    print GetLoginFailedPage();
} elseif ($lastLoginResult == LLR_NOW_LOGGED_OUT) {
    print GetLoggedOutPage();
} else {
    $tpl = new HTML_Template_IT("./");
    $tpl->loadTemplatefile("login.tpl.html", true, true);
    SetCommonLoginStatus($tpl);
    SetCommonToolbar($tpl);
    SetCommonFooter($tpl);
    $tpl->setVariable("RETURN_TO", urlencode($returnTo));
    $msg = "";
    if ($lastLoginResult != LLR_NOT_LOGGED_IN) {
        $msg = LastLoginResultMessage();
    }
    $tpl->setVariable("MESSAGE", $msg);
    // print the output
    $tpl->show();
}
Example #8
0
        // if we are editing without an ItemId, then we MUST have the Unit Id
        if (array_key_exists("UnitId", $_GET)) {
            $unitInfos = GetUnitInfos($_GET["UnitId"]);
        } else {
            echo "Error, the Unit Id MUST be indicated when adding an item.";
            exit;
        }
    }
}
$tpl = new HTML_Template_IT("./");
if ($edit) {
    $tpl->loadTemplatefile("item_edit.tpl.html", true, true);
} else {
    $tpl->loadTemplatefile("item.tpl.html", true, true);
}
SetCommonLoginStatus($tpl, array("UnitId" => $unitInfos["Id"]));
SetCommonToolbar($tpl);
SetCommonFooter($tpl);
if (!$edit) {
    SetLastChanged($tpl, $itemInfos["userId"], $itemInfos["LastChange"]);
}
$tpl->setVariable("UNIT_NAME", str_replace(".dtx", ".pas", $unitInfos["Name"]));
$tpl->setVariable("UNIT_ID", $unitInfos["Id"]);
if (is_numeric($itemId)) {
    SetItemImage($tpl, $itemInfos["Name"], GetProjectIdForItem($itemId));
    $tpl->setVariable("ITEM_NAME", $itemInfos["Name"]);
    $tpl->setVariable("ITEM_ID", $itemId);
    $baseclass = trim(substr($itemInfos["Name"], 0, strpos($itemInfos["Name"], ".")));
    if ($baseclass == "") {
        $baseclass = $itemInfos["Name"];
    }
Example #9
0
    if (array_key_exists("ProjectId", $_GET)) {
        $unitInfos["ProjectId"] = $_GET["ProjectId"];
        $unitInfos["Id"] = "";
        $unitInfos["Name"] = "Write here a name";
        $unitInfos["Description"] = "Write here a description";
        $unitInfos["Package"] = "";
        $unitInfos["Status"] = "";
        $unitInfos["Author"] = "";
    } else {
        die("You must at least specify the Project Id when editing");
    }
}
$projectInfos = GetProjectInfos($unitInfos["ProjectId"]);
$tpl->setVariable("PROJECT_NAME", $projectInfos["Name"]);
$tpl->setVariable("PROJECT_ID", $projectInfos["Id"]);
SetCommonLoginStatus($tpl, array("ProjectId" => $projectInfos["Id"]));
if (!$edit) {
    SetLastChanged($tpl, $unitInfos["userId"], $unitInfos["LastChange"]);
}
$unitName = str_replace(".dtx", ".pas", $unitInfos["Name"]);
$tpl->setVariable("UNIT_ID", $unitInfos["Id"]);
$tpl->setVariable("UNIT_NAME", $unitName);
$tpl->setVariable("UNIT_PACKAGE", $unitInfos["Package"]);
$tpl->setVariable("UNIT_STATUS", $unitInfos["Status"]);
$tpl->setVariable("UNIT_DESCRIPTION", EncodeString($unitInfos["Description"]));
$tpl->setVariable("UNIT_AUTHOR", str_replace("\r\n", ", ", EncodeString($unitInfos["Author"])));
if ($edit) {
    // set the cancel block
    if ($unitInfos["Id"] != "") {
        $tpl->setCurrentBlock("cancel_unit");
        // this marker MUST NOT be called UNIT_ID or the first replacement above will be reversed to ""