Commit d2943871 authored by Richard Mansfield's avatar Richard Mansfield

Add config options to show/hide selfsearch/tags sideblocks, number of tags to show

parent 1aaea2d5
......@@ -1194,6 +1194,12 @@ function xmldb_core_upgrade($oldversion=0) {
set_config('captchaonregisterform', (int) (is_null($captcha) || $captcha));
}
if ($oldversion < 2009090700) {
set_config('showselfsearchsideblock', 1);
set_config('showtagssideblock', 1);
set_config('tagssideblockmaxtags', 20);
}
return $status;
}
......
......@@ -2087,8 +2087,7 @@ function get_my_tags($limit=null, $cloud=true, $sort='freq') {
}
function tags_sideblock() {
$maxtags = 20;
if ($tagrecords = get_my_tags($maxtags)) {
if ($tagrecords = get_my_tags(get_config('tagssideblockmaxtags'))) {
return array('tags' => $tagrecords);
}
return null;
......
......@@ -665,6 +665,9 @@ function core_install_firstcoredata_defaults() {
set_config('allowpublicprofiles', 1);
set_config('captchaoncontactform', 1);
set_config('captchaonregisterform', 1);
set_config('showselfsearchsideblock', 0);
set_config('showtagssideblock', 1);
set_config('tagssideblockmaxtags', 20);
// install the applications
$app = new StdClass;
......
......@@ -27,7 +27,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2009082600;
$config->version = 2009090700;
$config->release = '1.2.0beta2dev';
$config->minupgradefrom = 2008040200;
$config->minupgraderelease = '1.0.0 (release tag 1.0.0_RELEASE)';
......
......@@ -430,17 +430,21 @@ EOF;
}
if ($USER->is_logged_in() && defined('MENUITEM') && substr(MENUITEM, 0, 11) == 'myportfolio') {
$SIDEBLOCKS[] = array(
'name' => 'selfsearch',
'weight' => 0,
'data' => array(),
);
$SIDEBLOCKS[] = array(
'name' => 'tags',
'id' => 'sb-tags',
'weight' => 0,
'data' => tags_sideblock(),
);
if (get_config('showselfsearchsideblock')) {
$SIDEBLOCKS[] = array(
'name' => 'selfsearch',
'weight' => 0,
'data' => array(),
);
}
if (get_config('showtagssideblock')) {
$SIDEBLOCKS[] = array(
'name' => 'tags',
'id' => 'sb-tags',
'weight' => 0,
'data' => tags_sideblock(),
);
}
}
if($USER->is_logged_in() && !defined('ADMIN') && !defined('INSTITUTIONALADMIN')) {
......
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