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


PHP tab函数代码示例

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


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

示例1: welcome_render_page_late

function welcome_render_page_late($args)
{
    global $page_has_object;
    if (!$args['edit'] || $page_has_object) {
        return false;
    }
    // we only display the information when there are no other pages in the
    // content directory except the current one
    load_modules('glue');
    $pns = pagenames(array());
    $pns = $pns['#data'];
    if (1 < count($pns)) {
        return false;
    }
    html_add_css(base_url() . 'modules/welcome/welcome-edit.css');
    html_add_js(base_url() . 'modules/welcome/welcome.js');
    body_append('<div id="welcome-msg">' . nl());
    body_append(tab() . '<span id="welcome-first"><img style="float:left; margin:5px 10px 0 5px" src="' . base_url() . 'modules/welcome/gun32.gif">Welcome to HOTGLUE!</span><br>' . nl());
    body_append(tab() . 'Your Content Manipulation System is ready to go!' . nl());
    body_append(tab() . '<p>A short intro before you start:</p>' . nl());
    body_append(tab() . '<span id="cont"><span id="text"><b>1.</b> Right now you are in <u>editing mode</u>. You can use single and double click to access the menus - they will appear next to the mouse pointer.</span>' . nl());
    body_append(tab() . '<span id="text"><b>2.</b> Click on the canvas (white background of the page) to open a menu which will let you create new objects, upload files and embed YouTube and Vimeo videos! Once you made an object click on it to activate its contextual menu.</span>' . nl());
    body_append(tab() . '<span id="text"><b>3.</b> Double-click on the canvas will give you a menu of options to change preferences, show a grid, make new pages, set background picture and more!</span>' . nl());
    body_append(tab() . '<span id="text"><b>4.</b> Remove "' . (SHORT_URLS ? '' : '?') . 'edit" from the address of the page (the URL) to see the "view-only" version. That\'s how your page will look to everyone else!</span>' . nl());
    body_append(tab() . '<span id="text"><b>5.</b> To get back to editing mode add "' . (SHORT_URLS ? '' : '?') . 'edit" to the URL of the page.<br>(for example: ' . base_url() . '<b>' . (SHORT_URLS ? '' : '?') . 'edit</b>)</span></span>' . nl());
    body_append(tab() . '<p>We recommend you to use <a href="http://firefox.com" target="_blank">Mozilla Firefox</a> browser when editing in HOTGLUE. Firefox is a very reliable and modern web-browser, it is our favorite!' . nl());
    body_append(tab() . '<p>You can find more information on how to work with HOTGLUE on our <a href="http://hotglue.me" target="_blank">web-site</a>. Make sure to check out "<a href="http://hotglue.me/what" target="_blank">What is HOTGLUE?</a>" and "<a href="http://hotglue.me/how" target="_blank">How to HOTGLUE?</a>" pages!' . nl());
    body_append(tab() . '<p>Enjoy! <span id="welcome-light">[click this message to make it go away]</span></p>' . nl());
    body_append('</div>' . nl());
    return true;
}
开发者ID:danielfogarty,项目名称:damp,代码行数:31,代码来源:module_welcome.inc.php

示例2: array_to_js

/**
 *	convert an associative array to a javascript block
 *
 *	@param array $container container array
 *	@return string
 */
function array_to_js($container)
{
    $ret = '<script type="text/javascript">' . nl();
    // sort container by keys
    ksort($container);
    $exists = array();
    foreach ($container as $key => $val) {
        // make sure the keys exist
        $objs = expl('.', $key);
        for ($i = 0; $i < count($objs) - 1; $i++) {
            $obj = implode('.', array_slice($objs, 0, $i + 1));
            if (!in_array($obj, $exists)) {
                if ($i == 0) {
                    $ret .= tab() . 'var ' . $obj . ' = ' . $obj . ' || {};' . nl();
                } else {
                    $ret .= tab() . $obj . ' = ' . $obj . ' || {};' . nl();
                }
                $exists[] = $obj;
            }
        }
        $ret .= tab() . '' . $key . ' = ' . json_encode($val) . ';' . nl();
    }
    $ret .= '</script>' . nl();
    return $ret;
}
开发者ID:danielfogarty,项目名称:damp,代码行数:31,代码来源:util.inc.php

示例3: log_msg

/**
 *	log a message to file
 *
 *	@param string $level can be error, warn, info or debug
 *	@param string $msg message
 *	@return bool true if successful, false if not
 */
function log_msg($level, $msg)
{
    global $logfile;
    global $loglevels;
    global $request_id;
    // open logfile
    if ($logfile === false) {
        $m = umask(0111);
        // having two processes appending to the same file should
        // work fine (at least on Linux)
        $logfile = @fopen(LOG_FILE, 'ab');
        umask($m);
    }
    if ($logfile === false) {
        return false;
    }
    foreach ($loglevels as $ll) {
        if ($ll == $level) {
            fwrite($logfile, date('Y-m-d H:i:s') . tab() . pad($_SERVER['REMOTE_ADDR'], 15) . tab() . sprintf('%05u', $request_id) . tab() . $level . tab() . $msg . nl());
            fflush($logfile);
            break;
        }
        if ($ll == LOG_LEVEL) {
            break;
        }
    }
    return true;
}
开发者ID:danielfogarty,项目名称:damp,代码行数:35,代码来源:log.inc.php

示例4: welcome_render_page_late

function welcome_render_page_late($args)
{
    global $page_has_object;
    if (!$args['edit'] || $page_has_object) {
        return false;
    }
    // we only display the information when there are no other pages in the
    // content directory except the current one
    load_modules('glue');
    $pns = pagenames(array());
    $pns = $pns['#data'];
    if (1 < count($pns)) {
        return false;
    }
    html_add_css(base_url() . 'modules/welcome/welcome-edit.css');
    html_add_js(base_url() . 'modules/welcome/welcome.js');
    body_append('<div id="welcome-msg">' . nl());
    body_append(tab() . '<span id="welcome-first">Welcome to HOTGLUE!</span><br>' . nl());
    body_append(tab() . 'Your Content Manipulation System is ready to go!' . nl());
    body_append(tab() . '<p>A short intro before you start:<br>' . nl());
    body_append(tab() . '&#164; To get back to editing mode in the future, add "' . (SHORT_URLS ? '' : '?') . 'edit" to the address in the address bar (i.e.: ' . base_url() . '<b>' . (SHORT_URLS ? '' : '?') . 'edit</b>)<br>' . nl());
    body_append(tab() . '&#164; In editing mode, you can use single and double click to access the menus.<br>' . nl());
    body_append(tab() . '&#164; Click the page\'s background once to open a menu that lets you create new objects, upload files and embed videos (YouTube and Vimeo).<br>' . nl());
    body_append(tab() . '&#164; Double-click to open a menu that allows you to change preferences, show a grid, make new pages and more.<br>' . nl());
    body_append(tab() . '&#164; Remove "' . (SHORT_URLS ? '' : '?') . 'edit" from the address in the address bar to go to the viewing-only mode of this page.</p>' . nl());
    body_append(tab() . '<p>You can find more ideas on how to use HOTGLUE at the <a href="http://hotglue.me/how_basic" target="_blank">"How-to" section of our website</a>!' . nl());
    body_append(tab() . '<p>Enjoy!<br>' . nl());
    body_append(tab() . '<span id="welcome-light">[This message goes away when you click it]</span></p>' . nl());
    body_append('</div>' . nl());
    return true;
}
开发者ID:QbpNogCYUGmaGPzD,项目名称:hotglue2,代码行数:31,代码来源:module_welcome.inc.php

示例5: controller_create_page

/**
 *	show a site where authenticated users can create new pages
 */
function controller_create_page($args)
{
    page_canonical($args[0][0]);
    $page = $args[0][0];
    if (page_exists($page)) {
        log_msg('debug', 'controller_create_page: page ' . quot($page) . 'already exists, invoking controller_edit');
        controller_edit($args);
        return;
    }
    load_modules('glue');
    default_html(true);
    html_add_css(base_url() . 'css/hotglue_error.css');
    if (USE_MIN_FILES) {
        html_add_js(base_url() . 'js/create_page.min.js');
    } else {
        html_add_js(base_url() . 'js/create_page.js');
    }
    html_add_js_var('$.glue.page', $page);
    html_add_js_var('$.glue.q', SHORT_URLS ? '' : '?');
    $bdy =& body();
    elem_attr($bdy, 'id', 'create_page');
    body_append(tab(1) . '<div id="paper">' . nl());
    body_append(tab(2) . '<div id="wrapper">' . nl());
    body_append(tab(3) . '<div id="content">' . nl());
    body_append(tab(4) . '<div id="left-nav">' . nl());
    body_append(tab(5) . '<img src="' . htmlspecialchars(base_url(), ENT_COMPAT, 'UTF-8') . 'img/hotglue-logo.png" alt="logo">' . nl());
    body_append(tab(4) . '</div>' . nl());
    body_append(tab(4) . '<div id="main">' . nl());
    body_append(tab(5) . '<h1 id="error-title">Page does not exist yet!</h1>' . nl());
    body_append(tab(5) . '<p>' . nl());
    body_append(tab(6) . 'This page does not exist yet!<br>' . nl());
    body_append(tab(6) . 'Would you like to create the page?' . nl());
    body_append(tab(5) . '</p>' . nl());
    body_append(tab(5) . '<form><input id="create_page_btn" type="button" value="Create it!"></form>' . nl());
    body_append(tab(4) . '</div>' . nl());
    body_append(tab(3) . '</div>' . nl());
    body_append(tab(2) . '</div>' . nl());
    body_append(tab(2) . '<div style="position: absolute; left: 200px; top: -10px; z-index: 2;">' . nl());
    body_append(tab(3) . '<img src="' . htmlspecialchars(base_url(), ENT_COMPAT, 'UTF-8') . 'img/hotglue-404.png" alt="404">' . nl());
    body_append(tab(2) . '</div>' . nl());
    body_append(tab(1) . '</div>' . nl());
    echo html_finalize();
}
开发者ID:QbpNogCYUGmaGPzD,项目名称:hotglue2,代码行数:46,代码来源:controller.inc.php

示例6: listeElementNoeudCourant

function listeElementNoeudCourant($noeud, $numDossier, $iter = 0)
{
    $iter++;
    while ($noeud) {
        switch ($noeud->node_name()) {
            case "dossier":
                // Ajout d'un dossier
                $nom = $noeud->get_attribute('nom');
                echo tab($iter) . $iter . "-" . "dossier " . $nom . "\n";
                $dossierParent = new Dossier($numDossier);
                $dossier = new Dossier();
                $dossier->nom = $nom;
                $numNouveauDossier = $dossierParent->ajouterDossier($dossier);
                $fils = $noeud->first_child();
                listeElementNoeudCourant($fils, $numNouveauDossier, $iter);
                break;
            case "lien":
                // On récupère les variables
                $langue = $noeud->get_attribute('langue');
                $url = $noeud->get_attribute('url');
                $nom = $noeud->get_attribute('nom');
                // On crée les objets Dossier et Url
                $dossierParent = new Dossier($numDossier);
                $lien = new Url();
                // On définit les attributs de l'Url
                $lien->langue = $langue;
                $lien->url = $url;
                $lien->nom = $nom;
                // On ajoute le lien
                $dossierParent->ajouterLien($lien, 1);
                echo tab($iter) . $iter . "-" . "lien [" . $langue . '] ' . $url . ' ' . $nom . "\n";
                break;
            case "livre":
                echo tab($iter) . "livre\n";
                break;
        }
        $noeud = $noeud->next_sibling();
    }
}
开发者ID:BackupTheBerlios,项目名称:blr,代码行数:39,代码来源:import.class.php

示例7: html_finalize

/**
 *	turn the page into a html string
 *
 *	@param bool &$cache is output cachable (will only modified if $cache is 
 *	true before)
 *	@return string html
 */
function html_finalize(&$cache = false)
{
    global $html;
    // return html5
    $ret = '<!DOCTYPE html>' . nl();
    $ret .= '<html';
    if (@is_array($html['header']['style'])) {
        $ret .= ' style="';
        ksort($html['header']['style']);
        foreach ($html['header']['style'] as $key => $val) {
            $ret .= htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . ': ' . htmlspecialchars($val, ENT_COMPAT, 'UTF-8') . '; ';
        }
        // strip the last space
        $ret = substr($ret, 0, -1);
        $ret .= '"';
    }
    $ret .= '>' . nl();
    $ret .= '<head>' . nl();
    $ret .= '<title>' . htmlspecialchars($html['header']['title'], ENT_NOQUOTES, 'UTF-8') . '</title>' . nl();
    $ret .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' . nl();
    if (@is_array($html['header']['alternate'])) {
        foreach ($html['header']['alternate'] as $e) {
            $ret .= '<link rel="alternate" type="' . htmlspecialchars($e['type'], ENT_COMPAT, 'UTF-8') . '" href="' . htmlspecialchars($e['url'], ENT_COMPAT, 'UTF-8') . '" title="' . htmlspecialchars($e['title'], ENT_COMPAT, 'UTF-8') . '">' . nl();
        }
    }
    if (!empty($html['header']['favicon'])) {
        $ret .= '<link rel="shortcut icon" href="' . htmlspecialchars($html['header']['favicon'], ENT_COMPAT, 'UTF-8') . '">' . nl();
    }
    if (@is_array($html['header']['css'])) {
        _array_sort_by_prio($html['header']['css']);
        // removed the removal of duplicates here as two different media might point to the same url
        //array_unique_element($html['header']['css'], 'url');
        foreach ($html['header']['css'] as $e) {
            $ret .= '<link rel="stylesheet" type="text/css" href="' . htmlspecialchars($e['url'], ENT_COMPAT, 'UTF-8') . '"';
            if (!empty($e['media'])) {
                $ret .= ' media="' . htmlspecialchars($e['media'], ENT_COMPAT, 'UTF-8') . '"';
            }
            $ret .= '>' . nl();
        }
    }
    if (@is_array($html['header']['css_inline'])) {
        _array_sort_by_prio($html['header']['css_inline']);
        if (0 < count($html['header']['css_inline'])) {
            $ret .= '<style type="text/css">' . nl();
        }
        foreach ($html['header']['css_inline'] as $c) {
            $rule = $c['rule'];
            // if the rule ends with a newline character, remove it
            if (substr($rule, -1) == "\n") {
                $rule = substr($rule, 0, -1);
            }
            // move rule in by one tab
            $rule = str_replace("\n", "\n\t", $rule);
            $ret .= tab() . $rule . nl();
        }
        if (0 < count($html['header']['css_inline'])) {
            $ret .= '</style>' . nl();
        }
    }
    if (@is_array($html['header']['js'])) {
        _array_sort_by_prio($html['header']['js']);
        array_unique_element($html['header']['js'], 'url');
        foreach ($html['header']['js'] as $e) {
            $ret .= '<script type="text/javascript" src="' . htmlspecialchars($e['url'], ENT_COMPAT, 'UTF-8') . '"></script>' . nl();
        }
    }
    if (@is_array($html['header']['js_var'])) {
        $ret .= array_to_js($html['header']['js_var']);
    }
    if (@is_array($html['header']['js_inline'])) {
        _array_sort_by_prio($html['header']['js_inline']);
        foreach ($html['header']['js_inline'] as $c) {
            if (!empty($c['reason'])) {
                $ret .= '<!-- ' . $c['reason'] . ' -->' . nl();
                $ret .= '<script type="text/javascript">' . nl();
                // if the code ends with a newline character, remove it
                if (substr($c['code'], -1) == "\n") {
                    $c['code'] = substr($c['code'], 0, -1);
                }
                // move code in by one tab
                $c = str_replace("\n", "\n\t", $c);
                $ret .= tab() . $c['code'] . nl();
                $ret .= '</script>' . nl();
            }
        }
    }
    $ret .= '</head>' . nl();
    $ret .= elem_finalize($html['body']);
    $ret .= '</html>';
    // pass caching information up if requested
    if ($cache) {
        if (!$html['cache']) {
            $cache = false;
//.........这里部分代码省略.........
开发者ID:QbpNogCYUGmaGPzD,项目名称:hotglue2,代码行数:101,代码来源:html.inc.php

示例8: ini_set

ini_set('error_append_string', null);
if (!isset($_SESSION["uid"])) {
    header("location:miniadm.logon.php");
}
include_once dirname(__FILE__) . "/ressources/class.templates.inc";
include_once dirname(__FILE__) . "/ressources/class.users.menus.inc";
include_once dirname(__FILE__) . "/ressources/class.miniadm.inc";
include_once dirname(__FILE__) . "/ressources/class.mysql.squid.builder.php";
include_once dirname(__FILE__) . "/ressources/class.user.inc";
include_once dirname(__FILE__) . "/ressources/class.calendar.inc";
if (!$_SESSION["AsWebStatisticsAdministrator"]) {
    header("location:miniadm.index.php");
    die;
}
if (isset($_GET["tab"])) {
    tab();
    exit;
}
if (isset($_GET["flow"])) {
    section_flow();
    exit;
}
if (isset($_GET["flow1"])) {
    section_flow_graph1();
    exit;
}
if (isset($_GET["topuser"])) {
    section_topuser();
    exit;
}
if (isset($_GET["topuser1"])) {
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:31,代码来源:miniadm.webstats.popup.ByMonthFamilysite.php

示例9: article_partial_view_modes

/**
 * Renders list of view modes.
 *
 * The rendered widget can be customised via the 'article_ui > view'
 * pluggable UI callback event.
 *
 * @param  array $rs Article data
 * @return string HTML
 */
function article_partial_view_modes($rs)
{
    global $step, $view, $use_textile;
    if ($step == "create") {
        $hasfilter = $use_textile !== LEAVE_TEXT_UNTOUCHED;
    } else {
        $hasfilter = $rs['textile_body'] !== LEAVE_TEXT_UNTOUCHED || $rs['textile_excerpt'] !== LEAVE_TEXT_UNTOUCHED;
    }
    if ($hasfilter) {
        $out = n . tag(tab('text', $view) . tab('html', $view) . tab('preview', $view), 'ul');
    } else {
        $out = '&#160;';
    }
    $out = pluggable_ui('article_ui', 'view', $out, $rs);
    return n . tag($out . n, 'div', array('id' => 'view_modes'));
}
开发者ID:ClaireBrione,项目名称:textpattern,代码行数:25,代码来源:txp_article.php

示例10: display_cart


//.........这里部分代码省略.........
             break;
         case 'HUF':
             $currencySymbol = 'Ft&nbsp;';
             break;
         case 'CZK':
             $currencySymbol = 'K&#269;&nbsp;';
             break;
         case 'ILS':
             $currencySymbol = '&#8362;&nbsp;';
             break;
         case 'TWD':
             $currencySymbol = 'NT$';
             break;
         case 'THB':
             $currencySymbol = '&#3647;';
             break;
         case 'MYR':
             $currencySymbol = 'RM';
             break;
         case 'PHP':
             $currencySymbol = 'Php';
             break;
         case 'BRL':
             $currencySymbol = 'R$';
             break;
         case 'USD':
         default:
             $currencySymbol = '$';
             break;
     }
     ////////////////////////////////////////////////////////////////////////
     // Output the cart
     // Return specified number of tabs to improve readability of HTML output
     function tab($n)
     {
         $tabs = null;
         while ($n > 0) {
             $tabs .= "\t";
             --$n;
         }
         return $tabs;
     }
     // If there's an error message wrap it in some HTML
     if ($errorMessage) {
         $errorMessage = "<p id='jcart-error'>{$errorMessage}</p>";
     }
     $this->totalIntegral = $this->integralCal->get_integral($this->subtotal, 'Dessert');
     // Display the cart header
     echo tab(1) . "{$errorMessage}\n";
     echo tab(1) . "<form method='post' action='{$checkout}'>\n";
     echo tab(2) . "<fieldset>\n";
     echo tab(3) . "<input type='hidden' name='jcartToken' value='{$_SESSION['jcartToken']}' />\n";
     echo tab(3) . "<input type='hidden' value='{$this->itemCount}' id='merchandiseCount' />\n";
     echo tab(3) . "<table border='1'>\n";
     echo tab(4) . "<thead>\n";
     echo tab(5) . "<tr>\n";
     echo tab(6) . "<th colspan='3'>\n";
     echo tab(7) . "&nbsp;<strong id='jcart-title'>{$config['text']['cartTitle']}</strong> ({$this->itemCount})\n";
     echo tab(6) . "</th>\n";
     echo tab(5) . "</tr>" . "\n";
     echo tab(4) . "</thead>\n";
     // Display the cart footer
     echo tab(4) . "<tfoot>\n";
     echo tab(5) . "<tr>\n";
     echo tab(6) . "<th colspan='2'>\n";
     echo tab(7) . "<span id='jcart-integral'>&nbsp;{$config['text']['totalIntegral']}: <strong>" . $this->totalIntegral . "</strong></span>\n";
开发者ID:fanqimeng,项目名称:4tweb,代码行数:67,代码来源:jcart.php

示例11: tab

echo tab('files');
?>
"><a href="/admin/tests/<?php 
echo $_REQUEST['test_id'];
?>
/files/">Файлы</a></li>
          <? if($_REQUEST['test_id']): ?>
          <li class="<?php 
echo tab('test-settings');
?>
"><a href="/admin/tests/<?php 
echo $_REQUEST['test_id'];
?>
/">Настройки теста</a></li>
          <li class="<?php 
echo tab('questions');
?>
"><a href="/admin/tests/<?php 
echo $_REQUEST['test_id'];
?>
/questions/">Вопросы</a></li>
          <? endif; ?>
        </ul>
        <div class="clear"></div>
      </div>
    </div>    
    <div id="wrapper">
      <div id="main">
        <? if($flash): ?>
        <div class="block">
          <div class="content">            
开发者ID:andreyvit,项目名称:retester,代码行数:31,代码来源:layout.inc.php

示例12: miniForm

function miniForm($string, $id, $name, $identifier = 'miniForm')
{
    $out = "<form class='form-inline " . $identifier . "' method='post'>" . nl();
    $out .= tab() . "<input name='" . $name . "' type='hidden' value='" . $id . "' />" . nl();
    $out .= $string . nl();
    $out .= tab() . "<input class='btn iHide' type='submit' value='Update' />" . nl();
    $out .= "</form>" . nl();
    return $out;
}
开发者ID:repsycle,项目名称:baseline,代码行数:9,代码来源:functions.inc.php

示例13: fwrite

        fwrite($fh, "return \$this->" . $field . ";");
        br($fh);
        tab($fh);
        fwrite($fh, "}");
        br($fh);
        tab($fh);
        fwrite($fh, "public function set" . $f . "( \$" . $field . " )");
        br($fh);
        tab($fh);
        fwrite($fh, "{");
        br($fh);
        tab($fh);
        tab($fh);
        fwrite($fh, "\$this->" . $field . " = \$" . $field . ";");
        br($fh);
        tab($fh);
        fwrite($fh, "}");
        br($fh);
    }
    fwrite($fh, "}");
    br($fh);
    fwrite($fh, "?>");
    fclose($fh);
    print "File: " . $className . ".php written.";
    print "<br />";
}
?>
<form action="<?php 
echo $_SERVER['PHP_SELF'];
?>
" method="POST">
开发者ID:rbudhu,项目名称:SPD,代码行数:31,代码来源:classgen.php

示例14: article_edit

function article_edit($message = "")
{
    global $txpcfg, $txp_user, $vars;
    extract(get_prefs());
    extract(gpsa(array('view', 'from_view', 'step')));
    if (!empty($GLOBALS['ID'])) {
        // newly-saved article
        $ID = intval($GLOBALS['ID']);
        $step = 'edit';
    } else {
        $ID = gps('ID');
    }
    include_once $txpcfg['txpath'] . '/lib/classTextile.php';
    $textile = new Textile();
    if (!$view) {
        $view = "text";
    }
    if (!$step) {
        $step = "create";
    }
    if ($step == "edit" && $view == "text" && !empty($ID) && $from_view != "preview" && $from_view != 'html') {
        $pull = true;
        //-- it's an existing article - off we go to the db
        $rs = safe_row("*, unix_timestamp(Posted) as sPosted,\n\t\t\t\tunix_timestamp(LastMod) as sLastMod", "textpattern", "ID={$ID}");
        extract($rs);
        if ($AnnotateInvite != $comments_default_invite) {
            $AnnotateInvite = $AnnotateInvite;
        } else {
            $AnnotateInvite = $comments_default_invite;
        }
    } else {
        $pull = false;
        //-- assume they came from post
        if (!$from_view or $from_view == 'text') {
            extract(gpsa($vars));
        } elseif ($from_view == 'preview' or $from_view == 'html') {
            // coming from either html or preview
            if (isset($_POST['store'])) {
                $store = unserialize(base64_decode($_POST['store']));
                extract($store);
            }
        }
        foreach ($vars as $var) {
            if (isset(${$var})) {
                $store_out[$var] = ${$var};
            }
        }
    }
    $GLOBALS['step'] = $step;
    if ($step == 'create') {
        $textile_body = 1;
        $textile_excerpt = 1;
    }
    if ($step != 'create') {
        // Previous record?
        $prev_id = checkIfNeighbour('prev', $sPosted);
        // Next record?
        $next_id = checkIfNeighbour('next', $sPosted);
    }
    pagetop($Title, $message);
    echo '<form action="index.php" method="post" name="article">';
    if (!empty($store_out)) {
        echo hInput('store', base64_encode(serialize($store_out)));
    }
    echo hInput('ID', $ID), eInput('article'), sInput($step);
    echo '<input type="hidden" name="view" />', startTable('edit');
    echo '<tr><td>&nbsp;</td><td colspan="3">', $view == 'preview' ? hed(ucfirst(gTxt('preview')), 2) . graf($Title) : '', $view == 'html' ? hed('XHTML', 2) . graf($Title) : '', $view == 'text' ? br . '<input type="text" name="Title" value="' . cleanfInput($Title) . '" class="edit" size="40" tabindex="1" />' : '', '</td></tr>';
    //-- article input --------------
    echo '<tr>
  		<td valign="top">', $view == 'text' && $use_textile == 2 ? '<p><a href="#" onclick="toggleDisplay(\'textile_help\');">' . gTxt('textile_help') . '</a></p>
		<div id="textile_help" style="display:none;">' . sidehelp() . '</div>' : sp;
    if ($view == 'text') {
        echo '<p><a href="#" onclick="toggleDisplay(\'advanced\');">' . gTxt('advanced_options') . '</a></p>', '<div id="advanced" style="display:none;">', graf(gTxt('use_textile') . br . tag(checkbox2('textile_body', $textile_body) . gTxt('article'), 'label') . br . tag(checkbox2('textile_excerpt', $textile_excerpt) . gTxt('excerpt'), 'label')), $allow_form_override ? graf(gTxt('override_default_form') . br . form_pop($override_form) . popHelp('override_form')) : '', $custom_1_set ? custField(1, $custom_1_set, $custom_1) : '', $custom_2_set ? custField(2, $custom_2_set, $custom_2) : '', $custom_3_set ? custField(3, $custom_3_set, $custom_3) : '', $custom_4_set ? custField(4, $custom_4_set, $custom_4) : '', $custom_5_set ? custField(5, $custom_5_set, $custom_5) : '', $custom_6_set ? custField(6, $custom_6_set, $custom_6) : '', $custom_7_set ? custField(7, $custom_7_set, $custom_7) : '', $custom_8_set ? custField(8, $custom_8_set, $custom_8) : '', $custom_9_set ? custField(9, $custom_9_set, $custom_9) : '', $custom_10_set ? custField(10, $custom_10_set, $custom_10) : '', graf(gTxt('keywords') . popHelp('keywords') . br . '<textarea name="Keywords" style="width:100px;height:80px" rows="1" cols="1">' . $Keywords . '</textarea>'), graf(gTxt('article_image') . popHelp('article_image') . br . fInput('text', 'Image', $Image, 'edit')), graf(gTxt('url_title') . popHelp('url_title') . br . fInput('text', 'url_title', $url_title, 'edit')) . '</div>
			
			<p><a href="#" onclick="toggleDisplay(\'recent\');">' . gTxt('recent_articles') . '</a>' . '</p>' . '<div id="recent" style="display:none;">';
        $recents = safe_rows_start("Title, ID", 'textpattern', "1 order by LastMod desc limit 10");
        if ($recents) {
            echo '<p>';
            while ($recent = nextRow($recents)) {
                extract($recent);
                if (!$Title) {
                    $Title = gTxt('untitled') . sp . $ID;
                }
                echo '<a href="?event=article' . a . 'step=edit' . a . 'ID=' . $ID . '">' . $Title . '</a>' . br . n;
            }
            echo '</p>';
        }
        echo '</div>';
    } else {
        echo sp;
    }
    echo '</td>
    	<td valign="top" style="width:400px">';
    if ($view == "preview") {
        if ($use_textile == 2) {
            echo $textile->TextileThis($Body);
        } else {
            if ($use_textile == 1) {
                echo nl2br($Body);
            } else {
//.........这里部分代码省略.........
开发者ID:bgarrels,项目名称:textpattern,代码行数:101,代码来源:txp_article.php

示例15: hotglue_error

/**
 *	return a hotglue-themed error message to the client
 *
 *	the function does not return if successful.
 *	@param int $code error code
 *	@param bool $no_header don't output any header
 *	@return false if the error code is not supported yet
 */
function hotglue_error($code, $no_header = false)
{
    if (!$no_header) {
        // output header
        if (USE_HOTGLUE_ERRORS) {
            $header_only = true;
        } else {
            $header_only = false;
        }
        if (!http_error($code, $header_only)) {
            return false;
        }
    }
    // output informative message
    html_flush();
    default_html(false);
    html_add_css(base_url() . 'css/hotglue_error.css');
    $bdy =& body();
    elem_attr($bdy, 'id', 'hotglue_error');
    body_append(tab(1) . '<div id="paper">' . nl());
    body_append(tab(2) . '<div id="wrapper">' . nl());
    body_append(tab(3) . '<div id="content">' . nl());
    body_append(tab(4) . '<div id="left-nav">' . nl());
    body_append(tab(5) . '<img src="' . htmlspecialchars(base_url(), ENT_COMPAT, 'UTF-8') . 'img/hotglue-logo.png" alt="logo">' . nl());
    body_append(tab(4) . '</div>' . nl());
    body_append(tab(4) . '<div id="main">' . nl());
    if ($code == 400) {
        body_append(tab(5) . '<h1 id="error-title">ERROR 400, bad request!</h1>' . nl());
    } elseif ($code == 401) {
        body_append(tab(5) . '<h1 id="error-title">Authorization required!</h1>' . nl());
    } elseif ($code == 404) {
        body_append(tab(5) . '<h1 id="error-title">ERROR 404, not found!</h1>' . nl());
    } elseif ($code == 500) {
        body_append(tab(5) . '<h1 id="error-title">ERROR 500, server fault!</h1>' . nl());
    }
    body_append(tab(5) . '<p>' . nl());
    if ($code == 400) {
        body_append(tab(6) . 'Something got screwed up...<br>' . nl());
        body_append(tab(6) . 'The page is sending a bad request to the server!' . nl());
    } elseif ($code == 401) {
        body_append(tab(6) . 'You need to be logged in in order to do this.<br>' . nl());
    } elseif ($code == 404) {
        body_append(tab(6) . 'It looks like you got lost in cyber-space...<br>' . nl());
        body_append(tab(6) . 'The page you are trying to reach does not exist!' . nl());
    } elseif ($code == 500) {
        body_append(tab(6) . 'Are we runnining out of fuel?!<br>' . nl());
        body_append(tab(6) . 'Something is causing serious server errors!' . nl());
    }
    body_append(tab(5) . '</p>' . nl());
    body_append(tab(6) . '<a href="' . htmlspecialchars(base_url(), ENT_COMPAT, 'UTF-8') . '" id="home">take me home!</a>' . nl());
    body_append(tab(4) . '</div>' . nl());
    body_append(tab(3) . '</div>' . nl());
    body_append(tab(2) . '</div>' . nl());
    body_append(tab(2) . '<div style="position: absolute; left: 200px; top: -10px; z-index: 2;">' . nl());
    body_append(tab(3) . '<img src="' . htmlspecialchars(base_url(), ENT_COMPAT, 'UTF-8') . 'img/hotglue-404.png" alt="404">' . nl());
    body_append(tab(2) . '</div>' . nl());
    body_append(tab(1) . '</div>' . nl());
    echo html_finalize();
    die;
}
开发者ID:QbpNogCYUGmaGPzD,项目名称:hotglue2,代码行数:68,代码来源:common.inc.php


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