]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Add API setting in the new theme during the installation 831/head
authorArthurHoaro <arthur@hoa.ro>
Wed, 22 Mar 2017 18:58:22 +0000 (19:58 +0100)
committerArthurHoaro <arthur@hoa.ro>
Wed, 22 Mar 2017 18:58:22 +0000 (19:58 +0100)
Also use the same variable name across template files

index.php
tpl/default/configure.html
tpl/default/install.html
tpl/vintage/configure.html

index cc7f3ca3497feaf96288b61f718997eb0c3a09cf..e5bfc2c275c7b21f6296155855f7020acc34334c 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1142,7 +1142,7 @@ function renderPage($conf, $pluginManager, $LINKSDB)
             $conf->set('feed.rss_permalinks', !empty($_POST['enableRssPermalinks']));
             $conf->set('updates.check_updates', !empty($_POST['updateCheck']));
             $conf->set('privacy.hide_public_links', !empty($_POST['hidePublicLinks']));
-            $conf->set('api.enabled', !empty($_POST['apiEnabled']));
+            $conf->set('api.enabled', !empty($_POST['enableApi']));
             $conf->set('api.secret', escape($_POST['apiSecret']));
             try {
                 $conf->write(isLoggedIn());
index d6536d47509a5228bda5e1acbc70a32069735f35..1226148743a038f6c02835644538aa9c08db2ead 100644 (file)
       <div class="pure-g">
         <div class="pure-u-lg-{$ratioLabel} pure-u-{$ratioLabelMobile}">
           <div class="form-label">
-            <label for="apiEnabled">
+            <label for="enableApi">
               <span class="label-name">{'Enable REST API'|t}</span><br>
               <span class="label-desc">{'Allow third party software to use Shaarli such as mobile application'|t}</span>
             </label>
         </div>
         <div class="pure-u-lg-{$ratioInput} pure-u-{$ratioInputMobile}">
           <div class="form-input">
-            <input type="checkbox" name="apiEnabled" id="apiEnabled"
+            <input type="checkbox" name="enableApi" id="enableApi"
                  {if="$api_enabled"}checked{/if}/>
           </div>
         </div>
index 33f8a45336c4a448505001dbce93d55f88261f34..663397ac51f896008b33ecffaafb7f82592db22f 100644 (file)
@@ -7,6 +7,8 @@
 
 {$ratioLabel='1-4'}
 {$ratioInput='3-4'}
+{$ratioLabelMobile='7-8'}
+{$ratioInputMobile='1-8'}
 
 <form method="POST" action="#" name="installform" id="installform">
 <div class="pure-g">
       </div>
     </div>
 
+    <div class="pure-g">
+      <div class="pure-u-lg-{$ratioLabel} pure-u-{$ratioLabelMobile}">
+        <div class="form-label">
+          <label for="enableApi">
+            <span class="label-name">{'Enable REST API'|t}</span><br>
+            <span class="label-desc">{'Allow third party software to use Shaarli such as mobile application'|t}</span>
+          </label>
+        </div>
+      </div>
+      <div class="pure-u-lg-{$ratioInput} pure-u-{$ratioInputMobile}">
+        <div class="form-input">
+          <input type="checkbox" name="enableApi" id="enableApi" checked />
+        </div>
+      </div>
+    </div>
+
     <div class="center">
       <input type="submit" value="{'Install'|t}" name="Save">
     </div>
index 5820e6e4022d902f7284205405ab1e0495687b1a..704389c596103954ea1ae532b10fd6db5ecaf3bf 100644 (file)
@@ -97,9 +97,9 @@
       <tr>
         <td valign="top"><b>Enable REST API</b></td>
         <td>
-          <input type="checkbox" name="apiEnabled" id="apiEnabled"
+          <input type="checkbox" name="enableApi" id="enableApi"
                  {if="$api_enabled"}checked{/if}/>
-          <label for="apiEnabled">&nbsp;Allow third party software to use Shaarli such as mobile application.</label>
+          <label for="enableApi">&nbsp;Allow third party software to use Shaarli such as mobile application.</label>
         </td>
       </tr>
       <tr>