ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilPluginAdmin Class Reference

Administration class for plugins. More...

+ Collaboration diagram for ilPluginAdmin:

Public Member Functions

 __construct ()
 
 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 includeClass ( $a_ctype, $a_cname, $a_slot_id, $a_pname, $a_class_file_name)
 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...
 

Data Fields

 $got_data = false
 

Static Public Attributes

static $active_plugins = array()
 
static $plugin_objects = 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...
 

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.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilPluginAdmin::__construct ( )

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

References $lng.

37  {
38  global $lng;
39  $this->lng = $lng;
40  $this->lng->loadLanguageModule("cmps");
41  }
global $lng
Definition: privfeed.php:17

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

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

References data, and getPluginData().

317  {
318  $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
319  return isset($this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]);
320  }
Add some data
getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get basic data of plugin from plugin.php.
+ Here is the call graph for this function:

◆ getActivePlugins()

static ilPluginAdmin::getActivePlugins ( )
static

Get info for all active plugins.

Returns
array

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

References array, and ilCachedComponentData\getInstance().

Referenced by ilAppEventHandler\raise().

456  {
457  $cached_component = ilCachedComponentData::getInstance();
458  $plugins = $cached_component->getIlPluginActive();
459  $buf = array();
460  foreach ($plugins as $slot => $plugs) {
461  $buf = array_merge($buf, $plugs);
462  }
463  return $buf;
464  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActivePluginsForSlot()

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

Get all active plugins for a slot.

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

References ilPlugin\getActivePluginsForSlot().

Referenced by ilDclPluginFieldRepresentation\buildFieldCreationInput(), and ilAppEventHandler\raise().

354  {
355  // cache the list of active plugins
356  if (!isset(self::$active_plugins[$a_ctype][$a_cname][$a_slot_id])) {
357  include_once "./Services/Component/classes/class.ilPlugin.php";
358 
359  self::$active_plugins[$a_ctype][$a_cname][$a_slot_id] =
360  ilPlugin::getActivePluginsForSlot($a_ctype, $a_cname, $a_slot_id);
361  }
362  return self::$active_plugins[$a_ctype][$a_cname][$a_slot_id];
363  }
static getActivePluginsForSlot($a_ctype, $a_cname, $a_slot_id)
Get all active plugin names for a slot.
+ 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

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

References data, and getPluginData().

345  {
346  $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
347  return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname];
348  }
Add some data
getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get basic data of plugin from plugin.php.
+ Here is the call graph for this function:

◆ getAllPlugins()

static ilPluginAdmin::getAllPlugins ( )
static

Get info for all plugins.

Returns
array<string, array>

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

References ilCachedComponentData\getInstance().

445  {
446  $cached_component = ilCachedComponentData::getInstance();
447  return $cached_component->getIlPluginById();
448  }
+ Here is the call 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

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

References data, and getPluginData().

285  {
286  $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
287  return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["id"];
288  }
Add some data
getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get basic data of plugin from plugin.php.
+ 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

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

References data, and getPluginData().

271  {
272  $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
273  return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["ilias_max_version"];
274  }
Add some data
getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get basic data of plugin from plugin.php.
+ 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

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

References data, and getPluginData().

257  {
258  $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
259  return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["ilias_min_version"];
260  }
Add some data
getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get basic data of plugin from plugin.php.
+ 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

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

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

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

52  {
53  //Can not use DIC because it is not initialized if plugin is activated
54  global $lng;
55  $this->lng = $lng;
56 
57  if (!isset($this->got_data[$a_ctype][$a_cname][$a_slot_id][$a_pname])) {
58  include_once "./Services/Component/classes/class.ilPluginSlot.php";
59  $slot_name = ilPluginSlot::lookupSlotName($a_ctype, $a_cname, $a_slot_id);
60 
61  $plugin_php_file = "./Customizing/global/plugins/" . $a_ctype . "/" .
62  $a_cname . "/" . $slot_name . "/" . $a_pname . "/plugin.php";
63 
64  if (!is_file($plugin_php_file)) {
65  throw new ilPluginException("No plugin.php file found for Plugin :" . $a_pname . ".");
66  }
67 
68  $plugin_db_data = ilPlugin::getPluginRecord($a_ctype, $a_cname, $a_slot_id, $a_pname);
69  $plugin_data = $this->parsePluginPhp($plugin_php_file);
70 
71  if ($plugin_db_data["plugin_id"] === null) {
72  $this->setMustInstall($plugin_data);
73  } else {
74  $this->setCurrentState($plugin_data, (bool) $plugin_db_data["active"]);
75  if ($this->pluginSupportCurrentILIAS($plugin_data)) {
76  $this->updateRequired($plugin_data, $plugin_db_data["last_update_version"]);
77  }
78  }
79 
80  $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname] = $plugin_data;
81  $this->got_data[$a_ctype][$a_cname][$a_slot_id][$a_pname] = true;
82  }
83  }
Add some data
parsePluginPhp($plugin_php_file)
Get informations from plugin php file.
setMustInstall(array &$plugin_data)
Set plugin data for intall.
static lookupSlotName($a_ctype, $a_cname, $a_slot_id)
Lookup slot name for component and slot id.
pluginSupportCurrentILIAS(array &$plugin_data)
Plugin supports current ILIAS.
static getPluginRecord($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get record from il_plugin table.
updateRequired(array &$plugin_data, $last_update_version)
Should the plugin be updated.
global $lng
Definition: privfeed.php:17
setCurrentState(array &$plugin_data, $active)
Set current state to static values, excluding active and activatoin possible.
+ 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 374 of file class.ilPluginAdmin.php.

References ilPlugin\getPluginObject().

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

375  {
376  // cache the plugin objects
377  if (!isset(self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname])) {
378  self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname] =
379  ilPlugin::getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname);
380  }
381  return self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname];
382  }
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
+ 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 490 of file class.ilPluginAdmin.php.

References $id.

491  {
492  assert('is_string($id)');
493  $plugs = self::getAllPlugins();
494  if (!array_key_exists($id, $plugs)) {
495  throw new \InvalidArgumentException("Plugin does not exist: " . $id, 1);
496  }
497  $pdata = $plugs[$id];
498  return self::getPluginObject(
499  $pdata['component_type'],
500  $pdata['component_name'],
501  $pdata['slot_id'],
502  $pdata['name']
503  );
504  }
if(!array_key_exists('StateId', $_REQUEST)) $id

◆ 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

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

References data, and getPluginData().

243  {
244  $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
245  return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["version"];
246  }
Add some data
getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get basic data of plugin from plugin.php.
+ 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

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

References data, and getPluginData().

419  {
420  $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
421  return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["learning_progress"];
422  }
Add some data
getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get basic data of plugin from plugin.php.
+ Here is the call graph for this function:

◆ includeClass()

static ilPluginAdmin::includeClass (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname,
  $a_class_file_name 
)
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 393 of file class.ilPluginAdmin.php.

References ilPlugin\getPluginObject().

399  {
400  // cache the plugin objects
401  if (!isset(self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname])) {
402  self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname] =
403  ilPlugin::getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname);
404  }
405  $pl = self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname];
406  $pl->includeClass($a_class_file_name);
407  }
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
+ 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

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

References data, and getPluginData().

299  {
300  try {
301  $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
302  } catch (ilPluginException $e) {
303  return false;
304  }
305  return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["is_active"];
306  }
Add some data
getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get basic data of plugin from plugin.php.
+ 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 472 of file class.ilPluginAdmin.php.

References $id, and ilCachedComponentData\getInstance().

473  {
474  assert('is_string($id)');
475  $cached_component = ilCachedComponentData::getInstance();
476  $plugs = $cached_component->getIlPluginById();
477  if (array_key_exists($id, $plugs) && $plugs[$id]['active']) {
478  return true;
479  }
480  return false;
481  }
if(!array_key_exists('StateId', $_REQUEST)) $id
+ 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

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

References data, and getPluginData().

331  {
332  $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
333  return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["needs_update"];
334  }
Add some data
getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get basic data of plugin from plugin.php.
+ 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 216 of file class.ilPluginAdmin.php.

References $id, and $version.

Referenced by getPluginData().

217  {
218  include_once($plugin_php_file);
219 
220  $values = [
221  "version" => $version,
222  "id" => $id,
223  "ilias_min_version" => $ilias_min_version,
224  "ilias_max_version" => $ilias_max_version,
225  "responsible" => $responsible,
226  "responsible_mail" => $responsible_mail,
227  "learning_progress" => (bool) $learning_progress,
228  "supports_export" => (bool) $supports_export
229  ];
230 
231  return $values;
232  }
if(!array_key_exists('StateId', $_REQUEST)) $id
+ 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 92 of file class.ilPluginAdmin.php.

References ILIAS_VERSION_NUMERIC, and ilComponent\isVersionGreaterString().

Referenced by getPluginData().

93  {
94  if (ilComponent::isVersionGreaterString($plugin_data["ilias_min_version"], ILIAS_VERSION_NUMERIC)) {
95  $plugin_data["is_active"] = false;
96  $plugin_data["needs_update"] = false;
97  $plugin_data["activation_possible"] = false;
98 
99  if (is_object($this->lng)) {
100  $inactive_reason = $this->lng->txt("cmps_needs_newer_ilias_version");
101  } else {
102  $inactive_reason = "Plugin needs a newer version of ILIAS.";
103  }
104  $plugin_data["inactive_reason"] = $inactive_reason;
105 
106  return false;
107  }
108 
109  if (ilComponent::isVersionGreaterString(ILIAS_VERSION_NUMERIC, $plugin_data["ilias_max_version"])) {
110  $plugin_data["is_active"] = false;
111  $plugin_data["needs_update"] = false;
112  $plugin_data["activation_possible"] = false;
113  if (is_object($this->lng)) {
114  $inactive_reason = $this->lng->txt("cmps_needs_newer_plugin_version");
115  } else {
116  $inactive_reason = "Plugin does not support current version of ILIAS. Newer version of plugin needed.";
117  }
118  $plugin_data["inactive_reason"] = $inactive_reason;
119 
120  return false;
121  }
122 
123  return true;
124  }
const ILIAS_VERSION_NUMERIC
static isVersionGreaterString($a_ver1, $a_ver2)
+ 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 200 of file class.ilPluginAdmin.php.

Referenced by getPluginData().

201  {
202  $plugin_data["is_active"] = $active;
203  $plugin_data["activation_possible"] = !$active;
204  $plugin_data["must_install"] = false;
205  $plugin_data["needs_update"] = false;
206  $plugin_data["inactive_reason"] = "";
207  }
+ 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 175 of file class.ilPluginAdmin.php.

Referenced by getPluginData().

176  {
177  $plugin_data["must_install"] = true;
178  $plugin_data["is_active"] = false;
179  $plugin_data["needs_update"] = false;
180  $plugin_data["activation_possible"] = false;
181 
182  if (is_object($this->lng)) {
183  $inactive_reason = $this->lng->txt("cmps_must_installed");
184  } else {
185  $inactive_reason = "Plugin must be installed.";
186  }
187  $plugin_data["inactive_reason"] = $inactive_reason;
188  }
+ 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

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

References data, and getPluginData().

434  {
435  $this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
436  return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["supports_export"];
437  }
Add some data
getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get basic data of plugin from plugin.php.
+ 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 134 of file class.ilPluginAdmin.php.

References ilComponent\isVersionGreaterString().

Referenced by getPluginData().

135  {
136  if ($last_update_version == "") {
137  $plugin_data["is_active"] = false;
138  if (is_object($this->lng)) {
139  $inactive_reason = $this->lng->txt("cmps_needs_update");
140  } else {
141  $inactive_reason = "Update needed.";
142  }
143  $plugin_data["inactive_reason"] = $inactive_reason;
144  $plugin_data["needs_update"] = true;
145  $plugin_data["activation_possible"] = false;
146  } elseif (ilComponent::isVersionGreaterString($last_update_version, $plugin_data["version"])) {
147  $plugin_data["is_active"] = false;
148  if (is_object($this->lng)) {
149  $inactive_reason = $this->lng->txt("cmps_needs_upgrade");
150  } else {
151  $inactive_reason = "Upgrade needed.";
152  }
153  $plugin_data["inactive_reason"] = $inactive_reason;
154  $plugin_data["activation_possible"] = false;
155  } elseif ($last_update_version != $plugin_data["version"]) {
156  $plugin_data["is_active"] = false;
157  if (is_object($this->lng)) {
158  $inactive_reason = $this->lng->txt("cmps_needs_update");
159  } else {
160  $inactive_reason = "Update needed.";
161  }
162  $plugin_data["inactive_reason"] = $inactive_reason;
163  $plugin_data["needs_update"] = true;
164  $plugin_data["activation_possible"] = false;
165  }
166  }
static isVersionGreaterString($a_ver1, $a_ver2)
+ 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 24 of file class.ilPluginAdmin.php.

◆ $got_data

ilPluginAdmin::$got_data = false

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

◆ $plugin_objects

ilPluginAdmin::$plugin_objects = array()
static

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


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