XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
zetadigme.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  This program is distributed in the hope that it will be useful,
7  but WITHOUT ANY WARRANTY; without even the implied warranty of
8  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9 */
10 xoops_load('gui', 'system');
23 {
24  function __construct() { }
25  function XoopsGuiZetadigme() { $this->__construct(); }
26  function validate() { return true; }
27  function generateMenu() { return true; }
28  function header() {
29  parent::header();
32  $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
33  $xoTheme->addScript('', '', '
34  startList = function() {
35 /* currentStyle restricts the Javascript to IE only */
36  if (document.all &&
37  document.getElementById(nav).currentStyle) {
38  var navroot = document.getElementById(nav);
39  /* Get all the list items within the menu */
40  var lis=navroot.getElementsByTagName("li");
41  for (i=0; i<lis.length; i++) {
42  /* If the li has another menu level */
43  if(lis[i].lastChild.tagName=="ul"){
44  /* assign the function to the li */
45  lis[i].onmouseover=function() {
46  /* display the inner menu */
47  this.lastChild.style.display="block";
48  }
49  lis[i].onmouseout=function() {
50  this.lastChild.style.display="none";
51  }
52  }
53  }
54  }
55 }
56 window.onload= function(){
57  /* pass the function the id of the top level il */
58  /* remove one, when only using one menu */
59  activateMenu("nav");
60  /*activateMenu("vertnav"); */
61 }
62  xoopsOnloadEvent(startList);');
63  $tpl->assign('lang_cp', _CPHOME);
64  $tpl->assign('system_options', _AD_SYSOPTIONS);
65  $tpl->assign('lang_banners', _AM_SYSTEM_BANS);
66  $tpl->assign('lang_blocks', _AM_SYSTEM_BLOCKS);
67  $tpl->assign('lang_groups', _AM_SYSTEM_ADGS);
68  $tpl->assign('lang_images', _AM_SYSTEM_IMAGES);
69  $tpl->assign('lang_modules', _AM_SYSTEM_MODULES);
70  $tpl->assign('lang_preferences', _AM_SYSTEM_PREF);
71  $tpl->assign('lang_smilies', _AM_SYSTEM_SMLS);
72  $tpl->assign('lang_ranks', _AM_SYSTEM_RANK);
73  $tpl->assign('lang_edituser', _AM_SYSTEM_USER);
74  $tpl->assign('lang_mailuser', _AM_SYSTEM_MLUS);
75  $tpl->assign('lang_avatars', _AM_SYSTEM_AVATARS);
76  $tpl->assign('lang_tpls', _AM_SYSTEM_TPLSETS);
77  $tpl->assign('lang_comments', _AM_SYSTEM_COMMENTS);
78  $tpl->assign('lang_insmodules', _AD_INSTALLEDMODULES);
79  $tpl->assign('xoops_sitename', $xoopsConfig['sitename']);
80  //for system overview
81  $tpl->assign('lang_overview', _MD_CPANEL_OVERVIEW);
82  $tpl->assign('lang_phpextensions', _MD_CPANEL_PHPEXTENSIONS);
83  $tpl->assign('lang_about_xoops', _MD_ABOUT);
84  $tpl->assign('lang_about_xoops_text', _MD_ABOUT_TEXT);
85  $tpl->assign('lang_version', _MD_VERSION);
86  $tpl->assign('lang_version_xoops', _MD_VERSION_XOOPS);
87  $tpl->assign('lang_version_php', _MD_VERSION_PHP);
88  $tpl->assign('lang_version_mysql', _MD_VERSION_MYSQL);
89  $tpl->assign('lang_server_api_name', _MD_Server_API);
90  $tpl->assign('lang_os', _MD_OS);
91  $tpl->assign('lang_xoops_links', _MD_XOOPS_LINKS);
92  //start system overview
93  $tpl->assign('lang_xoops_version', XOOPS_VERSION);
94  $tpl->assign('lang_php_vesion', PHP_VERSION);
95  $tpl->assign('lang_mysql_version', mysql_get_server_info());
96  $tpl->assign('lang_server_api', PHP_SAPI);
97  $tpl->assign('lang_os_name', PHP_OS);
98  $tpl->assign('safe_mode', ini_get( 'safe_mode' ) ? 'On' : 'Off');
99  $tpl->assign('register_globals', ini_get( 'register_globals' ) ? 'On' : 'Off');
100  $tpl->assign('magic_quotes_gpc', ini_get( 'magic_quotes_gpc' ) ? 'On' : 'Off');
101  $tpl->assign('allow_url_fopen', ini_get( 'allow_url_fopen' ) ? 'On' : 'Off');
102  $tpl->assign('fsockopen', function_exists( 'fsockopen' ) ? 'On' : 'Off');
103  $tpl->assign('allow_call_time_pass_reference', ini_get( 'allow_call_time_pass_reference' ) ? 'On' : 'Off');
104  $tpl->assign('post_max_size', ini_get( 'post_max_size' ));
105  $tpl->assign('max_input_time', ini_get( 'max_input_time' ));
106  $tpl->assign('output_buffering', ini_get( 'output_buffering' ));
107  $tpl->assign('max_execution_time', ini_get( 'max_execution_time' ));
108  $tpl->assign('memory_limit', ini_get( 'memory_limit' ));
109  $tpl->assign('file_uploads', ini_get( 'file_uploads' ) ? 'On' : 'Off');
110  $tpl->assign('upload_max_filesize', ini_get( 'upload_max_filesize' ));
111  $tpl->assign('xoops_sitename', $xoopsConfig['sitename']);
112  //for xoops links
113  $tpl->assign('lang_xoops_xoopsproject', _MD_XOOPSPROJECT);
114  $tpl->assign('lang_xoops_localsupport', _MD_LOCALSUPPORT);
115  $tpl->assign('lang_xoops_xoopscore', _MD_XOOPSCORE);
116  $tpl->assign('lang_xoops_xoopsthems', _MD_XOOPSTHEME);
117  $tpl->assign('lang_xoops_xoopswiki', _MD_XOOPSWIKI);
118  $tpl->assign('lang_xoops_codesvn', _MD_CODESVN);
119  $tpl->assign('lang_xoops_reportbug', _MD_REPORTBUG);
120  $tpl->assign('lang_xoops_movetoblue', _MD_MOVETOBLUE);
121  $tpl->assign('lang_xoops_movetobluelink', _MD_MOVETOBLUE_LINK);
122  // ADD MENU *****************************************
123  //Add CONTROL PANEL Menu items
124  $menu = array();
125  $menu[0]['link'] = XOOPS_URL;
126  $menu[0]['title'] = _YOURHOME;
127  $menu[0]['absolute'] = 1;
128  $menu[1]['link'] = XOOPS_URL . '/admin.php?xoopsorgnews=1';
129  $menu[1]['title'] = 'XOOPS News';
130  $menu[1]['absolute'] = 1;
131  $menu[1]['icon'] = XOOPS_ADMINTHEME_URL . '/zetadigme/img/xoops.png';
132  $menu[2]['link'] = XOOPS_URL . '/user.php?op=logout';
133  $menu[2]['title'] = _LOGOUT;
134  $menu[2]['absolute'] = 1;
135  $menu[2]['icon'] = XOOPS_ADMINTHEME_URL . '/zetadigme/img/logout.png';
136  $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => _CPHOME, 'menu' => $menu));
137  //add SYSTEM Menu items
138  include dirname(__FILE__) . '/menu.php';
139  $system_options = $adminmenu;
140  foreach (array_keys($adminmenu) as $item) {
141  $system_options[$item]['link'] = empty($adminmenu[$item]['absolute']) ? XOOPS_URL . '/modules/system/' . $adminmenu[$item]['link'] : $adminmenu[$item]['link'];
142  $system_options[$item]['icon'] = empty($adminmenu[$item]['icon_small']) ? '' : XOOPS_ADMINTHEME_URL . '/zetadigme/' . $adminmenu[$item]['icon_small'];
143  unset($system_options[$item]['icon_small']);
144  }
145  $tpl->append('navitems', array('link' => XOOPS_URL.'/modules/system/admin.php', 'text' => _AD_SYSOPTIONS, 'menu' => $system_options));
146  if (empty($xoopsModule) || 'system' == $xoopsModule->getVar('dirname', 'n')) {
147  $modpath = XOOPS_URL . '/admin.php';
148  $modname = _AD_SYSOPTIONS;
149  $modid = 1;
150  $moddir = 'system';
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_ADMINTHEME_URL . '/zetadigme/' . $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  $mod_options = $xoopsModule->getAdminMenu();
163  foreach (array_keys($mod_options) as $item) {
164  $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['link'] : $mod_options[$item]['link'];
165  $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['icon'];
166  }
167  }
168  $tpl->assign('mod_options', $mod_options);
169  $tpl->assign('modpath', $modpath);
170  $tpl->assign('modname', $modname);
171  $tpl->assign('modid', $modid);
172  $tpl->assign('moddir', $moddir);
173  // add MODULES Menu items
174  $module_handler =& xoops_gethandler('module');
175  $criteria = new CriteriaCompo();
176  $criteria->add(new Criteria('hasadmin', 1));
177  $criteria->add(new Criteria('isactive', 1));
178  $criteria->setSort('mid');
179  $mods = $module_handler->getObjects($criteria);
180  $menu = array();
181  $moduleperm_handler =& xoops_gethandler('groupperm');
182  foreach ($mods as $mod) {
183  $rtn = array();
184  $modOptions = array(); //add for sub menus
185  $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
186  if ($sadmin) {
187  $info = $mod->getInfo();
188  if (!empty($info['adminindex'])) {
189  $rtn['link'] = XOOPS_URL . '/modules/'. $mod->getVar('dirname', 'n') . '/' . $info['adminindex'];
190  } else {
191  $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $mod->getVar('mid');
192  }
193  $rtn['title'] = $mod->name();
194  $rtn['absolute'] = 1;
195  $rtn['url'] = XOOPS_URL . '/modules/'. $mod->getVar('dirname', 'n') . '/'; //add for sub menus
196  $modOptions = $mod->getAdminMenu(); //add for sub menus
197  $rtn['options'] = $modOptions; //add for sub menus
198 
199  if (isset($info['icon']) && $info['icon'] != '' ) {
200  $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon'];
201  }
202  $menu[] = $rtn;
203  }
204 
205  }
206  $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin',
207  'text' => _AM_SYSTEM_MODULES, 'dir' => $mod->getVar('dirname', 'n'), 'menu' => $menu));
208 
209  // add preferences menu
210  $menu = array();
211  $OPT = array();
212  $OPT[] = array(
213  'link' => 'admin.php?fct=preferences&amp;op=show&amp;confcat_id=1',
214  'title' => _THEME_GENERAL,
215  'absolute' => 1,
216  'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
217  $OPT[] = array(
218  'link' => 'admin.php?fct=preferences&amp;op=show&amp;confcat_id=2',
219  'title' => _THEME_USERSETTINGS,
220  'absolute' => 1,
221  'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
222  $OPT[] = array(
223  'link' => 'admin.php?fct=preferences&amp;op=show&amp;confcat_id=3',
224  'title' => _THEME_METAFOOTER,
225  'absolute' => 1,
226  'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
227  $OPT[] = array(
228  'link' => 'admin.php?fct=preferences&amp;op=show&amp;confcat_id=4',
229  'title' => _THEME_CENSOR,
230  'absolute' => 1,
231  'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
232  $OPT[] = array(
233  'link' => 'admin.php?fct=preferences&amp;op=show&amp;confcat_id=5',
234  'title' => _THEME_SEARCH,
235  'absolute' => 1,
236  'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
237  $OPT[] = array(
238  'link' => 'admin.php?fct=preferences&amp;op=show&amp;confcat_id=6',
239  'title' => _THEME_MAILER,
240  'absolute' => 1,
241  'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
242  $OPT[] = array(
243  'link' => 'admin.php?fct=preferences&amp;op=show&amp;confcat_id=7',
244  'title' => _THEME_AUTHENTICATION,
245  'absolute' => 1,
246  'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
247  $OPT[] = array(
248  'link' => 'admin.php?fct=preferences&amp;op=showmod&amp;mod=1',
249  'title' => _THEME_MODULESETTINGS,
250  'absolute' => 1,
251  'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/prefs_small.png');
252  $menu[] = array(
253  'link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences',
254  'title' => _AD_SYSOPTIONS,
255  'absolute' => 1,
256  'url' => XOOPS_URL . '/modules/system/',
257  'options' => $OPT);
258 
259  foreach ($mods as $mod) {
260  $rtn = array();
261  $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
262  if ($sadmin && ($mod->getVar('hasnotification') || is_array($mod->getInfo('config')) || is_array($mod->getInfo('comments')))) {
263  $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $mod->getVar('mid');
264  $rtn['title'] = $mod->name();
265  $rtn['absolute'] = 1;
266  $menu[] = $rtn;
267  }
268  //$menu[] = $rtn;
269  }
270  $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin', 'text' => _THEME_SITEPREF, 'dir' => $mod->getVar('dirname', 'n'), 'menu' => $menu));
271  //add OPTIONS/Links Menu Items
272  $menu = array();
273  $menu[] = array(
274  'link' => 'http://www.xoops.org',
275  'title' => 'XOOPS',
276  'absolute' => 1,
277  'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/xoops.png');
278  $menu[] = array(
279  'link' => 'http://www.xoops.org/modules/library/',
280  'title' => _AD_XOOPSTHEMES,
281  'absolute' => 1,
282  'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/tweb.png');
283  $menu[] = array(
284  'link' => 'http://www.xoops.org/modules/repository/',
285  'title' => _AD_XOOPSMODULES,
286  'absolute' => 1,
287  'icon' => XOOPS_ADMINTHEME_URL . '/zetadigme/icons/xoops.png');
288  $menu[] = array(
289  'link' => 'http://sourceforge.net/projects/xoops/',
290  'title' => 'Sourceforge',
291  'absolute' => 1);
292  $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php','text' => _AD_INTERESTSITES, 'menu' => $menu));
293  //add OPTIONS/links for local support
294  if (file_exists($file = XOOPS_ADMINTHEME_PATH . '/zetadigme/language/' . $xoopsConfig['language'] . '/localsupport.php' )) {
295  $links = include XOOPS_ADMINTHEME_PATH . '/zetadigme/language/' . $xoopsConfig['language'] . '/localsupport.php';
296  if ( count($links) > 0 ) {
297  $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php','text' => _AD_LOCALSUPPORT, 'menu' => $links));
298  }
299  }
300  if (is_object($xoopsModule) || !empty($_GET['xoopsorgnews'])) { return; }
301  foreach ($mods as $mod) {
302  $rtn = array();
303  $moduleperm_handler =& xoops_gethandler('groupperm');
304  $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
305  if ($sadmin) {
306  $info = $mod->getInfo();
307  if (!empty($info['adminindex'])) {
308  $rtn['link'] = XOOPS_URL . '/modules/'. $mod->getVar('dirname', 'n') . '/' . $info['adminindex'];
309  } else {
310  $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $mod->getVar('mid');
311  }
312  $rtn['title'] = $mod->getVar('name');
313  $rtn ['description'] = $mod->getInfo('description');
314  $rtn['absolute'] = 1;
315  if (isset($info['icon_big'])) {
316  $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon_big'];
317  } elseif (isset($info['image'])) {
318  $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['image'];
319  }
320  }
321  $tpl->append('modules', $rtn);
322  }
323  }
324 }
325 ?>