12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- {include file="public/header" /}
- <div class="page">
- <form id="add_form" method="post">
- <dl>
- <dt>{$Think.lang.gadmin_name}</dt>
- <dd>
- <input id="gname" name="gname" value="{$ginfo.gname}" class="input-txt" type="text">
- <span class="err"></span>
- </dd>
- </dl>
- <table class="ds-default-table nomargin">
- <thead>
- <tr class="space">
- <th> <input id="limitAll" id="limitAll" value="1" type="checkbox"> {$Think.lang.admin_set_limt}
- </th>
- </tr>
- </thead>
- <tbody>
- {foreach name="limit" item="v" key="k" }
- <tr>
- <td>
- <label style="width:100px">{$v.nav|default=''}</label>
- <input id="limit{$k}" type="checkbox" onclick="selectLimit('limit{$k}')">
- <label for="limit{$k}"><b>{$v.name}</b> </label>
- {foreach name="$v.child" item="xv" key="xk" }
- <label>
- <input dstype="limit{$k}" class="limit{$k}" type="checkbox" name="permission[]" value="{$xv.action}" <?php if(in_array(substr($xv['action'],0,($t=strpos($xv['action'],'|'))?$t:100),$ginfo['glimits'])){ echo "checked=\"checked\""; }?> >{$xv.name}
- </label>
- {/foreach}
- </td>
- </tr>
- {/foreach}
- </tbody>
- </table>
- <dl>
- <dt></dt>
- <dd><input class="btn" type="submit" value="{$Think.lang.ds_confirm_submit}"/></dd>
- </dl>
- </form>
- </div>
- <script>
- function selectLimit(name) {
- if ($('#'+name).prop('checked')) {
- $('.'+name).prop('checked', true);
- } else {
- $('.'+name).prop('checked', false);
- }
- }
- $(function() {
- $('#limitAll').on('click', function() {
- if ($(this).prop('checked')) {
- $(this).parents('table').find('input:checkbox').prop('checked', true);
- } else {
- $(this).parents('table').find('input:checkbox').prop('checked', false);
- }
- });
- $("#add_form").validate({
- errorPlacement: function(error, element) {
- error.appendTo(element.nextAll('span.err'));
- },
- rules: {
- gname: {
- required: true,
- remote: {
- url: ADMINSITEURL+'/admin/ajax.html?branch=check_gadmin_name&gid={$ginfo.gid}',
- type: 'get',
- data: {
- gname: function() {
- return $('#gname').val();
- }
- }
- }
- }
- },
- messages: {
- gname: {
- required: '{$Think.lang.ds_none_input}',
- remote: '{$Think.lang.admin_add_admin_not_exists}'
- }
- }
- });
- });
- </script>
|