[Fusionforge-commits] r13314 - in branches/Branch_5_1/src: common/widget www/account www/include www/themes/funky www/themes/gforge

Thorsten Glaser mirabilos at fusionforge.org
Wed May 18 12:39:54 CEST 2011


Author: mirabilos
Date: 2011-05-18 12:39:53 +0200 (Wed, 18 May 2011)
New Revision: 13314

Modified:
   branches/Branch_5_1/src/common/widget/Widget_MySurveys.class.php
   branches/Branch_5_1/src/www/account/index.php
   branches/Branch_5_1/src/www/account/login.php
   branches/Branch_5_1/src/www/account/lostpw.php
   branches/Branch_5_1/src/www/include/Layout.class.php
   branches/Branch_5_1/src/www/themes/funky/Theme.class.php
   branches/Branch_5_1/src/www/themes/gforge/Theme.class.php
Log:
mostly XHTML clean /my/ and /account/


Modified: branches/Branch_5_1/src/common/widget/Widget_MySurveys.class.php
===================================================================
--- branches/Branch_5_1/src/common/widget/Widget_MySurveys.class.php	2011-05-18 10:35:01 UTC (rev 13313)
+++ branches/Branch_5_1/src/common/widget/Widget_MySurveys.class.php	2011-05-18 10:39:53 UTC (rev 13314)
@@ -52,7 +52,7 @@
 		
 		$html_my_surveys = '';
 		if (count ($projects) < 1) {
-			$html_my_surveys .= _("<p>There are no surveys in your groups.<p><br /> ");
+			$html_my_surveys .= _("<p>There are no surveys in your groups.</p>");
 		} else {
 			$request =& HTTPRequest::instance();
 			$html_my_surveys .= '<table style="width:100%">';

Modified: branches/Branch_5_1/src/www/account/index.php
===================================================================
--- branches/Branch_5_1/src/www/account/index.php	2011-05-18 10:35:01 UTC (rev 13313)
+++ branches/Branch_5_1/src/www/account/index.php	2011-05-18 10:39:53 UTC (rev 13314)
@@ -232,37 +232,46 @@
 // ############################# Preferences
 echo $HTML->boxTop(_('Preferences')); ?>
 
+<div>
 <input type="checkbox" name="mail_site" value="1"<?php
 	if ($u->getMailingsPrefs('site')) print " checked=\"checked\""; ?> />
 	<?php echo _('Receive Email about Site Updates <i>(Very low traffic and includes security notices. Highly Recommended.)</i>'); ?>
+</div>
 
-<p /><input type="checkbox"  name="mail_va" value="1"<?php
+<div>
+<input type="checkbox"  name="mail_va" value="1"<?php
 	if ($u->getMailingsPrefs('va')) print " checked=\"checked\""; ?> />
 	<?php echo _('Receive additional community mailings. <i>(Low traffic.)</i>'); ?>
+</div>
+
 <?php /*
-<p /><input type="checkbox"  name="remember_user" value="1"<?php
+<div>
+<input type="checkbox"  name="remember_user" value="1"<?php
 	if ($sf_user_hash) print " checked=\"checked\""; ?> />
 <?php printf(_('"Remember me". <i>(Allows to access your <a href="%s">personal page</a> without being logged in. You will still need to login explicitly before making any changes.)</i>'),util_make_url ('/my/'));
+echo "\n</div>";
 */ ?>
 
-<p />
 <?php if (forge_get_config('use_ratings')) { ?>
+<div>
 <input type="checkbox"  name="use_ratings" value="1"<?php
 	if ($u->usesRatings()) print ' checked="checked"'; ?> />
 		  <?php printf(_('Participate in peer ratings. <i>(Allows you to rate other users using several criteria as well as to be rated by others. More information is available on your <a href="%s">user page</a> if you have chosen to participate in ratings.)</i>'),util_make_url_u ($u->getUnixName(),$u->getId())); 
-} ?>	
-</td></tr>
-<?php 
+echo "\n</div>";
+} ?>
+
+<table><tr><td><!-- hook[ --></td></tr>
+<?php
+/* each hook emits a complete table row */
 $hookParams['user']= user_get_object(user_getid());
 if (getStringFromRequest('submit')) {//if this is set, then the user has issued an Update
 	plugin_hook("userisactivecheckboxpost", $hookParams);
 } else {
 	plugin_hook("userisactivecheckbox", $hookParams);
 }
-?>
-<tr><td>
+echo "\n\n</table><!-- ]hook -->\n";
 
-<?php echo $HTML->boxBottom();
+echo $HTML->boxBottom();
 
 // ############################### Shell Account
 

Modified: branches/Branch_5_1/src/www/account/login.php
===================================================================
--- branches/Branch_5_1/src/www/account/login.php	2011-05-18 10:35:01 UTC (rev 13313)
+++ branches/Branch_5_1/src/www/account/login.php	2011-05-18 10:39:53 UTC (rev 13314)
@@ -118,13 +118,13 @@
 
 $HTML->header(array('title'=>'Login'));
 
-echo '<p>';
-
 if ($triggered) {
 	echo '<div class="warning">' ;
 	echo _('You\'ve been redirected to this login page because you have tried accessing a page that was not available to you as an anonymous user.');
 	echo '</div> ' ;
 }
+
+echo '<p>';
 echo _('Cookies must be enabled past this point.');
 
 ?>

Modified: branches/Branch_5_1/src/www/account/lostpw.php
===================================================================
--- branches/Branch_5_1/src/www/account/lostpw.php	2011-05-18 10:35:01 UTC (rev 13313)
+++ branches/Branch_5_1/src/www/account/lostpw.php	2011-05-18 10:39:53 UTC (rev 13314)
@@ -70,7 +70,7 @@
 
 		$HTML->header(array('title'=>"Lost Password Confirmation"));
 
-		echo '<p>'.printf(_('An email has been sent to the address you have on file. Follow the instructions in the email to change your account password.').'</p><p><a href="%1$s">'._("Home").'</a>', util_make_url ('/')).'</p>';
+		printf('<p>' . _('An email has been sent to the address you have on file. Follow the instructions in the email to change your account password.') . '</p><p><a href="%1$s">'._("Home").'</a></p>', util_make_url('/'));
 
 		$HTML->footer(array());
 		exit();

Modified: branches/Branch_5_1/src/www/include/Layout.class.php
===================================================================
--- branches/Branch_5_1/src/www/include/Layout.class.php	2011-05-18 10:35:01 UTC (rev 13313)
+++ branches/Branch_5_1/src/www/include/Layout.class.php	2011-05-18 10:39:53 UTC (rev 13314)
@@ -635,7 +635,7 @@
 
 				echo '
 					<form id="quicknavform" name="quicknavform" action=""><div>
-					<select name="quicknav" id="quicknav" onChange="location.href=document.quicknavform.quicknav.value">
+					<select name="quicknav" id="quicknav">
 					<option value="">'._('Quick Jump To...').'</option>';
 
 				foreach ($groups as $g) {
@@ -1222,9 +1222,13 @@
 		if (function_exists('iconv')) {
 			$string = @iconv('UTF-8', 'ASCII//TRANSLIT', $string);
 		}
-		$string = preg_replace("/[^a-zA-Z0-9- ]/", "-", $string);
+		$string = preg_replace("/[^a-zA-Z0-9_:. -]/", "-", $string);
 		$string = strtolower($string);
 		$string = str_replace(" ", $space, $string);
+		if (!preg_match("/^[a-zA-Z:_]/", $string)) {
+			/* some chars aren't allowed at the begin */
+			$string = "_" . $string;
+		}
 		return $string;
 	}
 

Modified: branches/Branch_5_1/src/www/themes/funky/Theme.class.php
===================================================================
--- branches/Branch_5_1/src/www/themes/funky/Theme.class.php	2011-05-18 10:35:01 UTC (rev 13313)
+++ branches/Branch_5_1/src/www/themes/funky/Theme.class.php	2011-05-18 10:39:53 UTC (rev 13314)
@@ -154,10 +154,21 @@
      */
     function boxTop($title, $id = '') 
     {
+	if ($id) {
+		$id = $this->toSlug($id);
+		$idid = ' id="' . $id . '"';
+		$idtitle = ' id="' . $id . '-title"';
+		$idtcont = ' id="' . $id . '-title-content"';
+	} else {
+		$idid = "";
+		$idtitle = "";
+		$idtcont = "";
+	}
+
         $t_result = '';
-        $t_result .= '<div id="' . $this->toSlug($id) . '" class="box-surround">';
-        $t_result .= '<div id="'. $this->toSlug($id) . '-title" class="box-title">';
-        $t_result .= '<div class="box-title-content"  id="'. $this->toSlug($id) .'-title-content">'. $title .'</div>';
+        $t_result .= '<div' . $idid . ' class="box-surround">';
+        $t_result .= '<div' . $idtitle . ' class="box-title">';
+        $t_result .= '<div class="box-title-content"' . $idtcont . '>'. $title .'</div>';
         $t_result .= '</div> <!-- class="box-title" -->';
         
         return $t_result;
@@ -171,7 +182,14 @@
      */
     function boxMiddle($title, $id = '')
     {
-        $t_result ='<div id="title-'. $this->toSlug($id).'" class="box-middle">'.$title.'</div>';
+	if ($id) {
+		$id = $this->toSlug($id);
+		$idtitle = ' id="' . $id . '-title"';
+	} else {
+		$idtitle = "";
+	}
+
+        $t_result ='<div' . $idtitle . ' class="box-middle">'.$title.'</div>';
         
         return $t_result;
     }
@@ -183,7 +201,14 @@
      */
     function boxContent($content, $id = '')
     {
-        $t_result ='<div id="'. $this->toSlug($id) .'-content" class="box-content">'.$content.'</div>';
+	if ($id) {
+		$id = $this->toSlug($id);
+		$idcont = ' id="' . $id . '-content"';
+	} else {
+		$idcont = "";
+	}
+
+        $t_result ='<div' . $idcont . ' class="box-content">'.$content.'</div>';
         return $t_result;
     }
 

Modified: branches/Branch_5_1/src/www/themes/gforge/Theme.class.php
===================================================================
--- branches/Branch_5_1/src/www/themes/gforge/Theme.class.php	2011-05-18 10:35:01 UTC (rev 13313)
+++ branches/Branch_5_1/src/www/themes/gforge/Theme.class.php	2011-05-18 10:39:53 UTC (rev 13314)
@@ -150,16 +150,29 @@
 	 * @param   string  The box background color
 	 */
 	function boxTop($title, $id = '') {
+		if ($id) {
+			$id = $this->toSlug($id);
+			$idid = ' id="' . $id . '"';
+			$idtitle = ' id="' . $id . '-title"';
+			$idtcont = ' id="' . $id . '-title-content"';
+			$idcont = ' id="' . $id . '-content"';
+		} else {
+			$idid = "";
+			$idtitle = "";
+			$idtcont = "";
+			$idcont = "";
+		}
+
 		$t_result = '
-        	<div id="' . $this->toSlug($id) . '" class="box-surround">
-            	<div id="'. $this->toSlug($id) . '-title" class="box-title">
+        	<div' . $idid . ' class="box-surround">
+            	<div' . $idtitle . ' class="box-title">
             		<div class="box-title-left">
             			<div class="box-title-right">
-                			<h3 class="box-title-content" id="'. $this->toSlug($id) .'-title-content">'. $title .'</h3>
+                			<h3 class="box-title-content"' . $idtcont . '>'. $title .'</h3>
                 		</div> <!-- class="box-title-right" -->
                 	</div> <!-- class="box-title-left" -->
                 </div> <!-- class="box-title" -->
-            	<div id="'. $this->toSlug($id) .'-content" class="box-content">
+            	<div' . $idcont . ' class="box-content">
             ';
 		return $t_result;
 	}
@@ -171,9 +184,16 @@
 	 * @param   string  The box background color
 	 */
 	function boxMiddle($title, $id = '') {
+		if ($id) {
+			$id = $this->toSlug($id);
+			$idtitle = ' id="' . $id . '-title"';
+		} else {
+			$idtitle = "";
+		}
+
 		$t_result ='
 	        	</div> <!-- class="box-content" -->
-	        <h3 id="title-'. $this->toSlug($id).'" class="box-middle">'.$title.'</h3>
+	        <h3' . $idtitle . ' class="box-middle">'.$title.'</h3>
 	       	<div class="box-content">
         ';
 		return $t_result;




More information about the Fusionforge-commits mailing list