コード例 #1
0
 function manageObject()
 {
     global $ilUser, $objDefinition, $ilCtrl, $lng;
     $objects = array();
     $this->manage = true;
     $this->setAvailableDetailLevels(1, 1);
     $top_tb = new ilToolbarGUI();
     $top_tb->setFormAction($ilCtrl->getFormAction($this));
     $top_tb->setLeadingImage(ilUtil::getImagePath("arrow_upright.png"), $lng->txt("actions"));
     if ($this->view == self::VIEW_MY_OFFERS) {
         $top_tb->addFormButton($lng->txt("remove"), "confirmRemove");
     } else {
         $top_tb->addFormButton($lng->txt("pd_unsubscribe_memberships"), "confirmRemove");
     }
     $top_tb->addSeparator();
     $top_tb->addFormButton($lng->txt("cancel"), "getHTML");
     $top_tb->setCloseFormTag(false);
     $bot_tb = new ilToolbarGUI();
     $bot_tb->setLeadingImage(ilUtil::getImagePath("arrow_downright.png"), $lng->txt("actions"));
     if ($this->view == self::VIEW_MY_OFFERS) {
         $bot_tb->addFormButton($lng->txt("remove"), "confirmRemove");
     } else {
         $bot_tb->addFormButton($lng->txt("pd_unsubscribe_memberships"), "confirmRemove");
     }
     $bot_tb->addSeparator();
     $bot_tb->addFormButton($lng->txt("cancel"), "getHTML");
     $bot_tb->setOpenFormTag(false);
     return $top_tb->getHTML() . $this->getHTML() . $bot_tb->getHTML();
     /*		
     		if($this->view == self::VIEW_MY_OFFERS)
     		{
     			return $top_tb->getHTML().$this->getHTML().$bot_tb->getHTML();
     			
     			foreach($ilUser->getDesktopItems() as $item)
     			{
     				$objects[] = $item;
     			}
     		}
     		else
     		{		 
     			$objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
     			   array("cat", "crs", "grp", "fold"));
     
     			foreach($objtype_groups as $grpdata)
     			{							
     				foreach($this->getObjectsByMembership($grpdata["objs"]) as $item)
     				{
     					$objects[] = $item;
     				}
     			}
     		}
     		
     		include_once "Services/PersonalDesktop/classes/class.ilPDSelectedItemsTableGUI.php";
     		$tbl = new ilPDSelectedItemsTableGUI($this, "manage", $objects, $this->view, ($ilUser->getPref("pd_order_items") == 'location'));
     		return $tbl->getHTML();
     */
 }
コード例 #2
0
 /**
  * Show paste tree
  */
 public function showPasteTreeObject()
 {
     global $ilTabs, $ilToolbar;
     $ilTabs->setTabActive('view_content');
     if (!in_array($_SESSION['clipboard']['cmd'], array('link', 'copy', 'cut'))) {
         $message = __METHOD__ . ": Unknown action.";
         $this->ilias->raiseError($message, $this->ilias->error_obj->WARNING);
     }
     $cmd = $_SESSION['clipboard']['cmd'];
     //
     $exp = $this->getTreeSelectorGUI($cmd);
     if ($exp->handleCommand()) {
         return;
     }
     $output = $exp->getHTML();
     $txt_var = $cmd == "copy" ? "copy" : "paste";
     // toolbars
     $t = new ilToolbarGUI();
     $t->setFormAction($this->ctrl->getFormAction($this, "performPasteIntoMultipleObjects"));
     $t->addFormButton($this->lng->txt($txt_var), "performPasteIntoMultipleObjects");
     $t->addSeparator();
     $t->addFormButton($this->lng->txt("obj_insert_into_clipboard"), "keepObjectsInClipboard");
     $t->addFormButton($this->lng->txt("cancel"), "cancelMoveLink");
     $t->setCloseFormTag(false);
     $t->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), " ");
     $output = $t->getHTML() . $output;
     $t->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), " ");
     $t->setCloseFormTag(true);
     $t->setOpenFormTag(false);
     $output .= "<br />" . $t->getHTML();
     $this->tpl->setContent($output);
 }
コード例 #3
0
 function manageObject()
 {
     global $ilUser, $objDefinition, $ilCtrl, $lng;
     $objects = array();
     $this->manage = true;
     $this->setAvailableDetailLevels(1, 1);
     $top_tb = new ilToolbarGUI();
     $top_tb->setFormAction($ilCtrl->getFormAction($this));
     $top_tb->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), $lng->txt("actions"));
     if ($this->view == self::VIEW_SELECTED_ITEMS) {
         $top_tb->addFormButton($lng->txt("remove"), "confirmRemove");
     } else {
         $top_tb->addFormButton($lng->txt("pd_unsubscribe_memberships"), "confirmRemove");
     }
     $top_tb->addSeparator();
     $top_tb->addFormButton($lng->txt("cancel"), "getHTML");
     $top_tb->setCloseFormTag(false);
     $bot_tb = new ilToolbarGUI();
     $bot_tb->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), $lng->txt("actions"));
     if ($this->view == self::VIEW_SELECTED_ITEMS) {
         $bot_tb->addFormButton($lng->txt("remove"), "confirmRemove");
     } else {
         $bot_tb->addFormButton($lng->txt("pd_unsubscribe_memberships"), "confirmRemove");
     }
     $bot_tb->addSeparator();
     $bot_tb->addFormButton($lng->txt("cancel"), "getHTML");
     $bot_tb->setOpenFormTag(false);
     return $top_tb->getHTML() . $this->getHTML() . $bot_tb->getHTML();
 }
コード例 #4
0
 /**
  * show administration panel
  */
 function showAdministrationPanel(&$tpl)
 {
     global $ilAccess, $lng;
     $lng->loadLanguageModule('cntr');
     if ($this->isActiveAdministrationPanel()) {
         // #11545
         $GLOBALS['tpl']->setPageFormAction($this->ctrl->getFormAction($this));
         include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
         $toolbar = new ilToolbarGUI();
         $this->ctrl->setParameter($this, "type", "");
         $this->ctrl->setParameter($this, "item_ref_id", "");
         if (!$_SESSION["clipboard"]) {
             if ($this->object->gotItems()) {
                 $toolbar->setLeadingImage(ilUtil::getImagePath("arrow_upright.png"), $lng->txt("actions"));
                 $toolbar->addFormButton($this->lng->txt('delete_selected_items'), 'delete');
                 $toolbar->addFormButton($this->lng->txt('move_selected_items'), 'cut');
                 $toolbar->addFormButton($this->lng->txt('copy_selected_items'), 'copy');
                 $toolbar->addFormButton($this->lng->txt('link_selected_items'), 'link');
                 // add download button if multi download enabled
                 $folder_set = new ilSetting("fold");
                 if ($folder_set->get("enable_multi_download") == true) {
                     $toolbar->addSeparator();
                     $toolbar->addFormButton($this->lng->txt('download_selected_items'), 'download');
                 }
             }
             if ($this->object->getType() == 'crs') {
                 if ($this->object->gotItems()) {
                     $toolbar->addSeparator();
                 }
                 $toolbar->addButton($this->lng->txt('cntr_adopt_content'), $this->ctrl->getLinkTargetByClass('ilObjectCopyGUI', 'initSourceSelection'));
             }
         } else {
             /*$GLOBALS["tpl"]->addAdminPanelCommand("paste",
                   $this->lng->txt("paste_clipboard_items")); 
                   
               if($_SESSION["clipboard"]["cmd"] == "link")
               {                    
                   $GLOBALS["tpl"]->addAdminPanelCommand("initAndDisplayLinkIntoMultipleObjects",
                       $this->lng->txt("paste_clipboard_items_into_multiple_objects"));
               }*/
             $toolbar->addFormButton($this->lng->txt('clear_clipboard'), 'clear');
             if ($this->isMultiDownloadEnabled()) {
                 $toolbar->addSeparator();
                 $toolbar->addFormButton($this->lng->txt('download_selected_items'), 'download');
             }
         }
         $GLOBALS['tpl']->addAdminPanelToolbar($toolbar, $this->object->gotItems() ? true : false, $this->object->gotItems() ? true : false);
     } else {
         if ($this->edit_order) {
             if ($this->object->gotItems() and $ilAccess->checkAccess("write", "", $this->object->getRefId())) {
                 include_once './Services/Container/classes/class.ilContainer.php';
                 if ($this->object->getOrderType() == ilContainer::SORT_MANUAL) {
                     // #11843
                     $GLOBALS['tpl']->setPageFormAction($this->ctrl->getFormAction($this));
                     include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
                     $toolbar = new ilToolbarGUI();
                     $this->ctrl->setParameter($this, "type", "");
                     $this->ctrl->setParameter($this, "item_ref_id", "");
                     $toolbar->addFormButton($this->lng->txt('sorting_save'), 'saveSorting');
                     $GLOBALS['tpl']->addAdminPanelToolbar($toolbar, true, false);
                     /*																																			
                     $GLOBALS["tpl"]->addAdminPanelCommand("saveSorting",
                     	$this->lng->txt('sorting_save'));
                     
                     // button should appear at bottom, too
                     $GLOBALS["tpl"]->admin_panel_bottom = true;					 
                     */
                 }
             }
         } else {
             if ($this->isMultiDownloadEnabled()) {
                 // #11843
                 $GLOBALS['tpl']->setPageFormAction($this->ctrl->getFormAction($this));
                 include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
                 $toolbar = new ilToolbarGUI();
                 $this->ctrl->setParameter($this, "type", "");
                 $this->ctrl->setParameter($this, "item_ref_id", "");
                 $toolbar->addFormButton($this->lng->txt('download_selected_items'), 'download');
                 $GLOBALS['tpl']->addAdminPanelToolbar($toolbar, $this->object->gotItems() ? true : false, $this->object->gotItems() ? true : false);
             }
         }
     }
 }
コード例 #5
0
 /**
  * Show target selection
  */
 public function showTargetSelectionTree()
 {
     global $ilTabs, $ilToolbar, $ilCtrl, $tree, $tpl, $objDefinition, $lng;
     $this->tpl = $tpl;
     if ($objDefinition->isContainer($this->getType())) {
         ilUtil::sendInfo($this->lng->txt('msg_copy_clipboard_container'));
     } else {
         ilUtil::sendInfo($this->lng->txt('msg_copy_clipboard'));
     }
     //
     include_once "./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php";
     $exp = new ilRepositorySelectorExplorerGUI($this, "showTargetSelectionTree");
     $exp->setTypeWhiteList(array("root", "cat", "grp", "crs", "fold"));
     $exp->setSelectMode("target", false);
     if ($exp->handleCommand()) {
         return;
     }
     $output = $exp->getHTML();
     // toolbars
     $t = new ilToolbarGUI();
     $t->setFormAction($ilCtrl->getFormAction($this, "saveTarget"));
     if ($objDefinition->isContainer($this->getType())) {
         $t->addFormButton($lng->txt("btn_next"), "saveTarget");
     } else {
         $t->addFormButton($lng->txt("paste"), "saveTarget");
     }
     $t->addSeparator();
     $t->addFormButton($lng->txt("obj_insert_into_clipboard"), "keepObjectsInClipboard");
     $t->addFormButton($lng->txt("cancel"), "cancel");
     $t->setCloseFormTag(false);
     $t->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), " ");
     $output = $t->getHTML() . $output;
     $t->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), " ");
     $t->setCloseFormTag(true);
     $t->setOpenFormTag(false);
     $output .= "<br />" . $t->getHTML();
     $this->tpl->setContent($output);
     return;
     // old implementation
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.paste_into_multiple_objects.html', "Services/Object");
     include_once './Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php';
     $exp = new ilPasteIntoMultipleItemsExplorer(ilPasteIntoMultipleItemsExplorer::SEL_TYPE_RADIO, 'ilias.php?baseClass=ilRepositoryGUI&amp;cmd=goto', 'paste_copy_repexpand');
     // Target selection should check for create permission
     $required_perm = 'visible';
     $create_perm = 'create_' . ilObject::_lookupType($this->getSource(), true);
     if ($create_perm) {
         $required_perm .= ',' . $create_perm;
     }
     $exp->setRequiredFormItemPermission($required_perm);
     $exp->setExpandTarget($ilCtrl->getLinkTarget($this, 'showTargetSelectionTree'));
     $exp->setTargetGet('ref_id');
     $exp->setPostVar('target');
     $exp->highlightNode($_GET['ref_id']);
     $exp->setCheckedItems(array((int) $_POST['target']));
     // Filter to container
     foreach (array('cat', 'root', 'crs', 'grp', 'fold') as $container) {
         /*
         if($this->getType() == 'crs' and $container == 'crs')
         {
         	continue;
         }
         */
         $sub = $objDefinition->getSubObjects($container);
         if (!isset($sub[$this->getType()])) {
             $exp->removeFormItemForType($container);
         }
     }
     if ($_GET['paste_copy_repexpand'] == '') {
         $expanded = $tree->readRootId();
     } else {
         $expanded = $_GET['paste_copy_repexpand'];
     }
     $this->tpl->setVariable('FORM_TARGET', '_self');
     $this->tpl->setVariable('FORM_ACTION', $ilCtrl->getFormAction($this, 'copySelection'));
     $exp->setExpand($expanded);
     // build html-output
     $exp->setOutput(0);
     $output = $exp->getOutput();
     $this->tpl->setVariable('OBJECT_TREE', $output);
     $this->tpl->setVariable('CMD_SUBMIT', 'saveTarget');
     if ($objDefinition->isContainer($this->getType())) {
         $this->tpl->setVariable('TXT_SUBMIT', $this->lng->txt('btn_next'));
     } else {
         if (!$objDefinition->isPlugin($this->getType())) {
             $submit = $this->lng->txt('obj_' . $this->getType() . '_duplicate');
         } else {
             // get plugin instance
             include_once "Services/Component/classes/class.ilPlugin.php";
             $plugin = ilPlugin::getPluginObject(IL_COMP_SERVICE, "Repository", "robj", ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $this->getType()));
             $submit = $plugin->txt('obj_' . $this->getType() . '_duplicate');
         }
         $this->tpl->setVariable('TXT_SUBMIT', $submit);
     }
     $ilToolbar->addButton($this->lng->txt('cancel'), $ilCtrl->getLinkTarget($this, 'cancel'));
 }