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

addded selection of current layout and changed save/back to my view to save/cancel

parent bc42b595
......@@ -10,19 +10,22 @@
{foreach from=$options key=id item=description}
<div class="fl" style="margin: 0 .5em; text-align: center;">
<div><img src="{$WWWROOT}thumb.php?type=viewlayout&vl={$id}" alt=""></div>
<div><img src="{$WWWROOT}thumb.php?type=viewlayout&amp;vl={$id}" alt=""></div>
{if $id == $currentlayout}
<div><input type="radio" class="radio" name="layout" value="{$id}" checked="checked"></div>
{else}
<div><input type="radio" class="radio" name="layout" value="{$id}"></div>
{/if}
<div>{$description|escape}</div>
</div>
{/foreach}
<div class="cb">
<input type="hidden" name="pieform_viewlayout" value="">
<input type="submit" class="submit" name="submit" value="{str tag='changeviewlayout' section='view'}">
<input type="submit" class="submit" name="cancel" value="{str tag='cancel'}">
</div>
</form>
<p><a href="blocks.php?id={$view}">&laquo; {str tag='backtoyourview' section='view'}</a></p>
{include file="columnfullend.tpl"}
{include file="footer.tpl"}
......@@ -38,6 +38,7 @@ $new = param_boolean('new');
$category = param_alpha('c', '');
$view = new View($id);
$numcolumns = $view->get('numcolumns');
$currentlayout = $view->get('layout');
if ($numcolumns > 1 && $numcolumns < 5) {
$layouts = get_records_array('view_layout', 'columns', $numcolumns);
......@@ -61,13 +62,15 @@ $form = new Pieform(array(
'defaultvalue' => $view->get('layout'),
),
'submit' => array(
'type' => 'submit',
'value' => get_string('submit'),
'type' => 'submitcancel',
'value' => array(get_string('submit'), get_string('cancel')),
'goto' => get_config('wwwroot') . '/view/blocks.php?id=' . $id . '&c=' . $category . '$new=' . $new,
),
),
));
$smarty = smarty();
$smarty->assign('currentlayout', $currentlayout);
$smarty->assign('view', $id);
$smarty->assign('form_start_tag', $form->get_form_tag());
$smarty->assign('options', $options);
......
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