本文整理汇总了PHP中COption类的典型用法代码示例。如果您正苦于以下问题:PHP COption类的具体用法?PHP COption怎么用?PHP COption使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了COption类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: GetModuleConnection
public static function GetModuleConnection($module_id, $bModuleInclude = false)
{
$node_id = COption::GetOptionString($module_id, "dbnode_id", "N");
if (is_numeric($node_id)) {
if ($bModuleInclude) {
$status = COption::GetOptionString($module_id, "dbnode_status", "ok");
if ($status === "move") {
return false;
}
}
$moduleDB = CDatabase::GetDBNodeConnection($node_id, $bModuleInclude);
if (is_object($moduleDB)) {
$moduleDB->bModuleConnection = true;
return $moduleDB;
}
//There was an connection error
if ($bModuleInclude && CModule::IncludeModule('cluster')) {
CClusterDBNode::SetOffline($node_id);
}
//TODO: unclear what to return when node went offline
//in the middle of the hit.
return false;
} else {
return $GLOBALS["DB"];
}
}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:26,代码来源:database.php
示例2: CSeoPageChecker
function CSeoPageChecker($site, $url, $get = true, $check_errors = true)
{
global $APPLICATION;
if (CModule::IncludeModule('search')) {
$this->bSearch = true;
} else {
$APPLICATION->ThrowException(GetMessage('SEO_ERROR_NO_SEARCH'));
}
// don't return false or set bError!
$this->__bCheckErrors = $check_errors;
$this->__site = $site;
$dbRes = CSite::GetByID($this->__site);
if ($arRes = $dbRes->Fetch()) {
$this->__lang = $arRes['LANGUAGE_ID'];
$this->__server_name = $arRes['SERVER_NAME'];
if (strlen($this->__server_name) <= 0) {
$this->__server_name = COption::GetOptionString('main', 'server_name', '');
}
if (strlen($this->__server_name) > 0) {
$this->__url = 'http://' . $this->__server_name . $url;
return $get ? $this->GetHTTPData() : true;
} else {
$this->bError = true;
$APPLICATION->ThrowException(str_replace('#SITE_ID#', $this->__site, GetMessage('SEO_ERROR_NO_SERVER_NAME')));
return false;
}
}
return false;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:29,代码来源:seo_page_checker.php
示例3: GetPHPFilesMark
public static function GetPHPFilesMark()
{
$res = array();
$file_name = $_SERVER["DOCUMENT_ROOT"] . "/" . COption::GetOptionString("main", "upload_dir", "/upload/") . "/perfmon#i#.php";
$content = "<?\$s='" . str_repeat("x", 1024) . "';?><?/*" . str_repeat("y", 1024) . "*/?><?\$r='" . str_repeat("z", 1024) . "';?>";
for ($j = 0; $j < 4; $j++) {
$s1 = getmicrotime();
for ($i = 0; $i < 100; $i++) {
$fn = str_replace("#i#", $i, $file_name);
}
$e1 = getmicrotime();
$N1 = $e1 - $s1;
$s2 = getmicrotime();
for ($i = 0; $i < 100; $i++) {
//This is one op
$fn = str_replace("#i#", $i, $file_name);
$fh = fopen($fn, "wb");
fwrite($fh, $content);
fclose($fh);
include $fn;
unlink($fn);
}
$e2 = getmicrotime();
$N2 = $e2 - $s2;
if ($N2 > $N1) {
$res[] = 100 / ($N2 - $N1);
}
}
if (count($res)) {
return array_sum($res) / doubleval(count($res));
} else {
return 0;
}
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:34,代码来源:measure.php
示例4: Show
public static function Show()
{
IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/interface/prolog_main_admin.php');
$supportFinishDate = COption::GetOptionString('main', '~support_finish_date', '');
if ($supportFinishDate != '' && is_array($aSupportFinishDate = ParseDate($supportFinishDate, 'ymd'))) {
$aGlobalOpt = CUserOptions::GetOption("global", "settings", array());
if ($aGlobalOpt['messages']['support'] != 'N') {
$supportFinishStamp = mktime(0, 0, 0, $aSupportFinishDate[1], $aSupportFinishDate[0], $aSupportFinishDate[2]);
$supportDateDiff = ceil(($supportFinishStamp - time()) / 86400);
$sSupportMess = '';
$sSupWIT = " (<span onclick=\"BX.toggle(BX('supdescr'))\" style='border-bottom: 1px dashed #1c91e7; color: #1c91e7; cursor: pointer;'>" . GetMessage("prolog_main_support_wit") . "</span>)";
if ($supportDateDiff >= 0 && $supportDateDiff <= 30) {
$sSupportMess = GetMessage("prolog_main_support11", array('#FINISH_DATE#' => GetTime($supportFinishStamp), '#DAYS_AGO#' => $supportDateDiff == 0 ? GetMessage("prolog_main_today") : GetMessage('prolog_main_support_days', array('#N_DAYS_AGO#' => $supportDateDiff)), '#LICENSE_KEY#' => md5(LICENSE_KEY), '#WHAT_IS_IT#' => $sSupWIT, '#SUP_FINISH_DATE#' => GetTime(mktime(0, 0, 0, $aSupportFinishDate[1] + 1, $aSupportFinishDate[0], $aSupportFinishDate[2]))));
} elseif ($supportDateDiff < 0 && $supportDateDiff >= -30) {
$sSupportMess = GetMessage("prolog_main_support21", array('#FINISH_DATE#' => GetTime($supportFinishStamp), '#DAYS_AGO#' => -$supportDateDiff, '#LICENSE_KEY#' => md5(LICENSE_KEY), '#WHAT_IS_IT#' => $sSupWIT, '#SUP_FINISH_DATE#' => GetTime(mktime(0, 0, 0, $aSupportFinishDate[1] + 1, $aSupportFinishDate[0], $aSupportFinishDate[2]))));
} elseif ($supportDateDiff < -30) {
$sSupportMess = GetMessage("prolog_main_support31", array('#FINISH_DATE#' => GetTime($supportFinishStamp), '#LICENSE_KEY#' => md5(LICENSE_KEY), '#WHAT_IS_IT#' => $sSupWIT));
}
if ($sSupportMess != '') {
$sSupportMess .= GetMessage('ACRIT_EXPORTPRO_BUY_LICENCE');
$userOption = CUserOptions::GetOption("main", "admSupInf");
if (mktime() > $userOption["showInformerDate"]) {
$prolongUrl = "/bitrix/admin/buy_support.php?lang=" . LANGUAGE_ID;
if (!in_array(LANGUAGE_ID, array("ru", "ua")) || IntVal(COption::GetOptionString("main", "~PARAM_PARTNER_ID")) <= 0) {
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/update_client.php";
$prolongUrl = "http://www.acrit-studio.ru/shop/list/lupd/";
}
echo BeginNote('style="position: relative; top: -15px;"');
?>
<div style="float: right; padding-left: 50px; margin-top: -5px; text-align: center;">
<a href="<?php
echo $prolongUrl;
?>
" target="_blank" class="adm-btn adm-btn-save" style="margin-bottom: 4px;"><?php
echo GetMessage("prolog_main_support_button_prolong");
?>
</a><br />
<a href="http://www.acrit-studio.ru/market/" target="_blank"><?php
echo GetMessage("prolog_main_support_button_prolong_modules");
?>
</a>
</div>
<?php
echo $sSupportMess;
?>
<div id="supdescr" style="display: none;"><br /><br /><b><?php
echo GetMessage("prolog_main_support_wit_descr1");
?>
</b><hr><?php
echo GetMessage("prolog_main_support_wit_descr2");
?>
</div>
<?php
echo EndNote();
}
}
}
}
}
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:60,代码来源:licence.php
示例5: Authorize
public function Authorize()
{
global $APPLICATION;
$APPLICATION->RestartBuffer();
if (isset($_REQUEST["code"]) && $_REQUEST["code"] != '' && CSocServAuthManager::CheckUniqueKey()) {
$redirect_uri = CSocServUtil::ServerName() . '/bitrix/tools/oauth/bitrix24.php';
$userId = intval($_REQUEST['uid']);
$appID = trim(COption::GetOptionString("socialservices", "bitrix24_gadget_appid", ''));
$appSecret = trim(COption::GetOptionString("socialservices", "bitrix24_gadget_appsecret", ''));
$portalURI = $_REQUEST['domain'];
if (strpos($portalURI, "http://") === false && strpos($portalURI, "https://") === false) {
$portalURI = "https://" . $portalURI;
}
$gAuth = new CBitrixOAuthInterface($appID, $appSecret, $portalURI, $_REQUEST["code"]);
$this->entityOAuth = $gAuth;
$gAuth->addScope(explode(',', $_REQUEST["scope"]));
if ($gAuth->GetAccessToken($redirect_uri) !== false) {
$gAuth->saveDataDB();
}
}
$url = CSocServUtil::ServerName() . BX_ROOT;
$mode = 'opener';
$url = CUtil::JSEscape($url);
$location = $mode == "opener" ? 'if(window.opener) window.opener.location = \'' . $url . '\'; window.close();' : ' window.location = \'' . $url . '\';';
$JSScript = '
<script type="text/javascript">
' . $location . '
</script>
';
echo $JSScript;
die;
}
开发者ID:webgksupport,项目名称:alpina,代码行数:32,代码来源:bitrix24.php
示例6: __construct
public function __construct($docRoot)
{
foreach ($this->arParams as $key => $value) {
$paramValue = \COption::GetOptionString(self::$MODULE_NAME, $key);
if (!$paramValue) {
$this->errors .= \Helper::boldColorText("Not value for {$key}", "red");
} elseif ($value == "dir") {
$this->arParams[$key] = $docRoot . $paramValue;
if ($key != 'LOG_FILE') {
if (!is_dir($this->arParams[$key])) {
if (!mkdir($this->arParams[$key])) {
$this->errors .= \Helper::boldColorText("Dir {$this->arParams[$key]} is absent", "red");
}
}
}
} else {
$this->arParams[$key] = $paramValue;
}
}
if (!empty($this->errors)) {
$logFile = $this->arParams['LOG_FILE'];
if ($logFile == 'dir') {
$logFile = $docRoot . '/local/logs/lot_info';
}
file_put_contents($this->errors, $logFile, FILE_APPEND);
throw new \Exception($this->errors);
}
}
开发者ID:HannibalLecktor,项目名称:alfa74,代码行数:28,代码来源:data.php
示例7: AddBlogPost
public static function AddBlogPost($arFields)
{
if (!is_array($_POST)) {
$_POST = array();
}
$_POST = array_merge($_POST, array("apply" => "Y", "decode" => "N"), $arFields);
$strPathToPost = COption::GetOptionString("socialnetwork", "userblogpost_page", false, SITE_ID);
$strPathToSmile = COption::GetOptionString("socialnetwork", "smile_page", false, SITE_ID);
$BlogGroupID = COption::GetOptionString("socialnetwork", "userbloggroup_id", false, SITE_ID);
$arBlogComponentParams = array("IS_REST" => "Y", "ID" => "new", "PATH_TO_POST" => $strPathToPost, "PATH_TO_SMILE" => $strPathToSmile, "GROUP_ID" => $BlogGroupID, "USER_ID" => $GLOBALS["USER"]->GetID(), "USE_SOCNET" => "Y", "MICROBLOG" => "Y");
ob_start();
$result = $GLOBALS["APPLICATION"]->IncludeComponent("bitrix:socialnetwork.blog.post.edit", "", $arBlogComponentParams, false, array("HIDE_ICONS" => "Y"));
ob_end_clean();
if (!$result) {
throw new Exception('Error');
} else {
if (isset($arFields["FILES"]) && \Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk') && ($storage = \Bitrix\Disk\Driver::getInstance()->getStorageByUserId($GLOBALS["USER"]->GetID())) && ($folder = $storage->getFolderForUploadedFiles($GLOBALS["USER"]->GetID()))) {
// upload to storage
$arResultFile = array();
foreach ($arFields["FILES"] as $tmp) {
$arFile = CRestUtil::saveFile($tmp);
if (is_array($arFile)) {
$file = $folder->uploadFile($arFile, array('NAME' => $arFile["name"], 'CREATED_BY' => $GLOBALS["USER"]->GetID()), array(), true);
if ($file) {
$arResultFile[] = \Bitrix\Disk\Uf\FileUserType::NEW_FILE_PREFIX . $file->getId();
}
}
}
if (!empty($arResultFile)) {
CBlogPost::Update($result, array("HAS_PROPS" => "Y", "UF_BLOG_POST_FILE" => $arResultFile));
}
}
return $result;
}
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:35,代码来源:rest.php
示例8: checkAccountNumberValue
function checkAccountNumberValue($templateType, $number_data, $number_prefix)
{
$res = true;
switch ($templateType)
{
case 'NUMBER':
if (strlen($number_data) <= 0
|| strlen($number_data) > 7
|| !ctype_digit($number_data)
|| intval($number_data) < intval(COption::GetOptionString("sale", "account_number_data", ""))
)
$res = false;
break;
case 'PREFIX':
if (strlen($number_prefix) <= 0
|| strlen($number_prefix) > 7
|| preg_match('/[^a-zA-Z0-9_-]/', $number_prefix)
)
$res = false;
break;
}
return $res;
}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:30,代码来源:options.php
示例9: CWebDavVirtual
function CWebDavVirtual($arStructure, $base_url, $arParams = array())
{
$arParams = is_array($arParams) ? $arParams : array();
$this->CWebDavBase($base_url);
$this->arStructure = $arStructure;
$this->permission = $this->permission_real;
if ($this->permission_real >= "W") {
$this->check_creator = false;
}
$this->USER["GROUPS"] = $GLOBALS["USER"]->GetUserGroupArray();
$this->workflow = false;
if (!isset($arParams["CACHE_TIME"])) {
$arParams["CACHE_TIME"] = 3600;
}
if ($arParams["CACHE_TYPE"] == "Y" || $arParams["CACHE_TYPE"] == "A" && COption::GetOptionString("main", "component_cache_on", "Y") == "Y") {
$arParams["CACHE_TIME"] = intval($arParams["CACHE_TIME"]);
} else {
$arParams["CACHE_TIME"] = 0;
}
$this->CACHE_TIME = $arParams["CACHE_TIME"] = 0;
$cache_hash = md5(serialize($arStructure));
$this->CACHE_PATH = str_replace(array("///", "//"), "/", "/" . SITE_ID . "/webdav/" . $cache_hash . "/");
$this->CACHE_OBJ = false;
if ($this->CACHE_TIME > 0) {
$this->CACHE_OBJ = new CPHPCache();
}
if (!$this->SetRootSection($arParams["ROOT_SECTION_ID"])) {
$this->arError[] = array("id" => "root_section_is_not_found", "text" => GetMessage("WD_ROOT_SECTION_NOT_FOUND"));
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:30,代码来源:virtual.php
示例10: DoUninstall
public function DoUninstall()
{
COption::RemoveOption('imageimport');
DeleteDirFiles($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/imageimport/install/admin', $_SERVER['DOCUMENT_ROOT'] . '/bitrix/admin');
UnRegisterModule('imageimport');
return true;
}
开发者ID:ASDAFF,项目名称:bx_imageimport,代码行数:7,代码来源:index.php
示例11: GetAbsoluteRoot
public static function GetAbsoluteRoot()
{
if(defined('FX_TEMPORARY_FILES_DIRECTORY'))
return FX_TEMPORARY_FILES_DIRECTORY;
else
return $_SERVER["DOCUMENT_ROOT"]."/".(COption::GetOptionString("main", "upload_dir", "upload"))."/tmp";
}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:7,代码来源:file_temp.php
示例12: InstallDB
function InstallDB($install_wizard = true)
{
global $DB, $DBType, $APPLICATION;
$arCurPhpVer = Explode(".", PhpVersion());
if (IntVal($arCurPhpVer[0]) < 5) {
return true;
}
$errors = null;
if (!$DB->Query("SELECT 'x' FROM b_bp_workflow_instance", true)) {
$errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/bizproc/install/db/" . $DBType . "/install.sql");
}
if (!empty($errors)) {
$APPLICATION->ThrowException(implode("", $errors));
return false;
}
RegisterModule("bizproc");
RegisterModuleDependences("iblock", "OnAfterIBlockElementDelete", "bizproc", "CBPVirtualDocument", "OnAfterIBlockElementDelete");
RegisterModuleDependences("main", "OnAdminInformerInsertItems", "bizproc", "CBPAllTaskService", "OnAdminInformerInsertItems");
RegisterModuleDependences('rest', 'OnRestServiceBuildDescription', 'bizproc', '\\Bitrix\\Bizproc\\RestService', 'onRestServiceBuildDescription');
RegisterModuleDependences('rest', 'OnRestAppDelete', 'bizproc', '\\Bitrix\\Bizproc\\RestService', 'onRestAppDelete');
RegisterModuleDependences('rest', 'OnRestAppUpdate', 'bizproc', '\\Bitrix\\Bizproc\\RestService', 'onRestAppUpdate');
RegisterModuleDependences('timeman', 'OnAfterTMDayStart', 'bizproc', 'CBPDocument', 'onAfterTMDayStart');
COption::SetOptionString("bizproc", "SkipNonPublicCustomTypes", "Y");
return true;
}
开发者ID:Satariall,项目名称:izurit,代码行数:25,代码来源:index.php
示例13: CalcUserBonus
function CalcUserBonus($arConfigs)
{
global $DB;
$err_mess = (CRatings::err_mess())."<br>Function: CalcUserBonus<br>Line: ";
$communityLastVisit = COption::GetOptionString("main", "rating_community_last_visit", '90');
CRatings::AddComponentResults($arConfigs);
$strSql = "DELETE FROM b_rating_component_results WHERE RATING_ID = '".IntVal($arConfigs['RATING_ID'])."' AND COMPLEX_NAME = '".$DB->ForSql($arConfigs['COMPLEX_NAME'])."'";
$res = $DB->Query($strSql, false, $err_mess.__LINE__);
$strSql = "INSERT INTO b_rating_component_results (RATING_ID, MODULE_ID, RATING_TYPE, NAME, COMPLEX_NAME, ENTITY_ID, ENTITY_TYPE_ID, CURRENT_VALUE)
SELECT
'".IntVal($arConfigs['RATING_ID'])."' RATING_ID,
'".$DB->ForSql($arConfigs['MODULE_ID'])."' MODULE_ID,
'".$DB->ForSql($arConfigs['RATING_TYPE'])."' RATING_TYPE,
'".$DB->ForSql($arConfigs['NAME'])."' NAME,
'".$DB->ForSql($arConfigs['COMPLEX_NAME'])."' COMPLEX_NAME,
RB.ENTITY_ID as ENTITY_ID,
'".$DB->ForSql($arConfigs['ENTITY_ID'])."' ENTITY_TYPE_ID,
RB.BONUS*".floatval($arConfigs['CONFIG']['COEFFICIENT'])." CURRENT_VALUE
FROM
b_rating_user RB
LEFT JOIN b_user U ON U.ID = RB.ENTITY_ID AND U.ACTIVE = 'Y' AND U.LAST_LOGIN > DATE_SUB(NOW(), INTERVAL ".intval($communityLastVisit)." DAY)
WHERE
RB.RATING_ID = ".IntVal($arConfigs['RATING_ID'])."
AND U.ID IS NOT NULL
";
$res = $DB->Query($strSql, false, $err_mess.__LINE__);
return true;
}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:34,代码来源:ratings_components.php
示例14: OnModuleInstalledEvent
function OnModuleInstalledEvent($id, $installed, $Module)
{
foreach (GetModuleEvents("main", "OnModuleInstalled", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($id, $installed));
}
$cModules = COption::GetOptionString("main", "mp_modules_date", "");
$arModules = array();
if (strlen($cModules) > 0) {
$arModules = unserialize($cModules);
}
if ($installed == "Y") {
$arModules[] = array("ID" => $id, "NAME" => htmlspecialcharsbx($Module->MODULE_NAME), "TMS" => time());
if (count($arModules) > 3) {
$arModules = array_slice($arModules, -3);
}
COption::SetOptionString("main", "mp_modules_date", serialize($arModules));
} else {
foreach ($arModules as $arid => $val) {
if ($val["ID"] == $id) {
unset($arModules[$arid]);
}
}
if (count($arModules) > 0) {
COption::SetOptionString("main", "mp_modules_date", serialize($arModules));
} else {
COption::RemoveOption("main", "mp_modules_date");
}
$_SESSION["MP_MOD_DELETED"] = array("ID" => $id, "NAME" => $Module->MODULE_NAME);
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:30,代码来源:partner_modules.php
示例15: UnInstallDB
function UnInstallDB($arParams = array())
{
global $DB, $DBType, $APPLICATION;
$this->errors = false;
UnRegisterModuleDependences("main", "OnPageStart", "security", "CSecurityIPRule", "OnPageStart");
UnRegisterModuleDependences("main", "OnBeforeProlog", "security", "CSecurityFilter", "OnBeforeProlog");
UnRegisterModuleDependences("main", "OnEndBufferContent", "security", "CSecurityXSSDetect", "OnEndBufferContent");
UnRegisterModuleDependences("main", "OnBeforeUserLogin", "security", "CSecurityUser", "OnBeforeUserLogin");
UnRegisterModuleDependences("main", "OnUserDelete", "security", "CSecurityUser", "OnUserDelete");
UnRegisterModuleDependences("main", "OnEventLogGetAuditTypes", "security", "CSecurityFilter", "GetAuditTypes");
UnRegisterModuleDependences("main", "OnEventLogGetAuditTypes", "security", "CSecurityAntiVirus", "GetAuditTypes");
UnRegisterModuleDependences("main", "OnBeforeLocalRedirect", "security", "CSecurityRedirect", "BeforeLocalRedirect");
UnRegisterModuleDependences("main", "OnEndBufferContent", "security", "CSecurityRedirect", "EndBufferContent");
UnRegisterModuleDependences("main", "OnAdminInformerInsertItems", "security", "CSecurityFilter", "OnAdminInformerInsertItems");
UnRegisterModuleDependences("main", "OnAdminInformerInsertItems", "security", "CSecuritySiteChecker", "OnAdminInformerInsertItems");
COption::SetOptionString("main", "session_id_ttl", "60");
COption::SetOptionString("main", "use_session_id_ttl", "N");
COption::SetOptionInt("main", "session_id_ttl", 60);
COption::SetOptionString("security", "session", "N");
if (!array_key_exists("save_tables", $arParams) || $arParams["save_tables"] != "Y") {
$this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/security/install/db/" . strtolower($DB->type) . "/uninstall.sql");
$this->UnInstallTasks();
}
UnRegisterModule("security");
if ($this->errors !== false) {
$APPLICATION->ThrowException(implode("<br>", $this->errors));
return false;
}
return true;
}
开发者ID:spas-viktor,项目名称:books,代码行数:30,代码来源:index.php
示例16: onPrepareComponentParams
public function onPrepareComponentParams($params)
{
$this->arIBlock = CIBlock::GetArrayByID($params["IBLOCK_ID"]);
$this->arResult["IBLOCK"] = htmlspecialcharsex($this->arIBlock);
$this->arResult["IBLOCK_ID"] = $this->arIBlock["ID"];
$this->arResult["GRID_ID"] = "lists_list_elements_" . $this->arResult["IBLOCK_ID"];
$this->arResult["ANY_SECTION"] = isset($_GET["list_section_id"]) && strlen($_GET["list_section_id"]) == 0;
$this->arResult["SECTIONS"] = array();
$this->arResult["SECTION_ID"] = false;
$this->arResult["LIST_SECTIONS"] = array();
if (isset($_GET["list_section_id"])) {
$sectionId = intval($_GET["list_section_id"]);
} else {
$sectionId = intval($params["SECTION_ID"]);
}
$rsSections = CIBlockSection::GetList(array("left_margin" => "asc"), array("IBLOCK_ID" => $this->arIBlock["ID"], "GLOBAL_ACTIVE" => "Y", "CHECK_PERMISSIONS" => "Y"));
while ($arSection = $rsSections->GetNext()) {
$this->arResult["SECTIONS"][$arSection["ID"]] = array("ID" => $arSection["ID"], "NAME" => $arSection["NAME"]);
if ($arSection["ID"] == $sectionId) {
$this->arResult["SECTION"] = $arSection;
$this->arResult["SECTION_ID"] = $arSection["ID"];
}
$this->arResult["LIST_SECTIONS"][$arSection["ID"]] = str_repeat(" . ", $arSection["DEPTH_LEVEL"]) . $arSection["NAME"];
}
$this->arResult["IS_SOCNET_GROUP_CLOSED"] = false;
if (intval($params["~SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule("socialnetwork")) {
$arSonetGroup = CSocNetGroup::GetByID(intval($params["~SOCNET_GROUP_ID"]));
if (is_array($arSonetGroup) && $arSonetGroup["CLOSED"] == "Y" && !CSocNetUser::IsCurrentUserModuleAdmin() && ($arSonetGroup["OWNER_ID"] != $GLOBALS["USER"]->GetID() || COption::GetOptionString("socialnetwork", "work_with_closed_groups", "N") != "Y")) {
$this->arResult["IS_SOCNET_GROUP_CLOSED"] = true;
}
}
return $params;
}
开发者ID:Satariall,项目名称:izurit,代码行数:33,代码来源:class.php
示例17: InitializeTemplate
function InitializeTemplate($arParams, $arResult)
{
$this->WEB_FORM_ID = $arParams["WEB_FORM_ID"];
$this->RESULT_ID = $arParams["RESULT_ID"];
$this->arParams = $arParams;
$this->arForm = $arResult["arForm"];
$this->arQuestions = $arResult["arQuestions"];
$this->arAnswers = $arResult["arAnswers"];
$this->arDropDown = $arResult["arDropDown"];
$this->arMultiSelect = $arResult["arMultiSelect"];
$this->arrVALUES = $arResult["arrVALUES"];
$this->F_RIGHT = $arResult["F_RIGHT"];
if ($this->RESULT_ID) {
if ($this->isAccessFormResult($arResult['arResultData'])) {
$this->arrRESULT_PERMISSION = CFormResult::GetPermissions($this->RESULT_ID, $v);
$this->arResult = $arResult['arResultData'];
}
}
$this->strFormNote = $arResult["FORM_NOTE"];
$this->__form_validate_errors = $arResult["FORM_ERRORS"];
$this->bIsFormValidateErrors = $arResult['isFormErrors'] == 'Y';
$this->bSimple = COption::GetOptionString("form", "SIMPLE", "Y") == "Y" ? true : false;
$this->WEB_FORM_NAME = $arResult["arForm"]["SID"];
if ($this->arForm["USE_CAPTCHA"] == "Y") {
$this->CAPTCHACode = $arResult["CAPTCHACode"];
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:27,代码来源:form_callformoutput.php
示例18: AddByChannel
public static function AddByChannel($channelId, $arParams = array())
{
global $DB;
if (!is_array($channelId)) {
$channelId = array($channelId);
}
$result = false;
if (strlen($arParams['module_id']) > 0 || strlen($arParams['command']) > 0) {
$arData = array('module_id' => $arParams['module_id'], 'command' => $arParams['command'], 'params' => is_array($arParams['params']) ? $arParams['params'] : array());
if (CPullOptions::GetQueueServerStatus()) {
$command = array('SERVER_TIME_WEB' => time(), 'SERVER_NAME' => COption::GetOptionString('main', 'server_name', $_SERVER['SERVER_NAME']), 'MESSAGE' => array($arData), 'ERROR' => '');
if (!is_array($channelId) && CPullOptions::GetQueueServerVersion() == 1) {
$command['CHANNEL_ID'] = $channelId;
}
$message = CUtil::PhpToJsObject($command);
if (!defined('BX_UTF') || !BX_UTF) {
$message = $GLOBALS['APPLICATION']->ConvertCharset($message, SITE_CHARSET, 'utf-8');
}
$options = isset($arParams['expiry']) ? array('expiry' => intval($arParams['expiry'])) : array();
$res = CPullChannel::Send($channelId, str_replace("\n", " ", $message), $options);
$result = $res ? true : false;
} else {
foreach ($channelId as $channel) {
$arParams = array('CHANNEL_ID' => $channel, 'MESSAGE' => str_replace("\n", " ", serialize($arData)), '~DATE_CREATE' => $DB->CurrentTimeFunction());
$res = IntVal($DB->Add("b_pull_stack", $arParams, array("MESSAGE")));
$result = $res ? true : false;
}
}
return $result;
}
return false;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:32,代码来源:pull_stack.php
示例19: GetList
function GetList($category = false)
{
static $arMeasurementsTable;
if (!is_array($arMeasurementsTable)) {
$tablePath = COption::GetOptionString('sale', 'measurement_path', '/bitrix/modules/sale/measurements.php');
$fullPath = $_SERVER["DOCUMENT_ROOT"] . $tablePath;
if (strlen($tablePath) > 0 && file_exists($fullPath) && !is_dir($fullPath)) {
require_once $fullPath;
if (!is_array($arMeasurementsTable)) {
return false;
}
} else {
return false;
}
}
if (!$category) {
return $arMeasurementsTable;
} else {
$arList = array();
foreach ($arMeasurementsTable as $key => $arM) {
if ($arM["CATEGORY"] == $category) {
$arList[$key] = $arM;
}
}
return $arList;
}
}
开发者ID:rasuldev,项目名称:torino,代码行数:27,代码来源:measurement.php
示例20: FormatEvent
public static function FormatEvent($arFields, $arParams, $bMail = false)
{
global $APPLICATION, $CACHE_MANAGER;
$arResult = array("EVENT" => $arFields);
if (defined("BX_COMP_MANAGED_CACHE")) {
$CACHE_MANAGER->RegisterTag("CALENDAR_EVENT_" . intval($arFields["SOURCE_ID"]));
$CACHE_MANAGER->RegisterTag("CALENDAR_EVENT_LIST");
}
$eventViewResult = $APPLICATION->IncludeComponent('bitrix:calendar.livefeed.view', '', array("EVENT_ID" => $arFields["SOURCE_ID"], "USER_ID" => $arFields["USER_ID"], "PATH_TO_USER" => $arParams["PATH_TO_USER"], "MOBILE" => $arParams["MOBILE"]), null, array('HIDE_ICONS' => 'Y'));
$arResult["EVENT_FORMATTED"] = array("TITLE" => GetMessage("EC_EDEV_EVENT"), "TITLE_24" => GetMessage("EC_EDEV_EVENT"), "URL" => "javascript:BX.StartSlider(" . $arFields["USER_ID"] . "," . $arFields["SOURCE_ID"] . ");", "MESSAGE" => $eventViewResult['MESSAGE'], "FOOTER_MESSAGE" => $eventViewResult['FOOTER_MESSAGE'], "IS_IMPORTANT" => false, "STYLE" => "calendar-confirm");
$eventId = $arFields["SOURCE_ID"];
if (!$eventId) {
$eventId = 0;
}
$editUrl = CCalendar::GetPath('user', $arFields["USER_ID"]);
$editUrl = $editUrl . (strpos($editUrl, "?") === false ? '?' : '&') . 'EVENT_ID=EDIT' . $eventId;
$arRights = array();
$dbRight = CSocNetLogRights::GetList(array(), array("LOG_ID" => $arFields["ID"]));
while ($arRight = $dbRight->Fetch()) {
$arRights[] = $arRight["GROUP_CODE"];
}
$arResult["EVENT_FORMATTED"]["DESTINATION"] = CSocNetLogTools::FormatDestinationFromRights($arRights, array_merge($arParams, array("CREATED_BY" => $arFields["USER_ID"])));
if (isset($eventViewResult['CACHED_JS_PATH'])) {
$arResult['CACHED_JS_PATH'] = $eventViewResult['CACHED_JS_PATH'];
}
$arResult['ENTITY']['FORMATTED']["NAME"] = "ENTITY FORMATTED NAME";
$arResult['ENTITY']['FORMATTED']["URL"] = COption::GetOptionString("timeman", "WORK_REPORT_PATH", "/company/work_report.php");
$arResult['AVATAR_SRC'] = CSocNetLog::FormatEvent_CreateAvatar($arFields, $arParams, 'CREATED_BY');
$arFieldsTooltip = array('ID' => $arFields['USER_ID'], 'NAME' => $arFields['~CREATED_BY_NAME'], 'LAST_NAME' => $arFields['~CREATED_BY_LAST_NAME'], 'SECOND_NAME' => $arFields['~CREATED_BY_SECOND_NAME'], 'LOGIN' => $arFields['~CREATED_BY_LOGIN']);
$arResult['CREATED_BY']['TOOLTIP_FIELDS'] = CSocNetLog::FormatEvent_FillTooltip($arFieldsTooltip, $arParams);
return $arResult;
}
开发者ID:rasuldev,项目名称:torino,代码行数:32,代码来源:calendar_livefeed.php
注:本文中的COption类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论