/**
  * Constructor
  */
 function __construct($a_parent_obj, $a_parent_cmd)
 {
     parent::__construct($a_parent_obj, $a_parent_cmd, null, "", "");
     // #14587 - ilRepositorySelectorExplorerGUI::__construct() does NOT include side blocks!
     $list = $this->getTypeWhiteList();
     $list[] = "poll";
     $this->setTypeWhiteList($list);
 }
 /**
  * Is node visible
  *
  * @param array $a_node node data
  * @return bool visible true/false
  */
 function isNodeVisible($a_node)
 {
     if (!parent::isNodeVisible($a_node)) {
         return false;
     }
     //hide empty container
     if (count($this->getChildsOfNode($a_node["child"])) > 0 || $this->isNodeClickable($a_node)) {
         return true;
     } else {
         return false;
     }
 }
 /**
  * {@inheritdoc}
  */
 function isNodeClickable($a_node)
 {
     /**
      * @var $ilAccess ilAccessHandler
      */
     global $ilAccess;
     if ($a_node['type'] == 'frm') {
         if ($this->getCurrentFrmRefId() && $this->getCurrentFrmRefId() == $a_node['child']) {
             return false;
         }
         return $ilAccess->checkAccess('moderate_frm', '', $a_node['child']) && parent::isNodeClickable($a_node);
     }
     return false;
 }
 /**
  * Is node visible
  *
  * @param array $a_node node data
  * @return bool visible true/false
  */
 function isNodeVisible($a_node)
 {
     if (parent::isNodeVisible($a_node)) {
         //hide empty container
         if (count($this->getChildsOfNode($a_node["child"])) > 0 || $this->isNodeClickable($a_node)) {
             // #16523
             if ($a_node["type"] == "qpl") {
                 include_once "Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
                 return ilObjQuestionPool::_lookupOnline($a_node["obj_id"]);
             }
             return true;
         }
     }
     return false;
 }
 /**
  * Is node highlighted?
  *
  * @param mixed $a_node node object/array
  * @return boolean node visible true/false
  */
 function isNodeHighlighted($a_node)
 {
     //highlight parent if target object cant be highlighted
     if ($this->highlighted_parent == $a_node["child"]) {
         return true;
     }
     return parent::isNodeHighlighted($a_node);
 }
 /**
  * Constructor
  */
 function __construct($a_parent_obj, $a_parent_cmd)
 {
     parent::__construct($a_parent_obj, $a_parent_cmd, null, "", "");
 }
示例#7
0
 /**
  * @param $cmd string
  * @return ilTreeExplorerGUI
  */
 protected function getTreeSelectorGUI($cmd)
 {
     include_once "./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php";
     $exp = new ilRepositorySelectorExplorerGUI($this, "showPasteTree");
     $exp->setTypeWhiteList(array("root", "cat", "grp", "crs", "fold"));
     if ($cmd == "link") {
         $exp->setSelectMode("nodes", true);
         return $exp;
     } else {
         $exp->setSelectMode("nodes[]", false);
         return $exp;
     }
 }
 /**
  * Add level resource
  */
 function addLevelResource()
 {
     global $ilCtrl, $ilTabs, $lng, $tree, $tpl;
     $this->setLevelHead();
     $ilTabs->activateTab("level_resources");
     include_once "./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php";
     $exp = new ilRepositorySelectorExplorerGUI($this, "addLevelResource", $this, "saveLevelResource", "root_id");
     if (!$exp->handleCommand()) {
         $tpl->setContent($exp->getHTML());
     }
 }
 /**
  * Select Repository Item
  */
 function showRepositorySelection()
 {
     global $tpl, $lng, $ilCtrl, $tree, $ilUser;
     include_once 'Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php';
     $ilCtrl->setParameter($this, "postvar", $this->getPostVar());
     ilUtil::sendInfo($this->getHeaderMessage());
     $exp = new ilRepositorySelectorExplorerGUI($this, "showRepositorySelection", $this, "selectRepositoryItem", "root_id");
     $exp->setTypeWhiteList($this->getVisibleTypes());
     $exp->setClickableTypes($this->getClickableTypes());
     if ($this->getValue()) {
         $exp->setPathOpen($this->getValue());
         $exp->setHighlightedNode($this->getHighlightedNode());
     }
     if ($exp->handleCommand()) {
         return;
     }
     // build html-output
     $tpl->setContent($exp->getHTML());
 }
 /**
  * Set scope
  *
  * @param
  * @return
  */
 function setScopeObject()
 {
     global $tpl, $ilCtrl;
     $ilCtrl->saveParameter($this, "id");
     include_once "./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php";
     $exp = new ilRepositorySelectorExplorerGUI($this, "setScope", $this, "saveScope", "cat");
     $exp->setTypeWhiteList(array("root", "cat"));
     if (!$exp->handleCommand()) {
         $tpl->setContent($exp->getHTML());
     }
 }
示例#11
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'));
 }