Class ilPageObjectGUI. More...
Class ilPageObjectGUI.
User Interface for Page Objects Editing
ilPageObjectGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMediaPoolTargetSelector
Definition at line 45 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::_forwards | ( | ) |
get all gui classes that are called from this one (see class ilCtrl)
| array | array of gui classes that are called |
Definition at line 104 of file class.ilPageObjectGUI.php.
{
return array("ilPageEditorGUI");
}
| ilPageObjectGUI::activatePage | ( | ) |
Definition at line 479 of file class.ilPageObjectGUI.php.
{
$act_meth = $this->act_meth;
$this->act_obj->$act_meth(true);
$this->ctrl->redirectByClass("illmpageobjectgui", "view");
}
| ilPageObjectGUI::deactivatePage | ( | ) |
Definition at line 472 of file class.ilPageObjectGUI.php.
{
$act_meth = $this->act_meth;
$this->act_obj->$act_meth(false);
$this->ctrl->redirectByClass("illmpageobjectgui", "view");
}
| ilPageObjectGUI::displayValidationError | ( | $ | a_error | ) |
display validation error
| string | $a_error error string |
Definition at line 1024 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
if(is_array($a_error))
{
$error_str = "<b>Validation Error(s):</b><br>";
foreach ($a_error as $error)
{
$err_mess = implode($error, " - ");
if (!is_int(strpos($err_mess, ":0:")))
{
$error_str .= htmlentities($err_mess)."<br />";
}
}
$this->tpl->setVariable("MESSAGE", $error_str);
}
}
Here is the caller graph for this function:| ilPageObjectGUI::enableChangeComments | ( | $ | a_enabled | ) |
Definition at line 321 of file class.ilPageObjectGUI.php.
{
$this->change_comments = $a_enabled;
}
| ilPageObjectGUI::enableCitation | ( | $ | a_enabled | ) |
Definition at line 265 of file class.ilPageObjectGUI.php.
{
$this->citation = $a_enabled;
}
| & ilPageObjectGUI::executeCommand | ( | ) |
execute command
Definition at line 427 of file class.ilPageObjectGUI.php.
References $cmd, $ret, getHeader(), and getPageObject().
{
$next_class = $this->ctrl->getNextClass($this);
//echo ":$next_class:";
$cmd = $this->ctrl->getCmd();
$this->ctrl->addTab("clipboard", $this->ctrl->getLinkTargetByClass("ilEditClipboardGUI", "view")
, "view", "ilEditClipboardGUI");
switch($next_class)
{
case "ileditclipboardgui":
$this->tabs_gui->clearTargets();
//$this->ctrl->setReturn($this, "view");
$clip_gui = new ilEditClipboardGUI();
$clip_gui->setPageBackTitle($this->page_back_title);
//$ret =& $clip_gui->executeCommand();
$ret =& $this->ctrl->forwardCommand($clip_gui);
break;
case "ilpageeditorgui":
$page_editor =& new ilPageEditorGUI($this->getPageObject(), $this);
$page_editor->setLocator($this->locator);
$page_editor->setHeader($this->getHeader());
$page_editor->setPageBackTitle($this->page_back_title);
$page_editor->setIntLinkHelpDefault($this->int_link_def_type,
$this->int_link_def_id);
$page_editor->setIntLinkReturn($this->int_link_return);
//$page_editor->executeCommand();
$ret =& $this->ctrl->forwardCommand($page_editor);
break;
// does not exist
case "ilmediapooltargetselector":
include_once("./classes/class.ilMediaPoolTargetSelector.php");
$target_sel =& new ilMediaPoolTargetSelector();
$ret =& $this->ctrl->forwardCommand($target_sel);
break;
default:
$ret =& $this->$cmd();
break;
}
}
Here is the call graph for this function:| ilPageObjectGUI::getActivated | ( | ) |
Definition at line 389 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->activated;
}
Here is the caller graph for this function:| ilPageObjectGUI::getBibId | ( | ) |
Definition at line 116 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->bib_id ? $this->bib_id : 0;
}
Here is the caller graph for this function:| ilPageObjectGUI::getEnabledActivation | ( | ) |
Definition at line 399 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->activation;
}
Here is the caller graph for this function:| ilPageObjectGUI::getEnabledInternalLinks | ( | ) |
Get Enable internal links.
Definition at line 419 of file class.ilPageObjectGUI.php.
{
return $this->enabledinternallinks;
}
| ilPageObjectGUI::getFileDownloadLink | ( | ) |
Definition at line 295 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->file_download_link;
}
Here is the caller graph for this function:| ilPageObjectGUI::getFullscreenLink | ( | ) |
Definition at line 305 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->fullscreen_link;
}
Here is the caller graph for this function:| ilPageObjectGUI::getHeader | ( | ) |
Definition at line 169 of file class.ilPageObjectGUI.php.
Referenced by executeCommand().
{
return $this->header;
}
Here is the caller graph for this function:| ilPageObjectGUI::getLinkFrame | ( | ) |
Definition at line 189 of file class.ilPageObjectGUI.php.
{
return $this->link_frame;
}
| ilPageObjectGUI::getLinkParams | ( | ) |
Definition at line 179 of file class.ilPageObjectGUI.php.
{
return $this->link_params;
}
| ilPageObjectGUI::getLinkXML | ( | ) |
Definition at line 199 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->link_xml;
}
Here is the caller graph for this function:| ilPageObjectGUI::getOfflineDirectory | ( | ) |
get offline directory
Definition at line 345 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->offline_directory;
}
Here is the caller graph for this function:| ilPageObjectGUI::getOutputMode | ( | ) |
Definition at line 139 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->output_mode;
}
Here is the caller graph for this function:| ilPageObjectGUI::getOutputSubmode | ( | ) |
Definition at line 251 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->output_submode;
}
Here is the caller graph for this function:| & ilPageObjectGUI::getPageObject | ( | ) |
Definition at line 126 of file class.ilPageObjectGUI.php.
Referenced by executeCommand().
{
return $this->obj;
}
Here is the caller graph for this function:| ilPageObjectGUI::getPresentationTitle | ( | ) |
Definition at line 159 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->presentation_title;
}
Here is the caller graph for this function:| ilPageObjectGUI::getQuestionHTML | ( | ) |
Definition at line 219 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->question_html;
}
Here is the caller graph for this function:| ilPageObjectGUI::getQuestionXML | ( | ) |
Definition at line 214 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->question_xml;
}
Here is the caller graph for this function:| ilPageObjectGUI::getSourcecodeDownloadScript | ( | ) |
Definition at line 261 of file class.ilPageObjectGUI.php.
{
return $this->sourcecode_download_script;
}
| ilPageObjectGUI::getTemplateOutputVar | ( | ) |
Definition at line 240 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->template_output_var;
}
Here is the caller graph for this function:| ilPageObjectGUI::getTemplateTargetVar | ( | ) |
Definition at line 229 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->target_var;
}
Here is the caller graph for this function:| ilPageObjectGUI::getViewPageLink | ( | ) |
get view page link
Definition at line 365 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->view_page_link;
}
Here is the caller graph for this function:| ilPageObjectGUI::getViewPageTarget | ( | ) |
get view page target frame
Definition at line 373 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->view_page_target;
}
Here is the caller graph for this function:| ilPageObjectGUI::ilPageObjectGUI | ( | &$ | a_page_object | ) |
Constructor public.
Definition at line 74 of file class.ilPageObjectGUI.php.
References $ilCtrl, $ilias, $lng, $tpl, and setPageObject().
{
global $ilias, $tpl, $lng, $ilCtrl,$ilTabs;
$this->ctrl =& $ilCtrl;
$this->ilias =& $ilias;
$this->tpl =& $tpl;
$this->ctrl =& $ilCtrl;
$this->lng =& $lng;
$this->obj =& $a_page_object;
$this->output_mode = "presentation";
$this->setPageObject($a_page_object);
$this->output2template = true;
$this->question_xml = "";
$this->question_html = "";
$this->tabs_gui =& $ilTabs;
// USED FOR TRANSLATIONS
$this->template_output_var = "PAGE_CONTENT";
$this->citation = false;
$this->change_comments = false;
$this->page_back_title = $this->lng->txt("page");
}
Here is the call graph for this function:| ilPageObjectGUI::isEnabledChangeComments | ( | ) |
Definition at line 326 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->change_comments;
}
Here is the caller graph for this function:| ilPageObjectGUI::isEnabledCitation | ( | ) |
Definition at line 270 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->citation;
}
Here is the caller graph for this function:| ilPageObjectGUI::outputToTemplate | ( | ) |
Definition at line 149 of file class.ilPageObjectGUI.php.
Referenced by showPage().
{
return $this->output2template;
}
Here is the caller graph for this function:| ilPageObjectGUI::presentation | ( | $ | mode = "presentation" |
) |
Definition at line 953 of file class.ilPageObjectGUI.php.
References setOutputMode(), and showPage().
{
global $tree;
$this->setOutputMode($mode);
return $this->showPage();
}
Here is the call graph for this function:| ilPageObjectGUI::preview | ( | ) |
Definition at line 933 of file class.ilPageObjectGUI.php.
References setOutputMode(), and showPage().
{
global $tree;
$this->setOutputMode("preview");
return $this->showPage();
}
Here is the call graph for this function:| ilPageObjectGUI::setActivated | ( | $ | a_act | ) |
Definition at line 384 of file class.ilPageObjectGUI.php.
{
$this->activated = $a_act;
}
| ilPageObjectGUI::setActivationListener | ( | &$ | a_obj, | |
| $ | a_meth | |||
| ) |
Definition at line 378 of file class.ilPageObjectGUI.php.
{
$this->act_obj =& $a_obj;
$this->act_meth = $a_meth;
}
| ilPageObjectGUI::setBibId | ( | $ | a_id | ) |
Definition at line 110 of file class.ilPageObjectGUI.php.
{
// USED FOR SELECTION WHICH PAGE TURNS AND LATER PAGES SHOULD BE SHOWN
$this->bib_id = $a_id;
}
| ilPageObjectGUI::setEnabledActivation | ( | $ | a_act | ) |
Definition at line 394 of file class.ilPageObjectGUI.php.
{
$this->activation = $a_act;
}
| ilPageObjectGUI::setEnabledInternalLinks | ( | $ | a_enabledinternallinks | ) |
Set Enable internal links.
| boolean | $a_enabledinternallinks Enable internal links |
Definition at line 409 of file class.ilPageObjectGUI.php.
{
$this->enabledinternallinks = $a_enabledinternallinks;
}
| ilPageObjectGUI::setFileDownloadLink | ( | $ | a_download_link | ) |
Definition at line 290 of file class.ilPageObjectGUI.php.
{
$this->file_download_link = $a_download_link;
}
| ilPageObjectGUI::setFullscreenLink | ( | $ | a_fullscreen_link | ) |
Definition at line 300 of file class.ilPageObjectGUI.php.
{
$this->fullscreen_link = $a_fullscreen_link;
}
| ilPageObjectGUI::setHeader | ( | $ | a_title = "" |
) |
Definition at line 164 of file class.ilPageObjectGUI.php.
{
$this->header = $a_title;
}
| ilPageObjectGUI::setIntLinkHelpDefault | ( | $ | a_type, | |
| $ | a_id | |||
| ) |
Definition at line 310 of file class.ilPageObjectGUI.php.
{
$this->int_link_def_type = $a_type;
$this->int_link_def_id = $a_id;
}
| ilPageObjectGUI::setIntLinkReturn | ( | $ | a_return | ) |
Definition at line 316 of file class.ilPageObjectGUI.php.
{
$this->int_link_return = $a_return;
}
| ilPageObjectGUI::setLinkFrame | ( | $ | l_frame = "" |
) |
Definition at line 184 of file class.ilPageObjectGUI.php.
{
$this->link_frame = $l_frame;
}
| ilPageObjectGUI::setLinkParams | ( | $ | l_params = "" |
) |
Definition at line 174 of file class.ilPageObjectGUI.php.
{
$this->link_params = $l_params;
}
| ilPageObjectGUI::setLinkXML | ( | $ | link_xml | ) |
Definition at line 194 of file class.ilPageObjectGUI.php.
{
$this->link_xml = $link_xml;
}
| ilPageObjectGUI::setLocator | ( | &$ | a_locator | ) |
Definition at line 275 of file class.ilPageObjectGUI.php.
{
$this->locator =& $a_locator;
}
| ilPageObjectGUI::setOfflineDirectory | ( | $ | offdir | ) |
set offline directory to offdir
| offdir | contains diretory where to store files |
Definition at line 336 of file class.ilPageObjectGUI.php.
{
$this->offline_directory = $offdir;
}
| ilPageObjectGUI::setOutputMode | ( | $ | a_mode = "presentation" |
) |
mode: "presentation" | "edit" | "preview"
Definition at line 134 of file class.ilPageObjectGUI.php.
Referenced by presentation(), preview(), and view().
{
$this->output_mode = $a_mode;
}
Here is the caller graph for this function:| ilPageObjectGUI::setOutputSubmode | ( | $ | a_mode | ) |
Definition at line 245 of file class.ilPageObjectGUI.php.
{
// USED FOR TRANSLATION PRESENTATION OF dbk OBJECTS
$this->output_submode = $a_mode;
}
| ilPageObjectGUI::setPageBackTitle | ( | $ | a_title | ) |
Definition at line 285 of file class.ilPageObjectGUI.php.
{
$this->page_back_title = $a_title;
}
| ilPageObjectGUI::setPageObject | ( | &$ | a_pg_obj | ) |
Definition at line 121 of file class.ilPageObjectGUI.php.
Referenced by ilPageObjectGUI().
{
$this->obj =& $a_pg_obj;
}
Here is the caller graph for this function:| ilPageObjectGUI::setPresentationTitle | ( | $ | a_title = "" |
) |
Definition at line 154 of file class.ilPageObjectGUI.php.
{
$this->presentation_title = $a_title;
}
| ilPageObjectGUI::setQuestionHTML | ( | $ | question_html | ) |
Definition at line 209 of file class.ilPageObjectGUI.php.
References $question_html.
{
$this->question_html = $question_html;
}
| ilPageObjectGUI::setQuestionXML | ( | $ | question_xml | ) |
Definition at line 204 of file class.ilPageObjectGUI.php.
{
$this->question_xml = $question_xml;
}
| ilPageObjectGUI::setSourcecodeDownloadScript | ( | $ | script_name | ) |
Definition at line 257 of file class.ilPageObjectGUI.php.
References $script_name.
{
$this->sourcecode_download_script = $script_name;
}
| ilPageObjectGUI::setTabs | ( | $ | a_tabs | ) |
Definition at line 280 of file class.ilPageObjectGUI.php.
{
$this->tabs_gui = $a_tabs;
}
| ilPageObjectGUI::setTemplateOutput | ( | $ | a_output = true |
) |
Definition at line 144 of file class.ilPageObjectGUI.php.
{
$this->output2template = $a_output;
}
| ilPageObjectGUI::setTemplateOutputVar | ( | $ | a_value | ) |
Definition at line 234 of file class.ilPageObjectGUI.php.
{
// USED FOR TRANSLATION PRESENTATION OF dbk OBJECTS
$this->template_output_var = $a_value;
}
| ilPageObjectGUI::setTemplateTargetVar | ( | $ | a_variable | ) |
Definition at line 224 of file class.ilPageObjectGUI.php.
{
$this->target_var = $a_variable;
}
| ilPageObjectGUI::setViewPageLink | ( | $ | a_link, | |
| $ | a_target = "" | |||
| ) |
set link for "view page" button
| string | link target | |
| string | target frame |
Definition at line 356 of file class.ilPageObjectGUI.php.
{
$this->view_page_link = $a_link;
$this->view_page_target = $a_target;
}
| ilPageObjectGUI::showMediaFullscreen | ( | $ | a_style_id = 0 |
) |
show fullscreen view of media object
Definition at line 964 of file class.ilPageObjectGUI.php.
References $_GET, ilObject::_lookupTitle(), ilUtil::getStyleSheetLocation(), ilUtil::getWebspaceDir(), xslt_create(), xslt_error(), xslt_free(), and xslt_process().
{
$this->tpl = new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
$this->tpl->setCurrentBlock("ContentStyle");
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", 0);
$this->tpl->parseCurrentBlock();
$this->tpl->setVariable("PAGETITLE", " - ".ilObject::_lookupTitle($_GET["mob_id"]));
$this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
$this->tpl->setCurrentBlock("ilMedia");
require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
$media_obj =& new ilObjMediaObject($_GET["mob_id"]);
if (!empty ($_GET["pg_id"]))
{
require_once("./Services/COPage/classes/class.ilPageObject.php");
$pg_obj =& new ilPageObject($this->obj->getParentType(), $_GET["pg_id"]);
$pg_obj->buildDom();
$xml = "<dummy>";
// todo: we get always the first alias now (problem if mob is used multiple
// times in page)
$xml.= $pg_obj->getMediaAliasElement($_GET["mob_id"]);
$xml.= $media_obj->getXML(IL_MODE_OUTPUT);
$xml.="</dummy>";
}
else
{
$xml = "<dummy>";
$xml.= $media_obj->getXML(IL_MODE_ALIAS);
$xml.= $media_obj->getXML(IL_MODE_OUTPUT);
$xml.="</dummy>";
}
//echo htmlentities($xml); exit;
$xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
$args = array( '/_xml' => $xml, '/_xsl' => $xsl );
$xh = xslt_create();
//echo "<b>XML:</b>".htmlentities($xml);
// determine target frames for internal links
//$pg_frame = $_GET["frame"];
$wb_path = ilUtil::getWebspaceDir("output");
// $wb_path = "../".$this->ilias->ini->readVariable("server","webspace_dir");
$mode = "fullscreen";
$params = array ('mode' => $mode, 'webspace_path' => $wb_path);
$output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
echo xslt_error($xh);
xslt_free($xh);
// unmask user html
$this->tpl->setVariable("MEDIA_CONTENT", $output);
}
Here is the call graph for this function:| ilPageObjectGUI::showPage | ( | ) |
Definition at line 489 of file class.ilPageObjectGUI.php.
References $_GET, $_SESSION, $ilias, ilPageEditorGUI::_doJSEditing(), ilObject::_exists(), ilInternalLink::_getTargetsOfSource(), ilPageEditorGUI::_isBrowserJSEditCapable(), ilObject::_lookupTitle(), ilUtil::buildLatexImages(), displayValidationError(), ilUtil::formSelect(), getActivated(), getBibId(), getEnabledActivation(), getFileDownloadLink(), getFullscreenLink(), ilUtil::getImagePath(), getLinkXML(), getOfflineDirectory(), getOutputMode(), getOutputSubmode(), getPresentationTitle(), getQuestionHTML(), getQuestionXML(), getTemplateOutputVar(), getTemplateTargetVar(), getViewPageLink(), getViewPageTarget(), ilUtil::getWebspaceDir(), ilObjContentObject::hasSuccessorPage(), ilUtil::insertLatexImages(), isEnabledChangeComments(), isEnabledCitation(), outputToTemplate(), ilUtil::sendInfo(), xslt_create(), xslt_free(), and xslt_process().
Referenced by presentation(), preview(), and view().
{
global $tree, $ilUser, $ilias;
// init template
if($this->outputToTemplate())
{
if($this->getOutputMode() == "edit")
{
//echo ":".$this->getTemplateTargetVar().":";
$this->tpl->addBlockFile($this->getTemplateTargetVar(), "adm_content", "tpl.page_edit_wysiwyg.html", "Services/COPage");
// to do: status dependent class
$this->tpl->setVariable("CLASS_PAGE_TD", "ilc_Page");
// user comment
if ($this->isEnabledChangeComments())
{
$this->tpl->setCurrentBlock("change_comment");
$this->tpl->setVariable("TXT_ADD_COMMENT", $this->lng->txt("cont_add_change_comment"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("adm_content");
}
$this->tpl->setVariable("TXT_INSERT_BEFORE", $this->lng->txt("cont_set_before"));
$this->tpl->setVariable("TXT_INSERT_AFTER", $this->lng->txt("cont_set_after"));
$this->tpl->setVariable("TXT_INSERT_CANCEL", $this->lng->txt("cont_set_cancel"));
$this->tpl->setVariable("TXT_CONFIRM_DELETE", $this->lng->txt("cont_confirm_delete"));
$this->tpl->setVariable("JS_DRAGDROP", ILIAS_HTTP_PATH."/Services/COPage/js/wz_dragdrop.js");
$this->tpl->setVariable("IMG_DRAGDROP",
ilUtil::getImagePath("icon_drag.gif"));
if (!ilPageEditorGUI::_isBrowserJSEditCapable())
{
$this->tpl->setVariable("TXT_JAVA_SCRIPT_CAPABLE", "<br />".$this->lng->txt("cont_browser_not_js_capable"));
}
$this->tpl->setVariable("TXT_CHANGE_EDIT_MODE", $this->lng->txt("cont_set_edit_mode"));
if ($this->getEnabledActivation())
{
$this->tpl->setCurrentBlock("de_activate_page");
if ($this->getActivated())
{
$this->tpl->setVariable("TXT_DE_ACTIVATE_PAGE", $this->lng->txt("cont_deactivate_page"));
$this->tpl->setVariable("CMD_DE_ACTIVATE_PAGE", "deactivatePage");
}
else
{
$this->tpl->setVariable("TXT_DE_ACTIVATE_PAGE", $this->lng->txt("cont_activate_page"));
$this->tpl->setVariable("CMD_DE_ACTIVATE_PAGE", "activatePage");
}
$this->tpl->parseCurrentBlock();
}
$med_mode = array("enable" => $this->lng->txt("cont_enable_media"),
"disable" => $this->lng->txt("cont_disable_media"));
$sel_media_mode = ($ilUser->getPref("ilPageEditor_MediaMode") == "disable")
? "disable"
: "enable";
$js_mode = array("enable" => $this->lng->txt("cont_enable_js"),
"disable" => $this->lng->txt("cont_disable_js"));
$this->tpl->setVariable("SEL_MEDIA_MODE",
ilUtil::formSelect($sel_media_mode, "media_mode", $med_mode, false, true,
0, "ilEditSelect"));
// HTML active/inactive
$html_mode = array("enable" => $this->lng->txt("cont_enable_html"),
"disable" => $this->lng->txt("cont_disable_html"));
$sel_html_mode = ($ilUser->getPref("ilPageEditor_HTMLMode") == "disable")
? "disable"
: "enable";
$this->tpl->setVariable("SEL_HTML_MODE",
ilUtil::formSelect($sel_html_mode, "html_mode", $html_mode, false, true,
0, "ilEditSelect"));
if ($this->getViewPageLink() != "")
{
$this->tpl->setCurrentBlock("view_link");
$this->tpl->setVariable("LINK_VIEW_PAGE",
$this->getViewPageLink());
$this->tpl->setVariable("TARGET_VIEW_PAGE",
$this->getViewPageTarget());
$this->tpl->setVariable("TXT_VIEW_PAGE", $this->lng->txt("view"));
$this->tpl->parseCurrentBlock();
}
// javascript activation
$sel_js_mode = "disable";
if($ilias->getSetting("enable_js_edit"))
{
$sel_js_mode = (ilPageEditorGUI::_doJSEditing())
? "enable"
: "disable";
$this->tpl->setVariable("SEL_JAVA_SCRIPT",
ilUtil::formSelect($sel_js_mode, "js_mode", $js_mode, false, true,
0, "ilEditSelect"));
}
// multiple actions
if ($sel_js_mode == "disable")
{
$this->tpl->setCurrentBlock("multi_actions");
$this->tpl->setVariable("TXT_DE_ACTIVATE_SELECTED", $this->lng->txt("cont_ed_enable"));
$this->tpl->setVariable("TXT_DELETE_SELECTED", $this->lng->txt("cont_delete_selected"));
$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
$this->tpl->parseCurrentBlock();
}
}
else
{
if($this->getOutputSubmode() == 'translation')
{
$this->tpl->addBlockFile($this->getTemplateTargetVar(), "adm_content", "tpl.page_translation_content.html", "Services/COPage");
}
else
{
// presentation
if($this->getOutputMode() != 'preview')
{
$this->tpl->addBlockFile($this->getTemplateTargetVar(), "adm_content", "tpl.page_content.html", "Services/COPage");
}
else // preview
{
$this->tpl->addBlockFile($this->getTemplateTargetVar(), "adm_content", "tpl.page_preview.html", "Services/COPage");
}
}
}
if ($this->getOutputMode() != "presentation" &&
$this->getOutputMode() != "offline" &&
$this->getOutputMode() != "print")
{
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormActionByClass("ilpageeditorgui"));
}
// output media object edit list (of media links)
if($this->getOutputMode() == "edit")
{
$links = ilInternalLink::_getTargetsOfSource($this->obj->getParentType().":pg",
$this->obj->getId());
$mob_links = array();
foreach($links as $link)
{
if ($link["type"] == "mob")
{
if (ilObject::_exists($link["id"]))
{
$mob_links[$link["id"]] = ilObject::_lookupTitle($link["id"])." [".$link["id"]."]";
}
}
}
if (count($mob_links) > 0)
{
$this->tpl->setCurrentBlock("med_link");
$this->tpl->setVariable("TXT_LINKED_MOBS", $this->lng->txt("cont_linked_mobs"));
$this->tpl->setVariable("SEL_MED_LINKS",
ilUtil::formSelect(0, "mob_id", $mob_links, false, true));
$this->tpl->setVariable("TXT_EDIT_MEDIA", $this->lng->txt("cont_edit_mob"));
$this->tpl->setVariable("TXT_COPY_TO_CLIPBOARD", $this->lng->txt("cont_copy_to_clipboard"));
//$this->tpl->setVariable("TXT_COPY_TO_POOL", $this->lng->txt("cont_copy_to_mediapool"));
$this->tpl->parseCurrentBlock();
}
}
if ($_GET["reloadTree"] == "y")
{
$this->tpl->setCurrentBlock("reload_tree");
if ($this->obj->getParentType() == "dbk")
{
$this->tpl->setVariable("LINK_TREE",
$this->ctrl->getLinkTargetByClass("ilobjdlbookgui", "explorer"));
}
else
{
$this->tpl->setVariable("LINK_TREE",
$this->ctrl->getLinkTargetByClass("ilobjlearningmodulegui", "explorer"));
}
$this->tpl->parseCurrentBlock();
}
}
// get content
$builded = $this->obj->buildDom();
$this->obj->addFileSizes();
// manage hierarchical ids
if($this->getOutputMode() == "edit")
{
$this->obj->addHierIDs();
$hids = $this->obj->getHierIds();
$row1_ids = $this->obj->getFirstRowIds();
$col1_ids = $this->obj->getFirstColumnIds();
$litem_ids = $this->obj->getListItemIds();
$fitem_ids = $this->obj->getFileItemIds();
// standard menues
$hids = $this->obj->getHierIds();
foreach($hids as $hid)
{
$this->tpl->setCurrentBlock("add_dhtml");
$this->tpl->setVariable("CONTEXTMENU", "contextmenu_".$hid);
$this->tpl->parseCurrentBlock();
}
// column menues for tables
foreach($col1_ids as $hid)
{
$this->tpl->setCurrentBlock("add_dhtml");
$this->tpl->setVariable("CONTEXTMENU", "contextmenu_r".$hid);
$this->tpl->parseCurrentBlock();
}
// row menues for tables
foreach($row1_ids as $hid)
{
$this->tpl->setCurrentBlock("add_dhtml");
$this->tpl->setVariable("CONTEXTMENU", "contextmenu_c".$hid);
$this->tpl->parseCurrentBlock();
}
// list item menues
foreach($litem_ids as $hid)
{
$this->tpl->setCurrentBlock("add_dhtml");
$this->tpl->setVariable("CONTEXTMENU", "contextmenu_i".$hid);
$this->tpl->parseCurrentBlock();
}
// file item menues
foreach($fitem_ids as $hid)
{
$this->tpl->setCurrentBlock("add_dhtml");
$this->tpl->setVariable("CONTEXTMENU", "contextmenu_i".$hid);
$this->tpl->parseCurrentBlock();
}
}
$this->obj->addSourceCodeHighlighting($this->getOutputMode());
//echo "<br>-".htmlentities($this->obj->getXMLContent())."-<br><br>";
//echo "<br>-".htmlentities($this->getLinkXML())."-";
$content = $this->obj->getXMLFromDom(false, true, true,
$this->getLinkXML().$this->getQuestionXML());
// check validation errors
if($builded !== true)
{
$this->displayValidationError($builded);
}
else
{
$this->displayValidationError($_SESSION["il_pg_error"]);
}
unset($_SESSION["il_pg_error"]);
if(isset($_SESSION["citation_error"]))
{
ilUtil::sendInfo($this->lng->txt("cont_citation_selection_not_valid"));
session_unregister("citation_error");
unset($_SESSION["citation_error"]);
}
// get title
$pg_title = $this->getPresentationTitle();
//$content = str_replace(" ", "", $content);
// run xslt
$xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
$args = array( '/_xml' => $content, '/_xsl' => $xsl );
$xh = xslt_create();
//echo "<b>XML</b>:".htmlentities($content).":<br>";
// echo "<b>XSLT</b>:".htmlentities($xsl).":<br>";
// echo "mode:".$this->getOutputMode().":<br>";
$add_path = ilUtil::getImagePath("add.gif");
$col_path = ilUtil::getImagePath("col.gif");
$row_path = ilUtil::getImagePath("row.gif");
$item_path = ilUtil::getImagePath("item.gif");
$med_disabled_path = ilUtil::getImagePath("media_disabled.gif");
if ($this->getOutputMode() != "offline")
{
$enlarge_path = ilUtil::getImagePath("enlarge.gif");
$wb_path = ilUtil::getWebspaceDir("output");
}
else
{
$enlarge_path = "images/enlarge.gif";
$wb_path = ".";
}
$pg_title_class = ($this->getOutputMode() == "print")
? "ilc_PrintPageTitle"
: "";
// page splitting only for learning modules and
// digital books
$enable_split_new = ($this->obj->getParentType() == "lm" ||
$this->obj->getParentType() == "dbk")
? "y"
: "n";
// page splitting to next page only for learning modules and
// digital books if next page exists in tree
if (($this->obj->getParentType() == "lm" ||
$this->obj->getParentType() == "dbk") &&
ilObjContentObject::hasSuccessorPage($this->obj->getParentId(),
$this->obj->getId()))
{
$enable_split_next = "y";
}
else
{
$enable_split_next = "n";
}
$paragraph_plugins = new ilParagraphPlugins();
$paragraph_plugins->initialize ();
if ($this->getOutputMode() == "presentation" )
{
$paragraph_plugin_string = $paragraph_plugins->serializeToString();
$_SESSION ["paragraph_plugins"] = $paragraph_plugins;
}
$img_path = ilUtil::getImagePath("", false, $this->getOutputMode(), $this->getOutputMode() == "offline");
//$wb_path = "../".$this->ilias->ini->readVariable("server","webspace_dir");
//echo "-".$this->sourcecode_download_script.":";
// added UTF-8 encoding otherwise umlaute are converted too
$params = array ('mode' => $this->getOutputMode(), 'pg_title' => htmlentities($pg_title,ENT_QUOTES,"UTF-8"),
'pg_id' => $this->obj->getId(), 'pg_title_class' => $pg_title_class,
'webspace_path' => $wb_path, 'enlarge_path' => $enlarge_path,
'img_add' => $add_path,
'img_col' => $col_path,
'img_row' => $row_path,
'img_item' => $item_path,
'enable_split_new' => $enable_split_new,
'enable_split_next' => $enable_split_next,
'link_params' => $this->link_params,
'file_download_link' => $this->getFileDownloadLink(),
'fullscreen_link' => $this->getFullscreenLink(),
'med_disabled_path' => $med_disabled_path,
'img_path' => $img_path,
'parent_id' => $this->obj->getParentId(),
'download_script' => $this->sourcecode_download_script,
'encoded_download_script' => urlencode($this->sourcecode_download_script),
// digilib
'bib_id' => $this->getBibId(),'citation' => (int) $this->isEnabledCitation(),
'pagebreak' => $this->lng->txt('dgl_pagebreak'),
'page' => $this->lng->txt('page'),
'citate_page' => $this->lng->txt('citate_page'),
'citate_from' => $this->lng->txt('citate_from'),
'citate_to' => $this->lng->txt('citate_to'),
'citate' => $this->lng->txt('citate'),
'media_mode' => $ilUser->getPref("ilPageEditor_MediaMode"),
'javascript' => $sel_js_mode,
'paragraph_plugins' => $paragraph_plugin_string);
if($this->link_frame != "") // todo other link types
$params["pg_frame"] = $this->link_frame;
//if (version_compare(PHP_VERSION,'5','>='))
//{
// $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params, true);
//}
//else
//{
$output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
//}
//echo xslt_error($xh);
xslt_free($xh);
// unmask user html
if ($this->getOutputMode() != "edit" ||
$ilUser->getPref("ilPageEditor_HTMLMode") != "disable")
{
$output = str_replace("<","<",$output);
$output = str_replace(">",">",$output);
}
$output = str_replace("&", "&", $output);
// replace latex code: todo: finish
if ($this->getOutputMode() != "offline")
{
$output = ilUtil::insertLatexImages($output);
}
else
{
$output = ilUtil::buildLatexImages($output,
$this->getOfflineDirectory());
}
// (horrible) workaround for preventing template engine
// from hiding paragraph text that is enclosed
// in curly brackets (e.g. "{a}", see ilLMEditorGUI::executeCommand())
$output = str_replace("{", "{", $output);
$output = str_replace("}", "}", $output);
//echo "<b>HTML</b>:".htmlentities($output).":<br>";
// remove all newlines (important for code / pre output)
$output = str_replace("\n", "", $output);
$qhtml = $this->getQuestionHTML();
if (strlen($qhtml))
{
// removed simple str_replace with preg_replace because if the question content
// is part of a table, the xmlns isn't added and the question content wasn't visible then
// Helmut Schottmüller, 2006-11-15
$output = preg_replace("/(<div( xmlns:xhtml\=\"http:\/\/www.w3.org\/1999\/xhtml\"){0,1} class\=\"ilc_Question\">)/ims", "\\1" . $qhtml, $output);
// old source code prior to the preg_replace change
// $question_prefix = "<div xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" class=\"ilc_Question\">";
// $output = str_replace($question_prefix, $question_prefix . $qhtml, $output);
}
if($this->getOutputMode() == "edit" && !$this->getActivated())
{
$output = '<div class="il_editarea_disabled">'.$output.'</div>';
}
// output
if($this->outputToTemplate())
{
$this->tpl->setVariable($this->getTemplateOutputVar(), $output);
return $output;
}
else
{
return $output;
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilPageObjectGUI::view | ( | ) |
Definition at line 943 of file class.ilPageObjectGUI.php.
References setOutputMode(), and showPage().
{
global $tree;
$this->setOutputMode("edit");
return $this->showPage();
}
Here is the call graph for this function:| ilPageObjectGUI::$activated = true |
Definition at line 67 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$activation = false |
Definition at line 66 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$bib_id |
Definition at line 61 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$change_comments |
Definition at line 64 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$citation |
Definition at line 62 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$ctrl |
Definition at line 50 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$enabledinternallinks = true |
Definition at line 68 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$ilias |
Definition at line 47 of file class.ilPageObjectGUI.php.
Referenced by ilPageObjectGUI(), and showPage().
| ilPageObjectGUI::$link_params |
Definition at line 60 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$lng |
Definition at line 49 of file class.ilPageObjectGUI.php.
Referenced by ilPageObjectGUI().
| ilPageObjectGUI::$obj |
Definition at line 51 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$output2template |
Definition at line 59 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$output_mode |
Definition at line 52 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$output_submode |
Definition at line 53 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$presentation_title |
Definition at line 54 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$question_html |
Definition at line 65 of file class.ilPageObjectGUI.php.
Referenced by setQuestionHTML().
| ilPageObjectGUI::$return_location |
Definition at line 56 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$sourcecode_download_script |
Definition at line 63 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$target_script |
Definition at line 55 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$target_var |
Definition at line 57 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$template_output_var |
Definition at line 58 of file class.ilPageObjectGUI.php.
| ilPageObjectGUI::$tpl |
Definition at line 48 of file class.ilPageObjectGUI.php.
Referenced by ilPageObjectGUI().
1.7.1