本文整理汇总了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');
}
}
示例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);
}
}
示例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.'&page=edit/'.urlencode($pagetemp).'&gid='.$WS->groupmember->groupid.'&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";
//.........这里部分代码省略.........
示例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";
}
}