本文整理汇总了PHP中COption::getOptionString方法的典型用法代码示例。如果您正苦于以下问题:PHP COption::getOptionString方法的具体用法?PHP COption::getOptionString怎么用?PHP COption::getOptionString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COption
的用法示例。
在下文中一共展示了COption::getOptionString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDirStructure
public static function getDirStructure($bLogical, $site, $path)
{
global $USER;
$arDirContent = array();
if ($USER->CanDoFileOperation('fm_view_listing', array($site, $path))) {
\Bitrix\Main\Loader::includeModule('fileman');
$arDirs = array();
$arFiles = array();
\CFileMan::GetDirList(array($site, $path), $arDirs, $arFiles, array(), array("NAME" => "asc"), "DF", $bLogical, true);
$arDirContent_t = array_merge($arDirs, $arFiles);
for ($i = 0, $l = count($arDirContent_t); $i < $l; $i++) {
$file = $arDirContent_t[$i];
$arPath = array($site, $file['ABS_PATH']);
if ($file["TYPE"] == "F" && !$USER->CanDoFileOperation('fm_view_file', $arPath) || $file["TYPE"] == "D" && !$USER->CanDoFileOperation('fm_view_listing', $arPath) || $file["TYPE"] == "F" && $file["NAME"] == ".section.php") {
continue;
}
$f = $file['TYPE'] == 'F' ? new \Bitrix\Main\IO\File($file['PATH'], $site) : new \Bitrix\Main\IO\Directory($file['PATH'], $site);
$p = $f->getName();
if ($f->isSystem() || $file['TYPE'] == 'F' && in_array($p, array("urlrewrite.php")) || $file['TYPE'] == 'D' && preg_match("/\\/(bitrix|" . \COption::getOptionString("main", "upload_dir", "upload") . ")\\//", "/" . $p . "/")) {
continue;
}
$arFileData = array('NAME' => $bLogical ? $file['LOGIC_NAME'] : $p, 'FILE' => $p, 'TYPE' => $file['TYPE'], 'DATA' => $file);
if (strlen($arFileData['NAME']) <= 0) {
$arFileData['NAME'] = GetMessage('SEO_DIR_LOGICAL_NO_NAME');
}
$arDirContent[] = $arFileData;
}
unset($arDirContent_t);
}
return $arDirContent;
}
示例2: __construct
function __construct($pCustomOptions = array(), $pChar = "")
{
if(isset($pCustomOptions["action"]))
{
$this->setAction($pCustomOptions["action"]);
}
else
{
$this->setAction(COption::getOptionString("security", "filter_action"));
}
if(isset($pCustomOptions["stop"]))
{
$this->setStop($pCustomOptions["stop"]);
}
else
{
$this->setStop(COption::getOptionString("security", "filter_stop"));
}
if(isset($pCustomOptions["log"]))
{
$this->setLog($pCustomOptions["log"]);
}
else
{
$this->setLog(COption::getOptionString("security", "filter_log"));
}
$this->auditors = array();
$this->auditors["XSS"] = new CSecurityFilterXssAuditor($pChar);
$this->auditors["SQL"] = new CSecurityFilterSqlAuditor($pChar);
$this->auditors["PHP"] = new CSecurityFilterPathAuditor($pChar);
}
示例3: getEntityUrl
/**
* Get url to view entity of storage (ex. user profile, group profile, etc)
* By default: folder list
* @return string
*/
public function getEntityUrl()
{
$groupPage = \COption::getOptionString("socialnetwork", "workgroups_page", false, SITE_ID);
if (!$groupPage) {
$groupPage = SITE_DIR . 'workgroups/';
}
return $groupPage . 'group/' . $this->entityId . '/';
}
示例4: getEntityUrl
/**
* Get url to view entity of storage (ex. user profile, group profile, etc)
* By default: folder list
* @return string
*/
public function getEntityUrl()
{
$userPage = \COption::getOptionString("socialnetwork", "user_page", false, SITE_ID);
if (!$userPage) {
$userPage = SITE_DIR . 'company/personal/';
}
return $userPage . 'user/' . $this->entityId . '/';
}
示例5: getOption
public static function getOption($module_name, $name, $default_value)
{
if (class_exists('\\Bitrix\\Main\\Config\\Option')) {
$result = \Bitrix\Main\Config\Option::get($module_name, $name, $default_value);
} else {
$result = \COption::getOptionString($module_name, $name, $default_value);
}
return $result;
}
示例6: getEntityUrl
/**
* Get name of entity (ex. user last name + first name, group name, etc)
* By default: get title
* @return string
*/
public function getEntityUrl()
{
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
$userPage = \COption::getOptionString("socialnetwork", "user_page", false, CExtranet::getExtranetSiteID());
if (!$userPage) {
$userPage = '/extranet/contacts/personal//';
}
return $userPage . 'user/' . $this->entityId . '/';
}
示例7: getEntityUrl
/**
* Get url to view entity of storage (ex. user profile, group profile, etc)
* By default: folder list
* @return string
*/
public function getEntityUrl()
{
if ($this->getUser()->isExtranetUser()) {
$extranetUser = new ExtranetUser($this->entityId, $this->storage, $this->entityMiscData);
return $extranetUser->getEntityUrl();
}
$userPage = \COption::getOptionString("socialnetwork", "user_page", false, SITE_ID);
if (!$userPage) {
$userPage = SITE_DIR . 'company/personal/';
}
return $userPage . 'user/' . $this->entityId . '/';
}
示例8: __construct
public function __construct($customOptions = array(), $char = "")
{
if (isset($customOptions["stop"])) {
$this->doBlock = $customOptions["stop"];
} else {
$this->doBlock = \COption::getOptionString("security", "filter_stop") === 'Y';
}
$this->requestFilter = new Filter\Request($customOptions);
$this->serverFilter = new Filter\Server($customOptions);
$this->context = \Bitrix\Main\Application::getInstance()->getContext();
$this->splittingChar = $char;
}
示例9: prepareUserData
function prepareUserData($user)
{
$user['DETAIL_URL'] = COption::getOptionString('intranet', 'search_user_url', '/user/#ID#/');
$user['DETAIL_URL'] = str_replace(array('#ID#', '#USER_ID#'), array($user['ID'], $user['ID']), $user['DETAIL_URL']);
$user['PHOTO_THUMB'] = '<img src="/bitrix/components/bitrix/main.user.link/templates/.default/images/nopic_30x30.gif" border="0" alt="" width="32" height="32">';
if (intval($user['PERSONAL_PHOTO']) > 0) {
$imageFile = CFile::getFileArray($user['PERSONAL_PHOTO']);
if ($imageFile !== false) {
$arFileTmp = CFile::resizeImageGet($imageFile, array('width' => 42, 'height' => 42), BX_RESIZE_IMAGE_EXACT, false);
$user['PHOTO_THUMB'] = CFile::showImage($arFileTmp['src'], 32, 32);
}
}
return $user;
}
示例10: isSystem
public function isSystem()
{
$isSystem = false;
if (substr($this->path, 0, strlen($this->documentRoot)) === $this->documentRoot) {
$relativePath = substr($this->path, strlen($this->documentRoot));
$relativePath = ltrim($relativePath, "/");
if (($pos = strpos($relativePath, "/")) !== false) {
$s = substr($relativePath, 0, $pos);
} else {
$s = $relativePath;
}
$s = strtolower(rtrim($s, "."));
$uploadDirName = \COption::getOptionString("main", "upload_dir", "upload");
if (in_array($s, array("bitrix", $uploadDirName))) {
$isSystem = true;
}
}
return $isSystem;
}
示例11: prepareParams
protected function prepareParams()
{
$this->arParams['STORAGE_ID'] = isset($this->arParams['DOCUMENT_ID']) ? intval(str_replace('STORAGE_', '', $this->arParams['DOCUMENT_ID'])) : $this->arParams['STORAGE_ID'];
$this->arParams['SET_TITLE'] = $this->arParams['SET_TITLE'] == 'N' ? 'N' : 'Y';
$this->arParams['NAME_TEMPLATE'] = empty($this->arParams['NAME_TEMPLATE']) ? COption::getOptionString('bizproc', 'name_template', CSite::getNameFormat(false), SITE_ID) : str_replace(array('#NOBR#', '#/NOBR#'), array('', ''), $this->arParams['NAME_TEMPLATE']);
if (!isset($this->arParams['MODULE_ID'])) {
$this->errorCollection->add(array(new Error(Loc::getMessage('BPATT_NO_MODULE_ID'), self::ERROR_COULD_NOT_FIND_MODULE_ID)));
}
if (!isset($this->arParams['STORAGE_ID'])) {
$this->errorCollection->add(array(new Error(Loc::getMessage('BPATT_NO_DOCUMENT_TYPE'), self::ERROR_COULD_NOT_FIND_STORAGE_ID)));
}
if ($this->errorCollection->hasErrors()) {
$error = array_shift($this->getErrors());
throw new ArgumentException($error->getMessage());
}
$this->arParams['DOCUMENT_DATA'] = array('DISK' => array('DOCUMENT_TYPE' => \Bitrix\Disk\BizProcDocument::generateDocumentComplexType($this->arParams['STORAGE_ID'])), 'WEBDAV' => array('DOCUMENT_TYPE' => \Bitrix\Disk\BizProcDocumentCompatible::generateDocumentComplexType($this->arParams['STORAGE_ID'])));
$this->arParams['DOCUMENT_TYPE'] = \Bitrix\Disk\BizProcDocument::generateDocumentType($this->arParams['STORAGE_ID']);
return $this;
}
示例12: initializeSyslogEngine
/**
* @param bool $pActive
*/
private function initializeSyslogEngine($pActive = false)
{
if ($pActive) {
$this->isSyslogEngineActive = true;
if (self::isRunOnWin()) {
$this->syslogFacility = LOG_USER;
} else {
$this->syslogFacility = COption::getOptionString("security", "security_event_syslog_facility");
}
$this->syslogPriority = COption::getOptionString("security", "security_event_syslog_priority");
if (COption::getOptionString("security", "security_event_collect_user_info") == "Y") {
$this->isUserInfoNeeded = true;
} else {
$this->isUserInfoNeeded = false;
}
openlog("Bitrix WAF", LOG_ODELAY, $this->syslogFacility);
} else {
$this->isSyslogEngineActive = false;
}
}
示例13: processActionPerformActionBp
protected function processActionPerformActionBp()
{
if (!Loader::includeModule('bizproc')) {
$this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_MODULE_NOT_INSTALLED'))));
}
$this->checkRequiredPostParams(array('iblockTypeId', 'iblockId', 'sectionId', 'workflowId', 'elementId', 'action'));
if ($this->request->getPost('iblockTypeId') == COption::getOptionString('lists', 'livefeed_iblock_type_id')) {
$this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_UNKNOWN_ERROR'))));
}
if ($this->errorCollection->hasErrors()) {
$this->sendJsonErrorResponse();
}
$this->iblockTypeId = $this->request->getPost('iblockTypeId');
$this->iblockId = $this->request->getPost('iblockId');
$this->sectionId = $this->request->getPost('sectionId');
$workflowId = $this->request->getPost('workflowId');
$elementId = $this->request->getPost('elementId');
$action = $this->request->getPost('action');
$this->documentStates = CBPDocument::getDocumentStates(BizProcDocument::generateDocumentComplexType($this->iblockTypeId, $this->iblockId), BizProcDocument::getDocumentComplexId($this->iblockTypeId, $elementId));
if (isset($this->documentStates[$workflowId]['WORKFLOW_STATUS']) && $this->documentStates[$workflowId]['WORKFLOW_STATUS'] !== null) {
$this->terminateWorkflow($workflowId, $elementId);
}
if ($action == 'delete') {
if (CBPDocument::canUserOperateDocument(CBPCanUserOperateOperation::CreateWorkflow, $this->getUser(), BizProcDocument::getDocumentComplexId($this->iblockTypeId, $elementId), array("DocumentStates" => $this->documentStates))) {
CBPTaskService::DeleteByWorkflow($workflowId);
CBPTrackingService::DeleteByWorkflow($workflowId);
CBPStateService::DeleteWorkflow($workflowId);
} else {
$this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_ACCESS_DENIED'))));
}
if ($this->errorCollection->hasErrors()) {
$this->sendJsonErrorResponse();
}
}
$this->sendJsonSuccessResponse(array('message' => Loc::getMessage('LISTS_LAC_MESSAGE_SUCCESS')));
}
示例14: initializeSyslogEngine
private function initializeSyslogEngine()
{
$this->isSyslogEngineActive = true;
if (self::isRunOnWin()) {
$this->syslogFacility = LOG_USER;
} else {
$this->syslogFacility = COption::getOptionString("security", "security_event_syslog_facility");
}
$this->syslogPriority = COption::getOptionString("security", "security_event_syslog_priority");
openlog("Bitrix WAF", LOG_ODELAY, $this->syslogFacility);
}
示例15: AddMessage
public static function AddMessage($arFields)
{
global $DB;
if (COption::getOptionString('mail', 'disable_log', 'N') == 'Y')
return;
$arFields["~DATE_INSERT"] = $DB->GetNowFunction();
if(array_key_exists('MESSAGE', $arFields))
$arFields['MESSAGE'] = strval(substr($arFields['MESSAGE'], 0, 255));
else
$arFields['MESSAGE'] = '';
return $DB->Add("b_mail_log", $arFields);
}