Index: trunk/lib/App.inc.php
===================================================================
--- trunk/lib/App.inc.php	(revision 433)
+++ trunk/lib/App.inc.php	(revision 441)
Index: trunk/lib/Hierarchy.inc.php
===================================================================
--- trunk/lib/Hierarchy.inc.php	(revision 433)
+++ trunk/lib/Hierarchy.inc.php	(revision 441)
@@ -4,5 +4,5 @@
  * For details visit the project site: <http://trac.strangecode.com/codebase/>
  * Copyright 2001-2012 Strangecode, LLC
- * 
+ *
  * This file is part of The Strangecode Codebase.
  *
@@ -11,10 +11,10 @@
  * Free Software Foundation, either version 3 of the License, or (at your option)
  * any later version.
- * 
+ *
  * The Strangecode Codebase is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  * details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
@@ -23,5 +23,5 @@
 /**
  * Hierarchy.inc.php
- * 
+ *
  * Objective: This class provides the tools to organize pieces of data into a
  * hierarchy of nodes. Any form of data (article, product, image) can be
@@ -116,5 +116,5 @@
     {
 			$app =& App::getInstance();
-	
+
             if (!isset($child_type) || !isset($child_id)) {
             if ($this->node_init) {
@@ -122,5 +122,5 @@
                 $child_id =& $this->child_id;
             } else {
-                $app->logMsg('toStringID failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
+                $app->logMsg('toStringID failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
                 return false;
             }
@@ -150,9 +150,9 @@
     {
 			$app =& App::getInstance();
-	
+
             if (preg_match('/^([[:alnum:]]+)__-?([[:digit:]]+)$/', $node, $node_parts)) {
             return array('node_type' => $node_parts[1], 'node_id' => $node_parts[2]);
         } else {
-            $app->logMsg('Cannot parse node identifier, not formated correctly.'), LOG_ERR, __FILE__, __LINE__);
+            $app->logMsg('Cannot parse node identifier, not formated correctly.', LOG_ERR, __FILE__, __LINE__);
             return false;
         }
@@ -171,5 +171,5 @@
 		$app =& App::getInstance();
 		$db =& DB::getInstance();
-	
+
         if (!isset($child_type) || !isset($child_id)) {
             if ($this->node_init) {
@@ -177,5 +177,5 @@
                 $child_id =& $this->child_id;
             } else {
-                $app->logMsg('insertNode failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
+                $app->logMsg('insertNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
                 return false;
             }
@@ -250,5 +250,5 @@
 		$app =& App::getInstance();
 		$db =& DB::getInstance();
-	
+
         if (!isset($child_type) || !isset($child_id)) {
             if ($this->node_init) {
@@ -256,5 +256,5 @@
                 $child_id =& $this->child_id;
             } else {
-                $app->logMsg('deleteNode failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
+                $app->logMsg('deleteNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
                 return false;
             }
@@ -306,5 +306,5 @@
                 $child_id =& $this->child_id;
             } else {
-                $app->logMsg('moveNode failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
+                $app->logMsg('moveNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
                 return false;
             }
@@ -377,5 +377,5 @@
 		$app =& App::getInstance();
 		$db =& DB::getInstance();
-	
+
         if (!isset($child_type) || !isset($child_id)) {
             if ($this->node_init) {
@@ -383,5 +383,5 @@
                 $child_id =& $this->child_id;
             } else {
-                $app->logMsg('getParents failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
+                $app->logMsg('getParents failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
                 return false;
             }
@@ -428,5 +428,5 @@
 		$app =& App::getInstance();
 		$db =& DB::getInstance();
-	
+
         if (!isset($child_type) || !isset($child_id)) {
             if ($this->node_init) {
@@ -434,5 +434,5 @@
                 $child_id =& $this->child_id;
             } else {
-                $app->logMsg('getNode failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
+                $app->logMsg('getNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
                 return false;
             }
@@ -472,5 +472,5 @@
 		$app =& App::getInstance();
 		$db =& DB::getInstance();
-	
+
         if (!isset($child_type) || !isset($child_id)) {
             if ($this->node_init) {
@@ -478,5 +478,5 @@
                 $child_id =& $this->child_id;
             } else {
-                $app->logMsg('getChildren failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
+                $app->logMsg('getChildren failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
                 return false;
             }
@@ -530,5 +530,5 @@
                 $child_id =& $this->child_id;
             } else {
-                $app->logMsg('getNumberChildren failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
+                $app->logMsg('getNumberChildren failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
                 return false;
             }
@@ -564,5 +564,5 @@
     {
 		$app =& App::getInstance();
-	
+
         if (!isset($child_type) || !isset($child_id)) {
             if ($this->node_init) {
@@ -570,5 +570,5 @@
                 $child_id =& $this->child_id;
             } else {
-                $app->logMsg('isLeaf failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
+                $app->logMsg('isLeaf failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
                 return false;
             }
@@ -625,5 +625,5 @@
     {
 		$db =& DB::getInstance();
-	
+
         static $output = array();
         static $return_flag;
@@ -680,5 +680,5 @@
 		$app =& App::getInstance();
 		$db =& DB::getInstance();
-	
+
         if (!isset($child_type) || !isset($child_id)) {
             if ($this->node_init) {
@@ -686,5 +686,5 @@
                 $child_id =& $this->child_id;
             } else {
-                $app->logMsg('nodeExists failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
+                $app->logMsg('nodeExists failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
                 return false;
             }
@@ -731,5 +731,5 @@
     {
 		$app =& App::getInstance();
-	
+
         static $output = array();
         static $is_a_leaf = array();
@@ -740,5 +740,5 @@
                 $child_id =& $this->child_id;
             } else {
-                $app->logMsg('getNodeList failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
+                $app->logMsg('getNodeList failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
                 return false;
             }
@@ -804,5 +804,5 @@
     {
 		$db =& DB::getInstance();
-	
+
         // Reset all the category counters to zero.
         $db->query("UPDATE node_tbl SET subnode_quantity = 0");
@@ -828,5 +828,5 @@
     {
 		$db =& DB::getInstance();
-	
+
         $db->query("
             UPDATE node_tbl
Index: trunk/lib/PEdit.inc.php
===================================================================
--- trunk/lib/PEdit.inc.php	(revision 433)
+++ trunk/lib/PEdit.inc.php	(revision 441)
@@ -4,5 +4,5 @@
  * For details visit the project site: <http://trac.strangecode.com/codebase/>
  * Copyright 2001-2012 Strangecode, LLC
- * 
+ *
  * This file is part of The Strangecode Codebase.
  *
@@ -11,10 +11,10 @@
  * Free Software Foundation, either version 3 of the License, or (at your option)
  * any later version.
- * 
+ *
  * The Strangecode Codebase is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  * details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
@@ -35,11 +35,11 @@
  * and call printing/editing functions where you want data and forms to
  * show up.
- * 
+ *
  * @author  Quinn Comendant <quinn@strangecode.com>
  * @concept Beau Smith <beau@beausmith.com>
- * @version 2.0 
- * 
+ * @version 2.0
+ *
  * Example of use:
- 
+
  // Initialize PEdit object.
  require_once 'codebase/lib/PEdit.inc.php';
@@ -48,16 +48,16 @@
      'authorized' => true,
  ));
- 
+
  // Setup content data types.
  $pedit->set('title');
  $pedit->set('content', array('type' => 'textarea'));
- 
+
  // After setting all parameters and data, load the data.
  $pedit->start();
- 
+
  // Print content.
  echo $pedit->get('title');
  echo $pedit->get('content');
- 
+
  // Print additional PEdit functionality.
  $pedit->formBegin();
@@ -96,9 +96,9 @@
     {
         $this->setParam($params);
-        
+
         if ($this->getParam('authorized') === true) {
             $this->_authorized = true;
         }
-        
+
         // Setup PEAR XML libraries.
         require_once 'XML/Serializer.php';
@@ -114,5 +114,5 @@
         ));
     }
-    
+
     /**
      * Set (or overwrite existing) parameters by passing an array of new parameters.
@@ -143,5 +143,5 @@
     {
 		$app =& App::getInstance();
-    
+
         if (isset($this->_params[$param])) {
             return $this->_params[$param];
@@ -151,5 +151,5 @@
         }
     }
-    
+
     /*
     * Load the pedit data and run automatic functions.
@@ -166,9 +166,9 @@
             trigger_error(sprintf('PEdit data directory not found: %s', $this->getParam('data_dir')), E_USER_WARNING);
         }
-        
+
         // The location of the data file. (i.e.: "COMMON_DIR/html/_pedit_data/news/index.xml")
         $this->_data_file = sprintf('%s%s.xml', $this->getParam('data_dir'), $_SERVER['SCRIPT_NAME']);
-        
-        // Make certain the evaluated path matches the assumed path (realpath will expand /../../); 
+
+        // Make certain the evaluated path matches the assumed path (realpath will expand /../../);
         // if realpath returns FALSE we're not concerned because it means the file doesn't exist (_initializeDataFile() will create it).
         if (false !== realpath($this->_data_file) && $this->_data_file !== realpath($this->_data_file)) {
@@ -199,5 +199,5 @@
             break;
         }
-        
+
         // Load data.
         $this->_loadDataFile();
@@ -258,5 +258,5 @@
             return false;
         }
-        ?>        
+        ?>
         <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="post" id="sc-pedit-form">
         <input type="hidden" name="filename" value="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" />
@@ -307,5 +307,5 @@
     function printForm($name, $type='text')
     {
-        if ($this->_authorized && $this->op == 'Edit' && $this->_data_loaded) {        
+        if ($this->_authorized && $this->op == 'Edit' && $this->_data_loaded) {
             ?>
             <div class="sc-pedit-item">
@@ -468,5 +468,5 @@
         }
         $xml_file_contents = file_get_contents($this->_data_file);
-        $status = $this->xml_unserializer->unserialize($xml_file_contents, false);    
+        $status = $this->xml_unserializer->unserialize($xml_file_contents, false);
         if (PEAR::isError($status)) {
             $app->logMsg(sprintf('XML_Unserialize error: %s', $status->getMessage()), LOG_WARNING, __FILE__, __LINE__);
@@ -487,5 +487,5 @@
         return true;
     }
-    
+
     /*
     * Start a new data file.
@@ -535,5 +535,5 @@
                 return false;
             }
-            
+
             // Collect posted data that is already specified in _data (by set()).
             foreach ($new_data as $name => $content) {
@@ -542,5 +542,5 @@
                 }
             }
-            
+
             if (is_array($this->_data) && !empty($this->_data)) {
                 $xml_file_contents = $this->xml_serializer->serialize($this->_data);
@@ -549,5 +549,5 @@
         }
     }
-    
+
     /*
     * Writes content to the specified file.
@@ -587,5 +587,5 @@
         if ($fp = fopen($filename, 'w')) {
             if (flock($fp, LOCK_EX)) {
-                fwrite($fp, $content, mb_strlen($content));
+                fwrite($fp, $content);
                 flock($fp, LOCK_UN);
             } else {
@@ -639,5 +639,5 @@
         return true;
     }
-    
+
     /*
     * Delete all versions older than versions_min_days if there are more than versions_min_qty or 100.
@@ -714,8 +714,8 @@
             return false;
         }
-        
+
         // The file to restore.
         $version_file = sprintf('%s__%s.xml', preg_replace('/\.xml$/', '', $this->_data_file), $version);
-        
+
         // Ensure specified version exists.
         if (!file_exists($version_file)) {
