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

Last change on this file since 16118 was 16118, checked in by mistic100, 12 years ago

add a simple page template system

File size: 5.1 KB
Line 
1{footer_script require='jquery'}{literal}
2jQuery().ready( function () {
3  jQuery('#title').focusout(function () {
4    if (jQuery('#permalink').val() == '' && auto_permalink)
5      jQuery.post("plugins/AdditionalPages/admin/ajax.php", { str: this.value }, function(data) {
6        jQuery('#permalink').val(data);
7        auto_permalink = false;
8      });
9  });
10 
11  var content_changed = false;
12  jQuery("#ap_content").change(function() {
13    content_changed = true;
14  });
15 
16  jQuery("#template").change(function() {
17    if ($(this).val() != '-1') {
18{/literal}
19      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}
20        window.location.href = "admin.php?page=plugin-AdditionalPages-add_page&load_template="+ $(this).val();
21      } else {ldelim}
22        $(this).val('-1');
23      }
24{literal}
25    }
26  });
27});
28var auto_permalink = true;
29{/literal}{/footer_script}
30{html_head}{literal}
31<style type="text/css">
32#mainConf { margin:0; }
33.groups { margin-top:15px; }
34.groups input { margin-right:5px; }
35.groups label { margin-right:10px; display: inline-block; overflow: hidden; white-space: nowrap; line-height:1.3em;}
36.groups div { float:right; width:74%; line-height:1.3em;}
37</style>
38{/literal}{/html_head}
39
40<div class="titrePage">
41        <h2>{$AP_TITLE}</h2>
42</div>
43<form method="post" action="" class="properties" id="configContent" ENCTYPE="multipart/form-data">
44<fieldset id="mainConf">
45  <legend></legend>
46        <ul>
47    {if $TEMPLATES}
48    <li>
49      <span class="property">
50        <label for="template">{'Load a page model'|@translate}</label>
51      </span>
52      <select name="template" id="template">
53        <option value="-1">---------</option>
54        {foreach from=$TEMPLATES item=tpl}
55        <option value="{$tpl.tpl_id}" {if $template_selected==$tpl.tpl_id}selected="selected"{/if}>{$tpl.name}</option>
56        {/foreach}
57      </select>
58    </li>
59    {/if}
60   
61    <li>
62      <span class="property">
63        <label for="title">{'ap_page_name'|@translate}</label>
64      </span>
65      <input type="text" size="60" maxlength="255" value="{if isset($NAME)}{$NAME}{/if}" name="title" id="title"/>
66    </li>
67
68    <li>
69      <span class="property">
70        <label for="permalink">{'Permalink'|@translate}</label>
71      </span>
72      <input type="text" size="60" value="{if isset($PERMALINK)}{$PERMALINK}{/if}" name="permalink" id="permalink"/>
73    </li>
74
75    {if isset($lang)}
76    <li>
77      <span class="property">
78        <label for="lang">{'ap_page_lang'|@translate}</label>
79      </span>
80      {html_options name=lang id=lang options=$lang selected=$selected_lang}
81    </li>
82    {/if}
83
84    <li style="margin-top:15px;">
85      <span class="property">
86        <label for="homepage">{'ap_set_as_homepage'|@translate}</label>
87      </span>
88      <input type="checkbox" name="homepage" id="homepage" {if isset($HOMEPAGE) and $HOMEPAGE}checked="checked"{/if}/>
89      <i>{'ap_homepage_tip'|@translate}</i>
90    </li>
91
92    <li>
93      <span class="property">
94        <label for="standalone">{'ap_standalone_page'|@translate}</label>
95      </span>
96      <input type="checkbox" name="standalone" id="standalone" {if isset($STANDALONE) and $STANDALONE}checked="checked"{/if}/>
97      <i>{'ap_standalone_tip'|@translate}</i>
98    </li>
99
100    {if isset($level_perm)}
101    <li style="margin-top:15px;">
102      <span class="property">
103        <label for="privacy">{'Privacy level'|@translate}</label>
104      </span>
105      <select name="level" size="1">{html_options options=$level_perm selected=$level_selected id=privacy}</select>
106    </li>
107    {/if}
108
109    {if isset($users)}
110    <li class="groups" style="margin-top:15px;">
111      <span class="property">
112        <label for="users">{'ap_authorized_users'|@translate}</label>
113      </span>
114      {html_checkboxes options=$users selected=$selected_users name=users}
115    </li>
116    {/if}
117
118    {if isset($groups)}
119    <li class="groups" style="margin-top:15px;">
120      <span class="property">
121        <label for="groups">{'ap_authorized_group'|@translate}</label>
122      </span>
123      <div>{html_checkboxes options=$groups selected=$selected_groups name=groups}</div>
124    </li>
125    <li class="groups">
126      <div>
127        <a href="#" onClick="jQuery('input[name^=\'groups\']').attr('checked', 'checked');return false;">{'ap_select_all'|@translate}</a> /
128        <a href="#" onClick="jQuery('input[name^=\'groups\']').attr('checked', '');return false;">{'ap_unselect_all'|@translate}</a> &nbsp;
129        <i>{'ap_guest'|@translate}</i>
130      </div>
131    </li>
132    {/if}
133</ul>
134</fieldset>
135<table style="width:95%;">
136                <tr>
137                        <td colspan="2" align="center"><br>
138                                <b>{'ap_page_content'|@translate}</b><br>
139                                <textarea name="ap_content" id="ap_content" rows="30" cols="50" style="width:100%;">{if isset($CONTENT)}{$CONTENT}{/if}</textarea>
140      </td>
141                </tr>
142
143                <tr>
144                <td colspan="2" align="center"><br>
145                <input class="submit" type="submit" value="{'ap_save'|@translate}" name="save">
146                {if isset($delete)}
147                <input class="submit" type="submit" value="{'ap_delete'|@translate}" name="delete" onclick="return confirm('{'Are you sure?'|@translate}');"/>
148                {/if}
149                </tr>
150</table>
151</form>
Note: See TracBrowser for help on using the repository browser.