logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

CVS: phpwiki/lib/plugin _BackendInfo.php, 1.26, 1.27: msg#00013

Subject: CVS: phpwiki/lib/plugin _BackendInfo.php, 1.26, 1.27
Update of /cvsroot/phpwiki/phpwiki/lib/plugin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21161/lib/plugin

Modified Files:
        _BackendInfo.php 
Log Message:
base class for EditmetaData

Index: _BackendInfo.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/_BackendInfo.php,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -2 -b -p -d -r1.26 -r1.27
--- _BackendInfo.php    7 Jan 2007 18:44:47 -0000       1.26
+++ _BackendInfo.php    13 May 2007 18:13:48 -0000      1.27
@@ -2,5 +2,5 @@
 rcs_id('$Id$');
 /**
- Copyright 1999,2000,2001,2002,2006 $ThePhpWikiProgrammingTeam
+ Copyright 1999,2000,2001,2002,2006,2007 $ThePhpWikiProgrammingTeam
 
  This file is part of PhpWiki.
@@ -52,4 +52,7 @@ extends WikiPlugin
 
         $backend = &$dbi->_backend;
+        $this->chunk_split = true;
+        $this->readonly_pagemeta = array();
+        $this->hidden_pagemeta = array ('_cached_html');
 
         $html = HTML(HTML::h3(fmt("Querying backend directly for '%s'",
@@ -107,9 +110,11 @@ extends WikiPlugin
     /**
      * Really should have a _fixupPagedata and _fixupVersiondata, but this 
works.
+     * also used in plugin/EditMetaData
      */
     function _fixupData(&$data) {
+       if (!is_array($data)) return;
+       
         global $request;
         $user = $request->getUser();
-
         foreach ($data as $key => $val) {
             if (is_integer($key)) {
@@ -125,5 +130,5 @@ extends WikiPlugin
             }
             elseif (is_bool($val)) {
-               $data[$key] = $val ? "<true>" : "<false>";
+               $data[$key] = $this->_showvalue($key, $val ? "true" : "false");
             }
             elseif (is_string($val) && ((substr($val, 0, 2) == 'a:' 
@@ -167,5 +172,6 @@ extends WikiPlugin
     }
             
-    function _showhash ($heading, $hash, $pagename = '') {
+    /* also used in plugin/EditMetaData */
+    function _showhash ($heading, $hash) {
         $rows = array();
         if ($heading)
@@ -175,7 +181,8 @@ extends WikiPlugin
                                               'style' => 'color:#000000'),
                                         $heading));
+       if (!is_array($hash)) return array();
         ksort($hash);
         foreach ($hash as $key => $val) {
-            if (is_string($val)) $val = chunk_split($val);     
+            if ($this->chunk_split and is_string($val)) $val = 
chunk_split($val);      
             $rows[] = HTML::tr(HTML::td(array('align' => 'right',
                                               'bgcolor' => '#cccccc',
@@ -185,12 +192,21 @@ extends WikiPlugin
                                HTML::td(array('bgcolor' => '#ffffff',
                                               'style' => 'color:#000000'),
-                                        $val ? $val : HTML::raw('&nbsp;'))
+                                        $this->_showvalue($key, $val))
                                );
         }
         return $rows;
     }
+
+    /* also used in plugin/EditMetaData */
+    function _showvalue ($key, $val) {
+       return $val ? $val : HTML::raw('&nbsp;');
+    }
+
 };
 
 // $Log$
+// Revision 1.27  2007/05/13 18:13:48  rurban
+// base class for EditmetaData
+//
 // Revision 1.26  2007/01/07 18:44:47  rurban
 // Add notallversion argument. Support more types: objects, serialized 
objects. split overlong strings


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/


<Prev in Thread] Current Thread [Next in Thread>