Ignore:
Timestamp:
Dec 5, 2013 6:58:11 AM (10 years ago)
Author:
anonymous
Message:

Very minor things

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Hierarchy.inc.php

    r396 r441  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    2323/**
    2424 * Hierarchy.inc.php
    25  * 
     25 *
    2626 * Objective: This class provides the tools to organize pieces of data into a
    2727 * hierarchy of nodes. Any form of data (article, product, image) can be
     
    116116    {
    117117            $app =& App::getInstance();
    118    
     118
    119119            if (!isset($child_type) || !isset($child_id)) {
    120120            if ($this->node_init) {
     
    122122                $child_id =& $this->child_id;
    123123            } 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__);
    125125                return false;
    126126            }
     
    150150    {
    151151            $app =& App::getInstance();
    152    
     152
    153153            if (preg_match('/^([[:alnum:]]+)__-?([[:digit:]]+)$/', $node, $node_parts)) {
    154154            return array('node_type' => $node_parts[1], 'node_id' => $node_parts[2]);
    155155        } 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__);
    157157            return false;
    158158        }
     
    171171        $app =& App::getInstance();
    172172        $db =& DB::getInstance();
    173    
     173
    174174        if (!isset($child_type) || !isset($child_id)) {
    175175            if ($this->node_init) {
     
    177177                $child_id =& $this->child_id;
    178178            } 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__);
    180180                return false;
    181181            }
     
    250250        $app =& App::getInstance();
    251251        $db =& DB::getInstance();
    252    
     252
    253253        if (!isset($child_type) || !isset($child_id)) {
    254254            if ($this->node_init) {
     
    256256                $child_id =& $this->child_id;
    257257            } 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__);
    259259                return false;
    260260            }
     
    306306                $child_id =& $this->child_id;
    307307            } 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__);
    309309                return false;
    310310            }
     
    377377        $app =& App::getInstance();
    378378        $db =& DB::getInstance();
    379    
     379
    380380        if (!isset($child_type) || !isset($child_id)) {
    381381            if ($this->node_init) {
     
    383383                $child_id =& $this->child_id;
    384384            } 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__);
    386386                return false;
    387387            }
     
    428428        $app =& App::getInstance();
    429429        $db =& DB::getInstance();
    430    
     430
    431431        if (!isset($child_type) || !isset($child_id)) {
    432432            if ($this->node_init) {
     
    434434                $child_id =& $this->child_id;
    435435            } 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__);
    437437                return false;
    438438            }
     
    472472        $app =& App::getInstance();
    473473        $db =& DB::getInstance();
    474    
     474
    475475        if (!isset($child_type) || !isset($child_id)) {
    476476            if ($this->node_init) {
     
    478478                $child_id =& $this->child_id;
    479479            } 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__);
    481481                return false;
    482482            }
     
    530530                $child_id =& $this->child_id;
    531531            } 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__);
    533533                return false;
    534534            }
     
    564564    {
    565565        $app =& App::getInstance();
    566    
     566
    567567        if (!isset($child_type) || !isset($child_id)) {
    568568            if ($this->node_init) {
     
    570570                $child_id =& $this->child_id;
    571571            } 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__);
    573573                return false;
    574574            }
     
    625625    {
    626626        $db =& DB::getInstance();
    627    
     627
    628628        static $output = array();
    629629        static $return_flag;
     
    680680        $app =& App::getInstance();
    681681        $db =& DB::getInstance();
    682    
     682
    683683        if (!isset($child_type) || !isset($child_id)) {
    684684            if ($this->node_init) {
     
    686686                $child_id =& $this->child_id;
    687687            } 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__);
    689689                return false;
    690690            }
     
    731731    {
    732732        $app =& App::getInstance();
    733    
     733
    734734        static $output = array();
    735735        static $is_a_leaf = array();
     
    740740                $child_id =& $this->child_id;
    741741            } 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__);
    743743                return false;
    744744            }
     
    804804    {
    805805        $db =& DB::getInstance();
    806    
     806
    807807        // Reset all the category counters to zero.
    808808        $db->query("UPDATE node_tbl SET subnode_quantity = 0");
     
    828828    {
    829829        $db =& DB::getInstance();
    830    
     830
    831831        $db->query("
    832832            UPDATE node_tbl
Note: See TracChangeset for help on using the changeset viewer.