Server : Apache System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64 User : palandch ( 1163) PHP Version : 7.1.33 Disable Function : NONE Directory : /home/palandch/www/core/model/modx/processors/context/setting/ |
<?php /** * Gets a context setting * * @param string $context_key The key of the context * @param string $key The key of the setting * * @package modx * @subpackage processors.context.setting */ if (!$modx->hasPermission('settings')) return $modx->error->failure($modx->lexicon('permission_denied')); $modx->lexicon->load('setting'); if (!isset($scriptProperties['key'],$scriptProperties['context_key'])) return $modx->error->failure($modx->lexicon('setting_err_ns')); if (!$context = $modx->getObject('modContext', $scriptProperties['context_key'])) return $modx->error->failure($modx->lexicon('setting_err_nf')); if (!$context->checkPolicy('view')) return $modx->error->failure($modx->lexicon('permission_denied')); $setting = $modx->getObject('modContextSetting',array( 'key' => $scriptProperties['key'], 'context_key' => $scriptProperties['context_key'], )); if ($setting == null) return $modx->error->failure($modx->lexicon('setting_err_nf')); return $modx->error->success('',$setting);