本文整理汇总了PHP中ilPlugin::getPluginRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP ilPlugin::getPluginRecord方法的具体用法?PHP ilPlugin::getPluginRecord怎么用?PHP ilPlugin::getPluginRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilPlugin
的用法示例。
在下文中一共展示了ilPlugin::getPluginRecord方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPluginTablePrefix
public function getPluginTablePrefix()
{
$id = $this->getId();
if (!$id) {
$rec = ilPlugin::getPluginRecord($this->getComponentType(), $this->getComponentName(), $this->getSlotId(), $this->getPluginName());
$id = $rec['plugin_id'];
}
return $this->getSlotObject()->getPrefix() . "_" . $id;
}
示例2: __init
/**
* Default initialization
*/
private final function __init()
{
global $ilDB, $lng, $ilPluginAdmin;
// read/set basic data
$rec = ilPlugin::getPluginRecord($this->getComponentType(), $this->getComponentName(), $this->getSlotId(), $this->getPluginName());
$this->setLastUpdateVersion($rec["last_update_version"]);
$this->setDBVersion($rec["db_version"]);
$this->setActive($rec["active"]);
// get id
$this->setId($ilPluginAdmin->getId($this->getComponentType(), $this->getComponentName(), $this->getSlotId(), $this->getPluginName()));
// get version
$this->setVersion($ilPluginAdmin->getVersion($this->getComponentType(), $this->getComponentName(), $this->getSlotId(), $this->getPluginName()));
// get ilias min version
$this->setIliasMinVersion($ilPluginAdmin->getIliasMinVersion($this->getComponentType(), $this->getComponentName(), $this->getSlotId(), $this->getPluginName()));
// get ilias max version
$this->setIliasMaxVersion($ilPluginAdmin->getIliasMaxVersion($this->getComponentType(), $this->getComponentName(), $this->getSlotId(), $this->getPluginName()));
// get slot object
$this->setSlotObject(new ilPluginSlot($this->getComponentType(), $this->getComponentName(), $this->getSlotId()));
// load language module
// Fix for authentication plugins
$this->loadLanguageModule();
// call slot and plugin init methods
$this->slotInit();
$this->init();
}
示例3: getPluginData
/**
* Get basic data of plugin from plugin.php
*
* @param string $a_ctype Component Type
* @param string $a_cname Component Name
* @param string $a_slot_id Slot ID
* @param string $a_pname Plugin Name
*/
private final function getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname)
{
global $ilDB, $lng;
if (!isset($this->got_data[$a_ctype][$a_cname][$a_slot_id][$a_pname])) {
include_once "./Services/Component/classes/class.ilPluginSlot.php";
$slot_name = ilPluginSlot::lookupSlotName($a_ctype, $a_cname, $a_slot_id);
$plugin_php_file = "./Customizing/global/plugins/" . $a_ctype . "/" . $a_cname . "/" . $slot_name . "/" . $a_pname . "/plugin.php";
$rec = ilPlugin::getPluginRecord($a_ctype, $a_cname, $a_slot_id, $a_pname);
if (is_file($plugin_php_file)) {
include_once $plugin_php_file;
$this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname] = array("version" => $version, "id" => $id, "ilias_min_version" => $ilias_min_version, "ilias_max_version" => $ilias_max_version, "responsible" => $responsible, "responsible_mail" => $responsible_mail, "learning_progress" => (bool) $learning_progress);
}
$active = $rec["active"];
$needs_update = false;
$activation_possible = !$active;
$inactive_reason = "";
// version checks
if (ilComponent::isVersionGreaterString($ilias_min_version, ILIAS_VERSION_NUMERIC)) {
$active = false;
if (is_object($lng)) {
$inactive_reason = $lng->txt("cmps_needs_newer_ilias_version");
} else {
$inactive_reason = "Plugin needs a newer version of ILIAS.";
}
$activation_possible = false;
} else {
if (ilComponent::isVersionGreaterString(ILIAS_VERSION_NUMERIC, $ilias_max_version)) {
$active = false;
if (is_object($lng)) {
$inactive_reason = $lng->txt("cmps_needs_newer_plugin_version");
} else {
$inactive_reason = "Plugin does not support current version of ILIAS. Newer version of plugin needed.";
}
$activation_possible = false;
} else {
if ($rec["last_update_version"] == "") {
$active = false;
if (is_object($lng)) {
$inactive_reason = $lng->txt("cmps_needs_update");
} else {
$inactive_reason = "Update needed.";
}
$needs_update = true;
$activation_possible = false;
} else {
if (ilComponent::isVersionGreaterString($rec["last_update_version"], $version)) {
$active = false;
if (is_object($lng)) {
$inactive_reason = $lng->txt("cmps_needs_upgrade");
} else {
$inactive_reason = "Upgrade needed.";
}
$activation_possible = false;
} else {
if ($rec["last_update_version"] != $version) {
$active = false;
if (is_object($lng)) {
$inactive_reason = $lng->txt("cmps_needs_update");
} else {
$inactive_reason = "Update needed.";
}
$needs_update = true;
$activation_possible = false;
}
}
}
}
}
$this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["is_active"] = $active;
$this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["inactive_reason"] = $inactive_reason;
$this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["needs_update"] = $needs_update;
$this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["activation_possible"] = $activation_possible;
$this->got_data[$a_ctype][$a_cname][$a_slot_id][$a_pname] = true;
}
}