Exemplo n.º 1
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;
 }
Exemplo n.º 2
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.º 3
0
 function executeCommand()
 {
     global $ilNavigationHistory, $ilCtrl, $ilUser, $ilTabs, $ilAccess, $ilErr;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     if ($this->id_type == self::WORKSPACE_NODE_ID) {
         include_once "Services/Form/classes/class.ilFileInputGUI.php";
         ilFileInputGUI::setPersonalWorkspaceQuotaCheck(true);
     }
     if (!$this->getCreationMode()) {
         // do not move this payment block!!
         if (IS_PAYMENT_ENABLED) {
             include_once './Services/Payment/classes/class.ilPaymentObject.php';
             if (ANONYMOUS_USER_ID == $ilUser->getId() && isset($_GET['transaction'])) {
                 $transaction = $_GET['transaction'];
                 include_once './Services/Payment/classes/class.ilPaymentBookings.php';
                 $valid_transaction = ilPaymentBookings::_readBookingByTransaction($transaction);
             }
             if (ilPaymentObject::_requiresPurchaseToAccess($this->node_id, $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) {
                 $this->setLocator();
                 $this->tpl->getStandardTemplate();
                 include_once './Services/Payment/classes/class.ilShopPurchaseGUI.php';
                 $pp = new ilShopPurchaseGUI((int) $this->node_id);
                 $ret = $this->ctrl->forwardCommand($pp);
                 return true;
             }
         } else {
             if ($this->id_type == self::REPOSITORY_NODE_ID && $this->checkPermissionBool("read")) {
                 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->node_id);
                 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "infoScreen");
                 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
                 // add entry to navigation history
                 $ilNavigationHistory->addItem($this->node_id, $link, "file");
             }
         }
     }
     $this->prepareOutput();
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->infoScreenForward();
             // forwards command
             break;
         case 'ilmdeditorgui':
             if (!$this->checkPermissionBool("write")) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             $ilTabs->activateTab("id_meta");
             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');
             // todo: make this work
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'Technical');
             $this->ctrl->forwardCommand($md_gui);
             break;
             // repository permissions
         // repository permissions
         case 'ilpermissiongui':
             $ilTabs->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilexportgui":
             $ilTabs->activateTab("export");
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $ret = $this->ctrl->forwardCommand($exp_gui);
             break;
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('file');
             $this->ctrl->forwardCommand($cp);
             break;
             // personal workspace permissions
         // personal workspace permissions
         case "ilworkspaceaccessgui":
             $ilTabs->activateTab("id_permissions");
             include_once './Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php';
             $wspacc = new ilWorkspaceAccessGUI($this->node_id, $this->getAccessHandler());
             $this->ctrl->forwardCommand($wspacc);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             // in personal workspace use object2gui
             if ($this->id_type == self::WORKSPACE_NODE_ID) {
                 $this->addHeaderAction();
                 // coming from goto we need default command
                 if (empty($cmd)) {
                     $ilCtrl->setCmd("infoScreen");
                 }
                 $ilTabs->clearTargets();
                 return parent::executeCommand();
             }
             if (empty($cmd)) {
                 $cmd = "infoScreen";
             }
             $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
 }
 protected function initEditCustomForm(ilPropertyFormGUI $a_form)
 {
     $this->setSettingsSubTabs("properties");
     // comments
     $comments = new ilCheckboxInputGUI($this->lng->txt("prtf_public_comments"), "comments");
     $a_form->addItem($comments);
     // profile picture
     $ppic = new ilCheckboxInputGUI($this->lng->txt("prtf_profile_picture"), "ppic");
     $a_form->addItem($ppic);
     $prfa_set = new ilSetting("prfa");
     if ($prfa_set->get("banner")) {
         include_once "Services/Form/classes/class.ilFileInputGUI.php";
         ilFileInputGUI::setPersonalWorkspaceQuotaCheck(true);
         $dimensions = " (" . $prfa_set->get("banner_width") . "x" . $prfa_set->get("banner_height") . ")";
         $img = new ilImageFileInputGUI($this->lng->txt("prtf_banner") . $dimensions, "banner");
         $a_form->addItem($img);
         // show existing file
         $file = $this->object->getImageFullPath(true);
         if ($file) {
             $img->setImage($file);
         }
     }
     /* #15000
     		$bg_color = new ilColorPickerInputGUI($this->lng->txt("prtf_background_color"), "bg_color");
     		$a_form->addItem($bg_color);
     
     		$font_color = new ilColorPickerInputGUI($this->lng->txt("prtf_font_color"), "font_color");
     		$a_form->addItem($font_color);										
     		*/
 }