/** Add a new item to tree db.
  *	@param int $idParent the id of the container folder
  *	@param string $title title of the item
  *	@param string $objectType type of the lo item
  *	@param int $idResource id of the resource
  *	@param int $idCategory id of the category
  *	@param int $idUser owner's id of the item
  *	@param int $idAuthor author's id of the content
  *	@param string $version version of the item
  *	@param string $difficult the level of difficult of the item
  *	@param string $description description of the item
  *	@param string $language language of the item
  *	@param string $resource web address from ....
  *	@param string $objective the item's objective
  *	@param string $dateInsert the insert date
  *  @param array $otherData other parameters for repo extensions
  **/
 function addItem($idParent, $title, $objectType, $idResource, $idCategory, $idUser, $idAuthor, $version, $difficult, $description, $language, $resource, $objective, $dateInsert, $otherData = NULL)
 {
     $this->org_title = $title;
     $this->org_objectType = $objectType;
     $this->org_idResource = $idResource;
     $this->org_idCategory = $idCategory;
     $this->org_idUser = $idUser;
     $this->org_idAuthor = $idAuthor;
     $this->org_version = $version;
     $this->org_difficult = $difficult;
     $this->org_description = $description;
     $this->org_language = $language;
     $this->org_resource = $resource;
     $this->org_objective = $objective;
     $this->org_dateInsert = $dateInsert;
     $idReference = parent::addFolderById($idParent, addslashes($title));
     return $idReference;
 }
Ejemplo n.º 2
0
 function addItem($idParent, $org_name)
 {
     $idReference = parent::addFolderById($idParent, $org_name);
     return $idReference;
 }
Ejemplo n.º 3
0
 function addItem($idParent, $title, $objectType, $idResource, $idCategory, $idUser, $idAuthor, $version, $difficult, $description, $language, $resource, $objective, $dateInsert, $otherData = NULL, $idCourse = FALSE)
 {
     require_once $GLOBALS['where_lms'] . '/lib/lib.param.php';
     $this->org_title = $title;
     $this->org_objectType = $objectType;
     $this->org_idResource = $idResource;
     $this->org_idCategory = $idCategory;
     $this->org_idUser = $idUser;
     $this->org_idAuthor = $idAuthor;
     $this->org_version = $version;
     $this->org_difficult = $difficult;
     $this->org_description = $description;
     $this->org_language = $language;
     $this->org_resource = $resource;
     $this->org_objective = $objective;
     $this->org_dateInsert = $dateInsert;
     $this->org_prerequisites = '';
     $this->org_isTerminator = 0;
     $this->org_visible = 1;
     if ($idCourse === FALSE) {
         $this->org_idCourse = $this->idCourse;
     } else {
         $this->org_idCourse = $idCourse;
     }
     require_once _lms_ . '/lib/lib.module.php';
     $lo = createLO($objectType);
     if ($lo) {
         // Add object to the uncategorized resources
         require_once _lms_ . '/lib/lib.kbres.php';
         $kbres = new KbRes();
         $lang = isset($_SESSION['idCourse']) && defined("LMS") ? Docebo::course()->getValue('lang_code') : false;
         $kbres->saveUncategorizedResource($title, $idResource, $objectType, 'course_lo', $this->org_idCourse, false, $lang);
     }
     $arrParamsInfo = $lo->getParamInfo();
     if ($arrParamsInfo !== FALSE) {
         $param = current($arrParamsInfo);
         $this->org_idParam = setLOParam(NULL, $param['param_name'], '');
         next($arrParamsInfo);
         while ($param = current($arrParamsInfo)) {
             setLOParam($this->org_idParam, $param['param_name'], '');
             next($arrParamsInfo);
         }
         reset($arrParamsInfo);
     } else {
         $this->org_idParam = setLOParam(NULL, 'idReference', '');
     }
     $idReference = TreeDb::addFolderById($idParent, $this->getNewPos($idParent));
     setLOParam($this->org_idParam, 'idReference', $idReference);
     return $idReference;
 }