[Vtigercrm-commits] [vtiger-commits] r9835 - in /customerportal/trunk: header.html index.php js/general.js
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Nov 14 08:38:38 EST 2006
Author: richie
Date: Tue Nov 14 06:38:32 2006
New Revision: 9835
Log:
* Changed the tab highlighting code to simplify the process
Modified:
customerportal/trunk/header.html
customerportal/trunk/index.php
customerportal/trunk/js/general.js
Modified: customerportal/trunk/header.html
==============================================================================
--- customerportal/trunk/header.html (original)
+++ customerportal/trunk/header.html Tue Nov 14 06:38:32 2006
@@ -63,8 +63,8 @@
<tbody>
<tr>
<td class="dvtTabCache" style="width: 10px;" nowrap="nowrap"> </td>
- <td width="75" align="center" nowrap="nowrap" class="dvtSelectedCell" id="pi" onclick="fnLoadValues('pi','mi')"><a href="index.php"><b>My Tickets</b></a></td>
- <td class="dvtUnSelectedCell" style="width: 100px;" align="center" nowrap="nowrap" id="mi" onclick="fnLoadValues('mi','pi')"><a href="index.php?module=Faq&action=index"><b>FAQ</b></a></td>
+ <td width="75" align="center" nowrap="nowrap" class="dvtSelectedCell" id="Tickets" onclick="fnLoadValues('Tickets')"><a href="index.php"><b>My Tickets</b></a></td>
+ <td class="dvtUnSelectedCell" style="width: 100px;" align="center" nowrap="nowrap" id="Faq" onclick="fnLoadValues('Faq')"><a href="index.php?module=Faq&action=index"><b>FAQ</b></a></td>
<td class="dvtTabCache" nowrap="nowrap"> </td>
</tr>
</tbody>
Modified: customerportal/trunk/index.php
==============================================================================
--- customerportal/trunk/index.php (original)
+++ customerportal/trunk/index.php Tue Nov 14 06:38:32 2006
@@ -96,19 +96,22 @@
<script>
<?php
- if(strstr($module,'Tickets'))
+ //highlight the selected tab
+ $tabArray = Array("Tickets","Faq");
+ foreach($tabArray as $tabName)
{
- ?>
- document.getElementById("pi").className = "dvtSelectedCell";
- document.getElementById("mi").className = "dvtUnSelectedCell";
- <?php
- }
- elseif(strstr($module,'Faq'))
- {
- ?>
- document.getElementById("mi").className = "dvtSelectedCell";
- document.getElementById("pi").className = "dvtUnSelectedCell";
- <?php
+ if(strcmp(rtrim($module,"/"),$tabName) == 0)//strstr($module,$tabName))
+ {
+ ?>
+ document.getElementById("<?php echo $tabName;?>").className = "dvtSelectedCell";
+ <?php
+ }
+ else
+ {
+ ?>
+ document.getElementById("<?php echo $tabName;?>").className = "dvtUnSelectedCell";
+ <?php
+ }
}
?>
</script>
Modified: customerportal/trunk/js/general.js
==============================================================================
--- customerportal/trunk/js/general.js (original)
+++ customerportal/trunk/js/general.js Tue Nov 14 06:38:32 2006
@@ -1,17 +1,19 @@
// JavaScript Document
-function fnLoadValues(obj1,obj2){
-
- var tabName1 = document.getElementById(obj1);
- var tabName2 = document.getElementById(obj2);
- if(tabName1.className == "dvtUnSelectedCell")
- tabName1.className = "dvtSelectedCell";
- if(tabName2.className == "dvtSelectedCell")
- tabName2.className = "dvtUnSelectedCell";
- if(obj1 == 'mi')
- window.location.href = "index.php?module=Faq&action=index";
- else if(obj1 == 'pi')
- window.location.href = "index.php";
+function fnLoadValues(obj){
+
+ /*
+ var tabArray = Array("Tickets","Faq");
+
+ for(var i=0;i<2;i++)
+ {
+ if(tabArray[i].indexOf(obj) > -1)
+ document.getElementById(tabArray[i]).className = "dvtSelectedCell";
+ else
+ document.getElementById(tabArray[i]).className = "dvtUnSelectedCell";
+ }
+ */
+ window.location.href = "index.php?module="+obj+"&action=index";
}
function fnDown(obj){
More information about the vtigercrm-commits
mailing list