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