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


PHP wiki_print_page_content函數代碼示例

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


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

示例1: print_content

    function print_content() {
        global $PAGE, $CFG;

        if (wiki_user_can_view($this->subwiki)) {

            if (!empty($this->page)) {
                wiki_print_page_content($this->page, $this->modcontext, $this->subwiki->id);
                $wiki = $PAGE->activityrecord;
            } else {
                print_string('nocontent', 'wiki');
                // TODO: fix this part
                $swid = 0;
                if (!empty($this->subwiki)) {
                    $swid = $this->subwiki->id;
                }
            }
        } else {
            echo get_string('cannotviewpage', 'wiki');
        }
    }
開發者ID:Burick,項目名稱:moodle,代碼行數:20,代碼來源:pagelib.php

示例2: wiki_hist_old

function wiki_hist_old(&$WS)
{
    global $USER, $COURSE;
    //convert wiki content to html content
    wiki_print_page_content($WS->pageolddata->content, $WS);
    wiki_hist_restore($WS);
    //link lo evaluate_page
    $context = get_context_instance(CONTEXT_MODULE, $WS->cm->id);
    if ($WS->dfperms['evaluation'] == '2' and has_capability('mod/wiki:viewevaluationswiki', $context) or $WS->dfperms['evaluation'] == '1' && has_capability('mod/wiki:evaluateawiki', $context)) {
        $prop = null;
        $prop->href = "view.php?id={$WS->linkid}&page=" . urlencode("evaluate_page/{$WS->page}") . "&ver={$WS->ver}&gid={$WS->groupmember->groupid}&uid={$WS->member->id}";
        wiki_a(get_string('evaluate_edition', 'wiki'), $prop);
    }
}
開發者ID:hmatulis,項目名稱:RTL-BIDI-Hebrew-Moodle-Plugins,代碼行數:14,代碼來源:hist.php

示例3: wiki_edit_content

function wiki_edit_content(&$WS)
{
    global $CFG;
    $context = get_context_instance(CONTEXT_MODULE, $WS->cm->id);
    require_capability('mod/wiki:caneditawiki', $context);
    $cont = false;
    $txt = '';
    $titlebox = '';
    $oldcontentbox = '';
    $viewtitle = '0';
    if ($WS->pageaction == 'adddiscussion' or isset($WS->dfform['addtitle']) and $WS->pageaction == 'edit') {
        $viewtitle = '1';
        if (isset($WS->dfform['addtitle'])) {
            $titlebox = $WS->dfform['addtitle'];
            $oldcontentbox = $WS->dfform['oldcontent'];
            $contentbox = $WS->dfform['content'];
        } else {
            $titlebox = '';
            $oldcontentbox = $WS->dfform['content'];
            $contentbox = '';
        }
    } else {
        if (isset($WS->dfform['content'])) {
            $contentbox = $WS->dfform['content'];
        } else {
            $contentbox = '';
        }
    }
    //need to check if  we have preview mode
    $preview = optional_param('dfformpreview', NULL, PARAM_ALPHA);
    if (isset($preview)) {
        //we're in preview mode
        print_simple_box_start('center', '100%', '', '20');
        wiki_size_text("Preview", 2);
        // discussions
        if ($titlebox == '') {
            $txt = $oldcontentbox . $contentbox;
        } else {
            switch ($WS->dfwiki->editor) {
                case 'ewiki':
                    $txt = $oldcontentbox . chr(13) . chr(10) . '!!! ' . $titlebox . ' ' . chr(13) . chr(10) . $contentbox . chr(10);
                    break;
                case 'htmleditor':
                    $txt = $oldcontentbox . chr(13) . chr(10) . '<h1> ' . $titlebox . ' </h1>' . chr(13) . chr(10) . $contentbox . chr(10);
                    break;
                default:
                    $txt = $oldcontentbox . chr(13) . chr(10) . '= ' . $titlebox . ' =' . chr(13) . chr(10) . $contentbox . chr(10);
                    break;
            }
        }
        wiki_print_page_content(stripslashes_safe($txt), $WS);
        print_simple_box_end();
    } else {
        //we're not in preview mode
        //check if there's content
        //echo 'wiki_forceeditorchange='.$CFG->wiki_forceeditorchange;
        if (!isset($WS->pagedata->content) || $CFG->wiki_forceeditorchange) {
            if (!isset($WS->pagedata->content)) {
                $WS->pagedata->content = '';
            }
            //  si no hem decidit encara l'editor per aquesta pagina i no hem adjuntat cap arxiu demanem l'editor
            if (!isset($WS->dfform['selectedit']) && (!isset($WS->pagedata->editor) || $WS->pagedata->editor == '') || $CFG->wiki_forceeditorchange) {
                $cont = true;
                //$pagename=stripslashes($pagename);
                $prop = null;
                $prop->border = "0";
                $prop->class = "nwikileftnow";
                wiki_table_start($prop);
                /// removed "choose different wiki syntax on new page listbox" so teachers will not get confused (nadavkav 25.10.09)
                /*
                				print_string('anothereditor','wiki');
                				//Converts reserved chars for html to prevent chars misreading
                				$pagetemp = stripslashes_safe($WS->page);
                
                                wiki_change_column();
                				$prop = null;
                				$prop->id = "sel_edit";
                				$prop->method = "post";
                				$prop->action = 'view.php?id='.$WS->linkid.'&amp;page=edit/'.urlencode($pagetemp).'&amp;gid='.$WS->groupmember->groupid.'&amp;uid='.$WS->member->id;
                				wiki_form_start($prop);
                				wiki_div_start();
                				$opt = "";
                                if ($WS->dfwiki->editor != 'dfwiki'){
                                	$prop = null;
                                	$prop->value = "0";
                                	$opt = wiki_option(get_string('dfwiki','wiki'), $prop, true);
                                }
                                if ($WS->dfwiki->editor != 'nwiki'){
                                	$prop = null;
                                	$prop->value = "3";
                                	$opt .= wiki_option(get_string('nwiki','wiki'), $prop, true);
                                }
                                if ($WS->dfwiki->editor != 'ewiki'){
                                	$prop = null;
                                	$prop->value = "1";
                                	$opt .= wiki_option(get_string('ewiki','wiki'), $prop, true);
                				}
                                if ($WS->dfwiki->editor != 'htmleditor'){
                                	$prop = null;
                                	$prop->value = "2";
//.........這裏部分代碼省略.........
開發者ID:hmatulis,項目名稱:RTL-BIDI-Hebrew-Moodle-Plugins,代碼行數:101,代碼來源:locallib.php

示例4: print_content

    function print_content() {
        global $PAGE, $CFG;

        $context = get_context_instance(CONTEXT_MODULE, $PAGE->cm->id);
        if (wiki_user_can_view($this->subwiki)) {

            if (!empty($this->page)) {
                wiki_print_page_content($this->page, $context, $this->subwiki->id);
                $wiki = $PAGE->activityrecord;
            } else {
                print_string('nocontent', 'wiki');
                // TODO: fix this part
                $swid = 0;
                if (!empty($this->subwiki)) {
                    $swid = $this->subwiki->id;
                }
            }
        } else {
            // @TODO: Tranlate it
            echo "You can not view this page";
        }
    }
開發者ID:nuckey,項目名稱:moodle,代碼行數:22,代碼來源:pagelib.php


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