Browse Source

Usability Enhancement: Click on list rows to Edit items.

Nate Jones 11 years ago
parent
commit
0670e27940

+ 3 - 2
core/menu/menu.php

@@ -105,7 +105,7 @@ require_once "resources/paging.php";
 	$row_style["1"] = "row_style1";
 
 	echo "<div align='center'>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
 	echo "<tr>\n";
 	echo th_order_by('menu_name', $text['label-name'], $order_by, $order);
 	echo th_order_by('menu_language', $text['label-language'], $order_by, $order);
@@ -117,7 +117,8 @@ require_once "resources/paging.php";
 
 	if ($result_count > 0) {
 		foreach($result as $row) {
-			echo "<tr >\n";
+			$tr_link = " onclick=\"document.location.href='menu_edit.php?id=".$row['menu_uuid']."';\"";
+			echo "<tr ".$tr_link.">\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'><a href='menu_edit.php?id=".$row['menu_uuid']."'>".$row['menu_name']."</a></td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['menu_language']."</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['menu_description']."</td>\n";

+ 2 - 2
core/menu/menu_edit.php

@@ -204,7 +204,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 	echo "</tr>\n";
 
 	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
+	echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
 	echo "	".$text['label-name'].":\n";
 	echo "</td>\n";
 	echo "<td class='vtable' align='left'>\n";
@@ -215,7 +215,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 	echo "</tr>\n";
 
 	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
+	echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
 	echo "	".$text['label-language'].":\n";
 	echo "</td>\n";
 	echo "<td class='vtable' align='left'>\n";

+ 12 - 13
core/menu/menu_item_edit.php

@@ -399,6 +399,7 @@ else {
 			}
 			echo "	</td>\n";
 			echo "</tr>\n";
+			$assigned_groups[] = $field['group_name'];
 		}
 	}
 	echo "</table>\n";
@@ -412,15 +413,14 @@ else {
 	echo "<option value=\"\"></option>\n";
 	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
 	foreach($result as $field) {
-		if ($field['group_name'] == "superadmin") {
-			//only show the superadmin group to other users in the superadmin group
-			if (if_group("superadmin")) {
+		if (!in_array($field['group_name'], $assigned_groups)) {
+			if ($field['group_name'] == "superadmin" && if_group("superadmin")) {
+				echo "<option value='".$field['group_name']."'>".$field['group_name']."</option>\n"; //only show the superadmin group to other users in the superadmin group
+			}
+			else {
 				echo "<option value='".$field['group_name']."'>".$field['group_name']."</option>\n";
 			}
 		}
-		else {
-			echo "<option value='".$field['group_name']."'>".$field['group_name']."</option>\n";
-		}
 	}
 	echo "</select>";
 	echo "<input type=\"submit\" class='btn' value=\"".$text['button-add']."\">\n";
@@ -434,19 +434,18 @@ else {
 	echo "</td>\n";
 	echo "<td class='vtable' align='left'>\n";
 	echo "    <select class='formfld' name='menu_item_protected'>\n";
-	echo "    <option value=''></option>\n";
-	if ($menu_item_protected == "true") {
-		echo "    <option value='true' selected='selected' >".$text['label-true']."</option>\n";
-	}
-	else {
-		echo "    <option value='true'>".$text['label-true']."</option>\n";
-	}
 	if ($menu_item_protected == "false") {
 		echo "    <option value='false' selected='selected' >".$text['label-false']."</option>\n";
 	}
 	else {
 		echo "    <option value='false'>".$text['label-false']."</option>\n";
 	}
+	if ($menu_item_protected == "true") {
+		echo "    <option value='true' selected='selected' >".$text['label-true']."</option>\n";
+	}
+	else {
+		echo "    <option value='true'>".$text['label-true']."</option>\n";
+	}
 	echo "    </select><br />\n";
 	echo $text['description-protected']."<br />\n";
 	echo "\n";

+ 26 - 25
core/menu/menu_item_list.php

@@ -101,7 +101,8 @@ function build_db_child_menu_list ($db, $menu_item_level, $menu_item_uuid, $c) {
 					}
 
 				//display the content of the list
-					echo "<tr'>\n";
+					$tr_link = (permission_exists('menu_edit')) ? " onclick=\"document.location.href='menu_item_edit.php?id=".$menu_uuid."&menu_item_uuid=".$row2['menu_item_uuid']."&menu_item_parent_uuid=".$row2['menu_item_parent_uuid']."';\"" : null;
+					echo "<tr ".$tr_link.">\n";
 					echo "<td valign='top' class='".$row_style[$c]."'>";
 					echo "  <table cellpadding='0' cellspacing='0' border='0'>";
 					echo "  <tr>";
@@ -117,16 +118,16 @@ function build_db_child_menu_list ($db, $menu_item_level, $menu_item_uuid, $c) {
 					echo "  </tr>";
 					echo "  </table>";
 					echo "</td>";
-					//echo "<td valign='top'>&nbsp;".$menu_item_link."&nbsp;</td>";
-					echo "<td valign='top' class='".$row_style[$c]."'>&nbsp;".$group_list."&nbsp;</td>";
-					echo "<td valign='top' class='".$row_style[$c]."'>&nbsp;".$menu_item_category."&nbsp;</td>";
+					//echo "<td valign='top'>".$menu_item_link."&nbsp;</td>";
+					echo "<td valign='top' class='".$row_style[$c]."'>".$group_list."&nbsp;</td>";
+					echo "<td valign='top' class='".$row_style[$c]."'>".$menu_item_category."&nbsp;</td>";
 					//echo "<td valign='top'>".$row[menu_item_description]."</td>";
-					//echo "<td valign='top'>&nbsp;".$row[menu_item_order]."&nbsp;</td>";
+					//echo "<td valign='top'>".$row[menu_item_order]."&nbsp;</td>";
 					if ($menu_item_protected == "true") {
-						echo "<td valign='top' class='".$row_style[$c]."'>&nbsp; <strong>".$text['label-true']."</strong> &nbsp;</td>";
+						echo "<td valign='top' class='".$row_style[$c]."' style='text-align: center;'><strong>".$text['label-true']."</strong> &nbsp;</td>";
 					}
 					else {
-						echo "<td valign='top' class='".$row_style[$c]."'>&nbsp; ".$text['label-false']." &nbsp;</td>";
+						echo "<td valign='top' class='".$row_style[$c]."' style='text-align: center;'>".$text['label-false']." &nbsp;</td>";
 					}
 					echo "<td valign='top' align='center' nowrap class='".$row_style[$c]."'>";
 					echo "	&nbsp;";
@@ -203,7 +204,7 @@ $order = $_GET["order"];
 	$row_style["1"] = "row_style0";
 
 	echo "<div align='left'>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
 
 	if ($result_count == 0) {
 		//no results
@@ -211,11 +212,11 @@ $order = $_GET["order"];
 	}
 	else {
 		echo "<tr>";
-		echo "<th align='left' nowrap>&nbsp; ".$text['label-title']." &nbsp; </th>";
-		echo "<th align='left' nowrap>&nbsp; ".$text['label-groups']." &nbsp; </th>";
-		echo "<th align='left'nowrap>&nbsp; ".$text['label-category']." &nbsp; </th>";
-		echo "<th nowrap>&nbsp; ".$text['label-protected']." &nbsp; </th>";
-		echo "<th nowrap width='70'>&nbsp; ".$text['label-menu_order']." &nbsp; </th>";
+		echo "<th align='left' nowrap>".$text['label-title']."</th>";
+		echo "<th align='left' nowrap>".$text['label-groups']."</th>";
+		echo "<th align='left'nowrap>".$text['label-category']."</th>";
+		echo "<th nowrap style='text-align: center;'>".$text['label-protected']."</th>";
+		echo "<th nowrap width='70' style='text-align: center;'>".$text['label-menu_order']."</th>";
 		echo "<td class='list_control_icons'>";
 		if (permission_exists('menu_add')) {
 			echo "<a href='menu_item_edit.php?id=".$menu_uuid."' alt='".$text['button-add']."'>$v_link_label_add</a>";
@@ -232,8 +233,7 @@ $order = $_GET["order"];
 				$menu_item_protected = $row['menu_item_protected'];
 
 			//get the groups that have been assigned to the menu
-				$sql = "";
-				$sql .= "select group_name from v_menu_item_groups ";
+				$sql = "select group_name from v_menu_item_groups ";
 				$sql .= "where menu_uuid = '$menu_uuid' ";
 				$sql .= "and menu_item_uuid = '$menu_item_uuid' ";
 				$sub_prep_statement = $db->prepare(check_sql($sql));
@@ -269,23 +269,24 @@ $order = $_GET["order"];
 				}
 
 			//display the content of the list
-				echo "<tr style='".$row_style[$c]."'>\n";
-				echo "<td valign='top' class='".$row_style[$c]."'>&nbsp; ".$menu_item_title."&nbsp;</td>";
-				echo "<td valign='top' class='".$row_style[$c]."'>&nbsp; ".$group_list."&nbsp;</td>";
-				//echo "<td valign='top' class='".$row_style[$c]."'>&nbsp;".$menu_item_link."&nbsp;</td>";
-				echo "<td valign='top' class='".$row_style[$c]."'>&nbsp;".$menu_item_category."&nbsp;</td>";
+				$tr_link = (permission_exists('menu_edit')) ? " onclick=\"document.location.href='menu_item_edit.php?id=".$menu_uuid."&menu_item_uuid=".$row['menu_item_uuid']."&menu_uuid=".$menu_uuid."';\"" : null;
+				echo "<tr style='".$row_style[$c]."' ".$tr_link.">\n";
+				echo "<td valign='top' class='".$row_style[$c]."'>".$menu_item_title."&nbsp;</td>";
+				echo "<td valign='top' class='".$row_style[$c]."'>".$group_list."&nbsp;</td>";
+				//echo "<td valign='top' class='".$row_style[$c]."'>".$menu_item_link."&nbsp;</td>";
+				echo "<td valign='top' class='".$row_style[$c]."'>".$menu_item_category."&nbsp;</td>";
 				//echo "<td valign='top' class='".$row_style[$c]."'>".$row[menu_item_description]."</td>";
-				//echo "<td valign='top' class='".$row_style[$c]."'>&nbsp;".$row['menu_item_parent_uuid']."&nbsp;</td>";
-				//echo "<td valign='top' class='".$row_style[$c]."'>&nbsp;".$row['menu_item_order']."&nbsp;</td>";
+				//echo "<td valign='top' class='".$row_style[$c]."'>".$row['menu_item_parent_uuid']."&nbsp;</td>";
+				//echo "<td valign='top' class='".$row_style[$c]."'>".$row['menu_item_order']."&nbsp;</td>";
 
 				if ($menu_item_protected == "true") {
-					echo "<td valign='top' class='".$row_style[$c]."'>&nbsp; <strong>".$text['label-true']."</strong> &nbsp;</td>";
+					echo "<td valign='top' class='".$row_style[$c]."' style='text-align: center;'><strong>".$text['label-true']."</strong> &nbsp;</td>";
 				}
 				else {
-					echo "<td valign='top' class='".$row_style[$c]."'>&nbsp; ".$text['label-false']." &nbsp;</td>";
+					echo "<td valign='top' class='".$row_style[$c]."' style='text-align: center;'>".$text['label-false']." &nbsp;</td>";
 				}
 
-				echo "<td valign='top' align='center' nowrap class='".$row_style[$c]."'>";
+				echo "<td valign='top' nowrap class='".$row_style[$c]."' style='text-align: center;'>";
 				echo "  ".$row[menu_item_order]."&nbsp;";
 				echo "</td>";
 

+ 3 - 2
core/users/users.php

@@ -132,7 +132,7 @@ echo "	<td align=\"center\">\n";
 
 //show the data
 	echo "<div align='center'>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
 
 	echo "<tr>\n";
 	echo th_order_by('username', $text['label-username'], $order_by, $order);
@@ -149,7 +149,8 @@ echo "	<td align=\"center\">\n";
 			if (if_superadmin($superadmins, $row['user_uuid']) && !if_group("superadmin")) {
 				//hide
 			} else {
-				echo "<tr >\n";
+				$tr_link = (permission_exists('user_edit')) ? " onclick=\"document.location.href='usersupdate.php?id=".$row['user_uuid']."';\"" : null;
+				echo "<tr ".$tr_link.">\n";
 				echo "	<td valign='top' class='".$row_style[$c]."'>";
 				if (permission_exists('user_edit')) {
 					echo "<a href='usersupdate.php?id=".$row['user_uuid']."'>".$row['username']."</a>";

+ 10 - 1
themes/enhanced/template.php

@@ -278,6 +278,16 @@ input[type=text]::-ms-clear {
 	padding: 4px 16px 4px 6px;
 }
 
+table.tr_hover tr {
+	background-color: transparent;
+	cursor: default;
+	}
+
+table.tr_hover tr:hover td,
+table.tr_hover tr:hover td a {
+	color: #5082ca;
+	}
+
 .row_style0 {
 	border-bottom: 1px solid #c5d1e5;
 	background-color: #e5e9f0;
@@ -286,7 +296,6 @@ input[type=text]::-ms-clear {
 	padding: 5px 7px;
 }
 
-
 .row_style1 {
 	border-bottom: 1px solid #c5d1e5;
 	background-color: #fff;