/**
  * Constructor.
  */
 function __construct($a_ref_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
 {
     parent::__construct($a_ref_id, $a_id_type, $a_parent_node_id);
     $this->plugin = ilPlugin::getPluginObject(IL_COMP_SERVICE, "Repository", "robj", ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $this->getType()));
     if (!is_object($this->plugin)) {
         die("ilObjectPluginGUI: Could not instantiate plugin object for type " . $this->getType() . ".");
     }
 }
 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
 {
     global $ilUser;
     parent::__construct($a_id, $a_id_type, $a_parent_node_id);
     $this->user_id = $ilUser->getId();
     $this->lng->loadLanguageModule("prtf");
     $this->lng->loadLanguageModule("user");
 }
 /**
  * get tabs
  */
 public function setTabs()
 {
     global $ilTabs;
     if ($this->checkPermissionBool('visible')) {
         $ilTabs->addTab("info", $this->lng->txt("info_short"), $this->ctrl->getLinkTarget($this, "infoScreen"));
     }
     if ($this->checkPermissionBool('write')) {
         $ilTabs->addTab("edit", $this->lng->txt("edit"), $this->ctrl->getLinkTarget($this, "edit"));
     }
     // will add permissions if needed
     parent::setTabs();
 }
 /**
  * @param int $a_id
  * @param int $a_id_type
  * @param int $a_parent_node_id
  */
 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
 {
     /**
      * @var $lng  ilLanguage
      * @var $ilDB ilDB
      */
     global $lng, $ilDB;
     parent::__construct($a_id, $a_id_type, $a_parent_node_id);
     $this->lng->loadLanguageModule('tos');
     $this->factory = new ilTermsOfServiceTableDataProviderFactory();
     $this->factory->setLanguageAdapter($lng);
     $this->factory->setDatabaseAdapter($ilDB);
 }
 protected function initHeaderAction($sub_type = null, $sub_id = null, $a_is_preview = false)
 {
     global $ilUser, $ilCtrl;
     if (!$this->obj_id) {
         return false;
     }
     $sub_type = $sub_id = null;
     if ($_GET["blpg"]) {
         $sub_type = "blp";
         $sub_id = $_GET["blpg"];
     }
     $lg = parent::initHeaderAction($sub_type, $sub_id);
     if ($a_is_preview) {
         $lg->enableComments(false);
         $lg->enableNotes(false);
         $lg->enableTags(false);
         include_once "./Services/Notification/classes/class.ilNotification.php";
         if (ilNotification::hasNotification(ilNotification::TYPE_BLOG, $ilUser->getId(), $this->obj_id)) {
             $ilCtrl->setParameter($this, "ntf", 1);
             $link = $ilCtrl->getLinkTarget($this, "setNotification");
             $ilCtrl->setParameter($this, "ntf", "");
             $lg->addCustomCommand($link, "blog_notification_toggle_off");
             $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_on.png"), $this->lng->txt("blog_notification_activated"));
         } else {
             $ilCtrl->setParameter($this, "ntf", 2);
             $link = $ilCtrl->getLinkTarget($this, "setNotification");
             $ilCtrl->setParameter($this, "ntf", "");
             $lg->addCustomCommand($link, "blog_notification_toggle_on");
             $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_off.png"), $this->lng->txt("blog_notification_deactivated"));
         }
         // #11758
         if ($this->mayContribute()) {
             $ilCtrl->setParameter($this, "prvm", "");
             $ilCtrl->setParameter($this, "bmn", "");
             $ilCtrl->setParameter($this, "blpg", "");
             $link = $ilCtrl->getLinkTarget($this, "");
             $ilCtrl->setParameter($this, "blpg", $sub_id);
             $ilCtrl->setParameter($this, "bmn", $this->month);
             $lg->addCustomCommand($link, "blog_edit");
             // #11868
             if ($sub_id && $this->mayContribute($sub_id)) {
                 $link = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit");
                 $lg->addCustomCommand($link, "blog_edit_posting");
             }
             $ilCtrl->setParameter($this, "prvm", "fsc");
         }
         $ilCtrl->setParameter($this, "ntf", "");
     }
     return $lg;
 }
 function update()
 {
     parent::update();
     $this->tabs_gui->activateTab("wsp");
     $this->tabs_gui->activateSubTab("settings");
 }
 protected function initCreationForms($a_new_type)
 {
     $forms = parent::initCreationForms($a_new_type);
     // disabling import
     unset($forms[self::CFORM_IMPORT]);
     return $forms;
 }
 /**
  * @param string $a_new_type
  *
  * @return array
  */
 protected function initCreationForms($a_new_type)
 {
     $forms = parent::initCreationForms($a_new_type);
     return $forms;
 }
 function executeCommand()
 {
     global $ilCtrl, $tpl, $ilTabs, $ilNavigationHistory;
     $next_class = $ilCtrl->getNextClass($this);
     $cmd = $ilCtrl->getCmd();
     $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, "poll");
     }
     switch ($next_class) {
         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();
             $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("poll");
             $this->ctrl->forwardCommand($cp);
             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");
             $ilCtrl->forwardCommand($exp_gui);
             break;
         default:
             return parent::executeCommand();
     }
     return true;
 }
 protected function setTabs()
 {
     global $ilHelp;
     $ilHelp->setScreenIdComponent("prtt");
     if ($this->checkPermissionBool("write")) {
         $this->tabs_gui->addTab("pages", $this->lng->txt("content"), $this->ctrl->getLinkTarget($this, "view"));
     }
     if ($this->checkPermissionBool("read")) {
         $this->tabs_gui->addTab("id_info", $this->lng->txt("info_short"), $this->ctrl->getLinkTargetByClass(array("ilobjportfoliotemplategui", "ilinfoscreengui"), "showSummary"));
     }
     if ($this->checkPermissionBool("write")) {
         $this->tabs_gui->addTab("settings", $this->lng->txt("settings"), $this->ctrl->getLinkTarget($this, "edit"));
         $this->tabs_gui->addTab("export", $this->lng->txt("export"), $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
     }
     if ($this->checkPermissionBool("read")) {
         $this->tabs_gui->addNonTabbedLink("preview", $this->lng->txt("user_profile_preview"), $this->ctrl->getLinkTarget($this, "preview"));
     }
     // will add permissions if needed
     ilObject2GUI::setTabs();
 }
Beispiel #11
0
 protected function initHeaderAction($a_sub_type = null, $a_sub_id = null)
 {
     $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
     if (is_object($lg)) {
         if ($this->object->hasRating()) {
             $lg->enableRating(true, null, false, array("ilcommonactiondispatchergui", "ilratinggui"));
         }
     }
     return $lg;
 }
 /**
  * get tabs
  * @access	public
  */
 function setTabs()
 {
     global $ilTabs, $lng, $ilHelp;
     $ilHelp->setScreenIdComponent("webr");
     if ($this->checkPermissionBool('read')) {
         $ilTabs->addTab("id_content", $lng->txt("content"), $this->ctrl->getLinkTarget($this, "view"));
     }
     if ($this->checkPermissionBool('visible')) {
         $ilTabs->addTab("id_info", $lng->txt("info_short"), $this->ctrl->getLinkTarget($this, "infoScreen"));
     }
     if ($this->checkPermissionBool('write') and !$this->getCreationMode()) {
         include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
         if (ilLinkResourceItems::lookupNumberOfLinks($this->object->getId()) > 1) {
             $ilTabs->addTab("id_settings", $lng->txt("settings"), $this->ctrl->getLinkTarget($this, "settings"));
         }
     }
     if ($this->checkPermissionBool('write')) {
         $ilTabs->addTab("id_history", $lng->txt("history"), $this->ctrl->getLinkTarget($this, "history"));
     }
     if ($this->checkPermissionBool('write')) {
         // Check if pear library is available
         if (@(include_once 'HTTP/Request.php')) {
             $ilTabs->addTab("id_link_check", $lng->txt("link_check"), $this->ctrl->getLinkTarget($this, "linkChecker"));
         }
     }
     if ($this->checkPermissionBool('write')) {
         $ilTabs->addTab("id_meta_data", $lng->txt("meta_data"), $this->ctrl->getLinkTargetByClass('ilmdeditorgui', 'listSection'));
     }
     if ($this->checkPermissionBool('write')) {
         $ilTabs->addTab('export', $this->lng->txt('export'), $this->ctrl->getLinkTargetByClass('ilexportgui', ''));
     }
     // will add permission tab if needed
     parent::setTabs();
 }
 /**
  * @return bool
  * @throws ilCloudException
  */
 public function executeCommand()
 {
     global $ilCtrl, $ilTabs, $ilNavigationHistory, $lng;
     // Navigation History
     $link = $ilCtrl->getLinkTarget($this, "render");
     try {
         ilCloudConnector::getActiveServices();
     } catch (Exception $e) {
         ilUtil::sendFailure($lng->txt("cld_no_service_active"), true);
         ilObjectGUI::redirectToRefId($this->parent_id);
     }
     if ($this->object != NULL) {
         $ilNavigationHistory->addItem($this->object->getRefId(), $link, "cld");
         try {
             ilCloudConnector::checkServiceActive($this->object->getServiceName());
         } catch (Exception $e) {
             ilUtil::sendFailure($lng->txt("cld_plugin_not_active"), true);
             ilObjectGUI::redirectToRefId($this->parent_id);
         }
         if ($this->object->getAuthComplete() == false && !$_GET["authMode"]) {
             if ($this->checkPermissionBool("write")) {
                 $this->serviceAuth($this->object);
             } else {
                 ilUtil::sendFailure($lng->txt("cld_auth_failed"), true);
                 ilObjectGUI::redirectToRefId($this->parent_id);
             }
         }
         $this->plugin_service = ilCloudConnector::getServiceClass($this->object->getServiceName(), $this->object->getId(), false);
     }
     $next_class = $ilCtrl->getNextClass($this);
     $cmd = $ilCtrl->getCmd($this);
     switch ($cmd) {
         case "editSettings":
             $next_class = "ilcloudpluginsettingsgui";
             break;
         case "afterServiceAuth":
             $this->checkPermission("write");
             $this->{$cmd}();
             return;
         case "render":
             $this->addHeaderAction();
             break;
     }
     switch ($next_class) {
         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();
             $ilTabs->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilcloudpluginuploadgui":
             if ($this->checkPermissionBool("upload")) {
                 $upload_gui = ilCloudConnector::getUploadGUIClass($this->plugin_service);
                 $this->ctrl->forwardCommand($upload_gui);
             }
             break;
         case "ilcloudplugincreatefoldergui":
             if ($this->checkPermissionBool("folders_create")) {
                 $folder_gui = ilCloudConnector::getCreateFolderGUIClass($this->plugin_service);
                 $this->ctrl->forwardCommand($folder_gui);
             }
             break;
         case "ilcloudplugindeletegui":
             if ($this->checkPermissionBool("delete_files") || $this->checkPermissionBool("delete_folders")) {
                 $delete_gui = ilCloudConnector::getDeleteGUIClass($this->plugin_service);
                 $this->ctrl->forwardCommand($delete_gui);
             }
             break;
         case "ilcloudpluginsettingsgui":
             $this->prepareOutput();
             if ($this->checkPermissionBool("write")) {
                 $settings_gui = ilCloudConnector::getSettingsGUIClass($this->plugin_service);
                 $settings_gui->setCloudObject($this->object);
                 $this->ctrl->forwardCommand($settings_gui);
             }
             break;
         case "ilcloudpluginactionlistgui":
             $action_list_gui = ilCloudConnector::getActionListGUIClass($this->plugin_service);
             $this->ctrl->forwardCommand($action_list_gui);
             break;
         case "ilcloudpluginitemcreationlistgui":
             $item_creation_gui = ilCloudConnector::getItemCreationListGUIClass($this->plugin_service);
             $this->ctrl->forwardCommand($item_creation_gui);
             break;
         case "ilcloudpluginfiletreegui":
             $file_tree_gui = ilCloudConnector::getFileTreeGUIClass($this->plugin_service, ilCloudFileTree::getFileTreeFromSession());
             $this->ctrl->forwardCommand($file_tree_gui);
             break;
         case "ilcloudpluginheaderactiongui":
             $header_action_gui = ilCloudConnector::getHeaderActionGUIClass($this->plugin_service);
             $this->ctrl->forwardCommand($header_action_gui);
             break;
         case "ilcloudplugininitgui":
             $init_gui = ilCloudConnector::getInitGUIClass($this->plugin_service);
             $this->ctrl->forwardCommand($init_gui);
             break;
         default:
             return parent::executeCommand();
     }
     return true;
 }
 /**
  * Save taxonomy
  *
  * @param
  * @return
  */
 function save()
 {
     global $ilCtrl;
     if ($this->getAssignedObject() > 0) {
         $_REQUEST["new_type"] = "tax";
     }
     parent::saveObject();
 }
 public function initEditForm()
 {
     global $lng;
     $form = parent::initEditForm();
     // Add File-Upload
     $in_file = new ilFileInputGUI($lng->txt("bibliography file"), "bibliographic_file");
     $in_file->setSuffixes(array("ris", "bib", "bibtex"));
     $in_file->setRequired(false);
     $cb_override = new ilCheckboxInputGUI($this->lng->txt("override_entries"), "override_entries");
     $cb_override->addSubItem($in_file);
     $form->addItem($cb_override);
     $form->setFormAction($this->ctrl->getFormAction($this, "save"));
     return $form;
 }
 function setTabs()
 {
     global $ilTabs, $lng, $ilHelp;
     $ilHelp->setScreenIdComponent("file");
     $this->ctrl->setParameter($this, "ref_id", $this->node_id);
     if ($this->checkPermissionBool("visible")) {
         $ilTabs->addTab("id_info", $lng->txt("info_short"), $this->ctrl->getLinkTargetByClass(array("ilobjfilegui", "ilinfoscreengui"), "showSummary"));
     }
     if ($this->checkPermissionBool("write")) {
         $ilTabs->addTab("settings", $lng->txt("edit"), $this->ctrl->getLinkTarget($this, "edit"));
     }
     if ($this->checkPermissionBool("write")) {
         $ilTabs->addTab("id_versions", $lng->txt("versions"), $this->ctrl->getLinkTarget($this, "versions"));
     }
     // meta data
     if ($this->checkPermissionBool("write")) {
         $ilTabs->addTab("id_meta", $lng->txt("meta_data"), $this->ctrl->getLinkTargetByClass(array('ilobjfilegui', 'ilmdeditorgui'), 'listSection'));
     }
     // export
     if ($this->checkPermissionBool("write")) {
         $ilTabs->addTab("export", $lng->txt("export"), $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
     }
     // will add permission tab if needed
     parent::setTabs();
 }