1
|
|
|
<?php |
2
|
|
|
// ------------------------------------------------------------------------ // |
3
|
|
|
// -- XoopsHP Module -- Xoops e-Learning System // |
4
|
|
|
// Copyright (c) 2005 SUDOW-SOKEN // |
5
|
|
|
// <http://www.mailpark.co.jp/> // |
6
|
|
|
// ------------------------------------------------------------------------ // |
7
|
|
|
// Based on XoopsHP1.01 by Yoshi, aka HowardGee. // |
8
|
|
|
// ------------------------------------------------------------------------ // |
9
|
|
|
// This program is free software; you can redistribute it and/or modify // |
10
|
|
|
// it under the terms of the GNU General Public License as published by // |
11
|
|
|
// the Free Software Foundation; either version 2 of the License, or // |
12
|
|
|
// (at your option) any later version. // |
13
|
|
|
// // |
14
|
|
|
// You may not change or alter any portion of this comment or credits // |
15
|
|
|
// of supporting developers from this source code or any supporting // |
16
|
|
|
// source code which is considered copyrighted (c) material of the // |
17
|
|
|
// original comment or credit authors. // |
18
|
|
|
// // |
19
|
|
|
// This program is distributed in the hope that it will be useful, // |
20
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of // |
21
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
22
|
|
|
// GNU General Public License for more details. // |
23
|
|
|
// // |
24
|
|
|
// You should have received a copy of the GNU General Public License // |
25
|
|
|
// along with this program; if not, write to the Free Software // |
26
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
27
|
|
|
// ------------------------------------------------------------------------ // |
28
|
|
|
|
29
|
|
|
defined('XOOPS_ROOT_PATH') or die('XOOPS root path not defined'); |
|
|
|
|
30
|
|
|
|
31
|
|
|
$path = dirname(dirname(dirname(__DIR__))); |
32
|
|
|
include_once $path . '/mainfile.php'; |
33
|
|
|
|
34
|
|
|
$dirname = basename(dirname(__DIR__)); |
35
|
|
|
$module_handler = xoops_getHandler('module'); |
36
|
|
|
$module = $module_handler->getByDirname($dirname); |
37
|
|
|
$pathIcon32 = $module->getInfo('icons32'); |
38
|
|
|
$pathModuleAdmin = $module->getInfo('dirmoduleadmin'); |
39
|
|
|
$pathLanguage = $path . $pathModuleAdmin; |
40
|
|
|
|
41
|
|
|
if (!file_exists($fileinc = $pathLanguage . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/' . 'main.php')) { |
42
|
|
|
$fileinc = $pathLanguage . '/language/english/main.php'; |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
include_once $fileinc; |
46
|
|
|
|
47
|
|
|
$adminmenu = array(); |
48
|
|
|
$i = 0; |
49
|
|
|
$adminmenu[$i]['title'] = _AM_MODULEADMIN_HOME; |
50
|
|
|
$adminmenu[$i]['link'] = 'admin/index.php'; |
51
|
|
|
$adminmenu[$i]['icon'] = $pathIcon32 . '/home.png'; |
52
|
|
|
$i++; |
53
|
|
|
$adminmenu[$i]['title'] = _MI_XHP_ADMENU; |
54
|
|
|
$adminmenu[$i]['link'] = 'admin/main.php'; |
55
|
|
|
$adminmenu[$i]['icon'] = $pathIcon32 . '/manage.png'; |
56
|
|
|
|
57
|
|
|
$i++; |
58
|
|
|
$adminmenu[$i]['title'] = _AM_MODULEADMIN_ABOUT; |
59
|
|
|
$adminmenu[$i]['link'] = 'admin/about.php'; |
60
|
|
|
$adminmenu[$i]['icon'] = $pathIcon32 . '/about.png'; |
61
|
|
|
|
PHP has two types of connecting operators (logical operators, and boolean operators):
and
&&
or
||
The difference between these is the order in which they are executed. In most cases, you would want to use a boolean operator like
&&
, or||
.Let’s take a look at a few examples:
Logical Operators are used for Control-Flow
One case where you explicitly want to use logical operators is for control-flow such as this:
Since
die
introduces problems of its own, f.e. it makes our code hardly testable, and prevents any kind of more sophisticated error handling; you probably do not want to use this in real-world code. Unfortunately, logical operators cannot be combined withthrow
at this point:These limitations lead to logical operators rarely being of use in current PHP code.