XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
main.php
Go to the documentation of this file.
1
<?php
2
/*
3
You may not change or alter any portion of this comment or credits
4
of supporting developers from this source code or any supporting source code
5
which is considered copyrighted (c) material of the original comment or credit authors.
6
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
12
use
Xoops\Core\Kernel\Criteria
;
13
use
Xoops\Core\Kernel\CriteriaCompo
;
14
25
function
b_system_main_show
()
26
{
27
$xoops
=
Xoops::getInstance
();
28
$block = array();
29
$block[
'lang_home'
] =
XoopsLocale::HOME
;
30
$block[
'lang_close'
] =
XoopsLocale::A_CLOSE
;
31
$module_handler
=
$xoops
->getHandlerModule();
32
$criteria
=
new
CriteriaCompo
(
new
Criteria
(
'hasmain'
, 1));
33
$criteria
->add(
new
Criteria
(
'isactive'
, 1));
34
$criteria
->add(
new
Criteria
(
'weight'
, 0,
'>'
));
35
$modules
=
$module_handler
->getObjectsArray(
$criteria
,
true
);
36
$moduleperm_handler
=
$xoops
->getHandlerGroupperm();
37
$groups
=
$xoops
->getUserGroups();
38
$read_allowed
=
$moduleperm_handler
->getItemIds(
'module_read'
,
$groups
);
39
/* @var $module XoopsModule */
40
foreach
(
$modules
as
$i
=>
$module
) {
41
if
(in_array(
$i
,
$read_allowed
)) {
42
$block[
'modules'
][
$i
][
'name'
] =
$module
->getVar(
'name'
);
43
$block[
'modules'
][
$i
][
'dirname'
] =
$module
->getVar(
'dirname'
);
44
if
(
XoopsLoad::fileExists
(
$xoops
->path(
'modules/'
.
$module
->getVar(
'dirname'
) .
'/icons/logo_small.png'
))) {
45
$block[
'modules'
][
$i
][
'image'
] =
$xoops
->url(
'modules/'
.
$module
->getVar(
'dirname'
) .
'/icons/logo_small.png'
);
46
}
47
if
(
$xoops
->isModule() && (
$i
==
$xoops
->module->getVar(
'mid'
))) {
48
$block[
'modules'
][
$i
][
'highlight'
] =
true
;
49
$block[
'nothome'
] =
true
;
50
}
51
if
(
$xoops
->module && (
$i
==
$xoops
->module->getVar(
'mid'
))) {
52
$block[
'modules'
][
$i
][
'highlight'
] =
true
;
53
$block[
'nothome'
] =
true
;
54
}
55
/* @var $plugin MenusPluginInterface */
56
if
(
$xoops
->isModule() &&
$module
->getVar(
'dirname'
) ==
$xoops
->module->getVar(
'dirname'
) && $plugin = \Xoops\Module\Plugin::getPlugin(
$module
->getVar(
'dirname'
),
'menus'
)) {
57
$sublinks = $plugin->subMenus();
58
foreach
($sublinks as $sublink) {
59
$block[
'modules'
][
$i
][
'sublinks'
][] = array(
60
'name'
=> $sublink[
'name'
],
61
'url'
=> \
XoopsBaseConfig::get
(
'url'
) .
'/modules/'
.
$module
->getVar(
'dirname'
) .
'/'
. $sublink[
'url'
]
62
);
63
}
64
}
65
66
}
67
}
68
return
$block;
69
}
70
71
function
b_system_main_edit
(
$options
)
72
{
73
$xoops
=
Xoops::getInstance
();
74
$system
=
System::getInstance
();
75
$system_module
=
new
SystemModule
();
76
$admin_page
= new \Xoops\Module\Admin();
77
78
// Define Stylesheet
79
$xoops
->theme()->addStylesheet(
'media/xoops/css/icons.css'
);
80
$xoops
->theme()->addStylesheet(
'modules/system/css/admin.css'
);
81
// Define scripts
82
$xoops
->theme()->addScript(
'media/jquery/plugins/jquery.jeditable.js'
);
83
$xoops
->theme()->addScript(
'modules/system/js/module.js'
);
84
85
$admin_page
->addTips(
SystemLocale::MENU_TIPS
);
86
$admin_page
->renderTips();
87
$list =
$system_module
->getModuleList();
88
$xoops
->tpl()->assign(
'modules_list'
, $list);
89
return
$xoops
->tpl()->fetch(
'admin:system/system_modules_menu.tpl'
);
90
}
$i
$i
Definition:
dialog.php:68
$system
$system
Definition:
main.php:26
System\getInstance
static getInstance()
Definition:
system.php:46
Xoops\getInstance
static getInstance()
Definition:
Xoops.php:160
b_system_main_edit
b_system_main_edit($options)
Definition:
main.php:71
Xoops\Core\Kernel\CriteriaCompo
Definition:
CriteriaCompo.php:30
CriteriaCompo
$read_allowed
$read_allowed
Definition:
userinfo.php:188
$options
$options['editor']
Definition:
sampleform.inc.php:44
Xoops\Core\Kernel\Criteria
Definition:
Criteria.php:30
$admin_page
$admin_page
Definition:
main.php:34
SystemLocaleEn_US\MENU_TIPS
const MENU_TIPS
Definition:
en_US.php:339
SystemModule
XoopsLocaleEn_US\A_CLOSE
const A_CLOSE
Definition:
en_US.php:87
XoopsLoad\fileExists
static fileExists($file)
Definition:
xoopsload.php:506
XoopsBaseConfig\get
static get($name)
Definition:
XoopsBaseConfig.php:117
$module
$module
Definition:
main.php:52
b_system_main_show
b_system_main_show()
Definition:
main.php:25
Criteria
$groups
$groups
Definition:
xoops_images.php:35
$modules
$modules
Definition:
userinfo.php:185
$criteria
$criteria
Definition:
page_configsite.php:52
$system_module
$system_module
Definition:
page_extensioninstaller.php:77
XoopsLocaleEn_US\HOME
const HOME
Definition:
en_US.php:463
$module_handler
$module_handler
Definition:
main.php:55
$xoops
$xoops
Definition:
main.php:25
$moduleperm_handler
$moduleperm_handler
Definition:
cp_header.php:31
usr64
htdocs
modules
system
blocks
main.php
Generated on Fri May 22 2015 03:07:03 for XOOPS by
1.8.9.1