浏览代码

String and phpDocumentor fix

Fredrik Jervfors 20 年之前
父节点
当前提交
94575cc163
共有 4 个文件被更改,包括 25 次插入24 次删除
  1. 5 5
      functions/abook_database.php
  2. 5 5
      functions/abook_local_file.php
  3. 7 6
      functions/addressbook.php
  4. 8 8
      functions/options.php

+ 5 - 5
functions/abook_database.php

@@ -313,8 +313,8 @@ class abook_database extends addressbook_backend {
         /* See if user exist already */
         /* See if user exist already */
         $ret = $this->lookup($userdata['nickname']);
         $ret = $this->lookup($userdata['nickname']);
         if (!empty($ret)) {
         if (!empty($ret)) {
-            return $this->set_error(sprintf(_("User '%s' already exists"),
-                                            $ret['nickname']));
+            return $this->set_error(sprintf(_("User %s already exists"),
+                        '"' . $ret['nickname'] . '"'));
         }
         }
 
 
         /* Create query */
         /* Create query */
@@ -394,8 +394,8 @@ class abook_database extends addressbook_backend {
          /* See if user exist */
          /* See if user exist */
         $ret = $this->lookup($alias);
         $ret = $this->lookup($alias);
         if (empty($ret)) {
         if (empty($ret)) {
-            return $this->set_error(sprintf(_("User '%s' does not exist"),
-                                            $alias));
+            return $this->set_error(sprintf(_("User %s does not exist"),
+                        '&qout;' . $alias . '&qout;'));
         }
         }
 
 
         /* Create query */
         /* Create query */
@@ -424,4 +424,4 @@ class abook_database extends addressbook_backend {
 } /* End of class abook_database */
 } /* End of class abook_database */
 
 
 // vim: et ts=4
 // vim: et ts=4
-?>
+?>

+ 5 - 5
functions/abook_local_file.php

@@ -357,8 +357,8 @@ class abook_local_file extends addressbook_backend {
         /* See if user exists already */
         /* See if user exists already */
         $ret = $this->lookup($userdata['nickname']);
         $ret = $this->lookup($userdata['nickname']);
         if(!empty($ret)) {
         if(!empty($ret)) {
-            return $this->set_error(sprintf(_("User '%s' already exists"),
-                   $ret['nickname']));
+            return $this->set_error(sprintf(_("User %s already exists"),
+                        '"' . $ret['nickname'] . '"'));
         }
         }
 
 
         /* Here is the data to write */
         /* Here is the data to write */
@@ -450,8 +450,8 @@ class abook_local_file extends addressbook_backend {
         /* See if user exists */
         /* See if user exists */
         $ret = $this->lookup($alias);
         $ret = $this->lookup($alias);
         if(empty($ret)) {
         if(empty($ret)) {
-            return $this->set_error(sprintf(_("User '%s' does not exist"),
-                $alias));
+            return $this->set_error(sprintf(_("User %s does not exist"),
+                        '"' . $alias . '"'));
         }
         }
 
 
         /* Lock the file to make sure we're the only process working
         /* Lock the file to make sure we're the only process working
@@ -503,4 +503,4 @@ class abook_local_file extends addressbook_backend {
     }
     }
 
 
 } /* End of class abook_local_file */
 } /* End of class abook_local_file */
-?>
+?>

+ 7 - 6
functions/addressbook.php

@@ -1,4 +1,5 @@
 <?php
 <?php
+
 /**
 /**
  * functions/addressbook.php - Functions and classes for the addressbook system
  * functions/addressbook.php - Functions and classes for the addressbook system
  *
  *
@@ -69,7 +70,6 @@ function addressbook_init($showerr = true, $onlylocal = false) {
             // no need to use $abook->error, because message explains error.
             // no need to use $abook->error, because message explains error.
             $abook_init_error.=sprintf( _("Error opening file %s"), $filename );
             $abook_init_error.=sprintf( _("Error opening file %s"), $filename );
         }
         }
-
     }
     }
 
 
     /* Global file based addressbook */
     /* Global file based addressbook */
@@ -131,7 +131,7 @@ function addressbook_init($showerr = true, $onlylocal = false) {
      * hook allows to include different address book backends.
      * hook allows to include different address book backends.
      * plugins should extract $abook and $r from arguments
      * plugins should extract $abook and $r from arguments
      * and use same add_backend commands as above functions.
      * and use same add_backend commands as above functions.
-     * @since 1.5.1
+     * @since 1.5.1 and 1.4.5
      */
      */
     $hookReturn = do_hook('abook_init', $abook, $r);
     $hookReturn = do_hook('abook_init', $abook, $r);
     $abook = $hookReturn[1];
     $abook = $hookReturn[1];
@@ -147,7 +147,7 @@ function addressbook_init($showerr = true, $onlylocal = false) {
                     if (!$r && $showerr) {
                     if (!$r && $showerr) {
                         if ($abook_init_error!='') $abook_init_error.="<br />\n";
                         if ($abook_init_error!='') $abook_init_error.="<br />\n";
                         $abook_init_error.=sprintf(_("Error initializing LDAP server %s:") .
                         $abook_init_error.=sprintf(_("Error initializing LDAP server %s:") .
-                                                   "<br />\n", $param['host']);
+                                "<br />\n", $param['host']);
                         $abook_init_error.= $abook->error;
                         $abook_init_error.= $abook->error;
                     }
                     }
                 }
                 }
@@ -161,6 +161,7 @@ function addressbook_init($showerr = true, $onlylocal = false) {
     if ($abook_init_error!='' && $showerr) {
     if ($abook_init_error!='' && $showerr) {
         error_box($abook_init_error,$color);
         error_box($abook_init_error,$color);
     }
     }
+
     /* Return the initialized object */
     /* Return the initialized object */
     return $abook;
     return $abook;
 }
 }
@@ -925,8 +926,8 @@ require_once(SM_PATH . 'functions/abook_ldap_server.php');
 
 
 /* Only load database backend if database is configured */
 /* Only load database backend if database is configured */
 if((isset($addrbook_dsn) && !empty($addrbook_dsn)) ||
 if((isset($addrbook_dsn) && !empty($addrbook_dsn)) ||
- (isset($addrbook_global_dsn) && !empty($addrbook_global_dsn)) ) {
-  include_once(SM_PATH . 'functions/abook_database.php');
+        (isset($addrbook_global_dsn) && !empty($addrbook_global_dsn))) {
+    include_once(SM_PATH . 'functions/abook_database.php');
 }
 }
 
 
 /*
 /*
@@ -934,7 +935,7 @@ if((isset($addrbook_dsn) && !empty($addrbook_dsn)) ||
  * class must follow address book class coding standards.
  * class must follow address book class coding standards.
  *
  *
  * see addressbook_backend class and functions/abook_*.php files.
  * see addressbook_backend class and functions/abook_*.php files.
- * @since 1.5.1
+ * @since 1.5.1 and 1.4.5
  */
  */
 do_hook('abook_add_class');
 do_hook('abook_add_class');
 
 

+ 8 - 8
functions/options.php

@@ -611,14 +611,14 @@ function create_option_groups($optgrps, $optvals) {
         foreach ($grpopts as $optset) {
         foreach ($grpopts as $optset) {
             /* Create a new option with all values given. */
             /* Create a new option with all values given. */
             $next_option = new SquirrelOption(
             $next_option = new SquirrelOption(
-                 $optset['name'],
-                 $optset['caption'],
-                 $optset['type'],
-                 (isset($optset['refresh']) ? $optset['refresh'] : SMOPT_REFRESH_NONE),
-                 (isset($optset['initial_value']) ? $optset['initial_value'] : ''),
-                 (isset($optset['posvals']) ? $optset['posvals'] : ''),
-                 (isset($optset['htmlencoded']) ? $optset['htmlencoded'] : false)
-            );
+                    $optset['name'],
+                    $optset['caption'],
+                    $optset['type'],
+                    (isset($optset['refresh']) ? $optset['refresh'] : SMOPT_REFRESH_NONE),
+                    (isset($optset['initial_value']) ? $optset['initial_value'] : ''),
+                    (isset($optset['posvals']) ? $optset['posvals'] : ''),
+                    (isset($optset['htmlencoded']) ? $optset['htmlencoded'] : false)
+                    );
 
 
             /* If provided, set the size for this option. */
             /* If provided, set the size for this option. */
             if (isset($optset['size'])) {
             if (isset($optset['size'])) {