Commit 2dbcef7d authored by Son Nguyen's avatar Son Nguyen Committed by Aaron Wells
Browse files

Refactor mahara plugin classes

... in order to silence all the E_ALL notices

Change-Id: I0fdc9fc68ae7ffd2fa2dffe68dfbd79ee9599c06
parent b5d0274f
......@@ -108,7 +108,7 @@ class PluginBlocktypeBlog extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
global $USER;
safe_require('artefact', 'blog');
$configdata = $instance->get('configdata');
......
......@@ -100,7 +100,7 @@ class PluginBlocktypeBlogpost extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
global $USER;
safe_require('artefact', 'blog');
$configdata = $instance->get('configdata');
......
......@@ -92,7 +92,7 @@ class PluginBlocktypeRecentposts extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
safe_require('artefact', 'blog');
$configdata = $instance->get('configdata');
$elements = array(self::artefactchooser_element((isset($configdata['artefactids'])) ? $configdata['artefactids'] : null),
......
......@@ -142,7 +142,7 @@ class PluginBlocktypeTaggedposts extends SystemBlocktype {
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
global $USER;
$configdata = $instance->get('configdata');
......
......@@ -77,7 +77,7 @@ class PluginBlocktypeFiledownload extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
$configdata = $instance->get('configdata');
safe_require('artefact', 'file');
$instance->set('artefactplugin', 'file');
......
......@@ -106,7 +106,7 @@ class PluginBlocktypeFolder extends PluginBlocktype {
);
}
public static function save_config_options($form, $values) {
public static function save_config_options(Pieform $form, $values) {
set_config_plugin('blocktype', 'folder', 'sortorder', $values['sortorder']);
set_config_plugin('blocktype', 'folder', 'folderdownloadzip', $values['folderdownloadzip']);
}
......@@ -121,7 +121,7 @@ class PluginBlocktypeFolder extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
$configdata = $instance->get('configdata');
safe_require('artefact', 'file');
$instance->set('artefactplugin', 'file');
......
......@@ -39,7 +39,7 @@ class PluginBlocktypeGallery extends PluginBlocktype {
}
}
public static function get_instance_config_javascript() {
public static function get_instance_config_javascript(BlockInstance $instance) {
return array(
'js/configform.js',
'js/slideshow.js',
......@@ -491,7 +491,7 @@ class PluginBlocktypeGallery extends PluginBlocktype {
}
public static function save_config_options($form, $values) {
public static function save_config_options(Pieform $form, $values) {
set_config_plugin('blocktype', 'gallery', 'useslimbox2', (int)$values['useslimbox2']);
set_config_plugin('blocktype', 'gallery', 'photoframe', (int)$values['photoframe']);
set_config_plugin('blocktype', 'gallery', 'previewwidth', (int)$values['previewwidth']);
......@@ -512,7 +512,7 @@ class PluginBlocktypeGallery extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
$configdata = $instance->get('configdata');
safe_require('artefact', 'file');
$instance->set('artefactplugin', 'file');
......@@ -587,7 +587,7 @@ class PluginBlocktypeGallery extends PluginBlocktype {
);
}
public static function instance_config_validate($form, $values) {
public static function instance_config_validate(Pieform $form, $values) {
global $USER;
if (!empty($values['images'])) {
......
......@@ -59,7 +59,7 @@ class PluginBlocktypeHtml extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
$configdata = $instance->get('configdata');
safe_require('artefact', 'file');
$instance->set('artefactplugin', 'file');
......
......@@ -69,7 +69,7 @@ class PluginBlocktypeImage extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
$configdata = $instance->get('configdata');
safe_require('artefact', 'file');
$instance->set('artefactplugin', 'file');
......
......@@ -78,14 +78,14 @@ class PluginBlocktypeInternalmedia extends PluginBlocktype {
return true;
}
public static function get_instance_config_javascript() {
public static function get_instance_config_javascript(BlockInstance $instance) {
$result = self::get_js_source(true);
if (!empty($result)) {
return $result;
}
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
$configdata = $instance->get('configdata');
safe_require('artefact', 'file');
$instance->set('artefactplugin', 'file');
......@@ -139,7 +139,7 @@ class PluginBlocktypeInternalmedia extends PluginBlocktype {
return $artefact;
}
public static function save_config_options($form, $values) {
public static function save_config_options(Pieform $form, $values) {
$enabledtypes = array();
foreach ($values as $type => $enabled) {
if (!in_array($type, self::get_all_filetypes())) {
......
......@@ -63,7 +63,7 @@ class PluginBlocktypePdf extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
$configdata = $instance->get('configdata');
safe_require('artefact', 'file');
$instance->set('artefactplugin', 'file');
......
......@@ -25,7 +25,7 @@ class PluginBlocktypeProfileinfo extends PluginBlocktype {
return array('internal');
}
public static function get_instance_config_javascript() {
public static function get_instance_config_javascript(BlockInstance $instance) {
return array('js/configform.js');
}
......@@ -128,7 +128,7 @@ class PluginBlocktypeProfileinfo extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
$configdata = $instance->get('configdata');
$form = array();
......
......@@ -73,7 +73,7 @@ class PluginBlocktypeSocialprofile extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
$configdata = $instance->get('configdata');
$form = array();
......
......@@ -119,7 +119,7 @@ class PluginBlocktypeTextbox extends PluginBlocktype {
return $artefact;
}
public static function get_instance_config_javascript($instance) {
public static function get_instance_config_javascript(BlockInstance $instance) {
// When an artefact is selected in the artefactchooser, update the
// contents of the wysiwyg editor and the message about the number
// of blocks containing the new artefact.
......@@ -271,7 +271,7 @@ EOF;
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
global $USER;
require_once('license.php');
safe_require('artefact', 'file');
......
......@@ -98,7 +98,7 @@ class PluginBlocktypePlans extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
$instance->set('artefactplugin', 'plans');
$configdata = $instance->get('configdata');
......
......@@ -57,7 +57,7 @@ class PluginBlocktypeEntireresume extends PluginBlocktype {
return true;
}
public static function instance_config_form() {
public static function instance_config_form(BlockInstance $instance) {
return array();
}
......
......@@ -61,7 +61,7 @@ class PluginBlocktypeResumefield extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance) {
public static function instance_config_form(BlockInstance $instance) {
$configdata = $instance->get('configdata');
$form = array();
......
......@@ -177,7 +177,7 @@ class PluginAuthBrowserid extends PluginAuth {
return false;
}
public static function save_instance_config_options($values, $form) {
public static function save_instance_config_options($values, Pieform $form) {
$authinstance = new stdClass();
......
......@@ -214,7 +214,7 @@ class PluginAuthImap extends PluginAuth {
);
}
public static function save_instance_config_options($values, $form) {
public static function save_instance_config_options($values, Pieform $form) {
$authinstance = new stdClass();
......
......@@ -1972,7 +1972,7 @@ class PluginAuthLdap extends PluginAuth {
}
public static function save_instance_config_options($values, $form) {
public static function save_instance_config_options($values, Pieform $form) {
$authinstance = new stdClass();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment