source: extensions/AdditionalPages/trunk/admin/template/add_page.tpl @ 29541

Revision 29541, 4.5 KB checked in by plg, 6 years ago (diff)

new font-icons checkboxes (requires Piwigo 2.7)

Line 
1{combine_script id='common' load='footer' path='admin/themes/default/js/common.js'}
2
3{footer_script require='jquery'}{literal}
4jQuery().ready( function () {
5  jQuery('#title').focusout(function () {
6    if (jQuery('#permalink').val() == '' && auto_permalink)
7      jQuery.post("plugins/AdditionalPages/admin/ajax.php", { str: this.value }, function(data) {
8        jQuery('#permalink').val(data);
9        auto_permalink = false;
10      });
11  });
12 
13  var content_changed = false;
14  jQuery("#ap_content").change(function() {
15    content_changed = true;
16  });
17 
18  jQuery("#template").change(function() {
19    if ($(this).val() != '-1') {
20{/literal}
21      if (content_changed == false || confirm("{'The content of the page changed, are your sure you wan\'t to quit without saving?'|@translate|escape:javascript}")) {ldelim}
22        window.location.href = "admin.php?page=plugin-AdditionalPages-add_page&load_template="+ $(this).val();
23      } else {ldelim}
24        $(this).val('-1');
25      }
26{literal}
27    }
28  });
29
30  jQuery("#groupsCheckAll").click(function() {
31    jQuery("input[name^=groups]").prop("checked", true);
32    return false;
33  });
34
35  jQuery("#groupsUncheckAll").click(function() {
36    jQuery("input[name^=groups]").prop("checked", false);
37    return false;
38  });
39});
40var auto_permalink = true;
41{/literal}{/footer_script}
42{html_head}{literal}
43<style type="text/css">
44form p {margin:1em; text-align:left;}
45form p label {font-weight:normal !important;}
46</style>
47{/literal}{/html_head}
48
49<div class="titrePage">
50        <h2>{$AP_TITLE}</h2>
51</div>
52<form method="post" action="" class="properties" id="configContent" ENCTYPE="multipart/form-data">
53{if $TEMPLATES}
54  <p>
55    <strong>{'Load a page model'|@translate}</strong>
56    <br>
57    <select name="template" id="template">
58      <option value="-1">---------</option>
59  {foreach from=$TEMPLATES item=tpl}
60      <option value="{$tpl.tpl_id}" {if $template_selected==$tpl.tpl_id}selected="selected"{/if}>{$tpl.name}</option>
61  {/foreach}
62    </select>
63  </p>
64{/if}
65   
66  <p>
67    <strong>{'ap_page_name'|@translate}</strong>
68    <br>
69    <input type="text" size="60" maxlength="255" value="{if isset($NAME)}{$NAME}{/if}" name="title" id="title"/>
70  </p>
71
72  <p>
73    <strong>{'Permalink'|@translate}</strong>
74    <br>
75    <input type="text" size="60" value="{if isset($PERMALINK)}{$PERMALINK}{/if}" name="permalink" id="permalink"/>
76  </p>
77
78{if isset($lang)}
79  <p>
80    <strong>{'ap_page_lang'|@translate}</strong>
81    <br>
82    {html_options name=lang id=lang options=$lang selected=$selected_lang}
83  </p>
84{/if}
85
86  <p>
87    <label class="font-checkbox">
88      <span class="icon-check"></span>
89      <input type="checkbox" name="homepage" id="homepage" {if isset($HOMEPAGE) and $HOMEPAGE}checked="checked"{/if}/> <strong>{'ap_set_as_homepage'|@translate}</strong>
90    </label>
91    <i>{'ap_homepage_tip'|@translate}</i>
92  </p>
93     
94  <p>
95    <label class="font-checkbox">
96      <span class="icon-check"></span>
97      <input type="checkbox" name="standalone" id="standalone" {if isset($STANDALONE) and $STANDALONE}checked="checked"{/if}/> <strong>{'ap_standalone_page'|@translate}</strong>
98    </label>
99    <i>{'ap_standalone_tip'|@translate}</i>
100  </p>
101
102{if isset($level_perm)}
103  <p style="margin-top:15px;">
104    <strong>{'Privacy level'|@translate}</strong>
105    <br>
106    <select name="level" size="1">{html_options options=$level_perm selected=$level_selected id=privacy}</select>
107  </p>
108{/if}
109
110{if isset($users)}
111  <p style="margin-top:15px;">
112    <strong>{'ap_authorized_users'|@translate}</strong>
113    <br>
114  {html_checkboxes options=$users selected=$selected_users name=users}
115  </p>
116{/if}
117
118{if isset($groups)}
119  <p style="margin-top:15px;">
120    <strong>{'ap_authorized_group'|@translate}</strong>
121    <i>{'ap_guest'|@translate}</i>
122    <a href="#" id="groupsCheckAll">{'ap_select_all'|@translate}</a> /
123    <a href="#" id="groupsUncheckAll">{'ap_unselect_all'|@translate}</a> &nbsp;
124    <br>
125  {html_checkboxes options=$groups selected=$selected_groups name=groups}
126  </p>
127{/if}
128
129  <p>
130    <strong>{'ap_page_content'|@translate}</strong>
131    <br>
132    <textarea name="ap_content" id="ap_content" rows="30" cols="50" style="width:100%;">{if isset($CONTENT)}{$CONTENT}{/if}</textarea>
133    {if isset($EXTDESC_BUTTON)}{$EXTDESC_BUTTON}{/if}
134  </p>
135
136  <p>
137    <input class="submit" type="submit" value="{'ap_save'|@translate}" name="save">
138{if isset($delete)}
139    <input class="submit" type="submit" value="{'ap_delete'|@translate}" name="delete" onclick="return confirm('{'Are you sure?'|@translate}');"/>
140{/if}
141</form>
Note: See TracBrowser for help on using the repository browser.