source: extensions/oAuth/admin/template/config.tpl @ 20293

Last change on this file since 20293 was 20293, checked in by mistic100, 11 years ago

first commit of oAuth plugin, still in developpement

File size: 6.3 KB
Line 
1{combine_css path=$OAUTH_PATH|@cat:"admin/template/style.css"}
2
3{footer_script}{literal}
4jQuery("select.enable").change(function() {
5  var $top = $(this).closest("div.provider");
6  var p = $top.data('p');
7 
8  if ($(this).val()=='true') {
9    $top.find("td.keys").show();
10    $top.removeClass('disabled');
11    $top.addClass('enabled');
12  }
13  else {
14    $top.find("td.keys").hide();
15    $top.removeClass('enabled');
16    $top.addClass('disabled');
17  }
18});
19
20jQuery("#close_help").click(function() {
21  jQuery("#help_container").animate({"margin-right": "-550px"}, 'fast');
22  return false;
23});
24
25jQuery(".open-help").click(function() {
26  var $top = $(this).closest("div.provider");
27  var p = $top.data('p');
28 
29  $("#help_container h5").html($top.find("h4").html());
30  $("#help_container div").html($top.find("div.help").html());
31  $("#help_container").animate({"margin-right": "0px"}, 'fast');
32  return false;
33});
34{/literal}{/footer_script}
35
36
37<div class="titrePage">
38        <h2>oAuth</h2>
39</div>
40
41<form method="post" action="" class="properties">
42<fieldset id="commentsConf">
43  <legend></legend>
44  <ul>
45    <li>
46      <label>
47        <input type="checkbox" name="display_menubar" {if ($display_menubar)}checked="checked"{/if}>
48        <b>{'Display sign in buttons in the menubar'|@translate}</b>
49      </label>
50    </li>
51
52    <li>
53      <label>
54        <input type="checkbox" name="display_register" {if ($display_register)}checked="checked"{/if}>
55        <b>{'Display sign in buttons on the register page'|@translate}</b>
56      </label>
57    </li>
58  </ul>
59</fieldset>
60
61<p style="text-align:left;"><input type="submit" name="save_config" value="{'Save Settings'|@translate}"></p>
62
63<fieldset id="providers">
64  <div id="help_container">
65    <a href="#" id="close_help" title="{'Close'|@translate}">&times;</a>
66    <h5></h5>
67    <div></div>
68  </div>
69  <legend>{'Providers'|@translate}</legend>
70 
71{foreach from=$PROVIDERS item=provider key=p}
72<div data-p="{$p}" class="provider {if $CONFIG[$p].enabled}enabled{else}disabled{/if}">
73  <h4>{$provider.provider_name}</h4>
74 
75  <table><tr>
76    <td>
77      <img src="{$OAUTH_PATH}template/icons/{$p|strtolower}_big.png">
78    </td>
79   
80    <td>
81      <select name="providers[{$p}][enabled]" class="enable">
82        <option value="true" {if $CONFIG[$p].enabled}selected="selected"{/if}>{'Enabled'|@translate}</option>
83        <option value="false" {if not $CONFIG[$p].enabled}selected="selected"{/if}>{'Disabled'|@translate}</option>
84      </select>
85      <br><a href="#" class="open-help">{'Help'|@translate}</a>
86    </td>
87   
88    {if $provider.new_app_link}
89    <td class="keys" {if not $CONFIG[$p].enabled}style="display:none;"{/if}>
90      {if $provider.require_client_id}
91        <label for="{$p}_app_id">Application ID</label>
92        <input type="text" id="{$p}_app_id" name="providers[{$p}][keys][id]" value="{$CONFIG[$p].keys.id}">
93      {else}
94        <label for="{$p}_key">Application Key</label>
95        <input type="text" id="{$p}_key" name="providers[{$p}][keys][key]" value="{$CONFIG[$p].keys.key}">
96      {/if}
97        <label for="{$p}_secret">Application Secret</label>
98        <input type="text" id="{$p}_secret" name="providers[{$p}][keys][secret]" value="{$CONFIG[$p].keys.secret}">
99        <br>
100    </td>
101    {/if}
102  </tr></table>
103 
104  <div class="help">
105  {if $provider.new_app_link}
106    <ol>
107      <li>{'Go to <a href="%s" target="_blank">%s</a> and <b>create a new application</b>'|@translate|sprintf:$provider.new_app_link:$provider.new_app_link}</li>
108     
109    {if $p=='Google'}
110      <li>{'On the <b>API Access</b> tab, <b>create an OAuth 2.0 Client ID</b>'|@translate}</li>
111      <li>{'Fill out any required fields such as the application name and description'|@translate}</li>
112      <li>{'On the <b>Create Client ID</b> popup switch to advanced settings by clicking on <b>(more options)</b>'|@translate}</li>
113    {else}
114      <li>{'Fill out any required fields such as the application name and description'|@translate}</li>
115    {/if}
116     
117    {if $provider.callback}
118      <li>
119        {assign var=callback value=$OAUTH_CALLBACK|cat:$p}
120        {'Provide this URL as the Callback/Redirect URL for your application: <em>%s</em>'|@translate|sprintf:$callback}
121      </li>
122    {/if}
123
124    {if $p=='Live'}
125      <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Redirect Domain</b>':$SERVERNAME}</li>
126    {elseif $p=='Facebook'}
127      <li>{'Select <em>Website with facebook authentification</em> as application type'|@translate}</li>
128      <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Site Url</b>, <b>App Domains</b>':$SERVERNAME}</li>
129    {elseif $p=='LinkedIn'}
130      <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Website URL</b>':$SERVERNAME}</li>
131      <li>{'Set the <b>Application Type</b> to <em>Web Application</em>'|@translate}</li>
132    {elseif $p=='Yahoo'}
133      <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Application URL</b>, <b>Application Domain</b>':$SERVERNAME}</li>
134      <li>{'Set the <b>Kind of Application</b> to <em>Web-based</em>'|@translate}</li>
135      <li>{'Set the <b>Access Scopes</b> to <em>This app will only access public...</em>'|@translate}</li>
136    {elseif $p=='Twitter'}
137      <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Application Website</b>, <b>Application Callback URL</b>':$SERVERNAME}</li>
138      <li>{'Set the <b>Default Access Type</b> to <em>Read only</em>'|@translate}</li>
139    {elseif $p=='Tumblr'}
140      <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Application Website</b>, <b>Default Callback URL</b>':$SERVERNAME}</li>
141    {/if}
142   
143      <li>{'Once you have registered, copy and past the created application credentials into this setup page'|@translate}</li> 
144    </ol>
145  {else}
146    <p>{'No registration required for OpenID based providers'|@translate}</p>
147  {/if}
148  </div>
149</div>
150{/foreach}
151
152</fieldset>
153
154<p style="text-align:left;"><input type="submit" name="save_config" value="{'Save Settings'|@translate}"></p>
155 
156</form>
Note: See TracBrowser for help on using the repository browser.