Commit f7d966c0 authored by Clare Lenihan's avatar Clare Lenihan Committed by Clare Lenihan
Browse files

changing the title of view/blocks and passing new to view/view and back again

parent a7054c6f
......@@ -2,6 +2,8 @@
{include file="columnfullstart.tpl"}
<h2>{$heading}</h2>
<form action="{$formurl}" method="post">
<input type="submit" name="{$action_name}" id="action-dummy" class="hidden">
<input type="hidden" id="viewid" name="id" value="{$view}">
......@@ -20,10 +22,10 @@
</div>
<div class="fr" style="font-size: smaller; padding-right: 5px;">
<strong><a href="view.php?id={$view}">{str tag=displaymyview section=view} &raquo;</a></strong>
<strong><a href="view.php?id={$view}&amp;new={$new}">{str tag=displaymyview section=view} &raquo;</a></strong>
</div>
<a id="layout-link" href="layout.php?id={$view}&c={$category}&new={$new}"{if !$can_change_layout} class="disabled"{/if}>{str tag='changeviewlayout' section='view'}</a>
<a id="layout-link" href="layout.php?id={$view}&amp;c={$category}&amp;new={$new}"{if !$can_change_layout} class="disabled"{/if}>{str tag='changeviewlayout' section='view'}</a>
<div id="bottom-pane">
<div id="column-container">
......
......@@ -4,7 +4,7 @@
{if $can_edit}
<div class="fr editview">
<span class="settingsicon">
<a href="blocks.php?id={$viewid}">{str tag=editthisview section=view}</a>
<a href="blocks.php?id={$viewid}&amp;new={$new}">{str tag=editthisview section=view}</a>
</span>
</div>
{/if}
......
......@@ -30,10 +30,16 @@ require(dirname(dirname(__FILE__)) . '/init.php');
require('view.php');
$view = new View(param_integer('id'));
define('TITLE', get_string('editblocksforview', 'view', $view->get('title')));
$new = param_boolean('new');
if ($new) {
define('TITLE', get_string('createviewsteptwo', 'view'));
}
else {
define('TITLE', get_string('editblocksforview', 'view', $view->get('title')));
}
// check if cancel was selected
if ($new && isset($_POST['cancel'])) {
$view->delete();
......@@ -85,6 +91,7 @@ foreach (array_keys($_POST + $_GET) as $key) {
}
}
$smarty->assign('heading', TITLE);
$smarty->assign('formurl', get_config('wwwroot') . 'view/blocks.php');
$smarty->assign('category', $category);
$smarty->assign('new', $new);
......
......@@ -30,6 +30,8 @@ require(dirname(dirname(__FILE__)) . '/init.php');
require(get_config('libroot') . 'view.php');
$viewid = param_integer('id');
$new = param_boolean('new');
$view = new View($viewid);
if (!can_view_view($viewid)) {
throw new AccessDeniedException();
......@@ -262,6 +264,7 @@ $smarty->assign('formattedowner', $view->formatted_owner());
if ($USER->get('id') == $view->get('owner')) {
$smarty->assign('can_edit', true);
$smarty->assign('new', $new);
}
$smarty->display('view/view.tpl');
......
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