當前位置: 首頁>>代碼示例>>PHP>>正文


PHP template_edit函數代碼示例

本文整理匯總了PHP中template_edit函數的典型用法代碼示例。如果您正苦於以下問題:PHP template_edit函數的具體用法?PHP template_edit怎麽用?PHP template_edit使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了template_edit函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: action_edit

function action_edit()
{
    global $page, $pagestore, $ParseEngine, $version;
    $pg = $pagestore->page($page);
    $pg->read();
    if (!$pg->mutable) {
        die(ACTION_ErrorPageLocked);
    }
    $archive = 0;
    if ($version != '') {
        $pg->version = $version;
        $pg->read();
        $archive = 1;
    }
    template_edit(array('page' => $page, 'text' => $pg->text, 'timestamp' => $pg->time, 'nextver' => $pg->version + 1, 'archive' => $archive));
}
開發者ID:BackupTheBerlios,項目名稱:hpt-obm-svn,代碼行數:16,代碼來源:edit.php

示例2: debug_msg

if (isset($_GET['action'])) {
    $action = $_GET['action'];
}
if (isset($_POST['action'])) {
    $action = $_POST['action'];
}
debug_msg("Action: " . $action, 5);
// Determine what action to take
switch ($action) {
    case 'add':
        template_add();
        break;
    case 'edit':
        if (isset($_GET['id'])) {
            $id = $_GET['id'];
            template_edit($id);
        }
        break;
    case 'delete':
        if (isset($_GET['id'])) {
            $id = $_GET['id'];
            template_delete($id);
        }
        break;
    case 'deleterecord':
        if (isset($_POST['id'])) {
            $id = $_POST['id'];
            template_deleterecord($id);
        }
        break;
    case 'insert':
開發者ID:sqall01,項目名稱:additional_plugins,代碼行數:31,代碼來源:template.php

示例3: form_actions

    case 'actions':
        form_actions();
        break;
    case 'rrd_add':
        template_rrd_add();
        break;
    case 'rrd_remove':
        template_rrd_remove();
        break;
    case 'template_remove':
        template_remove();
        header("Location: data_templates.php");
        break;
    case 'template_edit':
        include_once "./include/top_header.php";
        template_edit();
        include_once "./include/bottom_footer.php";
        break;
    default:
        include_once "./include/top_header.php";
        template();
        include_once "./include/bottom_footer.php";
        break;
}
/* --------------------------
    The Save Function
   -------------------------- */
function form_save()
{
    global $cnn_id;
    if (isset($_POST["save_component_template"])) {
開發者ID:teddywen,項目名稱:cacti,代碼行數:31,代碼來源:data_templates.php

示例4: action_edit

function action_edit()
{
    global $ErrorPageLocked, $page, $pagefrom, $pagestore, $ParseEngine;
    global $section, $use_template, $UserName, $version;
    $pg = $pagestore->page($page);
    $pg->read();
    if (!$UserName || !$pg->mutable) {
        die($ErrorPageLocked);
    }
    $archive = 0;
    if ($version != '') {
        $pg->version = $version;
        $pg->read();
        $archive = 1;
    }
    $page_text = $pg->text;
    // page template
    if ($use_template) {
        $tmpl_pg = $pagestore->page($use_template);
        if ($tmpl_pg->exists()) {
            $tmpl_pg->read();
            $page_text = $tmpl_pg->text;
            $archive = 0;
        } else {
            $use_template = '';
        }
    }
    // section editing
    $text_before = '';
    $text_after = '';
    if ($section) {
        $lines = explode("\n", $page_text);
        $lines_before = array();
        $lines_after = array();
        $lines_section = array();
        $section_count = 0;
        $found_level = 0;
        foreach ($lines as $line) {
            if (($result = parse_heading_line_match(strip_tags($line))) !== false && (!$found_level || strlen($result[2]) <= $found_level)) {
                $section_count++;
            }
            if ($section_count < $section) {
                $lines_before[] = $line;
            } else {
                if ($section_count > $section) {
                    $lines_after[] = $line;
                } else {
                    if (!$found_level) {
                        $found_level = strlen($result[2]);
                    }
                    $lines_section[] = $line;
                }
            }
        }
        $text_before = implode("\n", $lines_before);
        $text_after = implode("\n", $lines_after);
        $page_text = implode("\n", $lines_section);
    }
    if (trim($page_text) == '') {
        $page_text = "Describe {$page} here...\n\nPlease provide content before " . "saving.\n\n-- [{$UserName}]";
    }
    template_edit(array('page' => $page, 'pagefrom' => $pagefrom, 'text' => $page_text, 'section' => $section, 'text_before' => $text_before, 'text_after' => $text_after, 'timestamp' => $pg->time, 'nextver' => $pg->version + 1, 'archive' => $archive, 'template' => $pg->template, 'templates' => $pagestore->getTemplatePages(), 'use_template' => $use_template, 'edituser' => $pg->username, 'editver' => $UserName && $pg->mutable ? $version == '' ? 0 : $version : -1));
}
開發者ID:apenwarr,項目名稱:gracefultavi,代碼行數:63,代碼來源:edit.php


注:本文中的template_edit函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。