/**
  * Add table template
  */
 function addTemplate($a_type, $a_name, $a_classes)
 {
     global $ilDB;
     $tid = $ilDB->nextId("style_template");
     $ilDB->manipulate($q = "INSERT INTO style_template " . "(id, style_id, name, temp_type)" . " VALUES (" . $ilDB->quote($tid, "integer") . "," . $ilDB->quote($this->getId(), "integer") . "," . $ilDB->quote($a_name, "text") . "," . $ilDB->quote($a_type, "text") . ")");
     foreach ($a_classes as $t => $c) {
         $ilDB->manipulate($q = "INSERT INTO style_template_class " . "(template_id, class_type, class)" . " VALUES (" . $ilDB->quote($tid, "integer") . "," . $ilDB->quote($t, "text") . "," . $ilDB->quote($c, "text") . ")");
     }
     include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php";
     $this->writeTemplatePreview($tid, ilObjStyleSheetGUI::_getTemplatePreview($this, $a_type, $tid, true));
     return $tid;
 }
Exemplo n.º 2
0
 function executeCommand()
 {
     global $ilCtrl, $tpl, $ilTabs, $lng, $ilNavigationHistory;
     // goto link to blog posting
     if ($_GET["gtp"]) {
         $ilCtrl->setCmdClass("ilblogpostinggui");
         $_GET["blpg"] = $_GET["gtp"];
         $ilCtrl->setCmd("previewFullscreen");
     }
     $next_class = $ilCtrl->getNextClass($this);
     $cmd = $ilCtrl->getCmd();
     if ($this->id_type == self::REPOSITORY_NODE_ID) {
         $tpl->getStandardTemplate();
         // add entry to navigation history
         if (!$this->getCreationMode() && $this->getAccessHandler()->checkAccess("read", "", $this->node_id)) {
             $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset");
             $ilNavigationHistory->addItem($this->node_id, $link, "blog");
         }
     }
     switch ($next_class) {
         case 'ilblogpostinggui':
             // #9680
             if ($this->id_type == self::REPOSITORY_NODE_ID) {
                 $this->setLocator();
             } else {
                 include_once "Services/Form/classes/class.ilFileInputGUI.php";
                 ilFileInputGUI::setPersonalWorkspaceQuotaCheck(true);
             }
             $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, ""));
             include_once "./Modules/Blog/classes/class.ilBlogPostingGUI.php";
             $bpost_gui = new ilBlogPostingGUI($this->node_id, $this->getAccessHandler(), $_GET["blpg"], $_GET["old_nr"], $this->object->getNotesStatus() && !$this->disable_notes, $this->mayContribute($_GET["blpg"]));
             // needed for editor
             $bpost_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->object->getStyleSheetId(), "blog"));
             // keep preview mode through notes gui (has its own commands)
             switch ($cmd) {
                 // blog preview
                 case "previewFullscreen":
                     $ilCtrl->setParameter($this, "prvm", "fsc");
                     break;
                     // blog in portfolio
                 // blog in portfolio
                 case "previewEmbedded":
                     $ilCtrl->setParameter($this, "prvm", "emb");
                     break;
                     // edit
                 // edit
                 default:
                     $this->setContentStyleSheet();
                     $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]);
                     $this->tabs_gui->addNonTabbedLink("preview", $lng->txt("blog_preview"), $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "previewFullscreen"));
                     $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", "");
                     break;
             }
             $ret = $ilCtrl->forwardCommand($bpost_gui);
             if ($ret != "") {
                 // keep preview mode through notes gui
                 if ($_REQUEST["prvm"]) {
                     $cmd = "preview" . ($_REQUEST["prvm"] == "fsc" ? "Fullscreen" : "Embedded");
                 }
                 // $is_owner = $this->object->getOwner() == $ilUser->getId();
                 $is_owner = $this->mayContribute();
                 $is_active = $bpost_gui->getBlogPosting()->getActive();
                 // do not show inactive postings
                 if (($cmd == "previewFullscreen" || $cmd == "previewEmbedded") && !$is_owner && !$is_active) {
                     $this->ctrl->redirect($this, "preview");
                 }
                 switch ($cmd) {
                     // blog preview
                     case "previewFullscreen":
                         $this->addHeaderAction($cmd);
                         $this->filterInactivePostings();
                         $nav = $this->renderNavigation($this->items, "preview", $cmd);
                         $this->renderFullScreen($ret, $nav);
                         break;
                         // blog in portfolio
                     // blog in portfolio
                     case "previewEmbedded":
                         $this->filterInactivePostings();
                         $nav = $this->renderNavigation($this->items, "gethtml", $cmd);
                         return $this->buildEmbedded($ret, $nav);
                         // ilias/editor
                     // ilias/editor
                     default:
                         // infos about draft status / snippet
                         $info = array();
                         if (!$is_active) {
                             // single author blog (owner) in personal workspace
                             if ($this->id_type == self::WORKSPACE_NODE_ID) {
                                 $info[] = $lng->txt("blog_draft_info");
                             } else {
                                 $info[] = $lng->txt("blog_draft_info_contributors");
                             }
                         }
                         if ($cmd != "history" && !$bpost_gui->getBlogPosting()->getFirstParagraphText()) {
                             $info[] = $lng->txt("blog_new_posting_info");
                         }
                         if ($this->object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved()) {
                             // #9737
                             $info[] = $lng->txt("blog_posting_edit_approval_info");
                         }
                         if (sizeof($info)) {
                             ilUtil::sendInfo(implode("<br />", $info));
                         }
                         // revert to edit cmd to avoid confusion
                         $this->addHeaderAction("render");
                         $tpl->setContent($ret);
                         $nav = $this->renderNavigation($this->items, "render", $cmd, null, $is_owner);
                         $tpl->setRightContent($nav);
                         break;
                 }
             }
             break;
         case "ilinfoscreengui":
             $this->prepareOutput();
             $this->infoScreenForward();
             break;
         case "ilnotegui":
             $this->preview();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpermissiongui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilobjectcopygui":
             include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
             $cp = new ilObjectCopyGUI($this);
             $cp->setType("blog");
             $this->ctrl->forwardCommand($cp);
             break;
         case 'ilrepositorysearchgui':
             $this->prepareOutput();
             $ilTabs->activateTab("contributors");
             include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
             $rep_search = new ilRepositorySearchGUI();
             $rep_search->setTitle($this->lng->txt("blog_add_contributor"));
             $rep_search->setCallback($this, 'addContributor');
             $this->ctrl->setReturn($this, 'contributors');
             $ret =& $this->ctrl->forwardCommand($rep_search);
             break;
         case 'ilexportgui':
             $this->prepareOutput();
             $ilTabs->activateTab("export");
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $ret = $ilCtrl->forwardCommand($exp_gui);
             break;
         case "ilobjstylesheetgui":
             include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php";
             $this->ctrl->setReturn($this, "editStyleProperties");
             $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
             $style_gui->omitLocator();
             if ($cmd == "create" || $_GET["new_type"] == "sty") {
                 $style_gui->setCreationMode(true);
             }
             if ($cmd == "confirmedDelete") {
                 $this->object->setStyleSheetId(0);
                 $this->object->update();
             }
             $ret = $this->ctrl->forwardCommand($style_gui);
             if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
                 $style_id = $ret;
                 $this->object->setStyleSheetId($style_id);
                 $this->object->update();
                 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
             }
             break;
         default:
             if ($cmd != "gethtml") {
                 // desktop item handling, must be toggled before header action
                 if ($cmd == "addToDesk" || $cmd == "removeFromDesk") {
                     $this->{$cmd . "Object"}();
                     if ($_GET["prvm"]) {
                         $cmd = "preview";
                     } else {
                         $cmd = "render";
                     }
                     $ilCtrl->setCmd($cmd);
                 }
                 $this->addHeaderAction($cmd);
             }
             return parent::executeCommand();
     }
     return true;
 }
 public function executeCommand()
 {
     global $ilNavigationHistory;
     $this->tpl->getStandardTemplate();
     // add entry to navigation history
     if (!$this->getCreationMode() && $this->getAccessHandler()->checkAccess("read", "", $this->node_id)) {
         $link = $this->ctrl->getLinkTarget($this, "view");
         $ilNavigationHistory->addItem($this->node_id, $link, "prtt");
     }
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd("view");
     switch ($next_class) {
         case 'ilportfoliotemplatepagegui':
             $this->determinePageCall();
             // has to be done before locator!
             $this->prepareOutput();
             $this->handlePageCall($cmd);
             break;
         case "ilnotegui":
             $this->preview();
             break;
         case "ilinfoscreengui":
             $this->prepareOutput();
             $this->infoScreenForward();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpermissiongui":
             $this->prepareOutput();
             $this->tabs_gui->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilobjectcopygui":
             include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
             $cp = new ilObjectCopyGUI($this);
             $cp->setType("prtt");
             $this->ctrl->forwardCommand($cmd);
             break;
         case 'ilexportgui':
             $this->prepareOutput();
             $this->tabs_gui->activateTab("export");
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $this->ctrl->forwardCommand($exp_gui);
             break;
         case "ilobjstylesheetgui":
             include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php";
             $this->ctrl->setReturn($this, "editStyleProperties");
             $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
             $style_gui->omitLocator();
             if ($cmd == "create" || $_GET["new_type"] == "sty") {
                 $style_gui->setCreationMode(true);
             }
             if ($cmd == "confirmedDelete") {
                 $this->object->setStyleSheetId(0);
                 $this->object->update();
             }
             $ret = $this->ctrl->forwardCommand($style_gui);
             if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
                 $style_id = $ret;
                 $this->object->setStyleSheetId($style_id);
                 $this->object->update();
                 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
             }
             break;
         default:
             $this->addHeaderAction($cmd);
             return ilObject2GUI::executeCommand();
     }
 }
Exemplo n.º 4
0
 /**
  * Output tag style edit screen.
  */
 function outputTagStyleEditScreen()
 {
     global $tpl, $ilCtrl, $lng;
     // set style sheet
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", $this->object->getContentStylePath($this->object->getId()));
     $ts_tpl = new ilTemplate("tpl.style_tag_edit.html", true, true, "Services/Style");
     $cur = explode(".", $_GET["tag"]);
     $cur_tag = $cur[0];
     $cur_class = $cur[1];
     $ts_tpl->setVariable("EXAMPLE", ilObjStyleSheetGUI::getStyleExampleHTML($_GET["style_type"], $cur_class));
     $ts_tpl->setVariable("FORM", $this->form_gui->getHtml());
     $tpl->setTitle($cur_class . " (" . $lng->txt("sty_type_" . $_GET["style_type"]) . ")");
     $tpl->setContent($ts_tpl->get());
 }
Exemplo n.º 5
0
 /**
  * Forward to style object
  */
 function forwardToStyleSheet()
 {
     global $ilCtrl, $ilTabs;
     $ilTabs->clearTargets();
     $cmd = $ilCtrl->getCmd();
     include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php";
     $this->ctrl->setReturn($this, "editStyleProperties");
     $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
     $style_gui->omitLocator();
     if ($cmd == "create" || $_GET["new_type"] == "sty") {
         $style_gui->setCreationMode(true);
     }
     if ($cmd == "confirmedDelete") {
         $this->object->setStyleSheetId(0);
         $this->object->update();
     }
     $ret = $this->ctrl->forwardCommand($style_gui);
     if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
         $style_id = $ret;
         $this->object->setStyleSheetId($style_id);
         $this->object->update();
         $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
     }
 }
Exemplo n.º 6
0
 function executeCommand()
 {
     // goto link to portfolio page
     if ($_GET["gtp"]) {
         $_GET["user_page"] = $_GET["gtp"];
     }
     $this->setTitleAndDescription();
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd("view");
     /*
     if($_REQUEST["ecal"])
     {	
     	$cmd = "preview";
     	$next_class = "";
     }
     */
     switch ($next_class) {
         case "ilworkspaceaccessgui":
             if ($this->checkPermissionBool("write")) {
                 $this->setTabs();
                 $this->tabs_gui->activateTab("share");
                 $this->tpl->setPermanentLink("prtf", $this->object->getId());
                 include_once './Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php';
                 $wspacc = new ilWorkspaceAccessGUI($this->object->getId(), $this->access_handler, true, $plink);
                 $this->ctrl->forwardCommand($wspacc);
             }
             break;
         case 'ilportfoliopagegui':
             if ($this->determinePageCall()) {
                 // only in edit mode
                 $this->addLocator();
                 include_once "Services/Form/classes/class.ilFileInputGUI.php";
                 ilFileInputGUI::setPersonalWorkspaceQuotaCheck(true);
             }
             $this->handlePageCall($cmd);
             break;
         case "ilnotegui":
             $this->preview();
             break;
         case "ilobjstylesheetgui":
             include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php";
             $this->ctrl->setReturn($this, "editStyleProperties");
             $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
             $style_gui->omitLocator();
             if ($cmd == "create" || $_GET["new_type"] == "sty") {
                 $style_gui->setCreationMode(true);
             }
             if ($cmd == "confirmedDelete") {
                 $this->object->setStyleSheetId(0);
                 $this->object->update();
             }
             $ret = $this->ctrl->forwardCommand($style_gui);
             if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
                 $style_id = $ret;
                 $this->object->setStyleSheetId($style_id);
                 $this->object->update();
                 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
             }
             break;
         default:
             if ($cmd != "preview") {
                 $this->addLocator();
                 $this->setTabs();
             }
             $this->{$cmd}();
             break;
     }
     return true;
 }
Exemplo n.º 7
0
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $lng, $ilAccess, $ilTabs, $ilErr;
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     switch ($next_class) {
         case 'ilmdeditorgui':
             $this->checkPermission("write");
             $this->getTemplate();
             $this->setTabs();
             $this->setLocator();
             $this->addHeaderAction();
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             break;
         case "ilglossarytermgui":
             $this->getTemplate();
             //				$this->quickList();
             $this->ctrl->setReturn($this, "listTerms");
             $term_gui =& new ilGlossaryTermGUI($this->term_id);
             $term_gui->setGlossary($this->object);
             //$ret =& $term_gui->executeCommand();
             $ret =& $this->ctrl->forwardCommand($term_gui);
             break;
         case "ilinfoscreengui":
             $this->addHeaderAction();
             $this->showInfoScreen();
             break;
         case "ilobjstylesheetgui":
             include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php";
             $this->ctrl->setReturn($this, "editStyleProperties");
             $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
             $style_gui->omitLocator();
             if ($cmd == "create" || $_GET["new_type"] == "sty") {
                 $style_gui->setCreationMode(true);
             }
             if ($cmd == "confirmedDelete") {
                 $this->object->setStyleSheetId(0);
                 $this->object->update();
             }
             $ret = $this->ctrl->forwardCommand($style_gui);
             if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
                 $style_id = $ret;
                 $this->object->setStyleSheetId($style_id);
                 $this->object->update();
                 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
             }
             break;
         case 'ilpermissiongui':
             if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
                 $this->prepareOutput();
             } else {
                 $this->getTemplate();
                 $this->setTabs();
                 $this->setLocator();
                 $this->addHeaderAction();
             }
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilobjtaxonomygui":
             $this->getTemplate();
             $this->setTabs();
             $this->setLocator();
             $this->addHeaderAction();
             $ilTabs->activateTab("settings");
             $this->setSettingsSubTabs("taxonomy");
             include_once "./Services/Taxonomy/classes/class.ilObjTaxonomyGUI.php";
             $this->ctrl->setReturn($this, "properties");
             $tax_gui = new ilObjTaxonomyGUI();
             $tax_gui->setMultiple(false);
             /*include_once("./Modules/Glossary/classes/class.ilTermTaxInfo.php");
             		$term_info = new ilTermTaxInfo();*/
             //$tax_gui->activateAssignedItemSorting($term_info, "glo", "term");
             $tax_gui->setAssignedObject($this->object->getId());
             $ret = $this->ctrl->forwardCommand($tax_gui);
             break;
         case "ilexportgui":
             $this->getTemplate();
             $this->setTabs();
             $ilTabs->activateTab("export");
             $this->setLocator();
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             //$exp_gui->addFormat("xml", "", $this, "export");
             $exp_gui->addFormat("xml");
             $exp_gui->addFormat("html", "", $this, "exportHTML");
             $exp_gui->addCustomColumn($lng->txt("cont_public_access"), $this, "getPublicAccessColValue");
             $exp_gui->addCustomMultiCommand($lng->txt("cont_public_access"), $this, "publishExportFile");
             $ret = $this->ctrl->forwardCommand($exp_gui);
             break;
         case 'ilobjectcopygui':
             $this->prepareOutput();
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('glo');
             $this->ctrl->forwardCommand($cp);
             break;
         default:
             $cmd = $this->ctrl->getCmd("listTerms");
             if ($cmd == "create" && $_POST["new_type"] == "term") {
                 $this->ctrl->setCmd("create");
                 $this->ctrl->setCmdClass("ilGlossaryTermGUI");
                 $ret =& $this->executeCommand();
                 return;
             } else {
                 if (!in_array($cmd, array("frameset", "quickList"))) {
                     if (strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) {
                         $this->prepareOutput();
                         $cmd .= "Object";
                     } else {
                         $this->getTemplate();
                         $this->setTabs();
                         $this->setLocator();
                         $this->addHeaderAction();
                         if ($cmd == "redrawHeaderAction") {
                             $cmd = "redrawHeaderActionObject";
                         }
                     }
                 }
                 $ret =& $this->{$cmd}();
             }
             break;
     }
     if (!in_array($cmd, array("frameset", "quickList"))) {
         if (strtolower($_GET["baseClass"]) != "iladministrationgui") {
             if (!$this->getCreationMode()) {
                 $this->tpl->show();
             }
         }
     } else {
         $this->tpl->show(false);
     }
 }
Exemplo n.º 8
0
 function executeCommand()
 {
     global $ilUser, $ilCtrl, $tpl, $ilTabs, $ilAccess;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     $this->prepareOutput();
     // see ilWikiPageGUI::printViewOrderList()
     // printView() and pdfExport() cannot be in ilWikiPageGUI because of stylesheet confusion
     if ($cmd == "printView" || $cmd == "pdfExport") {
         $next_class = null;
     }
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->checkPermission("visible");
             $this->addHeaderAction();
             $this->infoScreen();
             // forwards command
             break;
         case 'ilpermissiongui':
             $this->addHeaderAction();
             $ilTabs->activateTab("perm_settings");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilwikipagegui':
             $this->checkPermission("read");
             include_once "./Modules/Wiki/classes/class.ilWikiPageGUI.php";
             $wpage_gui = ilWikiPageGUI::getGUIForTitle($this->object->getId(), ilWikiUtil::makeDbTitle($_GET["page"]), $_GET["old_nr"], $this->object->getRefId());
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $wpage_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->object->getStyleSheetId(), "wiki"));
             $this->setContentStyleSheet();
             if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()) && (!$ilAccess->checkAccess("edit_content", "", $this->object->getRefId()) || $wpage_gui->getPageObject()->getBlocked())) {
                 $wpage_gui->setEnableEditing(false);
             }
             // alter title and description
             //				$tpl->setTitle($wpage_gui->getPageObject()->getTitle());
             //				$tpl->setDescription($this->object->getTitle());
             $ret = $this->ctrl->forwardCommand($wpage_gui);
             if ($ret != "") {
                 $tpl->setContent($ret);
             }
             break;
         case 'ilpublicuserprofilegui':
             require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
             $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
             $ret = $this->ctrl->forwardCommand($profile_gui);
             $tpl->setContent($ret);
             break;
         case "ilobjstylesheetgui":
             include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php";
             $this->ctrl->setReturn($this, "editStyleProperties");
             $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
             $style_gui->omitLocator();
             if ($cmd == "create" || $_GET["new_type"] == "sty") {
                 $style_gui->setCreationMode(true);
             }
             if ($cmd == "confirmedDelete") {
                 $this->object->setStyleSheetId(0);
                 $this->object->update();
             }
             $ret = $this->ctrl->forwardCommand($style_gui);
             if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
                 $style_id = $ret;
                 $this->object->setStyleSheetId($style_id);
                 $this->object->update();
                 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
             }
             break;
         case "ilexportgui":
             //				$this->prepareOutput();
             $this->addHeaderAction();
             $ilTabs->activateTab("export");
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $exp_gui->addFormat("html", "", $this, "exportHTML");
             $ret = $this->ctrl->forwardCommand($exp_gui);
             //				$this->tpl->show();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilratinggui":
             // for rating category editing
             $this->checkPermission("write");
             $this->addHeaderAction();
             $ilTabs->activateTab("settings");
             $this->setSettingsSubTabs("rating_categories");
             include_once "Services/Rating/classes/class.ilRatingGUI.php";
             $gui = new ilRatingGUI();
             $gui->setObject($this->object->getId(), $this->object->getType());
             $gui->setExportCallback(array($this, "getSubObjectTitle"), $this->lng->txt("page"));
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilwikistatgui":
             $this->checkPermission("statistics_read");
             $this->addHeaderAction();
             $ilTabs->activateTab("statistics");
             include_once "Modules/Wiki/classes/class.ilWikiStatGUI.php";
             $gui = new ilWikiStatGUI($this->object->getId());
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilwikipagetemplategui":
             $this->addHeaderAction();
             $ilTabs->activateTab("settings");
             $this->setSettingsSubTabs("page_templates");
             include_once "./Modules/Wiki/classes/class.ilWikiPageTemplateGUI.php";
             $wptgui = new ilWikiPageTemplateGUI($this);
             $this->ctrl->forwardCommand($wptgui);
             break;
         default:
             $this->addHeaderAction();
             if (!$cmd) {
                 $cmd = "infoScreen";
             }
             $cmd .= "Object";
             if ($cmd != "infoScreenObject") {
                 $this->checkPermission("read");
             } else {
                 $this->checkPermission("visible");
             }
             $this->{$cmd}();
             break;
     }
     return $ret;
 }
Exemplo n.º 9
0
 /**
  * Standard Version of Fill Row. Most likely to
  * be overwritten by derived class.
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl, $ilAccess, $rbacsystem;
     $stypes = ilObjStyleSheet::_getStyleSuperTypes();
     $types = $stypes[$this->super_type];
     if (!in_array($a_set["type"], $types)) {
         return;
     }
     //var_dump($a_set);
     // checkbox row
     /*		if ($this->expandable)
     		{
     			if (!empty($this->core_styles[$a_set["type"].".".
     				ilObjStyleSheet::_determineTag($a_set["type"]).
     				".".$a_set["class"]]))
     			{
     				$this->tpl->touchBlock("no_checkbox");
     			}
     			else
     			{*/
     $this->tpl->setCurrentBlock("checkbox");
     $this->tpl->setVariable("CHAR", $a_set["type"] . "." . ilObjStyleSheet::_determineTag($a_set["type"]) . "." . $a_set["class"]);
     $this->tpl->parseCurrentBlock();
     /*			}
     		}*/
     if ($this->hideable) {
         if (!ilObjStyleSheet::_isHideable($a_set["type"]) || !empty($this->core_styles[$a_set["type"] . "." . ilObjStyleSheet::_determineTag($a_set["type"]) . "." . $a_set["class"]])) {
             $this->tpl->touchBlock("no_hide_checkbox");
         } else {
             $this->tpl->setCurrentBlock("hide_checkbox");
             $this->tpl->setVariable("CHAR", $a_set["type"] . "." . ilObjStyleSheet::_determineTag($a_set["type"]) . "." . $a_set["class"]);
             if ($this->style->getHideStatus($a_set["type"], $a_set["class"])) {
                 $this->tpl->setVariable("CHECKED", "checked='checked'");
             }
             $this->tpl->parseCurrentBlock();
         }
     }
     // example
     $this->tpl->setVariable("EXAMPLE", ilObjStyleSheetGUI::getStyleExampleHTML($a_set["type"], $a_set["class"]));
     $tag_str = ilObjStyleSheet::_determineTag($a_set["type"]) . "." . $a_set["class"];
     $this->tpl->setVariable("TXT_TAG", $a_set["class"]);
     $this->tpl->setVariable("TXT_TYPE", $lng->txt("sty_type_" . $a_set["type"]));
     if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"])) {
         $this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
         $ilCtrl->setParameter($this->parent_obj, "tag", $tag_str);
         $ilCtrl->setParameter($this->parent_obj, "style_type", $a_set["type"]);
         $this->tpl->setVariable("LINK_EDIT_TAG_STYLE", $ilCtrl->getLinkTarget($this->parent_obj, "editTagStyle"));
     }
 }