Texas Instruments matrix-gui-2.0 hacking -- menubar.php
<?php
/*
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
?>
<?php
/*
----Note----
This 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.
You 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
which 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
*/ //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
# 查看子菜单是否设置,并作相应的赋值
$submenu = isset($_GET["submenu"]) == true ? $_GET["submenu"] : "main_menu" ; # 查看前面一页是否设置
$previous_page = isset($previous_page) == true ? $previous_page : -;
# 是否打开了前面一页的链接,如果previous_page是-,表示不能再往前了
$enable_previous_link = $previous_page >= ; # 查看往后一页是否设置
$next_page = isset($next_page) == true ? $next_page : -;
# 是否打开了往后往后一页的链接
$enable_next_link = $next_page > ; # 查看是否打开主页链接使能
$enable_main_menu_link = isset($enable_main_menu_link) == true ? $enable_main_menu_link : false;
?> <!-- 由id = "menubar" 可知,这是一个菜单栏 -->
<table id = "menubar" width = "100%" style = "margin-bottom:10px;">
<tr>
<td align = "left" >
<?php
# 构建链接地址
$link = "submenu.php?submenu=".$submenu."&page=".$previous_page;
# 构建css字符串,hide_link的意思是隐藏链接的意思
$css_string = ($enable_previous_link == false) ? "hide_link" : ""; # 生成超级链接,并根据css_string决定是否显示
echo "<a href = '$link' class = 'previous_arrow $css_string' ><img id = 'previous_arrow_img' src= 'images/left-arrow-icon.png'></a>"; //Added these two html elements so that each side will be even
# 这两个图标没有超级链接的用途,当然也就被隐藏(hide_link)了
echo "<a href = '#' class = 'hide_link'><img id = 'exit_button_img' src= 'images/multi-icon.png'></a>";
echo "<a href = '#' class = 'hide_link'><img id = 'next_arrow_img' src= 'images/right-arrow-icon.png'></a>";
?> </td>
<!-- banner: 旗帜, 貌似是说logo的意思 -->
<td align = "center" id = "banner" >
<?php
echo "<img id = 'logo_img' src= 'images/tex.png'>";
echo $menu_title;
?>
</td>
<td align = "right" >
<?php
# 看是否有链接到主页的功能
$css_string = ($enable_main_menu_link == false) ? "hide_link" : ""; # 无效链接
echo "<a id = 'back_link' class = '$css_string' href = '#'><img id = 'back_button_img' src= 'images/back-arrow-icon.png'></a>";
# 链接到主页的超级链接
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>"; $css_string = ($enable_next_link == true) ? "" : "hide_link"; # 是否显示下一页的链接
$link = "submenu.php?submenu=".$submenu."&page=".$next_page;
echo "<a href = '$link' class = '$css_string' ><img id = 'next_arrow_img' src= 'images/right-arrow-icon.png'></a>"; ?>
</td>
</tr>
</table>
Texas Instruments matrix-gui-2.0 hacking -- menubar.php的更多相关文章
- Texas Instruments matrix-gui-2.0 hacking -- app_description.php
<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...
- Texas Instruments matrix-gui-2.0 hacking -- submenu.php
<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...
- Texas Instruments matrix-gui-2.0 hacking -- run_script.php
<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...
- Texas Instruments matrix-gui-2.0 hacking -- index.php
<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...
- Texas Instruments matrix-gui-2.0 hacking -- generate.php
<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...
- Texas Instruments matrix-gui-2.0 hacking -- execute_command.sh
#!/bin/sh #Copyright (C) Texas Instruments Incorporated - http://www.ti.com/ # # # Redistribution an ...
- 【LeetCode每天一题】Set Matrix Zeroes(设置0矩阵)
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place. Exampl ...
- Texas Instruments matrix-gui-2.0 hacking -- json.txt
{ "main_menu": { "apps": [ { "Name":"Profiling", ", &qu ...
- Texas Instruments matrix-gui-2.0 hacking -- helper_functions.php
<?php # PHP_SELF: 但前正在执行脚本的文件名,与document root相关 # QUERY_STRING: 查询(query)的字符串 $cachefile = " ...
随机推荐
- python json 文件读写
import json test_dict = {,,,} print(test_dict) print(type(test_dict))#字典 #dumps 将数据转换成字符串 json_str = ...
- RabbitMQ入门_08_所谓的点对点与发布订阅模型
A. JMS 模型 JMS 中定义了点对点和发布订阅两种消息模型,原来以为 AMQP 协议中 direct Exchange 对应点对点模型,topic Exchange 对应发布订阅模型,fanou ...
- 算法笔记--KMP算法 && EXKMP算法
1.KMP算法 这个博客写的不错:http://www.cnblogs.com/SYCstudio/p/7194315.html 模板: next数组的求解,那个循环本质就是如果相同前后缀不能加上该位 ...
- SVN同步版本库与网站目录
如何创建SVN版本库及同步文件到WEB目录 来源:空谷 一 安装与配置SVN 1.安装subversion centos: yum install subversion ubuntu: apt-get ...
- TortoiseXX 与TotalCommander (TC)的图标问题
TortoiseXX通过overlay图标标志文件或文件夹是否被修改等状态,非常有用. 可惜TotoalCommander上,这些图标都没有显示. 其实,只需要在TC的菜单 配置->显示-> ...
- HDOJ-1124 Factorial 数论
题意哇:求N!末尾多少个0. 很容易想到转化为求N!中5因子的个数.但是从数据范围来看必然不可能一个一个算出来. 所以这里借用数论的一个知识. 如果p是素数,那么n!中p因子的个数可以表示为1-n中整 ...
- Mashmokh and ACM CodeForces - 414D (贪心)
大意: 给定n结点树, 有k桶水, p块钱, 初始可以任选不超过k个点(不能选根结点), 在每个点放一桶水, 然后开始游戏. 游戏每一轮开始时, 可以任选若干个节点关闭, 花费为关闭结点储存水的数量和 ...
- 快速读入fread
struct FastIO { static const int S = 1e7; int wpos; char wbuf[S]; FastIO() : wpos(0) {} inline int x ...
- 51nod1344
有编号1-n的n个格子,机器人从1号格子顺序向后走,一直走到n号格子,并需要从n号格子走出去.机器人有一个初始能量,每个格子对应一个整数A[i],表示这个格子的能量值.如果A[i] > 0,机器 ...
- java keytool详解
Keytool 是一个Java 数据证书的管理工具 ,Keytool 将密钥(key)和证书(certificates)存在一个称为keystore的文件中. 在keystore里,包含两种数据:(1 ...