• R/O
  • SSH
  • HTTPS

kaede: Commit


Commit MetaInfo

Revision153 (tree)
Time2007-03-02 21:52:34
Authorhawkring

Log Message

_sequence-map.php追加、各ページに設置

Change Summary

Incremental Difference

--- Kaede/branches/try-state-pattern/examples/webapp/templates/ex2/confirm.html (revision 152)
+++ Kaede/branches/try-state-pattern/examples/webapp/templates/ex2/confirm.html (revision 153)
@@ -7,6 +7,7 @@
77 </head>
88 <body>
99 <h1>料理注文ウィザード [4]</h1>
10+ <?php include(dirname(__FILE__) .'/_sequence-map.php') ?>
1011 <p>
1112 <?php $h($action->get("name")) ?>さん
1213 </p>
--- Kaede/branches/try-state-pattern/examples/webapp/templates/ex2/page1.html (revision 152)
+++ Kaede/branches/try-state-pattern/examples/webapp/templates/ex2/page1.html (revision 153)
@@ -7,6 +7,7 @@
77 </head>
88 <body>
99 <h1>料理注文ウィザード</h1>
10+ <?php include(dirname(__FILE__) .'/_sequence-map.php') ?>
1011 <p>
1112 5画面のウィザードのテストです。
1213 </p>
--- Kaede/branches/try-state-pattern/examples/webapp/templates/ex2/page2.html (revision 152)
+++ Kaede/branches/try-state-pattern/examples/webapp/templates/ex2/page2.html (revision 153)
@@ -7,6 +7,7 @@
77 </head>
88 <body>
99 <h1>料理注文ウィザード [2]</h1>
10+ <?php include(dirname(__FILE__) .'/_sequence-map.php') ?>
1011 <p>
1112 ようこそ <?php $h($action->get("name")) ?>さん
1213 </p>
--- Kaede/branches/try-state-pattern/examples/webapp/templates/ex2/page3.html (revision 152)
+++ Kaede/branches/try-state-pattern/examples/webapp/templates/ex2/page3.html (revision 153)
@@ -7,6 +7,7 @@
77 </head>
88 <body>
99 <h1>料理注文ウィザード [3]</h1>
10+ <?php include(dirname(__FILE__) .'/_sequence-map.php') ?>
1011 <p>
1112 ようこそ <?php $h($action->get("name")) ?>さん
1213 </p>
--- Kaede/branches/try-state-pattern/examples/webapp/templates/ex2/done.html (revision 152)
+++ Kaede/branches/try-state-pattern/examples/webapp/templates/ex2/done.html (revision 153)
@@ -7,11 +7,12 @@
77 </head>
88 <body>
99 <h1>料理注文ウィザード [5]</h1>
10+ <?php include(dirname(__FILE__) .'/_sequence-map.php') ?>
1011 <p>
1112 <?php $h($action->get("name")) ?>さん
1213 </p>
1314 <p>
14- 正常に注文が行われました。<a href="">最初のページに戻る</a>
15+ 正常に注文が行われました。<a href="<?php $h($helper->getURL($action->context->getInitialAction())) ?>">最初のページに戻る</a>
1516 </p>
1617 <div class="code"><?php highlight_file($action->file) ?></div>
1718 <div class="code"><?php highlight_file(__FILE__) ?></div>
--- Kaede/branches/try-state-pattern/examples/webapp/templates/ex2/_sequence-map.php (nonexistent)
+++ Kaede/branches/try-state-pattern/examples/webapp/templates/ex2/_sequence-map.php (revision 153)
@@ -0,0 +1,23 @@
1+<ul class="sequence-map">
2+<?php
3+$label = array('名前登録', 'ジャンルと食材', '料理', '確認', '完了');
4+$currentIndex = $action->context->getCurrentIndex();
5+$lastIndex = count($action->context->getActions()) - 1;
6+
7+foreach($action->context->getActions() as $i => $actionName) {
8+ if($i < $currentIndex) {
9+ if($currentIndex == $lastIndex) {
10+ printf('<li class="before">%s</li>', htmlspecialchars($label[$i]));
11+ } else {
12+ printf('<li class="before"><a href="%s">%s</a></li>',
13+ htmlspecialchars($helper->getURL($actionName)),
14+ htmlspecialchars($label[$i]));
15+ }
16+ } elseif($i == $currentIndex) {
17+ printf('<li class="current">%s</li>', htmlspecialchars($label[$i]));
18+ } else {
19+ printf('<li class="after">%s</li>', htmlspecialchars($label[$i]));
20+ }
21+}
22+?>
23+</ul>
Show on old repository browser