XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
admin_header.php
Go to the documentation of this file.
1 <?php
21 //include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php';
22 include_once XOOPS_ROOT_PATH.'/mainfile.php';
23 
24 //include_once XOOPS_ROOT_PATH . '/include/cp_functions.php';
25 include("../../../include/cp_header.php");
26 //require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname') . '/include/functions.php';
27 
28 if ( file_exists($GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'))){
29  include_once $GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php');
30  //return true;
31  }else{
32  redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
33  //return false;
34  }
35 
37 
38 $moduleInfo =& $module_handler->get($xoopsModule->getVar('mid'));
39 $pathIcon16 = XOOPS_URL .'/'. $moduleInfo->getInfo('icons16');
40 $pathIcon32 = XOOPS_URL .'/'. $moduleInfo->getInfo('icons32');
41 
42 
43 
44 if ($xoopsUser) {
45  $moduleperm_handler =& xoops_gethandler('groupperm');
46  if (!$moduleperm_handler->checkRight('module_admin', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
47  redirect_header(XOOPS_URL, 1, _NOPERM);
48  exit();
49  }
50 } else {
51  redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM);
52  exit();
53 }
54 
55 if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
56  include_once(XOOPS_ROOT_PATH."/class/template.php");
57  $xoopsTpl = new XoopsTpl();
58 }
59 
60 
61 $xoopsTpl->assign('pathIcon16', $pathIcon16);
62 
63 // Load language files
64 if (!@include_once(XOOPS_TRUST_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/" . $xoopsConfig['language'] . "/admin.php")) {
65  include_once(XOOPS_TRUST_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/english/admin.php");
66 }
67 if (!@include_once(XOOPS_TRUST_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/" . $xoopsConfig['language'] . "/modinfo.php")) {
68  include_once(XOOPS_TRUST_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/english/modinfo.php");
69 }
70 if (!@include_once(XOOPS_TRUST_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/" . $xoopsConfig['language'] . "/main.php")) {
71  include_once(XOOPS_TRUST_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/english/main.php");
72 }