144        $this->lastupdateversion = $a_lastupdateversion;
 
  164        $this->version = $a_version;
 
  182        $this->iliasminversion = $a_iliasminversion;
 
  200        $this->iliasmaxversion = $a_iliasmaxversion;
 
  220        $this->active = $a_active;
 
  238        $this->slot = $a_slot;
 
  256        $this->dbversion = $a_dbversion;
 
  279        $q = 
"UPDATE il_plugin SET db_version = " . 
$ilDB->quote((
int) $this->
getDBVersion(), 
"integer") .
 
  285        $ilDB->manipulate($q);
 
  303    public static function _getDirectory(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_pname) : string
 
  343        if (!@is_dir($a_lang_directory)) {
 
  347        $dir = opendir($a_lang_directory);
 
  348        while ($file = readdir($dir)) {
 
  353                if (@is_file($a_lang_directory . 
"/" . $file)) {
 
  354                    if (substr($file, 0, 6) == 
"ilias_" 
  355                        && substr($file, strlen($file) - 5) == 
".lang" 
  358                            "key" => substr($file, 6, 2),
 
  360                            "path" => $a_lang_directory . 
"/" . $file,
 
  380    public static function hasConfigureClass(
string $a_slot_dir, array $plugin_data, array $plugin_db_data) : bool
 
  387            if (is_file($a_slot_dir . 
"/" . $plugin_data[
"name"] . 
"/classes/class.il" . $plugin_data[
"name"] . 
"ConfigGUI.php")) {
 
  405        return "il" . $plugin_data[
"name"] . 
"ConfigGUI";
 
  426    public static function getDBUpdateScriptName(
string $a_ctype, 
string $a_cname, 
string $a_slot_name, 
string $a_pname) : string
 
  428        return "Customizing/global/plugins/" . $a_ctype . 
"/" . $a_cname . 
"/" .
 
  429            $a_slot_name . 
"/" . $a_pname . 
"/sql/dbupdate.php";
 
  449        ilGlobalCache::flushAll();
 
  452        if (!isset($a_lang_keys)) {
 
  453            $a_lang_keys = array();
 
  455                if ($langObj->isInstalled()) {
 
  456                    $a_lang_keys[] = $langObj->getKey();
 
  465        foreach ($langs as 
$lang) {
 
  467            if (!in_array(
$lang[
'key'], $a_lang_keys)) {
 
  472            $lang_array = array();
 
  478            if (is_array(
$txt)) {
 
  479                foreach (
$txt as $row) {
 
  480                    if ($row[0] != 
"#" && strpos($row, 
"#:#") > 0) {
 
  481                        $a = explode(
"#:#", trim($row));
 
  482                        $identifier = $prefix . 
"_" . trim(
$a[0]);
 
  483                        $value = trim(
$a[1]);
 
  485                        if (isset($local_changes[$identifier])) {
 
  486                            $lang_array[$identifier] = $local_changes[$identifier];
 
  488                            $lang_array[$identifier] = $value;
 
  496            ilObjLanguage::replaceLangModule(
$lang[
"key"], $prefix, $lang_array);
 
  510        ilGlobalCache::flushAll();
 
  522        $result = $dbupdate->applyUpdate();
 
  524        if ($dbupdate->updateMsg == 
"no_changes") {
 
  525            $message = 
$lng->txt(
"no_changes") . 
". " . 
$lng->txt(
"database_is_uptodate");
 
  527            foreach ($dbupdate->updateMsg as $row) {
 
  528                $message .= 
$lng->txt($row[
"msg"]) . 
": " . $row[
"nr"] . 
"<br/>";
 
  533        ilGlobalCache::flushAll();
 
  547        if (!$this->lang_initialised && is_object(
$lng)) {
 
  549            $this->lang_initialised = 
true;
 
  557    public function txt(
string $a_var) : string
 
  574    public static function lookupTxt(
string $a_mod_prefix, 
string $a_pl_id, 
string $a_lang_var) : string
 
  580        $prefix = $a_mod_prefix . 
"_" . $a_pl_id;
 
  582        return $lng->txt($prefix . 
"_" . $a_lang_var, $prefix);
 
  594    public static function langExitsById(
string $pluginId, 
string $langVar) : bool
 
  600        $pl->loadLanguageModule();
 
  602        return $lng->exists($pl->getPrefix() . 
"_" . $langVar);
 
  630    public static function _getImagePath(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_pname, 
string $a_img) : string
 
  636        if (is_int(strpos(
$img, 
"Customizing"))) {
 
  642        return $d . 
"/templates/images/" . $a_img;
 
  672        if (is_int(strpos($css, 
"Customizing"))) {
 
  676        return $this->
getDirectory() . 
"/templates/" . $a_css_file;
 
  685        $a_tpl->addBlockFile(
 
  701    public static function createPluginRecord(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_pname)
 
  708        $q = 
"INSERT INTO il_plugin (component_type, component_name, slot_id, name)" .
 
  709            " VALUES (" . 
$ilDB->quote($a_ctype, 
"text") . 
"," .
 
  710            $ilDB->quote($a_cname, 
"text") . 
"," .
 
  711            $ilDB->quote($a_slot_id, 
"text") . 
"," .
 
  712            $ilDB->quote($a_pname, 
"text") . 
")";
 
  714        $ilDB->manipulate($q);
 
  727    public static function getPluginRecord(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_pname) : array
 
  730        $rec = $cached_component->lookupPluginByName($a_pname);
 
  732        if ($rec[
'component_type'] == $a_ctype and $rec[
'component_name'] == $a_cname and $rec[
'slot_id'] == $a_slot_id) {
 
  735            throw new ilPluginException(
"No plugin record found for '{$a_ctype}', '{$a_cname}', '{$a_slot_id}', '{$a_pname}");
 
  746        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
  761            $ilPluginAdmin->getId(
 
  762                $this->getComponentType(),
 
  763                $this->getComponentName(),
 
  765                $this->getPluginName()
 
  771            $ilPluginAdmin->getVersion(
 
  772                $this->getComponentType(),
 
  773                $this->getComponentName(),
 
  775                $this->getPluginName()
 
  781            $ilPluginAdmin->getIliasMinVersion(
 
  782                $this->getComponentType(),
 
  783                $this->getComponentName(),
 
  785                $this->getPluginName()
 
  791            $ilPluginAdmin->getIliasMaxVersion(
 
  792                $this->getComponentType(),
 
  793                $this->getComponentName(),
 
  795                $this->getPluginName()
 
  843        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
  845        return $ilPluginAdmin->isActive(
 
  860        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
  862        return $ilPluginAdmin->needsUpdate(
 
  877        $q = 
"UPDATE il_plugin SET plugin_id = " . 
$ilDB->quote($this->
getId(), 
"text") .
 
  883        $ilDB->manipulate($q);
 
  913                $q = 
"UPDATE il_plugin SET active = " . 
$ilDB->quote(1, 
"integer") .
 
  919                $ilDB->manipulate($q);
 
  971        $q = 
"UPDATE il_plugin SET active = " . 
$ilDB->quote(0, 
"integer") .
 
  977        $ilDB->manipulate($q);
 
 1011                    "DELETE FROM lng_data" .
 
 1012                    " WHERE module = " . 
$ilDB->quote($prefix, 
"text")
 
 1015                    "DELETE FROM lng_modules" .
 
 1016                    " WHERE module = " . 
$ilDB->quote($prefix, 
"text")
 
 1024            $q = 
"DELETE FROM il_plugin" .
 
 1029            $ilDB->manipulate($q);
 
 1062        ilGlobalCache::flushAll();
 
 1079        $structure_reader->readStructure(
 
 1088            "ilobjcomponentsettingsgui",
 
 1097            $q = 
"UPDATE il_plugin SET last_update_version = " . 
$ilDB->quote($this->
getVersion(), 
"text") .
 
 1103            $ilDB->manipulate($q);
 
 1106        ilGlobalCache::flushAll();
 
 1177        $rec = $cached_component->lookCompId($a_ctype, $a_cname);
 
 1182        $file = 
"./Customizing/global/plugins/" . $a_ctype . 
"/" .
 
 1183            $a_cname . 
"/" . $slot_name . 
"/" .
 
 1184            $a_pname . 
"/classes/class.il" . $a_pname . 
"Plugin.php";
 
 1186        if (is_file($file)) {
 
 1187            include_once($file);
 
 1188            $class = 
"il" . $a_pname . 
"Plugin";
 
 1193        throw new ilPluginException(
"File : ".$file. 
" . does not Exist for plugin: ".$a_pname. 
" Check if your  
 1194            plugin is still marked as active in the DB Table 'il_plugin' but not installed anymore.");
 
 1208    public static function lookupStoredData(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_pname) : array
 
 1213        $q = 
"SELECT * FROM il_plugin WHERE" .
 
 1214            " component_type = " . 
$ilDB->quote($a_ctype, 
"text") . 
" AND" .
 
 1215            " component_name = " . 
$ilDB->quote($a_cname, 
"text") . 
" AND" .
 
 1216            " slot_id = " . 
$ilDB->quote($a_slot_id, 
"text") . 
" AND" .
 
 1217            " name = " . 
$ilDB->quote($a_pname, 
"text");
 
 1219        $set = 
$ilDB->query($q);
 
 1221        if (
$ilDB->numRows($set) == 0) {
 
 1225        return $ilDB->fetchAssoc($set);
 
 1239        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
 1245        $lookupActivePluginsBySlotId = $cached_component->lookupActivePluginsBySlotId($a_slot_id);
 
 1246        foreach ($lookupActivePluginsBySlotId as $rec) {
 
 1247            if ($ilPluginAdmin->isActive($a_ctype, $a_cname, $a_slot_id, $rec[
"name"])) {
 
 1248                $plugins[] = $rec[
"name"];
 
 1268        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
 1272        $lookupActivePluginsBySlotId = $cached_component->lookupActivePluginsBySlotId($a_slot_id);
 
 1273        foreach ($lookupActivePluginsBySlotId as $rec) {
 
 1274            if ($ilPluginAdmin->isActive($a_ctype, $a_cname, $a_slot_id, $rec[
"name"])) {
 
 1275                $plugins[] = $rec[
"plugin_id"];
 
 1291    public static function lookupNameForId(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_plugin_id)
 
 1296        $q = 
"SELECT name FROM il_plugin " .
 
 1297            " WHERE component_type = " . 
$ilDB->quote($a_ctype, 
"text") .
 
 1298            " AND component_name = " . 
$ilDB->quote($a_cname, 
"text") .
 
 1299            " AND slot_id = " . 
$ilDB->quote($a_slot_id, 
"text") .
 
 1300            " AND plugin_id = " . 
$ilDB->quote($a_plugin_id, 
"text");
 
 1302        $set = 
$ilDB->query($q);
 
 1303        if ($rec = 
$ilDB->fetchAssoc($set)) {
 
 1304            return $rec[
"name"];
 
 1317    public static function lookupIdForName(
string $a_ctype, 
string $a_cname, 
string $a_slot_id, 
string $a_plugin_name) : string
 
 1322        $q = 
"SELECT plugin_id FROM il_plugin " .
 
 1323            " WHERE component_type = " . 
$ilDB->quote($a_ctype, 
"text") .
 
 1324            " AND component_name = " . 
$ilDB->quote($a_cname, 
"text") .
 
 1325            " AND slot_id = " . 
$ilDB->quote($a_slot_id, 
"text") .
 
 1326            " AND name = " . 
$ilDB->quote($a_plugin_name, 
"text");
 
 1328        $set = 
$ilDB->query($q);
 
 1329        if ($rec = 
$ilDB->fetchAssoc($set)) {
 
 1330            return $rec[
"plugin_id"];
 
 1345        $q = 
"SELECT component_type, component_name, slot_id FROM il_plugin " 
 1346            . 
" WHERE plugin_id = " . 
$ilDB->quote(
$id, 
"text");
 
 1348        $set = 
$ilDB->query($q);
 
 1349        if ($rec = 
$ilDB->fetchAssoc($set)) {
 
 1351                $rec[
"component_type"],
 
 1352                $rec[
"component_name"],
 
 1404        return $dic->raw(
'ui.renderer');
 
 1429        return $dic->raw($dic_key);
 
An exception for terminatinating execution or to throw for unit testing.
setMainBarProvider(AbstractStaticMainMenuPluginProvider $static_mai_menu_provider)
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()
exchangeUIFactoryAfterInitialization(string $dic_key, \ILIAS\DI\Container $dic)
This methods allows to replace some factory for UI Components (see src/UI) of ILIAS after initializat...
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)
exchangeUIRendererAfterInitialization(\ILIAS\DI\Container $dic)
This methods allows to replace the UI Renderer (see src/UI) of ILIAS after initialization by returnin...
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)
getGlobalScreenProviderCollection()
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
Class PluginProviderCollection.
Class ChatMainBarProvider \MainMenu\Provider.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples