cvs: php-testfest-web /PHP/App Contributors.php /PHP/App/Base/Helper NavAction.php /PHP/App/Base/Layout _contributors_nav.php _mentors_nav.php
/PHP/App/Mentors/Layout index.php /public/css style.css

From: Date: Tue, 22 Apr 2008 10:14:52 +0000
Subject: cvs: php-testfest-web /PHP/App Contributors.php /PHP/App/Base/Helper NavAction.php /PHP/App/Base/Layout _contributors_nav.php _mentors_nav.php
/PHP/App/Mentors/Layout index.php /public/css style.css
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-1588@lists.php.net to get a copy of this message
goldoraf Tue Apr 22 10:14:52 2008 UTC Added files: /php-testfest-web/PHP/App/Base/Helper NavAction.php Removed files: /php-testfest-web/PHP/App/Mentors/Layout index.php Modified files: /php-testfest-web/PHP/App Contributors.php /php-testfest-web/PHP/App/Base/Layout _contributors_nav.php _mentors_nav.php /php-testfest-web/public/css style.css Log: - Added a helper to handle navigation links and updated navigation partials accordingly. http://cvs.php.net/viewvc.cgi/php-testfest-web/PHP/App/Contributors.php?r1=1.3&r2=1.4&diff_format=u Index: php-testfest-web/PHP/App/Contributors.php diff -u php-testfest-web/PHP/App/Contributors.php:1.3 php-testfest-web/PHP/App/Contributors.php:1.4 --- php-testfest-web/PHP/App/Contributors.php:1.3 Thu Apr 17 14:38:25 2008 +++ php-testfest-web/PHP/App/Contributors.php Tue Apr 22 10:14:52 2008 @@ -25,7 +25,7 @@ */ public function actionIndex() { - + } /** http://cvs.php.net/viewvc.cgi/php-testfest-web/PHP/App/Base/Layout/_contributors_nav.php?r1=1.1&r2=1.2&diff_format=u Index: php-testfest-web/PHP/App/Base/Layout/_contributors_nav.php diff -u php-testfest-web/PHP/App/Base/Layout/_contributors_nav.php:1.1 php-testfest-web/PHP/App/Base/Layout/_contributors_nav.php:1.2 --- php-testfest-web/PHP/App/Base/Layout/_contributors_nav.php:1.1 Thu Apr 17 14:38:25 2008 +++ php-testfest-web/PHP/App/Base/Layout/_contributors_nav.php Tue Apr 22 10:14:52 2008 @@ -1,5 +1,5 @@ <ul id="nav-links"> - <li class="current"><a href="/contributors"><span>My Account</span></a></li> - <li><a href="/contributors/upload"><span>Upload test(s)</span></a></li> - <li><a href="/contributors/myfiles"><span>My Files</span></a></li> + <li><?php echo $this->navAction('My Account', '/contributors'); ?></li> + <li><?php echo $this->navAction('Upload test(s)', '/contributors/upload'); ?></li> + <li><?php echo $this->navAction('My Files', '/contributors/myfiles'); ?></li> </ul> http://cvs.php.net/viewvc.cgi/php-testfest-web/PHP/App/Base/Layout/_mentors_nav.php?r1=1.1&r2=1.2&diff_format=u Index: php-testfest-web/PHP/App/Base/Layout/_mentors_nav.php diff -u php-testfest-web/PHP/App/Base/Layout/_mentors_nav.php:1.1 php-testfest-web/PHP/App/Base/Layout/_mentors_nav.php:1.2 --- php-testfest-web/PHP/App/Base/Layout/_mentors_nav.php:1.1 Thu Apr 17 14:38:25 2008 +++ php-testfest-web/PHP/App/Base/Layout/_mentors_nav.php Tue Apr 22 10:14:52 2008 @@ -1,6 +1,6 @@ <ul id="nav-links"> - <li class="current"><a href="/mentors/my"><span>My Account</span></a></li> - <li><a href="/mentors/review"><span>Test Review</span></a></li> - <li><a href="/mentors/livetest"><span>Live Testing Area</span></a></li> - <li><a href="/mentors/announce"><span>Announcements</span></a></li> + <li><?php echo $this->navAction('My Account', '/mentors/my'); ?></li> + <li><?php echo $this->navAction('Test Review', '/mentors/review'); ?></li> + <li><?php echo $this->navAction('Live Testing Area', '/mentors/livetest'); ?></li> + <li><?php echo $this->navAction('Announcements', '/mentors/announce'); ?></li> </ul> http://cvs.php.net/viewvc.cgi/php-testfest-web/public/css/style.css?r1=1.2&r2=1.3&diff_format=u Index: php-testfest-web/public/css/style.css diff -u php-testfest-web/public/css/style.css:1.2 php-testfest-web/public/css/style.css:1.3 --- php-testfest-web/public/css/style.css:1.2 Thu Apr 17 14:38:26 2008 +++ php-testfest-web/public/css/style.css Tue Apr 22 10:14:52 2008 @@ -117,13 +117,13 @@ background-position: 100% -120px; } -ul#nav-links li.current a { +ul#nav-links a.current { background-position: 0 -60px; color: #fff; font-weight: bold; } -ul#nav-links li.current span { +ul#nav-links a.current span { background-position: 100% -60px; } http://cvs.php.net/viewvc.cgi/php-testfest-web/PHP/App/Base/Helper/NavAction.php?view=markup&rev=1.1 Index: php-testfest-web/PHP/App/Base/Helper/NavAction.php +++ php-testfest-web/PHP/App/Base/Helper/NavAction.php <?php /** * Helper for navigation links. * * It sets a 'class' attribute with 'current' as a value if the $href provided * corresponds to the request URI. * */ class PHP_App_Base_Helper_NavAction extends Solar_View_Helper_Action { /** * Internal request object. * * @var Solar_Request */ protected $_request = null; /** * Constructor * * @param array $config User-specified configuration. */ public function __construct($config = null) { parent::__construct($config); $this->_request = Solar::factory('Solar_Request'); } /** * Returns an action link. * * The $text link text will be put in a span tag. * * @param string $href The action href. * * @param string $text A locale translation key. * * @return string */ public function navAction($text, $href) { if ($this->_request->server('REQUEST_URI') == $href) { return "<a class=\"current\" href=\"$href\"><span>$text</span></a>"; } return "<a href=\"$href\"><span>$text</span></a>"; } } ?>

« previous php.webmaster (#1588) next »