• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂4ae10ae819598d5b4576842c4cf9b14b86a556fa (tree)
時間2007-10-04 00:18:15
作者henoheno <henoheno>
Commiterhenoheno

Log Message

Simplify: _page

Change Summary

差異

--- a/plugin/tracker.inc.php
+++ b/plugin/tracker.inc.php
@@ -1,6 +1,6 @@
11 <?php
22 // PukiWiki - Yet another WikiWikiWeb clone
3-// $Id: tracker.inc.php,v 1.101 2007/10/02 13:52:15 henoheno Exp $
3+// $Id: tracker.inc.php,v 1.102 2007/10/03 15:18:15 henoheno Exp $
44 // Copyright (C) 2003-2005, 2007 PukiWiki Developers Team
55 // License: GPL v2 or (at your option) any later version
66 //
@@ -228,7 +228,8 @@ function plugin_tracker_action()
228228 // Data set of XHTML form or something
229229 class Tracker_form
230230 {
231- var $id;
231+ var $id; // Unique id per instance
232+
232233 var $base;
233234 var $refer;
234235 var $config;
@@ -240,7 +241,7 @@ class Tracker_form
240241
241242 function Tracker_form($base, $refer, $config)
242243 {
243- static $id = 0; // Unique id per instance
244+ static $id = 0;
244245 $this->id = ++$id;
245246
246247 $this->base = $base;
@@ -365,9 +366,10 @@ class Tracker_form
365366 // Field classes within a form
366367 class Tracker_field
367368 {
368- var $id;
369+ var $id; // Unique id per instance, and per class(extended-class)
369370
370371 var $form; // Parent (class Tracker_form)
372+
371373 var $name;
372374 var $title;
373375 var $values;
@@ -380,7 +382,7 @@ class Tracker_field
380382 function Tracker_field(& $tracker_form, $field)
381383 {
382384 global $post;
383- static $id = 0; // Unique id per instance, and per class(extended-class)
385+ static $id = 0;
384386
385387 $this->id = ++$id;
386388
@@ -434,6 +436,7 @@ class Tracker_field_text extends Tracker_field
434436 }
435437 }
436438
439+// Special type: The page names
437440 class Tracker_field_page extends Tracker_field_text
438441 {
439442 var $sort_type = PLUGIN_TRACKER_SORT_TYPE_STRING;
@@ -444,8 +447,14 @@ class Tracker_field_page extends Tracker_field_text
444447 if (is_pagename($value)) $value = '[[' . $value . ']]';
445448 return parent::format_value($value);
446449 }
450+
451+ function format_cell($value)
452+ {
453+ return '[[' . $value . ']]';
454+ }
447455 }
448456
457+// Special type : Real(Raw) value of page name
449458 class Tracker_field_real extends Tracker_field_text
450459 {
451460 var $sort_type = PLUGIN_TRACKER_SORT_TYPE_NATURAL;
@@ -486,19 +495,20 @@ class Tracker_field_textarea extends Tracker_field
486495 }
487496 }
488497
498+// Text with formatting if trim($cell) != ''
499+// See also: http://home.arino.jp/?tracker.inc.php%2F41
489500 class Tracker_field_format extends Tracker_field
490501 {
491502 var $sort_type = PLUGIN_TRACKER_SORT_TYPE_STRING;
503+
492504 var $styles = array();
493505 var $formats = array();
494506
495507 function Tracker_field_format(& $tracker_form, $field)
496508 {
497509 parent::Tracker_field($tracker_form, $field);
498-
499510 foreach ($this->form->config->get($this->name) as $option) {
500- list($key, $style, $format) =
501- array_pad(array_map(create_function('$a', 'return trim($a);'), $option), 3, '');
511+ list($key, $style, $format) = array_pad(array_map('trim', $option), 3, '');
502512 if ($style != '') $this->styles[$key] = $style;
503513 if ($format != '') $this->formats[$key] = $format;
504514 }
@@ -831,7 +841,8 @@ function plugin_tracker_list_render($base, $refer, $config_name, $list, $order_c
831841 // Listing class
832842 class Tracker_list
833843 {
834- var $form;
844+ var $form; // class Tracker_form
845+
835846 var $list;
836847
837848 var $pattern;
@@ -941,7 +952,7 @@ class Tracker_list
941952 $filetime = get_filetime($pagename);
942953 $row = array(
943954 // column => default data of the cell
944- '_page' => '[[' . $pagename . ']]', // TODO: Redudant column pair [1]
955+ '_page' => $pagename, // TODO: Redudant column pair [1]
945956 '_real' => $pagename, // TODO: Redudant column pair [1]
946957 '_update' => $filetime, // TODO: Redudant column pair [2]
947958 '_past' => $filetime, // TODO: Redudant column pair [2]