Commit 1babfbae authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Change some strings and links to make view editing/creation with small header less confusing


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 6c531e5a
......@@ -28,16 +28,11 @@
defined('INTERNAL') || die();
$string['createview'] = 'Create View';
$string['createviewstepone'] = 'Create View Step One: Layout';
$string['createviewsteptwo'] = 'Create View Step Two: Details';
$string['createviewstepthree'] = 'Create View Step Three: Access';
$string['createtemplate'] = 'Create Template';
$string['editdetails'] = 'Edit Details';
$string['editviewdetails'] = 'Edit Details for View "%s"';
$string['editview'] = 'Edit View';
$string['editblocksforview'] = 'Edit View "%s"';
$string['edittitle'] = 'Edit Title';
$string['edittitleanddescription'] = 'Edit Title and Description';
$string['editcontent'] = 'Edit Content';
$string['editcontentandlayout'] = 'Edit Content and Layout';
$string['editaccess'] = 'Edit Access';
$string['editaccessforview'] = 'Edit Access for View "%s"';
$string['next'] = 'Next';
$string['back'] = 'Back';
$string['title'] = 'View Title';
......@@ -59,8 +54,6 @@ $string['institutionviews'] = 'Institution Views';
$string['reallyaddaccesstoemptyview'] = 'Your View contains no blocks. Do you really want to give these users access to the View?';
$string['viewdeleted'] = 'View deleted';
$string['viewsubmitted'] = 'View submitted';
$string['editviewnameanddescription'] = 'Edit View details';
$string['editviewaccess'] = 'Edit View access';
$string['deletethisview'] = 'Delete this View';
$string['submitthisviewto'] = 'Submit this View to';
$string['forassessment'] = 'for assessment';
......
......@@ -36,12 +36,15 @@ function pieform_element_cancelbackcreate(Pieform $form, $element) {
$form->include_plugin('element', 'submit');
$form->include_plugin('element', 'cancel');
$cancelelement = $element;
$cancelelement['class'] = (isset($cancelelement['class'])) ? $cancelelement['class'] . ' cancel' : 'cancel';
$cancelelement['value'] = $element['value'][0];
$backelement = $element;
$backelement['name'] = 'back';
$backelement['id'] = 'back';
$backelement['class'] = (isset($backelement['class'])) ? $backelement['class'] . ' cancel' : 'cancel';
$backelement['value'] = $element['value'][1];
$submitelement = $element;
$submitelement['class'] = (isset($submitelement['class'])) ? $submitelement['class'] . ' submit' : 'submit';
$submitelement['value'] = $element['value'][2];
if (isset($element['confirm']) && isset($element['confirm'][0])) {
......
......@@ -67,10 +67,10 @@
<form action="{$WWWROOT}view/edit.php" method="GET">
<input type="hidden" name="id" value="{$view}">
<input type="hidden" name="new" value="1">
<input type="submit" class="submit" value="{str tag='next'}">
<input type="submit" class="submit" value="{str tag=next}: {str tag='edittitleanddescription' section=view}">
</form>
{elseif $profile}
<form action="{$WWWROOT}user/view.php" method="GET">
<form action="{$WWWROOT}artefact/internal/index.php" method="GET">
<input class="submit" type="submit" value="{str tag='done'}">
</form>
{else}
......
......@@ -27,7 +27,7 @@
{else}
{if $view.removable}<div class="rbuttons"><a href="{$WWWROOT}view/delete.php?id={$view.id}" class="btn-del">{str tag="deletethisview" section="view"}</a></div>{/if}
<div class="vi">
<h4><a href="{$WWWROOT}view/edit.php?id={$view.id}" id="editviewdetails">{str tag="editviewnameanddescription" section="view"}</a></h4>
<h4><a href="{$WWWROOT}view/edit.php?id={$view.id}" id="editviewdetails">{str tag="edittitleanddescription" section="view"}</a></h4>
{if $view.description}
<div class="videsc">{$view.description}</div>
{/if}
......@@ -36,7 +36,7 @@
{/if}
</div>
<div class="vi">
<h4><a href="{$WWWROOT}view/blocks.php?id={$view.id}" id="editthisview">{str tag ="editthisview" section="view"}</a></h4>
<h4><a href="{$WWWROOT}view/blocks.php?id={$view.id}" id="editthisview">{str tag ="editcontentandlayout" section="view"}</a></h4>
{if $view.artefacts}
<div class="videsc">{str tag="artefacts" section="view"}:
{foreach from=$view.artefacts item=artefact name=artefacts}<a href="{$WWWROOT}view/artefact.php?artefact={$artefact.id}&amp;view={$view.id}" id="link-artefacts">{$artefact.title|escape}</a>{if !$.foreach.artefacts.last}, {/if}{/foreach}</div>
......@@ -44,7 +44,7 @@
</div>
{/if}
<div class="vi">
<h4><a href="{$WWWROOT}view/access.php?id={$view.id}" id="editviewaccess">{str tag="editviewaccess" section="view"}</a></h4>
<h4><a href="{$WWWROOT}view/access.php?id={$view.id}" id="editviewaccess">{str tag="editaccess" section="view"}</a></h4>
{if $view.access}
<div class="videsc">{$view.access}</div>
{/if}
......
......@@ -14,7 +14,7 @@
<div class="links lbuttons">
{if $microheaderlinks}
{foreach from=$microheaderlinks item=item}
<a {if $item.edit}class="btn-edit" {/if}href="{$item.url}">{$item.name|escape}</a>&nbsp;
<a {if $item.type}class="btn-{$item.type}" {/if}href="{$item.url}">{$item.name|escape}</a>&nbsp;
{/foreach}
{elseif $backurl}<a class="btn-reply" href="{$backurl}">{str tag=back}</a>&nbsp;
{/if}
......
......@@ -315,12 +315,12 @@ if ($loggedinid && $loggedinid == $userid) {
array(
'name' => get_string('editmyprofilepage'),
'url' => get_config('wwwroot') . 'view/blocks.php?profile=1',
'edit' => 1,
'type' => 'edit',
),
array(
'name' => get_string('editmyprofile', 'artefact.internal'),
'url' => get_config('wwwroot') . 'artefact/internal/index.php',
'edit' => 1,
'type' => 'edit',
),
);
$smarty->assign('microheaderlinks', $microheaderlinks);
......
......@@ -42,12 +42,7 @@ $institution = $view->get('institution');
View::set_nav($group, $institution);
$new = param_boolean('new');
if ($new) {
define('TITLE', get_string('createviewstepthree', 'view'));
}
else {
define('TITLE', get_string('editaccessforview', 'view', $view->get('title')));
}
define('TITLE', $view->get('title') . ': ' . get_string('editaccess', 'view'));
if (!$USER->can_edit_view($view)) {
throw new AccessDeniedException();
......
......@@ -99,13 +99,13 @@ View::set_nav($group, $institution, ($view->get('type') == 'profile'));
if ($view->get('type') == 'profile') {
$profile = true;
define('TITLE', get_string('editprofileview', 'view'));
define('TITLE', get_string('editprofilepage'));
}
else if ($new) {
define('TITLE', get_string('createviewstepone', 'view'));
define('TITLE', get_string('editcontentandlayout', 'view'));
}
else {
define('TITLE', get_string('editblocksforview', 'view', $view->get('title')));
define('TITLE', $view->get('title') . ': ' . get_string('editcontentandlayout', 'view'));
}
$category = param_alpha('c', '');
......@@ -196,22 +196,25 @@ if ($owner) {
array(
'name' => get_string('editmyprofile', 'artefact.internal'),
'url' => get_config('wwwroot') . 'artefact/internal/index.php',
'edit' => 1,
'type' => 'edit',
),
);
$viewtitle = get_string('usersprofile', 'mahara', display_name($view->get('owner'), null, true));
}
else if ($new) {
$microheaderlinks = array();
}
else {
$microheaderlinks = array(
array(
'name' => get_string('editdetails', 'view'),
'name' => get_string('edittitle', 'view'),
'url' => get_config('wwwroot') . 'view/edit.php?id=' . $viewid . '&amp;new=' . $new,
'edit' => 1,
'type' => 'edit',
),
array(
'name' => get_string('editaccess', 'view'),
'url' => get_config('wwwroot') . 'view/access.php?id=' . $viewid . '&amp;new=' . $new,
'edit' => 1,
'type' => 'edit',
),
);
}
......
......@@ -54,10 +54,10 @@ View::set_nav($group, $institution);
$new = param_boolean('new', 0);
if ($new) {
define('TITLE', get_string('createviewsteptwo', 'view'));
define('TITLE', get_string('edittitleanddescription', 'view'));
}
else {
define('TITLE', get_string('editviewdetails', 'view', $view->get('title')));
define('TITLE', $view->get('title') . ': ' . get_string('edittitleanddescription', 'view'));
}
$heading = TITLE; // for the smarty template
......@@ -137,7 +137,7 @@ if (!($group || $institution)) {
if ($new) {
$editview['elements']['submit'] = array(
'type' => 'cancelbackcreate',
'value' => array(get_string('cancel'), get_string('back','view'), get_string('next')),
'value' => array(get_string('cancel'), get_string('back','view'), get_string('next') . ': ' . get_string('editaccess', 'view')),
'confirm' => array(get_string('confirmcancelcreatingview', 'view'), null, null),
);
}
......@@ -166,7 +166,7 @@ function editview_cancel_submit() {
function editview_submit(Pieform $form, $values) {
global $view, $SESSION;
global $new, $view, $SESSION;
if (param_boolean('back')) {
redirect('/view/blocks.php?id=' . $view->get('id') . '&new=' . $new);
......
......@@ -193,31 +193,40 @@ if ($can_edit) {
array(
'name' => get_string('editmyprofilepage'),
'url' => get_config('wwwroot') . 'view/blocks.php?profile=1',
'edit' => 1,
'type' => 'edit',
),
array(
'name' => get_string('editmyprofile', 'artefact.internal'),
'url' => get_config('wwwroot') . 'artefact/internal/index.php',
'edit' => 1,
'type' => 'edit',
),
);
}
else if ($new) {
$microheaderlinks = array(
array(
'name' => get_string('back'),
'url' => get_config('wwwroot') . 'view/blocks.php?id=' . $viewid . '&amp;new=1',
'type' => 'reply',
),
);
}
else {
$microheaderlinks = array(
array(
'name' => get_string('editdetails', 'view'),
'name' => get_string('edittitle', 'view'),
'url' => get_config('wwwroot') . 'view/edit.php?id=' . $viewid . '&amp;new=' . $new,
'edit' => 1,
'type' => 'edit',
),
array(
'name' => get_string('editview', 'view'),
'name' => get_string('editcontent', 'view'),
'url' => get_config('wwwroot') . 'view/blocks.php?id=' . $viewid . '&amp;new=' . $new,
'edit' => 1,
'type' => 'edit',
),
array(
'name' => get_string('editaccess', 'view'),
'url' => get_config('wwwroot') . 'view/access.php?id=' . $viewid . '&amp;new=' . $new,
'edit' => 1,
'type' => 'edit',
),
);
}
......
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