OSDN Git Service

Compat for : [.style]
authorhenoheno <henoheno>
Sun, 23 Sep 2007 13:55:30 +0000 (22:55 +0900)
committerhenoheno <henoheno>
Sun, 23 Sep 2007 13:55:30 +0000 (22:55 +0900)
plugin/tracker.inc.php

index 70a4c23..be7fee8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // PukiWiki - Yet another WikiWikiWeb clone
-// $Id: tracker.inc.php,v 1.76 2007/09/23 13:50:01 henoheno Exp $
+// $Id: tracker.inc.php,v 1.77 2007/09/23 13:55:30 henoheno Exp $
 // Copyright (C) 2003-2005, 2007 PukiWiki Developers Team
 // License: GPL v2 or (at your option) any later version
 //
@@ -1075,26 +1075,29 @@ class Tracker_list
                $fieldname = isset($params[0])  ? $params[0] : '';
                $stylename = isset($params[1])  ? $params[1] : $fieldname;
 
-               if ($fieldname == '') return '';        // Invalid
+               $str = '';
 
-               if (! isset($items[$fieldname])) {
-                       // Maybe load miss of the page
-                       if (isset($fields[$fieldname])) {
-                               $str = '[page_err]';    // Exactlly
+               if ($fieldname != '') {
+                       if (! isset($items[$fieldname])) {
+                               // Maybe load miss of the page
+                               if (isset($fields[$fieldname])) {
+                                       $str = '[page_err]';    // Exactlly
+                               } else {
+                                       $str = isset($matches[0]) ? $matches[0] : '';   // Nothing to do
+                               }
                        } else {
-                               $str = isset($matches[0]) ? $matches[0] : '';   // Nothing to do
-                       }
-               } else {
-                       $str = $items[$fieldname];
-                       if (isset($fields[$fieldname])) {
-                               $str    = $fields[$fieldname]->format_cell($str);
-                       }
-                       if (isset($fields[$stylename]) && isset($items[$stylename])) {
-                               $_style = $fields[$stylename]->get_style($items[$stylename]);
-                               $str    = sprintf($_style, $str);
+                               $str = $items[$fieldname];
+                               if (isset($fields[$fieldname])) {
+                                       $str    = $fields[$fieldname]->format_cell($str);
+                               }
                        }
                }
 
+               if (isset($fields[$stylename]) && isset($items[$stylename])) {
+                       $_style = $fields[$stylename]->get_style($items[$stylename]);
+                       $str    = sprintf($_style, $str);
+               }
+
                return $this->_escape($tfc, $str);
        }