/**
  * Gets a value indicating whether file uploads to this object are allowed or not.
  *
  * @return bool true, if file upload is allowed; otherwise, false.
  */
 public function isFileUploadAllowed()
 {
     // check if file upload allowed
     include_once "./Services/FileUpload/classes/class.ilFileUploadUtil.php";
     return ilFileUploadUtil::isUploadAllowed($this->ref_id, $this->type);
 }
Example #2
0
 /**
  * prepare output
  */
 protected function prepareOutput()
 {
     global $ilLocator, $tpl, $ilUser;
     $this->tpl->getStandardTemplate();
     // administration prepare output
     if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
         $this->addAdminLocatorItems();
         $tpl->setLocator();
         //			ilUtil::sendInfo();
         ilUtil::infoPanel();
         $this->setTitleAndDescription();
         if ($this->getCreationMode() != true) {
             $this->setAdminTabs();
         }
         return false;
     }
     // set locator
     $this->setLocator();
     // catch feedback message
     //		ilUtil::sendInfo();
     ilUtil::infoPanel();
     // in creation mode (parent) object and gui object
     // do not fit
     if ($this->getCreationMode() == true) {
         // repository vs. workspace
         if ($this->call_by_reference) {
             // get gui class of parent and call their title and description method
             $obj_type = ilObject::_lookupType($_GET["ref_id"], true);
             $class_name = $this->objDefinition->getClassName($obj_type);
             $class = strtolower("ilObj" . $class_name . "GUI");
             $class_path = $this->ctrl->lookupClassPath($class);
             include_once $class_path;
             $class_name = $this->ctrl->getClassForClasspath($class_path);
             //echo "<br>instantiating parent for title and description";
             $this->parent_gui_obj = new $class_name("", $_GET["ref_id"], true, false);
             // the next line prevents the header action menu being shown
             $this->parent_gui_obj->setCreationMode(true);
             $this->parent_gui_obj->setTitleAndDescription();
         }
     } else {
         // set title and description and title icon
         $this->setTitleAndDescription();
         // set tabs
         $this->setTabs();
         // BEGIN WebDAV: Display Mount Webfolder icon.
         require_once 'Services/WebDAV/classes/class.ilDAVServer.php';
         if (ilDAVServer::_isActive() && $ilUser->getId() != ANONYMOUS_USER_ID) {
             $this->showMountWebfolderIcon();
         }
         // END WebDAV: Display Mount Webfolder icon.
         // fileupload support
         require_once './Services/FileUpload/classes/class.ilFileUploadUtil.php';
         if (ilFileUploadUtil::isUploadAllowed($this->ref_id, $this->object->getType())) {
             $this->enableDragDropFileUpload();
         }
     }
     return true;
 }
 private function getUploadUrl()
 {
     global $ilCtrl;
     // return null when the form is used
     if ($this->use_form) {
         return null;
     }
     // check if supported
     if (!ilFileUploadUtil::isUploadSupported()) {
         return false;
     }
     // build upload URL
     include_once "Modules/File/classes/class.ilObjFileGUI.php";
     $ilCtrl->setParameterByClass(self::FILE_OBJ_GUI_CLASS, "ref_id", $this->ref_id);
     $ilCtrl->setParameterByClass(self::FILE_OBJ_GUI_CLASS, "new_type", "file");
     return $ilCtrl->getFormActionByClass(self::FILE_OBJ_GUI_CLASS, "uploadFiles", "", true, false);
 }