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 : -1;
# 是否打开了前面一页的链接,如果previous_page是-1,表示不能再往前了
$enable_previous_link = $previous_page >= 0;

# 查看往后一页是否设置
$next_page = isset($next_page) == true ? $next_page : -1;
# 是否打开了往后往后一页的链接
$enable_next_link = $next_page > 0;

# 查看是否打开主页链接使能
$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>
时间: 2024-09-28 02:04:09

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/ * * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribut

Texas Instruments matrix-gui-2.0 hacking -- run_script.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: * * Redistribut

Texas Instruments matrix-gui-2.0 hacking -- submenu.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: * * Redistribut

Texas Instruments matrix-gui-2.0 hacking -- index.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: * * Redistribut

Texas Instruments matrix-gui-2.0 hacking -- execute_command.sh

#!/bin/sh #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: # # Redistribut

Texas Instruments matrix-gui-2.0 hacking -- json.txt

{ "main_menu": { "apps": [ { "Name":"Profiling", "Order":"1", "Icon":"apps\/images\/oprofile-icon.png", "Type":"directory", "Category":"prof

ZHA profile与ZLL profile的一个例子

ZHA Coordinator 如何控制ZLL Light/Philips Hue Light 缩写: ZHA: ZigBee Home Automation profile ZLL:  ZigBee Light Link profile TCLK: Trust Center Link Key 为什么ZLL 灯加入ZHA网络 在ZLL网络中,设备支持两种方式Join ZigBee网络,一种是通过Touch Link[1]方式入网,遥控器和灯靠近配对的方式把灯拉入到ZLL网络中.另外一种是传统入网

TIMAC 学习笔记1

TIMAC是TI公司推出的基于IEEE 802.15.4的通讯协议栈,编译环境为IAR,使用IAR自带的CLIB库,CLIB库提供了轻量级的C库,它不支持嵌入式C++.适用于RF4CE协议和ZigBee-Pro产品. 目前学习的MAC层协议版本为1.5.0. 为什么要学习TIMAC呢?在开发基于ZigBee的项目中,遇到了一些底层上的问题,再深入时,发现卡在底层封装的库中去,TIMAC比ZStack的底层开放程度更高,为了更好的理解无线传输的一些细节问题,才会去看TIMAC协议. 特点 1. 多

IAR8.30.3安装破解方法及ZStack-MESH安装方法

安装前的准备 安装破解前请先关闭所有安全软件,比如360安全卫士.电脑管家.金山毒霸. 安装包地址:[http://pan.baidu.com/s/1miDBFTI] 1.     安装IAR 将压缩文件解压,打开IAR8.30.3文件夹,找到EW8051-8303-Autorun.exe双击运行,接着在弹出的安装向导窗口里选择Install IAR Embedded Workbench,按照默认的选项完成安装就行了.安装完成后退出软件,并点击Exit退出安装向导窗口. 2.     破解IAR