Commit 844304d5 authored by lindonb's avatar lindonb

[REF] menus: refactor csrf and use central smarty variables and template

parent 91803bd5
This diff is collapsed.
......@@ -286,7 +286,6 @@ $(document).ready(function () {
data: $.toJSON(saveOptions),
menuId: $("input[name=menuId]").val(),
ticket: $("input[name=ticket]").val(),
daconfirm: $("input[name=daconfirm]").val()
}, function (data) {
$options.tikiModal();
......
......@@ -34,7 +34,7 @@
</div>
<div class="submit">
<input type="hidden" name="confirm" value="1">
{ticket mode=confirm}
<input type="hidden" name="menuId" value="{$info.menuId|escape}">
<input type="submit" class="btn btn-secondary" name="clone" value="{tr}Clone{/tr}">
</div>
......
......@@ -17,7 +17,6 @@
{/block}
{block name="content"}
<form action="{service controller=menu action=edit}" method="post" role="form" class="form">
{ticket}
<div class="form-group row mx-2">
<label for="menus_name" class="col-form-label">
{tr}Name{/tr}
......@@ -68,7 +67,7 @@
{if $prefs.menus_items_icons neq 'y'}
<input type="hidden" name="use_items_icons" value="{$info.use_items_icons}">
{/if}
<input type="hidden" name="confirm" value="1">
{ticket mode=confirm}
<input type="hidden" name="menuId" value="{$info.menuId|escape}">
<input type="submit" class="btn btn-secondary" name="save" value="{tr}Save{/tr}">
</div>
......
......@@ -117,11 +117,10 @@
</div>
{/if}
<div class="form-group text-center submit">
{ticket}
{ticket mode=confirm}
<input type="hidden" name="optionId" value="{$optionId|escape}">
<input type="hidden" name="menuId" value="{$menuId|escape}">
<input type="hidden" name="offset" value="{$offset|escape}">
<input type="hidden" name="confirm" value="1">
<input type="submit" class="btn btn-secondary" name="save" value="{tr}Save{/tr}">
</div>
</div>
......
......@@ -14,7 +14,8 @@
</span>
{/if}
{/remarksbox}
<div class="form-group hidden" > {* hiding enconding as it does not seem to work *}
{* hiding enconding as it does not seem to work - this template is therefore not being used currently *}
<div class="form-group hidden" >
<label for="encoding" class="col-form-label">
{tr}Encoding{/tr}
</label>
......@@ -24,7 +25,7 @@
</select>
</div>
<div class="submit">
<input type="hidden" name="confirm" value="1">
{ticket mode=confirm}
<button type="submit" class="btn btn-secondary" name="export">{tr}Export{/tr}</button>
</div>
</form>
......
......@@ -23,7 +23,7 @@
</label>
<input name="csvfile" type="file" required="required" class="form-control">
<div class="submit">
<input type="hidden" name="confirm" value="1">
{ticket mode=confirm}
<input type="submit" class="btn btn-primary" name="import" value="{tr}Import{/tr}">
</div>
</div>
......
......@@ -10,17 +10,7 @@
</div>
{/if}
{include file='find.tpl'}
{* Use css menus as fallback for item dropdown action menu if javascript is not being used *}
{if $prefs.javascript_enabled !== 'y'}
{$js = 'n'}
{$libeg = '<li>'}
{$liend = '</li>'}
{else}
{$js = 'y'}
{$libeg = ''}
{$liend = ''}
{/if}
<div class="{if $js === 'y'}table-responsive{/if}"> {* table-responsive class cuts off css drop-down menus *}
<div class="{if $js}table-responsive{/if}"> {* table-responsive class cuts off css drop-down menus *}
<table class="table table-hover">
<tr>
<th>{self_link _sort_arg='sort_mode' _sort_field='menuId'}{tr}ID{/tr}{/self_link}</th>
......@@ -60,9 +50,9 @@
</a>{$liend}
{/if}
{if $tiki_p_edit_menu eq 'y'}
{$libeg}{self_link remove=$channels[user].menuId _menu_text='y' _menu_icon='y' _icon_name="remove"}
{tr}Delete{/tr}
{/self_link}{$liend}
{$libeg}<a href="{bootstrap_modal controller=menu action=remove menuId=$channels[user].menuId}">
{icon name="remove" _menu_text='y' _menu_icon='y' alt="{tr}Delete{/tr}"}
</a>{$liend}
{/if}
{else}
{if $tiki_p_admin eq 'y'}
......@@ -77,19 +67,7 @@
{/if}
{/strip}
{/capture}
{if $js === 'n'}<ul class="cssmenu_horiz"><li>{/if}
<a
class="tips"
title="{tr}Actions{/tr}"
href="#"
{if $js === 'y'}{popup fullhtml="1" center=true text=$smarty.capture.menu_actions}{/if}
style="padding:0; margin:0; border:0"
>
{icon name='wrench'}
</a>
{if $js === 'n'}
<ul class="dropdown-menu" role="menu">{$smarty.capture.menu_actions}</ul></li></ul>
{/if}
{include file="templates/includes/tiki-actions_link.tpl" capturedActions="menu_actions"}
</td>
</tr>
{sectionelse}
......
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