1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: xoops_load('gui', 'system');
13:
14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27:
28:
29: 30: 31:
32: class XoopsGuiTransition extends XoopsSystemGui
33: {
34: 35: 36:
37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51:
52: 53: 54:
55: public static function validate()
56: {
57: return true;
58: }
59:
60: public function header()
61: {
62: parent::header();
63:
64: global $xoopsConfig, $xoopsUser, $xoopsModule, $xoTheme, $xoopsTpl, $xoopsDB;
65: $tpl =& $this->template;
66:
67:
68: $currentScript = str_replace(XOOPS_ROOT_PATH . '/', '', $_SERVER['SCRIPT_FILENAME']);
69:
70: if('admin.php' == $currentScript){
71: $show = isset($_GET['show']) ? $_GET['show'] : '';
72: if('info' == $show){
73: $tpl->assign('showTransitionInfo', true);
74: }
75: }
76:
77: $iconsSet = xoops_getModuleOption('typeicons', 'system');
78:
79: if ($iconsSet == '') {
80: $icons = 'transition';
81: }
82:
83: $tpl->assign('theme_icons', XOOPS_URL . '/modules/system/images/icons/' . $iconsSet);
84:
85:
86: $tpl->assign('xoops_language', $xoopsConfig['language']);
87:
88: $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
89: $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/transition/js/styleswitch.js');
90: $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/transition/js/formenu.js');
91: $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/transition/js/menu.js');
92: $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/transition/js/tooltip.js');
93:
94: $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/transition/js/tabs.js');
95: $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/transition/js/tabs.slideshow.js');
96:
97: $xoTheme->addStylesheet('https://fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700,700i|Roboto:300,300i,400,400i,700,700i');
98:
99: $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/transition/css/style.css');
100: $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/transition/css/dark.css', array('title' => 'dark', 'media' => 'screen'));
101: $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/transition/css/silver.css', array('title' => 'silver', 'media' => 'screen'));
102: $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/transition/css/orange.css', array('title' => 'orange', 'media' => 'screen'));
103:
104: $tpl->assign('lang_cp', _CPHOME);
105:
106:
107: $tpl->assign('lang_php_vesion', PHP_VERSION);
108: $tpl->assign('lang_mysql_version', mysqli_get_server_info($xoopsDB->conn));
109: $tpl->assign('lang_server_api', PHP_SAPI);
110: $tpl->assign('lang_os_name', PHP_OS);
111:
112:
113:
114: $tpl->assign('allow_url_fopen', ini_get('allow_url_fopen') ? 'On' : 'Off');
115: $tpl->assign('fsockopen', function_exists('fsockopen') ? 'On' : 'Off');
116:
117: $tpl->assign('post_max_size', ini_get('post_max_size'));
118: $tpl->assign('max_input_time', ini_get('max_input_time'));
119: $tpl->assign('output_buffering', ini_get('output_buffering'));
120: $tpl->assign('max_execution_time', ini_get('max_execution_time'));
121: $tpl->assign('memory_limit', ini_get('memory_limit'));
122: $tpl->assign('file_uploads', ini_get('file_uploads') ? 'On' : 'Off');
123: $tpl->assign('upload_max_filesize', ini_get('upload_max_filesize'));
124: $tpl->assign('xoops_sitename', $xoopsConfig['sitename']);
125:
126:
127:
128:
129: $menu = array();
130: $menu[0]['link'] = XOOPS_URL;
131: $menu[0]['title'] = "<span class='fa fa-home'></span> " . _YOURHOME;
132: $menu[0]['absolute'] = 1;
133: $menu[1]['link'] = XOOPS_URL . '/admin.php?xoopsorgnews=1';
134: $menu[1]['title'] = "<span class='fa fa-newspaper-o'></span> " . _OXYGEN_NEWS;
135: $menu[1]['absolute'] = 1;
136: $menu[1]['icon'] = XOOPS_ADMINTHEME_URL . '/transition/images/xoops.png';
137: $menu[2]['link'] = XOOPS_URL . '/user.php?op=logout';
138: $menu[2]['title'] = "<span class='fa fa-sign-out'></span> " . _LOGOUT;
139: $menu[2]['absolute'] = 1;
140: $menu[2]['icon'] = XOOPS_ADMINTHEME_URL . '/transition/images/logout.png';
141: $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => '<span class="fa fa-cog"></span> ' . _CPHOME, 'menu' => $menu));
142:
143:
144: include __DIR__ . '/menu.php';
145: if (empty($xoopsModule) || 'system' === $xoopsModule->getVar('dirname', 'n')) {
146: $modpath = XOOPS_URL . '/admin.php';
147: $modname = _OXYGEN_SYSOPTIONS;
148: $modid = 1;
149: $moddir = 'system';
150:
151: $mod_options = $adminmenu;
152: foreach (array_keys($mod_options) as $item) {
153: $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . '/modules/' . $moddir . '/' . $mod_options[$item]['link'] : $mod_options[$item]['link'];
154: $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : XOOPS_URL . '/modules/system/images/' . $mod_options[$item]['icon'];
155: unset($mod_options[$item]['icon_small']);
156: }
157: } else {
158: $moddir = $xoopsModule->getVar('dirname', 'n');
159: $modpath = XOOPS_URL . '/modules/' . $moddir;
160: $modname = $xoopsModule->getVar('name');
161: $modid = $xoopsModule->getVar('mid');
162:
163: $mod_options = $xoopsModule->getAdminMenu();
164: foreach (array_keys($mod_options) as $item) {
165: $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['link'] : $mod_options[$item]['link'];
166:
167:
168: $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : (filter_var($mod_options[$item]['icon'], FILTER_VALIDATE_URL) ? $mod_options[$item]['icon'] : (XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['icon']));
169: }
170: }
171:
172: $tpl->assign('mod_options', $mod_options);
173: $tpl->assign('modpath', $modpath);
174: $tpl->assign('modname', $modname);
175: $tpl->assign('modid', $modid);
176: $tpl->assign('moddir', $moddir);
177:
178:
179:
180: $module_handler = xoops_getHandler('module');
181: $criteria = new CriteriaCompo();
182: $criteria->add(new Criteria('hasadmin', 1));
183: $criteria->add(new Criteria('isactive', 1));
184: $criteria->setSort('mid');
185: $mods = $module_handler->getObjects($criteria);
186:
187: $menu = array();
188:
189: $moduleperm_handler = xoops_getHandler('groupperm');
190: foreach ($mods as $mod) {
191: $rtn = array();
192: $modOptions = array();
193: $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
194: if ($sadmin) {
195: $info = $mod->getInfo();
196: if (!empty($info['adminindex'])) {
197: $rtn['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['adminindex'];
198: } else {
199: $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid');
200: }
201: $rtn['title'] = htmlspecialchars($mod->name(), ENT_QUOTES);
202: $rtn['absolute'] = 1;
203: $rtn['url'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/';
204: $modOptions = $mod->getAdminMenu();
205: $rtn['options'] = $modOptions;
206:
207: if (isset($info['icon']) && $info['icon'] !== '') {
208: $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon'];
209: }
210: $menu[] = $rtn;
211: }
212: }
213: $tpl->append('navitems', array(
214: 'link' => XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin',
215: 'text' => '<span class="fa fa-puzzle-piece"></span> ' . _AM_SYSTEM_MODULES,
216: 'dir' => $mod->getVar('dirname', 'n'),
217: 'menu' => $menu));
218:
219:
220: $menu = array();
221:
222: $OPT = array();
223: $OPT[] = array(
224: 'link' => 'admin.php?fct=preferences&op=show&confcat_id=1',
225: 'title' => _OXYGEN_GENERAL,
226: 'absolute' => 1,
227: 'icon' => XOOPS_ADMINTHEME_URL . '/transition/icons/prefs_small.png');
228: $OPT[] = array(
229: 'link' => 'admin.php?fct=preferences&op=show&confcat_id=2',
230: 'title' => _OXYGEN_USERSETTINGS,
231: 'absolute' => 1,
232: 'icon' => XOOPS_ADMINTHEME_URL . '/transition/icons/prefs_small.png');
233: $OPT[] = array(
234: 'link' => 'admin.php?fct=preferences&op=show&confcat_id=3',
235: 'title' => _OXYGEN_METAFOOTER,
236: 'absolute' => 1,
237: 'icon' => XOOPS_ADMINTHEME_URL . '/transition/icons/prefs_small.png');
238: $OPT[] = array(
239: 'link' => 'admin.php?fct=preferences&op=show&confcat_id=4',
240: 'title' => _OXYGEN_CENSOR,
241: 'absolute' => 1,
242: 'icon' => XOOPS_ADMINTHEME_URL . '/transition/icons/prefs_small.png');
243: $OPT[] = array(
244: 'link' => 'admin.php?fct=preferences&op=show&confcat_id=5',
245: 'title' => _OXYGEN_SEARCH,
246: 'absolute' => 1,
247: 'icon' => XOOPS_ADMINTHEME_URL . '/transition/icons/prefs_small.png');
248: $OPT[] = array(
249: 'link' => 'admin.php?fct=preferences&op=show&confcat_id=6',
250: 'title' => _OXYGEN_MAILER,
251: 'absolute' => 1,
252: 'icon' => XOOPS_ADMINTHEME_URL . '/transition/icons/prefs_small.png');
253: $OPT[] = array(
254: 'link' => 'admin.php?fct=preferences&op=show&confcat_id=7',
255: 'title' => _OXYGEN_AUTHENTICATION,
256: 'absolute' => 1,
257: 'icon' => XOOPS_ADMINTHEME_URL . '/transition/icons/prefs_small.png');
258: $OPT[] = array(
259: 'link' => 'admin.php?fct=preferences&op=showmod&mod=1',
260: 'title' => _OXYGEN_MODULESETTINGS,
261: 'absolute' => 1,
262: 'icon' => XOOPS_ADMINTHEME_URL . '/transition/icons/prefs_small.png');
263:
264: $menu[] = array(
265: 'link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences',
266: 'title' => _OXYGEN_SYSOPTIONS,
267: 'absolute' => 1,
268: 'url' => XOOPS_URL . '/modules/system/',
269: 'options' => $OPT);
270:
271: foreach ($mods as $mod) {
272: $rtn = array();
273: $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
274: if ($sadmin && ($mod->getVar('hasnotification') || is_array($mod->getInfo('config')) || is_array($mod->getInfo('comments')))) {
275: $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid');
276: $rtn['title'] = htmlspecialchars($mod->name(), ENT_QUOTES);
277: $rtn['absolute'] = 1;
278: $rtn['icon'] = XOOPS_ADMINTHEME_URL . '/gui/oxygen/icons/prefs_small.png';
279: $menu[] = $rtn;
280: }
281: }
282: $tpl->append('navitems', array(
283: 'link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences',
284: 'text' => '<span class="fa fa-wrench"></span> ' . _OXYGEN_SITEPREF,
285: 'dir' => $mod->getVar('dirname', 'n'),
286: 'menu' => $menu));
287:
288:
289: $menu = array();
290: $menu[] = array(
291: 'link' => 'http://xoops.org',
292: 'title' => _OXYGEN_XOOPSPROJECT,
293: 'absolute' => 1);
294: $menu[] = array(
295: 'link' => 'http://xoops.org',
296: 'title' => _OXYGEN_WEBSITE,
297: 'absolute' => 1,
298: 'icon' => XOOPS_ADMINTHEME_URL . '/transition/images/xoops.png');
299: $menu[] = array(
300: 'link' => 'http://www.xoops.org/modules/repository/',
301: 'title' => _OXYGEN_XOOPSMODULES,
302: 'absolute' => 1,
303: 'icon' => XOOPS_ADMINTHEME_URL . '/transition/images/xoops.png');
304: $menu[] = array(
305: 'link' => 'http://www.xoops.org/modules/extgallery/',
306: 'title' => _OXYGEN_XOOPSTHEMES,
307: 'absolute' => 1,
308: 'icon' => XOOPS_ADMINTHEME_URL . '/transition/images/tweb.png');
309:
310: $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => '<span class="fa fa-link"></span> ' . _OXYGEN_INTERESTSITES, 'menu' => $menu));
311:
312:
313: if (file_exists($file = XOOPS_ADMINTHEME_PATH . '/transition/language/' . $xoopsConfig['language'] . '/localsupport.php')) {
314: $links = include XOOPS_ADMINTHEME_PATH . '/transition/language/' . $xoopsConfig['language'] . '/localsupport.php';
315: if (count($links) > 0) {
316: $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => '<span class="fa fa-link"></span> ' . _OXYGEN_LOCALSUPPORT, 'menu' => $links));
317: }
318: }
319:
320: if (is_object($xoopsModule) || !empty($_GET['xoopsorgnews'])) {
321: if (is_object($xoopsModule) && file_exists($file = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/' . $xoopsModule->getInfo('adminmenu'))) {
322: include $file;
323: }
324:
325: return null;
326: }
327:
328: foreach ($mods as $mod) {
329: $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
330: if ($sadmin) {
331: $rtn = array();
332: $info = $mod->getInfo();
333: if (!empty($info ['adminindex'])) {
334: $rtn ['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info ['adminindex'];
335: } else {
336: $rtn ['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid');
337: }
338: $rtn ['title'] = htmlspecialchars($mod->getVar('name'), ENT_QUOTES);
339: $rtn ['description'] = $mod->getInfo('description');
340: $rtn ['absolute'] = 1;
341: if (isset($info ['icon_big'])) {
342: $rtn ['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info ['icon_big'];
343: } elseif (isset($info ['image'])) {
344: $rtn ['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info ['image'];
345: }
346:
347: $tpl->append('modules', $rtn);
348: }
349: }
350: }
351: }
352: