foreach ($videoSteps as $step) { foreach ($step["patterns"] as $pattern) { //echo $pattern."<br>"; if (preg_match($pattern, $url)) { $result = $step["id"]; break 2; } } } return $result; } } if (IsModuleInstalled('bitrix24')) { $lastHeroView = CUserOptions::GetOption("bitrix24", "new_helper_last", ""); if ($lastHeroView && $lastHeroView + 60 * 60 > time()) { $arResult["SHOW_HELPER_HERO"] = "N"; } else { CUserOptions::SetOption("bitrix24", "new_helper_last", time()); $arHelperSteps = array(array("id" => "start", "patterns" => array()), array("id" => "tasks", "patterns" => array("~^" . SITE_DIR . "(company|contacts)/personal/user/\\d+/tasks/~", "~^" . SITE_DIR . "workgroups/group/\\d+/tasks/~")), array("id" => "calendar", "patterns" => array("~^" . SITE_DIR . "(company|contacts)/personal/user/\\d+/calendar/~", "~^" . SITE_DIR . "workgroups/group/\\d+/calendar/~")), array("id" => "disk", "patterns" => array("~^" . SITE_DIR . "(company|contacts)/personal/user/\\d+/disk/~", "~^" . SITE_DIR . "docs/~", "~^" . SITE_DIR . "workgroups/group/\\d+/disk/~")), array("id" => "profile", "patterns" => array("~^" . SITE_DIR . "(company|contacts)/personal/user/\\d+/edit/\$~", "~^" . SITE_DIR . "(company|contacts)/personal/user/\\d+/passwords/~", "~^" . SITE_DIR . "(company|contacts)/personal/user/\\d+/security/~")), array("id" => "crm", "patterns" => array("~^" . SITE_DIR . "crm/~")), array("id" => "workgroups", "patterns" => array("~^" . SITE_DIR . "workgroups/~")), array("id" => "marketplace", "patterns" => array("~^" . SITE_DIR . "marketplace/~")), array("id" => "telephony", "patterns" => array("~^" . SITE_DIR . "settings/telephony/([^/]*\\.php)?\$~")), array("id" => "extranet", "patterns" => array("~^" . SITE_DIR . "\$~"))); $currentStepId = __getVideoStepByUrl($arHelperSteps, $APPLICATION->GetCurPage()); $arViewedSteps = CUserOptions::GetOption("bitrix24", "new_helper_views", array()); if (!in_array("start", $arViewedSteps)) { $currentStepId = "start"; } $arResult["SHOW_HELPER_HERO"] = $currentStepId != "other" && !in_array($currentStepId, $arViewedSteps) ? "Y" : "N"; if ($currentStepId != "other" && !in_array($currentStepId, $arViewedSteps)) { $arViewedSteps[] = $currentStepId; CUserOptions::SetOption("bitrix24", "new_helper_views", $arViewedSteps); } } }
offsetTop: 9, offsetLeft: 43, angle: true, events: { onPopupClose : function() { BX.removeClass(this.bindElement, "user-block-active"); } } }); } </script> <?php $arViewedSteps = CUserOptions::GetOption("bitrix24", "help_views", array()); $currentStepId = __getVideoStepByUrl($videoSteps, $APPLICATION->GetCurDir()); if (!in_array("start", $arViewedSteps)) { $currentStepId = "start"; } require_once $_SERVER["DOCUMENT_ROOT"] . $this->GetFolder() . "/functions.php"; CIntranetPopupShow::getInstance()->init($currentStepId != "other" && !in_array($currentStepId, $arViewedSteps) ? "Y" : "N"); AddEventHandler("intranet", "OnIntranetPopupShow", "onIntranetPopupShow"); if (!function_exists("onIntranetPopupShow")) { function onIntranetPopupShow() { $isPopupShowed = CIntranetPopupShow::getInstance()->isPopupShowed(); if ($isPopupShowed == "Y") { return false; } } }