/**
  * create question pool object
  */
 function create($a_upload = false)
 {
     parent::create();
     if (!$a_upload) {
         $this->createMetaData();
     }
 }
 /**
  * create object
  * 
  * @param bool upload mode (if enabled no meta data will be created)
  */
 function create($a_upload = false)
 {
     $new_id = parent::create();
     if (!$a_upload) {
         $this->createMetaData();
     }
     return $new_id;
 }
Exemplo n.º 3
0
 /**
  * create file based lm
  */
 function create()
 {
     global $ilDB;
     parent::create();
     $this->createDataDirectory();
     $ilDB->manipulate("INSERT INTO file_based_lm (id, is_online, startfile) VALUES " . " (" . $ilDB->quote($this->getID(), "integer") . "," . $ilDB->quote("n", "text") . "," . $ilDB->quote($this->getStartfile(), "text") . ")");
     $this->createMetaData();
 }
 /**
  * create questionpool object
  */
 function create($a_upload = false)
 {
     parent::create();
     // meta data will be created by
     // import parser
     if (!$a_upload) {
         $this->createMetaData();
     }
 }
 /**
  * create object
  * @return	integer
  */
 function create()
 {
     global $ilDB;
     $new_id = parent::create();
     $fields = $this->getDBFields();
     $fields["booking_pool_id"] = array("integer", $new_id);
     $ilDB->insert("booking_settings", $fields);
     return $new_id;
 }
 /**
  * create content object
  */
 function create($a_no_meta_data = false)
 {
     global $ilUser;
     parent::create();
     // meta data will be created by
     // import parser
     if (!$a_no_meta_data) {
         $this->createMetaData();
     }
     $this->createProperties();
 }
    /**
     * create file based lm
     */
    function create($upload = false)
    {
        global $ilDB;
        parent::create();
        if (!$upload) {
            $this->createMetaData();
        }
        $this->createDataDirectory();
        $ilDB->manipulateF('
			INSERT INTO sahs_lm (id, c_online, api_adapter, c_type, editable, seq_exp_mode,localization) 
			VALUES (%s,%s,%s,%s,%s,%s,%s)', array('integer', 'text', 'text', 'text', 'integer', 'integer', 'text'), array($this->getId(), 'n', 'API', $this->getSubType(), (int) $this->getEditable(), (int) $this->getSequencingExpertMode(), $this->getLocalization()));
    }
Exemplo n.º 8
0
 /**
  * @return int
  */
 public function create()
 {
     $id = parent::create();
     require_once 'Modules/Forum/classes/class.ilForumProperties.php';
     $properties = ilForumProperties::getInstance($this->getId());
     $properties->setDefaultView(1);
     $properties->setAnonymisation(0);
     $properties->setStatisticsStatus(0);
     $properties->setPostActivation(0);
     $properties->setThreadSorting(0);
     $properties->insert();
     $this->createSettings();
     $this->saveData();
     return $id;
 }
Exemplo n.º 9
0
 /**
  * create glossary object
  */
 function create($a_upload = false)
 {
     global $ilDB;
     parent::create();
     // meta data will be created by
     // import parser
     if (!$a_upload) {
         $this->createMetaData();
     }
     $ilDB->manipulate("INSERT INTO glossary (id, is_online, virtual, pres_mode, snippet_length) VALUES (" . $ilDB->quote($this->getId(), "integer") . "," . $ilDB->quote("n", "text") . "," . $ilDB->quote($this->getVirtualMode(), "text") . "," . $ilDB->quote("table", "text") . "," . $ilDB->quote(200, "integer") . ")");
     $this->setPresentationMode("table");
     $this->setSnippetLength(200);
     if ((int) $this->getStyleSheetId() > 0) {
         include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
         ilObjStyleSheet::writeStyleUsage($this->getId(), $this->getStyleSheetId());
     }
 }
Exemplo n.º 10
0
 /**
  * create
  *
  *
  * @access	public
  * @return	integer		object id
  */
 function create()
 {
     global $ilDB;
     $this->id = parent::create();
     $query = "INSERT INTO role_data " . "(role_id,allow_register,assign_users,disk_quota,wsp_disk_quota) " . "VALUES " . "(" . $ilDB->quote($this->id, 'integer') . "," . $ilDB->quote($this->getAllowRegister(), 'integer') . "," . $ilDB->quote($this->getAssignUsersStatus(), 'integer') . "," . $ilDB->quote($this->getDiskQuota(), 'integer') . "," . $ilDB->quote($this->getPersonalWorkspaceDiskQuota(), 'integer') . ")";
     $res = $ilDB->query($query);
     return $this->id;
 }
Exemplo n.º 11
0
 /**
  * Create mew media cast
  */
 function create()
 {
     global $ilDB;
     parent::create();
     $query = "INSERT INTO il_media_cast_data (" . " id" . ", is_online" . ", public_files" . ", downloadable" . ", def_access" . ", sortmode" . ", viewmode" . " ) VALUES (" . $ilDB->quote($this->getId(), "integer") . "," . $ilDB->quote((int) $this->getOnline(), "integer") . "," . $ilDB->quote((int) $this->getPublicFiles(), "integer") . "," . $ilDB->quote((int) $this->getDownloadable(), "integer") . "," . $ilDB->quote((int) $this->getDefaultAccess(), "integer") . "," . $ilDB->quote((int) $this->getOrder(), "integer") . "," . $ilDB->quote((int) $this->getViewMode(), "text") . ")";
     $ilDB->manipulate($query);
 }
Exemplo n.º 12
0
 /**
  * create style from xml file
  */
 function createFromXMLFile($a_file, $a_skip_parent_create = false)
 {
     global $ilDB;
     $this->is_3_10_skin = false;
     if (!$a_skip_parent_create) {
         parent::create();
     }
     include_once "./Services/Style/classes/class.ilStyleImportParser.php";
     $importParser = new ilStyleImportParser($a_file, $this);
     $importParser->startParsing();
     // store style parameter
     foreach ($this->style as $style) {
         foreach ($style as $tag) {
             $id = $ilDB->nextId("style_parameter");
             // migrate old table PageFrame/PageContainer to div
             if (in_array($tag["class"], array("PageFrame", "PageContainer")) && $tag["tag"] == "table") {
                 $tag["tag"] = "div";
                 if ($tag["parameter"] == "width" && $tag["value"] == "100%") {
                     continue;
                 }
             }
             $q = "INSERT INTO style_parameter (id,style_id, tag, class, parameter, type, value) VALUES " . "(" . $ilDB->quote($id, "integer") . "," . $ilDB->quote($this->getId(), "integer") . "," . $ilDB->quote($tag["tag"], "text") . "," . $ilDB->quote($tag["class"], "text") . "," . $ilDB->quote($tag["parameter"], "text") . "," . $ilDB->quote($tag["type"], "text") . "," . $ilDB->quote($tag["value"], "text") . ")";
             //echo "<br>-$q";
             $ilDB->manipulate($q);
         }
     }
     // store characteristics
     $this->is_3_10_skin = true;
     if (is_array($this->chars)) {
         foreach ($this->chars as $char) {
             if ($char["type"] != "") {
                 $s = substr($char["class"], strlen($char["class"]) - 6);
                 if ($s != ":hover") {
                     $q = "INSERT INTO style_char (style_id, type, characteristic) VALUES " . "(" . $ilDB->quote($this->getId(), "integer") . "," . $ilDB->quote($char["type"], "text") . "," . $ilDB->quote($char["class"], "text") . ")";
                     $ilDB->manipulate($q);
                     $this->is_3_10_skin = false;
                 }
             }
         }
     }
     // add style_data record
     $q = "INSERT INTO style_data (id, uptodate) VALUES " . "(" . $ilDB->quote($this->getId(), "integer") . ", 0)";
     $ilDB->manipulate($q);
     $this->update();
     $this->read();
     if ($this->is_3_10_skin) {
         $this->do_3_10_Migration();
     }
     //$this->writeCSSFile();
 }
 /**
  * create
  *
  * note: title, description and type should be set when this function is called
  *
  * @return	integer		object id
  */
 public function create()
 {
     parent::create();
     $this->write();
 }
Exemplo n.º 14
0
 /**
  * create media object in db
  */
 function create($a_create_meta_data = false, $a_save_media_items = true)
 {
     parent::create();
     if (!$a_create_meta_data) {
         $this->createMetaData();
     }
     if ($a_save_media_items) {
         $media_items =& $this->getMediaItems();
         for ($i = 0; $i < count($media_items); $i++) {
             $item =& $media_items[$i];
             $item->setMobId($this->getId());
             $item->setNr($i + 1);
             $item->create();
         }
     }
     self::handleQuotaUpdate($this);
 }
 /**
  * create new media pool
  */
 function create()
 {
     global $ilDB;
     parent::create();
     $ilDB->manipulate("INSERT INTO mep_data " . "(id, default_width, default_height) VALUES (" . $ilDB->quote($this->getId(), "integer") . ", " . $ilDB->quote($this->getDefaultWidth(), "integer") . ", " . $ilDB->quote($this->getDefaultHeight(), "integer") . ")");
     $this->createMepTree();
 }
Exemplo n.º 16
0
 final function create($a_clone_mode = false)
 {
     if ($this->beforeCreate()) {
         $id = parent::create();
         if ($id) {
             $this->doCreate($a_clone_mode);
             return $id;
         }
     }
 }
Exemplo n.º 17
0
 public function testTreeTrash()
 {
     global $tree;
     $obj = new ilObject();
     $obj->setType("xxx");
     $obj->setTitle("TestObject");
     $obj->setDescription("TestDescription");
     $obj->setImportId("imp_44");
     $obj->create();
     $obj->createReference();
     $id = $obj->getId();
     $ref_id = $obj->getRefId();
     $obj = new ilObject($ref_id);
     $obj->putInTree(ROOT_FOLDER_ID);
     $obj->createRoleFolder();
     $obj->setPermissions(ROOT_FOLDER_ID);
     if ($tree->isInTree($ref_id)) {
         $value .= "tree1-";
     }
     if (ilObject::_hasUntrashedReference($id)) {
         $value .= "tree2-";
     }
     // isSaved() uses internal cache!
     $tree->useCache(false);
     $tree->saveSubTree($ref_id, true);
     if ($tree->isDeleted($ref_id)) {
         $value .= "tree3-";
     }
     if ($tree->isSaved($ref_id)) {
         $value .= "tree4-";
     }
     if (ilObject::_isInTrash($ref_id)) {
         $value .= "tree5-";
     }
     if (!ilObject::_hasUntrashedReference($id)) {
         $value .= "tree6-";
     }
     $saved_tree = new ilTree(-(int) $ref_id);
     $node_data = $saved_tree->getNodeData($ref_id);
     $saved_tree->deleteTree($node_data);
     if (!ilObject::_isInTrash($ref_id)) {
         $value .= "tree7-";
     }
     $obs = ilUtil::_getObjectsByOperations("cat", "read");
     foreach ($obs as $ob) {
         if (ilObject::_lookupType(ilObject::_lookupObjId($ob)) != "cat") {
             $value .= "nocat-";
         }
     }
     $obj->delete();
     $this->assertEquals("tree1-tree2-tree3-tree4-tree5-tree6-tree7-", $value);
 }
Exemplo n.º 18
0
 /**
  * Create new wiki
  */
 function create($a_prevent_start_page_creation = false)
 {
     global $ilDB;
     parent::create();
     $ilDB->insert("il_wiki_data", array("id" => array("integer", $this->getId()), "is_online" => array("integer", (int) $this->getOnline()), "startpage" => array("text", $this->getStartPage()), "short" => array("text", $this->getShortTitle()), "rating" => array("integer", (int) $this->getRating()), "public_notes" => array("integer", (int) $this->getPublicNotes()), "introduction" => array("clob", $this->getIntroduction()), "empty_page_templ" => array("integer", (int) $this->getEmptyPageTemplate())));
     // create start page
     if ($this->getStartPage() != "" && !$a_prevent_start_page_creation) {
         include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
         $start_page = new ilWikiPage();
         $start_page->setWikiId($this->getId());
         $start_page->setTitle($this->getStartPage());
         $start_page->create();
     }
     if ((int) $this->getStyleSheetId() > 0) {
         include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
         ilObjStyleSheet::writeStyleUsage($this->getId(), $this->getStyleSheetId());
     }
 }
Exemplo n.º 19
0
 /**
  * create media object in db
  */
 function create($a_create_meta_data = false, $a_save_media_items = true)
 {
     parent::create();
     if (!$a_create_meta_data) {
         $this->createMetaData();
     }
     if ($a_save_media_items) {
         $media_items =& $this->getMediaItems();
         for ($i = 0; $i < count($media_items); $i++) {
             $item =& $media_items[$i];
             $item->setMobId($this->getId());
             $item->setNr($i + 1);
             $item->create();
         }
     }
     self::handleQuotaUpdate($this);
     global $ilAppEventHandler;
     $ilAppEventHandler->raise('Services/MediaObjects', 'create', array('object' => $this, 'obj_type' => 'mob', 'obj_id' => $this->getId()));
 }
Exemplo n.º 20
0
 /**
  * Create
  */
 function create()
 {
     $ret = parent::create();
     if ((int) $this->getStyleSheetId() > 0) {
         include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
         ilObjStyleSheet::writeStyleUsage($this->getId(), $this->getStyleSheetId());
     }
     return $ret;
 }
Exemplo n.º 21
0
 /**	
  * Creates a dav null object as a child of this object.
  * null objects are used for locking names.
  *
  * @param	string		the name of the null object.
  * @return	ilObjectDAV	returns the created object, or null if creation failed.
  */
 function createNull($name)
 {
     global $tree;
     // create and insert Folder in tree
     require_once './Services/Object/classes/class.ilObject.php';
     $newObj = new ilObject(0);
     $newObj->setType('null');
     $newObj->setTitle($name);
     $newObj->create();
     $newObj->createReference();
     $newObj->setPermissions($this->getRefId());
     $newObj->putInTree($this->getRefId());
     require_once 'class.ilObjNullDAV.php';
     $objDAV = new ilObjNullDAV($newObj->getRefId(), $newObj);
     return $objDAV;
 }
Exemplo n.º 22
0
 /**
  * create new session
  *
  * @access public
  */
 public function create()
 {
     global $ilDB;
     global $ilAppEventHandler;
     parent::create();
     $next_id = $ilDB->nextId('event');
     $query = "INSERT INTO event (event_id,obj_id,location,tutor_name,tutor_phone,tutor_email,details,registration) " . "VALUES( " . $ilDB->quote($next_id, 'integer') . ", " . $this->db->quote($this->getId(), 'integer') . ", " . $this->db->quote($this->getLocation(), 'text') . "," . $this->db->quote($this->getName(), 'text') . ", " . $this->db->quote($this->getPhone(), 'text') . ", " . $this->db->quote($this->getEmail(), 'text') . ", " . $this->db->quote($this->getDetails(), 'text') . "," . $this->db->quote($this->enabledRegistration(), 'integer') . " " . ")";
     $res = $ilDB->manipulate($query);
     $this->event_id = $next_id;
     $ilAppEventHandler->raise('Modules/Session', 'create', array('object' => $this, 'obj_id' => $this->getId(), 'appointments' => $this->prepareCalendarAppointments('create')));
     return $this->getId();
 }
 /**
  * create object
  * 
  * @param bool upload mode (if enabled no entries in file_data will be done)
  */
 function create()
 {
     return parent::create();
 }