source: extensions/AMenuManager/admin/amm_personalisedlist_edit.tpl @ 13187

Last change on this file since 13187 was 5421, checked in by grum, 15 years ago

Update the plugin for compatibility with Piwigo 2.1 and fix some bugs
feature 1384, feature 1476, feature 1541

  • Property svn:executable set to *
File size: 4.6 KB
Line 
1{include file='include/autosize.inc.tpl'}
2
3{literal}
4<script type="text/javascript">
5
6  //global var ; need to not have to initialize them every time a value is changed
7  var objlang;
8  var objnames = new Array('iamm_personalised_title', 'iamm_personalised_content');
9  var objinput = new Array();   //input text from form => objinput[name]
10  var objhidden = new Array();  //input hidden from form => objhidden[name][lang]
11
12  function init()
13  {
14    objlang = document.getElementById('islang');
15    for(i=0;i<objnames.length;i++)
16    {
17      objinput[i] = document.getElementById(objnames[i]);
18      objhidden[i] = new Array();
19      for(j=0;j<objlang.options.length;j++)
20      {
21        objhidden[i][j] = document.getElementById(objnames[i]+'_'+objlang.options[j].value);
22      }
23    }
24  }
25
26  function change_lang()
27  {
28    for(i=0;i<objnames.length;i++)
29    {
30      objinput[i].value = objhidden[i][objlang.options.selectedIndex].value;
31    }
32  }
33
34  function apply_changes(input_id)
35  {
36    var obj=document.getElementById(input_id);
37    objhidden[objnames.indexOf(input_id)][objlang.options.selectedIndex].value = obj.value;
38  }
39
40  function do_translation()
41  {
42    var inputid = document.getElementById('iamm_personalised_title');
43    var tolang = objlang.options[objlang.options.selectedIndex].value.substr(0,2);
44
45    google_translate(inputid.value, '{/literal}{$datas.fromlang}{literal}', tolang, inputid, 'value', apply_changes, inputid.id);
46  }
47
48</script>
49{/literal}
50
51
52{if isset($datas.modeedit)}
53
54  <h3>
55  {if $datas.modeedit=='create'}
56    {'g002_createofpersonalised'|@translate}
57  {else}
58    {'g002_editofpersonalised'|@translate}
59  {/if}
60  / <span style="font-weight:normal"><a href="{$datas.personalised_list}">{'g002_personalisedlist'|@translate}</a></span></h3>
61  </h3>
62
63
64<form method="post" action="" class="general">
65  <fieldset>
66    <legend>{'g002_setting_personalised_properties'|@translate}</legend>
67
68    <table class="formtable">
69      <tr>
70        <td>{'g002_setting_block_active'|@translate}</td>
71        <td>
72          <select name="famm_personalised_visible" id="iamm_personalised_visible">
73            {html_options values=$datas.yesno_values output=$datas.yesno_labels selected=$datas.visible_selected}
74          </select>
75        </td>
76      </tr>
77
78      <tr>
79        <td>{'g002_setting_personalised_nfo'|@translate}</td>
80        <td>
81          <input type="text" name="famm_personalised_nfo" id="iamm_personalised_nfo" value="{$datas.nfo}" maxlength="255"/>
82        </td>
83      </tr>
84
85    </table>
86
87  </fieldset>
88
89  <fieldset>
90    <legend>{'g002_setting_block_menu'|@translate}</legend>
91
92    {if isset($datas.language_list) and count($datas.language_list)}
93      {foreach from=$datas.language_list key=name item=language_row}
94        <input type="hidden" name="famm_personalised_title_{$language_row.LANG}"
95                id="iamm_personalised_title_{$language_row.LANG}" value="{$language_row.MENUBARTIT}">
96        <input type="hidden" name="famm_personalised_content_{$language_row.LANG}"
97                id="iamm_personalised_content_{$language_row.LANG}" value="{$language_row.MENUBARCONTENT}">
98      {/foreach}
99    {/if}
100
101    <table class="formtable">
102
103      <tr>
104        <td>{'g002_setting_block_langchoice'|@translate}</td>
105        <td>
106          <select onchange="change_lang();" id="islang">
107            {html_options values=$datas.language_list_values output=$datas.language_list_labels selected=$datas.lang_selected}
108          </select><br>
109        </td>
110      </tr>
111
112      <tr>
113        <td colspan=2><hr/></td>
114      </tr>
115
116      <tr>
117        <td>{'g002_setting_block_title'|@translate}</td>
118        <td>
119          <input type="text" id="iamm_personalised_title" value="" maxlength="255" onkeyup="apply_changes('iamm_personalised_title');" onblur="apply_changes('iamm_personalised_title');"/>
120        </td>
121      </tr>
122      <tr>
123        <td></td>
124        <td style="font-size:80%;">
125          <a style="cursor:pointer;" onclick="do_translation()">{'g002_translate'|@translate}</a>
126        </td>
127      </tr>
128
129      <tr>
130        <td>{'g002_setting_personalised_content'|@translate}</td>
131        <td>
132          <textarea id="iamm_personalised_content" cols=80 rows=25 onkeyup="apply_changes('iamm_personalised_content');" /></textarea>
133        </td>
134      </tr>
135
136
137    </table>
138
139  </fieldset>
140
141
142  <p>
143    <input type="submit" name="famm_submit_apply" id="iamm_submit_apply" value="{'g002_apply'|@translate}" >
144  </p>
145
146  <input type="hidden" name="famm_modeedit" value="{$datas.modeedit}">
147  <input type="hidden" name="famm_id" value="{$datas.id}">
148
149</form>
150
151
152<script type="text/javascript">
153  init();
154  change_lang();
155</script>
156
157{/if}
Note: See TracBrowser for help on using the repository browser.