ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPlugin Class Reference
+ Inheritance diagram for ilPlugin:
+ Collaboration diagram for ilPlugin:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getComponentType ()
 Get Component Type. More...
 
 getComponentName ()
 Get Component Name. More...
 
 getSlot ()
 Get Slot Name. More...
 
 getSlotId ()
 Get Slot ID. More...
 
 getPluginName ()
 Get Plugin Name. More...
 
 getId ()
 Get Id. More...
 
 getLastUpdateVersion ()
 Get Version of last update. More...
 
 getVersion ()
 Get Current Version (from plugin.php file). More...
 
 getIliasMinVersion ()
 Get Required ILIAS min. More...
 
 getIliasMaxVersion ()
 Get Required ILIAS max. More...
 
 getActive ()
 Get Active. More...
 
 setDBVersion ($a_dbversion)
 Set DB Version. More...
 
 getDBVersion ()
 Get DB Version. More...
 
 writeDBVersion ($a_dbversion)
 Write DB version to database. More...
 
 getDirectory ()
 Get Plugin Directory. More...
 
 includeClass ($a_class_file_name)
 Include (once) a class file. More...
 
 getPrefix ()
 Get plugin prefix, used for lang vars. More...
 
 getTablePrefix ()
 Get db table plugin prefix. More...
 
 updateLanguages ()
 Update all languages. More...
 
 updateDatabase ()
 Update database. More...
 
 loadLanguageModule ()
 Load language module for plugin. More...
 
 txt ($a_var)
 Get Language Variable (prefix will be prepended automatically) More...
 
 getTemplate ($a_template, $a_par1=true, $a_par2=true)
 Get template from plugin. More...
 
 getImagePath ($a_img)
 Get image path. More...
 
 getStyleSheetLocation ($a_css_file)
 Get css file location. More...
 
 addBlockFile ($a_tpl, $a_var, $a_block, $a_tplname)
 Add template content to placeholder variable. More...
 
 isActive ()
 Check whether plugin is active. More...
 
 needsUpdate ()
 Check whether update is needed. More...
 
 activate ()
 Activate. More...
 
 deactivate ()
 Deactivate. More...
 
 update ()
 Update plugin. More...
 
 lookupNameForId ($a_ctype, $a_cname, $a_slot_id, $a_plugin_id)
 Lookup name for id. More...
 
 lookupIdForName ($a_ctype, $a_cname, $a_slot_id, $a_plugin_name)
 Lookup id for name. More...
 

Static Public Member Functions

static _getDirectory ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get plugin directory. More...
 
static getAvailableLangFiles ($a_lang_directory)
 Get array of all language files in the plugin. More...
 
static hasConfigureClass ($a_slot_dir, $a_name)
 Has the plugin a configure class? More...
 
static getConfigureClassName ($a_name)
 Get plugin configure class name. More...
 
static getDBUpdateScriptName ($a_ctype, $a_cname, $a_slot_name, $a_pname)
 Get DB update script filename (full path) More...
 
static lookupTxt ($a_mod_prefix, $a_pl_id, $a_lang_var)
 Lookup language text. More...
 
static _getImagePath ($a_ctype, $a_cname, $a_slot_id, $a_pname, $a_img)
 Get image path. More...
 
static createPluginRecord ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Create plugin record, if not existing. More...
 
static getPluginRecord ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get record from il_plugin table. More...
 
static getPluginObject ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get plugin object. More...
 
static lookupStoredData ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Lookup information data in il_plugin. More...
 
static getActivePluginsForSlot ($a_ctype, $a_cname, $a_slot_id)
 Get all active plugins for a slot. More...
 

Protected Member Functions

 setSlotObject ($a_slot)
 Set Plugin Slot. More...
 
 getSlotObject ()
 Get Plugin Slot. More...
 
 getClassesDirectory ()
 Get Plugin's classes Directory. More...
 
 getLanguageDirectory ()
 Get Plugin's language Directory. More...
 
 slotInit ()
 Object initialization done by slot. More...
 
 init ()
 Object initialization. More...
 
 beforeActivation ()
 Before activation processing. More...
 
 afterActivation ()
 After activation processing. More...
 

Protected Attributes

 $lang_initialised = false
 

Private Member Functions

 setId ($a_id)
 Set Id. More...
 
 setLastUpdateVersion ($a_lastupdateversion)
 Set Version of last update. More...
 
 setVersion ($a_version)
 Set Current Version (from plugin.php file). More...
 
 setIliasMinVersion ($a_iliasminversion)
 Set Required ILIAS min. More...
 
 setIliasMaxVersion ($a_iliasmaxversion)
 Set Required ILIAS max. More...
 
 setActive ($a_active)
 Set Active. More...
 
 __init ()
 Default initialization. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilPlugin::__construct ( )
final

Constructor.

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

References __init(), getComponentName(), getComponentType(), getPluginName(), getSlot(), and getSlotId().

24  {
25  $this->__init();
26  }
__init()
Default initialization.
+ Here is the call graph for this function:

Member Function Documentation

◆ __init()

ilPlugin::__init ( )
finalprivate

Default initialization.

Definition at line 627 of file class.ilPlugin.php.

References $lng, getComponentName(), getComponentType(), getPluginName(), getPluginRecord(), getSlotId(), init(), loadLanguageModule(), setActive(), setDBVersion(), setId(), setIliasMaxVersion(), setIliasMinVersion(), setLastUpdateVersion(), setSlotObject(), setVersion(), and slotInit().

Referenced by __construct().

628  {
629  global $ilDB, $lng, $ilPluginAdmin;
630 
631  // read/set basic data
633  $this->getComponentName(), $this->getSlotId(), $this->getPluginName());
634  $this->setLastUpdateVersion($rec["last_update_version"]);
635  $this->setDBVersion($rec["db_version"]);
636  $this->setActive($rec["active"]);
637 
638  // get id
639  $this->setId($ilPluginAdmin->getId($this->getComponentType(),
640  $this->getComponentName(),
641  $this->getSlotId(),
642  $this->getPluginName()));
643 
644  // get version
645  $this->setVersion($ilPluginAdmin->getVersion($this->getComponentType(),
646  $this->getComponentName(),
647  $this->getSlotId(),
648  $this->getPluginName()));
649 
650  // get ilias min version
651  $this->setIliasMinVersion($ilPluginAdmin->getIliasMinVersion($this->getComponentType(),
652  $this->getComponentName(),
653  $this->getSlotId(),
654  $this->getPluginName()));
655 
656  // get ilias max version
657  $this->setIliasMaxVersion($ilPluginAdmin->getIliasMaxVersion($this->getComponentType(),
658  $this->getComponentName(),
659  $this->getSlotId(),
660  $this->getPluginName()));
661 
662  // get slot object
663  $this->setSlotObject(new ilPluginSlot($this->getComponentType(),
664  $this->getComponentName(), $this->getSlotId()));
665 
666  // load language module
667 
668  // Fix for authentication plugins
669  $this->loadLanguageModule();
670 
671  // call slot and plugin init methods
672  $this->slotInit();
673  $this->init();
674  }
loadLanguageModule()
Load language module for plugin.
setId($a_id)
Set Id.
setSlotObject($a_slot)
Set Plugin Slot.
setVersion($a_version)
Set Current Version (from plugin.php file).
getComponentName()
Get Component Name.
setIliasMaxVersion($a_iliasmaxversion)
Set Required ILIAS max.
static getPluginRecord($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get record from il_plugin table.
getComponentType()
Get Component Type.
init()
Object initialization.
setDBVersion($a_dbversion)
Set DB Version.
Plugin Slot.
setLastUpdateVersion($a_lastupdateversion)
Set Version of last update.
getSlotId()
Get Slot ID.
global $lng
Definition: privfeed.php:40
slotInit()
Object initialization done by slot.
getPluginName()
Get Plugin Name.
setIliasMinVersion($a_iliasminversion)
Set Required ILIAS min.
setActive($a_active)
Set Active.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getDirectory()

static ilPlugin::_getDirectory (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)
staticfinal

Get plugin directory.

Definition at line 273 of file class.ilPlugin.php.

References ilPluginSlot\_getPluginsDirectory().

Referenced by _getImagePath(), and ilObjectDefinition\readDefinitionData().

274  {
275  include_once "Services/Component/classes/class.ilPluginSlot.php";
276  return ilPluginSlot::_getPluginsDirectory($a_ctype, $a_cname, $a_slot_id)."/".$a_pname;
277  }
_getPluginsDirectory($a_ctype, $a_cname, $a_slot_id)
Get plugins directory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getImagePath()

static ilPlugin::_getImagePath (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname,
  $a_img 
)
staticfinal

Get image path.

Definition at line 524 of file class.ilPlugin.php.

References $d, and _getDirectory().

Referenced by ilRepositoryObjectPlugin\_getIcon().

526  {
527  $d = ilPlugin::_getDirectory($a_ctype, $a_cname, $a_slot_id, $a_pname);
528  return $d."/templates/images/".$a_img;
529  }
static _getDirectory($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin directory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ activate()

ilPlugin::activate ( )
final

Activate.

Definition at line 717 of file class.ilPlugin.php.

References $lng, $result, afterActivation(), beforeActivation(), getComponentName(), getComponentType(), getId(), getPluginName(), getSlotId(), needsUpdate(), and update().

718  {
719  global $lng, $ilDB;
720 
721  $result = true;
722 
723  // check whether update is necessary
724  if ($this->needsUpdate())
725  {
726  //$result = $this->isUpdatePossible();
727 
728  // do update
729  if ($result === true)
730  {
731  $result = $this->update();
732  }
733  }
734  if ($result === true)
735  {
736  $result = $this->beforeActivation();
737  // activate plugin
738  if ($result === true)
739  {
740  $q = "UPDATE il_plugin SET active = ".$ilDB->quote(1, "integer").",".
741  " plugin_id = ".$ilDB->quote($this->getId(), "text").
742  " WHERE component_type = ".$ilDB->quote($this->getComponentType(), "text").
743  " AND component_name = ".$ilDB->quote($this->getComponentName(), "text").
744  " AND slot_id = ".$ilDB->quote($this->getSlotId(), "text").
745  " AND name = ".$ilDB->quote($this->getPluginName(), "text");
746 
747  $ilDB->manipulate($q);
748  $this->afterActivation();
749  }
750  }
751  return $result;
752  }
$result
update()
Update plugin.
needsUpdate()
Check whether update is needed.
getComponentName()
Get Component Name.
beforeActivation()
Before activation processing.
getId()
Get Id.
getComponentType()
Get Component Type.
afterActivation()
After activation processing.
getSlotId()
Get Slot ID.
global $lng
Definition: privfeed.php:40
getPluginName()
Get Plugin Name.
+ Here is the call graph for this function:

◆ addBlockFile()

ilPlugin::addBlockFile (   $a_tpl,
  $a_var,
  $a_block,
  $a_tplname 
)
final

Add template content to placeholder variable.

Definition at line 550 of file class.ilPlugin.php.

References getDirectory().

551  {
552  $a_tpl->addBlockFile($a_var, $a_block,
553  $this->getDirectory()."/templates/".$a_tplname);
554  }
getDirectory()
Get Plugin Directory.
+ Here is the call graph for this function:

◆ afterActivation()

ilPlugin::afterActivation ( )
protected

After activation processing.

Definition at line 768 of file class.ilPlugin.php.

Referenced by activate().

769  {
770  }
+ Here is the caller graph for this function:

◆ beforeActivation()

ilPlugin::beforeActivation ( )
protected

Before activation processing.

Definition at line 757 of file class.ilPlugin.php.

Referenced by activate().

758  {
759  return true; // false would indicate that anything went wrong
760  // activation would not proceed
761  // throw an exception in this case
762  //throw new ilPluginException($lng->txt(""));
763  }
+ Here is the caller graph for this function:

◆ createPluginRecord()

static ilPlugin::createPluginRecord (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)
staticfinal

Create plugin record, if not existing.

Definition at line 559 of file class.ilPlugin.php.

Referenced by ilPluginSlot\getPluginsInformation().

560  {
561  global $ilDB;
562 
563  // check record existence record
564  $q = "SELECT * FROM il_plugin".
565  " WHERE component_type = ".$ilDB->quote($a_ctype, "text").
566  " AND component_name = ".$ilDB->quote($a_cname, "text").
567  " AND slot_id = ".$ilDB->quote($a_slot_id, "text").
568  " AND name = ".$ilDB->quote($a_pname, "text");
569  $set = $ilDB->query($q);
570  if (!$rec = $ilDB->fetchAssoc($set))
571  {
572  $q = "INSERT INTO il_plugin (component_type, component_name, slot_id, name)".
573  " VALUES (".$ilDB->quote($a_ctype, "text").",".
574  $ilDB->quote($a_cname, "text").",".
575  $ilDB->quote($a_slot_id, "text").",".
576  $ilDB->quote($a_pname, "text").")";
577  $ilDB->manipulate($q);
578  }
579  }
+ Here is the caller graph for this function:

◆ deactivate()

ilPlugin::deactivate ( )
final

Deactivate.

Definition at line 775 of file class.ilPlugin.php.

References $result, getComponentName(), getComponentType(), getPluginName(), and getSlotId().

776  {
777  global $ilDB;
778 
779  $result = true;
780 
781  $q = "UPDATE il_plugin SET active = ".$ilDB->quote(0, "integer").
782  " WHERE component_type = ".$ilDB->quote($this->getComponentType(), "text").
783  " AND component_name = ".$ilDB->quote($this->getComponentName(), "text").
784  " AND slot_id = ".$ilDB->quote($this->getSlotId(), "text").
785  " AND name = ".$ilDB->quote($this->getPluginName(), "text");
786 
787  $ilDB->manipulate($q);
788 
789  return $result;
790  }
$result
getComponentName()
Get Component Name.
getComponentType()
Get Component Type.
getSlotId()
Get Slot ID.
getPluginName()
Get Plugin Name.
+ Here is the call graph for this function:

◆ getActive()

ilPlugin::getActive ( )
final

Get Active.

Returns
boolean Active

Definition at line 194 of file class.ilPlugin.php.

195  {
196  return $this->active;
197  }

◆ getActivePluginsForSlot()

static ilPlugin::getActivePluginsForSlot (   $a_ctype,
  $a_cname,
  $a_slot_id 
)
staticfinal

Get all active plugins for a slot.

Definition at line 899 of file class.ilPlugin.php.

Referenced by ilPluginAdmin\getActivePluginsForSlot().

900  {
901  global $ilDB, $ilPluginAdmin;
902 
903  $q = "SELECT * FROM il_plugin WHERE component_type = ".$ilDB->quote($a_ctype, "text").
904  " AND component_name = ".$ilDB->quote($a_cname, "text").
905  " AND slot_id = ".$ilDB->quote($a_slot_id, "text").
906  " AND active = ".$ilDB->quote(1, "integer");
907 
908  $set = $ilDB->query($q);
909  $plugins = array();
910  while($rec = $ilDB->fetchAssoc($set))
911  {
912  if ($ilPluginAdmin->isActive($a_ctype, $a_cname, $a_slot_id, $rec["name"]))
913  {
914  $plugins[] = $rec["name"];
915  }
916  }
917 
918  return $plugins;
919  }
+ Here is the caller graph for this function:

◆ getAvailableLangFiles()

static ilPlugin::getAvailableLangFiles (   $a_lang_directory)
staticfinal

Get array of all language files in the plugin.

Definition at line 311 of file class.ilPlugin.php.

References $file.

Referenced by ilPluginsOverviewTableGUI\gatherPluginData(), ilObjComponentSettingsGUI\showPlugin(), and updateLanguages().

312  {
313  $langs = array();
314 
315  if (!@is_dir($a_lang_directory))
316  {
317  return array();
318  }
319 
320  $dir = opendir($a_lang_directory);
321  while($file = readdir($dir))
322  {
323  if ($file != "." and
324  $file != "..")
325  {
326  // directories
327  if (@is_file($a_lang_directory."/".$file))
328  {
329  if (substr($file, 0, 6) == "ilias_" &&
330  substr($file, strlen($file) - 5) == ".lang")
331  {
332  $langs[] = array("key" => substr($file, 6, 2), "file" => $file,
333  "path" => $a_lang_directory."/".$file);
334  }
335  }
336  }
337  }
338 
339  return $langs;
340  }
print $file
+ Here is the caller graph for this function:

◆ getClassesDirectory()

ilPlugin::getClassesDirectory ( )
finalprotected

Get Plugin's classes Directory.

Returns
object classes directory

Definition at line 285 of file class.ilPlugin.php.

References getDirectory().

Referenced by includeClass().

286  {
287  return $this->getDirectory()."/classes";
288  }
getDirectory()
Get Plugin Directory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComponentName()

ilPlugin::getComponentName ( )
abstract

Get Component Name.

Must be overwritten in plugin class of plugin slot. (and should be made final)

Returns
string Component Name

Referenced by __construct(), __init(), activate(), deactivate(), isActive(), needsUpdate(), update(), updateDatabase(), and writeDBVersion().

+ Here is the caller graph for this function:

◆ getComponentType()

ilPlugin::getComponentType ( )
abstract

Get Component Type.

Must be overwritten in plugin class of plugin slot. (and should be made final)

Returns
string Component Type

Referenced by __construct(), __init(), activate(), deactivate(), isActive(), needsUpdate(), update(), updateDatabase(), and writeDBVersion().

+ Here is the caller graph for this function:

◆ getConfigureClassName()

static ilPlugin::getConfigureClassName (   $a_name)
staticfinal

Get plugin configure class name.

Parameters

Definition at line 365 of file class.ilPlugin.php.

Referenced by ilPluginsOverviewTableGUI\fillRow(), ilPluginsOverviewTableGUI\gatherPluginData(), ilObjComponentSettingsGUI\showPlugin(), and update().

366  {
367  return "il".$a_name."ConfigGUI";
368  }
+ Here is the caller graph for this function:

◆ getDBUpdateScriptName()

static ilPlugin::getDBUpdateScriptName (   $a_ctype,
  $a_cname,
  $a_slot_name,
  $a_pname 
)
staticfinal

Get DB update script filename (full path)

Returns
string DB Update script name

Definition at line 383 of file class.ilPlugin.php.

Referenced by ilPluginDBUpdate\ilPluginDBUpdate(), and ilObjComponentSettingsGUI\showPlugin().

384  {
385  return "Customizing/global/plugins/".$a_ctype."/".$a_cname."/".
386  $a_slot_name."/".$a_pname."/sql/dbupdate.php";
387  }
+ Here is the caller graph for this function:

◆ getDBVersion()

ilPlugin::getDBVersion ( )
final

Get DB Version.

Returns
int DB Version

Definition at line 234 of file class.ilPlugin.php.

Referenced by writeDBVersion().

235  {
236  return $this->dbversion;
237  }
+ Here is the caller graph for this function:

◆ getDirectory()

ilPlugin::getDirectory ( )
final

Get Plugin Directory.

Returns
object Plugin Slot

Definition at line 265 of file class.ilPlugin.php.

References getPluginName(), and getSlotObject().

Referenced by addBlockFile(), getClassesDirectory(), getImagePath(), getLanguageDirectory(), getStyleSheetLocation(), getTemplate(), and update().

266  {
267  return $this->getSlotObject()->getPluginsDirectory()."/".$this->getPluginName();
268  }
getPluginName()
Get Plugin Name.
getSlotObject()
Get Plugin Slot.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

ilPlugin::getId ( )
final

Get Id.

Returns
string Id

Definition at line 94 of file class.ilPlugin.php.

Referenced by activate(), ilRepositoryObjectPlugin\beforeActivation(), ilCloudHookPlugin\getPluginTablePrefix(), getPrefix(), and ilTestSignaturePlugin\handInFileForArchiving().

95  {
96  return $this->id;
97  }
+ Here is the caller graph for this function:

◆ getIliasMaxVersion()

ilPlugin::getIliasMaxVersion ( )
final

Get Required ILIAS max.

release.

Returns
string Required ILIAS max. release

Definition at line 174 of file class.ilPlugin.php.

175  {
176  return $this->iliasmaxversion;
177  }

◆ getIliasMinVersion()

ilPlugin::getIliasMinVersion ( )
final

Get Required ILIAS min.

release.

Returns
string Required ILIAS min. release

Definition at line 154 of file class.ilPlugin.php.

155  {
156  return $this->iliasminversion;
157  }

◆ getImagePath()

ilPlugin::getImagePath (   $a_img)
final

Get image path.

Definition at line 534 of file class.ilPlugin.php.

References getDirectory().

535  {
536  return $this->getDirectory()."/templates/images/".$a_img;
537  }
getDirectory()
Get Plugin Directory.
+ Here is the call graph for this function:

◆ getLanguageDirectory()

ilPlugin::getLanguageDirectory ( )
finalprotected

Get Plugin's language Directory.

Returns
object classes directory

Definition at line 303 of file class.ilPlugin.php.

References getDirectory().

Referenced by updateLanguages().

304  {
305  return $this->getDirectory()."/lang";
306  }
getDirectory()
Get Plugin Directory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLastUpdateVersion()

ilPlugin::getLastUpdateVersion ( )
final

Get Version of last update.

Returns
string Version of last update

Definition at line 114 of file class.ilPlugin.php.

115  {
116  return $this->lastupdateversion;
117  }

◆ getPluginName()

ilPlugin::getPluginName ( )
abstract

Get Plugin Name.

Must be same as in class name il<Name>Plugin and must correspond to plugins subdirectory name.

Must be overwritten in plugin class of plugin (and should be made final)

Returns
string Plugin Name

Referenced by __construct(), __init(), activate(), ilRepositoryObjectPlugin\beforeActivation(), deactivate(), getDirectory(), ilCloudHookPlugin\getPluginTablePrefix(), ilPreviewRendererPlugin\getRendererClassInstance(), isActive(), needsUpdate(), update(), updateDatabase(), and writeDBVersion().

+ Here is the caller graph for this function:

◆ getPluginObject()

static ilPlugin::getPluginObject (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)
staticfinal

Get plugin object.

Parameters
string$a_ctypeIL_COMP_MODULE | IL_COMP_SERVICE
string$a_cnamecomponent name
string$a_snameplugin slot name
string$a_pnameplugin name

Definition at line 844 of file class.ilPlugin.php.

References $file, and ilPluginSlot\lookupSlotName().

Referenced by ilObjectPluginGUI\__construct(), ilObjectPlugin\__construct(), ilObjectCopySearchResultTableGUI\__construct(), SurveyQuestion\_getQuestionTypeName(), assQuestion\_getQuestionTypeName(), ilObjSurveyQuestionPool\_getQuestiontypes(), ilObjQuestionPool\_getQuestionTypes(), ilObjSurveyQuestionPool\_getQuestionTypeTranslations(), SurveyQuestion\_includeClass(), ilObjComponentSettingsGUI\activatePlugin(), ilObjComponentSettingsGUI\deactivatePlugin(), ilPluginAdmin\getPluginObject(), ilObjQuestionPool\getQuestionTypeTranslations(), ilObjTest\getQuestionTypeTranslations(), ilPluginAdmin\includeClass(), assQuestion\includePluginClass(), ilObjectPluginListGUI\init(), ilObjLanguage\refreshAll(), ilObjComponentSettingsGUI\refreshLanguages(), ilObjectCopyGUI\showTargetSelectionTree(), ilObjComponentSettingsGUI\updatePlugin(), and ilObjQuestionPoolGUI\uploadQplObject().

845  {
846  global $ilDB;
847 
848  include_once("./Services/Component/classes/class.ilPluginSlot.php");
849  $slot_name = ilPluginSlot::lookupSlotName($a_ctype, $a_cname, $a_slot_id);
850 
851  // this check is done due to security reasons
852  $set = $ilDB->queryF("SELECT * FROM il_component WHERE type = %s ".
853  " AND name = %s", array("text", "text"),
854  array($a_ctype, $a_cname));
855  if (!$ilDB->fetchAssoc($set))
856  {
857  return null;
858  }
859 
860  $file = "./Customizing/global/plugins/".$a_ctype."/".
861  $a_cname."/".$slot_name."/".
862  $a_pname."/classes/class.il".$a_pname."Plugin.php";
863 
864  if (is_file($file))
865  {
866  include_once($file);
867  $class = "il".$a_pname."Plugin";
868  $plugin = new $class();
869  return $plugin;
870  }
871 
872  return null;
873  }
print $file
static lookupSlotName($a_ctype, $a_cname, $a_slot_id)
Lookup slot name for component and slot id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPluginRecord()

static ilPlugin::getPluginRecord (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)
staticfinal

Get record from il_plugin table.

Definition at line 585 of file class.ilPlugin.php.

Referenced by __init(), ilPluginAdmin\getPluginData(), and ilCloudHookPlugin\getPluginTablePrefix().

586  {
587  global $ilDB;
588 
589  // read/set basic data
590  $q = "SELECT * FROM il_plugin".
591  " WHERE component_type = ".$ilDB->quote($a_ctype, "text").
592  " AND component_name = ".$ilDB->quote($a_cname, "text").
593  " AND slot_id = ".$ilDB->quote($a_slot_id, "text").
594  " AND name = ".$ilDB->quote($a_pname, "text");
595  $set = $ilDB->query($q);
596  if ($rec = $ilDB->fetchAssoc($set))
597  {
598  return $rec;
599  }
600  else // no record? create one
601  {
602  // silently create these records is not a good idea, since
603  // the function can be called with "wrong parameters"
604  // raise exceptions instead
605  include_once("./Services/Component/exceptions/class.ilPluginException.php");
606  throw (new ilPluginException("No plugin record found for '".$a_ctype."', '".$a_cname."', '".$a_slot_id."', '".$a_pname."'."));
607 
608  $q = "INSERT INTO il_plugin (component_type, component_name, slot_id, name)".
609  " VALUES (".$ilDB->quote($a_ctype, "text").",".
610  $ilDB->quote($a_cname, "text").",".
611  $ilDB->quote($a_slot_id, "text").",".
612  $ilDB->quote($a_pname, "text").")";
613  $ilDB->manipulate($q);
614  $q = "SELECT * FROM il_plugin".
615  " WHERE component_type = ".$ilDB->quote($a_ctype, "text").
616  " AND component_name = ".$ilDB->quote($a_cname, "text").
617  " AND slot_id = ".$ilDB->quote($a_slot_id, "text").
618  " AND name = ".$ilDB->quote($a_pname, "text");
619  $set = $ilDB->query($q);
620  return $ilDB->fetchAssoc($set);
621  }
622  }
+ Here is the caller graph for this function:

◆ getPrefix()

ilPlugin::getPrefix ( )
final

Get plugin prefix, used for lang vars.

Definition at line 373 of file class.ilPlugin.php.

References getId(), and getSlotObject().

Referenced by getTablePrefix(), loadLanguageModule(), txt(), update(), and updateLanguages().

374  {
375  return $this->getSlotObject()->getPrefix()."_".$this->getId();
376  }
getId()
Get Id.
getSlotObject()
Get Plugin Slot.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSlot()

ilPlugin::getSlot ( )
abstract

Get Slot Name.

Must be overwritten in plugin class of plugin slot. (and should be made final)

Returns
string Slot Name

Referenced by __construct().

+ Here is the caller graph for this function:

◆ getSlotId()

ilPlugin::getSlotId ( )
abstract

Get Slot ID.

Must be overwritten in plugin class of plugin slot. (and should be made final)

Returns
string Slot Id

Referenced by __construct(), __init(), activate(), deactivate(), isActive(), needsUpdate(), update(), updateDatabase(), and writeDBVersion().

+ Here is the caller graph for this function:

◆ getSlotObject()

ilPlugin::getSlotObject ( )
finalprotected

Get Plugin Slot.

Returns
object Plugin Slot

Definition at line 214 of file class.ilPlugin.php.

Referenced by getDirectory(), ilCloudHookPlugin\getPluginTablePrefix(), and getPrefix().

215  {
216  return $this->slot;
217  }
+ Here is the caller graph for this function:

◆ getStyleSheetLocation()

ilPlugin::getStyleSheetLocation (   $a_css_file)
final

Get css file location.

Definition at line 542 of file class.ilPlugin.php.

References getDirectory().

543  {
544  return $this->getDirectory()."/templates/".$a_css_file;
545  }
getDirectory()
Get Plugin Directory.
+ Here is the call graph for this function:

◆ getTablePrefix()

ilPlugin::getTablePrefix ( )
final

Get db table plugin prefix.

Definition at line 392 of file class.ilPlugin.php.

References getPrefix().

Referenced by updateDatabase().

393  {
394  return $this->getPrefix();
395  }
getPrefix()
Get plugin prefix, used for lang vars.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplate()

ilPlugin::getTemplate (   $a_template,
  $a_par1 = true,
  $a_par2 = true 
)
final

Get template from plugin.

Definition at line 514 of file class.ilPlugin.php.

References $tpl, and getDirectory().

515  {
516  $tpl = new ilTemplate($this->getDirectory()."/templates/".$a_template, $a_par1, $a_par2);
517 
518  return $tpl;
519  }
getDirectory()
Get Plugin Directory.
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ Here is the call graph for this function:

◆ getVersion()

ilPlugin::getVersion ( )
final

Get Current Version (from plugin.php file).

Returns
string Current Version (from plugin.php file)

Definition at line 134 of file class.ilPlugin.php.

Referenced by update().

135  {
136  return $this->version;
137  }
+ Here is the caller graph for this function:

◆ hasConfigureClass()

static ilPlugin::hasConfigureClass (   $a_slot_dir,
  $a_name 
)
staticfinal

Has the plugin a configure class?

Parameters
stringslot directory
stringplugin name
Returns
boolean true/false

Definition at line 349 of file class.ilPlugin.php.

Referenced by ilPluginsOverviewTableGUI\gatherPluginData(), and ilObjComponentSettingsGUI\showPlugin().

350  {
351  if (is_file($a_slot_dir."/".
352  $a_name."/classes/class.il".$a_name."ConfigGUI.php"))
353  {
354  return true;
355  }
356  return false;
357  }
+ Here is the caller graph for this function:

◆ includeClass()

ilPlugin::includeClass (   $a_class_file_name)
final

Include (once) a class file.

Definition at line 293 of file class.ilPlugin.php.

References getClassesDirectory().

Referenced by ilPreviewRendererPlugin\getRendererClassInstance(), ilUserInterfaceHookPlugin\getUIClassInstance(), and ilPageComponentPlugin\getUIClassInstance().

294  {
295  include_once($this->getClassesDirectory()."/".$a_class_file_name);
296  }
getClassesDirectory()
Get Plugin&#39;s classes Directory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

ilPlugin::init ( )
protected

Object initialization.

Can be overwritten by plugin class (and should be made protected final)

Definition at line 688 of file class.ilPlugin.php.

Referenced by __init().

689  {
690  }
+ Here is the caller graph for this function:

◆ isActive()

ilPlugin::isActive ( )
final

Check whether plugin is active.

Definition at line 695 of file class.ilPlugin.php.

References getComponentName(), getComponentType(), getPluginName(), and getSlotId().

696  {
697  global $ilPluginAdmin;
698 
699  return $ilPluginAdmin->isActive($this->getComponentType(),
700  $this->getComponentName(), $this->getSlotId(), $this->getPluginName());
701  }
getComponentName()
Get Component Name.
getComponentType()
Get Component Type.
getSlotId()
Get Slot ID.
getPluginName()
Get Plugin Name.
+ Here is the call graph for this function:

◆ loadLanguageModule()

ilPlugin::loadLanguageModule ( )
final

Load language module for plugin.

Definition at line 473 of file class.ilPlugin.php.

References $lng, and getPrefix().

Referenced by __init(), and txt().

474  {
475  global $lng;
476 
477  if (!$this->lang_initialised && is_object($lng))
478  {
479  $lng->loadLanguageModule($this->getPrefix());
480  $this->lang_initialised = true;
481  }
482  }
getPrefix()
Get plugin prefix, used for lang vars.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupIdForName()

ilPlugin::lookupIdForName (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_plugin_name 
)

Lookup id for name.

Definition at line 944 of file class.ilPlugin.php.

Referenced by ilObjRepositorySettings\getAllObjTypes(), ilModulesTableGUI\getComponents(), ilObjectDefinition\getGroupedRepositoryObjectTypes(), and ilObjectDefinition\readDefinitionData().

945  {
946  global $ilDB;
947 
948  $q = "SELECT plugin_id FROM il_plugin ".
949  " WHERE component_type = ".$ilDB->quote($a_ctype, "text").
950  " AND component_name = ".$ilDB->quote($a_cname, "text").
951  " AND slot_id = ".$ilDB->quote($a_slot_id, "text").
952  " AND name = ".$ilDB->quote($a_plugin_name, "text");
953 
954  $set = $ilDB->query($q);
955  if ($rec = $ilDB->fetchAssoc($set))
956  {
957  return $rec["plugin_id"];
958  }
959  }
+ Here is the caller graph for this function:

◆ lookupNameForId()

ilPlugin::lookupNameForId (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_plugin_id 
)

Lookup name for id.

Definition at line 924 of file class.ilPlugin.php.

Referenced by ilObjectPluginGUI\__construct(), ilObjectPlugin\__construct(), ilObjectCopySearchResultTableGUI\__construct(), ilRepositoryObjectPlugin\_getIcon(), ilRepositoryObjectPlugin\_getName(), ilObjPluginDispatchGUI\forward(), ilNavigationHistory\getItems(), ilObjectPluginListGUI\init(), ilRepositoryObjectPluginSlot\isTypePlugin(), ilRepositoryObjectPluginSlot\isTypePluginWithLP(), and ilObjectCopyGUI\showTargetSelectionTree().

925  {
926  global $ilDB;
927 
928  $q = "SELECT name FROM il_plugin ".
929  " WHERE component_type = ".$ilDB->quote($a_ctype, "text").
930  " AND component_name = ".$ilDB->quote($a_cname, "text").
931  " AND slot_id = ".$ilDB->quote($a_slot_id, "text").
932  " AND plugin_id = ".$ilDB->quote($a_plugin_id, "text");
933 
934  $set = $ilDB->query($q);
935  if ($rec = $ilDB->fetchAssoc($set))
936  {
937  return $rec["name"];
938  }
939  }
+ Here is the caller graph for this function:

◆ lookupStoredData()

static ilPlugin::lookupStoredData (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)
staticfinal

Lookup information data in il_plugin.

Definition at line 879 of file class.ilPlugin.php.

Referenced by ilPluginSlot\getPluginsInformation().

880  {
881  global $ilDB;
882 
883  $q = "SELECT * FROM il_plugin WHERE ".
884  " component_type = ".$ilDB->quote($a_ctype, "text")." AND ".
885  " component_name = ".$ilDB->quote($a_cname, "text")." AND ".
886  " slot_id = ".$ilDB->quote($a_slot_id, "text")." AND ".
887  " name = ".$ilDB->quote($a_pname, "text");
888 
889  $set = $ilDB->query($q);
890 
891  $rec = $ilDB->fetchAssoc($set);
892 
893  return $rec;
894  }
+ Here is the caller graph for this function:

◆ lookupTxt()

static ilPlugin::lookupTxt (   $a_mod_prefix,
  $a_pl_id,
  $a_lang_var 
)
static

Lookup language text.

Definition at line 497 of file class.ilPlugin.php.

References $lng.

Referenced by ilObjRole\__getPermissionDefinitions(), ilPermission2GUI\__showPermissionsCreateSection(), ilPermission2GUI\__showPermissionsGeneralSection(), ilPermission2GUI\__showPermissionsObjectSection(), ilPermission2GUI\__showPermissionsRBACSection(), ilObject\_prepareCloneSelection(), ilContainerContentGUI\addHeaderRow(), ilPDSelectedItemsBlockGUI\addHeaderRow(), ilContainerContentGUI\addMessageRow(), ilObjSystemFolderGUI\checkObject(), ilRepUtilGUI\confirmRemoveFromSystemObject(), ilTrashTableGUI\fillRow(), ilSearchResultTableGUI\fillRow(), ilLPCollectionSettingsTableGUI\fillRow(), ilObjectOwnershipManagementTableGUI\fillRow(), ilAdminSubItemsTableGUI\fillRow(), ilObjectRoleTemplatePermissionTableGUI\fillRow(), ilObjectRolePermissionTableGUI\fillRow(), ilModulesTableGUI\getComponents(), ilLPObjectStatisticsTypesTableGUI\getItems(), ilObjectStatusGUI\getPermissionInfo(), ilLPTableBaseGUI\getPossibleTypes(), ilObjectListGUI\insertIconsAndCheckboxes(), ilObjectOwnershipManagementGUI\listObjects(), ilObjectAddNewItemGUI\parseRepository(), ilObjRoleTemplateGUI\permObject(), ilObjRoleGUI\permObject(), and ilRepUtilGUI\showDeleteConfirmation().

498  {
499  global $lng;
500 
501  // this enables default language fallback
502  $prefix = $a_mod_prefix."_".$a_pl_id;
503  return $lng->txt($prefix."_".$a_lang_var, $prefix);
504 
505  /*
506  return $lng->_lookupEntry($lng->lang_key, $a_mod_prefix."_".$a_pl_id,
507  $a_mod_prefix."_".$a_pl_id."_".$a_lang_var);
508  */
509  }
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ needsUpdate()

ilPlugin::needsUpdate ( )
final

Check whether update is needed.

Definition at line 706 of file class.ilPlugin.php.

References getComponentName(), getComponentType(), getPluginName(), and getSlotId().

Referenced by activate().

707  {
708  global $ilPluginAdmin;
709 
710  return $ilPluginAdmin->isActive($this->getComponentType(),
711  $this->getComponentName(), $this->getSlotId(), $this->getPluginName());
712  }
getComponentName()
Get Component Name.
getComponentType()
Get Component Type.
getSlotId()
Get Slot ID.
getPluginName()
Get Plugin Name.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setActive()

ilPlugin::setActive (   $a_active)
finalprivate

Set Active.

Parameters
boolean$a_activeActive

Definition at line 184 of file class.ilPlugin.php.

Referenced by __init().

185  {
186  $this->active = $a_active;
187  }
+ Here is the caller graph for this function:

◆ setDBVersion()

ilPlugin::setDBVersion (   $a_dbversion)
final

Set DB Version.

Parameters
int$a_dbversionDB Version

Definition at line 224 of file class.ilPlugin.php.

Referenced by __init(), and writeDBVersion().

225  {
226  $this->dbversion = $a_dbversion;
227  }
+ Here is the caller graph for this function:

◆ setId()

ilPlugin::setId (   $a_id)
finalprivate

Set Id.

Parameters
string$a_idId

Definition at line 84 of file class.ilPlugin.php.

Referenced by __init().

85  {
86  $this->id = $a_id;
87  }
+ Here is the caller graph for this function:

◆ setIliasMaxVersion()

ilPlugin::setIliasMaxVersion (   $a_iliasmaxversion)
finalprivate

Set Required ILIAS max.

release.

Parameters
string$a_iliasmaxversionRequired ILIAS max. release

Definition at line 164 of file class.ilPlugin.php.

Referenced by __init().

165  {
166  $this->iliasmaxversion = $a_iliasmaxversion;
167  }
+ Here is the caller graph for this function:

◆ setIliasMinVersion()

ilPlugin::setIliasMinVersion (   $a_iliasminversion)
finalprivate

Set Required ILIAS min.

release.

Parameters
string$a_iliasminversionRequired ILIAS min. release

Definition at line 144 of file class.ilPlugin.php.

Referenced by __init().

145  {
146  $this->iliasminversion = $a_iliasminversion;
147  }
+ Here is the caller graph for this function:

◆ setLastUpdateVersion()

ilPlugin::setLastUpdateVersion (   $a_lastupdateversion)
finalprivate

Set Version of last update.

Parameters
string$a_lastupdateversionVersion of last update

Definition at line 104 of file class.ilPlugin.php.

Referenced by __init().

105  {
106  $this->lastupdateversion = $a_lastupdateversion;
107  }
+ Here is the caller graph for this function:

◆ setSlotObject()

ilPlugin::setSlotObject (   $a_slot)
finalprotected

Set Plugin Slot.

Parameters
object$a_slotPlugin Slot

Definition at line 204 of file class.ilPlugin.php.

Referenced by __init().

205  {
206  $this->slot = $a_slot;
207  }
+ Here is the caller graph for this function:

◆ setVersion()

ilPlugin::setVersion (   $a_version)
finalprivate

Set Current Version (from plugin.php file).

Parameters
string$a_versionCurrent Version (from plugin.php file)

Definition at line 124 of file class.ilPlugin.php.

Referenced by __init().

125  {
126  $this->version = $a_version;
127  }
+ Here is the caller graph for this function:

◆ slotInit()

ilPlugin::slotInit ( )
abstractprotected

Object initialization done by slot.

Must be overwritten in plugin class of plugin slot.

(and should be made protected final)

Referenced by __init().

+ Here is the caller graph for this function:

◆ txt()

ilPlugin::txt (   $a_var)
final

Get Language Variable (prefix will be prepended automatically)

Definition at line 487 of file class.ilPlugin.php.

References $lng, getPrefix(), and loadLanguageModule().

Referenced by ilTestExportPlugin\getFormat().

488  {
489  global $lng;
490  $this->loadLanguageModule();
491  return $lng->txt($this->getPrefix()."_".$a_var, $this->getPrefix());
492  }
loadLanguageModule()
Load language module for plugin.
getPrefix()
Get plugin prefix, used for lang vars.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilPlugin::update ( )
final

Update plugin.

Definition at line 795 of file class.ilPlugin.php.

References $ilCtrl, $result, getComponentName(), getComponentType(), getConfigureClassName(), getDirectory(), getPluginName(), getPrefix(), getSlotId(), getVersion(), updateDatabase(), and updateLanguages().

Referenced by activate().

796  {
797  global $ilDB, $ilCtrl;
798 
799  $result = true;
800 
801  // DB update
802  if ($result === true)
803  {
804  $result = $this->updateDatabase();
805  }
806 
807  // Load language files
808  $this->updateLanguages();
809 
810  // load control structure
811  include_once("./setup/classes/class.ilCtrlStructureReader.php");
812  $structure_reader = new ilCtrlStructureReader();
813  $structure_reader->readStructure(true, "./".$this->getDirectory(), $this->getPrefix(),
814  $this->getDirectory());
815 // $ilCtrl->storeCommonStructures();
816 
817  // add config gui to the ctrl calls
818  $ilCtrl->insertCtrlCalls("ilobjcomponentsettingsgui", ilPlugin::getConfigureClassName($this->getPluginName()),
819  $this->getPrefix());
820 
821  // set last update version to current version
822  if ($result === true)
823  {
824  $q = "UPDATE il_plugin SET last_update_version = ".$ilDB->quote($this->getVersion(), "text").
825  " WHERE component_type = ".$ilDB->quote($this->getComponentType(), "text").
826  " AND component_name = ".$ilDB->quote($this->getComponentName(), "text").
827  " AND slot_id = ".$ilDB->quote($this->getSlotId(), "text").
828  " AND name = ".$ilDB->quote($this->getPluginName(), "text");
829 
830  $ilDB->manipulate($q);
831  }
832 
833  return $result;
834  }
getVersion()
Get Current Version (from plugin.php file).
$result
static getConfigureClassName($a_name)
Get plugin configure class name.
getComponentName()
Get Component Name.
Class ilCtrlStructureReader.
global $ilCtrl
Definition: ilias.php:18
getComponentType()
Get Component Type.
updateDatabase()
Update database.
getDirectory()
Get Plugin Directory.
updateLanguages()
Update all languages.
getPrefix()
Get plugin prefix, used for lang vars.
getSlotId()
Get Slot ID.
getPluginName()
Get Plugin Name.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateDatabase()

ilPlugin::updateDatabase ( )

Update database.

Definition at line 439 of file class.ilPlugin.php.

References $lng, $result, $row, getComponentName(), getComponentType(), getPluginName(), getSlotId(), and getTablePrefix().

Referenced by update().

440  {
441  global $ilDB, $lng;
442 
443  include_once("./Services/Component/classes/class.ilPluginDBUpdate.php");
444  $dbupdate = new ilPluginDBUpdate($this->getComponentType(),
445  $this->getComponentName(), $this->getSlotId(),
446  $this->getPluginName(), $ilDB, true, $this->getTablePrefix());
447 
448  //$dbupdate->getDBVersionStatus();
449  //$dbupdate->getCurrentVersion();
450 
451  $result = $dbupdate->applyUpdate();
452 
453  if ($dbupdate->updateMsg == "no_changes")
454  {
455  $message = $lng->txt("no_changes").". ".$lng->txt("database_is_uptodate");
456  }
457  else
458  {
459  foreach ($dbupdate->updateMsg as $row)
460  {
461  $message .= $lng->txt($row["msg"]).": ".$row["nr"]."<br/>";
462  }
463  }
464 
465  $this->message.= $message;
466 
467  return $result;
468  }
getTablePrefix()
Get db table plugin prefix.
$result
Database Update class.
getComponentName()
Get Component Name.
getComponentType()
Get Component Type.
getSlotId()
Get Slot ID.
global $lng
Definition: privfeed.php:40
getPluginName()
Get Plugin Name.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateLanguages()

ilPlugin::updateLanguages ( )
final

Update all languages.

Definition at line 400 of file class.ilPlugin.php.

References $ilCtrl, $lang, $row, getAvailableLangFiles(), getLanguageDirectory(), getPrefix(), ilObjLanguage\replaceLangEntry(), and ilObjLanguage\replaceLangModule().

Referenced by update().

401  {
402  global $ilCtrl;
403 
404  include_once("./Services/Language/classes/class.ilObjLanguage.php");
405 
406  $langs = $this->getAvailableLangFiles($this->getLanguageDirectory());
407 
408  $prefix = $this->getPrefix();
409 
410  foreach($langs as $lang)
411  {
412  $txt = file($this->getLanguageDirectory()."/".$lang["file"]);
413  $lang_array = array();
414 
415  // get language data
416  if (is_array($txt))
417  {
418  foreach ($txt as $row)
419  {
420  if ($row[0] != "#" && strpos($row, "#:#") > 0)
421  {
422  $a = explode("#:#",trim($row));
423  $lang_array[$prefix."_".trim($a[0])] = trim($a[1]);
424  ilObjLanguage::replaceLangEntry($prefix, $prefix."_".trim($a[0]),
425  $lang["key"], trim($a[1]));
426 //echo "<br>-$prefix-".$prefix."_".trim($a[0])."-".$lang["key"]."-";
427  }
428  }
429  }
430 
431  ilObjLanguage::replaceLangModule($lang["key"], $prefix,
432  $lang_array);
433  }
434  }
static replaceLangEntry($a_module, $a_identifier, $a_lang_key, $a_value, $a_local_change=null, $a_remarks=null)
Replace lang entry.
static replaceLangModule($a_key, $a_module, $a_array)
Replace language module array.
global $ilCtrl
Definition: ilias.php:18
getPrefix()
Get plugin prefix, used for lang vars.
static getAvailableLangFiles($a_lang_directory)
Get array of all language files in the plugin.
getLanguageDirectory()
Get Plugin&#39;s language Directory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeDBVersion()

ilPlugin::writeDBVersion (   $a_dbversion)
final

Write DB version to database.

Parameters
int$a_dbversionDB Version

Definition at line 244 of file class.ilPlugin.php.

References getComponentName(), getComponentType(), getDBVersion(), getPluginName(), getSlotId(), and setDBVersion().

245  {
246  global $ilDB;
247 
248  $this->setDBVersion($a_dbversion);
249 
250  $q = "UPDATE il_plugin SET db_version = ".$ilDB->quote((int) $this->getDBVersion(), "integer").
251  " WHERE component_type = ".$ilDB->quote($this->getComponentType(), "text").
252  " AND component_name = ".$ilDB->quote($this->getComponentName(), "text").
253  " AND slot_id = ".$ilDB->quote($this->getSlotId(), "text").
254  " AND name = ".$ilDB->quote($this->getPluginName(), "text");
255 
256  $ilDB->manipulate($q);
257  }
getComponentName()
Get Component Name.
getComponentType()
Get Component Type.
setDBVersion($a_dbversion)
Set DB Version.
getDBVersion()
Get DB Version.
getSlotId()
Get Slot ID.
getPluginName()
Get Plugin Name.
+ Here is the call graph for this function:

Field Documentation

◆ $lang_initialised

ilPlugin::$lang_initialised = false
protected

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


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