xref: /OK3568_Linux_fs/buildroot/board/forlinx/ok3568/fs-overlay/usr/share/matrix-gui-2.0/menubar.php (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1<?php
2/*
3 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
4 *
5 *
6 *  Redistribution and use in source and binary forms, with or without
7 *  modification, are permitted provided that the following conditions
8 *  are met:
9 *
10 *    Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 *
13 *    Redistributions in binary form must reproduce the above copyright
14 *    notice, this list of conditions and the following disclaimer in the
15 *    documentation and/or other materials provided with the
16 *    distribution.
17 *
18 *    Neither the name of Texas Instruments Incorporated nor the names of
19 *    its contributors may be used to endorse or promote products derived
20 *    from this software without specific prior written permission.
21 *
22 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34*/
35?>
36<?php
37/*
38----Note----
39This file is meant to be included in the php file of another page. Therefore, some variables used in this file is assumed to be set within the page that includes this file.
40You will notice that these variables are always checked to make sure they are set (set from the other page). If the variable isn't set then the variable is given a default value
41which usually is meant to deactivate something. This is done to allow pages that are including this file to only set the variables they care about
42*/
43
44//Some parts of the code doesn't set the submenu variable when the user is at the Main Menu which is relected in the "top" variable
45$submenu = isset($_GET["submenu"]) == true ? $_GET["submenu"] : "main_menu" ;
46
47$previous_page = isset($previous_page) == true ? $previous_page : -1;
48$enable_previous_link = $previous_page >= 0;
49
50$next_page = isset($next_page) == true ? $next_page : -1;
51$enable_next_link = $next_page > 0;
52
53$enable_main_menu_link = isset($enable_main_menu_link) == true ? $enable_main_menu_link : false;
54?>
55
56<table id = "menubar" width = "100%" style = "margin-bottom:10px;">
57	<tr>
58		<td  align = "left" >
59			<?php
60				$link = "submenu.php?submenu=".$submenu."&page=".$previous_page;
61				$css_string = ($enable_previous_link == false) ? "hide_link" : "";
62
63				echo "<a href = '$link' class = 'previous_arrow $css_string' ><img id = 'previous_arrow_img' src= 'images/left-arrow-icon.png'></a>";
64
65				//Added these two html elements so that each side will be even
66				echo "<a href = '#'  class = 'hide_link'><img id = 'exit_button_img' src= 'images/multi-icon.png'></a>";
67				echo "<a href = '#'  class = 'hide_link'><img id = 'next_arrow_img' src= 'images/right-arrow-icon.png'></a>";
68			?>
69
70		</td>
71		<td  align = "center" id = "banner" >
72			<?php
73				echo "<img id = 'logo_img' src= 'images/tex.png'>";
74				echo $menu_title;
75			?>
76		</td>
77		<td  align = "right" >
78			<?php
79				$css_string = ($enable_main_menu_link == false) ? "hide_link" : "";
80
81				echo "<a  id = 'back_link' class = '$css_string' href = '#'><img id = 'back_button_img' src= 'images/back-arrow-icon.png'></a>";
82				echo "<a  id = 'main_menu_link' class = '$css_string' href = 'submenu.php?submenu=main_menu&page=0'  ><img id = 'exit_button_img' src= 'images/multi-icon.png'></a>";
83
84				$css_string = ($enable_next_link == true) ? "" : "hide_link";
85
86				$link = "submenu.php?submenu=".$submenu."&page=".$next_page;
87
88				echo "<a href = '$link' class = '$css_string' ><img id = 'next_arrow_img' src= 'images/right-arrow-icon.png'></a>";
89
90			?>
91		</td>
92	</tr>
93</table>
94