Commit 48dcdd03c34bc53e966643cbf27d49df70697abd

Authored by Kevin Fourie
1 parent 9be85416

KTC-230

"ZendGuard 5.0.0 array_multisort bug is breaking encoding."
Fixed. Used two sorts instead of multisort.

Committed By: Kevin Fourie
Reviewed By: Conrad Vermeulen



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7132 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 26 additions and 26 deletions
lib/session/SiteMap.inc
... ... @@ -8,7 +8,7 @@
8 8 * License Version 1.1.2 ("License"); You may not use this file except in
9 9 * compliance with the License. You may obtain a copy of the License at
10 10 * http://www.knowledgetree.com/KPL
11   - *
  11 + *
12 12 * Software distributed under the License is distributed on an "AS IS"
13 13 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
14 14 * See the License for the specific language governing rights and
... ... @@ -19,9 +19,9 @@
19 19 * (ii) the KnowledgeTree copyright notice
20 20 * in the same form as they appear in the distribution. See the License for
21 21 * requirements.
22   - *
  22 + *
23 23 * The Original Code is: KnowledgeTree Open Source
24   - *
  24 + *
25 25 * The Initial Developer of the Original Code is The Jam Warehouse Software
26 26 * (Pty) Ltd, trading as KnowledgeTree.
27 27 * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright
... ... @@ -50,12 +50,12 @@ class SiteMap {
50 50 * Whether to use the database to store the sitemap or not
51 51 */
52 52 var $bUseDB;
53   -
  53 +
54 54 /**
55 55 * Whether to the user accessing the page is a Sysadmin
56 56 */
57 57 var $isSysAdmin;
58   -
  58 +
59 59 /**
60 60 * * Whether to the user accessing the page is a Unitadmin
61 61 */
... ... @@ -78,7 +78,7 @@ class SiteMap {
78 78 /**
79 79 * Sets the database flag
80 80 *
81   - * @param boolean whether to use the database to store the sitemap or not
  81 + * @param boolean whether to use the database to store the sitemap or not
82 82 */
83 83 function setUseDB($bUseDB) {
84 84 $this->bUseDB = $bUseDB;
... ... @@ -111,12 +111,12 @@ class SiteMap {
111 111 "order" => $iOrder);
112 112 }
113 113 }
114   -
  114 +
115 115 function addSectionColour($sSectionName, $sHtmlElement, $sColour) {
116   - $this->aSectionColours[$sSectionName][$sHtmlElement] = $sColour;
  116 + $this->aSectionColours[$sSectionName][$sHtmlElement] = $sColour;
117 117 }
118   -
119   - function getSectionColour($sSectionName, $sHtmlElement) {
  118 +
  119 + function getSectionColour($sSectionName, $sHtmlElement) {
120 120 return $this->aSectionColours[$sSectionName][$sHtmlElement];
121 121 }
122 122  
... ... @@ -127,7 +127,7 @@ class SiteMap {
127 127 * @param string the corresponding page for this action
128 128 * @param string the section this page falls under
129 129 * @param int the minimum access needed to access this page
130   - * @param string description of the page for link presentation
  130 + * @param string description of the page for link presentation
131 131 */
132 132 function addDefaultPage($sAction, $sPage, $sSectionName, $sRequiredAccess, $sLinkText, $bEnabled = true, $iOrder = 0) {
133 133 if (!$this->bUseDB) {
... ... @@ -153,7 +153,7 @@ class SiteMap {
153 153 /**
154 154 * Returns controller links for a section.
155 155 * Checks whether to use the db or not and calls the appropriate method
156   - *
  156 + *
157 157 * @param string the section to return links for
158 158 */
159 159 function getSectionLinks($sSectionName, $bSortLinks = true) {
... ... @@ -195,7 +195,7 @@ class SiteMap {
195 195 if (strlen($sql->f("link_text")) > 0) {
196 196 $results["descriptions"][] = $sql->f("link_text");
197 197 // if fFolderID is set and fFolderID is in the page string
198   - // append folderID to the controller link
  198 + // append folderID to the controller link
199 199 $results["links"][] = isset($iFolderID) ? generateControllerLink($sql->f("action"), "fFolderID=$iFolderID") : generateControllerLink($sql->f("action"), "");
200 200 }
201 201 }
... ... @@ -244,11 +244,11 @@ class SiteMap {
244 244 ($pages[$action]["enabled"]) && (!$pages[$action]["default"])) {
245 245 if (!$bSortLinks) {
246 246 $results["descriptions"][$pages[$action]["order"]] = $pages[$action]["description"];
247   -
  247 +
248 248 $results["links"][$pages[$action]["order"]] = isset($iFolderID) ? generateControllerLink($action, "fFolderID=$iFolderID") : generateControllerLink($action, "");
249 249 } else {
250 250 $results["descriptions"][] = $pages[$action]["description"];
251   -
  251 +
252 252 $results["links"][] = isset($iFolderID) ? generateControllerLink($action, "fFolderID=$iFolderID") : generateControllerLink($action, "");
253 253 }
254 254 }
... ... @@ -258,9 +258,9 @@ class SiteMap {
258 258 // now check if we have anything in the results array before returning it
259 259 if (count($results) > 0) {
260 260 if ($bSortLinks) {
261   - // alpha sort the results
262   - array_multisort ($results["descriptions"], SORT_ASC,
263   - $results["links"], SORT_ASC);
  261 + // alpha sort the results
  262 + sort($results["descriptions"], SORT_ASC);
  263 + sort($results["links"], SORT_ASC);
264 264 reset ($results);
265 265 }
266 266 return $results;
... ... @@ -272,7 +272,7 @@ class SiteMap {
272 272 return false;
273 273 }
274 274 }
275   -
  275 +
276 276 /**
277 277 * Returns the link text for a page
278 278 *
... ... @@ -298,12 +298,12 @@ class SiteMap {
298 298 }
299 299 }
300 300 }
301   - }
  301 + }
302 302 }
303   -
  303 +
304 304 /**
305 305 * Returns the page mapped to the (action, groupName) pair.
306   - * Checks whether to use the db or not and calls the appropriate method
  306 + * Checks whether to use the db or not and calls the appropriate method
307 307 *
308 308 * @param string the action to lookup pages for
309 309 * @return string the page to redirect to, or false if the user doesn't have access to the page
... ... @@ -383,7 +383,7 @@ class SiteMap {
383 383  
384 384 /**
385 385 * Returns the section name of the supplied page
386   - * Checks whether to use the db or not and calls the appropriate method
  386 + * Checks whether to use the db or not and calls the appropriate method
387 387 *
388 388 * @param string the page to lookup the section for
389 389 */
... ... @@ -443,7 +443,7 @@ class SiteMap {
443 443  
444 444 /**
445 445 * Returns the default action for the supplied section
446   - * Checks whether to use the db or not and calls the appropriate method
  446 + * Checks whether to use the db or not and calls the appropriate method
447 447 *
448 448 * @param string the section name to return the default action for
449 449 * @return string the controller action for the default page for this section
... ... @@ -629,7 +629,7 @@ class SiteMap {
629 629 $aFieldValue = array(
630 630 'name' => $section,
631 631 );
632   - $id =& DBUtil::autoInsert($default->site_sections_table, $aFieldValues);
  632 + $id = DBUtil::autoInsert($default->site_sections_table, $aFieldValues);
633 633  
634 634 // $default->log->debug("Sitemap::syncWithDB insert=$sSectionSql");
635 635  
... ... @@ -653,7 +653,7 @@ class SiteMap {
653 653 is_default => $page["default"],
654 654 is_enabled => $page["enabled"],
655 655 );
656   - $id =& DBUtil::autoInsert($default->sitemap_table, $aFieldValues);
  656 + $id = DBUtil::autoInsert($default->sitemap_table, $aFieldValues);
657 657 if (PEAR::isError($id)) {
658 658 $default->log->debug("Sitemap::syncWithDB sitemap insert failed ($sSiteMapSql)");
659 659 } else {
... ...