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


PHP begin_XML_for_XSLT函数代码示例

本文整理汇总了PHP中begin_XML_for_XSLT函数的典型用法代码示例。如果您正苦于以下问题:PHP begin_XML_for_XSLT函数的具体用法?PHP begin_XML_for_XSLT怎么用?PHP begin_XML_for_XSLT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: ClientJobSchedule

include_once 'models/project.php';
include_once "models/clientjobschedule.php";
if (!$CDASH_MANAGE_CLIENTS) {
    echo "CDash has not been setup to allow client management";
    return;
}
$userid = $_SESSION['cdash']['loginid'];
if (!isset($_GET['scheduleid'])) {
    echo "Schedule id not set";
    return;
}
$scheduleid = $_GET['scheduleid'];
$ClientJobSchedule = new ClientJobSchedule();
$ClientJobSchedule->Id = $scheduleid;
$projectid = $ClientJobSchedule->GetProjectId();
$xml = begin_XML_for_XSLT();
$xml .= add_XML_value("manageclient", $CDASH_MANAGE_CLIENTS);
$db = pdo_connect("{$CDASH_DB_HOST}", "{$CDASH_DB_LOGIN}", "{$CDASH_DB_PASS}");
pdo_select_db("{$CDASH_DB_NAME}", $db);
$xml .= add_XML_value("title", "CDash - Scheduled Build Submissions");
$xml .= add_XML_value("menutitle", "CDash");
$xml .= add_XML_value("menusubtitle", "Submitted Builds");
$xml .= "<hostname>" . $_SERVER['SERVER_NAME'] . "</hostname>";
$xml .= "<date>" . date("r") . "</date>";
$xml .= "<backurl>user.php</backurl>";
$builds = $ClientJobSchedule->GetAssociatedBuilds();
foreach ($builds as $buildid) {
    $xml .= '<build>';
    $xml .= add_XML_value("id", $buildid);
    $xml .= '</build>';
}
开发者ID:rpshaw,项目名称:CDash,代码行数:31,代码来源:scheduleSummary.php

示例2: LoginForm

/** Login Form function */
function LoginForm($loginerror)
{
    include dirname(__DIR__) . '/config/config.php';
    require_once 'include/pdo.php';
    include_once 'include/common.php';
    include 'include/version.php';
    $xml = begin_XML_for_XSLT();
    $xml .= '<title>Login</title>';
    if (isset($CDASH_NO_REGISTRATION) && $CDASH_NO_REGISTRATION == 1) {
        $xml .= add_XML_value('noregister', '1');
    }
    if (@$_GET['note'] == 'register') {
        $xml .= '<message>Registration Complete. Please login with your email and password.</message>';
    }
    if ($loginerror != '') {
        $xml .= '<message>' . $loginerror . '</message>';
    }
    if ($CDASH_ALLOW_LOGIN_COOKIE) {
        $xml .= '<allowlogincookie>1</allowlogincookie>';
    }
    if ($GOOGLE_CLIENT_ID != '' && $GOOGLE_CLIENT_SECRET != '') {
        $xml .= '<oauth2>';
        $xml .= add_XML_value('client', $GOOGLE_CLIENT_ID);
        // Google OAuth needs to know the base url to redirect back to
        $xml .= add_XML_value('CDASH_BASE_URL', get_server_URI());
        $xml .= '</oauth2>';
    }
    $xml .= '</cdash>';
    if (!isset($NoXSLGenerate)) {
        generate_XSLT($xml, 'login');
    }
}
开发者ID:kitware,项目名称:cdash,代码行数:33,代码来源:login_functions.php

示例3: generate_subprojects_dashboard_XML

/** Generate the subprojects dashboard */
function generate_subprojects_dashboard_XML($project_instance, $date)
{
    $start = microtime_float();
    $noforcelogin = 1;
    include_once "cdash/config.php";
    require_once "cdash/pdo.php";
    include 'login.php';
    include_once "models/banner.php";
    include_once "models/subproject.php";
    $db = pdo_connect("{$CDASH_DB_HOST}", "{$CDASH_DB_LOGIN}", "{$CDASH_DB_PASS}");
    if (!$db) {
        echo "Error connecting to CDash database server<br>\n";
        return;
    }
    if (!pdo_select_db("{$CDASH_DB_NAME}", $db)) {
        echo "Error selecting CDash database<br>\n";
        return;
    }
    $Project = $project_instance;
    $projectid = $project_instance->Id;
    $homeurl = make_cdash_url(htmlentities($Project->HomeUrl));
    checkUserPolicy(@$_SESSION['cdash']['loginid'], $projectid);
    $xml = begin_XML_for_XSLT();
    $xml .= "<title>CDash - " . $Project->Name . "</title>";
    $Banner = new Banner();
    $Banner->SetProjectId(0);
    $text = $Banner->GetText();
    if ($text !== false) {
        $xml .= "<banner>";
        $xml .= add_XML_value("text", $text);
        $xml .= "</banner>";
    }
    $Banner->SetProjectId($projectid);
    $text = $Banner->GetText();
    if ($text !== false) {
        $xml .= "<banner>";
        $xml .= add_XML_value("text", $text);
        $xml .= "</banner>";
    }
    global $CDASH_SHOW_LAST_SUBMISSION;
    if ($CDASH_SHOW_LAST_SUBMISSION) {
        $xml .= "<showlastsubmission>1</showlastsubmission>";
    }
    list($previousdate, $currentstarttime, $nextdate) = get_dates($date, $Project->NightlyTime);
    $svnurl = make_cdash_url(htmlentities($Project->CvsUrl));
    $homeurl = make_cdash_url(htmlentities($Project->HomeUrl));
    $bugurl = make_cdash_url(htmlentities($Project->BugTrackerUrl));
    $googletracker = htmlentities($Project->GoogleTracker);
    $docurl = make_cdash_url(htmlentities($Project->DocumentationUrl));
    // Main dashboard section
    $xml .= "<dashboard>\n  <datetime>" . date("l, F d Y H:i:s T", time()) . "</datetime>\n  <date>" . $date . "</date>\n  <unixtimestamp>" . $currentstarttime . "</unixtimestamp>\n  <svn>" . $svnurl . "</svn>\n  <bugtracker>" . $bugurl . "</bugtracker>\n  <googletracker>" . $googletracker . "</googletracker>\n  <documentation>" . $docurl . "</documentation>\n  <logoid>" . $Project->getLogoID() . "</logoid>\n  <projectid>" . $projectid . "</projectid>\n  <projectname>" . $Project->Name . "</projectname>\n  <projectname_encoded>" . urlencode($Project->Name) . "</projectname_encoded>\n  <previousdate>" . $previousdate . "</previousdate>\n  <projectpublic>" . $Project->Public . "</projectpublic>\n  <nextdate>" . $nextdate . "</nextdate>";
    if (empty($Project->HomeUrl)) {
        $xml .= "<home>index.php?project=" . urlencode($Project->Name) . "</home>";
    } else {
        $xml .= "<home>" . $homeurl . "</home>";
    }
    if ($CDASH_USE_LOCAL_DIRECTORY && file_exists("local/models/proProject.php")) {
        include_once "local/models/proProject.php";
        $pro = new proProject();
        $pro->ProjectId = $projectid;
        $xml .= "<proedition>" . $pro->GetEdition(1) . "</proedition>";
    }
    if ($currentstarttime > time()) {
        $xml .= "<future>1</future>";
    } else {
        $xml .= "<future>0</future>";
    }
    $xml .= "</dashboard>";
    // Menu definition
    $xml .= "<menu>";
    if (!has_next_date($date, $currentstarttime)) {
        $xml .= add_XML_value("nonext", "1");
    }
    $xml .= "</menu>";
    $beginning_timestamp = $currentstarttime;
    $end_timestamp = $currentstarttime + 3600 * 24;
    $beginning_UTCDate = gmdate(FMT_DATETIME, $beginning_timestamp);
    $end_UTCDate = gmdate(FMT_DATETIME, $end_timestamp);
    // User
    if (isset($_SESSION['cdash'])) {
        $xml .= "<user>";
        $userid = $_SESSION['cdash']['loginid'];
        $user2project = pdo_query("SELECT role FROM user2project WHERE userid='{$userid}' and projectid='{$projectid}'");
        $user2project_array = pdo_fetch_array($user2project);
        $user = pdo_query("SELECT admin FROM " . qid("user") . "  WHERE id='{$userid}'");
        $user_array = pdo_fetch_array($user);
        $xml .= add_XML_value("id", $userid);
        $isadmin = 0;
        if ($user2project_array["role"] > 1 || $user_array["admin"]) {
            $isadmin = 1;
        }
        $xml .= add_XML_value("admin", $isadmin);
        $xml .= add_XML_value("projectrole", $user2project_array['role']);
        $xml .= "</user>";
    }
    // Get some information about the project
    $xml .= "<project>";
    $xml .= add_XML_value("nbuilderror", $Project->GetNumberOfErrorBuilds($beginning_UTCDate, $end_UTCDate, true));
    $xml .= add_XML_value("nbuildwarning", $Project->GetNumberOfWarningBuilds($beginning_UTCDate, $end_UTCDate, true));
//.........这里部分代码省略.........
开发者ID:josephsnyder,项目名称:CDash,代码行数:101,代码来源:index.php

示例4: LoginForm

/** Login Form function */
function LoginForm($loginerror)
{
    include "cdash/config.php";
    require_once "cdash/pdo.php";
    include_once "cdash/common.php";
    include "cdash/version.php";
    $xml = begin_XML_for_XSLT();
    $xml .= "<title>Login</title>";
    if (isset($CDASH_NO_REGISTRATION) && $CDASH_NO_REGISTRATION == 1) {
        $xml .= add_XML_value("noregister", "1");
    }
    if (@$_GET['note'] == "register") {
        $xml .= "<message>Registration Complete. Please login with your email and password.</message>";
    }
    if ($loginerror != "") {
        $xml .= "<message>" . $loginerror . "</message>";
    }
    if ($CDASH_ALLOW_LOGIN_COOKIE) {
        $xml .= "<allowlogincookie>1</allowlogincookie>";
    }
    if ($GOOGLE_CLIENT_ID != '' && $GOOGLE_CLIENT_SECRET != '') {
        $xml .= "<oauth2>";
        $xml .= add_XML_value("client", $GOOGLE_CLIENT_ID);
        $xml .= "</oauth2>";
    }
    $xml .= "</cdash>";
    if (!isset($NoXSLGenerate)) {
        generate_XSLT($xml, "login");
    }
}
开发者ID:rpshaw,项目名称:CDash,代码行数:31,代码来源:login.php

示例5: RegisterForm

/** Login Form function */
function RegisterForm($regerror)
{
    include dirname(__DIR__) . '/config/config.php';
    require_once 'include/pdo.php';
    include_once 'include/common.php';
    if (isset($CDASH_NO_REGISTRATION) && $CDASH_NO_REGISTRATION == 1) {
        die("You cannot access this page. Contact your administrator if you think that's an error.");
    }
    $xml = begin_XML_for_XSLT();
    $xml .= '<title>CDash - Registration</title>';
    $xml .= '<error>' . $regerror . '</error>';
    if (isset($_GET['firstname'])) {
        $xml .= '<firstname>' . $_GET['firstname'] . '</firstname>';
    } else {
        $xml .= '<firstname></firstname>';
    }
    if (isset($_GET['lastname'])) {
        $xml .= '<lastname>' . $_GET['lastname'] . '</lastname>';
    } else {
        $xml .= '<lastname></lastname>';
    }
    if (isset($_GET['email'])) {
        $xml .= '<email>' . $_GET['email'] . '</email>';
    } else {
        $xml .= '<email></email>';
    }
    $xml .= '</cdash>';
    generate_XSLT($xml, 'register');
}
开发者ID:kitware,项目名称:cdash,代码行数:30,代码来源:register.php

示例6: RegisterForm

/** Login Form function */
function RegisterForm($regerror)
{
    include "cdash/config.php";
    require_once "cdash/pdo.php";
    include_once "cdash/common.php";
    if (isset($CDASH_NO_REGISTRATION) && $CDASH_NO_REGISTRATION == 1) {
        die("You cannot access this page. Contact your administrator if you think that's an error.");
    }
    $xml = begin_XML_for_XSLT();
    $xml .= "<title>CDash - Registration</title>";
    $xml .= "<error>" . $regerror . "</error>";
    if (isset($_GET["firstname"])) {
        $xml .= "<firstname>" . $_GET["firstname"] . "</firstname>";
    } else {
        $xml .= "<firstname></firstname>";
    }
    if (isset($_GET["lastname"])) {
        $xml .= "<lastname>" . $_GET["lastname"] . "</lastname>";
    } else {
        $xml .= "<lastname></lastname>";
    }
    if (isset($_GET["email"])) {
        $xml .= "<email>" . $_GET["email"] . "</email>";
    } else {
        $xml .= "<email></email>";
    }
    $xml .= "</cdash>";
    generate_XSLT($xml, "register");
}
开发者ID:rpshaw,项目名称:CDash,代码行数:30,代码来源:register.php


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