Commit 5f758eb7 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Remove use of istemplate argument in blocks' instance_config_form and...


Remove use of istemplate argument in blocks' instance_config_form and artefactchooser_element functions
Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 265ebecc
......@@ -78,7 +78,7 @@ class PluginBlocktypeBlog extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance, $istemplate) {
public static function instance_config_form($instance) {
global $USER;
safe_require('artefact', 'blog');
$configdata = $instance->get('configdata');
......@@ -98,7 +98,7 @@ class PluginBlocktypeBlog extends PluginBlocktype {
// Note: the owner check will have to change when we do group/site
// blogs
if (empty($configdata['artefactid']) || $blog->get('owner') == $USER->get('id')) {
$elements[] = self::artefactchooser_element((isset($configdata['artefactid'])) ? $configdata['artefactid'] : null, $istemplate);
$elements[] = self::artefactchooser_element((isset($configdata['artefactid'])) ? $configdata['artefactid'] : null);
$elements[] = PluginArtefactBlog::block_advanced_options_element($configdata, 'blog');
}
else {
......@@ -147,7 +147,7 @@ class PluginBlocktypeBlog extends PluginBlocktype {
return $artefacts;
}
public static function artefactchooser_element($default=null, $istemplate=false) {
public static function artefactchooser_element($default=null) {
return array(
'name' => 'artefactid',
'type' => 'artefactchooser',
......
......@@ -106,7 +106,7 @@ class PluginBlocktypeBlogpost extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance, $istemplate) {
public static function instance_config_form($instance) {
global $USER;
safe_require('artefact', 'blog');
$configdata = $instance->get('configdata');
......@@ -139,7 +139,7 @@ class PluginBlocktypeBlogpost extends PluginBlocktype {
return $elements;
}
public static function artefactchooser_element($default=null, $istemplate=false) {
public static function artefactchooser_element($default=null) {
$extrajoin = ' JOIN {artefact_blog_blogpost} ON {artefact_blog_blogpost}.blogpost = a.id ';
$element = array(
......
......@@ -77,14 +77,14 @@ class PluginBlocktypeRecentposts extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance, $istemplate) {
public static function instance_config_form($instance) {
safe_require('artefact', 'blog');
$configdata = $instance->get('configdata');
$elements = array(self::artefactchooser_element((isset($configdata['artefactids'])) ? $configdata['artefactids'] : null));
return $elements;
}
public static function artefactchooser_element($default=null, $istemplate=false) {
public static function artefactchooser_element($default=null) {
return array(
'name' => 'artefactids',
'type' => 'artefactchooser',
......
......@@ -98,7 +98,7 @@ class PluginBlocktypeFiledownload extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance, $istemplate) {
public static function instance_config_form($instance) {
$configdata = $instance->get('configdata');
safe_require('artefact', 'file');
$instance->set('artefactplugin', 'file');
......@@ -107,7 +107,7 @@ class PluginBlocktypeFiledownload extends PluginBlocktype {
);
}
public static function artefactchooser_element($default=null, $istemplate=false) {
public static function artefactchooser_element($default=null) {
return array(
'name' => 'artefactids',
'type' => 'artefactchooser',
......
......@@ -78,7 +78,7 @@ class PluginBlocktypeFolder extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance, $istemplate) {
public static function instance_config_form($instance) {
$configdata = $instance->get('configdata');
safe_require('artefact', 'file');
$instance->set('artefactplugin', 'file');
......@@ -87,7 +87,7 @@ class PluginBlocktypeFolder extends PluginBlocktype {
);
}
public static function artefactchooser_element($default=null, $istemplate=false) {
public static function artefactchooser_element($default=null) {
return array(
'name' => 'artefactid',
'type' => 'artefactchooser',
......
......@@ -63,7 +63,7 @@ class PluginBlocktypeHtml extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance, $istemplate) {
public static function instance_config_form($instance) {
$configdata = $instance->get('configdata');
safe_require('artefact', 'file');
$instance->set('artefactplugin', 'file');
......@@ -92,7 +92,7 @@ class PluginBlocktypeHtml extends PluginBlocktype {
return $element;
}
public static function artefactchooser_element($default=null, $istemplate=false) {
public static function artefactchooser_element($default=null) {
$extraselect = 'filetype IN (' . join(',', array_map('db_quote', self::get_allowed_mimetypes())) . ')';
$extrajoin = ' JOIN {artefact_file_files} ON {artefact_file_files}.artefact = a.id ';
......
......@@ -83,7 +83,7 @@ class PluginBlocktypeImage extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance, $istemplate) {
public static function instance_config_form($instance) {
$configdata = $instance->get('configdata');
safe_require('artefact', 'file');
$instance->set('artefactplugin', 'file');
......@@ -119,7 +119,7 @@ class PluginBlocktypeImage extends PluginBlocktype {
return $element;
}
public static function artefactchooser_element($default=null, $istemplate=false) {
public static function artefactchooser_element($default=null) {
return array(
'name' => 'artefactid',
'type' => 'artefactchooser',
......
......@@ -76,7 +76,7 @@ class PluginBlocktypeInternalmedia extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance, $istemplate) {
public static function instance_config_form($instance) {
$configdata = $instance->get('configdata');
safe_require('artefact', 'file');
$instance->set('artefactplugin', 'file');
......@@ -109,7 +109,7 @@ class PluginBlocktypeInternalmedia extends PluginBlocktype {
return $element;
}
public static function artefactchooser_element($default=null, $istemplate=false) {
public static function artefactchooser_element($default=null) {
$extraselect = 'filetype IN (' . join(',', array_map('db_quote', self::get_allowed_mimetypes())) . ')';
$extrajoin = ' JOIN {artefact_file_files} ON {artefact_file_files}.artefact = a.id ';
......
......@@ -82,7 +82,7 @@ class PluginBlocktypeContactinfo extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance, $istemplate) {
public static function instance_config_form($instance) {
$configdata = $instance->get('configdata');
$form = array();
......@@ -121,7 +121,7 @@ class PluginBlocktypeContactinfo extends PluginBlocktype {
}
// TODO: make decision on whether this should be abstract or not
public static function artefactchooser_element($default=null, $istemplate=false) {
public static function artefactchooser_element($default=null) {
safe_require('artefact', 'internal');
return array(
'name' => 'artefactids',
......
......@@ -116,7 +116,7 @@ class PluginBlocktypeProfileinfo extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance, $istemplate) {
public static function instance_config_form($instance) {
$configdata = $instance->get('configdata');
$form = array();
......@@ -195,7 +195,7 @@ class PluginBlocktypeProfileinfo extends PluginBlocktype {
return $form;
}
public static function artefactchooser_element($default=null, $istemplate=false) {
public static function artefactchooser_element($default=null) {
safe_require('artefact', 'internal');
return array(
'name' => 'artefactids',
......
......@@ -79,7 +79,7 @@ class PluginBlocktypeEntireresume extends PluginBlocktype {
return array();
}
public static function artefactchooser_element($default=null, $istemplate=false) {
public static function artefactchooser_element($default=null) {
}
/**
......
......@@ -79,7 +79,7 @@ class PluginBlocktypeResumefield extends PluginBlocktype {
return true;
}
public static function instance_config_form($instance, $istemplate) {
public static function instance_config_form($instance) {
$configdata = $instance->get('configdata');
$form = array();
......@@ -100,7 +100,7 @@ class PluginBlocktypeResumefield extends PluginBlocktype {
}
// TODO: make decision on whether this should be abstract or not
public static function artefactchooser_element($default=null, $istemplate=false) {
public static function artefactchooser_element($default=null) {
safe_require('artefact', 'resume');
return array(
'name' => 'artefactid',
......
......@@ -98,9 +98,8 @@ abstract class PluginBlocktype extends Plugin {
* blocktype that the form is for.
*
* @param mixed $default The default value for the element
* @param boolean $istemplate Whether the View this block is in is a template
*/
public static abstract function artefactchooser_element($default=null, $istemplate=false);
public static abstract function artefactchooser_element($default=null);
/**
* subclasses can override this if they need to do something a bit special
......@@ -360,7 +359,7 @@ abstract class SystemBlockType extends PluginBlockType {
return array();
}
public final static function artefactchooser_element($default=null, $istemplate=false) {
public final static function artefactchooser_element($default=null) {
}
}
......
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