Menu (nav table) Tweak for Safari

Use GitHub to post bug reports and error descriptions for phpwcms. Describe your problem detailed!
Locked
User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Menu (nav table) Tweak for Safari

Post by StudioZ »

Greetings,

Found a tweak to make the nav table behave good in Safari on Mac.

The tweak is simply to add an align=\"left\" to each <td
and to fool the left TD with a width of 1 pixel, as this: <td align=\"left\" width=\"1\">

Here's the modified "front.func.inc.php" file
Starting at Line 671:

Code: Select all

// -------------------------------------------------------------

//menu creating
function nav_table_simple_struct($struct, $act_cat_id, $link_to="index.php") {
	//returns a simple table based navigation menu of possible
	//structure levels based on current structure level
	$nav_table  = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n<tr>\n";
	$nav_table .= "<td align=\"left\" width=\"1\"><img src=\"img/leer.gif\" width=\"10\" height=\"1\" alt=\"\" /></td>\n";
	$nav_table .= "<td align=\"left\" width=\"100%\"><strong>";
	$nav_table .= html_specialchars($struct[$act_cat_id]["acat_name"]);
	$nav_table .= "</strong></td>\n<tr>";
	foreach($struct as $key => $value) {
		if($struct[$key]["acat_struct"] == $act_cat_id && $key != $act_cat_id && !$struct[$key]["acat_hidden"]) {
			$nav_table .= "<tr>\n";
			$nav_table .= "<td align=\"left\" width=\"1\"><img src=\"img/leer.gif\" width=\"10\" height=\"1\" alt=\"\" /></td>\n";
			$nav_table .= '<td align=\"left\" width=\"100%\">';
			
			if(!$struct[$key]["acat_redirect"]) {
				$nav_table .= '<a href="index.php?';
				if($struct[$key]["acat_alias"]) {
					$nav_table .= html_specialchars($struct[$key]["acat_alias"]);
				} else {
					$nav_table .= 'id='.$key.',0,0,1,0,0';
				}
				$nav_table .= '">';
			} else {
				$redirect = get_redirect_link($struct[$key]["acat_redirect"], ' ', '');
				$nav_table .= '<a href="'.$redirect['link'].'"'.$redirect['target'].'>';
			}
			
			$nav_table .= html_specialchars($struct[$key]["acat_name"])."</a></td>\n<tr>";
		}
	}
	$nav_table .= "</table>";
	return $nav_table;
}

// -------------------------------------------------------------
Hope this may be of any use... :)

Kind Regards,
Locked