CRM-15168 more metadata titles (& whitespace
[civicrm-core.git] / CRM / Utils / Weight.php
index b1dcfb7940b5b4781e74f06d41d8e47309b52aee..28822142d0ed49490925d908706f43d27d6cd483 100644 (file)
   | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
   +--------------------------------------------------------------------+
 */
+
+/**
+ * Class CRM_Utils_Weight
+ */
 class CRM_Utils_Weight {
   /**
    * @var array, list of GET fields which must be validated
@@ -332,6 +336,13 @@ class CRM_Utils_Weight {
     return $resultDAO;
   }
 
+  /**
+   * @param $rows
+   * @param $daoName
+   * @param $idName
+   * @param $returnURL
+   * @param null $filter
+   */
   static function addOrder(&$rows, $daoName, $idName, $returnURL, $filter = NULL) {
     if (empty($rows)) {
       return;
@@ -368,14 +379,14 @@ class CRM_Utils_Weight {
       $nextID = $ids[$i + 1];
 
       $links = array();
-      $url = "{$baseURL}&src=$id";
+      $url = "{$baseURL}&src=$id";
 
       if ($prevID != 0) {
         $alt = ts('Move to top');
-        $links[] = "<a class=\"crm-weight-arrow\" href=\"{$url}&dst={$firstID}&dir=first\"><img src=\"{$imageURL}/first.gif\" title=\"$alt\" alt=\"$alt\" class=\"order-icon\"></a>";
+        $links[] = "<a class=\"crm-weight-arrow\" href=\"{$url}&amp;dst={$firstID}&amp;dir=first\"><img src=\"{$imageURL}/first.gif\" title=\"$alt\" alt=\"$alt\" class=\"order-icon\"></a>";
 
         $alt = ts('Move up one row');
-        $links[] = "<a class=\"crm-weight-arrow\" href=\"{$url}&dst={$prevID}&dir=swap\"><img src=\"{$imageURL}/up.gif\" title=\"$alt\" alt=\"$alt\" class=\"order-icon\"></a>";
+        $links[] = "<a class=\"crm-weight-arrow\" href=\"{$url}&amp;dst={$prevID}&amp;dir=swap\"><img src=\"{$imageURL}/up.gif\" title=\"$alt\" alt=\"$alt\" class=\"order-icon\"></a>";
       }
       else {
         $links[] = "<img src=\"{$imageURL}/spacer.gif\" class=\"order-icon\">";
@@ -384,10 +395,10 @@ class CRM_Utils_Weight {
 
       if ($nextID != 0) {
         $alt = ts('Move down one row');
-        $links[] = "<a class=\"crm-weight-arrow\" href=\"{$url}&dst={$nextID}&dir=swap\"><img src=\"{$imageURL}/down.gif\" title=\"$alt\" alt=\"$alt\" class=\"order-icon\"></a>";
+        $links[] = "<a class=\"crm-weight-arrow\" href=\"{$url}&amp;dst={$nextID}&amp;dir=swap\"><img src=\"{$imageURL}/down.gif\" title=\"$alt\" alt=\"$alt\" class=\"order-icon\"></a>";
 
         $alt = ts('Move to bottom');
-        $links[] = "<a class=\"crm-weight-arrow\" href=\"{$url}&dst={$lastID}&dir=last\"><img src=\"{$imageURL}/last.gif\" title=\"$alt\" alt=\"$alt\" class=\"order-icon\"></a>";
+        $links[] = "<a class=\"crm-weight-arrow\" href=\"{$url}&amp;dst={$lastID}&amp;dir=last\"><img src=\"{$imageURL}/last.gif\" title=\"$alt\" alt=\"$alt\" class=\"order-icon\"></a>";
       }
       else {
         $links[] = "<img src=\"{$imageURL}/spacer.gif\" class=\"order-icon\">";
@@ -462,6 +473,9 @@ class CRM_Utils_Weight {
     self::fixOrderOutput($url);
   }
 
+  /**
+   * @param $url
+   */
   static function fixOrderOutput($url) {
     if (empty($_GET['snippet']) || $_GET['snippet'] !== 'json') {
       CRM_Utils_System::redirect($url);