Cheetah
explanation.php
Go to the documentation of this file.
1 <?php
2 
8 require_once( 'inc/header.inc.php' );
9 require_once( CH_DIRECTORY_PATH_INC . 'design.inc.php' );
10 require_once( CH_DIRECTORY_PATH_INC . 'profiles.inc.php' );
11 
12 // --------------- page variables and login
13 
14 check_logged();
15 
16 $_page['header'] = $_page['header_text'] = _t( "_EXPLANATION_H" ) . ": " . htmlspecialchars_adv(_t("_" . $_GET['explain']));
17 $_page['css_name'] = 'explanation.css';
18 
20 
21 if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
22  header('Content-type:text/html;charset=utf-8');
23  echo $GLOBALS['oFunctions']->popupBox('explanation_popup', $_page['header'], $sCode);
24  exit;
25 }
26 
27 // --------------- page components
28 
29 $_page['name_index'] = 44;
30 $_ni = $_page['name_index'];
31 $_page_cont[$_ni]['page_main_code'] = DesignBoxContent($_page['header_text'], PageMainCode(), $oTemplConfig -> PageExplanation_db_num);
32 
33 // --------------- [END] page components
34 
35 PageCode();
36 
37 // --------------- page components functions
38 
39 function membershipActionsList($membershipID)
40 {
41  $sNoLimit = _t('_no limit');
42  $sqlFields = '';
43  $aFields = array('AllowedCount', 'AllowedPeriodLen', 'AllowedPeriodStart', 'AllowedPeriodEnd');
44  foreach ($aFields as $sField)
45  $sqlFields .= ",IFNULL(`$sField`, '$sNoLimit') as `$sField`";
46  $sqlQuery = "
47  SELECT `IDAction`, `Name` $sqlFields
48  FROM `sys_acl_matrix`
49  INNER JOIN `sys_acl_actions` ON `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID`
50  WHERE `sys_acl_matrix`.`IDLevel` = ?";
51  $aDraw['ch_repeat:actions'] = $GLOBALS['MySQL']->getAll($sqlQuery, [$membershipID]);
52 
53  translateMembershipActions($aDraw['ch_repeat:actions']);
54 
55  return $GLOBALS['oSysTemplate']->parseHtmlByName('memlevel_actions_list.html', $aDraw);
56 }
57 
61 function PageMainCode()
62 {
63  $sCode = '';
64  switch ( $_GET['explain'] ) {
65  case 'Unconfirmed': $sCode = _t("_ATT_UNCONFIRMED_E"); break;
66  case 'Approval': $sCode = _t("_ATT_APPROVAL_E"); break;
67  case 'Active': $sCode = _t("_ATT_ACTIVE_E"); break;
68  case 'Rejected': $sCode = _t("_ATT_REJECTED_E"); break;
69  case 'Suspended': $sCode = _t("_ATT_SUSPENDED_E", $GLOBALS['site']['title']); break;
70  case 'membership': $sCode = membershipActionsList((int)$_GET['type']); break;
71  }
72 
73  return $GLOBALS['oSysTemplate']->parseHtmlByName('default_padding.html', array('content' => $sCode));
74 }
header
</code > Be careful enabling this directive if you have a redirector script that does not use the< code > Location</code > HTTP header
Definition: URI.MungeResources.txt:10
check_logged
check_logged()
Definition: admin.inc.php:238
translateMembershipActions
translateMembershipActions(&$aActions)
Definition: membership_levels.inc.php:766
$sCode
$sCode
Definition: explanation.php:19
$_ni
$_ni
Definition: explanation.php:30
$_page
$_page['header']
Definition: explanation.php:16
membershipActionsList
membershipActionsList($membershipID)
Definition: explanation.php:39
$_page_cont
$_page_cont[$_ni]['page_main_code']
Definition: explanation.php:31
php
exit
exit
Definition: cart.php:21
$_GET
$_GET['debug']
Definition: index.php:67
$aFields
$aFields
Definition: preValues.php:19
htmlspecialchars_adv
htmlspecialchars_adv($string)
Definition: utils.inc.php:302
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
PageCode
PageCode($oTemplate=null)
Definition: design.inc.php:91
PageMainCode
PageMainCode()
Definition: explanation.php:61
DesignBoxContent
DesignBoxContent($title, $content, $db_num=0, $caption_item='', $bottom_item='')
Definition: design.inc.php:78
$oTemplConfig
$oTemplConfig
Definition: params.inc.php:90
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
$GLOBALS
$GLOBALS['iAdminPage']
Definition: advanced_settings.php:10