XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
cp_header.php
Go to the documentation of this file.
1 <?php
23 $xoopsOption['pagetype'] = 'admin';
24 include_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'mainfile.php';
25 include_once $GLOBALS['xoops']->path('include/cp_functions.php');
26 
28 if ($xoopsUser) {
29  $url_arr = explode('/', strstr($_SERVER['REQUEST_URI'], '/modules/'));
30  $module_handler =& xoops_gethandler('module');
31  $xoopsModule =& $module_handler->getByDirname($url_arr[2]);
32  unset($url_arr);
33  if (!$moduleperm_handler->checkRight('module_admin', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
34  redirect_header(XOOPS_URL, 1, _NOPERM);
35  exit();
36  }
37 } else {
38  redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
39  exit();
40 }
41 
42 // set config values for this module
43 if ($xoopsModule->getVar('hasconfig') == 1 || $xoopsModule->getVar('hascomments') == 1) {
44  $config_handler =& xoops_gethandler('config');
45  $xoopsModuleConfig = $config_handler->getConfigsByCat(0, $xoopsModule->getVar('mid'));
46 }
47 
48 // include the default language file for the admin interface
49 if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/admin.php'))) {
50  include_once $file;
51 } else if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname') . '/language/english/admin.php'))) {
52  include_once $file;
53 }
54 // I will disable this because module developer should nod be forced to have a admin.php
55 // xoops_loadLanguage('admin', $xoopsModule->getVar('dirname'));
56 ?>