Commit 8d54236c authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Allow blocktypes in all viewtypes by default

parent 77deec6a
......@@ -55,10 +55,6 @@ class PluginBlocktypeBlog extends PluginBlocktype {
return array('blog');
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
public static function render_instance(BlockInstance $instance, $editing=false) {
$configdata = $instance->get('configdata');
......
......@@ -55,10 +55,6 @@ class PluginBlocktypeBlogpost extends PluginBlocktype {
return array('blog');
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
public static function render_instance(BlockInstance $instance, $editing=false) {
$configdata = $instance->get('configdata');
......
......@@ -41,10 +41,6 @@ class PluginBlocktypeRecentposts extends PluginBlocktype {
return array('blog');
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
public static function render_instance(BlockInstance $instance, $editing=false) {
$configdata = $instance->get('configdata');
......
......@@ -40,10 +40,6 @@ class PluginBlocktypeFiledownload extends PluginBlocktype {
return array('fileimagevideo');
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
public static function render_instance(BlockInstance $instance, $editing=false) {
require_once(get_config('docroot') . 'artefact/lib.php');
$configdata = $instance->get('configdata');
......
......@@ -55,10 +55,6 @@ class PluginBlocktypeFolder extends PluginBlocktype {
return array('fileimagevideo');
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
public static function render_instance(BlockInstance $instance, $editing=false) {
require_once(get_config('docroot') . 'artefact/lib.php');
$configdata = $instance->get('configdata');
......
......@@ -114,10 +114,6 @@ class PluginBlocktypeHtml extends PluginBlocktype {
return $element;
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
public static function default_copy_type() {
return 'full';
}
......
......@@ -40,10 +40,6 @@ class PluginBlocktypeImage extends PluginBlocktype {
return array('fileimagevideo');
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
public static function render_instance(BlockInstance $instance, $editing=false) {
$configdata = $instance->get('configdata'); // this will make sure to unserialize it for us
$configdata['viewid'] = $instance->get('view');
......
......@@ -40,10 +40,6 @@ class PluginBlocktypeInternalmedia extends PluginBlocktype {
return array('fileimagevideo');
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
public static function has_config() {
return true;
}
......
......@@ -40,10 +40,6 @@ class PluginBlocktypeContactinfo extends PluginBlocktype {
return array('internal');
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
public static function render_instance(BlockInstance $instance, $editing=false) {
require_once(get_config('docroot') . 'artefact/lib.php');
$smarty = smarty_core();
......
......@@ -40,10 +40,6 @@ class PluginBlocktypeProfileinfo extends PluginBlocktype {
return array('internal');
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
public static function render_instance(BlockInstance $instance, $editing=false) {
require_once(get_config('docroot') . 'artefact/lib.php');
$smarty = smarty_core();
......
......@@ -40,10 +40,6 @@ class PluginBlocktypeEntireresume extends PluginBlocktype {
return array('resume');
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
public static function render_instance(BlockInstance $instance, $editing=false) {
require_once(get_config('docroot') . 'artefact/lib.php');
$smarty = smarty_core();
......
......@@ -40,10 +40,6 @@ class PluginBlocktypeResumefield extends PluginBlocktype {
return array('resume');
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
/**
* Optional method. If exists, allows this class to decide the title for
* all blockinstances of this type
......
......@@ -40,10 +40,6 @@ class PluginBlocktypeExternalfeed extends SystemBlocktype {
return array('feeds');
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
public static function render_instance(BlockInstance $instance, $editing=false) {
$configdata = $instance->get('configdata');
if ($configdata['feedid']) {
......
......@@ -54,10 +54,6 @@ class PluginBlocktypeExternalvideo extends SystemBlocktype {
return array('fileimagevideo');
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
public static function render_instance(BlockInstance $instance, $editing=false) {
$configdata = $instance->get('configdata');
$result = '';
......
......@@ -67,7 +67,18 @@ abstract class PluginBlocktype extends Plugin {
public static abstract function get_categories();
public static abstract function get_viewtypes();
public static function get_viewtypes() {
static $viewtypes = null;
if (is_null($viewtypes)) {
$viewtypes = get_column('view_type', 'type');
if (!$viewtypes) {
$viewtypes = array();
}
}
return $viewtypes;
}
public static abstract function render_instance(BlockInstance $instance, $editing=false);
......
......@@ -40,10 +40,6 @@ class PluginBlocktypeTextbox extends SystemBlocktype {
return array('general');
}
public static function get_viewtypes() {
return array('portfolio', 'profile');
}
public static function render_instance(BlockInstance $instance, $editing=false) {
$configdata = $instance->get('configdata');
$text = (isset($configdata['text'])) ? $configdata['text'] : '';
......
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