Commit 55bcb589 authored by Richard Mansfield's avatar Richard Mansfield

Remove edit access link from collections, move navigation bar checkbox to edit title page

Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 4ec5cdb4
......@@ -111,34 +111,6 @@ if ($available = Collection::available_views()) {
));
}
$elements = array();
$elements['navigation'] = array(
'type' => 'checkbox',
'title' => get_string('viewnavigation','collection'),
'description' => get_string('viewnavigationdesc','collection'),
'defaultvalue' => $collection ? $collection->get('navigation') : 1,
);
if ($new) {
$elements['submit'] = array(
'type' => 'cancelbackcreate',
'value' => array(get_string('cancel'), get_string('back','collection'), get_string('savecollection', 'collection')),
'confirm' => array(get_string('confirmcancelcreatingcollection', 'collection'), null, null),
);
}
else {
$elements['submit'] = array(
'type' => 'submit',
'value' => get_string('done'),
);
}
$nextform = pieform(array(
'name' => 'manageviews',
'plugintype' => 'core',
'pluginname' => 'collection',
'autofocus' => false,
'method' => 'post',
'elements' => $elements,
));
$smarty = smarty();
$smarty->assign('PAGEHEADING', TITLE);
......@@ -146,7 +118,6 @@ $smarty->assign('displayurl',get_config('wwwroot').'collection/views.php?id='.$i
$smarty->assign('removeurl',get_config('wwwroot').'collection/deleteview.php?id='.$id.$newurl);
$smarty->assign_by_ref('views', $views);
$smarty->assign_by_ref('viewsform', $viewsform);
$smarty->assign_by_ref('nextform', $nextform);
$smarty->display('collection/views.tpl');
function addviews_submit(Pieform $form, $values) {
......@@ -162,14 +133,6 @@ function addviews_submit(Pieform $form, $values) {
}
function manageviews_cancel_submit() {
global $collection, $new;
if ($new && $collection) {
$collection->delete();
}
redirect('/collection/');
}
function manageviews_submit(Pieform $form, $values) {
global $collection, $new, $SESSION, $views;
if (param_boolean('back')) {
......
......@@ -205,6 +205,12 @@ class Collection {
'defaultvalue' => null,
'title' => get_string('description', 'collection'),
),
'navigation' => array(
'type' => 'checkbox',
'title' => get_string('viewnavigation','collection'),
'description' => get_string('viewnavigationdesc','collection'),
'defaultvalue' => 1,
),
);
// populate the fields with the existing values if any
......@@ -220,10 +226,6 @@ class Collection {
'type' => 'hidden',
'value' => $data->owner,
);
$elements['navigation'] = array(
'type' => 'hidden',
'value' => $data->navigation,
);
}
return $elements;
......
......@@ -712,6 +712,7 @@ class View {
public function set_access($accessdata) {
global $USER;
require_once('activity.php');
require_once('group.php');
$beforeusers = activity_get_viewaccess_users($this->get('id'), $USER->get('id'), 'viewaccess');
......
......@@ -19,20 +19,14 @@
<div class="rbuttons">
<div class="viewcontrol">
<a href="{$WWWROOT}collection/delete.php?id={$collection->id}"><img src="{theme_url filename='images/icon_close.gif'}" alt="{str tag=delete}"></a>
<a href="{$WWWROOT}collection/delete.php?id={$collection->id}" title="{str tag=deletecollection section=collection}"><img src="{theme_url filename='images/icon_close.gif'}" alt="{str tag=delete}"></a>
</div>
<div class="viewcontrol">
{if $collection->views[0]->view}
<a href="{$WWWROOT}view/access.php?collection={$collection->id}" title="{str tag=editaccess section=view}"><img src="{theme_url filename='images/edit_access.gif'}" alt="{str tag=editaccess}"></a>
{/if}
<a href="{$WWWROOT}collection/views.php?id={$collection->id}" title="{str tag=manageviews section=collection}"><img src="{theme_url filename='images/manage.gif'}" alt="{str tag=manageviews}"></a>
</div>
<div class="viewcontrol">
<a href="{$WWWROOT}collection/edit.php?id={$collection->id}" title="{str tag=edittitleanddescription section=view}"><img src="{theme_url filename='images/edit.gif'}" alt="{str tag=edit}"></a>
</div>
<div class="viewcontrol">
<a href="{$WWWROOT}collection/views.php?id={$collection->id}"><img src="{theme_url filename='images/manage.gif'}" alt="{str tag=manageviews}"></a>
</div>
</div>
......
......@@ -41,7 +41,7 @@
{str tag=noviewsavailable section=collection}
{/if}
</fieldset>
{if $nextform}
{$nextform|safe}
{/if}
<form action="{$WWWROOT}collection/index.php">
<input type="submit" class="submit" value="{str tag=done}">
</form>
{include file="footer.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