]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
Updated 'Generate New Key' button to use ajax if javascript enabled.
authorMark Pemberton <mpemberton5@gmail.com>
Mon, 16 May 2011 04:35:31 +0000 (00:35 -0400)
committerMark Pemberton <mpemberton5@gmail.com>
Mon, 16 May 2011 04:35:31 +0000 (00:35 -0400)
data/templates/editprofile.tpl.php
src/SemanticScuttle/Service/Bookmark.php
www/profile.php

index 76f608a346d34b87e0c4877436e031e5c2d80f58..258e8648161b401e23bca41ba01cf48c5936b6e1 100644 (file)
@@ -33,7 +33,9 @@ $this->includeTemplate($GLOBALS['top_include']);
     <td><input type="checkbox" id="pEnablePrivateKey" name="pEnablePrivateKey" value="true" <?php echo $privateKeyIsEnabled;?> />
         <label for="pEnablePrivateKey"><?php echo T_('Enable'); ?></label>&nbsp;&nbsp;&nbsp;
         <input type="text" id="pPrivateKey" name="pPrivateKey" size="40" value="<?php echo $privateKey;?>" readonly="readonly" />
-        <input type="submit" name="submittedPK" value="<?php echo T_('Generate New Key'); ?>" />
+        <!--<input type="button" name="submittedPK" value="<?php echo T_('Generate New Key'); ?>" />-->
+
+        <a onClick="getNewPrivateKey(this); return false;"><button type="submit" name="submittedPK" value="1"><?php echo T_('Generate New Key'); ?></button></a>
     </td>
 </tr>
 </table>
index 57d0b2e9f8725324cd882640c57d99e655b5640f..9a075beca0f0b6942f1ab1ec267f53ab119ff497 100644 (file)
@@ -728,14 +728,15 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
             $privacy = ' AND B.bStatus = 0';
         }
 
+        $tagcount = 0;
         // Set up the tags, if need be.
-        if (!is_array($tags) && !is_null($tags)) {
+        if (!is_array($tags) && !is_null($tags) && $tags<>"") {
             $tags = explode('+', trim($tags));
-        }
 
-        $tagcount = count($tags);
-        for ($i = 0; $i < $tagcount; $i ++) {
-            $tags[$i] = trim($tags[$i]);
+            $tagcount = count($tags);
+            for ($i = 0; $i < $tagcount; $i ++) {
+                $tags[$i] = trim($tags[$i]);
+            }
         }
 
         // Set up the SQL query.
index e6894d03442a5b3278f94c7ad3d96b736b479286..63f4da8f93affe380d2c52d1ab69189d7b5e0af0 100644 (file)
@@ -23,6 +23,7 @@ require_once 'www-header.php';
 
 /* Service creation: only useful services are created */
 // No specific services
+$tplVars['loadjs'] = true;
 
 /* Managing all possible inputs */
 isset($_POST['submittedPK']) ? define('POST_SUBMITTEDPK', $_POST['submittedPK']): define('POST_SUBMITTEDPK', '');