Changeset 441 for trunk/lib/Hierarchy.inc.php
- Timestamp:
- Dec 5, 2013 6:58:11 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Hierarchy.inc.php
r396 r441 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 23 23 /** 24 24 * Hierarchy.inc.php 25 * 25 * 26 26 * Objective: This class provides the tools to organize pieces of data into a 27 27 * hierarchy of nodes. Any form of data (article, product, image) can be … … 116 116 { 117 117 $app =& App::getInstance(); 118 118 119 119 if (!isset($child_type) || !isset($child_id)) { 120 120 if ($this->node_init) { … … 122 122 $child_id =& $this->child_id; 123 123 } else { 124 $app->logMsg('toStringID failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);124 $app->logMsg('toStringID failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 125 125 return false; 126 126 } … … 150 150 { 151 151 $app =& App::getInstance(); 152 152 153 153 if (preg_match('/^([[:alnum:]]+)__-?([[:digit:]]+)$/', $node, $node_parts)) { 154 154 return array('node_type' => $node_parts[1], 'node_id' => $node_parts[2]); 155 155 } else { 156 $app->logMsg('Cannot parse node identifier, not formated correctly.' ), LOG_ERR, __FILE__, __LINE__);156 $app->logMsg('Cannot parse node identifier, not formated correctly.', LOG_ERR, __FILE__, __LINE__); 157 157 return false; 158 158 } … … 171 171 $app =& App::getInstance(); 172 172 $db =& DB::getInstance(); 173 173 174 174 if (!isset($child_type) || !isset($child_id)) { 175 175 if ($this->node_init) { … … 177 177 $child_id =& $this->child_id; 178 178 } else { 179 $app->logMsg('insertNode failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);179 $app->logMsg('insertNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 180 180 return false; 181 181 } … … 250 250 $app =& App::getInstance(); 251 251 $db =& DB::getInstance(); 252 252 253 253 if (!isset($child_type) || !isset($child_id)) { 254 254 if ($this->node_init) { … … 256 256 $child_id =& $this->child_id; 257 257 } else { 258 $app->logMsg('deleteNode failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);258 $app->logMsg('deleteNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 259 259 return false; 260 260 } … … 306 306 $child_id =& $this->child_id; 307 307 } else { 308 $app->logMsg('moveNode failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);308 $app->logMsg('moveNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 309 309 return false; 310 310 } … … 377 377 $app =& App::getInstance(); 378 378 $db =& DB::getInstance(); 379 379 380 380 if (!isset($child_type) || !isset($child_id)) { 381 381 if ($this->node_init) { … … 383 383 $child_id =& $this->child_id; 384 384 } else { 385 $app->logMsg('getParents failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);385 $app->logMsg('getParents failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 386 386 return false; 387 387 } … … 428 428 $app =& App::getInstance(); 429 429 $db =& DB::getInstance(); 430 430 431 431 if (!isset($child_type) || !isset($child_id)) { 432 432 if ($this->node_init) { … … 434 434 $child_id =& $this->child_id; 435 435 } else { 436 $app->logMsg('getNode failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);436 $app->logMsg('getNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 437 437 return false; 438 438 } … … 472 472 $app =& App::getInstance(); 473 473 $db =& DB::getInstance(); 474 474 475 475 if (!isset($child_type) || !isset($child_id)) { 476 476 if ($this->node_init) { … … 478 478 $child_id =& $this->child_id; 479 479 } else { 480 $app->logMsg('getChildren failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);480 $app->logMsg('getChildren failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 481 481 return false; 482 482 } … … 530 530 $child_id =& $this->child_id; 531 531 } else { 532 $app->logMsg('getNumberChildren failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);532 $app->logMsg('getNumberChildren failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 533 533 return false; 534 534 } … … 564 564 { 565 565 $app =& App::getInstance(); 566 566 567 567 if (!isset($child_type) || !isset($child_id)) { 568 568 if ($this->node_init) { … … 570 570 $child_id =& $this->child_id; 571 571 } else { 572 $app->logMsg('isLeaf failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);572 $app->logMsg('isLeaf failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 573 573 return false; 574 574 } … … 625 625 { 626 626 $db =& DB::getInstance(); 627 627 628 628 static $output = array(); 629 629 static $return_flag; … … 680 680 $app =& App::getInstance(); 681 681 $db =& DB::getInstance(); 682 682 683 683 if (!isset($child_type) || !isset($child_id)) { 684 684 if ($this->node_init) { … … 686 686 $child_id =& $this->child_id; 687 687 } else { 688 $app->logMsg('nodeExists failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);688 $app->logMsg('nodeExists failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 689 689 return false; 690 690 } … … 731 731 { 732 732 $app =& App::getInstance(); 733 733 734 734 static $output = array(); 735 735 static $is_a_leaf = array(); … … 740 740 $child_id =& $this->child_id; 741 741 } else { 742 $app->logMsg('getNodeList failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);742 $app->logMsg('getNodeList failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 743 743 return false; 744 744 } … … 804 804 { 805 805 $db =& DB::getInstance(); 806 806 807 807 // Reset all the category counters to zero. 808 808 $db->query("UPDATE node_tbl SET subnode_quantity = 0"); … … 828 828 { 829 829 $db =& DB::getInstance(); 830 830 831 831 $db->query(" 832 832 UPDATE node_tbl
Note: See TracChangeset
for help on using the changeset viewer.