Location: PHPKode > projects > Polaring > view/navigation.php
<?php 
// vim: sw=4:ts=4
/**
* @version 00.04.09
* @package polaring
* @license This component in released under the GNU/GPL License
*
* File: view/navigation.php
* Role: Menus (left and right column)
*
**/

class navigation {

    function giveSection() {
	if ( $_GET['section'] ) {
	    $section = $_GET['section'];
	}
	return $section;
    }


    function geUppdrag() {
	if ( $_GET['mission'] ) {
	    $mission = $_GET['mission'];
	}
	return $mission;
    }


    function geVal() {
	if ( $_GET['val'] ) {
	    $val = $_GET['val'];
	}
	return $val;
    } // END function geVal


    function geOpt2() {
	if ( !empty($_GET['val2']) ) {
	    $val2=$_GET['val2'];
	} else {
	    $val2="0";
	}
	return $val2;
    } // END function geOpt2


    function navRight() {
	$mission = navigation::geUppdrag();

	switch( $mission ) {
	case 'dagbok':
	    require_once './functions/diary.php';
	    echo "\n\n<div id=\"navRight\">\n";
	    diary::navRight();
	    echo "</div>\n";
	    break;
	}
	return(true);
    } // END function navRight


    function navLeft() {
	echo "<div id=\"navLeft\">\n";
	// home
	if ( checkHomeShow() ) {
	    echo "  <p class=\"menuparent\"><a href=\"".
		give::phpindex()."\">".strings::expression("navigation", 
		"home")."</a></p>\n";
	}
	// polar
	echo "  <p class=\"menuparent\"><a href=\"".give::phpindex().
	    "?section=polar&amp;mission=months\">".
	    strings::expression("navigation", "workouts").
	    "</a></p>\n";
	// diary
	if ( $_SESSION['diary']['on'] && 
	    user::validateIP($_SESSION['validIp']['diary']) ) {
		echo "  <p class=\"menuparent\"><a href=\"".
		    give::phpindex()."?section=dagbok&amp;mission=dagbok".
		    "\">".strings::expression("navigation", "diary").
		    "</a></p>\n";
	    }
	echo "<p class=\"menuparent\"><hr /></p>";
	// upload workout
	if ( user::validateIP($_SESSION['validIp']['upload']) ) {
	    echo "  <p class=\"menuparent\"><a href=\"".give::phpindex().
		"?section=uploadWorkout\">".
		strings::expression("navigation", "uploadWorkout")."</a></p>\n";
	}
	// settings
	if ( user::validateIP($_SESSION['validIp']['settings']) ) {
	    echo "  <p class=\"menuparent\"><a href=\"".give::phpindex()."?section=setup\">".strings::expression("setup", "Settings")."</a></p>\n";
	}
	// tools
	if ( user::validateIP($_SESSION['validIp']['tools']) ) {
	    echo "  <p class=\"menuparent\"><a href=\"".
		give::phpindex()."?section=tools\">".
		strings::expression("navigation", "Tools")."</a></p>\n";
	}
	echo "</div>\n";

	return(true);
    } // END function navLeft



    function navTabHead() {
	$section = navigation::giveSection();
	echo "<div id=\"navTabHead\">\n".
	    "  <ul id=\"navTab\">\n";
	// "home"
	if ( checkHomeShow() ) {
	    echo "    <li><a href=\"".give::phpindex()."\" ";
	    if ( !isset($section)) {
		echo "id=\"navTabHere\"";
	    }
	    echo ">".strings::expression("navigation", "home").
		"</a></li>\n";
	}
	// polar
	echo "    <li><a href=\"".give::phpindex().
	    "?section=polar&amp;mission=months\" ";
	if ( $section == "polar" ) {
	    echo "id=\"navTabHere\"";
	}
	echo ">".strings::expression("navigation", "workouts").
	    "</a></li>\n";
	// check if diary is wanted and show if true
	if ( $_SESSION['diary']['on'] && 
	    user::validateIP($_SESSION['validIp']['diary']) ) {
		echo "    <li><a href=\"".give::phpindex().
		    "?section=dagbok&amp;mission=dagbok\" ";
		if ( $section == "dagbok" ) {
		    echo "id=\"navTabHere\"";
		}
		echo ">".strings::expression("navigation", "diary").
		    "</a></li>\n";
	    }
	// upload workout
	if ( user::validateIP($_SESSION['validIp']['upload']) ) {
	    echo "    <li><a href=\"".give::phpindex()."?section=".
		"uploadWorkout\" ";
	    if ( $section == "uploadWorkout" ) {
		echo "id=\"navTabHere\"";
	    }
	    echo ">".strings::expression("navigation", "uploadWorkout").
		"</a></li>\n";
	}
	// settings
	if ( user::validateIP($_SESSION['validIp']['settings']) ) {
	    echo "    <li><a href=\"".give::phpindex().
		"?section=setup\" ";
	    if ( $section == "setup" ) {
		echo "id=\"navTabHere\"";
	    }
	    echo ">".strings::expression("setup", "Settings")."</a></li>\n";
	}
	// tools
	if ( user::validateIP($_SESSION['validIp']['tools']) ) {
	    echo "    <li><a href=\"".give::phpindex().
		"?section=tools\" ";
	    if ( $section == "tools" )  {
		echo "id=\"navTabHere\"";
	    }
	    echo ">".strings::expression("navigation", "Tools")."</a></li>\n";
	}
	// end navTavHead
	echo "  </ul>\n".
	    "</div>\n";

	return(true);
  }


  function submenu($parent) {

    $mission = navigation::geUppdrag();

    if ( $mission == $parent ) {    
      switch( $parent )
	{
	case 'dagbok':
	  break;
	default:
	  break;
	}
    }
    
  } // END function submenu
    

  
} // END class navigation

?>
Return current item: Polaring