Adding isset validation

skala
Julio Montoya 13 years ago
parent 72d49f1bc2
commit 2c1c0ece3c
  1. 8
      main/inc/lib/plugin.lib.php

@ -249,6 +249,7 @@ class AppPlugin {
*/
function get_plugin_info($plugin_name, $forced = false) {
static $plugin_data = array();
if (isset($plugin_data[$plugin_name]) && $forced == false) {
return $plugin_data[$plugin_name];
} else {
@ -395,11 +396,15 @@ class AppPlugin {
}
if ($i>0) {
$plugin_info = $this->get_plugin_info($plugin_name);
if (isset($plugin_info['plugin_class'])) {
$obj = $plugin_info['plugin_class']::create();
$obj->course_settings_updated($subvalues);
}
}
}
}
/**
* Gets a nice array of keys for just the plugin's course settings
* @param string The plugin ID
@ -409,6 +414,8 @@ class AppPlugin {
$settings = array();
if (empty($plugin_name)) { return $settings; }
$plugin_info = $this->get_plugin_info($plugin_name);
if (isset($plugin_info['plugin_class'])) {
$obj = $plugin_info['plugin_class']::create();
if (is_array($obj->course_settings)) {
foreach ($obj->course_settings as $item) {
@ -422,6 +429,7 @@ class AppPlugin {
}
}
unset($obj); unset($plugin_info);
}
return $settings;
}
}

Loading…
Cancel
Save