source: extensions/FacebookPlug/Plugin/tpl/admin.config.tpl @ 8331

Last change on this file since 8331 was 8331, checked in by rub, 13 years ago

Admin configuration page:

o Fix cancel Button
o Change layout
o Like Button and comments cannot be enabled together (php and JQuery test)

  • Property svn:eol-style set to LF
File size: 11.3 KB
Line 
1{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
2{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
3{known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.dialog.packed.js"}
4
5{*
6{html_head}
7<link rel="stylesheet" type="text/css" href="{$FBP_PATH|@cat:'/css/admin.config.css'}">
8{/html_head}
9*}
10
11{*html_head}
12<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css">
13{/html_head*}
14
15<div class="titrePage">
16  <h2>FacebookPlug</h2>
17</div>
18<br>
19
20<form method="post" class="properties" action="{$FBP_ACTION}">
21{if isset($social_plugin)}
22<h3>{'On picture pages'|@translate}</h3>
23<fieldset>
24  <legend><a href="{$social_plugin.like_button.FB_PAGE}" onclick="window.open(this.href); return false;">{'Like button'|@translate}</a></legend>
25  <ul>
26    <li>
27      <label>
28        <span class="property">{'Enabled'|@translate}</span>
29        <input type="checkbox" name="FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ENABLED" {$social_plugin.like_button.ENABLED} />
30      </label>
31    </li>
32
33    <div id='like_button'>
34      <li>
35        <label>
36          <span class="property">{'Layout style'|@translate}</span>
37          <select name="FBP_SOCIAL_PLUGIN_LIKE_BUTTON_LAYOUT" size="1">
38            {html_options options=$social_plugin.like_button.LAYOUT_OPTIONS selected=$social_plugin.like_button.LAYOUT_OPTIONS_SELECTED}
39          </select>
40        </label>
41      </li>
42      <li>
43        <label>
44          <span class="property">{'Show faces'|@translate}</span>
45          <input type="checkbox" name="FBP_SOCIAL_PLUGIN_LIKE_BUTTON_SHOW_FACES" {$social_plugin.like_button.SHOW_FACES} />
46        </label>
47      </li>
48      <li>
49        <label>
50          <span class="property">{'Verb to display'|@translate}</span>
51          <select name="FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ACTION" size="1">
52            {html_options options=$social_plugin.like_button.ACTION_OPTIONS selected=$social_plugin.like_button.ACTION_OPTIONS_SELECTED}
53          </select>
54        </label>
55      </li>
56      <li>
57        <label>
58          <span class="property">{'Color scheme'|@translate}</span>
59          <select name="FBP_SOCIAL_PLUGIN_LIKE_BUTTON_COLORSCHEME" size="1">
60            {html_options options=$social_plugin.like_button.COLORSCHEME_OPTIONS selected=$social_plugin.like_button.COLORSCHEME_OPTIONS_SELECTED}
61          </select>
62        </label>
63      </li>
64    </div>
65  </ul>
66</fieldset>
67
68<fieldset>
69  <legend><a href="{$social_plugin.facepile.FB_PAGE}" onclick="window.open(this.href); return false;">{'Facepile'|@translate}</a> {'on slideshow pages'|@translate}</legend>
70  <ul>
71    <li>
72      <label>
73        <span class="property">{'Enabled'|@translate}</span>
74        <input type="checkbox" name="FBP_SOCIAL_PLUGIN_FACEPILE_ENABLED" {$social_plugin.facepile.ENABLED} />
75      </label>
76    </li>
77
78    <div id='facepile'>
79      <li>
80        <label>
81          <span class="property">{'Num rows'|@translate}</span>
82          <input type="text" size="3" maxlength="4" name="FBP_SOCIAL_PLUGIN_FACEPILE_MAX_ROWS" value="{$social_plugin.facepile.MAX_ROWS}" />
83        </label>
84      </li>
85    </div>
86  </ul>
87</fieldset>
88
89<fieldset>
90  <legend><a href="{$social_plugin.comments.FB_PAGE}" onclick="window.open(this.href); return false;">{'Comments'|@translate}</a></legend>
91  <ul>
92    <li>
93      <label>
94        <span class="property">{'Enabled'|@translate}</span>
95        <input type="checkbox" name="FBP_SOCIAL_PLUGIN_COMMENTS_ENABLED" {$social_plugin.comments.ENABLED} />
96      </label>
97    </li>
98
99    <div id='comments'>
100      <li>
101        <label>
102          <span class="property">{'Num posts'|@translate}</span>
103          <input type="text" size="3" maxlength="4" name="FBP_SOCIAL_PLUGIN_COMMENTS_NUMPOSTS" value="{$social_plugin.comments.NUMPOSTS}" />
104        </label>
105      </li>
106      <li>
107        <label>
108          <span class="property">{'Title'|@translate}</span>
109          <input type="text" size="39" name="FBP_SOCIAL_PLUGIN_COMMENTS_TITLE" value="{$social_plugin.comments.TITLE}" />
110        </label>
111      </li>
112      <li>
113        <label>
114          <span class="property">{'Simple'|@translate}</span>
115          <input type="checkbox" name="FBP_SOCIAL_PLUGIN_COMMENTS_SIMPLE" {$social_plugin.comments.SIMPLE} />
116        </label>
117      </li>
118      <li>
119        <label>
120          <span class="property">{'Reverse'|@translate}</span>
121          <input type="checkbox" name="FBP_SOCIAL_PLUGIN_COMMENTS_REVERSE" {$social_plugin.comments.REVERSE} />
122        </label>
123      </li>
124      <li>
125        <label>
126          <span class="property">{'Publish feed'|@translate}</span>
127          <input type="checkbox" name="FBP_SOCIAL_PLUGIN_COMMENTS_PUBLISH_FEED" {$social_plugin.comments.PUBLISH_FEED} />
128        </label>
129      </li>
130    </div>
131  </ul>
132</fieldset>
133
134<h3>{'On menu of main pages'|@translate}</h3>
135<fieldset>
136  <legend><a href="{$social_plugin.like_box.FB_PAGE}" onclick="window.open(this.href); return false;">{'Like box'|@translate}</a></legend>
137  <ul>
138    <li>
139      <label>
140        <span class="property">{'Enabled'|@translate}</span>
141        <input type="checkbox" name="FBP_SOCIAL_PLUGIN_LIKE_BOX_ENABLED" {$social_plugin.like_box.ENABLED} />
142      </label>
143    </li>
144
145    <div id='like_box'>
146      <li>
147        <label>
148          <span class="property">{'Facebook Page URL'|@translate}</span>
149          <input type="text" size="39" name="FBP_SOCIAL_PLUGIN_LIKE_BOX_URL" value="{$social_plugin.like_box.URL}" />
150        </label>
151      </li>
152      <li>
153        <label>
154          <span class="property">{'Color scheme'|@translate}</span>
155          <select name="FBP_SOCIAL_PLUGIN_LIKE_BOX_COLORSCHEME" size="1">
156            {html_options options=$social_plugin.like_box.COLORSCHEME_OPTIONS selected=$social_plugin.like_box.COLORSCHEME_OPTIONS_SELECTED}
157          </select>
158        </label>
159      </li>
160      <li>
161        <label>
162          <span class="property">{'Show faces'|@translate}</span>
163          <input type="checkbox" name="FBP_SOCIAL_PLUGIN_LIKE_BOX_SHOW_FACES" {$social_plugin.like_box.SHOW_FACES} />
164        </label>
165      </li>
166      <li>
167        <label>
168          <span class="property">{'Show stream'|@translate}</span>
169          <input type="checkbox" name="FBP_SOCIAL_PLUGIN_LIKE_BOX_STREAM" {$social_plugin.like_box.STREAM} />
170        </label>
171      </li>
172      <li>
173        <label>
174          <span class="property">{'Show header'|@translate}</span>
175          <input type="checkbox" name="FBP_SOCIAL_PLUGIN_LIKE_BOX_HEADER" {$social_plugin.like_box.HEADER} />
176        </label>
177      </li>
178    </div>
179  </ul>
180</fieldset>
181{/if}{* isset $social_plugin*}
182
183{if isset($advanced)}
184<fieldset>
185  <legend>{'Options'|@translate}</legend>
186  <ul>
187      <li>
188      <label>
189        <span class="property">{'Facebook application identifient'|@translate}</span>
190        <input type="text" size="15" name="FBP_FACEBOOK_APP_ID" value="{$advanced.FBP_FACEBOOK_APP_ID}" />
191      </label>
192    </li>
193{*    <li>
194      <label>
195        <span class="property">{'Asynchronous Facebook access'|@translate}</span>
196        <input type="checkbox" name="FBP_ASYNC_SCRIPT" {$advanced.FBP_ASYNC_SCRIPT} />
197      </label>
198    </li>*}
199    <li>
200      <label>
201        <span class="property">{'Picture URL type'|@translate}</span>
202        <select name="FBP_PICTURE_URL_TYPE" size="1">
203          {html_options options=$advanced.FBP_PICTURE_URL_TYPE_OPTIONS selected=$advanced.FBP_PICTURE_URL_TYPE_OPTIONS_SELECTED}
204        </select>
205      </label>
206    </li>
207    <li>
208      <label>
209        <span class="property">{'Allow Facebook to see private page (recommended)'|@translate}</span>
210        <input type="checkbox" name="FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE" {$advanced.FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE} />
211      </label>
212    </li>
213  </ul>
214</fieldset>
215{/if}{* isset $advanced*}
216
217
218  <p>
219    <input class="submit" type="submit" name="submit" value="{'Submit'|@translate}">
220    <input class="submit" type="reset" name="reset" value="{'Reset'|@translate}">
221  </p>
222
223</form>
224
225<div id="dialog_modal_like_button_comments" title="{'Informations'|@translate}">{'Like button and comments cannot be enabled together'|@translate}</div>
226{*<div id="dialog_modal_can_close" title="{'Informations'|@translate}">{'Data are modified but not saved! Are you sure to quit this tabsheet?'|@translate}</div>*}
227
228{literal}
229<script type="text/javascript">
230  function show_hide(checkbox_name, div_name)
231  {
232    if ($("input[name="+checkbox_name+"]").attr('checked'))
233    {
234      $("#"+div_name).show();
235    }
236    else
237    {
238      $("#"+div_name).hide();
239    }
240  }
241
242  function inverse_check_value(checkbox_name_1, checkbox_name_2)
243  {
244    if ($("input[name="+checkbox_name_1+"]").attr('checked') && $("input[name="+checkbox_name_2+"]").attr('checked'))
245    {
246      $("input[name="+checkbox_name_1+"]").attr('checked', false);
247      $("#dialog_modal_like_button_comments").dialog('open');
248    }
249  }
250
251  function init_checkbox(checkbox_name, div_name)
252  {
253    $("input[name="+checkbox_name+"]").click(
254      function()
255      {
256        show_hide(checkbox_name, div_name);
257      }
258    );
259    show_hide(checkbox_name, div_name);
260  }
261
262  function init_checkbox_with_inverse_value(checkbox_name_1, checkbox_name_2)
263  {
264    $("input[name="+checkbox_name_1+"]").click(
265      function()
266      {
267        inverse_check_value(checkbox_name_1, checkbox_name_2);
268      }
269    );
270    $("input[name="+checkbox_name_2+"]").click(
271      function()
272      {
273        inverse_check_value(checkbox_name_2, checkbox_name_1);
274      }
275    );
276  }
277
278  $(document).ready(
279    function()
280    {
281      //Init all main checkbox
282      init_checkbox_with_inverse_value("FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ENABLED", "FBP_SOCIAL_PLUGIN_COMMENTS_ENABLED");
283      init_checkbox("FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ENABLED", "like_button");
284      init_checkbox("FBP_SOCIAL_PLUGIN_FACEPILE_ENABLED", "facepile");
285      init_checkbox("FBP_SOCIAL_PLUGIN_COMMENTS_ENABLED", "comments");
286      init_checkbox("FBP_SOCIAL_PLUGIN_LIKE_BOX_ENABLED", "like_box");
287      // Init message box
288      $("#dialog_modal_like_button_comments").dialog({
289        autoOpen: false, modal: true, dialogClass: 'admin_config', // necessary to have a specific class because there are conflic with main menu accordeon
290        buttons: { "{/literal}{'Continue'|@translate}{literal}": function() { $(this).dialog("close"); } },
291      });
292      $("#dialog_modal_can_close").dialog({
293        autoOpen: false, modal: true, dialogClass: 'admin_config', // necessary to have a specific class because there are conflic with main menu accordeon
294        buttons: { "Cancel": function() { $(this).dialog("close"); }, "{/literal}{'Submit'|@translate}{literal}": function() { IsDataChanged = false; $(this).dialog("close"); } },
295      });
296      // Detect data change
297      /*IsDataChanged = false;
298      $("input, select").change(function() { IsDataChanged = true; });
299      //~ $(".tabsheet").click(function()
300      $(window).unload(function()
301        {
302          if (IsDataChanged)
303          {
304            //~ alert($(this).attr("name"));
305           //~ $("#dialog_modal_can_close").dialog( "option", "buttons", { "{/literal}{'Submit'|@translate}{literal}": function() { $(this).dialog("close"); } } );
306            $("#dialog_modal_can_close").dialog('open');
307           
308            //~ return true;
309            return false
310          }
311          else
312          {
313            return true;
314          }
315          //return ! IsDataChanged;
316        });*/
317    });
318
319</script>
320{/literal}
Note: See TracBrowser for help on using the repository browser.