ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilPluginAdmin Class Reference

Administration class for plugins. More...

+ Collaboration diagram for ilPluginAdmin:

Public Member Functions

 __construct ()
 ilPluginAdmin constructor. More...
 
 getVersion ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get version of plugin. More...
 
 getIliasMinVersion ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get Ilias Min Version. More...
 
 getIliasMaxVersion ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get Ilias Max Version. More...
 
 getId ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get ID. More...
 
 isActive ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Checks whether plugin is active (include version checks) More...
 
 exists ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Checks whether plugin exists. More...
 
 needsUpdate ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get version. More...
 
 getAllData ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get all data from file in an array. More...
 
 hasLearningProgress ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Checks whether plugin has active learning progress. More...
 
 supportsExport ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Checks whether plugin supports export/import. More...
 

Static Public Member Functions

static getActivePluginsForSlot ($a_ctype, $a_cname, $a_slot_id)
 Get all active plugins for a slot. More...
 
static getPluginObject ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get Plugin Object. More...
 
static getAllPlugins ()
 Get info for all plugins. More...
 
static getActivePlugins ()
 Get info for all active plugins. More...
 
static isPluginActive ($id)
 Check, if a plugin is active. More...
 
static getPluginObjectById ($id)
 Get a plugin-object by id. More...
 
static getAllGlobalScreenProviders ()
 

Static Public Attributes

static $active_plugins = array()
 

Protected Member Functions

 pluginSupportCurrentILIAS (array &$plugin_data)
 Plugin supports current ILIAS. More...
 
 updateRequired (array &$plugin_data, $last_update_version)
 Should the plugin be updated. More...
 
 setMustInstall (array &$plugin_data)
 Set plugin data for intall. More...
 
 setCurrentState (array &$plugin_data, $active)
 Set current state to static values, excluding active and activatoin possible. More...
 
 parsePluginPhp ($plugin_php_file)
 Get informations from plugin php file. More...
 

Protected Attributes

 $data
 
 $got_data = false
 
 $lng
 

Static Protected Attributes

static $plugin_objects = array()
 

Private Member Functions

 getPluginData ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get basic data of plugin from plugin.php. More...
 

Detailed Description

Administration class for plugins.

Handles basic data from plugin.php files.

This class currently needs refactoring. There are a lot of methods which are related to some specific slots.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 17 of file class.ilPluginAdmin.php.

Constructor & Destructor Documentation

◆ __construct()

ilPluginAdmin::__construct ( )

ilPluginAdmin constructor.

Definition at line 49 of file class.ilPluginAdmin.php.

50 {
51 global $DIC;
52 $this->lng = $DIC->language();
53 $this->lng->loadLanguageModule("cmps");
54 }
global $DIC
Definition: saml.php:7

References $DIC.

Member Function Documentation

◆ exists()

ilPluginAdmin::exists (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Checks whether plugin exists.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name
Returns
bool
Exceptions
ilPluginException

Definition at line 361 of file class.ilPluginAdmin.php.

362 {
363 $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
364
365 return isset($this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]);
366 }
getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get basic data of plugin from plugin.php.
$this data['403_header']

References data, and getPluginData().

+ Here is the call graph for this function:

◆ getActivePlugins()

static ilPluginAdmin::getActivePlugins ( )
static

Get info for all active plugins.

Returns
array

Definition at line 533 of file class.ilPluginAdmin.php.

534 {
535 $cached_component = ilCachedComponentData::getInstance();
536 $plugins = $cached_component->getIlPluginActive();
537 $buf = array();
538 foreach ($plugins as $slot => $plugs) {
539 $buf = array_merge($buf, $plugs);
540 }
541
542 return $buf;
543 }

References ilCachedComponentData\getInstance().

+ Here is the call graph for this function:

◆ getActivePluginsForSlot()

static ilPluginAdmin::getActivePluginsForSlot (   $a_ctype,
  $a_cname,
  $a_slot_id 
)
static

Get all active plugins for a slot.

Parameters
string$a_ctype
string$a_cname
string$a_slot_id
Returns
array

Definition at line 416 of file class.ilPluginAdmin.php.

417 {
418 // cache the list of active plugins
419 if (!isset(self::$active_plugins[$a_ctype][$a_cname][$a_slot_id])) {
420 self::$active_plugins[$a_ctype][$a_cname][$a_slot_id]
421 = ilPlugin::getActivePluginsForSlot($a_ctype, $a_cname, $a_slot_id);
422 }
423
424 return self::$active_plugins[$a_ctype][$a_cname][$a_slot_id];
425 }
static getActivePluginsForSlot(string $a_ctype, string $a_cname, string $a_slot_id)

References ilPlugin\getActivePluginsForSlot().

Referenced by ilDclPluginFieldRepresentation\buildFieldCreationInput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAllData()

ilPluginAdmin::getAllData (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Get all data from file in an array.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name
Returns
array
Exceptions
ilPluginException

Definition at line 399 of file class.ilPluginAdmin.php.

400 {
401 $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
402
403 return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname];
404 }

References data, and getPluginData().

+ Here is the call graph for this function:

◆ getAllGlobalScreenProviders()

static ilPluginAdmin::getAllGlobalScreenProviders ( )
static
Returns
\ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticPluginMainMenuProvider[]

Definition at line 595 of file class.ilPluginAdmin.php.

595 : array
596 {
597 $providers = array();
598 foreach (self::getActivePlugins() as $plugin) {
599 $pl = self::getPluginObjectById($plugin['plugin_id']);
600 if ($pl instanceof ilPlugin && $pl->isActive()) {
601 array_push($providers, $pl->promoteGlobalScreenProvider());
602 }
603 }
604
605 return $providers;
606 }
static getPluginObjectById($id)
Get a plugin-object by id.
isActive()
Check whether plugin is active.

References getPluginObjectById(), and ilPlugin\isActive().

Referenced by ilGSProviderFactory\appendPlugins(), and ilMMItemRepository\sync().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAllPlugins()

static ilPluginAdmin::getAllPlugins ( )
static

Get info for all plugins.

Returns
array<string, array>

Definition at line 520 of file class.ilPluginAdmin.php.

521 {
522 $cached_component = ilCachedComponentData::getInstance();
523
524 return $cached_component->getIlPluginById();
525 }

References ilCachedComponentData\getInstance().

Referenced by getPluginObjectById().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

ilPluginAdmin::getId (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Get ID.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name
Returns
string
Exceptions
ilPluginException

Definition at line 320 of file class.ilPluginAdmin.php.

321 {
322 $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
323
324 return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["id"];
325 }

References data, and getPluginData().

+ Here is the call graph for this function:

◆ getIliasMaxVersion()

ilPluginAdmin::getIliasMaxVersion (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Get Ilias Max Version.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name
Returns
string
Exceptions
ilPluginException

Definition at line 301 of file class.ilPluginAdmin.php.

302 {
303 $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
304
305 return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["ilias_max_version"];
306 }

References data, and getPluginData().

+ Here is the call graph for this function:

◆ getIliasMinVersion()

ilPluginAdmin::getIliasMinVersion (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Get Ilias Min Version.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name
Returns
string
Exceptions
ilPluginException

Definition at line 282 of file class.ilPluginAdmin.php.

283 {
284 $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
285
286 return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["ilias_min_version"];
287 }

References data, and getPluginData().

+ Here is the call graph for this function:

◆ getPluginData()

ilPluginAdmin::getPluginData (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)
finalprivate

Get basic data of plugin from plugin.php.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name
Exceptions
ilPluginException

Definition at line 67 of file class.ilPluginAdmin.php.

68 {
69 if (!isset($this->got_data[$a_ctype][$a_cname][$a_slot_id][$a_pname])) {
70 $slot_name = ilPluginSlot::lookupSlotName($a_ctype, $a_cname, $a_slot_id);
71
72 $plugin_php_file = "./Customizing/global/plugins/" . $a_ctype . "/" . $a_cname . "/" . $slot_name . "/" . $a_pname . "/plugin.php";
73
74 if (!is_file($plugin_php_file)) {
75 throw new ilPluginException("No plugin.php file found for Plugin :" . $a_pname . ".");
76 }
77
78 $plugin_db_data = ilPlugin::getPluginRecord($a_ctype, $a_cname, $a_slot_id, $a_pname);
79 $plugin_data = $this->parsePluginPhp($plugin_php_file);
80
81 if ($plugin_db_data["plugin_id"] === null) {
82 $this->setMustInstall($plugin_data);
83 } else {
84 $this->setCurrentState($plugin_data, (bool) $plugin_db_data["active"]);
85 if ($this->pluginSupportCurrentILIAS($plugin_data)) {
86 $this->updateRequired($plugin_data, $plugin_db_data["last_update_version"]);
87 }
88 }
89
90 $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname] = $plugin_data;
91 $this->got_data[$a_ctype][$a_cname][$a_slot_id][$a_pname] = true;
92 }
93 }
parsePluginPhp($plugin_php_file)
Get informations from plugin php file.
updateRequired(array &$plugin_data, $last_update_version)
Should the plugin be updated.
setMustInstall(array &$plugin_data)
Set plugin data for intall.
setCurrentState(array &$plugin_data, $active)
Set current state to static values, excluding active and activatoin possible.
pluginSupportCurrentILIAS(array &$plugin_data)
Plugin supports current ILIAS.
static lookupSlotName($a_ctype, $a_cname, $a_slot_id)
Lookup slot name for component and slot id.
static getPluginRecord(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)

References data, ilPlugin\getPluginRecord(), ilPluginSlot\lookupSlotName(), parsePluginPhp(), pluginSupportCurrentILIAS(), setCurrentState(), setMustInstall(), and updateRequired().

Referenced by exists(), getAllData(), getId(), getIliasMaxVersion(), getIliasMinVersion(), getVersion(), hasLearningProgress(), isActive(), needsUpdate(), and supportsExport().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPluginObject()

static ilPluginAdmin::getPluginObject (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)
static

Get Plugin Object.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name
Returns
ilPlugin the plugin

Definition at line 438 of file class.ilPluginAdmin.php.

439 {
440 // cache the plugin objects
441 if (!isset(self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname])) {
442 self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname]
443 = ilPlugin::getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname);
444 }
445
446 return self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname];
447 }
static getPluginObject(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)

References ilPlugin\getPluginObject().

Referenced by ilUIHookProcessor\__construct(), ilTestSignatureGUI\__construct(), ilTabsGUI\__getHTML(), ilStartUpGUI\_checkGoto(), ilTemplate\addBlockFile(), ilDclPluginFieldRepresentation\buildFieldCreationInput(), ilObjComponentSettingsGUI\executeCommand(), ilTemplate\get(), ilContainerGUI\getAsynchItemListObject(), getPluginObjectById(), ilInitialisation\initStyle(), ilRendererFactory\loadAvailableRenderers(), ilTemplate\loadTemplatefile(), ilCtrl\redirectToURL(), ilObjContentObjectGUI\setilLMMenu(), and ilTemplate\show().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPluginObjectById()

static ilPluginAdmin::getPluginObjectById (   $id)
static

Get a plugin-object by id.

Parameters
string$idid of the plugin
Exceptions
InvalidArgumentExceptionif no plugin with that id is found
Returns
ilPlugin

Definition at line 574 of file class.ilPluginAdmin.php.

575 {
576 assert(is_string($id));
577 $plugs = self::getAllPlugins();
578 if (!array_key_exists($id, $plugs)) {
579 throw new \InvalidArgumentException("Plugin does not exist: " . $id, 1);
580 }
581 $pdata = $plugs[$id];
582
584 $pdata['component_type'],
585 $pdata['component_name'],
586 $pdata['slot_id'],
587 $pdata['name']
588 );
589 }
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
static getAllPlugins()
Get info for all plugins.
if(!array_key_exists('StateId', $_REQUEST)) $id

References $id, getAllPlugins(), and getPluginObject().

Referenced by getAllGlobalScreenProviders().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getVersion()

ilPluginAdmin::getVersion (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Get version of plugin.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name
Returns
string
Exceptions
ilPluginException

Definition at line 263 of file class.ilPluginAdmin.php.

264 {
265 $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
266
267 return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["version"];
268 }

References data, and getPluginData().

+ Here is the call graph for this function:

◆ hasLearningProgress()

ilPluginAdmin::hasLearningProgress (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Checks whether plugin has active learning progress.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name
Returns
bool
Exceptions
ilPluginException

Definition at line 488 of file class.ilPluginAdmin.php.

489 {
490 $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
491
492 return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["learning_progress"];
493 }

References data, and getPluginData().

+ Here is the call graph for this function:

◆ isActive()

ilPluginAdmin::isActive (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Checks whether plugin is active (include version checks)

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name
Returns
bool

Definition at line 338 of file class.ilPluginAdmin.php.

339 {
340 try {
341 $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
342 } catch (ilPluginException $e) {
343 return false;
344 }
345
346 return (bool) $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["is_active"];
347 }

References data, and getPluginData().

+ Here is the call graph for this function:

◆ isPluginActive()

static ilPluginAdmin::isPluginActive (   $id)
static

Check, if a plugin is active.

Parameters
string$idid of the plugin
Returns
boolean

Definition at line 553 of file class.ilPluginAdmin.php.

554 {
555 assert(is_string($id));
556 $cached_component = ilCachedComponentData::getInstance();
557 $plugs = $cached_component->getIlPluginById();
558 if (array_key_exists($id, $plugs) && $plugs[$id]['active']) {
559 return true;
560 }
561
562 return false;
563 }

References $id, and ilCachedComponentData\getInstance().

+ Here is the call graph for this function:

◆ needsUpdate()

ilPluginAdmin::needsUpdate (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Get version.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name
Returns
bool
Exceptions
ilPluginException

Definition at line 380 of file class.ilPluginAdmin.php.

381 {
382 $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
383
384 return (bool) $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["needs_update"];
385 }

References data, and getPluginData().

+ Here is the call graph for this function:

◆ parsePluginPhp()

ilPluginAdmin::parsePluginPhp (   $plugin_php_file)
protected

Get informations from plugin php file.

Parameters
string$plugin_php_file
Returns
string[]

Definition at line 235 of file class.ilPluginAdmin.php.

236 {
237 include($plugin_php_file);
238
239 $values = ["version" => $version,
240 "id" => $id,
241 "ilias_min_version" => $ilias_min_version,
242 "ilias_max_version" => $ilias_max_version,
243 "responsible" => $responsible,
244 "responsible_mail" => $responsible_mail,
245 "learning_progress" => (bool) $learning_progress,
246 "supports_export" => (bool) $supports_export];
247
248 return $values;
249 }
$version
Definition: build.php:27
$values

References $id, $values, and $version.

Referenced by getPluginData().

+ Here is the caller graph for this function:

◆ pluginSupportCurrentILIAS()

ilPluginAdmin::pluginSupportCurrentILIAS ( array &  $plugin_data)
protected

Plugin supports current ILIAS.

Parameters
string[]&$plugin_data
Returns
bool

Definition at line 103 of file class.ilPluginAdmin.php.

104 {
105 if (ilComponent::isVersionGreaterString($plugin_data["ilias_min_version"], ILIAS_VERSION_NUMERIC)) {
106 $plugin_data["is_active"] = false;
107 $plugin_data["needs_update"] = false;
108 $plugin_data["activation_possible"] = false;
109
110 if ($this->lng instanceof ilLanguage) {
111 $inactive_reason = $this->lng->txt("cmps_needs_newer_ilias_version");
112 } else {
113 $inactive_reason = "Plugin needs a newer version of ILIAS.";
114 }
115 $plugin_data["inactive_reason"] = $inactive_reason;
116
117 return false;
118 }
119
120 if (ilComponent::isVersionGreaterString(ILIAS_VERSION_NUMERIC, $plugin_data["ilias_max_version"])) {
121 $plugin_data["is_active"] = false;
122 $plugin_data["needs_update"] = false;
123 $plugin_data["activation_possible"] = false;
124 if ($this->lng instanceof ilLanguage) {
125 $inactive_reason = $this->lng->txt("cmps_needs_newer_plugin_version");
126 } else {
127 $inactive_reason = "Plugin does not support current version of ILIAS. Newer version of plugin needed.";
128 }
129 $plugin_data["inactive_reason"] = $inactive_reason;
130
131 return false;
132 }
133
134 return true;
135 }
static isVersionGreaterString($a_ver1, $a_ver2)
language handling
const ILIAS_VERSION_NUMERIC

References ILIAS_VERSION_NUMERIC, and ilComponent\isVersionGreaterString().

Referenced by getPluginData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCurrentState()

ilPluginAdmin::setCurrentState ( array &  $plugin_data,
  $active 
)
protected

Set current state to static values, excluding active and activatoin possible.

There will be set from db value $active

Parameters
string[]&$plugin_data
bool$active
Returns
void

Definition at line 218 of file class.ilPluginAdmin.php.

219 {
220 $plugin_data["is_active"] = $active;
221 $plugin_data["activation_possible"] = !$active;
222 $plugin_data["must_install"] = false;
223 $plugin_data["needs_update"] = false;
224 $plugin_data["inactive_reason"] = "";
225 }

Referenced by getPluginData().

+ Here is the caller graph for this function:

◆ setMustInstall()

ilPluginAdmin::setMustInstall ( array &  $plugin_data)
protected

Set plugin data for intall.

Parameters
string[]&$plugin_data
Returns
void

Definition at line 192 of file class.ilPluginAdmin.php.

193 {
194 $plugin_data["must_install"] = true;
195 $plugin_data["is_active"] = false;
196 $plugin_data["needs_update"] = false;
197 $plugin_data["activation_possible"] = false;
198
199 if ($this->lng instanceof ilLanguage) {
200 $inactive_reason = $this->lng->txt("cmps_must_installed");
201 } else {
202 $inactive_reason = "Plugin must be installed.";
203 }
204 $plugin_data["inactive_reason"] = $inactive_reason;
205 }

Referenced by getPluginData().

+ Here is the caller graph for this function:

◆ supportsExport()

ilPluginAdmin::supportsExport (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Checks whether plugin supports export/import.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name
Returns
bool
Exceptions
ilPluginException

Definition at line 507 of file class.ilPluginAdmin.php.

508 {
509 $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
510
511 return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["supports_export"];
512 }

References data, and getPluginData().

+ Here is the call graph for this function:

◆ updateRequired()

ilPluginAdmin::updateRequired ( array &  $plugin_data,
  $last_update_version 
)
protected

Should the plugin be updated.

Parameters
string[]&$plugin_data
string$last_update_version
Returns
void

Definition at line 146 of file class.ilPluginAdmin.php.

147 {
148 if ($last_update_version == "") {
149 $plugin_data["is_active"] = false;
150 if ($this->lng instanceof ilLanguage) {
151 $inactive_reason = $this->lng->txt("cmps_needs_update");
152 } else {
153 $inactive_reason = "Update needed.";
154 }
155 $plugin_data["inactive_reason"] = $inactive_reason;
156 $plugin_data["needs_update"] = true;
157 $plugin_data["activation_possible"] = false;
158 } else {
159 if (ilComponent::isVersionGreaterString($last_update_version, $plugin_data["version"])) {
160 $plugin_data["is_active"] = false;
161 if ($this->lng instanceof ilLanguage) {
162 $inactive_reason = $this->lng->txt("cmps_needs_upgrade");
163 } else {
164 $inactive_reason = "Upgrade needed.";
165 }
166 $plugin_data["inactive_reason"] = $inactive_reason;
167 $plugin_data["activation_possible"] = false;
168 } else {
169 if ($last_update_version != $plugin_data["version"]) {
170 $plugin_data["is_active"] = false;
171 if ($this->lng instanceof ilLanguage) {
172 $inactive_reason = $this->lng->txt("cmps_needs_update");
173 } else {
174 $inactive_reason = "Update needed.";
175 }
176 $plugin_data["inactive_reason"] = $inactive_reason;
177 $plugin_data["needs_update"] = true;
178 $plugin_data["activation_possible"] = false;
179 }
180 }
181 }
182 }

References ilComponent\isVersionGreaterString().

Referenced by getPluginData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $active_plugins

ilPluginAdmin::$active_plugins = array()
static

Definition at line 33 of file class.ilPluginAdmin.php.

◆ $data

ilPluginAdmin::$data
protected

Definition at line 23 of file class.ilPluginAdmin.php.

◆ $got_data

ilPluginAdmin::$got_data = false
protected

Definition at line 27 of file class.ilPluginAdmin.php.

◆ $lng

ilPluginAdmin::$lng
protected

Definition at line 43 of file class.ilPluginAdmin.php.

◆ $plugin_objects

ilPluginAdmin::$plugin_objects = array()
staticprotected

Definition at line 39 of file class.ilPluginAdmin.php.


The documentation for this class was generated from the following file: