139        $this->lastupdateversion = $a_lastupdateversion;
 
  159        $this->version = $a_version;
 
  177        $this->iliasminversion = $a_iliasminversion;
 
  195        $this->iliasmaxversion = $a_iliasmaxversion;
 
  215        $this->active = $a_active;
 
  233        $this->slot = $a_slot;
 
  251        $this->dbversion = $a_dbversion;
 
  274        $q = 
"UPDATE il_plugin SET db_version = " . 
$ilDB->quote((
int) $this->
getDBVersion(), 
"integer") .
 
  280        $ilDB->manipulate($q);
 
  298    public static function _getDirectory(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_pname) : string
 
  338        if (!@is_dir($a_lang_directory)) {
 
  342        $dir = opendir($a_lang_directory);
 
  343        while ($file = readdir($dir)) {
 
  348                if (@is_file($a_lang_directory . 
"/" . $file)) {
 
  349                    if (substr($file, 0, 6) == 
"ilias_" 
  350                        && substr($file, strlen($file) - 5) == 
".lang" 
  352                        $langs[] = array(
"key" => substr($file, 6, 2), 
"file" => $file,
 
  353                                         "path" => $a_lang_directory . 
"/" . $file);
 
  372    public static function hasConfigureClass(
string $a_slot_dir, array $plugin_data, array $plugin_db_data) : bool
 
  379            if (is_file($a_slot_dir . 
"/" . $plugin_data[
"name"] . 
"/classes/class.il" . $plugin_data[
"name"] . 
"ConfigGUI.php")) {
 
  397        return "il" . $plugin_data[
"name"] . 
"ConfigGUI";
 
  418    public static function getDBUpdateScriptName(
string $a_ctype, 
string $a_cname, 
string $a_slot_name, 
string $a_pname) : string
 
  420        return "Customizing/global/plugins/" . $a_ctype . 
"/" . $a_cname . 
"/" .
 
  421            $a_slot_name . 
"/" . $a_pname . 
"/sql/dbupdate.php";
 
  441        ilGlobalCache::flushAll();
 
  444        if (!isset($a_lang_keys)) {
 
  445            $a_lang_keys = array();
 
  447                if ($langObj->isInstalled()) {
 
  448                    $a_lang_keys[] = $langObj->getKey();
 
  457        foreach ($langs as 
$lang) {
 
  459            if (!in_array(
$lang[
'key'], $a_lang_keys)) {
 
  464            $lang_array = array();
 
  470            if (is_array(
$txt)) {
 
  472                    if (
$row[0] != 
"#" && strpos(
$row, 
"#:#") > 0) {
 
  473                        $a = explode(
"#:#", trim(
$row));
 
  474                        $identifier = $prefix . 
"_" . trim($a[0]);
 
  475                        $value = trim($a[1]);
 
  477                        if (isset($local_changes[$identifier])) {
 
  478                            $lang_array[$identifier] = $local_changes[$identifier];
 
  480                            $lang_array[$identifier] = $value;
 
  488            ilObjLanguage::replaceLangModule(
$lang[
"key"], $prefix, $lang_array);
 
  502        ilGlobalCache::flushAll();
 
  514        $result = $dbupdate->applyUpdate();
 
  516        if ($dbupdate->updateMsg == 
"no_changes") {
 
  517            $message = 
$lng->txt(
"no_changes") . 
". " . 
$lng->txt(
"database_is_uptodate");
 
  519            foreach ($dbupdate->updateMsg as 
$row) {
 
  525        ilGlobalCache::flushAll();
 
  539        if (!$this->lang_initialised && is_object(
$lng)) {
 
  541            $this->lang_initialised = 
true;
 
  549    public function txt(
string $a_var) : string
 
  566    public static function lookupTxt(
string $a_mod_prefix, 
string $a_pl_id, 
string $a_lang_var) : string
 
  572        $prefix = $a_mod_prefix . 
"_" . $a_pl_id;
 
  574        return $lng->txt($prefix . 
"_" . $a_lang_var, $prefix);
 
  586    public static function langExitsById(
string $pluginId, 
string $langVar) : bool
 
  592        $pl->loadLanguageModule();
 
  594        return $lng->exists($pl->getPrefix() . 
"_" . $langVar);
 
  622    public static function _getImagePath(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_pname, 
string $a_img) : string
 
  628        if (is_int(strpos(
$img, 
"Customizing"))) {
 
  634        return $d . 
"/templates/images/" . $a_img;
 
  664        if (is_int(strpos($css, 
"Customizing"))) {
 
  668        return $this->
getDirectory() . 
"/templates/" . $a_css_file;
 
  677        $a_tpl->addBlockFile(
 
  693    public static function createPluginRecord(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_pname)
 
  700        $q = 
"INSERT INTO il_plugin (component_type, component_name, slot_id, name)" .
 
  701            " VALUES (" . 
$ilDB->quote($a_ctype, 
"text") . 
"," .
 
  702            $ilDB->quote($a_cname, 
"text") . 
"," .
 
  703            $ilDB->quote($a_slot_id, 
"text") . 
"," .
 
  704            $ilDB->quote($a_pname, 
"text") . 
")";
 
  706        $ilDB->manipulate($q);
 
  719    public static function getPluginRecord(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_pname) : array
 
  722        $rec = $cached_component->lookupPluginByName($a_pname);
 
  724        if ($rec[
'component_type'] == $a_ctype and $rec[
'component_name'] == $a_cname and $rec[
'slot_id'] == $a_slot_id) {
 
  727            throw new ilPluginException(
"No plugin record found for '{$a_ctype}', '{$a_cname}', '{$a_slot_id}', '{$a_pname}");
 
  738        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
  753            $ilPluginAdmin->getId(
 
  754                $this->getComponentType(),
 
  755                $this->getComponentName(),
 
  757                $this->getPluginName()
 
  763            $ilPluginAdmin->getVersion(
 
  764                $this->getComponentType(),
 
  765                $this->getComponentName(),
 
  767                $this->getPluginName()
 
  773            $ilPluginAdmin->getIliasMinVersion(
 
  774                $this->getComponentType(),
 
  775                $this->getComponentName(),
 
  777                $this->getPluginName()
 
  783            $ilPluginAdmin->getIliasMaxVersion(
 
  784                $this->getComponentType(),
 
  785                $this->getComponentName(),
 
  787                $this->getPluginName()
 
  835        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
  837        return $ilPluginAdmin->isActive(
 
  852        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
  854        return $ilPluginAdmin->needsUpdate(
 
  869        $q = 
"UPDATE il_plugin SET plugin_id = " . 
$ilDB->quote($this->
getId(), 
"text") .
 
  875        $ilDB->manipulate($q);
 
  905                $q = 
"UPDATE il_plugin SET active = " . 
$ilDB->quote(1, 
"integer") .
 
  911                $ilDB->manipulate($q);
 
  963        $q = 
"UPDATE il_plugin SET active = " . 
$ilDB->quote(0, 
"integer") .
 
  969        $ilDB->manipulate($q);
 
 1003                    "DELETE FROM lng_data" .
 
 1004                    " WHERE module = " . 
$ilDB->quote($prefix, 
"text")
 
 1007                    "DELETE FROM lng_modules" .
 
 1008                    " WHERE module = " . 
$ilDB->quote($prefix, 
"text")
 
 1016            $q = 
"DELETE FROM il_plugin" .
 
 1021            $ilDB->manipulate($q);
 
 1054        ilGlobalCache::flushAll();
 
 1070        include_once(
"./setup/classes/class.ilCtrlStructureReader.php");
 
 1072        $structure_reader->readStructure(
 
 1081            "ilobjcomponentsettingsgui",
 
 1090            $q = 
"UPDATE il_plugin SET last_update_version = " . 
$ilDB->quote($this->
getVersion(), 
"text") .
 
 1096            $ilDB->manipulate($q);
 
 1099        ilGlobalCache::flushAll();
 
 1166    public static function getPluginObject(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_pname)
 
 1171        $rec = $cached_component->lookCompId($a_ctype, $a_cname);
 
 1176        $file = 
"./Customizing/global/plugins/" . $a_ctype . 
"/" .
 
 1177            $a_cname . 
"/" . $slot_name . 
"/" .
 
 1178            $a_pname . 
"/classes/class.il" . $a_pname . 
"Plugin.php";
 
 1180        if (is_file($file)) {
 
 1181            include_once($file);
 
 1182            $class = 
"il" . $a_pname . 
"Plugin";
 
 1183            $plugin = 
new $class();
 
 1202    public static function lookupStoredData(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_pname) : array
 
 1207        $q = 
"SELECT * FROM il_plugin WHERE" .
 
 1208            " component_type = " . 
$ilDB->quote($a_ctype, 
"text") . 
" AND" .
 
 1209            " component_name = " . 
$ilDB->quote($a_cname, 
"text") . 
" AND" .
 
 1210            " slot_id = " . 
$ilDB->quote($a_slot_id, 
"text") . 
" AND" .
 
 1211            " name = " . 
$ilDB->quote($a_pname, 
"text");
 
 1213        $set = 
$ilDB->query($q);
 
 1215        if (
$ilDB->numRows($set) == 0) {
 
 1219        return $ilDB->fetchAssoc($set);
 
 1233        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
 1239        $lookupActivePluginsBySlotId = $cached_component->lookupActivePluginsBySlotId($a_slot_id);
 
 1240        foreach ($lookupActivePluginsBySlotId as $rec) {
 
 1241            if ($ilPluginAdmin->isActive($a_ctype, $a_cname, $a_slot_id, $rec[
"name"])) {
 
 1242                $plugins[] = $rec[
"name"];
 
 1262        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
 1266        $lookupActivePluginsBySlotId = $cached_component->lookupActivePluginsBySlotId($a_slot_id);
 
 1267        foreach ($lookupActivePluginsBySlotId as $rec) {
 
 1268            if ($ilPluginAdmin->isActive($a_ctype, $a_cname, $a_slot_id, $rec[
"name"])) {
 
 1269                $plugins[] = $rec[
"plugin_id"];
 
 1285    public static function lookupNameForId(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_plugin_id)
 
 1290        $q = 
"SELECT name FROM il_plugin " .
 
 1291            " WHERE component_type = " . 
$ilDB->quote($a_ctype, 
"text") .
 
 1292            " AND component_name = " . 
$ilDB->quote($a_cname, 
"text") .
 
 1293            " AND slot_id = " . 
$ilDB->quote($a_slot_id, 
"text") .
 
 1294            " AND plugin_id = " . 
$ilDB->quote($a_plugin_id, 
"text");
 
 1296        $set = 
$ilDB->query($q);
 
 1297        if ($rec = 
$ilDB->fetchAssoc($set)) {
 
 1298            return $rec[
"name"];
 
 1311    public static function lookupIdForName(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_plugin_name) : string
 
 1316        $q = 
"SELECT plugin_id FROM il_plugin " .
 
 1317            " WHERE component_type = " . 
$ilDB->quote($a_ctype, 
"text") .
 
 1318            " AND component_name = " . 
$ilDB->quote($a_cname, 
"text") .
 
 1319            " AND slot_id = " . 
$ilDB->quote($a_slot_id, 
"text") .
 
 1320            " AND name = " . 
$ilDB->quote($a_plugin_name, 
"text");
 
 1322        $set = 
$ilDB->query($q);
 
 1323        if ($rec = 
$ilDB->fetchAssoc($set)) {
 
 1324            return $rec[
"plugin_id"];
 
 1337        $q = 
"SELECT component_type, component_name, slot_id FROM il_plugin " 
 1338            . 
" WHERE plugin_id = " . 
$ilDB->quote(
$id, 
"text")
 
 1341        $set = 
$ilDB->query($q);
 
 1342        if ($rec = 
$ilDB->fetchAssoc($set)) {
 
 1344                $rec[
"component_type"],
 
 1345                $rec[
"component_name"],
 
An exception for terminatinating execution or to throw for unit testing.
Class AbstractStaticPluginMainMenuProvider.
static isVersionGreaterString($a_ver1, $a_ver2)
static lookupId($a_type, $a_name)
Lookup ID of a component.
Class ilCtrlStructureReader.
static _getLocalChangesByModule($a_key, $a_module)
Get the local changes of a language module.
static getInstalledLanguages()
Get the language objects of the installed languages.
static replaceLangEntry( $a_module, $a_identifier, $a_lang_key, $a_value, $a_local_change=null, $a_remarks=null)
Replace lang entry.
static getPluginObjectByType($type)
Return either a repoObject plugin or a orgunit extension plugin or null if the type is not a plugin.
Class ilPluginGlobalScreenNullProvider.
static lookupSlotName($a_ctype, $a_cname, $a_slot_id)
Lookup slot name for component and slot id.
static _getPluginsDirectory($a_ctype, $a_cname, $a_slot_id)
Get plugins directory.
setDBVersion(int $a_dbversion)
setActive(bool $a_active)
static lookupNameForId(string $a_ctype, string $a_cname, string $a_slot_id, string $a_plugin_id)
promoteGlobalScreenProvider()
static _getDirectory(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
Get plugin directory.
static _getImagePath(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname, string $a_img)
needsUpdate()
Check whether update is needed.
static getPluginRecord(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
getTablePrefix()
Get db table plugin prefix.
afterActivation()
After activation processing.
static lookupTxt(string $a_mod_prefix, string $a_pl_id, string $a_lang_var)
readEventListening()
Read the event listening definitions from the plugin.xml (if file exists)
updateLanguages($a_lang_keys=null)
includeClass($a_class_file_name)
Include (once) a class file.
isActive()
Check whether plugin is active.
static getAvailableLangFiles(string $a_lang_directory)
Get array of all language files in the plugin.
static getActivePluginsForSlot(string $a_ctype, string $a_cname, string $a_slot_id)
getLastUpdateVersion()
Get Version of last update.
clearEventListening()
Clear the entries of this plugin in the event handling table.
static hasConfigureClass(string $a_slot_dir, array $plugin_data, array $plugin_db_data)
Has the plugin a configure class?
txt(string $a_var)
Get Language Variable (prefix will be prepended automatically)
addBlockFile($a_tpl, $a_var, $a_block, $a_tplname)
Add template content to placeholder variable.
afterUpdate()
After update processing.
getPrefix()
Get plugin prefix, used for lang vars.
static getDBUpdateScriptName(string $a_ctype, string $a_cname, string $a_slot_name, string $a_pname)
afterInstall()
After install processing.
setIliasMinVersion(string $a_iliasminversion)
static langExitsById(string $pluginId, string $langVar)
Is searched lang var available in plugin lang files.
static getActivePluginIdsForSlot(string $a_ctype, string $a_cname, string $a_slot_id)
Get All active plugin ids for a slot.
static lookupIdForName(string $a_ctype, string $a_cname, string $a_slot_id, string $a_plugin_name)
static lookupStoredData(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
Lookup information data in il_plugin.
afterUninstall()
This is Plugin-Specific and is triggered after the uninstall command of a plugin.
init()
Object initialization.
getPluginName()
Get Plugin Name.
static lookupTypeInformationsForId(string $id)
getComponentName()
Get Component Name.
getTemplate(string $a_template, bool $a_par1=true, bool $a_par2=true)
gets a ilTemplate instance of a html-file in the plugin /templates
__init()
Default initialization.
writeDBVersion(int $a_dbversion)
beforeUpdate()
Before update processing.
setSlotObject(ilPluginSlot $a_slot)
getDirectory()
Get Plugin Directory.
getIliasMaxVersion()
Get Required ILIAS max.
beforeActivation()
Before activation processing.
static getPluginObject(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
loadLanguageModule()
Load language module for plugin.
getImagePath(string $a_img)
Get image path.
setLastUpdateVersion(string $a_lastupdateversion)
Set Version of last update.
slotInit()
Object initialization done by slot.
static getConfigureClassName(array $plugin_data)
Get plugin configure class name.
setVersion(string $a_version)
afterDeactivation()
After deactivation processing.
getStyleSheetLocation(string $a_css_file)
getComponentType()
Get Component Type.
setIliasMaxVersion(string $a_iliasmaxversion)
static createPluginRecord(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
updateDatabase()
Update database.
special template class to simplify handling of ITX/PEAR
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
const ILIAS_VERSION_NUMERIC
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
catch(Exception $e) $message