25 include_once(
"./Services/Component/classes/class.ilComponent.php");
123 $this->lastupdateversion = $a_lastupdateversion;
133 return $this->lastupdateversion;
143 $this->version = $a_version;
153 return $this->version;
163 $this->iliasminversion = $a_iliasminversion;
173 return $this->iliasminversion;
183 $this->iliasmaxversion = $a_iliasmaxversion;
193 return $this->iliasmaxversion;
203 $this->active = $a_active;
213 return $this->active;
223 $this->slot = $a_slot;
243 $this->dbversion = $a_dbversion;
253 return $this->dbversion;
267 $q =
"UPDATE il_plugin SET db_version = ".$ilDB->quote($this->
getDBVersion()).
270 " AND slot_id = ".$ilDB->quote($this->
getSlotId()).
322 if (!@is_dir($a_lang_directory))
327 $dir = opendir($a_lang_directory);
334 if (@is_file($a_lang_directory.
"/".
$file))
336 if (substr(
$file, 0, 6) ==
"ilias_" &&
339 $langs[] = array(
"key" => substr(
$file, 6, 2),
"file" =>
$file,
340 "path" => $a_lang_directory.
"/".
$file);
364 return "Customizing/global/plugins/".$a_ctype.
"/".$a_cname.
"/".
365 $a_slot_name.
"/".$a_pname.
"/sql/dbupdate.php";
373 return "il_".$this->getPrefix();
383 include_once(
"./Services/Language/classes/class.ilObjLanguage.php");
389 foreach($langs as
$lang)
392 $lang_array = array();
397 foreach ($txt as $row)
399 if ($row[0] !=
"#" && strpos($row,
"#:#") > 0)
401 $a = explode(
"#:#",trim($row));
402 $lang_array[$prefix.
"_".trim($a[0])] = trim($a[1]);
419 include_once(
"./Services/Component/classes/class.ilPluginDBUpdate.php");
427 $result = $dbupdate->applyUpdate();
429 if ($dbupdate->updateMsg ==
"no_changes")
431 $message = $lng->txt(
"no_changes").
". ".$lng->txt(
"database_is_uptodate");
435 foreach ($dbupdate->updateMsg as $row)
437 $message .= $lng->txt($row[
"msg"]).
": ".$row[
"nr"].
"<br/>";
441 $this->message.= $message;
453 $lng->loadLanguageModule($this->
getPrefix());
459 public final function txt($a_var)
462 return $lng->txt($this->
getPrefix().
"_".$a_var);
468 public final function getTemplate($a_template, $a_par1 =
true, $a_par2 =
true)
486 public final function addBlockFile($a_tpl, $a_var, $a_block, $a_tplname)
488 $a_tpl->addBlockFile($a_var, $a_block,
495 static final public function getPluginRecord($a_ctype, $a_cname, $a_slot_id, $a_pname)
500 $q =
"SELECT * FROM il_plugin".
501 " WHERE component_type = ".$ilDB->quote($a_ctype).
502 " AND component_name = ".$ilDB->quote($a_cname).
503 " AND slot_id = ".$ilDB->quote($a_slot_id).
504 " AND name = ".$ilDB->quote($a_pname);
505 $set = $ilDB->query($q);
512 $q =
"INSERT INTO il_plugin (component_type, component_name, slot_id, name)".
513 " VALUES (".$ilDB->quote($a_ctype).
",".
514 $ilDB->quote($a_cname).
",".
515 $ilDB->quote($a_slot_id).
",".
516 $ilDB->quote($a_pname).
")";
518 $q =
"SELECT * FROM il_plugin".
519 " WHERE component_type = ".$ilDB->quote($a_ctype).
520 " AND component_name = ".$ilDB->quote($a_cname).
521 " AND slot_id = ".$ilDB->quote($a_slot_id).
522 " AND name = ".$ilDB->quote($a_pname);
523 $set = $ilDB->query($q);
533 global $ilDB,
$lng, $ilPluginAdmin;
543 $this->
setId($ilPluginAdmin->getId($this->getComponentType(),
549 $this->
setVersion($ilPluginAdmin->getVersion($this->getComponentType(),
555 $this->
setIliasMinVersion($ilPluginAdmin->getIliasMinVersion($this->getComponentType(),
561 $this->
setIliasMaxVersion($ilPluginAdmin->getIliasMaxVersion($this->getComponentType(),
571 $lng->loadLanguageModule($this->
getPrefix());
584 abstract protected function slotInit();
599 global $ilPluginAdmin;
610 global $ilPluginAdmin;
628 $result = $this->isUpdatePossible();
640 $q =
"UPDATE il_plugin SET active = 1".
643 " AND slot_id = ".$ilDB->quote($this->
getSlotId()).
659 $q =
"UPDATE il_plugin SET active = 0".
662 " AND slot_id = ".$ilDB->quote($this->
getSlotId()).
690 include_once(
"./classes/class.ilCtrlStructureReader.php");
694 $ilCtrl->storeCommonStructures();
699 $q =
"UPDATE il_plugin SET last_update_version = ".$ilDB->quote($this->
getVersion()).
702 " AND slot_id = ".$ilDB->quote($this->
getSlotId()).
723 include_once(
"./Services/Component/classes/class.ilPluginSlot.php");
727 $set = $ilDB->query(
"SELECT * FROM il_component WHERE type = ".
728 $ilDB->quote($a_ctype).
" AND name = ".$ilDB->quote($a_cname));
729 if ($set->numRows() == 0)
734 $file =
"./Customizing/global/plugins/".$a_ctype.
"/".
735 $a_cname.
"/".$slot_name.
"/".
736 $a_pname.
"/classes/class.il".$a_pname.
"Plugin.php";
741 $class =
"il".$a_pname.
"Plugin";
742 $plugin =
new $class();
757 $q =
"SELECT * FROM il_plugin WHERE ".
758 " component_type = ".$ilDB->quote($a_ctype).
" AND ".
759 " component_name = ".$ilDB->quote($a_cname).
" AND ".
760 " slot_id = ".$ilDB->quote($a_slot_id).
" AND ".
761 " name = ".$ilDB->quote($a_pname);
763 $set = $ilDB->query($q);
775 global $ilDB, $ilPluginAdmin;
777 $q =
"SELECT * FROM il_plugin WHERE component_type = ".$ilDB->quote($a_ctype).
778 " AND component_name = ".$ilDB->quote($a_cname).
779 " AND slot_id = ".$ilDB->quote($a_slot_id).
782 $set = $ilDB->query($q);
786 if ($ilPluginAdmin->isActive($a_ctype, $a_cname, $a_slot_id, $rec[
"name"]))
788 $plugins[] = $rec[
"name"];