示例#1
0
 /**
  * Update plugin
  */
 final function update()
 {
     global $ilDB, $ilCtrl;
     ilCachedComponentData::flush();
     $result = $this->beforeUpdate();
     if ($result === false) {
         return false;
     }
     // DB update
     if ($result === true) {
         $result = $this->updateDatabase();
     }
     // Load language files
     $this->updateLanguages();
     // load control structure
     include_once "./setup/classes/class.ilCtrlStructureReader.php";
     $structure_reader = new ilCtrlStructureReader();
     $structure_reader->readStructure(true, "./" . $this->getDirectory(), $this->getPrefix(), $this->getDirectory());
     //		$ilCtrl->storeCommonStructures();
     // add config gui to the ctrl calls
     $ilCtrl->insertCtrlCalls("ilobjcomponentsettingsgui", ilPlugin::getConfigureClassName($this->getPluginName()), $this->getPrefix());
     // set last update version to current version
     if ($result === true) {
         $q = "UPDATE il_plugin SET last_update_version = " . $ilDB->quote($this->getVersion(), "text") . " WHERE component_type = " . $ilDB->quote($this->getComponentType(), "text") . " AND component_name = " . $ilDB->quote($this->getComponentName(), "text") . " AND slot_id = " . $ilDB->quote($this->getSlotId(), "text") . " AND name = " . $ilDB->quote($this->getPluginName(), "text");
         $ilDB->manipulate($q);
         $this->afterUpdate();
     }
     return $result;
 }