Commit 0d38e2cf authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Change blocks around on dashboard & remove heading


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 0b85d5bf
......@@ -61,7 +61,6 @@ if ($USER->is_logged_in()) {
);
$smarty->assign('dashboardview', true);
$smarty->assign('maintitle', get_string('mydashboard'));
$smarty->assign('viewcontent', $view->build_columns());
$smarty->assign('viewid', $view->get('id'));
}
......
......@@ -1659,10 +1659,9 @@ function xmldb_core_upgrade($oldversion=0) {
$viewdata = (object) array(
'type' => 'dashboard',
'owner' => 0,
'numcolumns' => 3,
'numcolumns' => 2,
'ownerformat' => FORMAT_NAME_PREFERREDNAME,
'title' => get_string('dashboardviewtitle', 'view'),
'description' => '',
'template' => 1,
'ctime' => $dbtime,
'atime' => $dbtime,
......@@ -1672,78 +1671,47 @@ function xmldb_core_upgrade($oldversion=0) {
$accessdata = (object) array('view' => $id, 'accesstype' => 'loggedin');
insert_record('view_access', $accessdata);
$blocktypes = array(
0 => array(
'blocktype' => 'inbox',
'title' => get_string('mymessages'),
array(
'blocktype' => 'newviews',
'title' => get_string('title', 'blocktype.newviews'),
'column' => 1,
'config' => array(
'newpost' => false,
'feedback' => false,
'groupmessage' => true,
'institutionmessage' => true,
'maharamessage' => false,
'usermessage' => true,
'viewaccess' => false,
'watchlist' => false,
'adminmessages' => false,
'maxitems' => '5',
'limit' => 5,
),
),
1 => array(
array(
'blocktype' => 'myviews',
'title' => get_string('title', 'blocktype.myviews'),
'column' => 1,
'config' => null,
),
array(
'blocktype' => 'inbox',
'title' => get_string('recentactivity'),
'column' => 2,
'config' => array(
'newpost' => false,
'feedback' => true,
'groupmessage' => false,
'institutionmessage' => false,
'groupmessage' => true,
'institutionmessage' => true,
'maharamessage' => true,
'usermessage' => false,
'usermessage' => true,
'viewaccess' => true,
'watchlist' => true,
'adminmessages' => false,
'maxitems' => '5',
),
),
2 => array(
array(
'blocktype' => 'inbox',
'title' => get_string('topicsimfollowing'),
'column' => 3,
'column' => 2,
'config' => array(
'newpost' => true,
'feedback' => false,
'groupmessage' => false,
'institutionmessage' => false,
'maharamessage' => false,
'usermessage' => false,
'viewaccess' => false,
'watchlist' => false,
'adminmessages' => false,
'maxitems' => '5',
),
),
3 => array(
'blocktype' => 'myviews',
'title' => get_string('title', 'blocktype.myviews'),
'column' => 1,
'config' => null,
),
4 => array(
'blocktype' => 'mygroups',
'title' => get_string('title', 'blocktype.mygroups'),
'column' => 2,
'config' => null,
),
5 => array(
'blocktype' => 'myfriends',
'title' => get_string('title', 'blocktype.myfriends'),
'column' => 3,
'config' => null,
),
);
$installed = get_column_sql('SELECT name FROM {blocktype_installed}');
$weights = array(1 => 0, 2 => 0, 3 => 0);
$weights = array(1 => 0, 2 => 0);
foreach ($blocktypes as $blocktype) {
if (in_array($blocktype['blocktype'], $installed)) {
$weights[$blocktype['column']]++;
......
......@@ -1713,88 +1713,56 @@ function install_system_dashboard_view() {
$view = View::create(array(
'type' => 'dashboard',
'owner' => 0,
'numcolumns' => 3,
'numcolumns' => 2,
'ownerformat' => FORMAT_NAME_PREFERREDNAME,
'title' => get_string('dashboardviewtitle', 'view'),
'description' => get_string('dashboarddescription'),
'template' => 1,
));
$view->set_access(array(array(
'type' => 'loggedin'
)));
$blocktypes = array(
0 => array(
'blocktype' => 'inbox',
'title' => get_string('mymessages'),
array(
'blocktype' => 'newviews',
'title' => get_string('title', 'blocktype.newviews'),
'column' => 1,
'config' => array(
'newpost' => false,
'feedback' => false,
'groupmessage' => true,
'institutionmessage' => true,
'maharamessage' => false,
'usermessage' => true,
'viewaccess' => false,
'watchlist' => false,
'adminmessages' => false,
'maxitems' => '5',
'limit' => 5,
),
),
1 => array(
array(
'blocktype' => 'myviews',
'title' => get_string('title', 'blocktype.myviews'),
'column' => 1,
'config' => null,
),
array(
'blocktype' => 'inbox',
'title' => get_string('recentactivity'),
'column' => 2,
'config' => array(
'newpost' => false,
'feedback' => true,
'groupmessage' => false,
'institutionmessage' => false,
'groupmessage' => true,
'institutionmessage' => true,
'maharamessage' => true,
'usermessage' => false,
'usermessage' => true,
'viewaccess' => true,
'watchlist' => true,
'adminmessages' => false,
'maxitems' => '5',
),
),
2 => array(
array(
'blocktype' => 'inbox',
'title' => get_string('topicsimfollowing'),
'column' => 3,
'column' => 2,
'config' => array(
'newpost' => true,
'feedback' => false,
'groupmessage' => false,
'institutionmessage' => false,
'maharamessage' => false,
'usermessage' => false,
'viewaccess' => false,
'watchlist' => false,
'adminmessages' => false,
'maxitems' => '5',
),
),
3 => array(
'blocktype' => 'myviews',
'title' => get_string('title', 'blocktype.myviews'),
'column' => 1,
'config' => null,
),
4 => array(
'blocktype' => 'mygroups',
'title' => get_string('title', 'blocktype.mygroups'),
'column' => 2,
'config' => null,
),
5 => array(
'blocktype' => 'myfriends',
'title' => get_string('title', 'blocktype.myfriends'),
'column' => 3,
'config' => null,
),
);
$installed = get_column_sql('SELECT name FROM {blocktype_installed}');
$weights = array(1 => 0, 2 => 0, 3 => 0);
$weights = array(1 => 0, 2 => 0);
foreach ($blocktypes as $blocktype) {
if (in_array($blocktype['blocktype'], $installed)) {
$weights[$blocktype['column']]++;
......
<h1>{$maintitle}<span class="s"> (<a href="{$WWWROOT}view/blocks.php?id={$viewid}">{str tag=editdashboard section=mahara}</a>)</span></h1>
<div id="view" class="cb">
<div id="bottom-pane">
<div id="column-container">
......
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