Esempio n. 1
0
function html_page_top1($p_page_title = null)
{
    html_begin();
    html_head_begin();
    html_css();
    html_content_type();
    include config_get('meta_include_file');
    html_rss_link();
    html_title($p_page_title);
    html_head_javascript();
}
Esempio n. 2
0
        $t_marker[$t_ptr] = $t_now;
        foreach ($t_view_status as $t_status => $t_label) {
            $t_data[$t_ptr][$t_status] = $t_data[$t_ptr - 1][$t_status];
        }
    }
}
ksort($t_view_status);
/* @todo - these should probably be separate strings, but in the summary page context,
   the string is used as the title for all columns */
$t_label_string = lang_get('orct');
//use the (open/resolved/closed/total) label
$t_label_strings = explode('/', utf8_substr($t_label_string, 1, strlen($t_label_string) - 2));
// add headers for table
if ($f_show_as_table) {
    $t_date_format = config_get('short_date_format');
    html_begin();
    html_head_begin();
    html_css();
    html_content_type();
    html_title(lang_get('by_status'));
    html_head_end();
    html_body_begin();
    echo '<table class="width100"><tr><td></td>';
    if ($f_summary) {
        echo '<th>' . $t_label_strings[0] . '</th>';
        echo '<th>' . $t_label_strings[1] . '</th>';
        echo '<th>' . $t_label_strings[2] . '</th>';
    } else {
        foreach ($t_view_status as $t_status => $t_label) {
            echo '<th>' . $t_label . ' (' . $t_status . ')</th>';
        }
Esempio n. 3
0
function html_page_top1($p_page_title = null)
{
    html_begin();
    html_head_begin();
    html_css();
    html_content_type();
    include config_get('meta_include_file');
    html_rss_link();
    echo '<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />';
    html_title($p_page_title);
    html_head_javascript();
}
Esempio n. 4
0
/**
 * Print the part of the page that comes before meta redirect tags should be inserted
 * @param string $p_page_title page title
 * @return null
 */
function html_page_top1($p_page_title = null)
{
    html_begin();
    html_head_begin();
    html_css();
    html_content_type();
    include config_get('meta_include_file');
    global $g_robots_meta;
    if (!is_blank($g_robots_meta)) {
        echo "\t", '<meta name="robots" content="', $g_robots_meta, '" />', "\n";
    }
    html_rss_link();
    $t_favicon_image = config_get('favicon_image');
    if (!is_blank($t_favicon_image)) {
        echo "\t", '<link rel="shortcut icon" href="', helper_mantis_url($t_favicon_image), '" type="image/x-icon" />', "\n";
    }
    // Advertise the availability of the browser search plug-ins.
    echo "\t", '<link rel="search" type="application/opensearchdescription+xml" title="MantisBT: Text Search" href="' . string_sanitize_url('browser_search_plugin.php?type=text', true) . '" />' . "\n";
    echo "\t", '<link rel="search" type="application/opensearchdescription+xml" title="MantisBT: Issue Id" href="' . string_sanitize_url('browser_search_plugin.php?type=id', true) . '" />' . "\n";
    html_title($p_page_title);
    html_head_javascript();
}
    # Is the user's response the correct birthplace?
    if ($response == $place) {
        print "That is correct!<br />\n";
        printf("%s was born in %s.<br />\n", htmlspecialchars($name), htmlspecialchars($place));
        print "Try the next question:<br /><br />\n";
        present_question($dbh);
    } else {
        printf("\"%s\" is not correct.  Please try again.<br /><br />\n", htmlspecialchars($response));
        $choices = explode("#", $choices);
        display_form($name, $place, $choices);
    }
}
#@ _CHECK_RESPONSE_
#@ _OUTLINE_PART_2_
$title = "U.S. President Quiz";
html_begin($title, $title);
$dbh = sampdb_connect();
#@ _TEST_RESPONSE_
$response = script_param("response");
if (is_null($response)) {
    # invoked for first time
    present_question($dbh);
} else {
    # user submitted response to form
    check_response($dbh);
}
#@ _TEST_RESPONSE_
$dbh = NULL;
# close connection
html_end();
#@ _OUTLINE_PART_2_
Esempio n. 6
0
function do_purge_tweets(array $querybin, $dt_start, $dt_end)
{
    // Purge tweets
    $num_del = tweet_purge($querybin, $dt_start, $dt_end);
    // Show result
    $response_mediatype = choose_mediatype(['application/json', 'text/html']);
    switch ($response_mediatype) {
        case 'application/json':
            respond_with_json(['purge-tweets' => $num_del]);
            break;
        case 'text/html':
            $script_url = $_SERVER['SCRIPT_URL'];
            $components = explode('/', $script_url);
            array_pop($components);
            $query_bin_info = implode('/', $components);
            array_pop($components);
            $query_bin_list = implode('/', $components);
            html_begin("Query bin tweets: {$querybin['bin']}: purge", [["Query Bins", $query_bin_list], [$querybin['bin'], $query_bin_info], ["Purge"]]);
            $hB = isset($dt_end) ? dt_format_html($dt_end) : "";
            if (isset($dt_start)) {
                $hA = dt_format_html($dt_start);
                if (isset($dt_end)) {
                    $dt_desc_html = "tweets from {$hA} to {$hB}";
                } else {
                    $dt_desc_html = "tweets from {$hA} to last tweet";
                }
            } else {
                if (isset($dt_end)) {
                    $dt_desc_html = "tweets from first tweet to {$hB}";
                } else {
                    $dt_desc_html = "all tweets";
                }
            }
            echo <<<END

<p>Purged {$dt_desc_html}.</p>

<p>Number of tweets deleted: {$num_del['tweets']}</p>

END;
            html_end();
            break;
        default:
            print "{$num_del['tweets']} tweets purged from {$querybin['bin']}\n";
            foreach ($num_del as $name => $num) {
                print "  Table {$name}: {$num} rows deleted\n";
            }
            break;
    }
}
Esempio n. 7
0
<?php

require_once __DIR__ . '/lib/common.php';
require_once __DIR__ . '/lib/http_util.php';
switch (choose_mediatype(['text/html'])) {
    case 'text/html':
        html_begin("API", []);
        echo <<<END

            <ul>
              <li><a href="querybin.php">List query bins</a></li>
            </ul>

END;
        echo "<p>Version: ", API_VERSION, "</p>\n";
        html_end();
        break;
    default:
        echo "DMI-TCAT API (version: ", API_VERSION, ")\n";
        echo "  Running this script from the command line does nothing useful!\n";
        echo "  Run \"php querybin.php --help\" instead.\n";
        exit(1);
        break;
}
Esempio n. 8
0
<?php

include "librarylib.php";
session_start();
require "sessioncheck.php";
html_begin($choralcfg_sitename, $choralcfg_sitename, $choralcfg_cssfile);
if ($_SERVER["REQUEST_METHOD"] == "GET" || $_SERVER["REQUEST_METHOD"] == "POST") {
    $timestamp = date("YmdHis");
    //Grab all of the variables and store em in the database
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        while (list($key, $value) = each($HTTP_POST_VARS)) {
            ${$key} = $value;
            if ($DEBUG) {
                print "HTTP_POST_VARS[{$key}] = {$value}<br>\n";
            }
        }
    }
    if ($_SERVER["REQUEST_METHOD"] == "GET") {
        while (list($key, $value) = each($HTTP_GET_VARS)) {
            ${$key} = $value;
            if ($DEBUG) {
                print "HTTP_GET_VARS[{$key}] = {$value}<br>\n";
            }
        }
    }
}
print "<TABLE width=\"100%\" border=\"0\" cellpadding=\"0\" " . "cellspacing=\"10\">\n";
print "<TR><TD valign=\"top\">\n";
include "addlinks.phtml";
print "</TD>\n";
print "<TD>";
Esempio n. 9
0
/**
 * Print the part of the page that comes before meta redirect tags should be inserted
 * @param string $p_page_title Page title.
 * @return void
 */
function html_page_top1($p_page_title = null)
{
    html_begin();
    html_head_begin();
    html_content_type();
    $t_meta = config_get_global('meta_include_file');
    if (!is_blank($t_meta)) {
        include $t_meta;
    }
    global $g_robots_meta;
    if (!is_blank($g_robots_meta)) {
        echo "\t", '<meta name="robots" content="', $g_robots_meta, '" />', "\n";
    }
    html_title($p_page_title);
    html_css();
    html_rss_link();
    $t_favicon_image = config_get('favicon_image');
    if (!is_blank($t_favicon_image)) {
        echo "\t", '<link rel="shortcut icon" href="', helper_mantis_url($t_favicon_image), '" type="image/x-icon" />', "\n";
    }
    # Advertise the availability of the browser search plug-ins.
    $t_title = config_get('search_title');
    $t_searches = array('text', 'id');
    foreach ($t_searches as $t_type) {
        echo "\t", '<link rel="search" type="application/opensearchdescription+xml" ', 'title="' . sprintf(lang_get("opensearch_{$t_type}_description"), $t_title) . '" ', 'href="' . string_sanitize_url('browser_search_plugin.php?type=' . $t_type, true) . '"/>', "\n";
    }
    html_head_javascript();
}
Esempio n. 10
0
function abort_with_error($status, $message)
{
    global $argv;
    if (PHP_SAPI !== 'cli') {
        // Invoked by Web server
        http_response_code($status);
        html_begin("Error", []);
        print "<p style=\"color: red;\">";
        print htmlspecialchars($message);
        print "</p>";
        html_end();
        exit(0);
    } else {
        /// Invoked from command line
        fwrite(STDERR, "{$argv['0']}: error: {$message}\n");
        exit(1);
    }
}