Go to the documentation of this file.
8 require_once(
'../inc/header.inc.php' );
12 require_once( CH_DIRECTORY_PATH_INC .
'profiles.inc.php' );
13 require_once( CH_DIRECTORY_PATH_INC .
'design.inc.php' );
14 require_once( CH_DIRECTORY_PATH_INC .
'admin_design.inc.php' );
15 require_once( CH_DIRECTORY_PATH_INC .
'utils.inc.php' );
28 if(isset($_POST[
'save']) && isset($_POST[
'cat'])) {
36 'css_name' => array(
'forms_adv.css',
'settings.css'),
37 'js_name' => array(
'privacy.js'),
38 'header' =>
_t(
'_adm_page_cpt_privacy'),
50 'adm-pvc-btn-defaults' => array(
'href' =>
'javascript:void(0)',
'onclick' =>
'javascript:onChangeType(this)',
'title' =>
_t(
'_adm_txt_pvc_defaults'),
'active' =>
empty(
$aResults) ? 1 : 0),
51 'adm-pvc-btn-settings' => array(
'href' =>
'javascript:void(0)',
'onclick' =>
'javascript:onChangeType(this)',
'title' =>
_t(
'_adm_txt_pvc_settings'),
'active' => isset(
$aResults[
'settings']) ? 1 : 0)
65 if($mixedResult !==
true && !
empty($mixedResult)) {
70 return $GLOBALS[
'oAdmTemplate']->parseHtmlByName(
'privacy_settings.html', array(
71 'display' => $bActive ?
'block' :
'none',
78 $sNamePrefix =
'adm-pvc-action-';
81 'form_attrs' => array(
82 'id' =>
'adm-pvc-defaults',
83 'action' =>
$GLOBALS[
'site'][
'url_admin'] .
'privacy.php',
85 'enctype' =>
'multipart/form-data',
89 'table' =>
'sys_privacy_actions',
93 'submit_name' =>
'adm-pvc-defaults-save'
102 foreach($aGroupIds
as $iGroupId)
103 if(
getParam(
'sys_ps_enabled_group_' . $iGroupId) ==
'on')
104 $aValues[$iGroupId] =
_t(
'_ps_group_' . $iGroupId .
'_title');
107 $aActions =
$GLOBALS[
'MySQL']->getAll(
"SELECT `id` AS `id`, `module_uri` AS `module`, `title` AS `title`, `default_group` AS `default_group` FROM `sys_privacy_actions` WHERE 1 ORDER BY `module_uri` ASC");
108 foreach($aActions
as $aAction) {
109 $sName = $sNamePrefix . $aAction[
'id'];
110 $sValue = $aAction[
'default_group'];
112 if($aAction[
'module'] !=
$sModule) {
115 'type' =>
'block_end'
121 'type' =>
'block_header',
123 'collapsable' =>
true,
128 if(!in_array($sValue, $aGroupIds))
134 'caption' =>
_t($aAction[
'title']),
135 'value' => (
int)$sValue,
136 'values' => $aValues,
144 'type' =>
'block_end'
146 $aForm[
'inputs'][
'adm-pvc-defaults-save'] = array(
148 'name' =>
'adm-pvc-defaults-save',
149 'value' =>
_t(
'_adm_btn_pvc_save'),
156 if(
$oForm->isSubmittedAndValid()) {
158 foreach($aActions
as $aAction) {
159 $sName = $sNamePrefix . $aAction[
'id'];
160 $sValueOld = $aAction[
'default_group'];
162 if(!in_array($sValueOld, $aGroupIds))
166 if($sValueNew ===
false || (
int)$sValueNew == (
int)$sValueOld)
169 $iResult += (int)
$GLOBALS[
'MySQL']->query(
"UPDATE `sys_privacy_actions` SET `default_group`='" . (
int)$sValueNew .
"' WHERE `id`='" . $aAction[
'id'] .
"'");
173 $sResult .=
MsgBox(
_t($iResult > 0 ?
"_adm_txt_pvc_success_save" :
"_adm_txt_pvc_nothing_changed"), 3);
177 return $GLOBALS[
'oAdmTemplate']->parseHtmlByName(
'privacy_defaults.html', array(
178 'display' => $bActive ?
'block' :
'none',
MsgBox($sText, $iTimer=0)
_getSettings($mixedResult, $bActive=false)
ch_import($sClassName, $aModule=array())
if(!file_exists($sRayHeaderPath)) $sModule
_getDefaults($mixedResult, $bActive=false)
DesignBoxAdmin($sTitle, $sContent, $mixedTopItems='', $sBottomItems='', $iIndex=1)
if(isset($_POST['save']) &&isset($_POST['cat'])) $iNameIndex
getParam($sParamName, $bUseCache=true)
PageCodeAdmin($oTemplate=null)
_t($key, $arg0="", $arg1="", $arg2="")
member_auth($member=0, $error_handle=true, $bAjx=false)
Attr AllowedRel this is empty