Commit d47cb19b authored by Richard Mansfield's avatar Richard Mansfield

Fix 'display my view' link on edit title & layout pages

Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent e8eed2da
......@@ -3092,6 +3092,12 @@ class View {
if ($this->type == 'profile') {
$url = 'user/view.php?id=' . (int) $this->owner;
}
else if ($this->type == 'dashboard') {
$url = '';
}
else if ($this->type == 'grouphomepage') {
$url = 'group/view.php?id=' . $this->group;
}
else {
$url = 'view/view.php?id=' . (int) $this->id;
}
......
......@@ -95,30 +95,27 @@ if ($blockid = param_integer('blockconfig', 0)) {
}
$view->set_edit_nav();
$displaylink = $view->get_url();
if ($view->get('type') == 'profile') {
$profile = true;
$displaylink = get_config('wwwroot') . 'user/view.php';
$title = get_string('usersprofile', 'mahara', display_name($view->get('owner'), null, true));
define('TITLE', $title . ': ' . get_string('editcontent', 'view'));
}
else if ($view->get('type') == 'dashboard') {
$dashboard = true;
$displaylink = get_config('wwwroot');
$title = get_string('usersdashboard', 'mahara', display_name($view->get('owner'), null, true));
define('TITLE', $title . ': ' . get_string('editcontent', 'view'));
}
else if ($view->get('type') == 'grouphomepage') {
$displaylink = get_config('wwwroot') . 'group/view.php?id=' . (int) $view->get('group');
$title = get_string('grouphomepage', 'view');
define('TITLE', $title . ': ' . get_string('editcontent', 'view'));
}
else if ($new) {
$displaylink = get_config('wwwroot') . 'view/view.php?id=' . $view->get('id') . '&new=1';
$displaylink .= '&new=1';
define('TITLE', get_string('editcontent', 'view'));
}
else {
$displaylink = get_config('wwwroot') . 'view/view.php?id=' . $view->get('id');
define('TITLE', $view->get('title') . ': ' . get_string('editcontent', 'view'));
$editabletitle = true;
}
......
......@@ -187,6 +187,7 @@ $smarty->assign('editview', $editview);
$smarty->assign('viewid', $view->get('id'));
$smarty->assign('viewtitle', $view->get('title'));
$smarty->assign('edittitle', $view->can_edit_title());
$smarty->assign('displaylink', $view->get_url());
if (get_config('viewmicroheaders')) {
$smarty->assign('microheaders', true);
$smarty->assign('microheadertitle', $view->display_title(true, false));
......
......@@ -88,6 +88,7 @@ $smarty->assign('back', $back);
$smarty->assign('viewid', $view->get('id'));
$smarty->assign('viewtitle', $view->get('title'));
$smarty->assign('edittitle', $view->can_edit_title());
$smarty->assign('displaylink', $view->get_url());
if (get_config('viewmicroheaders')) {
$smarty->assign('microheaders', true);
$smarty->assign('microheadertitle', $view->display_title(true, false));
......
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