Commit 00c3d6a6 authored by Clare Lenihan's avatar Clare Lenihan Committed by Clare Lenihan
Browse files

combining the blocktype categories images, multimedia and files to files, images and video

parent 6087232e
......@@ -37,7 +37,7 @@ class PluginBlocktypeFiledownload extends PluginBlocktype {
}
public static function get_categories() {
return array('file');
return array('fileimagevideo');
}
public static function render_instance(BlockInstance $instance) {
......
......@@ -52,7 +52,7 @@ class PluginBlocktypeFolder extends PluginBlocktype {
}
public static function get_categories() {
return array('file');
return array('fileimagevideo');
}
public static function render_instance(BlockInstance $instance) {
......
......@@ -37,7 +37,7 @@ class PluginBlocktypeImage extends PluginBlocktype {
}
public static function get_categories() {
return array('file', 'images');
return array('fileimagevideo');
}
public static function render_instance(BlockInstance $instance) {
......
......@@ -37,7 +37,7 @@ class PluginBlocktypeInternalmedia extends PluginBlocktype {
}
public static function get_categories() {
return array('multimedia', 'file');
return array('fileimagevideo');
}
public static function has_config() {
......
......@@ -46,7 +46,7 @@ class PluginBlocktypeExternalvideo extends SystemBlocktype {
}
public static function get_categories() {
return array('multimedia');
return array('fileimagevideo');
}
public static function render_instance(BlockInstance $instance) {
......
......@@ -220,9 +220,8 @@ $string['20,30,30,20'] = 'Larger centre columns';
$string['noviewlayouts'] = 'There are no view layouts for a %s column view';
$string['blocktypecategory.feeds'] = 'External feeds';
$string['blocktypecategory.images'] = 'Images';
$string['blocktypecategory.fileimagevideo'] = 'Files, images and video';
$string['blocktypecategory.general'] = 'General';
$string['blocktypecategory.multimedia'] = 'Multimedia';
$string['notitle'] = 'No title';
$string['clickformoreinformation'] = 'Click for more information and to place feedback';
......
......@@ -785,6 +785,27 @@ function xmldb_core_upgrade($oldversion=0) {
add_field($table, $field);
}
if ($oldversion < 2008012400) {
$blocktypes = get_column_sql(
'SELECT DISTINCT blocktype
FROM {blocktype_installed_category}
WHERE category IN (\'file\', \'images\', \'multimedia\')'
);
delete_records_sql(
'DELETE FROM {blocktype_installed_category}
WHERE category IN (\'file\', \'images\', \'multimedia\')'
);
delete_records_sql(
'DELETE FROM {blocktype_category}
WHERE name IN (\'file\', \'images\', \'multimedia\')'
);
insert_record('blocktype_category', array('name' => 'fileimagevideo'));
foreach ($blocktypes as $bt) {
insert_record('blocktype_installed_category', array('blocktype' => $bt, 'category' => 'fileimagevideo'));
}
}
return $status;
}
......
......@@ -447,10 +447,6 @@ function upgrade_plugin($upgrade) {
delete_records_select('artefact_installed_type', $select,
array_merge(array($pluginname),$types));
}
// install a blocktype category for this plugin
if (get_config('installed') && !record_exists('blocktype_category', 'name', $pluginname)) {
insert_record('blocktype_category', (object)array('name' => $pluginname));
}
}
// install blocktype categories.
......@@ -798,11 +794,10 @@ function sort_upgrades($k1, $k2) {
return ($weight1 > $weight2);
}
/** core blocktype categories the system exports
* (eg not tied to artefact plugins)
/** blocktype categories the system exports (including artefact categories)
*/
function get_core_blocktype_categories() {
return array('general', 'images', 'multimedia', 'feeds');
function get_blocktype_categories() {
return array('general', 'internal', 'blog', 'resume', 'fileimagevideo', 'feeds');
}
function install_blocktype_categories_for_plugin($blocktype) {
......@@ -824,13 +819,7 @@ function install_blocktype_categories_for_plugin($blocktype) {
function install_blocktype_categories() {
db_begin();
if ($artefacts = plugins_installed('artefact')) {
$artefacts = array_map(create_function('$a', 'return $a->name;'), $artefacts);
}
else {
$artefacts = array();
}
$categories = array_merge(get_core_blocktype_categories(), $artefacts);
$categories = get_blocktype_categories();
$installedcategories = get_column('blocktype_category', 'name');
if ($toinstall = array_diff($categories, $installedcategories)) {
......
......@@ -27,7 +27,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2008011400;
$config->version = 2008012400;
$config->release = '1.0.0alpha2dev';
$config->minupgradefrom = 2007080700;
$config->minupgraderelease = '0.8.0 (release tag 0.8.0_RELEASE)';
......
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