|
|
|
|
@ -47,7 +47,7 @@ class Plugin |
|
|
|
|
array('name' => 'big_blue_button_record_and_store', 'type' => 'checkbox') |
|
|
|
|
); |
|
|
|
|
*/ |
|
|
|
|
public $course_settings = array(); |
|
|
|
|
public $course_settings = []; |
|
|
|
|
/** |
|
|
|
|
* This indicates whether changing the setting should execute the callback |
|
|
|
|
* function. |
|
|
|
|
@ -61,7 +61,7 @@ class Plugin |
|
|
|
|
* @param string $author of this plugin |
|
|
|
|
* @param array $settings settings to be proposed to configure the plugin |
|
|
|
|
*/ |
|
|
|
|
protected function __construct($version, $author, $settings = array()) |
|
|
|
|
protected function __construct($version, $author, $settings = []) |
|
|
|
|
{ |
|
|
|
|
$this->version = $version; |
|
|
|
|
$this->author = $author; |
|
|
|
|
@ -77,7 +77,7 @@ class Plugin |
|
|
|
|
*/ |
|
|
|
|
public function get_info() |
|
|
|
|
{ |
|
|
|
|
$result = array(); |
|
|
|
|
$result = []; |
|
|
|
|
$result['obj'] = $this; |
|
|
|
|
$result['title'] = $this->get_title(); |
|
|
|
|
$result['comment'] = $this->get_comment(); |
|
|
|
|
@ -88,7 +88,7 @@ class Plugin |
|
|
|
|
$result['is_admin_plugin'] = $this->isAdminPlugin; |
|
|
|
|
$result['is_mail_plugin'] = $this->isMailPlugin; |
|
|
|
|
|
|
|
|
|
if ($form = $this->get_settings_form()) { |
|
|
|
|
if ($form = $this->getSettingsForm()) { |
|
|
|
|
$result['settings_form'] = $form; |
|
|
|
|
|
|
|
|
|
foreach ($this->fields as $name => $type) { |
|
|
|
|
@ -173,7 +173,7 @@ class Plugin |
|
|
|
|
if (!is_readable($path)) { |
|
|
|
|
return ''; |
|
|
|
|
} |
|
|
|
|
$css = array(); |
|
|
|
|
$css = []; |
|
|
|
|
$css[] = file_get_contents($path); |
|
|
|
|
$result = implode($css); |
|
|
|
|
|
|
|
|
|
@ -184,13 +184,13 @@ class Plugin |
|
|
|
|
* Returns an HTML form (generated by FormValidator) of the plugin settings |
|
|
|
|
* @return FormValidator FormValidator-generated form |
|
|
|
|
*/ |
|
|
|
|
public function get_settings_form() |
|
|
|
|
public function getSettingsForm() |
|
|
|
|
{ |
|
|
|
|
$result = new FormValidator($this->get_name()); |
|
|
|
|
|
|
|
|
|
$defaults = array(); |
|
|
|
|
$checkboxGroup = array(); |
|
|
|
|
$checkboxCollection = array(); |
|
|
|
|
$defaults = []; |
|
|
|
|
$checkboxGroup = []; |
|
|
|
|
$checkboxCollection = []; |
|
|
|
|
|
|
|
|
|
if ($checkboxNames = array_keys($this->fields, 'checkbox')) { |
|
|
|
|
$pluginInfoCollection = api_get_settings('Plugins'); |
|
|
|
|
@ -235,7 +235,7 @@ class Plugin |
|
|
|
|
$result->addElement($type, $name, array($this->get_lang($name), $help)); |
|
|
|
|
break; |
|
|
|
|
case 'boolean': |
|
|
|
|
$group = array(); |
|
|
|
|
$group = []; |
|
|
|
|
$group[] = $result->createElement( |
|
|
|
|
'radio', |
|
|
|
|
$name, |
|
|
|
|
@ -380,7 +380,7 @@ class Plugin |
|
|
|
|
$english_path = $root.$plugin_name."/lang/english.php"; |
|
|
|
|
|
|
|
|
|
if (is_readable($english_path)) { |
|
|
|
|
$strings = array(); |
|
|
|
|
$strings = []; |
|
|
|
|
include $english_path; |
|
|
|
|
$this->strings = $strings; |
|
|
|
|
} |
|
|
|
|
@ -644,7 +644,7 @@ class Plugin |
|
|
|
|
*/ |
|
|
|
|
public function getCourseSettings() |
|
|
|
|
{ |
|
|
|
|
$settings = array(); |
|
|
|
|
$settings = []; |
|
|
|
|
if (is_array($this->course_settings)) { |
|
|
|
|
foreach ($this->course_settings as $item) { |
|
|
|
|
if (isset($item['group'])) { |
|
|
|
|
@ -666,7 +666,7 @@ class Plugin |
|
|
|
|
* @param array $values sent back from the course configuration script |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
public function course_settings_updated($values = array()) |
|
|
|
|
public function course_settings_updated($values = []) |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -755,9 +755,9 @@ class Plugin |
|
|
|
|
*/ |
|
|
|
|
public function deleteTab($key) |
|
|
|
|
{ |
|
|
|
|
$t = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT); |
|
|
|
|
$table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT); |
|
|
|
|
$sql = "SELECT * |
|
|
|
|
FROM $t |
|
|
|
|
FROM $table |
|
|
|
|
WHERE variable = 'show_tabs' |
|
|
|
|
AND subkey <> '$key' |
|
|
|
|
AND subkey like 'custom_tab_%' |
|
|
|
|
@ -786,7 +786,6 @@ class Plugin |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$attributes = ['subkey' => $newSubKey]; |
|
|
|
|
|
|
|
|
|
$this->updateTab($row['subkey'], $attributes); |
|
|
|
|
$i++; |
|
|
|
|
} |
|
|
|
|
|