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


PHP ocp_tempcode::handle_symbol_preprocessing方法代码示例

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


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

示例1: lorem_globalise

/**
 * Lorem version of globalise. It will wrap the input into something that is "stable XHTML" and thus can work inside an XHTML editor
 *
 * @param  tempcode		The tempcode to put into a nice frame
 * @param  ?mixed			'Additional' message (NULL: none)
 * @param  string			The type of special message
 * @set    inform warn ""
 * @param  boolean		Whether to automatically include the header and footer templates
 * @return tempcode		Standalone page
 */
function lorem_globalise($middle, $message = NULL, $type = '', $include_header_and_footer = false)
{
    global $CYCLES;
    $CYCLES = array();
    // Here we reset some Tempcode environmental stuff, because template compilation or preprocessing may have dirtied things
    global $LOREM_AVOID_GLOBALISE;
    if ($LOREM_AVOID_GLOBALISE || is_full_screen_template(NULL, $middle)) {
        return $middle;
    }
    $_message = !is_null($message) ? do_lorem_template('ADDITIONAL', array('TYPE' => $type, 'MESSAGE' => $message)) : new ocp_tempcode();
    $out = new ocp_tempcode();
    if ($include_header_and_footer) {
        $display = do_lorem_template('HEADER', array('VERSION_NUMBER' => lorem_phrase(), 'CHARSET' => 'ISO-8859-1', 'HEADER_TEXT' => lorem_phrase(), 'DESCRIPTION' => lorem_paragraph(), 'KEYWORDS' => lorem_phrase(), 'SELF_URL' => placeholder_url(), 'REFRESH' => '', 'LOGOURL' => placeholder_image_url(), 'SHOW_TOP' => true));
        $out->attach($display);
    }
    $out->attach(do_lorem_template('GLOBAL', array('HELPER_PANEL_TUTORIAL' => '', 'HELPER_PANEL_HTML' => '', 'HELPER_PANEL_TEXT' => '', 'HELPER_PANEL_PIC' => '', 'MESSAGE_TOP' => '', 'MESSAGE' => $_message, 'MIDDLE' => $middle, 'BREADCRUMBS' => '')));
    if ($include_header_and_footer) {
        $display = do_lorem_template('FOOTER', array('BAIL_OUT' => false, 'ERROR_MESSAGES_DURING_OUTPUT' => '', 'SHOW_BOTTOM' => true, 'HAS_SU' => lorem_phrase(), 'STAFF_ACTIONS' => lorem_phrase(), 'EXTRA_FOOT' => new ocp_tempcode()));
        $out->attach($display);
    }
    $out->handle_symbol_preprocessing();
    return $out;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:33,代码来源:lorem.php

示例2: globalise

/**
 * Turn the tempcode lump into a standalone page (except for header/footer which is assumed already handled elsewhere).
 *
 * @param  tempcode		The tempcode to put into a nice frame
 * @param  ?mixed			'Additional' message (NULL: none)
 * @param  string			The type of special message
 * @set    inform warn ""
 * @param  boolean		Whether to automatically include the header and footer templates
 * @return tempcode		Standalone page
 */
function globalise($middle, $message = NULL, $type = '', $include_header_and_footer = false)
{
    require_code('site');
    if (running_script('iframe')) {
        global $ATTACHED_MESSAGES;
        $middle->handle_symbol_preprocessing();
        $tpl = do_template('STYLED_HTML_WRAP', array('TITLE' => is_null($GLOBALS['DISPLAYED_TITLE']) ? do_lang_tempcode('NA') : $GLOBALS['DISPLAYED_TITLE'], 'EXTRA_HEAD' => $GLOBALS['EXTRA_HEAD'], 'EXTRA_FOOT' => $GLOBALS['EXTRA_FOOT'], 'MESSAGE_TOP' => $ATTACHED_MESSAGES, 'FRAME' => true, 'TARGET' => '_self', 'CONTENT' => $middle));
        $tpl->handle_symbol_preprocessing();
        return $tpl;
    }
    global $DONE_HEADER;
    global $CYCLES;
    $CYCLES = array();
    // Here we reset some Tempcode environmental stuff, because template compilation or preprocessing may have dirtied things
    if ($GLOBALS['HELPER_PANEL_TUTORIAL'] === NULL) {
        $GLOBALS['HELPER_PANEL_TUTORIAL'] = '';
    }
    if ($GLOBALS['HELPER_PANEL_HTML'] === NULL) {
        $GLOBALS['HELPER_PANEL_HTML'] = '';
    }
    if ($GLOBALS['HELPER_PANEL_TEXT'] === NULL) {
        $GLOBALS['HELPER_PANEL_TEXT'] = '';
    }
    if ($GLOBALS['HELPER_PANEL_PIC'] === NULL) {
        $GLOBALS['HELPER_PANEL_PIC'] = '';
    }
    $_message = $message !== NULL ? do_template('ADDITIONAL', array('_GUID' => 'b4c9f0a0bbfb9344d00c29db8ff5715d', 'TYPE' => $type, 'MESSAGE' => $message)) : new ocp_tempcode();
    if (get_option('show_docs') == '0') {
        $GLOBALS['HELPER_PANEL_TUTORIAL'] = '';
    }
    $global = new ocp_tempcode();
    $bail_out = isset($DONE_HEADER) && $DONE_HEADER;
    if ($include_header_and_footer && !$bail_out) {
        $global->attach(do_header());
    }
    $global->attach(do_template('GLOBAL', array('_GUID' => '592faa2c0e8bf2dc3492de2c11ca7131', 'HELPER_PANEL_TUTORIAL' => $GLOBALS['HELPER_PANEL_TUTORIAL'], 'HELPER_PANEL_HTML' => $GLOBALS['HELPER_PANEL_HTML'], 'HELPER_PANEL_TEXT' => $GLOBALS['HELPER_PANEL_TEXT'], 'HELPER_PANEL_PIC' => $GLOBALS['HELPER_PANEL_PIC'], 'MESSAGE_TOP' => $GLOBALS['ATTACHED_MESSAGES'], 'MESSAGE' => $_message, 'MIDDLE' => $middle, 'BREADCRUMBS' => breadcrumbs())));
    if ($include_header_and_footer) {
        $global->attach(do_footer($bail_out));
    }
    $global->handle_symbol_preprocessing();
    if (get_value('xhtml_strict') === '1') {
        $global = make_xhtml_strict($global);
    }
    return $global;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:55,代码来源:support.php

示例3: do_site


//.........这里部分代码省略.........
    global $PAGE;
    $PAGE = get_page_name();
    $doing_special_page_type = $special_page_type != 'view' && $special_page_type != 'show_markers' && $special_page_type != 'show_edit_links' && $special_page_type != 'memory' && (has_specific_permission(get_member(), 'view_profiling_modes') || $GLOBALS['IS_ACTUALLY_ADMIN']);
    // Load up our frames into strings. Note that the header and the footer are fixed already.
    $middle = request_page($PAGE, true);
    global $CYCLES;
    $CYCLES = array();
    // Here we reset some Tempcode environmental stuff, because template compilation or preprocessing may have dirtied things
    if ($middle === NULL || $middle->is_definitely_empty()) {
        $GLOBALS['HTTP_STATUS_CODE'] = '404';
        if (!headers_sent()) {
            if (!browser_matches('ie') && strpos(ocp_srv('SERVER_SOFTWARE'), 'IIS') === false) {
                header('HTTP/1.0 404 Not Found');
            }
        }
        $title = get_page_title('ERROR_OCCURRED');
        $text = do_lang_tempcode('NO_PAGE_OUTPUT');
        $middle = warn_screen($title, $text, false);
    }
    // Extra stuff we can tag on (like messages)
    $additional = new ocp_tempcode();
    $site_closed = get_option('site_closed');
    // May have been JUST changed in page load - think Setup Wizard
    if ($site_closed == '1' && $PAGE != 'login' && $PAGE != 'join' && get_param_integer('wide_high', 0) == 0) {
        $additional->attach(do_template('ADDITIONAL', array('_GUID' => '03a41a91606b3ad05330e7d6f3e741c1', 'TYPE' => 'notice', 'MESSAGE' => do_lang_tempcode(has_specific_permission(get_member(), 'access_closed_site') ? 'SITE_SPECIAL_ACCESS' : 'SITE_SPECIAL_ACCESS_SU'))));
    }
    if ($GLOBALS['IS_ACTUALLY_ADMIN']) {
        $unsu_link = get_self_url(true, true, array('keep_su' => NULL));
        $su_username = $GLOBALS['FORUM_DRIVER']->get_username(get_member());
        $additional->attach(do_template('ADDITIONAL', array('_GUID' => '13a41a91606b3ad05330e7d6f3e741c1', 'TYPE' => 'notice', 'MESSAGE' => do_lang_tempcode('USING_SU', escape_html($unsu_link), escape_html($su_username)))));
    }
    $out = new ocp_tempcode();
    // This is important - it makes sure the tempcode tree appears nicely
    $middle->handle_symbol_preprocessing();
    // Due to the '->evaluate()' below, plus so that some symbol preprocessing can be passed into header
    $out->attach(do_header());
    if (function_exists('memory_get_usage') && get_param('special_page_type', '') == 'memory') {
        if (function_exists('memory_get_peak_usage')) {
            $memory_usage = memory_get_peak_usage();
        } else {
            $memory_usage = memory_get_usage();
        }
        $additional->attach(do_template('ADDITIONAL', array('_GUID' => 'd605c0d111742a8cd2d4ef270a1e5fe1', 'TYPE' => 'inform', 'MESSAGE' => do_lang_tempcode('MEMORY_USAGE', float_format(round(floatval($memory_usage) / 1024.0 / 1024.0, 2))))));
    }
    // Whack it into our global template
    global $ATTACHED_MESSAGES;
    $global_template = 'GLOBAL';
    if (get_option('show_docs') == '0') {
        $GLOBALS['HELPER_PANEL_TUTORIAL'] = '';
    }
    $helper_panel_pic = $GLOBALS['HELPER_PANEL_PIC'];
    if ($helper_panel_pic != '') {
        if (find_theme_image($helper_panel_pic, true) == '') {
            $helper_panel_pic = '';
        }
    }
    $global = do_template($global_template, array('HELPER_PANEL_TUTORIAL' => $GLOBALS['HELPER_PANEL_TUTORIAL'], 'HELPER_PANEL_HTML' => $GLOBALS['HELPER_PANEL_HTML'], 'HELPER_PANEL_TEXT' => $GLOBALS['HELPER_PANEL_TEXT'], 'HELPER_PANEL_PIC' => $helper_panel_pic, 'MIDDLE' => $doing_special_page_type ? $middle : $middle->evaluate(), 'MESSAGE_TOP' => $ATTACHED_MESSAGES, 'MESSAGE' => $additional, 'BREADCRUMBS' => breadcrumbs()));
    unset($middle);
    $out->attach($global);
    $out->attach(do_footer());
    $out->handle_symbol_preprocessing();
    if (get_value('xhtml_strict') === '1') {
        $out = make_xhtml_strict($out);
    }
    // Validation
    $novalidate = get_param_integer('keep_novalidate', get_param_integer('novalidate', 0));
开发者ID:erico-deh,项目名称:ocPortal,代码行数:67,代码来源:site.php


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