This commit is contained in:
root
2025-11-13 19:52:28 +03:00
parent 8aeeb05b7d
commit 807dec3b6c
4646 changed files with 163445 additions and 626017 deletions
@@ -65,8 +65,6 @@ namespace PHPSTORM_META
'documentgenerator',
'documentproxy',
'extranet',
'faceid',
'faceidcontroller',
'fileman',
'form',
'forum',
@@ -96,8 +94,6 @@ namespace PHPSTORM_META
'meeting',
'messageservice',
'microservice',
'ml',
'mlserver',
'mobile',
'mobileapp',
'notifications',
@@ -72,9 +72,9 @@ if($_SERVER['REQUEST_METHOD']=="POST" && (!empty($_POST['save']) || !empty($_POS
if($res)
{
if(!empty($_POST['save']))
LocalRedirect("/bitrix/admin/agent_list.php");
LocalRedirect("/bitrix/admin/agent_list.php?lang=" . LANGUAGE_ID);
elseif(!empty($_POST['apply']))
LocalRedirect("/bitrix/admin/agent_edit.php?&ID=".$ID."&".$editTab->ActiveTabParam());
LocalRedirect("/bitrix/admin/agent_edit.php?ID=" . $ID . "&" . $editTab->ActiveTabParam() . "&lang=" . LANGUAGE_ID);
}
}
@@ -41,8 +41,8 @@ while ($arSite = $rsSites->GetNext())
$arSites["reference"][] = "[".$arSite["ID"]."] ".$arSite["NAME"];
}
$USER_COUNT = CUser::GetCount();
$USER_COUNT_MAX = 25;
$USER_COUNT = CUser::GetCount($USER_COUNT_MAX + 1);
$aTabs = array(
array("DIV" => "edit1", "TAB" => GetMessage("MAIN_TAB"), "ICON" => "group_edit", "TITLE" => GetMessage("MAIN_TAB_TITLE")),
@@ -131,7 +131,7 @@ $runtimeList = array();
$arFilter['!EVENT_NAME'] = null;
if(isset($arFilter['MESSAGE_ID']))
{
$runtimeList[] = new \Bitrix\Main\Entity\ReferenceField(
$runtimeList[] = new \Bitrix\Main\ORM\Fields\Relations\Reference(
'MESSAGE',
'Bitrix\Main\Mail\Internal\EventMessageTable',
array('=this.EVENT_NAME' => 'ref.EVENT_NAME')
+14 -375
View File
@@ -6,7 +6,7 @@
// region environment initialization
if (!defined("UPDATE_SYSTEM_VERSION"))
{
define("UPDATE_SYSTEM_VERSION", "25.100.500");
define("UPDATE_SYSTEM_VERSION", "25.700.0");
}
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php");
@@ -461,7 +461,7 @@ function UpdateSystemRenderLicenseIsNotActive()
<td class="icon-new"><div class="icon icon-licence"></div></td>
<td>
<?= GetMessage("SUP_SUBA_ACTIVATE_HINT") ?><br><br>
<input TYPE="button" NAME="activate_key_btn" value="<?= GetMessage("SUP_SUBA_ACTIVATE_BUTTON") ?>" onclick="ShowActivateForm()">
<input TYPE="button" NAME="activate_key_btn" value="<?= GetMessage("SUP_SUBA_ACTIVATE_BUTTON") ?>" onclick="javascript:document.getElementById('check_key_info_form').submit()">
</td>
</tr>
</table>
@@ -804,13 +804,7 @@ $tabControl->BeginNextTab();
$countTotalImportantUpdates = $countLangUpdatesInst;
if ($countModuleUpdates > 0)
{
for ($i = 0, $cnt = count($arUpdateList["MODULES"][0]["#"]["MODULE"]); $i < $cnt; $i++)
{
if (isset($arUpdateList["MODULES"][0]["#"]["MODULE"][$i]["#"]["VERSION"]))
$countTotalImportantUpdates += count($arUpdateList["MODULES"][0]["#"]["MODULE"][$i]["#"]["VERSION"]);
if (!array_key_exists($arUpdateList["MODULES"][0]["#"]["MODULE"][$i]["@"]["ID"], $arClientModules))
$countTotalImportantUpdates += 1;
}
$countTotalImportantUpdates += array_sum(CUpdateClient::getUpdatesCount($arUpdateList, $arClientModules));
}
$newLicenceSignedKey = CUpdateClient::getNewLicenseSignedKey();
@@ -1221,7 +1215,6 @@ $tabControl->BeginNextTab();
</table>
</div>
<SCRIPT>
<!--
function ActivateCoupon()
{
document.getElementById("id_coupon_btn").disabled = true;
@@ -1257,7 +1250,6 @@ $tabControl->BeginNextTab();
alert("<?= GetMessageJS("SUP_SUAC_NO_COUP") ?>");
}
}
//-->
</SCRIPT>
<?
}
@@ -1346,7 +1338,6 @@ $tabControl->BeginNextTab();
</table>
</div>
<SCRIPT>
<!--
function SwithStability()
{
var sel = document.getElementById("id_stable_select");
@@ -1371,7 +1362,6 @@ $tabControl->BeginNextTab();
updRand++;
CHttpRequest.Send('/bitrix/admin/update_system_act.php?query_type=stability&<?= bitrix_sessid_get() ?>&STABILITY=' + encodeURIComponent(sel.options[sel.selectedIndex].value) + "&updRand=" + updRand);
}
//-->
</SCRIPT>
<BR>
@@ -1400,7 +1390,6 @@ $tabControl->BeginNextTab();
</table>
</div>
<SCRIPT>
<!--
function SubscribeMail()
{
document.getElementById("id_email_btn").disabled = true;
@@ -1436,7 +1425,6 @@ $tabControl->BeginNextTab();
alert("<?= GetMessageJS("SUP_SUSU_NO_EMAIL") ?>");
}
}
//-->
</SCRIPT>
<?
}
@@ -1477,7 +1465,10 @@ $tabControl->End();
$strTitleTmp .= '<p><b>';
$strTitleTmp .= str_replace("#VER#", $arModuleTmp["#"]["VERSION"][$j]["@"]["ID"], GetMessage("SUP_SULL_VERSION"));
$strTitleTmp .= '</b><br />';
$strTitleTmp .= $arModuleTmp["#"]["VERSION"][$j]["#"]["DESCRIPTION"][0]["#"];
if (isset($arModuleTmp["#"]["VERSION"][$j]["#"]["DESCRIPTION"][0]["#"]))
{
$strTitleTmp .= $arModuleTmp["#"]["VERSION"][$j]["#"]["DESCRIPTION"][0]["#"];
}
$strTitleTmp .= '</p>';
}
}
@@ -1493,24 +1484,17 @@ $tabControl->End();
var arModuleUpdatesCnt = {<?
if ($countModuleUpdates > 0)
{
for ($i = 0, $cnt = count($arUpdateList["MODULES"][0]["#"]["MODULE"]); $i < $cnt; $i++)
$updatesCount = CUpdateClient::getUpdatesCount($arUpdateList, $arClientModules);
$s = '';
foreach ($updatesCount as $module => $count)
{
if ($i > 0)
echo ", ";
echo "\"".$arUpdateList["MODULES"][0]["#"]["MODULE"][$i]["@"]["ID"]."\" : ";
if (isset($arUpdateList["MODULES"][0]["#"]["MODULE"][$i]["#"]["VERSION"])
&& is_array($arUpdateList["MODULES"][0]["#"]["MODULE"][$i]["#"]["VERSION"]))
if ($s != '')
{
if (!array_key_exists($arUpdateList["MODULES"][0]["#"]["MODULE"][$i]["@"]["ID"], $arClientModules))
echo count($arUpdateList["MODULES"][0]["#"]["MODULE"][$i]["#"]["VERSION"]) + 1;
else
echo count($arUpdateList["MODULES"][0]["#"]["MODULE"][$i]["#"]["VERSION"]);
}
else
{
echo "0";
$s .= ", ";
}
$s .= "\"" . $module . "\": " . $count;
}
echo $s;
}
?>};
@@ -1752,10 +1736,6 @@ $tabControl->End();
if (result == "Y")
{
window.location.href = "/bitrix/admin/update_system.php?lang=<?= LANG ?>";
//var udl = document.getElementById("upd_activate_div");
//udl.style["display"] = "none";
//UnLockControls();
//CloseActivateForm();
}
else
{
@@ -1768,347 +1748,6 @@ $tabControl->End();
CHttpRequest.Send('/bitrix/admin/update_system_act.php?query_type=key&<?= bitrix_sessid_get() ?>&NEW_LICENSE_KEY=' + encodeURIComponent(document.licence_key_form.NEW_LICENSE_KEY.value) + "&updRand=" + updRand);
}
//endregion
// region license is not active
function ActivateEnableDisableUser(value)
{
document.activate_form.USER_NAME.disabled = !value;
document.activate_form.USER_LAST_NAME.disabled = !value;
document.getElementById("USER_LOGIN_activate").disabled = !value;
document.getElementById("USER_LOGIN").disabled = value;
document.activate_form.USER_PASSWORD.disabled = !value;
document.activate_form.USER_PASSWORD_CONFIRM.disabled = !value;
document.activate_form.USER_EMAIL.disabled = !value;
if(!value)
{
document.getElementById("new-user").style.display = 'none';
document.getElementById("exist-user").style.display = 'block';
}
else
{
document.getElementById("new-user").style.display = 'block';
document.getElementById("exist-user").style.display = 'none';
}
}
function ActivateFormSubmit()
{
document.getElementById("id_activate_form_button").disabled = true;
ShowWaitWindow();
var bEr = false;
var erImg = '<img src="/bitrix/themes/.default/images/icon_warn.gif" width="20" height="20" alt="Error" title="Error" align="left" />';
document.getElementById('errorDiv').style.diplay = 'none';
document.getElementById('id_activate_name_error').innerHTML = '';
document.getElementById('SITE_URL_error').innerHTML = '';
document.getElementById('PHONE_error').innerHTML = '';
document.getElementById('EMAIL_error').innerHTML = '';
document.getElementById('CONTACT_PERSON_error').innerHTML = '';
document.getElementById('CONTACT_EMAIL_error').innerHTML = '';
document.getElementById('CONTACT_PHONE_error').innerHTML = '';
if(document.getElementById('id_activate_name').value.length <= 3)
{
document.getElementById('id_activate_name_error').innerHTML = erImg;
bEr = true;
}
if(document.getElementById('SITE_URL').value.length <= 3)
{
document.getElementById('SITE_URL_error').innerHTML = erImg;
bEr = true;
}
if(document.getElementById('PHONE').value.length <= 3)
{
document.getElementById('PHONE_error').innerHTML = erImg;
bEr = true;
}
if(document.activate_form.EMAIL.value.length <= 3)
{
document.getElementById('EMAIL_error').innerHTML = erImg;
bEr = true;
}
if(document.getElementById('CONTACT_PERSON').value.length <= 3)
{
document.getElementById('CONTACT_PERSON_error').innerHTML = erImg;
bEr = true;
}
if(document.getElementById('CONTACT_EMAIL').value.length <= 3)
{
document.getElementById('CONTACT_EMAIL_error').innerHTML = erImg;
bEr = true;
}
if(document.getElementById('CONTACT_PHONE').value.length <= 3)
{
document.getElementById('CONTACT_PHONE_error').innerHTML = erImg;
bEr = true;
}
var generateUser = "N";
if(document.getElementById('GENERATE_USER').checked)
{
generateUser = "Y";
document.getElementById('USER_NAME_error').innerHTML = '';
document.getElementById('USER_LAST_NAME_error').innerHTML = '';
document.getElementById('USER_LOGIN_error').innerHTML = '';
document.getElementById('USER_PASSWORD_error').innerHTML = '';
document.getElementById('USER_PASSWORD_CONFIRM_error').innerHTML = '';
document.getElementById('USER_EMAIL_error').innerHTML = '';
if(document.getElementById('USER_NAME').value.length <= 0)
{
document.getElementById('USER_NAME_error').innerHTML = erImg;
bEr = true;
}
if(document.getElementById('USER_LAST_NAME').value.length <= 0)
{
document.getElementById('USER_LAST_NAME_error').innerHTML = erImg;
bEr = true;
}
if(document.getElementById('USER_LOGIN_activate').value.length < 3)
{
document.getElementById('USER_LOGIN_error').innerHTML = erImg;
bEr = true;
}
var UserLogin = document.getElementById('USER_LOGIN_activate').value;
if(document.getElementById('USER_PASSWORD').value.length < 6)
{
document.getElementById('USER_PASSWORD_error').innerHTML = erImg;
bEr = true;
}
if(document.getElementById('USER_PASSWORD').value != document.getElementById('USER_PASSWORD_CONFIRM').value)
{
document.getElementById('USER_PASSWORD_error').innerHTML = erImg;
bEr = true;
document.getElementById('USER_PASSWORD_CONFIRM_error').innerHTML = erImg;
bEr = true;
}
if(document.getElementById('USER_EMAIL').value.length <= 3)
{
document.getElementById('USER_EMAIL_error').innerHTML = erImg;
bEr = true;
}
}
else
{
if(document.getElementById('USER_LOGIN').value.length < 3)
{
document.getElementById('USER_LOGIN_EXIST_error').innerHTML = erImg;
bEr = true;
}
var UserLogin = document.getElementById('USER_LOGIN').value;
}
if(bEr)
{
document.getElementById("id_activate_form_button").disabled = false;
CloseWaitWindow();
document.getElementById('errorDiv').innerHTML = '<table style="color:red;"><tr><td><img src="/bitrix/themes/.default/images/icon_error.gif" width="32" height="32" alt="Error" title="Error" align="left" valign="center"/></td><td><b><?=GetMessageJS("SUP_SUBA_CONFIRM_ERROR")?></b></td></tr></table>';
document.getElementById('errorDiv').style.border = "1px solid red";
document.getElementById('activate_content').scrollTop = 0;
return false;
}
else
{
var param = "NAME=" + encodeURIComponent(document.activate_form.NAME.value)
+ "&EMAIL=" + encodeURIComponent(document.activate_form.EMAIL.value)
+ "&CONTACT_INFO=" + encodeURIComponent(document.activate_form.CONTACT_INFO.value)
+ "&PHONE=" + encodeURIComponent(document.activate_form.PHONE.value)
+ "&CONTACT_PERSON=" + encodeURIComponent(document.activate_form.CONTACT_PERSON.value)
+ "&CONTACT_EMAIL=" + encodeURIComponent(document.activate_form.CONTACT_EMAIL.value)
+ "&CONTACT_PHONE=" + encodeURIComponent(document.activate_form.CONTACT_PHONE.value)
+ "&SITE_URL=" + encodeURIComponent(document.activate_form.SITE_URL.value)
+ "&GENERATE_USER=" + encodeURIComponent(generateUser)
+ "&USER_NAME=" + encodeURIComponent(document.activate_form.USER_NAME.value)
+ "&USER_LAST_NAME=" + encodeURIComponent(document.activate_form.USER_LAST_NAME.value)
+ "&USER_LOGIN=" + encodeURIComponent(UserLogin)
+ "&USER_PASSWORD=" + encodeURIComponent(document.activate_form.USER_PASSWORD.value)
+ "&USER_PASSWORD_CONFIRM=" + encodeURIComponent(document.activate_form.USER_PASSWORD_CONFIRM.value);
CHttpRequest.Action = function(result)
{
CloseWaitWindow();
result = PrepareString(result);
if (result == "Y")
{
window.location.href = "update_system.php?lang=<?= LANG ?>";
}
else
{
document.getElementById("id_activate_form_button").disabled = false;
document.getElementById('errorDiv').innerHTML = '<table style="color:red;"><tr><td><img src="/bitrix/themes/.default/images/icon_error.gif" width="32" height="32" alt="Error" title="Error" align="left" valign="center"/></td><td><b>'+result+'</b></td></tr></table>';
document.getElementById('errorDiv').style.border = "1px solid red";
document.getElementById('activate_content').scrollTop = 0;
}
}
updRand++;
CHttpRequest.Send('/bitrix/admin/update_system_act.php?query_type=activate&<?= bitrix_sessid_get() ?>&' + param + "&updRand=" + updRand);
return true;
}
}
function ShowActivateForm()
{
if (document.getElementById("activate_float_div"))
return;
LockControls();
var div = document.body.appendChild(document.createElement("DIV"));
div.id = "activate_float_div";
div.className = "settings-float-form";
div.style.position = 'absolute';
var txt = '<div class="title">';
txt += '<table cellspacing="0" width="100%">';
txt += '<tr>';
txt += '<td width="100%" class="title-text" onmousedown="jsFloatDiv.StartDrag(arguments[0], document.getElementById(\'activate_float_div\'));"><?= GetMessage("SUP_SUBA_ACTIVATE") ?></td>';
txt += '<td width="0%"><a class="close" href="javascript:CloseActivateWindow();" title="<?= GetMessageJS("SUP_SULD_CLOSE") ?>"></a></td>';
txt += '</tr>';
txt += '</table>';
txt += '</div>';
txt += '<div class="content" id="activate_content" style="overflow:auto;overflow-y:auto;height:400px;">';
txt += '<form name="activate_form" id="activate_form" onsubmit="return validate();" method="POST">';
txt += '<h2><?= GetMessageJS("SUP_SUBA_ACTIVATE") ?></h2>';
txt += '<input type="hidden" name="TYPE" VALUE="ACTIVATE_KEY">';
txt += '<input type="hidden" name="STEP" VALUE="1">';
txt += '<input type="hidden" name="lang" id="lang" VALUE="<?=LANGUAGE_ID?>">';
txt += '<table>';
txt += '<tr>';
txt += ' <td colspan="2"><div id="errorDiv"></div></td>';
txt += '</tr>';
txt += ' <tr>';
txt += ' <td width="50%"><span class="required">*</span><?= GetMessageJS("SUP_SUBA_RI_NAME") ?>:</td>';
txt += ' <td width="50%" nowrap><div id="id_activate_name_error"></div><input type="text" id="id_activate_name" name="NAME" value="<?=htmlspecialcharsEx(isset($_POST["NAME"]) ? $_POST["NAME"] : '')?>" size="40"></td>';
txt += ' </tr>';
txt += ' <tr>';
txt += ' <td width="50%"><span class="required">*</span><?= GetMessageJS("SUP_SUBA_RI_URI") ?>:</td>';
txt += ' <td width="50%" nowrap><div id="SITE_URL_error"></div><input type="text" id="SITE_URL" name="SITE_URL" value="<?=htmlspecialcharsEx(isset($_POST["SITE_URL"]) ? $_POST["SITE_URL"] : '')?>" size="40"></td>';
txt += ' </tr>';
txt += ' <tr>';
txt += ' <td width="50%"><span class="required">*</span><?= GetMessageJS("SUP_SUBA_RI_PHONE") ?>:</td>';
txt += ' <td width="50%" nowrap><div id="PHONE_error"></div><input type="text" id="PHONE" name="PHONE" value="<?=htmlspecialcharsEx(isset($_POST["PHONE"]) ? $_POST["PHONE"] : '')?>" size="40"></td>';
txt += ' </tr>';
txt += ' <tr>';
txt += ' <td width="50%"><span class="required">*</span><?= GetMessageJS("SUP_SUBA_RI_EMAIL") ?>:</td>';
txt += ' <td width="50%" nowrap><div id="EMAIL_error"></div><input type="text" id="EMAIL" name="EMAIL" value="<?=htmlspecialcharsEx(isset($_POST["EMAIL"]) ? $_POST["EMAIL"] : '')?>" size="40"></td>';
txt += ' </tr>';
txt += ' <tr>';
txt += ' <td width="50%"><span class="required">*</span><?= GetMessageJS("SUP_SUBA_RI_CONTACT_PERSON") ?>:</td>';
txt += ' <td width="50%" nowrap><div id="CONTACT_PERSON_error"></div><input type="text" id="CONTACT_PERSON" name="CONTACT_PERSON" value="<?=htmlspecialcharsEx(isset($_POST["CONTACT_PERSON"]) ? $_POST["CONTACT_PERSON"] : '')?>" size="40"></td>';
txt += ' </tr>';
txt += ' <tr>';
txt += ' <td width="50%"><span class="required">*</span><?= GetMessageJS("SUP_SUBA_RI_CONTACT_EMAIL") ?>:</td>';
txt += ' <td width="50%" nowrap><div id="CONTACT_EMAIL_error"></div><input type="text" id="CONTACT_EMAIL" name="CONTACT_EMAIL" value="<?=htmlspecialcharsEx(isset($_POST["CONTACT_EMAIL"]) ? $_POST["CONTACT_EMAIL"] : '')?>" size="40"></td>';
txt += ' </tr>';
txt += ' <tr>';
txt += ' <td width="50%"><span class="required">*</span><?= GetMessageJS("SUP_SUBA_RI_CONTACT_PHONE") ?>:</td>';
txt += ' <td width="50%" nowrap><div id="CONTACT_PHONE_error"></div><input type="text" id="CONTACT_PHONE" name="CONTACT_PHONE" value="<?=htmlspecialcharsEx(isset($_POST["CONTACT_PHONE"]) ? $_POST["CONTACT_PHONE"] : '')?>" size="40"></td>';
txt += ' </tr>';
txt += ' <tr>';
txt += ' <td width="50%"><?= GetMessage("SUP_SUBA_RI_CONTACT") ?>:</td>';
txt += ' <td width="50%" nowrap><input type="text" name="CONTACT_INFO" value="<?=htmlspecialcharsEx(isset($_POST["CONTACT_INFO"]) ? $_POST["CONTACT_INFO"] : '')?>" size="40"></td>';
txt += ' </tr>';
txt += '<tr>';
txt += ' <td colspan="2">';
txt += ' <?= GetMessageJS("SUP_SUBA_UI_HINT") ?><br />';
txt += ' <input name="GENERATE_USER" id="GENERATE_USER" type="radio" onclick="ActivateEnableDisableUser(true)" value="Y"<?if(!isset($GENERATE_USER) || $GENERATE_USER != "N") echo " checked"?>><label for="GENERATE_USER"><?= GetMessageJS("SUP_SUBA_UI_CREATE") ?></label><br />';
txt += ' <input name="GENERATE_USER" id="GENERATE_USER_NO" type="radio" onclick="ActivateEnableDisableUser(false)" value="N"<?if(isset($GENERATE_USER) && $GENERATE_USER == "N") echo " checked"?>><label for="GENERATE_USER_NO"><?echo GetMessageJS("SUP_SUBA_UI_EXIST");?></label>';
txt += ' </td>';
txt += '</tr>';
txt += '<tr>';
txt += ' <td colspan="2">';
txt += ' <div id="new-user">';
txt += ' <table width="100%" border="0">';
txt += ' <tr id="tr_USER_NAME">';
txt += ' <td width="50%" class="field-name" style="padding: 3px;"><span class="required">*</span><?= GetMessageJS("SUP_SUBA__UI_NAME") ?>:</td>';
txt += ' <td width="50%" style="padding: 3px;" nowrap><div id="USER_NAME_error"></div><input type="text" id="USER_NAME" name="USER_NAME" value="<?=htmlspecialcharsEx(isset($_POST["USER_NAME"]) ? $_POST["USER_NAME"] : '')?>" size="40"></td>';
txt += ' </tr>';
txt += ' <tr id="tr_USER_LAST_NAME">';
txt += ' <td width="50%" class="field-name" style="padding: 3px;"><span class="required">*</span><?= GetMessageJS("SUP_SUBA_UI_LASTNAME") ?>:</td>';
txt += ' <td width="50%" style="padding: 3px;" nowrap><div id="USER_LAST_NAME_error"></div><input type="text" id="USER_LAST_NAME" name="USER_LAST_NAME" value="<?=htmlspecialcharsEx(isset($_POST["USER_LAST_NAME"]) ? $_POST["USER_LAST_NAME"] : '')?>" size="40"></td>';
txt += ' </tr>';
txt += ' <tr id="tr_USER_LOGIN">';
txt += ' <td width="50%" class="field-name" style="padding: 3px;"><span class="required">*</span><?= GetMessageJS("SUP_SUBA_UI_LOGIN") ?>:</td>';
txt += ' <td width="50%" style="padding: 3px;" nowrap><div id="USER_LOGIN_error"></div><input type="text" id="USER_LOGIN_activate" name="USER_LOGIN_A" value="<?=htmlspecialcharsEx(isset($_POST["USER_LOGIN_A"]) ? $_POST["USER_LOGIN_A"] : '')?>" size="40"></td>';
txt += ' </tr>';
txt += ' <tr id="tr_USER_PASSWORD">';
txt += ' <td width="50%" class="field-name" style="padding: 3px;"><span class="required">*</span><?= GetMessageJS("SUP_SUBA_UI_PASSWORD") ?>:</td>';
txt += ' <td width="50%" style="padding: 3px;" nowrap><div id="USER_PASSWORD_error"></div><input type="password" id="USER_PASSWORD" name="USER_PASSWORD" value="" size="40" autocomplete="off"></td>';
txt += ' </tr>';
txt += ' <tr id="tr_USER_PASSWORD_CONFIRM">';
txt += ' <td width="50%" class="field-name" style="padding: 3px;"><span class="required">*</span><?= GetMessageJS("SUP_SUBA_UI_PASSWORD_CONF") ?>:</td>';
txt += ' <td width="50%" style="padding: 3px;" nowrap><div id="USER_PASSWORD_CONFIRM_error"></div><input type="password" id="USER_PASSWORD_CONFIRM" name="USER_PASSWORD_CONFIRM" value="" size="40"></td>';
txt += ' </tr>';
txt += ' <tr id="tr_USER_EMAIL">';
txt += ' <td width="50%" class="field-name" style="padding: 3px;"><span class="required">*</span>E-mail:</td>';
txt += ' <td width="50%" style="padding: 3px;" nowrap><div id="USER_EMAIL_error"></div><input type="text" id="USER_EMAIL" name="USER_EMAIL" value="<?=htmlspecialcharsEx(isset($_POST["USER_EMAIL"]) ? $_POST["USER_EMAIL"] : '')?>" size="40"></td>';
txt += ' </tr>';
txt += ' </table>';
txt += ' </div>';
txt += ' <div id="exist-user" style="display:none;">';
txt += ' <table width="100%" border="0">';
txt += ' <tr>';
txt += ' <td width="50%" class="field-name" style="padding: 3px;"><span class="required">*</span><?= GetMessageJS("SUP_SUBA_UI_LOGIN") ?>:</td>';
txt += ' <td width="50%" style="padding: 3px;" nowrap><div id="USER_LOGIN_EXIST_error"></div><input id="USER_LOGIN" name="USER_LOGIN" maxlength="50" value="<?=htmlspecialcharsEx(isset($_POST["USER_LOGIN"]) ? $_POST["USER_LOGIN"] : '')?>" size="40" type="text"></td>';
txt += ' </tr>';
txt += ' </table>';
txt += ' </div>';
txt += ' </td>';
txt += ' </tr>';
txt += ' </table>';
txt += '<div class="buttons">';
txt += '<input type="button" id="id_activate_form_button" value="<?= GetMessageJS("SUP_SUBA_ACTIVATE_BUTTON") ?>" onclick="ActivateFormSubmit()" title="<?= GetMessageJS("SUP_SUBA_ACTIVATE_BUTTON") ?>">';
txt += '</div><br />';
txt += '</form>';
div.innerHTML = txt;
var left = parseInt(document.body.scrollLeft + document.body.clientWidth/2 - div.offsetWidth/2);
var top = parseInt(document.body.scrollTop + document.body.clientHeight/2 - div.offsetHeight/2);
jsFloatDiv.Show(div, left, top);
jsUtils.addEvent(document, "keypress", ActivateOnKeyPress);
document.getElementById("id_activate_name").focus();
}
function ActivateOnKeyPress(e)
{
if (!e)
e = window.event;
if (!e)
return;
if (e.keyCode == 27)
CloseActivateWindow();
}
function CloseActivateWindow()
{
jsUtils.removeEvent(document, "keypress", ActivateOnKeyPress);
var div = document.getElementById("activate_float_div");
jsFloatDiv.Close(div);
div.parentNode.removeChild(div);
}
function CloseActivateForm()
{
var div = document.getElementById("activate_float_div");
jsFloatDiv.Close(div);
div.parentNode.removeChild(div);
}
// endregion
//region update client
function UpdateUpdate()
{
@@ -23,7 +23,7 @@ $errorMessage = "";
$stableVersionsOnly = COption::GetOptionString("main", "stable_versions_only", "Y");
$queryType = isset($_REQUEST["query_type"]) ? $_REQUEST["query_type"] : null;
if (!in_array($queryType, array("licence", "activate", "key", "register", "sources", "updateupdate", "coupon", "stability", "mail", "support_full_load")))
if (!in_array($queryType, array("licence", "key", "register", "sources", "updateupdate", "coupon", "stability", "mail", "support_full_load")))
$queryType = "licence";
if (!defined("UPD_INTERNAL_CALL") || UPD_INTERNAL_CALL != "Y")
@@ -43,122 +43,6 @@ if ($queryType == "licence")
echo "Y";
}
elseif ($queryType == "activate")
{
$name = isset($_REQUEST["NAME"]) ? $_REQUEST["NAME"] : '';
$name = $APPLICATION->UnJSEscape($name);
if ($name == '')
$errorMessage .= GetMessage("SUPA_AERR_NAME").". ";
$email = isset($_REQUEST["EMAIL"]) ? $_REQUEST["EMAIL"] : '';
$email = $APPLICATION->UnJSEscape($email);
if ($email == '')
$errorMessage .= GetMessage("SUPA_AERR_EMAIL").". ";
elseif (!CUpdateSystem::CheckEMail($email))
$errorMessage .= GetMessage("SUPA_AERR_EMAIL1").". ";
$siteUrl = isset($_REQUEST["SITE_URL"]) ? $_REQUEST["SITE_URL"] : '';
$siteUrl = $APPLICATION->UnJSEscape($siteUrl);
if ($siteUrl == '')
$errorMessage .= GetMessage("SUPA_AERR_URI").". ";
$phone = isset($_REQUEST["PHONE"]) ? $_REQUEST["PHONE"] : '';
$phone = $APPLICATION->UnJSEscape($phone);
if ($phone == '')
$errorMessage .= GetMessage("SUPA_AERR_PHONE").". ";
$contactEMail = isset($_REQUEST["CONTACT_EMAIL"]) ? $_REQUEST["CONTACT_EMAIL"] : '';
$contactEMail = $APPLICATION->UnJSEscape($contactEMail);
if ($contactEMail == '')
$errorMessage .= GetMessage("SUPA_AERR_CONTACT_EMAIL").". ";
elseif (!CUpdateSystem::CheckEMail($contactEMail))
$errorMessage .= GetMessage("SUPA_AERR_CONTACT_EMAIL1").". ";
$contactPerson = isset($_REQUEST["CONTACT_PERSON"]) ? $_REQUEST["CONTACT_PERSON"] : '';
$contactPerson = $APPLICATION->UnJSEscape($contactPerson);
if ($contactPerson == '')
$errorMessage .= GetMessage("SUPA_AERR_CONTACT_PERSON").". ";
$contactPhone = isset($_REQUEST["CONTACT_PHONE"]) ? $_REQUEST["CONTACT_PHONE"] : '';
$contactPhone = $APPLICATION->UnJSEscape($contactPhone);
if ($contactPhone == '')
$errorMessage .= GetMessage("SUPA_AERR_CONTACT_PHONE").". ";
$generateUser = isset($_REQUEST["GENERATE_USER"]) ? $_REQUEST["GENERATE_USER"] : '';
$generateUser = $APPLICATION->UnJSEscape($generateUser);
if ($generateUser == "Y")
{
$userName = isset($_REQUEST["USER_NAME"]) ? $_REQUEST["USER_NAME"] : '';
$userName = $APPLICATION->UnJSEscape($userName);
if ($userName == '')
$errorMessage .= GetMessage("SUPA_AERR_FNAME").". ";
$userLastName = isset($_REQUEST["USER_LAST_NAME"]) ? $_REQUEST["USER_LAST_NAME"] : '';
$userLastName = $APPLICATION->UnJSEscape($userLastName);
if ($userLastName == '')
$errorMessage .= GetMessage("SUPA_AERR_LNAME").". ";
$userLogin = isset($_REQUEST["USER_LOGIN"]) ? $_REQUEST["USER_LOGIN"] : '';
$userLogin = $APPLICATION->UnJSEscape($userLogin);
if ($userLogin == '')
$errorMessage .= GetMessage("SUPA_AERR_LOGIN").". ";
elseif (strlen($userLogin) < 3)
$errorMessage .= GetMessage("SUPA_AERR_LOGIN1").". ";
$userPassword = isset($_REQUEST["USER_PASSWORD"]) ? $_REQUEST["USER_PASSWORD"] : '';
$userPassword = $APPLICATION->UnJSEscape($userPassword);
$userPasswordConfirm = isset($_REQUEST["USER_PASSWORD_CONFIRM"]) ? $_REQUEST["USER_PASSWORD_CONFIRM"] : '';
$userPasswordConfirm = $APPLICATION->UnJSEscape($userPasswordConfirm);
if ($userPassword == '')
$errorMessage .= GetMessage("SUPA_AERR_PASSW").". ";
if ($userPassword != $userPasswordConfirm)
$errorMessage .= GetMessage("SUPA_AERR_PASSW_CONF").". ";
}
else
{
$userLogin = isset($_REQUEST["USER_LOGIN"]) ? $_REQUEST["USER_LOGIN"] : '';
$userLogin = $APPLICATION->UnJSEscape($userLogin);
if ($userLogin == '')
$errorMessage .= GetMessage("SUPA_AERR_LOGIN").". ";
elseif (strlen($userLogin) < 3)
$errorMessage .= GetMessage("SUPA_AERR_LOGIN1").". ";
}
if ($errorMessage == '')
{
$contactInfo = isset($_REQUEST["CONTACT_INFO"]) ? $_REQUEST["CONTACT_INFO"] : '';
$contactInfo = $APPLICATION->UnJSEscape($contactInfo);
$arFields = array(
"NAME" => $name,
"EMAIL" => $email,
"SITE_URL" => $siteUrl,
"CONTACT_INFO" => $contactInfo,
"PHONE" => $phone,
"CONTACT_EMAIL" => $contactEMail,
"CONTACT_PERSON" => $contactPerson,
"CONTACT_PHONE" => $contactPhone,
"GENERATE_USER" => (($generateUser == "Y") ? "Y" : "N"),
"USER_NAME" => $userName,
"USER_LAST_NAME" => $userLastName,
"USER_LOGIN" => $userLogin,
"USER_PASSWORD" => $userPassword
);
CUpdateClient::ActivateLicenseKey($arFields, $errorMessage, LANG, $stableVersionsOnly);
}
if ($errorMessage == '')
{
CUpdateClient::AddMessage2Log("Licence activated", "UPD_SUCCESS");
echo "Y";
}
else
{
CUpdateClient::AddMessage2Log("Error: ".$errorMessage, "UPD_ERROR");
echo $errorMessage;
}
}
elseif ($queryType == "key")
{
if (!check_bitrix_sessid())
@@ -186,21 +186,12 @@ if ($queryType == "M")
$bFirst = true;
for ($i = 0, $cnt = count($arUpdateDescription["DATA"]["#"]["ITEM"]); $i < $cnt; $i++)
{
$strModuleDescr = "";
if ($arUpdateDescription["DATA"]["#"]["ITEM"][$i]["@"]["DESCR"] <> '')
{
$strModuleDescr = "<br>".htmlspecialcharsback($arUpdateDescription["DATA"]["#"]["ITEM"][$i]["@"]["DESCR"]);
$strModuleDescr = preg_replace("#</?pre>#i", " ", $strModuleDescr);
$strModuleDescr = preg_replace("/[\s\n\r]+/", " ", $strModuleDescr);
$strModuleDescr = addslashes($strModuleDescr);
}
CUpdateClient::AddMessage2Log("Updated: ".$arUpdateDescription["DATA"]["#"]["ITEM"][$i]["@"]["NAME"].(($arUpdateDescription["DATA"]["#"]["ITEM"][$i]["@"]["VALUE"] != "0") ? " (".$arUpdateDescription["DATA"]["#"]["ITEM"][$i]["@"]["VALUE"].")" : "").$strModuleDescr, "UPD_SUCCESS");
echo ($bFirst ? "" : ", ").$arUpdateDescription["DATA"]["#"]["ITEM"][$i]["@"]["NAME"].(($arUpdateDescription["DATA"]["#"]["ITEM"][$i]["@"]["VALUE"] != "0") ? " (".$arUpdateDescription["DATA"]["#"]["ITEM"][$i]["@"]["VALUE"].")" : "");
$bFirst = false;
}
CUpdateClient::logUpdates($arUpdateDescription["DATA"]["#"]["ITEM"]);
CUpdateClient::finalizeModuleUpdate($arUpdateDescription["DATA"]["#"]["ITEM"]);
}
}
@@ -28,9 +28,9 @@ use Bitrix\Main\ORM\Fields\Relations\Reference;
use Bitrix\Main\ORM\Query\Join;
use Bitrix\Main\UserTable;
use Bitrix\Main\UserGroupTable;
use Bitrix\Main\Entity\Query;
use Bitrix\Main\ORM\Query\Query;
use Bitrix\Main\DB\SqlExpression;
use Bitrix\Main\Entity\ExpressionField;
use Bitrix\Main\ORM\Fields\ExpressionField;
use Bitrix\Main\Text\HtmlFilter;
use Bitrix\Main\Type\DateTime;
@@ -793,45 +793,144 @@ class CComponentUtil
"ADDITIONAL_VALUES" => "N"
);
}
elseif ($arParamKeys[$i] == "USER_CONSENT")
elseif ($arParamKeys[$i] == 'USER_CONSENT')
{
$arComponentParameters["GROUPS"]["USER_CONSENT"] = array(
"NAME" => GetMessage("COMP_GROUP_USER_CONSENT"),
"SORT" => 350
);
$arComponentParameters['GROUPS']['USER_CONSENT'] = [
'NAME' => GetMessage('COMP_GROUP_USER_CONSENT'),
'SORT' => 350,
];
$arComponentParameters["PARAMETERS"]["USER_CONSENT"] = array(
"PARENT" => "USER_CONSENT",
"NAME" => GetMessage("COMP_PROP_USER_CONSENT_USE"),
"TYPE" => "CHECKBOX",
"DEFAULT" => "N",
"ADDITIONAL_VALUES" => "N"
);
$arComponentParameters['PARAMETERS']['USER_CONSENT'] = [
'PARENT' => 'USER_CONSENT',
'NAME' => GetMessage('COMP_PROP_USER_CONSENT_USE'),
'TYPE' => 'CHECKBOX',
'DEFAULT' => 'N',
'ADDITIONAL_VALUES' => 'N',
];
$arComponentParameters["PARAMETERS"]["USER_CONSENT_ID"] = array(
"PARENT" => "USER_CONSENT",
"NAME" => GetMessage("COMP_PROP_USER_CONSENT_ID"),
"TYPE" => "LIST",
"VALUES" => array(GetMessage("COMP_PROP_USER_CONSENT_ID_DEF")) + \Bitrix\Main\UserConsent\Agreement::getActiveList(),
"MULTIPLE" => "N",
"DEFAULT" => "",
);
$isMultiple = isset($arComponentParameters['PARAMETERS']['USER_CONSENT_IDS']);
if ($isMultiple)
{
$agreements = \Bitrix\Main\UserConsent\Agreement::getActiveList();
if (array_key_exists('USER_CONSENT_IDS', $arCurrentValues))
{
$userConsentIds =
is_array($arCurrentValues['USER_CONSENT_IDS'])
? $arCurrentValues['USER_CONSENT_IDS']
: [$arCurrentValues['USER_CONSENT_IDS']]
;
}
else
{
$userConsentIds = null;
}
$defaultUserConsentId = null;
$defaultUserConsentChecked = null;
$arComponentParameters["PARAMETERS"]["USER_CONSENT_IS_CHECKED"] = array(
"PARENT" => "USER_CONSENT",
"NAME" => GetMessage("COMP_PROP_USER_CONSENT_IS_CHECKED"),
"TYPE" => "CHECKBOX",
"DEFAULT" => "Y",
"ADDITIONAL_VALUES" => "N"
);
if (!$userConsentIds)
{
if (
isset($arCurrentValues['USER_CONSENT_ID'])
&& !isset($arCurrentValues['USER_CONSENT_IS_CHECKED_' . $arCurrentValues['USER_CONSENT_ID']])
)
{
$defaultUserConsentId =
$agreements[(int)$arCurrentValues['USER_CONSENT_ID']]
? (int)$arCurrentValues['USER_CONSENT_ID']
: null
;
$userConsentIds = [$arCurrentValues['USER_CONSENT_ID']];
if (isset($arCurrentValues['USER_CONSENT_IS_CHECKED']))
{
$defaultUserConsentChecked =
$arCurrentValues['USER_CONSENT_IS_CHECKED'] === 'Y'
? 'Y'
: 'N'
;
}
}
else
{
$userConsentIds = [];
}
}
$arComponentParameters['PARAMETERS']['USER_CONSENT_IDS'] = [
'PARENT' => 'USER_CONSENT',
'NAME' => GetMessage('COMP_PROP_USER_CONSENT_IDS'),
'TYPE' => 'LIST',
'VALUES' => $agreements,
'MULTIPLE' => 'Y',
'DEFAULT' => $defaultUserConsentId ? [$defaultUserConsentId] : '',
'REFRESH' => 'Y',
];
foreach ($userConsentIds as $userConsentId)
{
if (!is_scalar($userConsentId))
{
continue;
}
$arComponentParameters["PARAMETERS"]["USER_CONSENT_IS_LOADED"] = array(
"PARENT" => "USER_CONSENT",
"NAME" => GetMessage("COMP_PROP_USER_CONSENT_IS_LOADED"),
"TYPE" => "CHECKBOX",
"DEFAULT" => "N",
"ADDITIONAL_VALUES" => "N"
);
$userConsentId = (int)$userConsentId;
if ($userConsentId <= 0)
{
continue;
}
if (!isset($agreements[$userConsentId]))
{
continue;
}
$arComponentParameters['PARAMETERS']['USER_CONSENT_IS_CHECKED_' . $userConsentId] = [
'PARENT' => 'USER_CONSENT',
'NAME' => GetMessage(
'COMP_PROP_USER_CONSENT_IS_CHECKED_WITH_NAME',
['#NAME#' => $agreements[$userConsentId]],
),
'TYPE' => 'CHECKBOX',
'DEFAULT' => $defaultUserConsentId === $userConsentId ? $defaultUserConsentChecked : 'N',
'ADDITIONAL_VALUES' => 'N',
];
$arComponentParameters['PARAMETERS']['USER_CONSENT_REQUIRED_' . $userConsentId] = [
'PARENT' => 'USER_CONSENT',
'NAME' => GetMessage(
'COMP_PROP_USER_CONSENT_REQUIRED_WITH_NAME',
['#NAME#' => $agreements[$userConsentId]],
),
'TYPE' => 'CHECKBOX',
'DEFAULT' => 'Y',
'ADDITIONAL_VALUES' => 'N',
];
}
}
else
{
$arComponentParameters['PARAMETERS']['USER_CONSENT_ID'] = [
'PARENT' => 'USER_CONSENT',
'NAME' => GetMessage('COMP_PROP_USER_CONSENT_ID'),
'TYPE' => 'LIST',
'VALUES' => [GetMessage('COMP_PROP_USER_CONSENT_ID_DEF')] + \Bitrix\Main\UserConsent\Agreement::getActiveList(),
'MULTIPLE' => 'N',
'DEFAULT' => '',
];
$arComponentParameters['PARAMETERS']['USER_CONSENT_IS_CHECKED'] = [
'PARENT' => 'USER_CONSENT',
'NAME' => GetMessage('COMP_PROP_USER_CONSENT_IS_CHECKED'),
'TYPE' => 'CHECKBOX',
'DEFAULT' => 'Y',
'ADDITIONAL_VALUES' => 'N'
];
}
$arComponentParameters['PARAMETERS']['USER_CONSENT_IS_LOADED'] = [
'PARENT' => 'USER_CONSENT',
'NAME' => GetMessage('COMP_PROP_USER_CONSENT_IS_LOADED'),
'TYPE' => 'CHECKBOX',
'DEFAULT' => 'N',
'ADDITIONAL_VALUES' => 'N'
];
}
else
{
@@ -1,17 +1,15 @@
<?php
/**
* Bitrix Framework
* @package bitrix
* @subpackage main
* @copyright 2001-2020 Bitrix
* @copyright 2001-2025 Bitrix
*/
use Bitrix\Main\Mail;
/**
* @deprecated
*/
class CAllEvent
class CEvent
{
public static $EVENT_SITE_PARAMS = [];
@@ -30,49 +28,37 @@ class CAllEvent
return Mail\EventManager::cleanUpAgent();
}
public static function SendImmediate($event, $lid, $arFields, $Duplicate = "Y", $message_id = "", $files = array(), $languageId = '', array $filesContent = [])
public static function SendImmediate($event, $lid, $arFields, $Duplicate = "Y", $message_id = "", $files = [], $languageId = '', array $filesContent = [])
{
foreach(GetModuleEvents("main", "OnBeforeEventAdd", true) as $arEvent)
if(ExecuteModuleEventEx($arEvent, array(&$event, &$lid, &$arFields, &$message_id, &$files, &$languageId)) === false)
return false;
if(!is_array($arFields))
{
$arFields = array();
}
$arLocalFields = array(
$arLocalFields = [
"EVENT_NAME" => $event,
"C_FIELDS" => $arFields,
"LID" => (is_array($lid)? implode(",", $lid) : $lid),
"DUPLICATE" => ($Duplicate != "N"? "Y" : "N"),
"MESSAGE_ID" => (intval($message_id) > 0? intval($message_id): ""),
"LID" => $lid,
"DUPLICATE" => ($Duplicate != "N" ? "Y" : "N"),
"MESSAGE_ID" => (intval($message_id) > 0 ? intval($message_id) : ""),
"DATE_INSERT" => GetTime(time(), "FULL"),
"FILE" => $files,
"LANGUAGE_ID" => ($languageId == ''? LANGUAGE_ID : $languageId),
"LANGUAGE_ID" => ($languageId == '' ? LANGUAGE_ID : $languageId),
"ID" => "0",
"FILES_CONTENT" => $filesContent,
);
];
return Mail\Event::sendImmediate($arLocalFields);
$result = Mail\Event::sendImmediate($arLocalFields);
return $result === Mail\Event::SEND_RESULT_NONE ? false : $result;
}
public static function Send($event, $lid, $arFields, $Duplicate = "Y", $message_id="", $files=array(), $languageId = '')
public static function Send($event, $lid, $arFields, $Duplicate = "Y", $message_id = "", $files = [], $languageId = '')
{
foreach(GetModuleEvents("main", "OnBeforeEventAdd", true) as $arEvent)
if(ExecuteModuleEventEx($arEvent, array(&$event, &$lid, &$arFields, &$message_id, &$files, &$languageId)) === false)
return false;
$arLocalFields = array(
$arLocalFields = [
"EVENT_NAME" => $event,
"C_FIELDS" => $arFields,
"LID" => (is_array($lid)? implode(",", $lid) : $lid),
"DUPLICATE" => ($Duplicate != "N"? "Y" : "N"),
"LID" => $lid,
"DUPLICATE" => ($Duplicate != "N" ? "Y" : "N"),
"MESSAGE_ID" => (intval($message_id) > 0 ? intval($message_id) : ""),
"FILE" => $files,
"LANGUAGE_ID" => ($languageId == ''? LANGUAGE_ID : $languageId),
);
if(intval($message_id) > 0)
$arLocalFields["MESSAGE_ID"] = intval($message_id);
"LANGUAGE_ID" => ($languageId == '' ? LANGUAGE_ID : $languageId),
];
$result = Mail\Event::send($arLocalFields);
@@ -86,16 +72,18 @@ class CAllEvent
public static function fieldencode($s)
{
if(is_array($s))
if (is_array($s))
{
$ret_val = '';
foreach($s as $v)
$ret_val .= ($ret_val <> ''? ', ':'').CEvent::fieldencode($v);
foreach ($s as $v)
{
$ret_val .= ($ret_val <> '' ? ', ' : '') . CEvent::fieldencode($v);
}
}
else
{
$ret_val = str_replace("%", "%2", $s);
$ret_val = str_replace("&","%1", $ret_val);
$ret_val = str_replace("&", "%1", $ret_val);
$ret_val = str_replace("=", "%3", $ret_val);
}
return $ret_val;
@@ -104,8 +92,8 @@ class CAllEvent
public static function ExtractMailFields($str)
{
$ar = explode("&", $str);
$newar = array();
foreach($ar as $val)
$newar = [];
foreach ($ar as $val)
{
$val = str_replace("%1", "&", $val);
$tar = explode("=", $val);
@@ -115,54 +103,60 @@ class CAllEvent
$val = str_replace("%3", "=", $val);
$key = str_replace("%2", "%", $key);
$val = str_replace("%2", "%", $val);
if($key != "")
if ($key != "")
{
$newar[$key] = $val;
}
}
return $newar;
}
public static function GetSiteFieldsArray($site_id)
{
if($site_id !== false && isset(static::$EVENT_SITE_PARAMS[$site_id]))
if ($site_id !== false && isset(static::$EVENT_SITE_PARAMS[$site_id]))
{
return static::$EVENT_SITE_PARAMS[$site_id];
}
$SITE_NAME = COption::GetOptionString("main", "site_name", $GLOBALS["SERVER_NAME"]);
$SERVER_NAME = COption::GetOptionString("main", "server_name", $GLOBALS["SERVER_NAME"]);
$DEFAULT_EMAIL_FROM = COption::GetOptionString("main", "email_from", "admin@".$GLOBALS["SERVER_NAME"]);
$DEFAULT_EMAIL_FROM = COption::GetOptionString("main", "email_from", "admin@" . $GLOBALS["SERVER_NAME"]);
if($site_id <> '')
if ($site_id <> '')
{
$dbSite = CSite::GetByID($site_id);
if($arSite = $dbSite->Fetch())
if ($arSite = $dbSite->Fetch())
{
static::$EVENT_SITE_PARAMS[$site_id] = array(
"SITE_NAME" => ($arSite["SITE_NAME"]<>''? $arSite["SITE_NAME"] : $SITE_NAME),
"SERVER_NAME" => ($arSite["SERVER_NAME"]<>''? $arSite["SERVER_NAME"] : $SERVER_NAME),
"DEFAULT_EMAIL_FROM" => ($arSite["EMAIL"]<>''? $arSite["EMAIL"] : $DEFAULT_EMAIL_FROM),
static::$EVENT_SITE_PARAMS[$site_id] = [
"SITE_NAME" => ($arSite["SITE_NAME"] <> '' ? $arSite["SITE_NAME"] : $SITE_NAME),
"SERVER_NAME" => ($arSite["SERVER_NAME"] <> '' ? $arSite["SERVER_NAME"] : $SERVER_NAME),
"DEFAULT_EMAIL_FROM" => ($arSite["EMAIL"] <> '' ? $arSite["EMAIL"] : $DEFAULT_EMAIL_FROM),
"SITE_ID" => $arSite['ID'],
"SITE_DIR" => $arSite['DIR'],
);
];
return static::$EVENT_SITE_PARAMS[$site_id];
}
}
return array(
return [
"SITE_NAME" => $SITE_NAME,
"SERVER_NAME" => $SERVER_NAME,
"DEFAULT_EMAIL_FROM" => $DEFAULT_EMAIL_FROM
);
"DEFAULT_EMAIL_FROM" => $DEFAULT_EMAIL_FROM,
];
}
public static function ReplaceTemplate($str, $ar, $bNewLineToBreak=false)
public static function ReplaceTemplate($str, $ar, $bNewLineToBreak = false)
{
$str = str_replace("%", "%2", $str);
foreach($ar as $key=>$val)
foreach ($ar as $key => $val)
{
if($bNewLineToBreak && !str_contains($val, "<"))
if ($bNewLineToBreak && !str_contains($val, "<"))
{
$val = nl2br($val);
}
$val = str_replace("%", "%2", $val);
$val = str_replace("#", "%1", $val);
$str = str_replace("#".$key."#", $val, $str);
$str = str_replace("#" . $key . "#", $val, $str);
}
$str = str_replace("%1", "#", $str);
$str = str_replace("%2", "%", $str);
@@ -215,7 +209,7 @@ class CAllEvent
*/
public static function HandleEvent($arEvent)
{
if(isset($arEvent['C_FIELDS']))
if (isset($arEvent['C_FIELDS']))
{
$arEvent['FIELDS'] = $arEvent['C_FIELDS'];
unset($arEvent['C_FIELDS']);
@@ -224,7 +218,3 @@ class CAllEvent
return Mail\Event::handleEvent($arEvent);
}
}
class CEvent extends CAllEvent
{
}
@@ -370,6 +370,9 @@ class CEventLog
"USER_DELETE" => "[USER_DELETE] " . GetMessage("MAIN_EVENTLOG_USER_DELETE"),
"USER_INFO" => "[USER_INFO] " . GetMessage("MAIN_EVENTLOG_USER_INFO"),
"USER_LOGIN" => "[USER_LOGIN] " . GetMessage("MAIN_EVENTLOG_USER_LOGIN"),
"USER_LOGIN_INCORRECT_CAPTCHA" => "[USER_LOGIN_INCORRECT_CAPTCHA] " . GetMessage("MAIN_EVENTLOG_USER_LOGIN_INCORRECT_CAPTCHA"),
"USER_LOGIN_BLOCKED" => "[USER_LOGIN_BLOCKED] " . GetMessage("MAIN_EVENTLOG_USER_LOGIN_BLOCKED"),
"USER_LOGIN_NOT_FOUND" => "[USER_LOGIN_NOT_FOUND] " . GetMessage("MAIN_EVENTLOG_USER_LOGIN_NOT_FOUND"),
"USER_LOGINBYHASH" => "[USER_LOGINBYHASH] " . GetMessage("MAIN_EVENTLOG_USER_LOGINBYHASH_FAILED"),
"USER_LOGOUT" => "[USER_LOGOUT] " . GetMessage("MAIN_EVENTLOG_USER_LOGOUT"),
"USER_PASSWORD_CHANGED" => "[USER_PASSWORD_CHANGED] " . GetMessage("MAIN_EVENTLOG_USER_PASSWORD_CHANGED"),
@@ -8,6 +8,7 @@
use Bitrix\Main\Mail;
use Bitrix\Main\Mail\Internal\EventTypeTable;
use Bitrix\Main\ORM\Query\Query;
IncludeModuleLangFile(__FILE__);
@@ -947,7 +948,7 @@ class CEventType
$arSearch['!EVENT_NAME'] = null;
$arQuerySelect = ['ID1' => 'EVENT_NAME', 'EVENT_NAME1' => 'EVENT_NAME'];
$query1 = new \Bitrix\Main\Entity\Query(Mail\Internal\EventMessageTable::getEntity());
$query1 = new Query(Mail\Internal\EventMessageTable::getEntity());
$query1->setSelect($arQuerySelect);
$query1->setFilter(array_merge($arSearch, $arSearch1));
$query1->registerRuntimeField('EVENT_MESSAGE_TYPE', [
@@ -955,7 +956,7 @@ class CEventType
'reference' => ['=this.EVENT_NAME' => 'ref.EVENT_NAME'],
]);
$query2 = new \Bitrix\Main\Entity\Query(Mail\Internal\EventTypeTable::getEntity());
$query2 = new Query(Mail\Internal\EventTypeTable::getEntity());
$query2->setSelect($arQuerySelect);
$query2->setFilter(array_merge($arSearch, $arSearch2));
$query2->registerRuntimeField('EVENT_MESSAGE', [
+137 -156
View File
@@ -18,6 +18,7 @@ use Bitrix\Main\File\Image\Rectangle;
use Bitrix\Main\File\Internal;
use Bitrix\Main\ORM\Query;
use Bitrix\Main\Security;
use Bitrix\Main\Web\Http\Range;
IncludeModuleLangFile(__FILE__);
@@ -2786,15 +2787,15 @@ function ImgShw(ID, width, height, alt)
/**
* @param int|array $arFile
* @param array $arOptions
* @param array $options
* @return bool
*/
public static function ViewByUser($arFile, $arOptions = [])
public static function ViewByUser($arFile, $options = [])
{
$previewManager = new Viewer\PreviewManager();
if ($previewManager->isInternalRequest($arFile, $arOptions))
if ($previewManager->isInternalRequest($arFile, $options))
{
$previewManager->processViewByUserRequest($arFile, $arOptions);
$previewManager->processViewByUserRequest($arFile, $options);
}
/** @global CMain $APPLICATION */
@@ -2802,46 +2803,41 @@ function ImgShw(ID, width, height, alt)
$fastDownload = (COption::GetOptionString('main', 'bx_fast_download', 'N') == 'Y');
$attachment_name = "";
$content_type = "";
$specialchars = false;
$force_download = false;
$cache_time = 10800;
$attachmentName = "";
$contentType = "";
$forceDownload = false;
$cacheTime = 10800;
$fromClouds = false;
$filename = '';
$fromTemp = false;
if (is_array($arOptions))
if (is_array($options))
{
if (isset($arOptions["content_type"]))
if (isset($options["content_type"]))
{
$content_type = $arOptions["content_type"];
$contentType = $options["content_type"];
}
if (isset($arOptions["specialchars"]))
if (isset($options["force_download"]))
{
$specialchars = $arOptions["specialchars"];
$forceDownload = $options["force_download"];
}
if (isset($arOptions["force_download"]))
if (isset($options["cache_time"]))
{
$force_download = $arOptions["force_download"];
$cacheTime = intval($options["cache_time"]);
}
if (isset($arOptions["cache_time"]))
if (isset($options["attachment_name"]))
{
$cache_time = intval($arOptions["cache_time"]);
$attachmentName = $options["attachment_name"];
}
if (isset($arOptions["attachment_name"]))
if (isset($options["fast_download"]))
{
$attachment_name = $arOptions["attachment_name"];
}
if (isset($arOptions["fast_download"]))
{
$fastDownload = (bool)$arOptions["fast_download"];
$fastDownload = (bool)$options["fast_download"];
}
}
if ($cache_time < 0)
if ($cacheTime < 0)
{
$cache_time = 0;
$cacheTime = 0;
}
if (is_array($arFile))
@@ -2878,21 +2874,21 @@ function ImgShw(ID, width, height, alt)
return false;
}
if ($content_type == '' && isset($arFile["CONTENT_TYPE"]))
if ($contentType == '' && isset($arFile["CONTENT_TYPE"]))
{
$content_type = $arFile["CONTENT_TYPE"];
$contentType = $arFile["CONTENT_TYPE"];
}
//we produce resized jpg for original bmp
if ($content_type == '' || $content_type == "image/bmp")
if ($contentType == '' || $contentType == "image/bmp")
{
if (isset($arFile["tmp_name"]))
{
$content_type = static::GetContentType($arFile["tmp_name"], true);
$contentType = static::GetContentType($arFile["tmp_name"], true);
}
else
{
$content_type = static::GetContentType($_SERVER["DOCUMENT_ROOT"] . $filename);
$contentType = static::GetContentType($_SERVER["DOCUMENT_ROOT"] . $filename);
}
}
@@ -2915,30 +2911,25 @@ function ImgShw(ID, width, height, alt)
$name = str_replace(["\n", "\r"], '', $name);
if ($attachment_name)
if ($attachmentName)
{
$attachment_name = str_replace(["\n", "\r"], '', $attachment_name);
$attachmentName = str_replace(["\n", "\r"], '', $attachmentName);
}
else
{
$attachment_name = $name;
$attachmentName = $name;
}
if (!$force_download)
if (!$forceDownload)
{
if (!static::IsImage($name, $content_type) || $arFile["HEIGHT"] <= 0 || $arFile["WIDTH"] <= 0)
if (!static::IsImage($name, $contentType) || $arFile["HEIGHT"] <= 0 || $arFile["WIDTH"] <= 0)
{
//only valid images can be downloaded inline
$force_download = true;
$forceDownload = true;
}
}
$content_type = Web\MimeType::normalize($content_type);
if ($force_download)
{
$specialchars = false;
}
$contentType = Web\MimeType::normalize($contentType);
$src = null;
$file = null;
@@ -2947,7 +2938,7 @@ function ImgShw(ID, width, height, alt)
{
$file = new IO\File($_SERVER['DOCUMENT_ROOT'] . $filename);
}
elseif (isset($arFile['tmp_name']))
elseif (!empty($arFile['tmp_name']))
{
$file = new IO\File($arFile['tmp_name']);
}
@@ -2978,35 +2969,43 @@ function ImgShw(ID, width, height, alt)
$APPLICATION->RestartBuffer();
$APPLICATION->EndBufferContentMan();
$cur_pos = 0;
$response = \Bitrix\Main\Context::getCurrent()->getResponse();
$curPos = 0;
$filesize = (isset($arFile["FILE_SIZE"]) && (int)$arFile["FILE_SIZE"] > 0 ? (int)$arFile["FILE_SIZE"] : (int)($arFile["size"] ?? 0));
$size = $filesize - 1;
$p = strpos($_SERVER["HTTP_RANGE"] ?? '', "=");
if (intval($p) > 0)
$contentLength = $filesize;
$range = null;
$acceptRanged = is_resource($src) || $fastDownload;
if (!empty($_SERVER["HTTP_RANGE"]) && $acceptRanged)
{
$bytes = substr($_SERVER["HTTP_RANGE"], $p + 1);
$p = strpos($bytes, "-");
if ($p !== false)
$ranges = Range::createFromString($_SERVER["HTTP_RANGE"], $filesize);
if ($ranges === null || count($ranges) > 1)
{
$cur_pos = (float)substr($bytes, 0, $p);
$size = (float)substr($bytes, $p + 1);
if ($size <= 0)
{
$size = $filesize - 1;
}
if ($cur_pos > $size)
{
$cur_pos = 0;
$size = $filesize - 1;
}
// TODO: Multiple ranges are not supported
$response
->setStatus("416 Requested Range Not Satisfiable")
->addHeader("Content-Range", "bytes */$filesize")
;
$response->writeHeaders();
self::terminate();
}
$range = $ranges[0];
$curPos = $range->getStart();
$size = $range->getEnd();
$contentLength = $size - $curPos + 1;
}
if ($file instanceof IO\File)
{
$filetime = $file->getModificationTime();
}
elseif (isset($arFile["tmp_name"]) && $arFile["tmp_name"] <> '')
elseif (!empty($arFile["tmp_name"]))
{
$tmpFile = new IO\File($arFile["tmp_name"]);
$filetime = $tmpFile->getModificationTime();
@@ -3016,32 +3015,40 @@ function ImgShw(ID, width, height, alt)
$filetime = intval(MakeTimeStamp($arFile["TIMESTAMP_X"]));
}
$response = \Bitrix\Main\Context::getCurrent()->getResponse();
if ($_SERVER["REQUEST_METHOD"] == "HEAD")
{
$response->setStatus("200 OK")
->addHeader("Accept-Ranges", "bytes")
->addHeader("Content-Type", $content_type)
->addHeader("Content-Length", ($size - $cur_pos + 1))
$response
->setStatus("200 OK")
->addHeader("Content-Type", $contentType)
->addHeader("Content-Length", $contentLength)
;
if ($acceptRanged)
{
// ranges are supported only for local files
$response->addHeader("Accept-Ranges", "bytes");
}
if ($filetime > 0)
{
$response->addHeader("Last-Modified", date("r", $filetime));
}
$response->writeHeaders();
}
else
{
$lastModified = '';
if ($cache_time > 0)
if ($cacheTime > 0)
{
//Handle ETag
$ETag = md5($filename . $filesize . $filetime);
if (array_key_exists("HTTP_IF_NONE_MATCH", $_SERVER) && ($_SERVER['HTTP_IF_NONE_MATCH'] === $ETag))
if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] === $ETag)
{
$response->setStatus("304 Not Modified");
$response->addHeader("Cache-Control", "private, max-age=" . $cache_time . ", pre-check=" . $cache_time);
$response
->setStatus("304 Not Modified")
->addHeader("Cache-Control", "private, max-age=" . $cacheTime . ", pre-check=" . $cacheTime)
;
$response->writeHeaders();
self::terminate();
@@ -3053,10 +3060,12 @@ function ImgShw(ID, width, height, alt)
if ($filetime > 0)
{
$lastModified = gmdate('D, d M Y H:i:s', $filetime) . ' GMT';
if (array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER) && ($_SERVER['HTTP_IF_MODIFIED_SINCE'] === $lastModified))
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] === $lastModified)
{
$response->setStatus("304 Not Modified");
$response->addHeader("Cache-Control", "private, max-age=" . $cache_time . ", pre-check=" . $cache_time);
$response
->setStatus("304 Not Modified")
->addHeader("Cache-Control", "private, max-age=" . $cacheTime . ", pre-check=" . $cacheTime)
;
$response->writeHeaders();
self::terminate();
@@ -3064,54 +3073,40 @@ function ImgShw(ID, width, height, alt)
}
}
$utfName = Uri::urnEncode($attachment_name);
$translitName = CUtil::translit($attachment_name, LANGUAGE_ID, [
$utfName = Uri::urnEncode($attachmentName);
$translitName = CUtil::translit($attachmentName, LANGUAGE_ID, [
"max_len" => 1024,
"safe_chars" => ".",
"replace_space" => '-',
"change_case" => false,
]);
if ($force_download)
// $range shows that we are sending partial content (range request)
if ($range)
{
//Disable zlib for old versions of php <= 5.3.0
//it has broken Content-Length handling
if (ini_get('zlib.output_compression'))
{
ini_set('zlib.output_compression', 'Off');
}
// $p shows that we are sending partial content (range request)
if ($p)
{
$response->setStatus("206 Partial Content");
}
else
{
$response->SetStatus("200 OK");
}
$response->addHeader("Content-Type", $content_type)
->addHeader("Content-Disposition", "attachment; filename=\"" . $translitName . "\"; filename*=utf-8''" . $utfName)
->addHeader("Content-Transfer-Encoding", "binary")
->addHeader("Content-Length", ($size - $cur_pos + 1))
$response
->setStatus("206 Partial Content")
->addHeader("Accept-Ranges", "bytes")
->addHeader("Content-Range", "bytes " . $range->getStart() . "-" . $range->getEnd() . "/" . $filesize)
;
if (is_resource($src))
{
$response->addHeader("Accept-Ranges", "bytes");
$response->addHeader("Content-Range", "bytes " . $cur_pos . "-" . $size . "/" . $filesize);
}
}
else
{
$response->addHeader("Content-Type", $content_type);
$response->addHeader("Content-Disposition", "inline; filename=\"" . $translitName . "\"; filename*=utf-8''" . $utfName);
$response->SetStatus("200 OK");
}
if ($cache_time > 0)
$contentDisposition = $forceDownload ? "attachment" : "inline";
$response
->addHeader("Content-Type", $contentType)
->addHeader("Content-Disposition", $contentDisposition . "; filename=\"" . $translitName . "\"; filename*=utf-8''" . $utfName)
->addHeader("Content-Transfer-Encoding", "binary")
->addHeader('Content-Length', $contentLength)
;
if ($cacheTime > 0)
{
$response->addHeader("Cache-Control", "private, max-age=" . $cache_time . ", pre-check=" . $cache_time);
$response->addHeader("Cache-Control", "private, max-age=" . $cacheTime . ", pre-check=" . $cacheTime);
if ($filetime > 0)
{
$response->addHeader('Last-Modified', $lastModified);
@@ -3122,80 +3117,66 @@ function ImgShw(ID, width, height, alt)
$response->addHeader("Cache-Control", "no-cache, must-revalidate, post-check=0, pre-check=0");
}
$response->addHeader("Expires", "0");
$response->addHeader("Pragma", "public");
$response
->addHeader("Expires", "0")
->addHeader("Pragma", "public")
;
$filenameEncoded = Uri::urnEncode($filename);
// Download from front-end
if ($fastDownload)
{
// Download from front-end
$filenameEncoded = Uri::urnEncode($filename);
if ($fromClouds)
{
$filenameDisableProto = preg_replace('~^(https?)(\://)~i', '\\1.', $filenameEncoded);
$filenameDisableProto = preg_replace('~^(https?)(://)~i', '\\1.', $filenameEncoded);
$cloudUploadPath = COption::GetOptionString('main', 'bx_cloud_upload', '/upload/bx_cloud_upload/');
$response->addHeader('X-Accel-Redirect', rawurlencode($cloudUploadPath . $filenameDisableProto));
}
else
{
$response->addHeader('X-Accel-Redirect', $filenameEncoded);
$filenameEncoded = rawurlencode($cloudUploadPath . $filenameDisableProto);
}
$response->addHeader('X-Accel-Redirect', $filenameEncoded);
$response->writeHeaders();
self::terminate();
}
else
{
ini_set('zlib.output_compression', 'Off');
session_write_close();
$response->writeHeaders();
if ($specialchars)
if (is_resource($src))
{
// read local file
/** @var IO\File $file */
echo "<", "pre", ">";
if (is_resource($src))
$file->seek($curPos);
while (!feof($src) && ($curPos <= $size))
{
while (!feof($src))
$bufsize = 131072; //128K
if ($curPos + $bufsize > $size)
{
echo htmlspecialcharsbx(fread($src, 32768));
$bufsize = $size - $curPos + 1;
}
$file->close();
$curPos += $bufsize;
echo fread($src, $bufsize);
}
else
{
/** @var Web\HttpClient $src */
echo htmlspecialcharsbx($src->get($filenameEncoded));
}
echo "<", "/pre", ">";
$file->close();
}
else
{
if (is_resource($src))
{
/** @var IO\File $file */
$file->seek($cur_pos);
while (!feof($src) && ($cur_pos <= $size))
{
$bufsize = 131072; //128K
if ($cur_pos + $bufsize > $size)
{
$bufsize = $size - $cur_pos + 1;
}
$cur_pos += $bufsize;
echo fread($src, $bufsize);
}
$file->close();
}
else
{
$fp = fopen("php://output", "wb");
/** @var Web\HttpClient $src */
$src->setOutputStream($fp);
$src->get($filenameEncoded);
}
// download file by URI
$filenameEncoded = Uri::urnEncode($filename);
$fp = fopen("php://output", "wb");
/** @var Web\HttpClient $src */
$src->setOutputStream($fp);
$src->get($filenameEncoded);
}
flush();
self::terminate();
}
}
self::terminate();
return true;
}
@@ -51,7 +51,14 @@ class CAllGroup
}
$fields = $arFields;
unset($fields["USER_ID"]);
unset($fields['~ID']);
unset($fields['USER_ID']);
if (isset($arFields['~ID']))
{
$fields['ID'] = $arFields['~ID'];
}
$result = GroupTable::add($fields);
$ID = $result->getId();
@@ -518,37 +518,44 @@ class CHTTP
/**
* @deprecated Use \Bitrix\Main\Web\Uri::addParams().
*/
public static function urlAddParams($url, $add_params, $options = array())
public static function urlAddParams($url, $add_params, $options = [])
{
if(!empty($add_params))
if (!empty($add_params))
{
$params = array();
foreach($add_params as $name => $value)
$params = [];
foreach ($add_params as $name => $value)
{
if(($options["skip_empty"] ?? false) && (string)$value == '')
continue;
if(($options["encode"] ?? false))
$params[] = urlencode($name).'='.urlencode($value);
else
$params[] = $name.'='.$value;
}
if(!empty($params))
{
$p1 = mb_strpos($url, "?");
if($p1 === false)
$ch = "?";
else
$ch = "&";
$p2 = mb_strpos($url, "#");
if($p2===false)
if (is_array($value))
{
$url = $url.$ch.implode("&", $params);
// arrays are unsupported, use \Bitrix\Main\Web\Uri::addParams()
continue;
}
if (!empty($options["skip_empty"]) && (string)$value == '')
{
continue;
}
if (!empty($options["encode"]))
{
$params[] = urlencode($name) . '=' . urlencode($value);
}
else
{
$url = mb_substr($url, 0, $p2).$ch.implode("&", $params).mb_substr($url, $p2);
$params[] = $name . '=' . $value;
}
}
if (!empty($params))
{
$ch = (mb_strpos($url, "?") === false ? "?" : "&");
$p2 = mb_strpos($url, "#");
if ($p2 === false)
{
$url = $url . $ch . implode("&", $params);
}
else
{
$url = mb_substr($url, 0, $p2) . $ch . implode("&", $params) . mb_substr($url, $p2);
}
}
}
@@ -130,84 +130,6 @@ class CUpdateSystem
return true;
}
/** Активирует лицензионный ключ **/
public static function ActivateLicenseKey($arFields, &$strError, $lang = false, $stableVersionsOnly = "Y")
{
$strError_tmp = "";
CUpdateSystem::AddMessage2Log("exec CUpdateSystem::ActivateLicenseKey");
$stableVersionsOnly = (($stableVersionsOnly == "N") ? "N" : "Y");
if ($lang===false)
$lang = LANGUAGE_ID;
$GLOBALS["DB"]->GetVersion();
$strVars = "LICENSE_KEY=".urlencode(md5(CUpdateSystem::GetLicenseKey())).
"&CLIENT_SITE=".urlencode($_SERVER["SERVER_NAME"]).
"&CANGZIP=".urlencode((CUpdateSystem::IsGzipInstalled()) ? "Y" : "N").
"&UTYPES=".urlencode("A").
"&COUNT_ONLY=".urlencode("N").
"&SUPD_STS=".urlencode(CUpdateSystem::GetFooPath("GetList")).
"&SUPD_DBS=".urlencode($GLOBALS["DB"]->type).
"&XE=".urlencode((isset($GLOBALS["DB"]->XE) && $GLOBALS["DB"]->XE) ? "Y" : "N").
"&SUPD_VER=".urlencode(UPDATE_SYSTEM_VERSION).
"&CLIENT_PHPVER=".urlencode(phpversion()).
"&stable=".urlencode($stableVersionsOnly).
"&lang=".urlencode($lang);
foreach ($arFields as $key => $value)
{
$strVars .= "&".$key."=".urlencode($value);
}
CUpdateSystem::AddMessage2Log(preg_replace("/LICENSE_KEY=[^&]*/i", "LICENSE_KEY=X", $strVars));
$stime = microtime(true);
$content = CUpdateSystem::getHTTPPage("bit_sysserver.php", $strVars, $strError_tmp);
CUpdateSystem::AddMessage2Log("TIME ActivateLicenseKey.getHTTPPage ".round(microtime(true)-$stime,3)." sec");
if ($content == '')
$strError_tmp .= "[UALK01] ".GetMessage("SUPP_AS_EMPTY_RESP").".<br>";
if ($strError_tmp == '')
{
$arRes = Array();
CUpdateSystem::ParseServerData($content, $arRes, $strError_tmp);
}
if ($strError_tmp == '')
{
if (isset($arRes["DATA"]["#"]["ERROR"])
&& is_array($arRes["DATA"]["#"]["ERROR"])
&& !empty($arRes["DATA"]["#"]["ERROR"]))
{
for ($i = 0, $n = count($arRes["DATA"]["#"]["ERROR"]); $i < $n; $i++)
{
if ($arRes["DATA"]["#"]["ERROR"][$i]["@"]["TYPE"] <> '')
$strError_tmp .= "[".$arRes["DATA"]["#"]["ERROR"][$i]["@"]["TYPE"]."] ";
$strError_tmp .= $arRes["DATA"]["#"]["ERROR"][$i]["#"].".<br>";
}
}
}
if ($strError_tmp == '')
{
CUpdateSystem::AddMessage2Log("License key activated successfully!", "CUALK");
}
if ($strError_tmp <> '')
{
CUpdateSystem::AddMessage2Log($strError_tmp, "CUALK");
$strError .= $strError_tmp;
return false;
}
else
return true;
}
// Регистрирует копию продукта, если можно
public static function RegisterVersion(&$strError, $lang = false, $stableVersionsOnly = "Y")
{
File diff suppressed because one or more lines are too long
@@ -1720,6 +1720,7 @@ class CAllUser extends CDBResult
$result_message = true;
$user_id = 0;
$error = [];
$context = (new Authentication\Context())
->setMethod(Method::Password)
;
@@ -1777,7 +1778,7 @@ class CAllUser extends CDBResult
if ($user_id <= 0)
{
//internal authentication OR application password for external user
$user_id = static::LoginInternal($arParams, $result_message, $context);
$user_id = static::LoginInternal($arParams, $result_message, $context, $error);
if ($user_id <= 0)
{
@@ -1885,7 +1886,10 @@ class CAllUser extends CDBResult
if ($doAuthorize && $result_message !== true && (Option::get('main', 'event_log_login_fail', 'N') === 'Y'))
{
CEventLog::Log(CEventLog::SEVERITY_SECURITY, 'USER_LOGIN', 'main', $login, $result_message['MESSAGE']);
$auditType = $error['auditType'] ?? 'USER_LOGIN';
$info = $error['info'] ?? [];
$info['message'] = $result_message['MESSAGE'];
CEventLog::Log(CEventLog::SEVERITY_SECURITY, $auditType, 'main', $login, $info);
}
return $arParams["RESULT_MESSAGE"];
@@ -1896,9 +1900,10 @@ class CAllUser extends CDBResult
* @param array $arParams
* @param array|bool $result_message
* @param Authentication\Context|null $context
* @param array $error
* @return int User ID on success or 0 on failure. Additionally, $result_message will hold an error.
*/
public static function LoginInternal(&$arParams, &$result_message = true, $context = null)
public static function LoginInternal(&$arParams, &$result_message = true, $context = null, &$error = [])
{
global $DB, $APPLICATION;
@@ -1932,6 +1937,13 @@ class CAllUser extends CDBResult
$original = isset($arParams["PASSWORD_ORIGINAL"]) && $arParams["PASSWORD_ORIGINAL"] === 'Y';
$loginAttempts = intval($arUser["LOGIN_ATTEMPTS"]) + 1;
$error['info'] = [
'userId' => $arUser["ID"],
'active' => $arUser["ACTIVE"],
'blocked' => $arUser["BLOCKED"],
'loginAttempts' => $loginAttempts,
];
if ($arUser["BLOCKED"] != 'Y')
{
$policy = static::getPolicy($arUser["ID"]);
@@ -1944,6 +1956,9 @@ class CAllUser extends CDBResult
$APPLICATION->SetNeedCAPTHA(true);
if (!$APPLICATION->CaptchaCheckCode($_REQUEST["captcha_word"] ?? '', $_REQUEST["captcha_sid"] ?? ''))
{
$error['auditType'] = 'USER_LOGIN_INCORRECT_CAPTCHA';
$error['info']['policyLoginAttempts'] = $policyLoginAttempts;
$correctCaptcha = false;
}
}
@@ -2001,6 +2016,10 @@ class CAllUser extends CDBResult
}
}
}
else
{
$error['auditType'] = 'USER_LOGIN_BLOCKED';
}
if ($passwordCorrect)
{
@@ -2029,6 +2048,7 @@ class CAllUser extends CDBResult
{
//require to change the password right now
$passwordExpired = true;
$error['info']['passwordExpired'] = 'Y';
}
if (!$passwordExpired && $original && $policy->getPasswordCheckPolicy())
{
@@ -2037,6 +2057,7 @@ class CAllUser extends CDBResult
{
//require to change the password because it doesn't match the group policy
$passwordExpired = true;
$error['info']['passwordExpired'] = 'Policy';
}
}
if (!$passwordExpired)
@@ -2048,6 +2069,8 @@ class CAllUser extends CDBResult
if (UserPasswordTable::passwordExpired($arUser["ID"], $policyChangeDays))
{
$passwordExpired = true;
$error['info']['passwordExpired'] = 'Days';
$error['info']['passwordExpiredDays'] = $policyChangeDays;
}
}
}
@@ -2099,6 +2122,10 @@ class CAllUser extends CDBResult
$DB->Query("UPDATE b_user SET LOGIN_ATTEMPTS = " . $loginAttempts . ", TIMESTAMP_X = TIMESTAMP_X WHERE ID = " . intval($arUser["ID"]));
}
}
else
{
$error['auditType'] = 'USER_LOGIN_NOT_FOUND';
}
if ($user_id == 0)
{
@@ -4328,10 +4355,17 @@ class CAllUser extends CDBResult
return $groups;
}
public static function GetCount()
public static function GetCount($maxCount = 0)
{
global $DB;
$r = $DB->Query("SELECT COUNT('x') as C FROM b_user");
if ($maxCount > 0)
{
$r = $DB->Query("SELECT COUNT('x') as C FROM (SELECT ID from b_user limit " . intval($maxCount) . ") t");
}
else
{
$r = $DB->Query("SELECT COUNT('x') as C FROM b_user");
}
$r = $r->Fetch();
return intval($r["C"]);
}
@@ -2,7 +2,7 @@
use Bitrix\Main\Application;
use Bitrix\Main\DB\SqlExpression;
use Bitrix\Main\Entity;
use Bitrix\Main\ORM\Fields;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\Text\HtmlFilter;
use Bitrix\Main\UI\FileInputUtility;
@@ -98,7 +98,7 @@ class CUserTypeManager
if ($arUserField['MULTIPLE'] == 'Y')
{
$sqlHelper = \Bitrix\Main\Application::getConnection()->getSqlHelper();
return $sqlHelper->getColumnTypeByField(new Entity\TextField('TMP'));
return $sqlHelper->getColumnTypeByField(new Fields\TextField('TMP'));
}
else
{
@@ -2478,7 +2478,7 @@ class CUserTypeManager
* @param null|string $fieldName
* @param array $fieldParameters
*
* @return Entity\DatetimeField|Entity\FloatField|Entity\IntegerField|Entity\StringField|mixed
* @return Fields\DatetimeField|Fields\FloatField|Fields\IntegerField|Fields\StringField|mixed
* @throws Bitrix\Main\ArgumentException
*/
public function getEntityField($arUserField, $fieldName = null, $fieldParameters = [])
@@ -2494,7 +2494,7 @@ class CUserTypeManager
}
elseif ($arUserField['USER_TYPE']['USER_TYPE_ID'] == 'date')
{
$field = new Entity\DateField($fieldName, $fieldParameters);
$field = new Fields\DateField($fieldName, $fieldParameters);
}
else
{
@@ -2503,22 +2503,22 @@ class CUserTypeManager
case 'int':
case 'enum':
case 'file':
$field = (new Entity\IntegerField($fieldName, $fieldParameters))
$field = (new Fields\IntegerField($fieldName, $fieldParameters))
->configureNullable()
;
break;
case 'double':
$field = (new Entity\FloatField($fieldName, $fieldParameters))
$field = (new Fields\FloatField($fieldName, $fieldParameters))
->configureNullable()
;
break;
case 'string':
$field = (new Entity\StringField($fieldName, $fieldParameters))
$field = (new Fields\StringField($fieldName, $fieldParameters))
->configureNullable()
;
break;
case 'datetime':
$field = (new Entity\DatetimeField($fieldName, $fieldParameters))
$field = (new Fields\DatetimeField($fieldName, $fieldParameters))
->configureNullable()
->configureUseTimezone(isset($arUserField['SETTINGS']['USE_TIMEZONE']) && $arUserField['SETTINGS']['USE_TIMEZONE'] == 'Y')
;
@@ -2542,12 +2542,12 @@ class CUserTypeManager
}
/**
* @param $arUserField
* @param Entity\ScalarField $entityField
* @param $arUserField
* @param Fields\ScalarField $entityField
*
* @return Entity\ReferenceField[]
* @return Fields\Relations\Reference[]
*/
public function getEntityReferences($arUserField, Entity\ScalarField $entityField)
public function getEntityReferences($arUserField, Fields\ScalarField $entityField)
{
if (is_callable([$arUserField['USER_TYPE']['CLASS_NAME'], 'getEntityReferences']))
{
@@ -1,3 +1,3 @@
<?php
define("SM_VERSION","25.600.100");
define("SM_VERSION_DATE","2025-08-15 13:00:00"); // YYYY-MM-DD HH:MI:SS
define("SM_VERSION", "25.750.0");
define("SM_VERSION_DATE", "2025-09-09 10:49:18"); // YYYY-MM-DD HH:MI:SS
-42
View File
@@ -17,48 +17,6 @@
// include bitrix
require_once 'bootstrap.php';
// default location of composer.json
$composerJsonFile = $_SERVER["DOCUMENT_ROOT"].'/bitrix/composer.json';
// custom location of composer.json from .settings.php
$composerSettings = \Bitrix\Main\Config\Configuration::getValue('composer');
if (!empty($composerSettings['config_path']))
{
$jsonPath = $composerSettings['config_path'];
$jsonPath = ($jsonPath[0] == '/')
? $jsonPath // absolute
: realpath($_SERVER["DOCUMENT_ROOT"].'/'.$jsonPath); // relative
if (!empty($jsonPath))
{
$composerJsonFile = $jsonPath;
}
}
// default vendor path has the same parent dir as composer.json has
$vendorPath = dirname($composerJsonFile).'/vendor';
if (file_exists($composerJsonFile) && is_readable($composerJsonFile))
{
$jsonContent = json_decode(file_get_contents($composerJsonFile), true);
if (isset($jsonContent['config']['vendor-dir']))
{
$vendorPath = realpath(dirname($composerJsonFile).DIRECTORY_SEPARATOR.$jsonContent['config']['vendor-dir']);
if ($vendorPath === false)
{
throw new \Bitrix\Main\SystemException(sprintf(
'Failed to load vendor libs from %s, path \'%s\' is not readable',
$composerJsonFile, $jsonContent['config']['vendor-dir']
));
}
}
}
// include composer autoload
require $vendorPath.'/autoload.php';
// initialize symfony
use Symfony\Component\Console\Application;
@@ -16,6 +16,7 @@ foreach (
'GeoIp2' => '/vendor/geoip2/geoip2/src',
'MaxMind\\Db' => '/vendor/maxmind-db/reader/src/MaxMind/Db',
'PhpParser' => '/vendor/nikic/php-parser/lib/PhpParser',
'Recurr' => '/vendor/simshaun/recurr/src/Recurr',
]
as $namespace => $namespacePath
)
@@ -235,7 +236,6 @@ Loader::registerAutoLoadClasses(
'CAjax' => 'ajax_tools.php',
'CAllUser' => 'classes/general/user.php',
'CUser' => 'classes/general/user.php',
'CAllEvent' => 'classes/general/event.php',
'CEvent' => 'classes/general/event.php',
'CAllEventMessage' => 'classes/general/eventmessage.php',
'CEventMessage' => 'classes/general/eventmessage.php',
@@ -308,3 +308,6 @@ Loader::registerHandler([\Bitrix\Main\ORM\Loader::class, 'autoLoad']);
// old class names compatibility
require_once __DIR__ . '/compatibility.php';
// register composer classes
Loader::includeComposerAutoload();
@@ -1,74 +1,70 @@
<?php
/**
* All classes will be loaded immediately.
* In case of performance issues need to make alias-on-demand.
* E.g. Loader::registerClassAlias(original, alias), and call class_alias only when Loader gets request on particular class.
* UPDATE: Loader idea doesn't work because of type hints and instanceof - alias should be loaded before these constructions.
*/
use Bitrix\Main\Loader;
class_alias('Bitrix\Main\ORM\Fields\IReadable', 'Bitrix\Main\Entity\Field\IReadable');
class_alias('Bitrix\Main\ORM\Fields\IStorable', 'Bitrix\Main\Entity\Field\IStorable');
class_alias('Bitrix\Main\ORM\Fields\BooleanField', 'Bitrix\Main\Entity\BooleanField');
class_alias('Bitrix\Main\ORM\Fields\DateField', 'Bitrix\Main\Entity\DateField');
class_alias('Bitrix\Main\ORM\Fields\DatetimeField', 'Bitrix\Main\Entity\DatetimeField');
class_alias('Bitrix\Main\ORM\Fields\EnumField', 'Bitrix\Main\Entity\EnumField');
class_alias('Bitrix\Main\ORM\Fields\ExpressionField', 'Bitrix\Main\Entity\ExpressionField');
class_alias('Bitrix\Main\ORM\Fields\IntegerField', 'Bitrix\Main\Entity\IntegerField');
class_alias('Bitrix\Main\ORM\Fields\FloatField', 'Bitrix\Main\Entity\FloatField');
class_alias('Bitrix\Main\ORM\Fields\StringField', 'Bitrix\Main\Entity\StringField');
class_alias('Bitrix\Main\ORM\Fields\TextField', 'Bitrix\Main\Entity\TextField');
class_alias('Bitrix\Main\ORM\Fields\CryptoField', 'Bitrix\Main\Entity\CryptoField');
class_alias('Bitrix\Main\ORM\Fields\Relations\Reference', 'Bitrix\Main\Entity\ReferenceField');
class_alias('Bitrix\Main\ORM\Fields\ScalarField', 'Bitrix\Main\Entity\ScalarField');
class_alias('Bitrix\Main\ORM\Fields\Field', 'Bitrix\Main\Entity\Field');
class_alias('Bitrix\Main\ORM\Fields\FieldError', 'Bitrix\Main\Entity\FieldError');
Loader::registerClassAliases([
'Bitrix\Main\Entity\Field\IReadable' => 'Bitrix\Main\ORM\Fields\IReadable',
'Bitrix\Main\Entity\Field\IStorable' => 'Bitrix\Main\ORM\Fields\IStorable',
'Bitrix\Main\Entity\BooleanField' => 'Bitrix\Main\ORM\Fields\BooleanField',
'Bitrix\Main\Entity\DateField' => 'Bitrix\Main\ORM\Fields\DateField',
'Bitrix\Main\Entity\DatetimeField' => 'Bitrix\Main\ORM\Fields\DatetimeField',
'Bitrix\Main\Entity\EnumField' => 'Bitrix\Main\ORM\Fields\EnumField',
'Bitrix\Main\Entity\ExpressionField' => 'Bitrix\Main\ORM\Fields\ExpressionField',
'Bitrix\Main\Entity\IntegerField' => 'Bitrix\Main\ORM\Fields\IntegerField',
'Bitrix\Main\Entity\FloatField' => 'Bitrix\Main\ORM\Fields\FloatField',
'Bitrix\Main\Entity\StringField' => 'Bitrix\Main\ORM\Fields\StringField',
'Bitrix\Main\Entity\TextField' => 'Bitrix\Main\ORM\Fields\TextField',
'Bitrix\Main\Entity\CryptoField' => 'Bitrix\Main\ORM\Fields\CryptoField',
'Bitrix\Main\Entity\ReferenceField' => 'Bitrix\Main\ORM\Fields\Relations\Reference',
'Bitrix\Main\Entity\ScalarField' => 'Bitrix\Main\ORM\Fields\ScalarField',
'Bitrix\Main\Entity\Field' => 'Bitrix\Main\ORM\Fields\Field',
'Bitrix\Main\Entity\FieldError' => 'Bitrix\Main\ORM\Fields\FieldError',
class_alias('Bitrix\Main\ORM\Fields\Validators\IValidator', 'Bitrix\Main\Entity\IValidator');
class_alias('Bitrix\Main\ORM\Fields\Validators\Validator', 'Bitrix\Main\Entity\Validator\Base');
class_alias('Bitrix\Main\ORM\Fields\Validators\DateValidator', 'Bitrix\Main\Entity\Validator\Date');
class_alias('Bitrix\Main\ORM\Fields\Validators\EnumValidator', 'Bitrix\Main\Entity\Validator\Enum');
class_alias('Bitrix\Main\ORM\Fields\Validators\ForeignValidator', 'Bitrix\Main\Entity\Validator\Foreign');
class_alias('Bitrix\Main\ORM\Fields\Validators\LengthValidator', 'Bitrix\Main\Entity\Validator\Length');
class_alias('Bitrix\Main\ORM\Fields\Validators\RangeValidator', 'Bitrix\Main\Entity\Validator\Range');
class_alias('Bitrix\Main\ORM\Fields\Validators\RegExpValidator', 'Bitrix\Main\Entity\Validator\RegExp');
class_alias('Bitrix\Main\ORM\Fields\Validators\UniqueValidator', 'Bitrix\Main\Entity\Validator\Unique');
'Bitrix\Main\Entity\IValidator' => 'Bitrix\Main\ORM\Fields\Validators\IValidator',
'Bitrix\Main\Entity\Validator\Base' => 'Bitrix\Main\ORM\Fields\Validators\Validator',
'Bitrix\Main\Entity\Validator\Date' => 'Bitrix\Main\ORM\Fields\Validators\DateValidator',
'Bitrix\Main\Entity\Validator\Enum' => 'Bitrix\Main\ORM\Fields\Validators\EnumValidator',
'Bitrix\Main\Entity\Validator\Foreign' => 'Bitrix\Main\ORM\Fields\Validators\ForeignValidator',
'Bitrix\Main\Entity\Validator\Length' => 'Bitrix\Main\ORM\Fields\Validators\LengthValidator',
'Bitrix\Main\Entity\Validator\Range' => 'Bitrix\Main\ORM\Fields\Validators\RangeValidator',
'Bitrix\Main\Entity\Validator\RegExp' => 'Bitrix\Main\ORM\Fields\Validators\RegExpValidator',
'Bitrix\Main\Entity\Validator\Unique' => 'Bitrix\Main\ORM\Fields\Validators\UniqueValidator',
class_alias('Bitrix\Main\ORM\Query\INosqlPrimarySelector', 'Bitrix\Main\Entity\INosqlPrimarySelector');
class_alias('Bitrix\Main\ORM\Query\NosqlPrimarySelector', 'Bitrix\Main\Entity\NosqlPrimarySelector');
class_alias('Bitrix\Main\ORM\Query\Query', 'Bitrix\Main\Entity\Query');
class_alias('Bitrix\Main\ORM\Query\Chain', 'Bitrix\Main\Entity\QueryChain');
class_alias('Bitrix\Main\ORM\Query\ChainElement', 'Bitrix\Main\Entity\QueryChainElement');
'Bitrix\Main\Entity\INosqlPrimarySelector' => 'Bitrix\Main\ORM\Query\INosqlPrimarySelector',
'Bitrix\Main\Entity\NosqlPrimarySelector' => 'Bitrix\Main\ORM\Query\NosqlPrimarySelector',
'Bitrix\Main\Entity\Query' => 'Bitrix\Main\ORM\Query\Query',
'Bitrix\Main\Entity\QueryChain' => 'Bitrix\Main\ORM\Query\Chain',
'Bitrix\Main\Entity\QueryChainElement' => 'Bitrix\Main\ORM\Query\ChainElement',
class_alias('Bitrix\Main\ORM\Query\Filter\Expressions\Expression', 'Bitrix\Main\Entity\Query\Filter\Expression\Base');
class_alias('Bitrix\Main\ORM\Query\Filter\Expressions\ColumnExpression', 'Bitrix\Main\Entity\Query\Filter\Expression\Column');
class_alias('Bitrix\Main\ORM\Query\Filter\Expressions\NullExpression', 'Bitrix\Main\Entity\Query\Filter\Expression\NullEx');
'Bitrix\Main\Entity\Query\Filter\Expression\Base' => 'Bitrix\Main\ORM\Query\Filter\Expressions\Expression',
'Bitrix\Main\Entity\Query\Filter\Expression\Column' => 'Bitrix\Main\ORM\Query\Filter\Expressions\ColumnExpression',
'Bitrix\Main\Entity\Query\Filter\Expression\NullEx' => 'Bitrix\Main\ORM\Query\Filter\Expressions\NullExpression',
class_alias('Bitrix\Main\ORM\Data\DataManager', 'Bitrix\Main\Entity\DataManager');
class_alias('Bitrix\Main\ORM\Data\Result', 'Bitrix\Main\Entity\Result');
class_alias('Bitrix\Main\ORM\Data\AddResult', 'Bitrix\Main\Entity\AddResult');
class_alias('Bitrix\Main\ORM\Data\UpdateResult', 'Bitrix\Main\Entity\UpdateResult');
class_alias('Bitrix\Main\ORM\Data\DeleteResult', 'Bitrix\Main\Entity\DeleteResult');
'Bitrix\Main\Entity\DataManager' => 'Bitrix\Main\ORM\Data\DataManager',
'Bitrix\Main\Entity\Result' => 'Bitrix\Main\ORM\Data\Result',
'Bitrix\Main\Entity\AddResult' => 'Bitrix\Main\ORM\Data\AddResult',
'Bitrix\Main\Entity\UpdateResult' => 'Bitrix\Main\ORM\Data\UpdateResult',
'Bitrix\Main\Entity\DeleteResult' => 'Bitrix\Main\ORM\Data\DeleteResult',
class_alias('Bitrix\Main\ORM\Query\Filter\Condition', 'Bitrix\Main\Entity\Query\Filter\Condition');
class_alias('Bitrix\Main\ORM\Query\Filter\ConditionTree', 'Bitrix\Main\Entity\Query\Filter\ConditionTree');
class_alias('Bitrix\Main\ORM\Query\Filter\Helper', 'Bitrix\Main\Entity\Query\Filter\Helper');
class_alias('Bitrix\Main\ORM\Query\Filter\Operator', 'Bitrix\Main\Entity\Query\Filter\Operator');
'Bitrix\Main\Entity\Query\Filter\Condition' => 'Bitrix\Main\ORM\Query\Filter\Condition',
'Bitrix\Main\Entity\Query\Filter\ConditionTree' => 'Bitrix\Main\ORM\Query\Filter\ConditionTree',
'Bitrix\Main\Entity\Query\Filter\Helper' => 'Bitrix\Main\ORM\Query\Filter\Helper',
'Bitrix\Main\Entity\Query\Filter\Operator' => 'Bitrix\Main\ORM\Query\Filter\Operator',
class_alias('Bitrix\Main\ORM\Query\Expression', 'Bitrix\Main\Entity\Query\Expression');
class_alias('Bitrix\Main\ORM\Query\Join', 'Bitrix\Main\Entity\Query\Join');
class_alias('Bitrix\Main\ORM\Query\Union', 'Bitrix\Main\Entity\Query\Union');
class_alias('Bitrix\Main\ORM\Query\UnionCondition', 'Bitrix\Main\Entity\Query\UnionCondition');
'Bitrix\Main\Entity\Query\Expression' => 'Bitrix\Main\ORM\Query\Expression',
'Bitrix\Main\Entity\Query\Join' => 'Bitrix\Main\ORM\Query\Join',
'Bitrix\Main\Entity\Query\Union' => 'Bitrix\Main\ORM\Query\Union',
'Bitrix\Main\Entity\Query\UnionCondition' => 'Bitrix\Main\ORM\Query\UnionCondition',
class_alias('Bitrix\Main\ORM\Entity', 'Bitrix\Main\Entity\Base');
class_alias('Bitrix\Main\ORM\EntityError', 'Bitrix\Main\Entity\EntityError');
class_alias('Bitrix\Main\ORM\Event', 'Bitrix\Main\Entity\Event');
class_alias('Bitrix\Main\ORM\EventResult', 'Bitrix\Main\Entity\EventResult');
'Bitrix\Main\Entity\Base' => 'Bitrix\Main\ORM\Entity',
'Bitrix\Main\Entity\EntityError' => 'Bitrix\Main\ORM\EntityError',
'Bitrix\Main\Entity\Event' => 'Bitrix\Main\ORM\Event',
'Bitrix\Main\Entity\EventResult' => 'Bitrix\Main\ORM\EventResult',
\Bitrix\Main\Loader::registerAutoLoadClasses(
'Bitrix\Main\ORM\UField' => 'Bitrix\Main\Entity\UField',
'Bitrix\Main\Type\ArrayHelper' => 'Bitrix\Main\Type\Collection',
]);
Loader::registerAutoLoadClasses(
"main", ["Bitrix\\Main\\Entity\\UField" => "include/deprecated/ufield.php"]
);
class_alias('Bitrix\Main\Entity\UField', 'Bitrix\Main\ORM\UField');
class_alias('Bitrix\Main\Type\Collection', 'Bitrix\Main\Type\ArrayHelper');
@@ -10,6 +10,7 @@
"psr/http-message": "^2.0",
"psr/http-client": "^1.0",
"psr/container": "^2.0",
"php-http/promise": "^1.1"
"php-http/promise": "^1.1",
"simshaun/recurr": "^5.0"
}
}
@@ -1,12 +1,14 @@
<?php
/**
* @global CMain $APPLICATION
* @global CUser $USER
*/
define("STOP_STATISTICS", true);
define("BX_SECURITY_SHOW_MESSAGE", true);
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php");
global $APPLICATION;
global $USER;
require_once $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php";
if (!check_bitrix_sessid() || !$USER->IsAuthorized() || $_SERVER['REQUEST_METHOD'] != "POST")
{
@@ -120,9 +122,6 @@ if (isset($_POST["type"]) && $_POST["type"] == "desktop")
}
else
{
$GLOBALS["APPLICATION"]->SetTitle(GetMessage("CMDESKTOP_ADMIN_SETTINGS_DIALOG_TITLE"));
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_after.php");
?>
<script>
BX.ready(function()
@@ -168,8 +167,6 @@ if (isset($_POST["type"]) && $_POST["type"] == "desktop")
</form>
</div>
<?php
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_admin.php");
}
}
elseif (isset($_POST["type"]) && $_POST["type"] == "gadget")
@@ -1,22 +1,26 @@
<?
<?php
/**
* @global CMain $APPLICATION
* @global CUser $USER
*/
define("STOP_STATISTICS", true);
define("BX_SECURITY_SHOW_MESSAGE", true);
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php");
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_js.php");
require_once $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php";
require_once $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/interface/init_admin.php";
CComponentUtil::__IncludeLang("/bitrix/components/bitrix/desktop/", "/admin_settings_all.php");
if (false == check_bitrix_sessid() || !$GLOBALS["USER"]->IsAuthorized())
if (!check_bitrix_sessid() || !$USER->IsAuthorized())
{
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_admin_after.php");
die();
CMain::FinalActions();
}
$APPLICATION->SetAdditionalCSS('/bitrix/themes/.default/pubstyles.css');
$arUserOptions = CUserOptions::GetOption("intranet", "~gadgets_admin_index", array(), false);
$arUserOptions = CUserOptions::GetOption("intranet", "~gadgets_admin_index", array());
if(!is_array($arUserOptions))
$arUserOptions = Array();
@@ -29,6 +33,7 @@ else
if ($_SERVER['REQUEST_METHOD']=="POST" && isset($_REQUEST['save']) && $_REQUEST['save'] == 'Y')
{
$ids = $_REQUEST['ids'] ?? [];
if (!is_array($ids))
$ids = array();
@@ -43,22 +48,22 @@ if ($_SERVER['REQUEST_METHOD']=="POST" && isset($_REQUEST['save']) && $_REQUEST[
continue;
$arTmp = $arUserOptions[$num-1];
if(trim($arValues["text_".$num]) <> '')
$arTmp["NAME"] = $arValues["text_".$num];
$arUserOptionsTmp[] = $arTmp;
}
CUserOptions::SetOption("intranet", "~gadgets_admin_index", $arUserOptionsTmp, false, false);
CUserOptions::SetOption("intranet", "~gadgets_admin_index", $arUserOptionsTmp);
?>
<script bxrunfirst="true">
top.BX.WindowManager.Get().Close();
top.BX.showWait();
top.location.href = '<?=htmlspecialcharsbx(CUtil::JSEscape($desktop_backurl))?>';
</script>
<?
die();
<?php
CMain::FinalActions();
}
/******* /POST **********/
$obJSPopup = new CJSPopup('',
@@ -77,7 +82,7 @@ $obJSPopup->ShowTitlebar();
?>
<script src="/bitrix/js/main/dd.js"></script>
<?
<?php
// ======================== Show content ============================= //
$obJSPopup->StartContent();
?>
@@ -92,7 +97,7 @@ div.bx-core-dialog-content div.bx-desktopset-current-row div.edit-field-active {
<thead>
<tr class="heading">
<td width="0"></td>
<td width="50%"><b><?echo GetMessage("CMDESKTOP_ADMIN_SETTINGS_ALL_NAME")?></b></td>
<td width="50%"><b><?= GetMessage("CMDESKTOP_ADMIN_SETTINGS_ALL_NAME")?></b></td>
<td width="0"></td>
<td width="0"></td>
<td width="0"></td>
@@ -100,7 +105,7 @@ div.bx-core-dialog-content div.bx-desktopset-current-row div.edit-field-active {
</thead>
</table>
<div id="bx_desktopset_layout" class="bx-desktopset-layout"><?
<div id="bx_desktopset_layout" class="bx-desktopset-layout"><?php
$itemcnt = 0;
for($i=1; $i<=count($arUserOptions); $i++):
@@ -113,18 +118,17 @@ for($i=1; $i<=count($arUserOptions); $i++):
<input type="hidden" name="del_<?=$i?>" value="N" />
<span class="rowcontrol drag" title="<?=GetMessage('CMDESKTOP_ADMIN_SETTINGS_ALL_DRAG')?>"></span>
</td>
</td>
<td>
<div onmouseout="rowMouseOut(this)" onmouseover="rowMouseOver(this)" class="edit-field view-area" id="view_area_text_<?=$i?>" onclick="editArea('text_<?=$i?>')" title="<?=GetMessage('CMDESKTOP_ADMIN_SETTINGS_ALL_TOOLTIP_TEXT_EDIT')?>"><?=(($arUserOption["NAME"] ?? '') <> '' ? htmlspecialcharsbx($arUserOption["NAME"]):GetMessage('CMDESKTOP_ADMIN_SETTINGS_ALL_DIALOG_DESKTOP').$i)?></div>
<div class="edit-area" id="edit_area_text_<?=$i?>" style="display: none;"><input type="text" style="width: 220px;" name="text_<?echo $i?>" value="<?=(($arUserOption["NAME"] ?? '') <> '' ? htmlspecialcharsbx($arUserOption["NAME"]) : GetMessage('CMDESKTOP_ADMIN_SETTINGS_ALL_DIALOG_DESKTOP').$i)?>" onblur="viewArea('text_<?=$i?>')" /></div>
<div class="edit-area" id="edit_area_text_<?=$i?>" style="display: none;"><input type="text" style="width: 220px;" name="text_<?= $i?>" value="<?=(($arUserOption["NAME"] ?? '') <> '' ? htmlspecialcharsbx($arUserOption["NAME"]) : GetMessage('CMDESKTOP_ADMIN_SETTINGS_ALL_DIALOG_DESKTOP').$i)?>" onblur="viewArea('text_<?=$i?>')" /></div>
</td>
<td><span onclick="dsMoveUp(<?=$i?>)" class="rowcontrol up" style="visibility: <?=($i == 1 ? 'hidden' : 'visible')?>" title="<?=GetMessage('CMDESKTOP_ADMIN_SETTINGS_ALL_TOOLTIP_UP')?>"></span></td>
<td><span onclick="dsMoveDown(<?=$i?>)" class="rowcontrol down" style="visibility: <?=($i == count($arUserOptions) ? 'hidden' : 'visible')?>" title="<?=GetMessage('CMDESKTOP_ADMIN_SETTINGS_ALL_TOOLTIP_DOWN')?>"></span></td>
<td><span onclick="dsDelete(<?=$i?>)" class="rowcontrol delete" title="<?=GetMessage('CMDESKTOP_ADMIN_SETTINGS_ALL_TOOLTIP_DELETE')?>"></span></td>
</tr>
</tbody></table></div></div><?
</tbody></table></div></div><?php
endfor?></div>
<input type="hidden" name="itemcnt" value="<?echo $itemcnt?>" />
<input type="hidden" name="itemcnt" value="<?= $itemcnt?>" />
<input type="hidden" name="desktop_backurl" value="<?=htmlspecialcharsbx(CUtil::JSEscape($desktop_backurl))?>">
<script>
var currentRow = null;
@@ -208,7 +212,7 @@ function dsDelete(i)
if (GLOBAL_bDisableActions)
return;
var obInput = <?echo $obJSPopup->jsPopup?>.GetForm()['del_' + i];
var obInput = <?= $obJSPopup->jsPopup?>.GetForm()['del_' + i];
var obPlacement = BX('bx_desktopset_row_' + i).parentNode;
obInput.value = 'Y';
@@ -362,7 +366,7 @@ BX.ready(function ()
{
jsDD.Reset();
<?
<?php
for($i=1; $i<=count($arUserOptions); $i++):
?>
jsDD.registerDest(BX('bx_desktopset_placement_<?=$i?>'));
@@ -372,7 +376,7 @@ for($i=1; $i<=count($arUserOptions); $i++):
obEl.onbxdragstop = BXDD_DragStop;
obEl.onbxdraghover = BXDD_DragHover;
jsDD.registerObject(obEl);
<?
<?php
endfor;
?>
jsDD.registerContainer(BX.WindowManager.Get().GetContent());
@@ -381,6 +385,5 @@ endfor;
l.style.MozUserSelect = 'none';
});
</script>
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_admin_js.php");
?>
<?php
CMain::FinalActions();
@@ -283,7 +283,16 @@ class CMainInterfaceButtons
*/
protected function prepareItemUrl($url)
{
return preg_match('#^(?:/|https?://)#', $url) ? (string)$url: '';
$url= trim((string)$url);
if (!preg_match('#^(?:/|https?://)#', $url)) {
return '';
}
if (str_contains($url, SITE_DIR)) {
return $url;
}
return SITE_DIR . ltrim($url, '/');
}
/**
@@ -264,6 +264,10 @@
display: none;
}
.main-buttons.--air .main-buttons-item .main-buttons-item-counter {
transform: translateX(10px);
}
.main-buttons.--air .main-buttons-item-super-title {
top: 30px;
}
@@ -629,7 +633,7 @@
top: calc(var(--mib-height) / 2 - var(--mib-item-font-size) / 2 - 14px);
padding: 2px 5px 3px 5px;
border-radius: 30px;
background: #f54819;
background: #f2473d;
font: 11px/11px var(--ui-font-family-secondary, var(--ui-font-family-open-sans));
font-weight: var(--ui-font-weight-semi-bold, 600);
color: #fff;
File diff suppressed because one or more lines are too long
@@ -175,7 +175,7 @@ if (check_bitrix_sessid())
"(%2\$s LIKE '%%" . $word . "%%')"
);
}
$sortWeight = new \Bitrix\Main\Entity\ExpressionField('SORT_WEIGHT', $sortExpr, ['NAME', 'EMAIL']);
$sortWeight = new \Bitrix\Main\ORM\Fields\ExpressionField('SORT_WEIGHT', $sortExpr, ['NAME', 'EMAIL']);
$queryFilter = [
[
'LOGIC' => 'OR',
@@ -422,6 +422,10 @@
border: var(--ui-border-width-thin) solid var(--ui-color-design-outline-focused-stroke);
}
.main-ui-filter-theme-air .main-ui-filter-field-container .main-ui-square-search-item:focus {
border: none;
}
.main-ui-filter-theme-air .main-ui-control.main-ui-select {
background-image: none;
}
File diff suppressed because one or more lines are too long
@@ -224,6 +224,7 @@ class MainUserConsentConsentListComponent extends CBitrixComponent
"name" => Loc::getMessage('MAIN_USER_CONSENTS_COMP_UI_COLUMN_AGREEMENT_ID'),
"default" => true,
"type" => "list",
'params' => ['multiple' => 'Y'],
"items" => $agreements
],
[
@@ -33,6 +33,7 @@ class MainUserConsentRequestComponent extends CBitrixComponent
{
$this->arParams['AUTO_SAVE'] = isset($this->arParams['AUTO_SAVE']) ? $this->arParams['AUTO_SAVE'] === 'Y' : true;
$this->arParams['IS_CHECKED'] = isset($this->arParams['IS_CHECKED']) ? $this->arParams['IS_CHECKED'] === 'Y' : true;
$this->arParams['REQUIRED'] = isset($this->arParams['REQUIRED']) ? $this->arParams['REQUIRED'] === 'Y' : false;
$this->arParams['IS_LOADED'] = isset($this->arParams['IS_LOADED']) ? $this->arParams['IS_LOADED'] === 'Y' : false;
$this->arParams['ID'] = isset($this->arParams['ID']) ? intval($this->arParams['ID']) : null;
@@ -72,6 +73,7 @@ class MainUserConsentRequestComponent extends CBitrixComponent
'actionUrl' => $this->getPath() . '/ajax.php',
'replace' => $this->arParams['REPLACE'],
'url' => $this->arResult['URL'],
'required' => $this->arResult['REQUIRED'],
);
if ($this->arParams['IS_LOADED'])
@@ -31,7 +31,7 @@ else
?>
<label data-bx-user-consent="<?=htmlspecialcharsbx($config)?>" class="main-user-consent-request">
<input type="checkbox" value="Y" <?=($arParams['IS_CHECKED'] ? 'checked' : '')?> name="<?=htmlspecialcharsbx($arParams['INPUT_NAME'])?>">
<span class="<?=$linkClassName?>"><?=$label?></span>
<span class="<?=$linkClassName?>"><?=$label?><?php if ($arParams['REQUIRED']): ?> <span class="main-user-consent-request-announce-required">*</span><?php endif; ?></span>
</label>
<div data-bx-template="main-user-consent-request-loader" style="display: none;">
<div class="main-user-consent-request-popup">
@@ -178,6 +178,9 @@
.main-user-consent-request-announce-link{
cursor: pointer;
}
.main-user-consent-request-announce-required {
color: red;
}
@keyframes rotate {
100% {
@@ -7,6 +7,7 @@
this.controlNode = params.controlNode;
this.inputNode = params.inputNode;
this.config = params.config;
this.saved = false;
}
UserConsentControl.prototype = {
@@ -23,13 +24,14 @@
events: {
'save': 'main-user-consent-request-save',
'refused': 'main-user-consent-request-refused',
'accepted': 'main-user-consent-request-accepted'
'accepted': 'main-user-consent-request-accepted',
'afterAccepted': 'main-user-consent-request-after-accepted',
},
current: null,
autoSave: false,
isFormSubmitted: false,
isConsentSaved: false,
attributeControl: 'data-bx-user-consent',
items: [],
load: function (context)
{
var item = this.find(context)[0];
@@ -43,7 +45,16 @@
},
loadAll: function (context, limit)
{
this.find(context, limit).forEach(this.bind, this);
var items = this.find(context, limit);
if (items.length > 0)
{
items.forEach(this.bind, this);
this.items = this.items.concat(items);
}
},
getItems: function()
{
return this.items;
},
loadFromForms: function ()
{
@@ -73,7 +84,7 @@
BX.bind(item.formNode, 'submit', this.onSubmit.bind(this, item));
}
BX.bind(item.controlNode, 'click', this.onClick.bind(this, item));
BX.bind(item.inputNode, 'click', this.onClick.bind(this, item));
},
createItem: function (context, controlNode)
{
@@ -114,6 +125,17 @@
{
if (item.config.url)
{
if (item.inputNode.checked)
{
BX.onCustomEvent(item, this.events.afterAccepted, [item]);
BX.onCustomEvent(this, this.events.afterAccepted, [item]);
}
else
{
BX.onCustomEvent(item, this.events.refused, [item]);
BX.onCustomEvent(this, this.events.refused, [item]);
}
return;
}
@@ -141,7 +163,10 @@
{
if (item.inputNode.checked)
{
this.saveConsent(item);
this.saveConsent(item, () => {
item.saved = true;
});
return true;
}
@@ -182,21 +207,24 @@
BX.onCustomEvent(item, this.events.accepted, []);
BX.onCustomEvent(this, this.events.accepted, [item]);
this.isConsentSaved = true;
item.saved = true;
if (this.isFormSubmitted && item.formNode && !item.config.submitEventName)
{
BX.submit(item.formNode);
}
this.current.inputNode.checked = true;
this.current = null;
BX.onCustomEvent(item, this.events.afterAccepted, [item]);
BX.onCustomEvent(this, this.events.afterAccepted, [item]);
}
);
this.current.inputNode.checked = true;
this.current = null;
},
onRefused: function ()
{
BX.onCustomEvent(this.current, this.events.refused, []);
BX.onCustomEvent(this.current, this.events.refused, [this.current]);
BX.onCustomEvent(this, this.events.refused, [this.current]);
this.current.inputNode.checked = false;
this.current = null;
@@ -471,7 +499,7 @@
BX.onCustomEvent(item, this.events.save, [data]);
BX.onCustomEvent(this, this.events.save, [item, data]);
if (this.isConsentSaved || !item.config.autoSave)
if (item.saved || !item.config.autoSave)
{
if (callback)
{
@@ -1 +1 @@
.main-user-consent-request a{cursor:pointer}.main-user-consent-request-popup{position:fixed;top:0;left:0;bottom:0;right:0;background-color:rgba(0,0,0,0.5);overflow:hidden;z-index:9000}.main-user-consent-request-popup-cont{min-height:290px;position:absolute;top:50%;left:50%;margin:0 auto;padding:20px;min-width:320px;width:100%;max-width:600px;background:#fff;text-align:center;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-border-radius:5px;border-radius:5px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow-y:auto}.main-user-consent-request-popup-header{margin:0 0 10px 0;font:normal 18px var(--ui-font-family-primary,var(--ui-font-family-helvetica));color:#000;text-align:left;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:260px}.main-user-consent-request-popup-textarea-block{margin:0 0 20px 0}.main-user-consent-request-popup-buttons{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.main-user-consent-request-popup-button{display:inline-block;height:39px;margin:0 10px 5px 0;padding:0 18px;border:0;border-radius:2px;font:normal 12px/39px var(--ui-font-family-primary,var(--ui-font-family-helvetica));color:#535c69;outline:0;vertical-align:middle;text-decoration:none;text-transform:uppercase;text-shadow:none;white-space:nowrap;-webkit-font-smoothing:antialiased;-webkit-transition:background-color .2s linear,color .2s linear;transition:background-color .2s linear,color .2s linear;cursor:pointer}.main-user-consent-request-popup-button-acc{background:#bbed21}.main-user-consent-request-popup-button-acc:hover{background:#d2f95f}.main-user-consent-request-popup-button-rej{-webkit-box-shadow:inset 0 0 0 1px #a1a6ac;box-shadow:inset 0 0 0 1px #a1a6ac;background:0}.main-user-consent-request-popup-button-rej:hover{background:#cfd4d8}.main-user-consent-request-popup-text{border:1px solid #999;overflow:auto;padding:8px;text-align:left;color:#545454}.main-user-consent-request-popup-link{height:130px;display:flex;justify-content:center;align-items:center;flex-direction:column}.main-user-consent-request-popup-link a{display:block;margin:20px 0 0 0;text-overflow:ellipsis;overflow:hidden;max-width:260px}.main-user-consent-request-loader{position:relative;height:100px;width:100px;margin:0 auto;-webkit-transform:translate(0,50%);transform:translate(0,50%)}.main-user-consent-request-path{stroke:#80868e;stroke-dasharray:100,200}.main-user-consent-request-loader:before{content:'';display:block;padding-top:100%}.main-user-consent-request-circular{position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;height:inherit;width:inherit;-webkit-animation:rotate 1s linear infinite;animation:rotate 1s linear infinite;-webkit-transform-origin:center center;transform-origin:center center}.main-user-consent-request-path{stroke:#ccc;stroke-dasharray:60,200;stroke-dashoffset:0;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite;stroke-linecap:round}.main-user-consent-request-announce{color:#333;font-size:13px;line-height:15px}.main-user-consent-request-announce-link{cursor:pointer}@keyframes rotate{100%{transform:rotate(360deg)}}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg)}}@media(min-width:1000px){.main-user-consent-request-popup-cont{min-height:400px;min-width:640px}.main-user-consent-request-popup-header{max-width:590px}.main-user-consent-request-popup-text,.main-user-consent-request-popup-link{height:240px}.main-user-consent-request-popup-link a{max-width:200px}}@media(max-width:768px){.main-user-consent-request-popup-cont{height:100%}}
.main-user-consent-request a{cursor:pointer}.main-user-consent-request-popup{position:fixed;top:0;left:0;bottom:0;right:0;background-color:rgba(0,0,0,.5);overflow:hidden;z-index:9000}.main-user-consent-request-popup-cont{min-height:290px;position:absolute;top:50%;left:50%;margin:0 auto;padding:20px;min-width:320px;width:100%;max-width:600px;background:#fff;text-align:center;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-border-radius:5px;border-radius:5px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow-y:auto}.main-user-consent-request-popup-header{margin:0 0 10px;font:normal 18px var(--ui-font-family-primary,var(--ui-font-family-helvetica));color:#000;text-align:left;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:260px}.main-user-consent-request-popup-textarea-block{margin:0 0 20px}.main-user-consent-request-popup-buttons{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.main-user-consent-request-popup-button{display:inline-block;height:39px;margin:0 10px 5px 0;padding:0 18px;border:none;border-radius:2px;font:normal 12px/39px var(--ui-font-family-primary,var(--ui-font-family-helvetica));color:#535c69;outline:none;vertical-align:middle;text-decoration:none;text-transform:uppercase;text-shadow:none;white-space:nowrap;-webkit-font-smoothing:antialiased;-webkit-transition:background-color .2s linear,color .2s linear;transition:background-color .2s linear,color .2s linear;cursor:pointer}.main-user-consent-request-popup-button-acc{background:#bbed21}.main-user-consent-request-popup-button-acc:hover{background:#d2f95f}.main-user-consent-request-popup-button-rej{-webkit-box-shadow:inset 0 0 0 1px #a1a6ac;box-shadow:inset 0 0 0 1px #a1a6ac;background:none}.main-user-consent-request-popup-button-rej:hover{background:#cfd4d8}.main-user-consent-request-popup-text{border:1px solid #999;overflow:auto;padding:8px;text-align:left;color:#545454}.main-user-consent-request-popup-link{height:130px;display:flex;justify-content:center;align-items:center;flex-direction:column}.main-user-consent-request-popup-link a{display:block;margin:20px 0 0;text-overflow:ellipsis;overflow:hidden;max-width:260px}.main-user-consent-request-loader{position:relative;height:100px;width:100px;margin:0 auto;-webkit-transform:translateY(50%);transform:translateY(50%)}.main-user-consent-request-path{stroke:#80868e;stroke-dasharray:100,200}.main-user-consent-request-loader:before{content:"";display:block;padding-top:100%}.main-user-consent-request-circular{position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;height:inherit;width:inherit;-webkit-animation:rotate 1s linear infinite;animation:rotate 1s linear infinite;-webkit-transform-origin:center center;transform-origin:center center}.main-user-consent-request-path{stroke:#ccc;stroke-dasharray:60,200;stroke-dashoffset:0;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite;stroke-linecap:round}.main-user-consent-request-announce{color:#333;font-size:13px;line-height:15px}.main-user-consent-request-announce-link{cursor:pointer}.main-user-consent-request-announce-required{color:red}@keyframes rotate{to{transform:rotate(1turn)}}@-webkit-keyframes rotate{to{-webkit-transform:rotate(1turn)}}@media (min-width:1000px){.main-user-consent-request-popup-cont{min-height:400px;min-width:640px}.main-user-consent-request-popup-header{max-width:590px}.main-user-consent-request-popup-link,.main-user-consent-request-popup-text{height:240px}.main-user-consent-request-popup-link a{max-width:200px}}@media (max-width:768px){.main-user-consent-request-popup-cont{height:100%}}
File diff suppressed because one or more lines are too long
@@ -26,6 +26,23 @@ class MainUserConsentSelectorComponent extends CBitrixComponent
protected function initParams()
{
$this->arParams['ID'] = isset($this->arParams['ID']) ? intval($this->arParams['ID']) : null;
if (isset($this->arParams['AGREEMENTS']))
{
if (!is_array($this->arParams['AGREEMENTS']) || empty($this->arParams['AGREEMENTS']))
{
$this->arParams['AGREEMENTS'] = [
[
'ID' => null,
'CHECKED' => 'Y',
'REQUIRED' => 'Y',
],
];
}
}
else
{
$this->arParams['AGREEMENTS'] = null;
}
$this->arParams['INPUT_NAME'] = isset($this->arParams['INPUT_NAME']) ? (string) $this->arParams['INPUT_NAME'] : 'AGREEMENT_ID';
$this->arParams['PATH_TO_ADD'] = $this->arParams['PATH_TO_ADD'] ?? '';
@@ -41,9 +58,8 @@ class MainUserConsentSelectorComponent extends CBitrixComponent
foreach ($list as $id => $name)
{
$this->arResult['LIST'][] = array(
'ID' => $id,
'ID' => (int)$id,
'NAME' => $name,
'SELECTED' => $id == $this->arParams['ID'],
);
}
@@ -1,7 +1,11 @@
<?php
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_ADD"] = "Add a consent";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_CONSENT"] = "Obtained consents";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_CREATE"] = "Create new Consent";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_CREATE_1"] = "Create new Consent";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_DELETE"] = "Delete";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_EDIT"] = "Edit settings";
$MESS["MAIN_USER_CONSENT_SELECTOR_CHOOSE"] = "Select Consent";
$MESS["MAIN_USER_CONSENT_SELECTOR_DEFAULT"] = "Consent checkbox is checked by default";
$MESS["MAIN_USER_CONSENT_SELECTOR_DEF_NOT_SELECTED"] = "(not selected)";
$MESS["MAIN_USER_CONSENT_SELECTOR_REQUIRED"] = "Consent is required";
@@ -1,7 +1,11 @@
<?php
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_ADD"] = "Қосымша келісім қосу";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_CONSENT"] = "Алынған келісімдер тізімі";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_CREATE"] = "Келісім жасау";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_CREATE_1"] = "Келісім жасау";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_DELETE"] = "Жою";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_EDIT"] = "Баптау";
$MESS["MAIN_USER_CONSENT_SELECTOR_CHOOSE"] = "Келісімді таңдаңыз";
$MESS["MAIN_USER_CONSENT_SELECTOR_DEFAULT"] = "Нысандағы келісімге әдепкі құсбелгіні қосу";
$MESS["MAIN_USER_CONSENT_SELECTOR_DEF_NOT_SELECTED"] = "(таңдалмаған)";
$MESS["MAIN_USER_CONSENT_SELECTOR_REQUIRED"] = "Міндетті келісім";
@@ -3,5 +3,9 @@ $MESS["MAIN_USER_CONSENT_SELECTOR_DEF_NOT_SELECTED"] = "(не выбрано)";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_EDIT"] = "Настроить";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_CREATE"] = "Создать соглашение";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_CREATE_1"] = "Создать соглашение";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_ADD"] = "Добавить ещё соглашение";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_DELETE"] = "Удалить";
$MESS["MAIN_USER_CONSENT_SELECTOR_BTN_CONSENT"] = "Список полученных согласий";
$MESS["MAIN_USER_CONSENT_SELECTOR_CHOOSE"] = "Выберите соглашение";
$MESS["MAIN_USER_CONSENT_SELECTOR_DEFAULT"] = "Включить по умолчанию галочку на соглашении в форме";
$MESS["MAIN_USER_CONSENT_SELECTOR_REQUIRED"] = "Обязательное соглашение";
@@ -4,6 +4,14 @@ var MainUserConsentSelectorManager = function(params)
this.init = function (params)
{
this.actionRequestUrl = params.actionRequestUrl;
this.template = params.template ?? null;
if (this.template)
{
this.template = BX.Tag.render([this.template]);
var selector = this.template.querySelector('select[data-bx-selector]');
this.selectors.push(selector);
}
this.inputName = params.inputName;
this.initSlider();
var contexts = document.querySelectorAll('[data-bx-user-consent-selector]');
@@ -11,21 +19,99 @@ var MainUserConsentSelectorManager = function(params)
contexts.forEach(this.initByContext, this);
};
this.initByContext = function(context)
this.initByBlockContext = function(block)
{
var selector = context.querySelector('select[data-bx-selector]');
var linkEdit = context.querySelector('a[data-bx-link-edit]');
var linkView = context.querySelector('a[data-bx-link-view]');
var selector = block.querySelector('select[data-bx-selector]');
var linkEdit = block.querySelector('a[data-bx-link-edit]');
var linkView = block.querySelector('a[data-bx-link-view]');
if (!selector || !linkEdit || !linkView)
{
return;
}
var deleteButton = block.querySelector('[data-bx-delete]');
BX.bind(deleteButton, 'click', this.removeBlock.bind(this, block));
this.selectors.push(selector);
BX.bind(selector, 'change', this.onChange.bind(this, selector, linkEdit, linkView));
this.onChange(selector, linkEdit, linkView);
};
this.initByContext = function(context)
{
var blocks = context.querySelectorAll('[data-bx-user-consent-selector-block]');
blocks = BX.convert.nodeListToArray(blocks);
blocks.forEach(this.initByBlockContext, this);
this.initSliderButtons(context);
var linkAdd = context.querySelector('a[data-bx-link-add]');
if (linkAdd)
{
BX.bind(linkAdd, 'click', this.onAddClick.bind(this, context));
}
};
this.onAddClick = function(context)
{
var blocksContainer = context.querySelector('[data-bx-user-consent-selector-blocks-container]');
if (blocksContainer)
{
var newBlock = this.template.cloneNode(true);
var blocks = blocksContainer.querySelectorAll('[data-bx-user-consent-selector-block]');
var newBlockIndex = blocks.length;
this.updateBlockInputNames(newBlock, newBlockIndex);
blocksContainer.appendChild(newBlock);
this.initByBlockContext(newBlock);
this.initSliderButtons(newBlock);
blocks = blocksContainer.querySelectorAll('[data-bx-user-consent-selector-block]');
if (blocks.length === 2)
{
var deleteButton = blocks[0].querySelector('[data-bx-delete]');
deleteButton.style.display = 'inline';
}
}
};
this.removeBlock = function(removedBlock)
{
var blocksContainer = removedBlock.parentNode;
var blocks = blocksContainer.querySelectorAll('[data-bx-user-consent-selector-block]');
if (blocks.length > 1)
{
removedBlock.remove();
}
blocks = blocksContainer.querySelectorAll('[data-bx-user-consent-selector-block]');
if (blocks.length > 1)
{
blocks.forEach((block, index) => {
this.updateBlockInputNames(block, index);
});
}
else
{
var deleteButton = blocks[0].querySelector('[data-bx-delete]');
deleteButton.style.display = 'none';
}
};
this.updateBlockInputNames = function(block, index)
{
var selector = block.querySelector('[data-bx-selector]');
selector.name = this.inputName + '[' + index + ']' + '[ID]';
var defaultInputs = block.querySelectorAll('[data-bx-default-input]');
defaultInputs.forEach((defaultInput) => {
defaultInput.name = this.inputName + '[' + index + ']' + '[CHECKED]';
});
var requiredInputs = block.querySelectorAll('[data-bx-required-input]');
requiredInputs.forEach((requiredInput) => {
requiredInput.name = this.inputName + '[' + index + ']' + '[REQUIRED]';
});
};
this.onChange = function(selector, linkEdit, linkView)
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
var MainUserConsentSelectorManager=function(e){this.selectors=[];this.init=function(e){this.actionRequestUrl=e.actionRequestUrl;this.initSlider();var t=document.querySelectorAll("[data-bx-user-consent-selector]");t=BX.convert.nodeListToArray(t);t.forEach(this.initByContext,this)};this.initByContext=function(e){var t=e.querySelector("select[data-bx-selector]");var i=e.querySelector("a[data-bx-link-edit]");var n=e.querySelector("a[data-bx-link-view]");if(!t||!i||!n){return}this.selectors.push(t);BX.bind(t,"change",this.onChange.bind(this,t,i,n));this.onChange(t,i,n);this.initSliderButtons(e)};this.onChange=function(e,t,i){t.style.display=e.value?"":"none";i.style.display=e.value?"":"none";this.fillHrefByTemplate(t,e.value);this.fillHrefByTemplate(i,e.value)};this.fillHrefByTemplate=function(e,t){var i=e.getAttribute("data-bx-link-tmpl");if(!i){return}e.href=i.replace(new RegExp("#id#","g"),t)};this.fillDropDownControl=function(e,t,i){t=t||[];var n=e.children[0];e.innerHTML="";if(i&&n){e.appendChild(n)}t.forEach(function(t){if(!t||!t.caption){return}var i=document.createElement("option");i.value=t.value;i.selected=!!t.selected;i.innerText=t.caption;e.appendChild(i)})};this.initSliderButtons=function(e){var t=e.querySelectorAll("[data-bx-slider-href]");t=BX.convert.nodeListToArray(t);t.forEach(this.slider.bindOpen,this.slider)};this.initSlider=function(){this.slider.caller=this;top.BX.addCustomEvent(top,"main-user-consent-to-list",function(){top.BX.SidePanel.Instance.close()})};this.onSliderClose=function(){this.sendActionRequest("getAgreements",{},function(e){if(!e.list){return}this.selectors.forEach(function(t){var i=t.value;if(!i){i=e.list[0].ID}var n=e.list.map(function(e){return{caption:e.NAME,value:e.ID,selected:(e.ID||"").toString()===i}});this.fillDropDownControl(t,n,true);BX.fireEvent(t,"change")},this)})};this.slider={caller:null,init:function(e){top.BX.SidePanel.Instance.bindAnchors({rules:[{condition:e.condition,loader:e.loader,stopParameters:[]}]})},onSaved:function(){this.onClose();top.BX.SidePanel.Instance.close()},onClose:function(){if(this.caller){this.caller.onSliderClose()}},bindOpen:function(e){BX.bind(e,"click",this.openHref.bind(this,e))},openHref:function(e,t){t.preventDefault();this.open(e.getAttribute("href"),e.getAttribute("data-bx-slider-reload"))},open:function(e,t){top.BX.SidePanel.Instance.open(e,{cacheable:false,events:{}});if(t){top.BX.addCustomEvent(top,"main-user-consent-saved",this.onSaved.bind(this))}}};this.sendActionRequest=function(e,t,i,n){i=i||null;n=n||null;t.action=e;t.sessid=BX.bitrix_sessid();t.action=e;BX.ajax({url:this.actionRequestUrl,method:"POST",data:t,timeout:10,dataType:"json",processData:true,onsuccess:BX.proxy(function(e){e=e||{};if(e.error){n.apply(this,[e])}else if(i){i.apply(this,[e])}},this),onfailure:BX.proxy(function(){var e={error:true,text:""};if(n){n.apply(this,[e])}},this)})};this.init(e)};
var MainUserConsentSelectorManager=function(e){this.selectors=[];this.init=function(e){this.actionRequestUrl=e.actionRequestUrl;this.template=e.template??null;if(this.template){this.template=BX.Tag.render([this.template]);var t=this.template.querySelector("select[data-bx-selector]");this.selectors.push(t)}this.inputName=e.inputName;this.initSlider();var i=document.querySelectorAll("[data-bx-user-consent-selector]");i=BX.convert.nodeListToArray(i);i.forEach(this.initByContext,this)};this.initByBlockContext=function(e){var t=e.querySelector("select[data-bx-selector]");var i=e.querySelector("a[data-bx-link-edit]");var n=e.querySelector("a[data-bx-link-view]");if(!t||!i||!n){return}var l=e.querySelector("[data-bx-delete]");BX.bind(l,"click",this.removeBlock.bind(this,e));this.selectors.push(t);BX.bind(t,"change",this.onChange.bind(this,t,i,n));this.onChange(t,i,n)};this.initByContext=function(e){var t=e.querySelectorAll("[data-bx-user-consent-selector-block]");t=BX.convert.nodeListToArray(t);t.forEach(this.initByBlockContext,this);this.initSliderButtons(e);var i=e.querySelector("a[data-bx-link-add]");if(i){BX.bind(i,"click",this.onAddClick.bind(this,e))}};this.onAddClick=function(e){var t=e.querySelector("[data-bx-user-consent-selector-blocks-container]");if(t){var i=this.template.cloneNode(true);var n=t.querySelectorAll("[data-bx-user-consent-selector-block]");var l=n.length;this.updateBlockInputNames(i,l);t.appendChild(i);this.initByBlockContext(i);this.initSliderButtons(i);n=t.querySelectorAll("[data-bx-user-consent-selector-block]");if(n.length===2){var o=n[0].querySelector("[data-bx-delete]");o.style.display="inline"}}};this.removeBlock=function(e){var t=e.parentNode;var i=t.querySelectorAll("[data-bx-user-consent-selector-block]");if(i.length>1){e.remove()}i=t.querySelectorAll("[data-bx-user-consent-selector-block]");if(i.length>1){i.forEach(((e,t)=>{this.updateBlockInputNames(e,t)}))}else{var n=i[0].querySelector("[data-bx-delete]");n.style.display="none"}};this.updateBlockInputNames=function(e,t){var i=e.querySelector("[data-bx-selector]");i.name=this.inputName+"["+t+"]"+"[ID]";var n=e.querySelectorAll("[data-bx-default-input]");n.forEach((e=>{e.name=this.inputName+"["+t+"]"+"[CHECKED]"}));var l=e.querySelectorAll("[data-bx-required-input]");l.forEach((e=>{e.name=this.inputName+"["+t+"]"+"[REQUIRED]"}))};this.onChange=function(e,t,i){t.style.display=e.value?"":"none";i.style.display=e.value?"":"none";this.fillHrefByTemplate(t,e.value);this.fillHrefByTemplate(i,e.value)};this.fillHrefByTemplate=function(e,t){var i=e.getAttribute("data-bx-link-tmpl");if(!i){return}e.href=i.replace(new RegExp("#id#","g"),t)};this.fillDropDownControl=function(e,t,i){t=t||[];var n=e.children[0];e.innerHTML="";if(i&&n){e.appendChild(n)}t.forEach((function(t){if(!t||!t.caption){return}var i=document.createElement("option");i.value=t.value;i.selected=!!t.selected;i.innerText=t.caption;e.appendChild(i)}))};this.initSliderButtons=function(e){var t=e.querySelectorAll("[data-bx-slider-href]");t=BX.convert.nodeListToArray(t);t.forEach(this.slider.bindOpen,this.slider)};this.initSlider=function(){this.slider.caller=this;top.BX.addCustomEvent(top,"main-user-consent-to-list",(function(){top.BX.SidePanel.Instance.close()}))};this.onSliderClose=function(){this.sendActionRequest("getAgreements",{},(function(e){if(!e.list){return}this.selectors.forEach((function(t){var i=t.value;if(!i){i=e.list[0].ID}var n=e.list.map((function(e){return{caption:e.NAME,value:e.ID,selected:(e.ID||"").toString()===i}}));this.fillDropDownControl(t,n,true);BX.fireEvent(t,"change")}),this)}))};this.slider={caller:null,init:function(e){top.BX.SidePanel.Instance.bindAnchors({rules:[{condition:e.condition,loader:e.loader,stopParameters:[]}]})},onSaved:function(){this.onClose();top.BX.SidePanel.Instance.close()},onClose:function(){if(this.caller){this.caller.onSliderClose()}},bindOpen:function(e){BX.bind(e,"click",this.openHref.bind(this,e))},openHref:function(e,t){t.preventDefault();this.open(e.getAttribute("href"),e.getAttribute("data-bx-slider-reload"))},open:function(e,t){top.BX.SidePanel.Instance.open(e,{cacheable:false,events:{}});if(t){top.BX.addCustomEvent(top,"main-user-consent-saved",this.onSaved.bind(this))}}};this.sendActionRequest=function(e,t,i,n){i=i||null;n=n||null;t.action=e;t.sessid=BX.bitrix_sessid();t.action=e;BX.ajax({url:this.actionRequestUrl,method:"POST",data:t,timeout:10,dataType:"json",processData:true,onsuccess:BX.proxy((function(e){e=e||{};if(e.error){n.apply(this,[e])}else if(i){i.apply(this,[e])}}),this),onfailure:BX.proxy((function(){var e={error:true,text:""};if(n){n.apply(this,[e])}}),this)})};this.init(e)};
//# sourceMappingURL=script.map.js
@@ -65,6 +65,10 @@
padding: 0 0 0 20px;
}
.main-user-consent-selector-footer .main-user-consent-selector-block-link:not(:first-child) {
margin-left: 10px;
}
.main-user-consent-selector-alert {
margin: 0 0 16px 0;
padding: 14px 20px;
@@ -72,4 +76,22 @@
background: #FFFDE1;
font: 13px var(--ui-font-family-primary, var(--ui-font-family-helvetica));
color: #8B7B60;
}
}
.main-user-consent-selector-block-checkbox {
margin-bottom: 10px;
}
.main-user-consent-selector-block-link {
cursor: pointer;
}
.main-user-consent-selector-block-delete {
margin-bottom: 10px;
}
.main-user-consent-selector-block-delete-button {
cursor: pointer;
font: var(--ui-font-weight-bold) 13px var(--ui-font-family-primary, var(--ui-font-family-helvetica));
color: #d0011b;
}
@@ -1 +1 @@
.main-user-consent-selector-block{margin:0 0 10px 0;padding:10px 20px 10px 20px;-webkit-border-radius:2px;border-radius:var(--main-user-consent-selector-block-border-radius,var(--ui-border-radius-sm,2px));background:rgba(83,92,105,.07);font:13px var(--ui-font-family-primary,var(--ui-font-family-helvetica))}.main-user-consent-selector-block-name{margin:0 0 5px 0;color:#535c69}.main-user-consent-selector-block-input{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0 0 10px 0}.main-user-consent-selector-block-input-item{margin:0 12px 0 0;padding:5px 30px 5px 10px;height:38px;width:100%;border:1px solid #caced7;border-radius:var(--ui-field-border-radius); background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%228px%22%20height%3D%228px%22%20viewBox%3D%220%200%2011%207%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Ctitle%3EPath%3C/title%3E%3Cpath%20d%3D%22M5.485%204.228L1.37.114%200%201.484l4.8%204.8.685.687%205.486-5.485L9.6.115%205.484%204.227z%22%20fill%3D%22%23535C69%22%20fill-rule%3D%22evenodd%22/%3E%3C/svg%3E'); background-repeat:no-repeat;background-position:99% center;background-color:#fff;font:15px var(--ui-font-family-primary,var(--ui-font-family-helvetica));color:#535c69;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;outline:0}.main-user-consent-selector-alert a{display:inline-block;border-bottom:1px solid transparent;color:#0b66c3;-webkit-transition:border-bottom .3s;transition:border-bottom .3s;cursor:pointer}.main-user-consent-selector-alert a:hover{border-bottom:1px solid #0b66c3}.main-user-consent-selector-block-link-bold{font:var(--ui-font-weight-bold) 13px var(--ui-font-family-primary,var(--ui-font-family-helvetica))}.main-user-consent-selector-block-hint{margin:0 0 10px 0}.main-user-consent-selector-footer{padding:0 0 0 20px}.main-user-consent-selector-alert{margin:0 0 16px 0;padding:14px 20px;border-radius:var(--main-user-consent-selector-alert-border-radius,var(--ui-border-radius-sm,3px));background:#fffde1;font:13px var(--ui-font-family-primary,var(--ui-font-family-helvetica));color:#8b7b60}
.main-user-consent-selector-block{margin:0 0 10px;padding:10px 20px;-webkit-border-radius:2px;border-radius:var(--main-user-consent-selector-block-border-radius,var(--ui-border-radius-sm,2px));background:rgba(83,92,105,.07);font:13px var(--ui-font-family-primary,var(--ui-font-family-helvetica))}.main-user-consent-selector-block-name{margin:0 0 5px;color:#535c69}.main-user-consent-selector-block-input{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0 0 10px}.main-user-consent-selector-block-input-item{margin:0 12px 0 0;padding:5px 30px 5px 10px;height:38px;width:100%;border:1px solid #caced7;border-radius:var(--ui-field-border-radius);background-image:url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%228px%22%20height%3D%228px%22%20viewBox%3D%220%200%2011%207%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Ctitle%3EPath%3C/title%3E%3Cpath%20d%3D%22M5.485%204.228L1.37.114%200%201.484l4.8%204.8.685.687%205.486-5.485L9.6.115%205.484%204.227z%22%20fill%3D%22%23535C69%22%20fill-rule%3D%22evenodd%22/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:99%;background-color:#fff;font:15px var(--ui-font-family-primary,var(--ui-font-family-helvetica));color:#535c69;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;outline:none}.main-user-consent-selector-alert a{display:inline-block;border-bottom:1px solid transparent;color:#0b66c3;-webkit-transition:border-bottom .3s;transition:border-bottom .3s;cursor:pointer}.main-user-consent-selector-alert a:hover{border-bottom:1px solid #0b66c3}.main-user-consent-selector-block-link-bold{font:var(--ui-font-weight-bold) 13px var(--ui-font-family-primary,var(--ui-font-family-helvetica))}.main-user-consent-selector-block-hint{margin:0 0 10px}.main-user-consent-selector-footer{padding:0 0 0 20px}.main-user-consent-selector-footer .main-user-consent-selector-block-link:not(:first-child){margin-left:10px}.main-user-consent-selector-alert{margin:0 0 16px;padding:14px 20px;border-radius:var(--main-user-consent-selector-alert-border-radius,var(--ui-border-radius-sm,3px));background:#fffde1;font:13px var(--ui-font-family-primary,var(--ui-font-family-helvetica));color:#8b7b60}.main-user-consent-selector-block-checkbox{margin-bottom:10px}.main-user-consent-selector-block-link{cursor:pointer}.main-user-consent-selector-block-delete{margin-bottom:10px}.main-user-consent-selector-block-delete-button{cursor:pointer;font:var(--ui-font-weight-bold) 13px var(--ui-font-family-primary,var(--ui-font-family-helvetica));color:#d0011b}
@@ -1,5 +1,9 @@
<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
<?php
if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true)
{
die();
}
use Bitrix\Main\Localization\Loc;
@@ -10,52 +14,216 @@ use Bitrix\Main\Localization\Loc;
/** @var array $arParams */
/** @var array $arResult */
?>
<script>
BX.ready(function () {
new MainUserConsentSelectorManager(<?=\Bitrix\Main\Web\Json::encode(array(
'actionRequestUrl' => $arParams['ACTION_REQUEST_URL']
))?>);
});
</script>
<div data-bx-user-consent-selector="" class="main-user-consent-selector-wrapper">
<?if ($arResult['DESCRIPTION']):?>
<div class="main-user-consent-selector-alert">
<?=$arResult['DESCRIPTION']?>
</div>
<?endif;?>
<div class="main-user-consent-selector-block">
$template = null;
if ($arParams['AGREEMENTS'])
{
ob_start()
?>
<div class="main-user-consent-selector-block" data-bx-user-consent-selector-block>
<div class="main-user-consent-selector-block-name">
<?=Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_CHOOSE')?>:
</div>
<div class="main-user-consent-selector-block-input">
<select class="main-user-consent-selector-block-input-item" data-bx-selector="" name="<?=htmlspecialcharsbx($arParams['INPUT_NAME'])?>">
<option value=""><?=Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_DEF_NOT_SELECTED')?></option>
<?foreach ($arResult['LIST'] as $item):?>
<option value="<?=htmlspecialcharsbx($item['ID'])?>" <?=($item['SELECTED'] ? 'selected' : '')?>>
<?=htmlspecialcharsbx($item['NAME'])?>
<select class="main-user-consent-selector-block-input-item" data-bx-selector="">
<option value=""><?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_DEF_NOT_SELECTED') ?></option>
<?php foreach ($arResult['LIST'] as $item):?>
<option value="<?=htmlspecialcharsbx($item['ID'])?>">
<?= htmlspecialcharsbx($item['NAME']) ?>
</option>
<?endforeach;?>
<?php endforeach; ?>
</select>
<a class="main-user-consent-selector-block-link main-user-consent-selector-block-link-bold"
href="#" data-bx-link-edit="" data-bx-slider-href=""
data-bx-slider-reload="1"
data-bx-link-tmpl="<?=htmlspecialcharsbx($arParams['PATH_TO_EDIT'])?>"
data-bx-link-tmpl="<?= htmlspecialcharsbx($arParams['PATH_TO_EDIT']) ?>"
>
<?=Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_BTN_EDIT')?>
<?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_BTN_EDIT') ?>
</a>
</div>
<div class="main-user-consent-selector-block-checkbox">
<label class="ui-ctl ui-ctl-checkbox">
<input
type="hidden"
value="N"
data-bx-default-input
>
<input
type="checkbox"
checked
class="ui-ctl-element"
value="Y"
data-bx-default-input
/>
<span class="ui-ctl-label-text"><?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_DEFAULT') ?></span>
</label>
</div>
<div class="main-user-consent-selector-block-checkbox">
<label class="ui-ctl ui-ctl-checkbox">
<input
type="hidden"
value="N"
data-bx-required-input
>
<input
type="checkbox"
checked
class="ui-ctl-element"
value="Y"
data-bx-required-input
/>
<span class="ui-ctl-label-text"><?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_REQUIRED') ?></span>
</label>
</div>
<div class="main-user-consent-selector-block-hint">
<a class="main-user-consent-selector-block-link" href="#" data-bx-link-view="" data-bx-slider-href="" data-bx-link-tmpl="<?=htmlspecialcharsbx($arParams['PATH_TO_CONSENT_LIST'])?>">
<?=Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_BTN_CONSENT')?>
<a class="main-user-consent-selector-block-link" href="#" data-bx-link-view="" data-bx-slider-href="" data-bx-link-tmpl="<?= htmlspecialcharsbx($arParams['PATH_TO_CONSENT_LIST']) ?>">
<?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_BTN_CONSENT') ?>
</a>
</div>
<div class="main-user-consent-selector-block-delete">
<a class="main-user-consent-selector-block-link main-user-consent-selector-block-link-bold" data-bx-delete="">
<?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_BTN_DELETE') ?>
</a>
</div>
</div>
<?php
$template = ob_get_clean();
}
?>
<script>
BX.ready(function () {
new MainUserConsentSelectorManager(<?=\Bitrix\Main\Web\Json::encode([
'actionRequestUrl' => $arParams['ACTION_REQUEST_URL'],
'template' => $template,
'ids' => $arParams['ID'],
'inputName' => htmlspecialcharsbx($arParams['INPUT_NAME']),
])?>);
});
</script>
<div data-bx-user-consent-selector="" class="main-user-consent-selector-wrapper">
<?php if ($arResult['DESCRIPTION']): ?>
<div class="main-user-consent-selector-alert">
<?= $arResult['DESCRIPTION'] ?>
</div>
<?php endif; ?>
<div data-bx-user-consent-selector-blocks-container="">
<?php if ($arParams['AGREEMENTS']): ?>
<?php for ($index = 0; $index < count($arParams['AGREEMENTS']); $index++): ?>
<div class="main-user-consent-selector-block" data-bx-user-consent-selector-block="">
<div class="main-user-consent-selector-block-name">
<?=Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_CHOOSE')?>:
</div>
<div class="main-user-consent-selector-block-input">
<select class="main-user-consent-selector-block-input-item" data-bx-selector="" name="<?= htmlspecialcharsbx($arParams['INPUT_NAME']) . "[$index][ID]" ?>">
<option value=""><?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_DEF_NOT_SELECTED') ?></option>
<?php foreach ($arResult['LIST'] as $item): ?>
<option value="<?=htmlspecialcharsbx($item['ID'])?>" <?= ($item['ID'] === (int)$arParams['AGREEMENTS'][$index]['ID'] ? 'selected' : '') ?>>
<?= htmlspecialcharsbx($item['NAME']) ?>
</option>
<?php endforeach; ?>
</select>
<a class="main-user-consent-selector-block-link main-user-consent-selector-block-link-bold"
href="#" data-bx-link-edit="" data-bx-slider-href=""
data-bx-slider-reload="1"
data-bx-link-tmpl="<?= htmlspecialcharsbx($arParams['PATH_TO_EDIT']) ?>"
>
<?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_BTN_EDIT') ?>
</a>
</div>
<div class="main-user-consent-selector-block-checkbox">
<label class="ui-ctl ui-ctl-checkbox">
<input
type="hidden"
name="<?= htmlspecialcharsbx($arParams['INPUT_NAME']) . "[$index][CHECKED]" ?>"
value="N"
data-bx-default-input
>
<input
type="checkbox"
<?= $arParams['AGREEMENTS'][$index]['CHECKED'] === 'Y' ? 'checked' : '' ?>
class="ui-ctl-element"
name="<?= htmlspecialcharsbx($arParams['INPUT_NAME']) . "[$index][CHECKED]" ?>"
value="Y"
data-bx-default-input
/>
<span class="ui-ctl-label-text"><?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_DEFAULT') ?></span>
</label>
</div>
<div class="main-user-consent-selector-block-checkbox">
<label class="ui-ctl ui-ctl-checkbox">
<input
type="hidden"
name="<?= htmlspecialcharsbx($arParams['INPUT_NAME']) . "[$index][REQUIRED]" ?>"
value="N"
data-bx-required-input
>
<input
type="checkbox"
<?= $arParams['AGREEMENTS'][$index]['REQUIRED'] === 'Y' ? 'checked' : '' ?>
class="ui-ctl-element"
name="<?= htmlspecialcharsbx($arParams['INPUT_NAME']) . "[$index][REQUIRED]" ?>"
value="Y"
data-bx-required-input
/>
<span class="ui-ctl-label-text"><?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_REQUIRED') ?></span>
</label>
</div>
<div class="main-user-consent-selector-block-hint">
<a class="main-user-consent-selector-block-link" href="#" data-bx-link-view="" data-bx-slider-href="" data-bx-link-tmpl="<?= htmlspecialcharsbx($arParams['PATH_TO_CONSENT_LIST']) ?>">
<?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_BTN_CONSENT') ?>
</a>
</div>
<div class="main-user-consent-selector-block-delete">
<a class="main-user-consent-selector-block-link main-user-consent-selector-block-link-bold" style="display: <?= count($arParams['AGREEMENTS']) >= 2 ? 'inline' : 'none' ?>" data-bx-delete="">
<?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_BTN_DELETE') ?>
</a>
</div>
</div>
<?php endfor; ?>
<?php else: ?>
<div class="main-user-consent-selector-block" data-bx-user-consent-selector-block="">
<div class="main-user-consent-selector-block-name">
<?=Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_CHOOSE')?>:
</div>
<div class="main-user-consent-selector-block-input">
<select class="main-user-consent-selector-block-input-item" data-bx-selector="" name="<?= htmlspecialcharsbx($arParams['INPUT_NAME']) ?>">
<option value=""><?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_DEF_NOT_SELECTED') ?></option>
<?php foreach ($arResult['LIST'] as $item): ?>
<option value="<?=htmlspecialcharsbx($item['ID'])?>" <?=($item['ID'] === (int)$arParams['ID'] ? 'selected' : '')?>>
<?= htmlspecialcharsbx($item['NAME']) ?>
</option>
<?php endforeach; ?>
</select>
<a class="main-user-consent-selector-block-link main-user-consent-selector-block-link-bold"
href="#" data-bx-link-edit="" data-bx-slider-href=""
data-bx-slider-reload="1"
data-bx-link-tmpl="<?= htmlspecialcharsbx($arParams['PATH_TO_EDIT']) ?>"
>
<?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_BTN_EDIT') ?>
</a>
</div>
<div class="main-user-consent-selector-block-hint">
<a class="main-user-consent-selector-block-link" href="#" data-bx-link-view="" data-bx-slider-href="" data-bx-link-tmpl="<?= htmlspecialcharsbx($arParams['PATH_TO_CONSENT_LIST']) ?>">
<?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_BTN_CONSENT') ?>
</a>
</div>
</div>
<?php endif; ?>
</div>
<div class="main-user-consent-selector-footer">
<a class="main-user-consent-selector-block-link" data-bx-link-add="" data-bx-slider-href="" data-bx-slider-reload="true" href="<?=htmlspecialcharsbx($arParams['PATH_TO_ADD'])?>">
<?php if ($arParams['AGREEMENTS']): ?>
<a class="main-user-consent-selector-block-link" data-bx-link-add="">
<span class="main-user-consent-selector-block-plus-icon">&#43;</span>
<?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_BTN_ADD') ?>
</a>
<?php endif; ?>
<a class="main-user-consent-selector-block-link" data-bx-slider-href="" data-bx-slider-reload="true" href="<?=htmlspecialcharsbx($arParams['PATH_TO_ADD'])?>">
<span class="main-user-consent-selector-block-plus-icon">&#43;</span>
<?=Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_BTN_CREATE_1')?>
<?= Loc::getMessage('MAIN_USER_CONSENT_SELECTOR_BTN_CREATE_1') ?>
</a>
</div>
</div>
@@ -125,16 +125,11 @@ BX.Helper =
show: function(additionalParam, sliderOptions)
{
if (this.isOpen())
{
return;
}
if (!BX.Type.isPlainObject(sliderOptions))
{
sliderOptions = {};
}
//compote code
const frameOpenUrl = this.frameOpenUrl + ((this.frameOpenUrl.indexOf("?") < 0) ? "?" : "&") +
(BX.type.isNotEmptyString(additionalParam) ? additionalParam : "");
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -29,6 +29,7 @@ BX.Kanban.Column = function(options)
this.total = null;
this.isTotalFrozen = false;
this.animate = options.animate || null;
this.autoPagination = false;
this.canEdit = null;
this.canSort = null;
@@ -126,13 +127,22 @@ BX.Kanban.Column.prototype =
this.setColor(options.color);
this.setData(options.data);
var boolOptions = ["canEdit", "canSort", "canRemove", "canAddItem", "droppable", "canSortItems",];
boolOptions.forEach(function(boolOption) {
const boolOptions = [
'canEdit',
'canSort',
'canRemove',
'canAddItem',
'droppable',
'canSortItems',
'autoPagination',
];
boolOptions.forEach((boolOption) => {
if (BX.type.isBoolean(options[boolOption]))
{
this[boolOption] = options[boolOption];
}
}, this);
});
},
setColor: function(color)
@@ -567,6 +577,11 @@ BX.Kanban.Column.prototype =
hasLoading: function()
{
if (this.autoPagination)
{
return true;
}
return this.total !== null && this.total > this.getItemsCount();
},
@@ -623,6 +638,11 @@ BX.Kanban.Column.prototype =
columnContainer.classList[isEmptyColumn ? "add" : "remove"]("main-kanban-column-empty");
columnContainer.classList[this.isDroppable() ? "add" : "remove"]("main-kanban-column-droppable");
if (this.autoPagination)
{
columnContainer.classList.add("--auto-pagination");
}
if(!this.getGrid().firstRenderComplete)
{
this.hasBeenEdt = true;
@@ -1172,7 +1192,7 @@ BX.Kanban.Column.prototype =
var firstItem = this.getFirstItem(false);
if (firstItem)
{
var existsDraftItem = firstItem.getId().indexOf('kanban-new-item-') === 0;
const existsDraftItem = firstItem.getId().toString().indexOf('kanban-new-item-') === 0;
if (existsDraftItem)
{
firstItem.applyDraftEditMode();
@@ -2023,6 +2043,7 @@ BX.Kanban.Pagination.prototype = {
jsDD.refreshDestArea();
var loader = this.getLoader();
if (!this.loadingInProgress && column.hasLoading() && loader.offsetTop < scrollTop + offsetHeight)
{
this.showLoader();
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -334,6 +334,10 @@
font-weight: var(--ui-font-weight-regular, 400);
}
.main-kanban-column.--auto-pagination .main-kanban-column-total-item {
display: none;
}
.main-kanban-column-title-dark .main-kanban-column-total-item,
.main-kanban-column-title-dark .main-kanban-column-title-text { color: #fff }
File diff suppressed because one or more lines are too long
@@ -3,4 +3,5 @@ module.exports = {
output: './dist/md5.bundle.js',
namespace: 'BX',
adjustConfigPhp: false,
};
browserslist: true,
};
@@ -1,3 +1,4 @@
/* eslint-disable */
(function (exports) {
'use strict';
@@ -37,23 +38,19 @@
var md5 = function () {
var ERROR = 'input is invalid type';
var WINDOW = (typeof window === "undefined" ? "undefined" : babelHelpers.typeof(window)) === 'object';
var WINDOW = typeof window === 'object';
var root = WINDOW ? window : {};
if (root.JS_MD5_NO_WINDOW) {
WINDOW = false;
}
var WEB_WORKER = !WINDOW && (typeof self === "undefined" ? "undefined" : babelHelpers.typeof(self)) === 'object';
var NODE_JS = !root.JS_MD5_NO_NODE_JS && (typeof process === "undefined" ? "undefined" : babelHelpers.typeof(process)) === 'object' && process.versions && process.versions.node;
var WEB_WORKER = !WINDOW && typeof self === 'object';
var NODE_JS = !root.JS_MD5_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
if (NODE_JS) {
root = global;
} else if (WEB_WORKER) {
root = self;
}
var COMMON_JS = !root.JS_MD5_NO_COMMON_JS && (typeof module === "undefined" ? "undefined" : babelHelpers.typeof(module)) === 'object' && module.exports;
var COMMON_JS = !root.JS_MD5_NO_COMMON_JS && typeof module === 'object' && module.exports;
var AMD = typeof define === 'function' && define.amd;
var ARRAY_BUFFER = !root.JS_MD5_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';
var HEX_CHARS = '0123456789abcdef'.split('');
@@ -62,25 +59,23 @@
var OUTPUT_TYPES = ['hex', 'array', 'digest', 'buffer', 'arrayBuffer', 'base64'];
var BASE64_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
var blocks = [],
buffer8;
buffer8;
if (ARRAY_BUFFER) {
var buffer = new ArrayBuffer(68);
buffer8 = new Uint8Array(buffer);
blocks = new Uint32Array(buffer);
}
if (root.JS_MD5_NO_NODE_JS || !Array.isArray) {
Array.isArray = function (obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
};
}
if (ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {
ArrayBuffer.isView = function (obj) {
return babelHelpers.typeof(obj) === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;
return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;
};
}
/**
* @method hex
* @memberof md5
@@ -92,7 +87,6 @@
* // equal to
* md5('The quick brown fox jumps over the lazy dog');
*/
/**
* @method digest
* @memberof md5
@@ -102,7 +96,6 @@
* @example
* md5.digest('The quick brown fox jumps over the lazy dog');
*/
/**
* @method array
* @memberof md5
@@ -112,7 +105,6 @@
* @example
* md5.array('The quick brown fox jumps over the lazy dog');
*/
/**
* @method arrayBuffer
* @memberof md5
@@ -122,7 +114,6 @@
* @example
* md5.arrayBuffer('The quick brown fox jumps over the lazy dog');
*/
/**
* @method buffer
* @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
@@ -133,7 +124,6 @@
* @example
* md5.buffer('The quick brown fox jumps over the lazy dog');
*/
/**
* @method base64
* @memberof md5
@@ -143,13 +133,12 @@
* @example
* md5.base64('The quick brown fox jumps over the lazy dog');
*/
var createOutputMethod = function createOutputMethod(outputType) {
var createOutputMethod = function (outputType) {
return function (message) {
return new Md5(true).update(message)[outputType]();
};
};
/**
* @method create
* @memberof md5
@@ -158,7 +147,6 @@
* @example
* var hash = md5.create();
*/
/**
* @method update
* @memberof md5
@@ -171,36 +159,27 @@
* var hash = md5.create();
* hash.update('The quick brown fox jumps over the lazy dog');
*/
var createMethod = function createMethod() {
var createMethod = function () {
var method = createOutputMethod('hex');
if (NODE_JS) {
method = nodeWrap(method);
}
method.create = function () {
return new Md5();
};
method.update = function (message) {
return method.create().update(message);
};
for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
var type = OUTPUT_TYPES[i];
method[type] = createOutputMethod(type);
}
return method;
};
var nodeWrap = function nodeWrap(method) {
var nodeWrap = function (method) {
var crypto = eval("require('crypto')");
var Buffer = eval("require('buffer').Buffer");
var nodeMethod = function nodeMethod(message) {
var nodeMethod = function (message) {
if (typeof message === 'string') {
return crypto.createHash('md5').update(message, 'utf8').digest('hex');
} else {
@@ -210,24 +189,21 @@
message = new Uint8Array(message);
}
}
if (Array.isArray(message) || ArrayBuffer.isView(message) || message.constructor === Buffer) {
return crypto.createHash('md5').update(new Buffer(message)).digest('hex');
} else {
return method(message);
}
};
return nodeMethod;
};
/**
* Md5 class
* @class Md5
* @description This is internal class.
* @see {@link md5.create}
*/
function Md5(sharedMemory) {
if (sharedMemory) {
blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
@@ -242,11 +218,11 @@
this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
}
}
this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0;
this.finalized = this.hashed = false;
this.first = true;
}
/**
* @method update
* @memberof Md5
@@ -256,16 +232,12 @@
* @returns {Md5} Md5 object.
* @see {@link md5.update}
*/
Md5.prototype.update = function (message) {
if (this.finalized) {
return;
}
var notString,
type = babelHelpers.typeof(message);
type = typeof message;
if (type !== 'string') {
if (type === 'object') {
if (message === null) {
@@ -280,24 +252,20 @@
} else {
throw ERROR;
}
notString = true;
}
var code,
index = 0,
i,
length = message.length,
blocks = this.blocks;
index = 0,
i,
length = message.length,
blocks = this.blocks;
var buffer8 = this.buffer8;
while (index < length) {
if (this.hashed) {
this.hashed = false;
blocks[0] = blocks[16];
blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
}
if (notString) {
if (ARRAY_BUFFER) {
for (i = this.start; index < length && i < 64; ++index) {
@@ -312,7 +280,6 @@
if (ARRAY_BUFFER) {
for (i = this.start; index < length && i < 64; ++index) {
code = message.charCodeAt(index);
if (code < 0x80) {
buffer8[i++] = code;
} else if (code < 0x800) {
@@ -333,7 +300,6 @@
} else {
for (i = this.start; index < length && i < 64; ++index) {
code = message.charCodeAt(index);
if (code < 0x80) {
blocks[i >> 2] |= code << SHIFT[i++ & 3];
} else if (code < 0x800) {
@@ -353,10 +319,8 @@
}
}
}
this.lastByteIndex = i;
this.bytes += i - this.start;
if (i >= 64) {
this.start = i - 64;
this.hash();
@@ -365,48 +329,39 @@
this.start = i;
}
}
if (this.bytes > 4294967295) {
this.hBytes += this.bytes / 4294967296 << 0;
this.bytes = this.bytes % 4294967296;
}
return this;
};
Md5.prototype.finalize = function () {
if (this.finalized) {
return;
}
this.finalized = true;
var blocks = this.blocks,
i = this.lastByteIndex;
i = this.lastByteIndex;
blocks[i >> 2] |= EXTRA[i & 3];
if (i >= 56) {
if (!this.hashed) {
this.hash();
}
blocks[0] = blocks[16];
blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
}
blocks[14] = this.bytes << 3;
blocks[15] = this.hBytes << 3 | this.bytes >>> 29;
this.hash();
};
Md5.prototype.hash = function () {
var a,
b,
c,
d,
bc,
da,
blocks = this.blocks;
b,
c,
d,
bc,
da,
blocks = this.blocks;
if (this.first) {
a = blocks[0] - 680876937;
a = (a << 7 | a >>> 25) - 271733879 << 0;
@@ -430,7 +385,6 @@
b += (a ^ c & (d ^ a)) + blocks[3] - 1044525330;
b = (b << 22 | b >>> 10) + c << 0;
}
a += (d ^ b & (c ^ d)) + blocks[4] - 176418897;
a = (a << 7 | a >>> 25) + b << 0;
d += (c ^ a & (b ^ c)) + blocks[5] + 1200080426;
@@ -559,7 +513,6 @@
c = (c << 15 | c >>> 17) + d << 0;
b += (d ^ (c | ~a)) + blocks[9] - 343485551;
b = (b << 21 | b >>> 11) + c << 0;
if (this.first) {
this.h0 = a + 1732584193 << 0;
this.h1 = b - 271733879 << 0;
@@ -573,6 +526,7 @@
this.h3 = this.h3 + d << 0;
}
};
/**
* @method hex
* @memberof Md5
@@ -583,16 +537,15 @@
* @example
* hash.hex();
*/
Md5.prototype.hex = function () {
this.finalize();
var h0 = this.h0,
h1 = this.h1,
h2 = this.h2,
h3 = this.h3;
h1 = this.h1,
h2 = this.h2,
h3 = this.h3;
return HEX_CHARS[h0 >> 4 & 0x0F] + HEX_CHARS[h0 & 0x0F] + HEX_CHARS[h0 >> 12 & 0x0F] + HEX_CHARS[h0 >> 8 & 0x0F] + HEX_CHARS[h0 >> 20 & 0x0F] + HEX_CHARS[h0 >> 16 & 0x0F] + HEX_CHARS[h0 >> 28 & 0x0F] + HEX_CHARS[h0 >> 24 & 0x0F] + HEX_CHARS[h1 >> 4 & 0x0F] + HEX_CHARS[h1 & 0x0F] + HEX_CHARS[h1 >> 12 & 0x0F] + HEX_CHARS[h1 >> 8 & 0x0F] + HEX_CHARS[h1 >> 20 & 0x0F] + HEX_CHARS[h1 >> 16 & 0x0F] + HEX_CHARS[h1 >> 28 & 0x0F] + HEX_CHARS[h1 >> 24 & 0x0F] + HEX_CHARS[h2 >> 4 & 0x0F] + HEX_CHARS[h2 & 0x0F] + HEX_CHARS[h2 >> 12 & 0x0F] + HEX_CHARS[h2 >> 8 & 0x0F] + HEX_CHARS[h2 >> 20 & 0x0F] + HEX_CHARS[h2 >> 16 & 0x0F] + HEX_CHARS[h2 >> 28 & 0x0F] + HEX_CHARS[h2 >> 24 & 0x0F] + HEX_CHARS[h3 >> 4 & 0x0F] + HEX_CHARS[h3 & 0x0F] + HEX_CHARS[h3 >> 12 & 0x0F] + HEX_CHARS[h3 >> 8 & 0x0F] + HEX_CHARS[h3 >> 20 & 0x0F] + HEX_CHARS[h3 >> 16 & 0x0F] + HEX_CHARS[h3 >> 28 & 0x0F] + HEX_CHARS[h3 >> 24 & 0x0F];
};
/**
* @method toString
* @memberof Md5
@@ -603,9 +556,8 @@
* @example
* hash.toString();
*/
Md5.prototype.toString = Md5.prototype.hex;
/**
* @method digest
* @memberof Md5
@@ -616,15 +568,15 @@
* @example
* hash.digest();
*/
Md5.prototype.digest = function () {
this.finalize();
var h0 = this.h0,
h1 = this.h1,
h2 = this.h2,
h3 = this.h3;
h1 = this.h1,
h2 = this.h2,
h3 = this.h3;
return [h0 & 0xFF, h0 >> 8 & 0xFF, h0 >> 16 & 0xFF, h0 >> 24 & 0xFF, h1 & 0xFF, h1 >> 8 & 0xFF, h1 >> 16 & 0xFF, h1 >> 24 & 0xFF, h2 & 0xFF, h2 >> 8 & 0xFF, h2 >> 16 & 0xFF, h2 >> 24 & 0xFF, h3 & 0xFF, h3 >> 8 & 0xFF, h3 >> 16 & 0xFF, h3 >> 24 & 0xFF];
};
/**
* @method array
* @memberof Md5
@@ -635,9 +587,8 @@
* @example
* hash.array();
*/
Md5.prototype.array = Md5.prototype.digest;
/**
* @method arrayBuffer
* @memberof Md5
@@ -648,7 +599,6 @@
* @example
* hash.arrayBuffer();
*/
Md5.prototype.arrayBuffer = function () {
this.finalize();
var buffer = new ArrayBuffer(16);
@@ -659,6 +609,7 @@
blocks[3] = this.h3;
return buffer;
};
/**
* @method buffer
* @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
@@ -670,9 +621,8 @@
* @example
* hash.buffer();
*/
Md5.prototype.buffer = Md5.prototype.arrayBuffer;
/**
* @method base64
* @memberof Md5
@@ -683,26 +633,22 @@
* @example
* hash.base64();
*/
Md5.prototype.base64 = function () {
var v1,
v2,
v3,
base64Str = '',
bytes = this.array();
v2,
v3,
base64Str = '',
bytes = this.array();
for (var i = 0; i < 15;) {
v1 = bytes[i++];
v2 = bytes[i++];
v3 = bytes[i++];
base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] + BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] + BASE64_ENCODE_CHAR[(v2 << 2 | v3 >>> 6) & 63] + BASE64_ENCODE_CHAR[v3 & 63];
}
v1 = bytes[i];
base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] + BASE64_ENCODE_CHAR[v1 << 4 & 63] + '==';
return base64Str;
};
return createMethod();
}();
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -259,6 +259,25 @@ this.BX = this.BX || {};
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Popup).call(this));
_classPrivateMethodInitSpec(babelHelpers.assertThisInitialized(_this), _enableTargetScroll);
_classPrivateMethodInitSpec(babelHelpers.assertThisInitialized(_this), _disableTargetScroll);
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "handleAutoHide", function (event) {
if (_this.isDestroyed()) {
return;
}
if (_this.autoHideHandler !== null) {
if (_this.autoHideHandler(event)) {
_this._tryCloseByEvent(event);
}
} else if (event.target !== _this.getPopupContainer() && !_this.getPopupContainer().contains(event.target)) {
_this._tryCloseByEvent(event);
}
});
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "handleDocumentKeyUp", function (event) {
if (event.keyCode === 27) {
checkEscPressed(_this.getZindex(), function () {
_this.close();
});
}
});
_this.setEventNamespace('BX.Main.Popup');
var _arguments = Array.prototype.slice.call(arguments),
popupId = _arguments[0],
@@ -303,7 +322,6 @@ this.BX = this.BX || {};
_this.autoHide = params.autoHide === true;
_this.disableScroll = params.disableScroll === true || params.isScrollBlock === true;
_this.autoHideHandler = main_core.Type.isFunction(params.autoHideHandler) ? params.autoHideHandler : null;
_this.handleAutoHide = _this.handleAutoHide.bind(babelHelpers.assertThisInitialized(_this));
_this.handleOverlayClick = _this.handleOverlayClick.bind(babelHelpers.assertThisInitialized(_this));
_this.isAutoHideBinded = false;
_this.closeByEsc = params.closeByEsc === true;
@@ -324,7 +342,7 @@ this.BX = this.BX || {};
_this.contentBackground = null;
_this.borderRadius = null;
_this.contentBorderRadius = null;
_this.targetContainer = main_core.Type.isElementNode(params.targetContainer) ? params.targetContainer : document.body;
_this.setTargetContainer(params.targetContainer);
_this.dragOptions = {
cursor: '',
callback: function callback() {},
@@ -338,7 +356,6 @@ this.BX = this.BX || {};
_this.animationCloseEventType = null;
_this.handleDocumentMouseMove = _this.handleDocumentMouseMove.bind(babelHelpers.assertThisInitialized(_this));
_this.handleDocumentMouseUp = _this.handleDocumentMouseUp.bind(babelHelpers.assertThisInitialized(_this));
_this.handleDocumentKeyUp = _this.handleDocumentKeyUp.bind(babelHelpers.assertThisInitialized(_this));
_this.handleResizeWindow = _this.handleResizeWindow.bind(babelHelpers.assertThisInitialized(_this));
_this.handleResize = _this.handleResize.bind(babelHelpers.assertThisInitialized(_this));
_this.handleMove = _this.handleMove.bind(babelHelpers.assertThisInitialized(_this));
@@ -380,7 +397,7 @@ this.BX = this.BX || {};
* @private
*/
_this.popupContainer = main_core.Tag.render(_templateObject4 || (_templateObject4 = babelHelpers.taggedTemplateLiteral(["\n\t\t\t<div\n\t\t\t\tclass=\"", "\"\n\t\t\t\tid=\"", "\"\n\t\t\t\tstyle=\"display: none; position: absolute; left: 0; top: 0;\"\n\t\t\t>", "</div>\n\t\t"])), popupClassName, popupId, [_this.titleBar, _this.contentContainer, _this.closeIcon]);
_this.targetContainer.appendChild(_this.popupContainer);
_this.getTargetContainer().append(_this.popupContainer);
_this.zIndexComponent = main_core_zIndexManager.ZIndexManager.register(_this.popupContainer, params.zIndexOptions);
_this.buttonsContainer = null;
if (params.contentColor && main_core.Type.isStringFilled(params.contentColor)) {
@@ -985,6 +1002,23 @@ this.BX = this.BX || {};
this.designSystemContext = context;
}
}
}, {
key: "setTargetContainer",
value: function setTargetContainer(targetContainer) {
var newTargetContainer = main_core.Type.isElementNode(targetContainer) ? targetContainer : document.body;
if (newTargetContainer === this.targetContainer) {
return;
}
this.targetContainer = newTargetContainer;
if (this.getPopupContainer()) {
main_core_zIndexManager.ZIndexManager.unregister(this.getPopupContainer());
this.getTargetContainer().append(this.getPopupContainer());
main_core_zIndexManager.ZIndexManager.register(this.getPopupContainer());
}
if (this.overlay) {
main_core.Dom.append(this.overlay.element, this.getTargetContainer());
}
}
}, {
key: "getTargetContainer",
value: function getTargetContainer() {
@@ -1159,7 +1193,7 @@ this.BX = this.BX || {};
key: "bindClosingByEsc",
value: function bindClosingByEsc() {
if (this.closeByEsc && !this.isCloseByEscBinded) {
main_core.Event.bind(document, 'keyup', this.handleDocumentKeyUp);
main_core.Event.bind(this.targetContainer.ownerDocument, 'keyup', this.handleDocumentKeyUp, true);
this.isCloseByEscBinded = true;
}
}
@@ -1170,7 +1204,7 @@ this.BX = this.BX || {};
key: "unbindClosingByEsc",
value: function unbindClosingByEsc() {
if (this.isCloseByEscBinded) {
main_core.Event.unbind(document, 'keyup', this.handleDocumentKeyUp);
main_core.Event.unbind(this.targetContainer.ownerDocument, 'keyup', this.handleDocumentKeyUp, true);
this.isCloseByEscBinded = false;
}
}
@@ -1201,9 +1235,9 @@ this.BX = this.BX || {};
main_core.Event.bind(this.overlay.element, 'click', this.handleOverlayClick);
} else {
if (this.isCompatibleMode()) {
main_core.Event.bind(document, 'click', this.handleAutoHide);
main_core.Event.bind(this.targetContainer.ownerDocument, 'click', this.handleAutoHide);
} else {
document.addEventListener('click', this.handleAutoHide, true);
this.targetContainer.ownerDocument.addEventListener('click', this.handleAutoHide, true);
}
}
}
@@ -1223,9 +1257,9 @@ this.BX = this.BX || {};
main_core.Event.unbind(this.overlay.element, 'click', this.handleOverlayClick);
} else {
if (this.isCompatibleMode()) {
main_core.Event.unbind(document, 'click', this.handleAutoHide);
main_core.Event.unbind(this.targetContainer.ownerDocument, 'click', this.handleAutoHide);
} else {
document.removeEventListener('click', this.handleAutoHide, true);
this.targetContainer.ownerDocument.removeEventListener('click', this.handleAutoHide, true);
}
}
}
@@ -1234,24 +1268,10 @@ this.BX = this.BX || {};
* @private
*/
}, {
key: "handleAutoHide",
value: function handleAutoHide(event) {
if (this.isDestroyed()) {
return;
}
if (this.autoHideHandler !== null) {
if (this.autoHideHandler(event)) {
this._tryCloseByEvent(event);
}
} else if (event.target !== this.getPopupContainer() && !this.getPopupContainer().contains(event.target)) {
this._tryCloseByEvent(event);
}
}
key: "_tryCloseByEvent",
/**
* @private
*/
}, {
key: "_tryCloseByEvent",
value: function _tryCloseByEvent(event) {
var _this2 = this;
if (this.isCompatibleMode()) {
@@ -1289,7 +1309,7 @@ this.BX = this.BX || {};
element: main_core.Tag.render(_templateObject9 || (_templateObject9 = babelHelpers.taggedTemplateLiteral(["\n\t\t\t\t\t<div class=\"popup-window-overlay\" id=\"popup-window-overlay-", "\"></div>\n\t\t\t\t"])), this.getId())
};
this.resizeOverlay();
main_core.Dom.append(this.overlay.element, this.targetContainer);
main_core.Dom.append(this.overlay.element, this.getTargetContainer());
this.getZIndexComponent().setOverlay(this.overlay.element);
}
if (main_core.Type.isNumber(params === null || params === void 0 ? void 0 : params.opacity) && params.opacity >= 0 && params.opacity <= 100) {
@@ -1553,7 +1573,8 @@ this.BX = this.BX || {};
}, {
key: "isShown",
value: function isShown() {
return !this.isDestroyed() && this.getPopupContainer().style.display === 'block';
var _this$getPopupContain;
return !this.isDestroyed() && ((_this$getPopupContain = this.getPopupContainer()) === null || _this$getPopupContain === void 0 ? void 0 : _this$getPopupContain.style.display) === 'block';
}
}, {
key: "destroy",
@@ -1753,20 +1774,10 @@ this.BX = this.BX || {};
* @private
*/
}, {
key: "handleDocumentKeyUp",
value: function handleDocumentKeyUp(event) {
var _this7 = this;
if (event.keyCode === 27) {
checkEscPressed(this.getZindex(), function () {
_this7.close();
});
}
}
key: "handleResizeWindow",
/**
* @private
*/
}, {
key: "handleResizeWindow",
value: function handleResizeWindow() {
if (this.isShown()) {
this.adjustPosition();
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -166,7 +166,6 @@ export default class Popup extends EventEmitter
this.autoHide = params.autoHide === true;
this.disableScroll = params.disableScroll === true || params.isScrollBlock === true;
this.autoHideHandler = Type.isFunction(params.autoHideHandler) ? params.autoHideHandler : null;
this.handleAutoHide = this.handleAutoHide.bind(this);
this.handleOverlayClick = this.handleOverlayClick.bind(this);
this.isAutoHideBinded = false;
this.closeByEsc = params.closeByEsc === true;
@@ -192,7 +191,7 @@ export default class Popup extends EventEmitter
this.borderRadius = null;
this.contentBorderRadius = null;
this.targetContainer = Type.isElementNode(params.targetContainer) ? params.targetContainer : document.body;
this.setTargetContainer(params.targetContainer);
this.dragOptions = {
cursor: '',
@@ -211,7 +210,6 @@ export default class Popup extends EventEmitter
this.handleDocumentMouseMove = this.handleDocumentMouseMove.bind(this);
this.handleDocumentMouseUp = this.handleDocumentMouseUp.bind(this);
this.handleDocumentKeyUp = this.handleDocumentKeyUp.bind(this);
this.handleResizeWindow = this.handleResizeWindow.bind(this);
this.handleResize = this.handleResize.bind(this);
this.handleMove = this.handleMove.bind(this);
@@ -284,7 +282,7 @@ export default class Popup extends EventEmitter
>${[this.titleBar, this.contentContainer, this.closeIcon]}</div>
`;
this.targetContainer.appendChild(this.popupContainer);
this.getTargetContainer().append(this.popupContainer);
this.zIndexComponent = ZIndexManager.register(this.popupContainer, params.zIndexOptions);
@@ -1050,6 +1048,28 @@ export default class Popup extends EventEmitter
}
}
setTargetContainer(targetContainer: HTMLElement): void
{
const newTargetContainer = Type.isElementNode(targetContainer) ? targetContainer : document.body;
if (newTargetContainer === this.targetContainer)
{
return;
}
this.targetContainer = newTargetContainer;
if (this.getPopupContainer())
{
ZIndexManager.unregister(this.getPopupContainer());
this.getTargetContainer().append(this.getPopupContainer());
ZIndexManager.register(this.getPopupContainer());
}
if (this.overlay)
{
Dom.append(this.overlay.element, this.getTargetContainer());
}
}
getTargetContainer(): HTMLElement
{
return this.targetContainer;
@@ -1265,7 +1285,7 @@ export default class Popup extends EventEmitter
{
if (this.closeByEsc && !this.isCloseByEscBinded)
{
Event.bind(document, 'keyup', this.handleDocumentKeyUp);
Event.bind(this.targetContainer.ownerDocument, 'keyup', this.handleDocumentKeyUp, true);
this.isCloseByEscBinded = true;
}
}
@@ -1277,7 +1297,7 @@ export default class Popup extends EventEmitter
{
if (this.isCloseByEscBinded)
{
Event.unbind(document, 'keyup', this.handleDocumentKeyUp);
Event.unbind(this.targetContainer.ownerDocument, 'keyup', this.handleDocumentKeyUp, true);
this.isCloseByEscBinded = false;
}
}
@@ -1319,11 +1339,11 @@ export default class Popup extends EventEmitter
{
if (this.isCompatibleMode())
{
Event.bind(document, 'click', this.handleAutoHide);
Event.bind(this.targetContainer.ownerDocument, 'click', this.handleAutoHide);
}
else
{
document.addEventListener('click', this.handleAutoHide, true);
this.targetContainer.ownerDocument.addEventListener('click', this.handleAutoHide, true);
}
}
}
@@ -1351,11 +1371,11 @@ export default class Popup extends EventEmitter
{
if (this.isCompatibleMode())
{
Event.unbind(document, 'click', this.handleAutoHide);
Event.unbind(this.targetContainer.ownerDocument, 'click', this.handleAutoHide);
}
else
{
document.removeEventListener('click', this.handleAutoHide, true);
this.targetContainer.ownerDocument.removeEventListener('click', this.handleAutoHide, true);
}
}
}
@@ -1364,8 +1384,7 @@ export default class Popup extends EventEmitter
/**
* @private
*/
handleAutoHide(event): void
{
handleAutoHide = (event): void => {
if (this.isDestroyed())
{
return;
@@ -1382,7 +1401,7 @@ export default class Popup extends EventEmitter
{
this._tryCloseByEvent(event);
}
}
};
/**
* @private
@@ -1433,7 +1452,7 @@ export default class Popup extends EventEmitter
this.resizeOverlay();
Dom.append(this.overlay.element, this.targetContainer);
Dom.append(this.overlay.element, this.getTargetContainer());
this.getZIndexComponent().setOverlay(this.overlay.element);
}
@@ -1814,7 +1833,7 @@ export default class Popup extends EventEmitter
isShown(): boolean
{
return !this.isDestroyed() && this.getPopupContainer().style.display === 'block';
return !this.isDestroyed() && this.getPopupContainer()?.style.display === 'block';
}
destroy(): void
@@ -2095,15 +2114,14 @@ export default class Popup extends EventEmitter
/**
* @private
*/
handleDocumentKeyUp(event): void
{
handleDocumentKeyUp = (event): void => {
if (event.keyCode === 27)
{
checkEscPressed(this.getZindex(), () => {
this.close();
});
}
}
};
/**
* @private
@@ -13,8 +13,10 @@ return [
'clipboard',
'ui.fonts.opensans',
'popup',
'ui.design-tokens.air',
'ui.icon-set.actions',
'ui.icon-set.main',
'ui.icon-set.outline',
],
'skip_core' => false,
];
@@ -81,39 +81,107 @@
z-index: 1;
transform: translateX(-100%);
transition: all 300ms ease;
pointer-events: none;
}
.side-panel-extra-labels {
display: flex;
flex-direction: column;
align-items: flex-end;
margin-top: 10px;
transition-property: opacity, display, transform;
transition-duration: 150ms;
transition-timing-function: ease-in-out;
transition-behavior: allow-discrete;
}
.side-panel-extra-labels.--hidden {
opacity: 0;
pointer-events: none;
transform: translateX(100%);
}
.side-panel-label {
display: inline-flex;
min-width: 37px;
height: 38px;
padding-right: 5px;
align-items: center;
min-width: 36px;
height: 28px;
margin-bottom: 10px;
background: rgba(47, 198, 246, 0.95);
border-top-left-radius: 19px;
border-bottom-left-radius: 19px;
position: relative;
background: var(--sidepanel-label-background, var(--ui-color));
white-space: nowrap;
overflow: hidden;
/*overflow: hidden;*/
transition: top 0.3s;
box-shadow: inset -6px 0 8px -10px rgba(0, 0, 0, 0.95);
box-shadow: var(--sidepanel-label-box-shadow, inset -6px 0 8px -10px rgba(0, 0, 0, 0.95));
z-index: 1;
cursor: pointer;
pointer-events: auto;
opacity: 1;
transition-property: opacity, display, transform;
transition-duration: 150ms;
transition-timing-function: ease-in-out;
transition-behavior: allow-discrete;
box-sizing: border-box;
border-top-left-radius: 18px;
border-bottom-left-radius: 18px;
border: var(--sidepanel-label-border);
border-right: none;
}
.side-panel-label.--ui-hoverable {
--ui-color: var(--ui-color-base-6);
}
.side-panel-label.--close-label.--ui-hoverable {
--ui-color: #0075FF;
}
.side-panel-label:before {
position: absolute;
content: '';
inset: -5px 0 -5px -5px;
}
.side-panel-label:hover {
background: var(--sidepanel-label-background-hover, var(--ui-color-hover));
border: var(--sidepanel-label-border-hover);
border-right: none;
}
.side-panel-label.--close-label {
min-width: 43px;
height: 36px;
background: var(--sidepanel-close-label-background, var(--sidepanel-label-background, var(--ui-color)));
border: var(--sidepanel-close-label-border, var(--sidepanel-label-border));
border-right: none;
}
.side-panel-label:hover.--close-label {
background: var(--sidepanel-close-label-background-hover, var(--sidepanel-label-background-hover, var(--ui-color-hover)));
border: var(--sidepanel-close-label-border-hover, var(--sidepanel-label-border-hover));
border-right: none;
}
.side-panel-label.--hidden {
opacity: 0;
pointer-events: none;
transform: translateX(100%);
}
.side-panel-label:not(.--visible) {
display: none;
}
.side-panel-label-icon-box {
display: inline-flex;
align-items: center;
width: 34px;
height: 38px;
vertical-align: top;
border-radius: 19px;
min-width: 20px;
height: 20px;
transition: all .2s;
}
@@ -121,43 +189,27 @@
display: flex;
align-items: center;
position: relative;
width: 22px;
height: 22px;
margin-left: 9px;
border-radius: 50%;
transition: all 300ms ease;
width: 20px;
height: 20px;
margin-left: 7px;
transition: all 150ms ease;
background-repeat: no-repeat;
background-position: center;
box-sizing: content-box;
--ui-icon-set__icon-color: var(--sidepanel-label-icon-color, var(--ui-color-base-2));
}
.side-panel-label-icon-close:before {
display: block;
content: '';
width: 12px;
height: 12px;
margin-left: 5px;
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath fill='%23FFF' fill-rule='evenodd' d='M11.381 1.746L7.138 5.988l4.248 4.249-1.151 1.152L5.986 7.14l-4.242 4.244-1.147-1.146L4.84 5.994.592 1.747 1.744.595l4.248 4.247L10.235.6z'/%3E%3C/svg%3E");
opacity: 0.85;
.side-panel-label:hover .side-panel-label-icon {
--ui-icon-set__icon-color: var(--sidepanel-label-icon-color-hover, var(--ui-color-base-2));
}
.side-panel-label-icon-minimize {
opacity: 0.5;
/*--ui-icon-set__icon-color: #878f98;*/
.side-panel-label.--close-label .side-panel-label-icon {
margin-left: 13px;
--ui-icon-set__icon-color: var(--sidepanel-close-label-icon-color, #ffffff);
}
.side-panel-label:hover .side-panel-label-icon-minimize {
opacity: 1;
}
.side-panel-label-icon-new-window {
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='13' height='14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.991.065v1.67H2.17a.5.5 0 00-.492.41l-.008.09v8.651a.5.5 0 00.41.492l.09.008h8.65a.5.5 0 00.493-.41l.008-.09-.001-2.846 1.67.001v4.015a1 1 0 01-1 1H1a1 1 0 01-1-1V1.066a1 1 0 011-1h3.991zm7 0a1 1 0 011 1l-.001 3.987h-1.67V3.035l-4.39 4.39-1.28-1.28 4.409-4.41H7.998V.065h3.992z' fill='%23878F98' fill-rule='evenodd'/%3E%3C/svg%3E");
opacity: 0.6;
}
.side-panel-label-icon-copy-link {
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.467 5.728c.182.183.34.38.473.59L9.674 7.584a1.91 1.91 0 00-3.015-.741l-.11.1L2.694 10.8a1.91 1.91 0 002.592 2.804l.11-.102 1.309-1.308c.703.25 1.42.257 2.149.019l-2.508 2.505A3.442 3.442 0 111.478 9.85l4.12-4.12a3.442 3.442 0 014.869 0zm4.426-4.425a3.442 3.442 0 010 4.868l-4.12 4.12a3.442 3.442 0 01-5.341-.59l1.265-1.265a1.91 1.91 0 003.015.741l.11-.101 3.856-3.856a1.91 1.91 0 00-2.592-2.803l-.11.102-1.31 1.308a3.232 3.232 0 00-2.148-.019l2.507-2.505a3.442 3.442 0 014.868 0z' fill='%23878F98' fill-rule='evenodd'/%3E%3C/svg%3E");
opacity: 0.6;
.side-panel-label.--close-label:hover .side-panel-label-icon {
--ui-icon-set__icon-color: var(--sidepanel-close-label-icon-color-hover, #ffffff);
}
.side-panel-label-icon--hide .side-panel-label-icon-box {
@@ -169,32 +221,14 @@
opacity: 0.4;
}
.side-panel-label:hover .side-panel-label-icon:before {
opacity: 1;
}
.side-panel-label:hover .side-panel-label-icon-close:after {
content: '';
display: block;
width: 24px;
height: 24px;
position: absolute;
top: -1px;
left: -1px;
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath fill='%23FFF' fill-rule='evenodd' d='M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zm0 1.771C6.35 1.771 1.771 6.351 1.771 12c0 5.65 4.58 10.229 10.229 10.229 5.65 0 10.229-4.58 10.229-10.229 0-5.65-4.58-10.229-10.229-10.229z'/%3E%3C/svg%3E");
opacity: 0.4;
}
.side-panel-label-text {
display: inline-block;
flex-grow: 1;
flex-shrink: 1;
flex-basis: 0;
height: 100%;
margin-left: 2px;
margin-right: 8px;
line-height: 38px;
vertical-align: top;
font-family: var(--ui-font-family-secondary, var(--ui-font-family-open-sans));
font-weight: var(--ui-font-weight-bold, 700);
font-size: 11px;
@@ -380,41 +414,6 @@
}
}
.side-panel-print {
display: none;
position: absolute;
left: -64px;
bottom: 0;
width: 64px;
height: 64px;
cursor: pointer;
}
.side-panel-print-visible {
display: block;
}
.side-panel-print:after {
display: block;
content: "";
position: absolute;
bottom: 22px;
right: 24px;
width: 16px;
height: 17px;
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTIuODk1IDMuMjI1aDEwLjExN2MuMTcgMCAuMzA4LS4xNC4zMDgtLjMxN1YuMzg1YS4zMTIuMzEyIDAgMDAtLjMwOC0uMzE3SDIuODk1YS4zMTQuMzE0IDAgMDAtLjMwOC4zMTd2Mi41MjZjMCAuMTc0LjEzOS4zMTQuMzA4LjMxNHptMTIuMTc3IDEuNTc5SDEuMTVhLjc3MS43NzEgMCAwMC0uNzczLjc2NnY1LjM2N2MwIC40MjIuMzQ3Ljc2Ny43NzMuNzY3aC43NzR2My4wNjZjMCAuNDIzLjM0Ny43NjcuNzczLjc2N2gxMC44MjhhLjc3MS43NzEgMCAwMC43NzQtLjc2N3YtMy4wNjZoLjc3M2EuNzcxLjc3MSAwIDAwLjc3NC0uNzY3VjUuNTdhLjc3MS43NzEgMCAwMC0uNzc0LS43NjZ6bS0yLjMyIDkuMkgzLjQ3di0zLjA2N2g5LjI4djMuMDY3em0uNzczLTYuMTM0YS43NzEuNzcxIDAgMDEtLjc3My0uNzY2YzAtLjQyMy4zNDctLjc2Ny43NzMtLjc2Ny40MjcgMCAuNzc0LjM0NC43NzQuNzY3YS43NzEuNzcxIDAgMDEtLjc3NC43NjZ6IiBmaWxsPSIjRkZGIiBvcGFjaXR5PSIuNiIvPjwvc3ZnPg==);
opacity: 0.2;
transition: opacity .3s;
}
.side-panel-print-visible:after {
opacity: 0.6;
}
.side-panel-print:hover:after {
opacity: 1;
}
.side-panel-toolbar {
display: none;
position: fixed;
@@ -66,16 +66,22 @@ this.BX = this.BX || {};
babelHelpers.defineProperty(this, "slider", null);
babelHelpers.defineProperty(this, "color", null);
babelHelpers.defineProperty(this, "bgColor", null);
babelHelpers.defineProperty(this, "className", '');
babelHelpers.defineProperty(this, "iconClass", '');
babelHelpers.defineProperty(this, "iconTitle", '');
babelHelpers.defineProperty(this, "onclick", null);
babelHelpers.defineProperty(this, "text", null);
babelHelpers.defineProperty(this, "hidden", false);
babelHelpers.defineProperty(this, "visible", true);
babelHelpers.defineProperty(this, "cache", new main_core.Cache.MemoryCache());
this.slider = slider;
const options = main_core.Type.isPlainObject(labelOptions) ? labelOptions : {};
this.setBgColor(options.bgColor);
this.hidden = main_core.Type.isBoolean(options.hidden) ? options.hidden : this.hidden;
this.visible = main_core.Type.isBoolean(options.visible) ? options.visible : this.visible;
this.setColor(options.color);
this.setBgColor(options.bgColor);
this.setText(options.text);
this.setClassName(options.className);
this.setIconClass(options.iconClass);
this.setIconTitle(options.iconTitle);
this.setOnclick(options.onclick);
@@ -84,9 +90,19 @@ this.BX = this.BX || {};
key: "getContainer",
value: function getContainer() {
return this.cache.remember('container', () => {
const classes = ['side-panel-label'];
if (this.getClassName()) {
classes.push(this.getClassName());
}
if (this.isHidden()) {
classes.push('--hidden');
}
if (this.isVisible()) {
classes.push('--visible');
}
return main_core.Dom.create('div', {
props: {
className: 'side-panel-label'
className: classes.join(' ')
},
children: [this.getIconBox(), this.getTextContainer()],
events: {
@@ -180,9 +196,10 @@ this.BX = this.BX || {};
}, {
key: "setColor",
value: function setColor(color) {
if (main_core.Type.isStringFilled(color)) {
if (main_core.Type.isStringFilled(color) || color === null) {
this.color = color;
main_core.Dom.style(this.getTextContainer(), 'color', color);
main_core.Dom.style(this.getTextContainer(), 'color', this.color);
main_core.Dom.style(this.getIconContainer(), '--ui-icon-set__icon-color', this.color);
}
}
}, {
@@ -207,10 +224,14 @@ this.BX = this.BX || {};
bgColor = `#${hex}${alfaHex}`;
}
this.bgColor = bgColor;
main_core.Dom.style(this.getContainer(), 'background-color', bgColor);
main_core.Dom.style(this.getContainer(), '--ui-color', bgColor);
if (this.getColor() === null) {
main_core.Dom.style(this.getIconContainer(), '--ui-icon-set__icon-color', '#fff');
}
} else if (bgColor === null) {
this.bgColor = null;
main_core.Dom.style(this.getContainer(), 'background-color', null);
main_core.Dom.style(this.getContainer(), '--ui-color', null);
main_core.Dom.style(this.getIconContainer(), '--ui-icon-set__icon-color', null);
}
}
}, {
@@ -234,6 +255,23 @@ this.BX = this.BX || {};
value: function getText() {
return this.text;
}
}, {
key: "setClassName",
value: function setClassName(className) {
if (main_core.Type.isStringFilled(className)) {
main_core.Dom.removeClass(this.getContainer(), this.className);
this.className = className;
main_core.Dom.addClass(this.getContainer(), this.className);
} else if (className === null) {
main_core.Dom.removeClass(this.getContainer(), this.className);
this.className = className;
}
}
}, {
key: "getClassName",
value: function getClassName() {
return this.className;
}
}, {
key: "setIconClass",
value: function setIconClass(iconClass) {
@@ -264,6 +302,33 @@ this.BX = this.BX || {};
value: function getIconTitle() {
return this.iconTitle;
}
}, {
key: "isHidden",
value: function isHidden() {
return this.hidden;
}
}, {
key: "hide",
value: function hide() {
this.hidden = true;
main_core.Dom.addClass(this.getContainer(), '--hidden');
}
}, {
key: "show",
value: function show() {
this.hidden = false;
main_core.Dom.removeClass(this.getContainer(), '--hidden');
}
}, {
key: "isVisible",
value: function isVisible() {
return this.visible;
}
}, {
key: "setVisible",
value: function setVisible(isVisible = true) {
main_core.Dom.toggleClass(this.getContainer(), '--visible', isVisible);
}
}, {
key: "setOnclick",
value: function setOnclick(fn) {
@@ -423,6 +488,7 @@ this.BX = this.BX || {};
var _designSystemContext = /*#__PURE__*/new WeakMap();
var _zIndexComponent = /*#__PURE__*/new WeakMap();
var _autoOffset = /*#__PURE__*/new WeakMap();
var _subscribeEvents = /*#__PURE__*/new WeakSet();
var _getAnimationState = /*#__PURE__*/new WeakSet();
var _calculateOuterBoundary = /*#__PURE__*/new WeakSet();
let Slider = /*#__PURE__*/function () {
@@ -430,6 +496,7 @@ this.BX = this.BX || {};
babelHelpers.classCallCheck(this, Slider);
_classPrivateMethodInitSpec$1(this, _calculateOuterBoundary);
_classPrivateMethodInitSpec$1(this, _getAnimationState);
_classPrivateMethodInitSpec$1(this, _subscribeEvents);
_classPrivateFieldInitSpec$1(this, _refs, {
writable: true,
value: new main_core_cache.MemoryCache()
@@ -483,7 +550,7 @@ this.BX = this.BX || {};
this.cacheable = options.cacheable !== false;
this.autoFocus = options.autoFocus !== false;
this.printable = options.printable === true;
this.allowChangeHistory = options.allowChangeHistory !== false;
this.allowChangeHistory = main_core.Type.isBoolean(options.allowChangeHistory) ? options.allowChangeHistory : null;
this.allowChangeTitle = main_core.Type.isBoolean(options.allowChangeTitle) ? options.allowChangeTitle : null;
this.allowCrossOrigin = options.allowCrossOrigin === true;
this.data = new Dictionary(main_core.Type.isPlainObject(options.data) ? options.data : {});
@@ -535,15 +602,13 @@ this.BX = this.BX || {};
this.animationName = 'sliding';
this.animationOptions = {};
this.minimizeOptions = null;
const minimizeOptions = options.minimizeOptions;
if (main_core.Type.isPlainObject(minimizeOptions) && main_core.Type.isStringFilled(minimizeOptions.entityType) && (main_core.Type.isStringFilled(minimizeOptions.entityId) || main_core.Type.isNumber(minimizeOptions.entityId)) && main_core.Type.isStringFilled(minimizeOptions.url)) {
this.minimizeOptions = minimizeOptions;
}
this.setMinimizeOptions(options.minimizeOptions);
this.setToolbarOnOpen(options.hideToolbarOnOpen);
this.setDesignSystemContext(options.designSystemContext);
this.setAutoOffset(options.autoOffset);
this.label = new Label(this, {
iconClass: 'side-panel-label-icon-close',
className: '--close-label --ui-hoverable',
iconClass: 'side-panel-label-icon-close ui-icon-set --cross-l',
iconTitle: main_core.Loc.getMessage('MAIN_SIDEPANEL_CLOSE'),
onclick(label, slider) {
slider.close();
@@ -553,26 +618,25 @@ this.BX = this.BX || {};
this.label.setText(labelOptions.text);
this.label.setColor(labelOptions.color);
this.label.setBgColor(labelOptions.bgColor, labelOptions.opacity);
this.minimizeLabel = null;
this.minimizeLabel = new Label(this, {
className: '--ui-hoverable',
iconClass: 'side-panel-label-icon-minimize ui-icon-set --o-minimize',
iconTitle: main_core.Loc.getMessage('MAIN_SIDEPANEL_MINIMIZE'),
onclick: (label, slider) => {
if (this.isLoaded()) {
this.minimize();
}
},
visible: this.areMinimizeOptionsValid(this.minimizeOptions)
});
this.newWindowLabel = null;
this.copyLinkLabel = null;
if (!this.isSelfContained() && this.minimizeOptions !== null) {
this.minimizeLabel = new Label(this, {
iconClass: 'side-panel-label-icon-minimize ui-icon-set --arrow-line',
iconTitle: main_core.Loc.getMessage('MAIN_SIDEPANEL_MINIMIZE'),
bgColor: ['#d9dcdf', 100],
onclick: (label, slider) => {
if (this.isLoaded()) {
this.minimize();
}
}
});
}
if (options.newWindowLabel === true && (!this.isSelfContained() || main_core.Type.isStringFilled(options.newWindowUrl))) {
this.printLabel = null;
if (options.newWindowLabel === true && (this.canChangeHistory() || main_core.Type.isStringFilled(options.newWindowUrl))) {
this.newWindowLabel = new Label(this, {
iconClass: 'side-panel-label-icon-new-window',
className: '--ui-hoverable',
iconClass: 'side-panel-label-icon-new-window ui-icon-set --go-to-l',
iconTitle: main_core.Loc.getMessage('MAIN_SIDEPANEL_NEW_WINDOW'),
bgColor: ['#d9dcdf', 100],
onclick(label, slider) {
const newWindowUrl = main_core.Type.isStringFilled(options.newWindowUrl) ? options.newWindowUrl : slider.getUrl();
Object.assign(document.createElement('a'), {
@@ -582,11 +646,11 @@ this.BX = this.BX || {};
}
});
}
if (options.copyLinkLabel === true && (!this.isSelfContained() || main_core.Type.isStringFilled(options.newWindowUrl))) {
if (options.copyLinkLabel === true && (this.canChangeHistory() || main_core.Type.isStringFilled(options.newWindowUrl))) {
this.copyLinkLabel = new Label(this, {
iconClass: 'side-panel-label-icon-copy-link',
iconTitle: main_core.Loc.getMessage('MAIN_SIDEPANEL_COPY_LINK'),
bgColor: ['#d9dcdf', 100]
className: '--ui-hoverable',
iconClass: 'side-panel-label-icon-copy-link ui-icon-set --o-link',
iconTitle: main_core.Loc.getMessage('MAIN_SIDEPANEL_COPY_LINK')
});
BX.clipboard.bindCopyClick(this.copyLinkLabel.getIconBox(), {
text: () => {
@@ -596,6 +660,13 @@ this.BX = this.BX || {};
}
});
}
this.printLabel = new Label(this, {
hidden: !this.isPrintable(),
className: '--side-panel-label-print --ui-hoverable',
iconClass: 'side-panel-label-icon-print ui-icon-set --o-printer',
iconTitle: main_core.Loc.getMessage('MAIN_SIDEPANEL_PRINT'),
onclick: this.handlePrintBtnClick.bind(this)
});
// Compatibility
if (this.url.includes('crm.activity.planner/slider.php') && options.events && main_core.Type.isFunction(options.events.onOpen) && options.events.compatibleEvents !== false) {
@@ -605,15 +676,7 @@ this.BX = this.BX || {};
onOpen(event.getSlider());
};
}
if (main_core.Type.isPlainObject(options.events)) {
for (const [eventName, fn] of Object.entries(options.events)) {
if (main_core.Type.isFunction(fn)) {
main_core_events.EventEmitter.subscribe(this, Slider.getEventFullName(eventName), fn, {
compatMode: true
});
}
}
}
[options.events].flat().forEach(events => _classPrivateMethodGet$1(this, _subscribeEvents, _subscribeEvents2).call(this, events));
}
babelHelpers.createClass(Slider, [{
key: "open",
@@ -725,6 +788,19 @@ this.BX = this.BX || {};
this.animationName = type === 'scale' ? type : 'sliding';
this.animationOptions = main_core.Type.isPlainObject(options) ? options : {};
}
}, {
key: "setMinimizeOptions",
value: function setMinimizeOptions(minimizeOptions) {
var _this$minimizeLabel;
const showMinimizeLabel = this.areMinimizeOptionsValid(minimizeOptions);
this.minimizeOptions = minimizeOptions;
(_this$minimizeLabel = this.minimizeLabel) === null || _this$minimizeLabel === void 0 ? void 0 : _this$minimizeLabel.setVisible(showMinimizeLabel);
}
}, {
key: "areMinimizeOptionsValid",
value: function areMinimizeOptionsValid(minimizeOptions) {
return main_core.Type.isPlainObject(minimizeOptions) && main_core.Type.isStringFilled(minimizeOptions.entityType) && (main_core.Type.isStringFilled(minimizeOptions.entityId) || main_core.Type.isNumber(minimizeOptions.entityId)) && main_core.Type.isStringFilled(minimizeOptions.url);
}
}, {
key: "getMinimizeOptions",
value: function getMinimizeOptions() {
@@ -934,7 +1010,13 @@ this.BX = this.BX || {};
}, {
key: "canChangeHistory",
value: function canChangeHistory() {
return this.allowChangeHistory && !this.allowCrossOrigin && !this.isSelfContained() && !/^\/bitrix\/(components|tools)\//i.test(this.getUrl());
if (this.allowCrossOrigin || /^\/bitrix\/(components|tools)\//i.test(this.getUrl())) {
return false;
}
if (this.allowChangeHistory === null) {
return !this.isSelfContained();
}
return this.allowChangeHistory;
}
}, {
key: "canChangeTitle",
@@ -1001,12 +1083,12 @@ this.BX = this.BX || {};
}, {
key: "showCloseBtn",
value: function showCloseBtn() {
this.getLabel().showIcon();
this.getLabel().show();
}
}, {
key: "hideCloseBtn",
value: function hideCloseBtn() {
this.getLabel().hideIcon();
this.getLabel().hide();
}
}, {
key: "showOrLightenCloseBtn",
@@ -1029,22 +1111,26 @@ this.BX = this.BX || {};
}, {
key: "showPrintBtn",
value: function showPrintBtn() {
main_core.Dom.addClass(this.getPrintBtn(), 'side-panel-print-visible');
if (this.printLabel !== null) {
this.printLabel.show();
}
}
}, {
key: "hidePrintBtn",
value: function hidePrintBtn() {
main_core.Dom.removeClass(this.getPrintBtn(), 'side-panel-print-visible');
if (this.printLabel !== null) {
this.printLabel.hide();
}
}
}, {
key: "showExtraLabels",
value: function showExtraLabels() {
main_core.Dom.style(this.getExtraLabelsContainer(), 'display', null);
main_core.Dom.removeClass(this.getExtraLabelsContainer(), '--hidden');
}
}, {
key: "hideExtraLabels",
value: function hideExtraLabels() {
main_core.Dom.style(this.getExtraLabelsContainer(), 'display', 'none');
main_core.Dom.addClass(this.getExtraLabelsContainer(), '--hidden');
}
}, {
key: "setContentClass",
@@ -1438,7 +1524,7 @@ this.BX = this.BX || {};
<div class="side-panel side-panel-container">
${0}
</div>
`), this.hideControls ? content : [content, this.getLabelsContainer(), this.getPrintBtn()]);
`), this.hideControls ? content : [content, this.getLabelsContainer()]);
main_core.Dom.addClass(this.layout.container, this.getDesignSystemContext());
main_core.Dom.addClass(this.layout.container, this.containerClassName);
return this.layout.container;
@@ -1477,7 +1563,7 @@ this.BX = this.BX || {};
props: {
className: 'side-panel-extra-labels'
},
children: [this.minimizeLabel ? this.minimizeLabel.getContainer() : null, this.newWindowLabel ? this.newWindowLabel.getContainer() : null, this.copyLinkLabel ? this.copyLinkLabel.getContainer() : null]
children: [this.minimizeLabel.getContainer(), this.newWindowLabel ? this.newWindowLabel.getContainer() : null, this.copyLinkLabel ? this.copyLinkLabel.getContainer() : null, this.printLabel ? this.printLabel.getContainer() : null]
});
});
}
@@ -1507,19 +1593,9 @@ this.BX = this.BX || {};
return this.minimizeLabel;
}
}, {
key: "getPrintBtn",
value: function getPrintBtn() {
return babelHelpers.classPrivateFieldGet(this, _refs).remember('print-btn', () => {
return main_core.Dom.create('span', {
props: {
className: 'side-panel-print',
title: main_core.Loc.getMessage('MAIN_SIDEPANEL_PRINT')
},
events: {
click: this.handlePrintBtnClick.bind(this)
}
});
});
key: "getPrintLabel",
value: function getPrintLabel() {
return this.printLabel;
}
/**
* @private
@@ -1775,9 +1851,6 @@ this.BX = this.BX || {};
}, {
key: "animateOpening",
value: function animateOpening() {
if (this.isPrintable()) {
this.showPrintBtn();
}
if (this.animation) {
this.animation.stop();
}
@@ -2176,6 +2249,17 @@ this.BX = this.BX || {};
this.firePageEvent('onEscapePress');
this.fireFrameEvent('onEscapePress');
}
}, {
key: "isOnTopOfPopup",
value: function isOnTopOfPopup(popup) {
const sameStack = this.getZIndexComponent().getStack() === popup.getZIndexComponent().getStack();
const popupOnTop = sameStack && popup.getZindex() > this.getZindex();
let popupInside = this.getContainer().contains(popup.getPopupContainer());
if (this.getFrameWindow()) {
popupInside = this.getFrameWindow().document.contains(popup.getPopupContainer());
}
return !(popup.isShown() && (popupOnTop || popupInside));
}
/**
* @private
* @param {BaseEvent} event
@@ -2292,6 +2376,17 @@ this.BX = this.BX || {};
}]);
return Slider;
}();
function _subscribeEvents2(events) {
if (main_core.Type.isPlainObject(events)) {
for (const [eventName, fn] of Object.entries(events)) {
if (main_core.Type.isFunction(fn)) {
main_core_events.EventEmitter.subscribe(this, Slider.getEventFullName(eventName), fn, {
compatMode: true
});
}
}
}
}
function _getAnimationState2(mode) {
const states = {
right: {
@@ -2356,18 +2451,6 @@ this.BX = this.BX || {};
return main_core.Runtime.merge(main_core.Type.isPlainObject(outerBoundary) ? outerBoundary : {}, this.getOuterBoundary());
}
let instance = null;
function getInstance() {
const topWindow = main_pageobject.PageObject.getRootWindow();
if (topWindow !== window) {
return topWindow.BX.SidePanel.Instance;
}
if (instance === null) {
instance = new SliderManager();
}
return instance;
}
let _$1 = t => t,
_t$1,
_t2$1,
@@ -2384,7 +2467,7 @@ this.BX = this.BX || {};
_this.title = '';
_this.url = '';
_this.entityType = '';
_this.entityId = 0;
_this.entityId = '0';
_this.entityName = '';
_this.refs = new main_core.Cache.MemoryCache();
_this.rendered = false;
@@ -2450,7 +2533,7 @@ this.BX = this.BX || {};
key: "setEntityId",
value: function setEntityId(entityId) {
if (main_core.Type.isNumber(entityId) || main_core.Type.isStringFilled(entityId)) {
this.entityId = entityId;
this.entityId = String(entityId);
}
}
}, {
@@ -2470,8 +2553,8 @@ this.BX = this.BX || {};
value: function getContainer() {
return this.refs.remember('container', () => {
return main_core.Tag.render(_t$1 || (_t$1 = _$1`
<div class="side-panel-toolbar-item"
onclick="${0}"
<div
class="side-panel-toolbar-item"
onmouseenter="${0}"
onmouseleave="${0}"
>
@@ -2480,7 +2563,7 @@ this.BX = this.BX || {};
<div class="ui-icon-set --cross-20" style="--ui-icon-set__icon-size: 100%;"></div>
</div>
</div>
`), this.handleClick.bind(this), this.handleMouseEnter.bind(this), this.handleMouseLeave.bind(this), this.getTitleContainer(), this.handleRemoveBtnClick.bind(this));
`), this.handleMouseEnter.bind(this), this.handleMouseLeave.bind(this), this.getTitleContainer(), this.handleRemoveBtnClick.bind(this));
});
}
}, {
@@ -2496,7 +2579,7 @@ this.BX = this.BX || {};
<a
class="side-panel-toolbar-item-title"
href="${0}"
data-slider-ignore-autobinding="true"
data-slider-maximize="true"
>${0}</a>
`), encodeURI(this.getUrl()), main_core.Text.encode(this.getTitle()));
});
@@ -2590,15 +2673,6 @@ this.BX = this.BX || {};
hint.close();
}
}
}, {
key: "handleClick",
value: function handleClick(event) {
if (event.ctrlKey || event.metaKey) {
return;
}
event.preventDefault();
getInstance().maximize(this.getUrl());
}
}, {
key: "handleMouseEnter",
value: function handleMouseEnter() {
@@ -2629,6 +2703,18 @@ this.BX = this.BX || {};
return ToolbarItem;
}(main_core_events.EventEmitter);
let instance = null;
function getInstance() {
const topWindow = main_pageobject.PageObject.getRootWindow();
if (topWindow !== window) {
return topWindow.BX.SidePanel.Instance;
}
if (instance === null) {
instance = new SliderManager();
}
return instance;
}
let _$2 = t => t,
_t$2,
_t2$2,
@@ -3090,7 +3176,9 @@ this.BX = this.BX || {};
}, {
key: "getItem",
value: function getItem(entityType, entityId) {
return this.items.find(item => item.getEntityType() === entityType && item.getEntityId() === entityId) || null;
return this.items.find(item => {
return item.getEntityType() === entityType && item.getEntityId() === String(entityId);
}) || null;
}
}, {
key: "getItemByUrl",
@@ -3845,6 +3933,7 @@ this.BX = this.BX || {};
console.trace();
}
parameters.rules.forEach(rule => {
var _rule$options;
if (main_core.Type.isArray(rule.condition)) {
for (let m = 0; m < rule.condition.length; m++) {
if (main_core.Type.isString(rule.condition[m])) {
@@ -3852,11 +3941,7 @@ this.BX = this.BX || {};
}
}
}
rule.options = main_core.Type.isPlainObject(rule.options) ? rule.options : {};
if (main_core.Type.isStringFilled(rule.loader) && !main_core.Type.isStringFilled(rule.options.loader)) {
rule.options.loader = rule.loader;
delete rule.loader;
}
(_rule$options = rule.options) !== null && _rule$options !== void 0 ? _rule$options : rule.options = {};
this.anchorRules.push(rule);
});
}
@@ -3906,16 +3991,16 @@ this.BX = this.BX || {};
if (!sameWidth) {
this.getTopSlider().showShadow();
}
this.getTopSlider().hideOrDarkenCloseBtn();
this.getTopSlider().hidePrintBtn();
this.getTopSlider().hideCloseBtn();
this.getTopSlider().hideExtraLabels();
} else {
slider.setOverlayAnimation(true);
}
_classPrivateMethodGet$2(this, _addOpenSlider, _addOpenSlider2).call(this, slider);
this.getOpenSliders().forEach((currentSlider, index, openSliders) => {
currentSlider.getLabel().moveAt(openSliders.length - index - 1); // move down
});
// this.getOpenSliders().forEach((currentSlider: Slider, index: number, openSliders: Slider[]) => {
// currentSlider.getLabel().moveAt(openSliders.length - index - 1); // move down
// });
this.losePageFocus();
if (!this.opened) {
@@ -3963,9 +4048,10 @@ this.BX = this.BX || {};
const previousSlider = this.getPreviousSlider();
const topSlider = this.getTopSlider();
this.exitFullScreen();
this.getOpenSliders().forEach((slider, index, openSliders) => {
slider.getLabel().moveAt(openSliders.length - index - 2); // move up
});
// this.getOpenSliders().forEach((slider, index, openSliders) => {
// slider.getLabel().moveAt(openSliders.length - index - 2); // move up
// });
let visibleSlider = null;
const openSliders = this.getOpenSliders();
@@ -3982,7 +4068,8 @@ this.BX = this.BX || {};
if (previousSlider) {
previousSlider.unhideOverlay();
previousSlider.hideShadow();
previousSlider.showOrLightenCloseBtn();
previousSlider.showCloseBtn();
previousSlider.showExtraLabels();
if (topSlider) {
topSlider.hideOverlay();
topSlider.hideShadow();
@@ -4033,7 +4120,7 @@ this.BX = this.BX || {};
entityType,
entityId,
url
} = minimizeOptions || slider.getMinimizeOptions() || {};
} = slider.getMinimizeOptions() || minimizeOptions || {};
const item = this.getToolbar().minimizeItem({
title,
url: main_core.Type.isStringFilled(url) ? url : slider.getUrl(),
@@ -4086,8 +4173,9 @@ this.BX = this.BX || {};
}, {
key: "handleEscapePress",
value: function handleEscapePress(event) {
if (this.isOnTop() && this.getTopSlider() && this.getTopSlider().canCloseByEsc()) {
this.getTopSlider().close();
const topSlider = this.getTopSlider();
if (topSlider !== null && topSlider !== void 0 && topSlider.canCloseByEsc() && this.isOnTop(topSlider)) {
topSlider.close();
}
}
/**
@@ -4099,18 +4187,16 @@ this.BX = this.BX || {};
_classPrivateMethodGet$2(this, _removeOpenSlider, _removeOpenSlider2).call(this, slider);
slider.unhideOverlay();
slider.hideShadow();
this.getOpenSliders().forEach((slider, index, openSliders) => {
slider.getLabel().moveAt(openSliders.length - index - 1); //update position
});
// this.getOpenSliders().forEach((slider, index, openSliders) => {
// slider.getLabel().moveAt(openSliders.length - index - 1); //update position
// });
if (this.getTopSlider()) {
this.getTopSlider().showOrLightenCloseBtn();
this.getTopSlider().unhideOverlay();
this.getTopSlider().hideShadow();
this.getTopSlider().showCloseBtn();
this.getTopSlider().showExtraLabels();
if (this.getTopSlider().isPrintable()) {
this.getTopSlider().showPrintBtn();
}
this.getTopSlider().focus();
} else {
window.focus();
@@ -4271,9 +4357,7 @@ this.BX = this.BX || {};
}
event.preventDefault(); // otherwise an iframe loading can be cancelled by a browser
if (this.isOnTop() && this.getTopSlider() && this.getTopSlider().canCloseByEsc()) {
this.getTopSlider().close();
}
this.handleEscapePress();
}
/**
* @private
@@ -4306,7 +4390,15 @@ this.BX = this.BX || {};
*/
}, {
key: "isOnTop",
value: function isOnTop() {
value: function isOnTop(slider) {
if (slider) {
const popups = main_popup.PopupManager.getPopups();
const isOnTopOfAllPopups = popups.every(popup => slider.isOnTopOfPopup(popup));
if (!isOnTopOfAllPopups) {
return false;
}
}
// Photo Slider or something else can cover Side Panel.
const centerX = document.documentElement.clientWidth / 2;
const centerY = document.documentElement.clientHeight / 2;
@@ -4367,7 +4459,11 @@ this.BX = this.BX || {};
rule.handler(event, link);
} else {
event.preventDefault();
this.open(link.url, rule.options);
if (main_core.Dom.attr(event.target, 'data-slider-maximize') === null) {
this.open(link.url, rule.options);
} else {
this.maximize(link.url, rule.options);
}
}
}
/**
@@ -4386,7 +4482,7 @@ this.BX = this.BX || {};
if (!this.isValidLink(rule, link)) {
BX.reload(url);
} else if (main_core.Type.isFunction(rule.handler)) {
rule.handler(new main_core.Event('slider', {
rule.handler(new MouseEvent('slider', {
bubbles: false,
cancelable: true
}), link);
@@ -4421,17 +4517,25 @@ this.BX = this.BX || {};
const matches = href.match(rule.condition[m]);
if (matches && !this.hasStopParams(href, rule.stopParameters)) {
link.matches = matches;
let options = main_core.Type.isFunction(rule.options) ? rule.options(link) : rule.options;
const minimizeOptions = main_core.Type.isFunction(rule.minimizeOptions) ? rule.minimizeOptions(link) : null;
if (main_core.Type.isPlainObject(minimizeOptions)) {
if (main_core.Type.isPlainObject(rule.options)) {
rule.options.minimizeOptions = minimizeOptions;
if (main_core.Type.isPlainObject(options)) {
options.minimizeOptions = minimizeOptions;
} else {
rule.options = {
options = {
minimizeOptions
};
}
}
return rule;
if (main_core.Type.isStringFilled(rule.loader) && !main_core.Type.isStringFilled(options.loader)) {
options.loader = rule.loader;
delete rule.loader;
}
return {
...rule,
options
};
}
}
}
@@ -4595,6 +4699,7 @@ this.BX = this.BX || {};
return SliderManager;
}();
function _createSlider2(sliderUrl, sliderOptions) {
var _ref, _sliderOptions$useGlo;
if (!main_core.Type.isStringFilled(sliderUrl)) {
return null;
}
@@ -4611,13 +4716,13 @@ this.BX = this.BX || {};
}
const rule = this.getUrlRule(url);
const ruleOptions = rule !== null && main_core.Type.isPlainObject(rule.options) ? rule.options : {};
const options = main_core.Type.isPlainObject(sliderOptions) ? sliderOptions : ruleOptions;
if (main_core.Type.isPlainObject(ruleOptions.minimizeOptions) && main_core.Type.isPlainObject(sliderOptions) && !main_core.Type.isPlainObject(sliderOptions.minimizeOptions)) {
options.minimizeOptions = ruleOptions.minimizeOptions;
}
if (this.getToolbar() === null && options.minimizeOptions) {
options.minimizeOptions = null;
}
const useGlobalOptions = (_ref = (_sliderOptions$useGlo = sliderOptions === null || sliderOptions === void 0 ? void 0 : sliderOptions.useGlobalOptions) !== null && _sliderOptions$useGlo !== void 0 ? _sliderOptions$useGlo : ruleOptions.useGlobalOptions) !== null && _ref !== void 0 ? _ref : true;
const useRuleOptions = sliderOptions !== ruleOptions && useGlobalOptions;
const options = {
...(useRuleOptions ? ruleOptions : {}),
...sliderOptions,
events: [useRuleOptions && ruleOptions.events, sliderOptions === null || sliderOptions === void 0 ? void 0 : sliderOptions.events]
};
const defaultOptions = SliderManager.getSliderDefaultOptions();
const priorityOptions = SliderManager.getSliderPriorityOptions();
const SliderClass = SliderManager.getSliderClass();
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -81,39 +81,107 @@
z-index: 1;
transform: translateX(-100%);
transition: all 300ms ease;
pointer-events: none;
}
.side-panel-extra-labels {
display: flex;
flex-direction: column;
align-items: flex-end;
margin-top: 10px;
transition-property: opacity, display, transform;
transition-duration: 150ms;
transition-timing-function: ease-in-out;
transition-behavior: allow-discrete;
}
.side-panel-extra-labels.--hidden {
opacity: 0;
pointer-events: none;
transform: translateX(100%);
}
.side-panel-label {
display: inline-flex;
min-width: 37px;
height: 38px;
padding-right: 5px;
align-items: center;
min-width: 36px;
height: 28px;
margin-bottom: 10px;
background: rgba(47, 198, 246, 0.95);
border-top-left-radius: 19px;
border-bottom-left-radius: 19px;
position: relative;
background: var(--sidepanel-label-background, var(--ui-color));
white-space: nowrap;
overflow: hidden;
/*overflow: hidden;*/
transition: top 0.3s;
box-shadow: inset -6px 0 8px -10px rgba(0, 0, 0, 0.95);
box-shadow: var(--sidepanel-label-box-shadow, inset -6px 0 8px -10px rgba(0, 0, 0, 0.95));
z-index: 1;
cursor: pointer;
pointer-events: auto;
opacity: 1;
transition-property: opacity, display, transform;
transition-duration: 150ms;
transition-timing-function: ease-in-out;
transition-behavior: allow-discrete;
box-sizing: border-box;
border-top-left-radius: 18px;
border-bottom-left-radius: 18px;
border: var(--sidepanel-label-border);
border-right: none;
}
.side-panel-label.--ui-hoverable {
--ui-color: var(--ui-color-base-6);
}
.side-panel-label.--close-label.--ui-hoverable {
--ui-color: #0075FF;
}
.side-panel-label:before {
position: absolute;
content: '';
inset: -5px 0 -5px -5px;
}
.side-panel-label:hover {
background: var(--sidepanel-label-background-hover, var(--ui-color-hover));
border: var(--sidepanel-label-border-hover);
border-right: none;
}
.side-panel-label.--close-label {
min-width: 43px;
height: 36px;
background: var(--sidepanel-close-label-background, var(--sidepanel-label-background, var(--ui-color)));
border: var(--sidepanel-close-label-border, var(--sidepanel-label-border));
border-right: none;
}
.side-panel-label:hover.--close-label {
background: var(--sidepanel-close-label-background-hover, var(--sidepanel-label-background-hover, var(--ui-color-hover)));
border: var(--sidepanel-close-label-border-hover, var(--sidepanel-label-border-hover));
border-right: none;
}
.side-panel-label.--hidden {
opacity: 0;
pointer-events: none;
transform: translateX(100%);
}
.side-panel-label:not(.--visible) {
display: none;
}
.side-panel-label-icon-box {
display: inline-flex;
align-items: center;
width: 34px;
height: 38px;
vertical-align: top;
border-radius: 19px;
min-width: 20px;
height: 20px;
transition: all .2s;
}
@@ -121,43 +189,27 @@
display: flex;
align-items: center;
position: relative;
width: 22px;
height: 22px;
margin-left: 9px;
border-radius: 50%;
transition: all 300ms ease;
width: 20px;
height: 20px;
margin-left: 7px;
transition: all 150ms ease;
background-repeat: no-repeat;
background-position: center;
box-sizing: content-box;
--ui-icon-set__icon-color: var(--sidepanel-label-icon-color, var(--ui-color-base-2));
}
.side-panel-label-icon-close:before {
display: block;
content: '';
width: 12px;
height: 12px;
margin-left: 5px;
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3e%3cpath fill='%23FFF' fill-rule='evenodd' d='M11.381 1.746L7.138 5.988l4.248 4.249-1.151 1.152L5.986 7.14l-4.242 4.244-1.147-1.146L4.84 5.994.592 1.747 1.744.595l4.248 4.247L10.235.6z'/%3e%3c/svg%3e");
opacity: 0.85;
.side-panel-label:hover .side-panel-label-icon {
--ui-icon-set__icon-color: var(--sidepanel-label-icon-color-hover, var(--ui-color-base-2));
}
.side-panel-label-icon-minimize {
opacity: 0.5;
/*--ui-icon-set__icon-color: #878f98;*/
.side-panel-label.--close-label .side-panel-label-icon {
margin-left: 13px;
--ui-icon-set__icon-color: var(--sidepanel-close-label-icon-color, #ffffff);
}
.side-panel-label:hover .side-panel-label-icon-minimize {
opacity: 1;
}
.side-panel-label-icon-new-window {
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='13' height='14' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4.991.065v1.67H2.17a.5.5 0 00-.492.41l-.008.09v8.651a.5.5 0 00.41.492l.09.008h8.65a.5.5 0 00.493-.41l.008-.09-.001-2.846 1.67.001v4.015a1 1 0 01-1 1H1a1 1 0 01-1-1V1.066a1 1 0 011-1h3.991zm7 0a1 1 0 011 1l-.001 3.987h-1.67V3.035l-4.39 4.39-1.28-1.28 4.409-4.41H7.998V.065h3.992z' fill='%23878F98' fill-rule='evenodd'/%3e%3c/svg%3e");
opacity: 0.6;
}
.side-panel-label-icon-copy-link {
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.467 5.728c.182.183.34.38.473.59L9.674 7.584a1.91 1.91 0 00-3.015-.741l-.11.1L2.694 10.8a1.91 1.91 0 002.592 2.804l.11-.102 1.309-1.308c.703.25 1.42.257 2.149.019l-2.508 2.505a3.442 3.442 0 11-4.868-4.868l4.12-4.12a3.442 3.442 0 014.869 0zm4.426-4.425a3.442 3.442 0 010 4.868l-4.12 4.12a3.442 3.442 0 01-5.341-.59l1.265-1.265a1.91 1.91 0 003.015.741l.11-.101 3.856-3.856a1.91 1.91 0 00-2.592-2.803l-.11.102-1.31 1.308a3.232 3.232 0 00-2.148-.019l2.507-2.505a3.442 3.442 0 014.868 0z' fill='%23878F98' fill-rule='evenodd'/%3e%3c/svg%3e");
opacity: 0.6;
.side-panel-label.--close-label:hover .side-panel-label-icon {
--ui-icon-set__icon-color: var(--sidepanel-close-label-icon-color-hover, #ffffff);
}
.side-panel-label-icon--hide .side-panel-label-icon-box {
@@ -169,32 +221,14 @@
opacity: 0.4;
}
.side-panel-label:hover .side-panel-label-icon:before {
opacity: 1;
}
.side-panel-label:hover .side-panel-label-icon-close:after {
content: '';
display: block;
width: 24px;
height: 24px;
position: absolute;
top: -1px;
left: -1px;
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3e%3cpath fill='%23FFF' fill-rule='evenodd' d='M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zm0 1.771C6.35 1.771 1.771 6.351 1.771 12c0 5.65 4.58 10.229 10.229 10.229 5.65 0 10.229-4.58 10.229-10.229 0-5.65-4.58-10.229-10.229-10.229z'/%3e%3c/svg%3e");
opacity: 0.4;
}
.side-panel-label-text {
display: inline-block;
flex-grow: 1;
flex-shrink: 1;
flex-basis: 0;
height: 100%;
margin-left: 2px;
margin-right: 8px;
line-height: 38px;
vertical-align: top;
font-family: var(--ui-font-family-secondary, var(--ui-font-family-open-sans));
font-weight: var(--ui-font-weight-bold, 700);
font-size: 11px;
@@ -406,41 +440,6 @@
}
}
.side-panel-print {
display: none;
position: absolute;
left: -64px;
bottom: 0;
width: 64px;
height: 64px;
cursor: pointer;
}
.side-panel-print-visible {
display: block;
}
.side-panel-print:after {
display: block;
content: "";
position: absolute;
bottom: 22px;
right: 24px;
width: 16px;
height: 17px;
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij48cGF0aCBkPSJNMi44OTUgMy4yMjVoMTAuMTE3Yy4xNyAwIC4zMDgtLjE0LjMwOC0uMzE3Vi4zODVhLjMxMi4zMTIgMCAwIDAtLjMwOC0uMzE3SDIuODk1YS4zMTQuMzE0IDAgMCAwLS4zMDguMzE3djIuNTI2YzAgLjE3NC4xMzkuMzE0LjMwOC4zMTR6bTEyLjE3NyAxLjU3OUgxLjE1YS43NzEuNzcxIDAgMCAwLS43NzMuNzY2djUuMzY3YzAgLjQyMi4zNDcuNzY3Ljc3My43NjdoLjc3NHYzLjA2NmMwIC40MjMuMzQ3Ljc2Ny43NzMuNzY3aDEwLjgyOGEuNzcxLjc3MSAwIDAgMCAuNzc0LS43Njd2LTMuMDY2aC43NzNhLjc3MS43NzEgMCAwIDAgLjc3NC0uNzY3VjUuNTdhLjc3MS43NzEgMCAwIDAtLjc3NC0uNzY2em0tMi4zMiA5LjJIMy40N3YtMy4wNjdoOS4yOHYzLjA2N3ptLjc3My02LjEzNGEuNzcxLjc3MSAwIDAgMS0uNzczLS43NjZjMC0uNDIzLjM0Ny0uNzY3Ljc3My0uNzY3LjQyNyAwIC43NzQuMzQ0Ljc3NC43NjdhLjc3MS43NzEgMCAwIDEtLjc3NC43NjZ6IiBmaWxsPSIjRkZGIiBvcGFjaXR5PSIuNiIvPjwvc3ZnPg==);
opacity: 0.2;
transition: opacity .3s;
}
.side-panel-print-visible:after {
opacity: 0.6;
}
.side-panel-print:hover:after {
opacity: 1;
}
.side-panel-toolbar {
display: none;
position: fixed;
@@ -12,19 +12,27 @@ export class Label
slider: Slider = null;
color = null;
bgColor = null;
className = '';
iconClass = '';
iconTitle = '';
onclick = null;
text = null;
hidden: boolean = false;
visible: boolean = true;
cache = new Cache.MemoryCache();
constructor(slider: Slider, labelOptions: LabelOptions)
{
this.slider = slider;
const options = Type.isPlainObject(labelOptions) ? labelOptions : {};
this.setBgColor(options.bgColor);
this.hidden = Type.isBoolean(options.hidden) ? options.hidden : this.hidden;
this.visible = Type.isBoolean(options.visible) ? options.visible : this.visible;
this.setColor(options.color);
this.setBgColor(options.bgColor);
this.setText(options.text);
this.setClassName(options.className);
this.setIconClass(options.iconClass);
this.setIconTitle(options.iconTitle);
this.setOnclick(options.onclick);
@@ -33,9 +41,25 @@ export class Label
getContainer(): HTMLElement
{
return this.cache.remember('container', () => {
const classes = ['side-panel-label'];
if (this.getClassName())
{
classes.push(this.getClassName());
}
if (this.isHidden())
{
classes.push('--hidden');
}
if (this.isVisible())
{
classes.push('--visible');
}
return Dom.create('div', {
props: {
className: 'side-panel-label',
className: classes.join(' '),
},
children: [
this.getIconBox(),
@@ -150,11 +174,12 @@ export class Label
setColor(color: string): void
{
if (Type.isStringFilled(color))
if (Type.isStringFilled(color) || color === null)
{
this.color = color;
Dom.style(this.getTextContainer(), 'color', color);
Dom.style(this.getTextContainer(), 'color', this.color);
Dom.style(this.getIconContainer(), '--ui-icon-set__icon-color', this.color);
}
}
@@ -186,12 +211,18 @@ export class Label
}
this.bgColor = bgColor;
Dom.style(this.getContainer(), 'background-color', bgColor);
Dom.style(this.getContainer(), '--ui-color', bgColor);
if (this.getColor() === null)
{
Dom.style(this.getIconContainer(), '--ui-icon-set__icon-color', '#fff');
}
}
else if (bgColor === null)
{
this.bgColor = null;
Dom.style(this.getContainer(), 'background-color', null);
Dom.style(this.getContainer(), '--ui-color', null);
Dom.style(this.getIconContainer(), '--ui-icon-set__icon-color', null);
}
}
@@ -219,6 +250,26 @@ export class Label
return this.text;
}
setClassName(className: string | null): void
{
if (Type.isStringFilled(className))
{
Dom.removeClass(this.getContainer(), this.className);
this.className = className;
Dom.addClass(this.getContainer(), this.className);
}
else if (className === null)
{
Dom.removeClass(this.getContainer(), this.className);
this.className = className;
}
}
getClassName(): string
{
return this.className;
}
setIconClass(iconClass: string | null): void
{
if (Type.isStringFilled(iconClass))
@@ -253,6 +304,33 @@ export class Label
return this.iconTitle;
}
isHidden(): boolean
{
return this.hidden;
}
hide(): void
{
this.hidden = true;
Dom.addClass(this.getContainer(), '--hidden');
}
show(): void
{
this.hidden = false;
Dom.removeClass(this.getContainer(), '--hidden');
}
isVisible(): boolean
{
return this.visible;
}
setVisible(isVisible: boolean = true): void
{
Dom.toggleClass(this.getContainer(), '--visible', isVisible);
}
setOnclick(fn: Function): void
{
if (Type.isFunction(fn) || fn === null)
@@ -1,6 +1,7 @@
import type { JsonObject } from 'main.core';
import { Type, Dom, Event, Runtime, Reflection, Browser, ajax as Ajax, Uri } from 'main.core';
import { EventEmitter, BaseEvent } from 'main.core.events';
import { PopupManager } from 'main.popup';
import { Slider } from './slider';
import type { SliderEvent } from './slider-event';
@@ -156,21 +157,14 @@ export class SliderManager
const rule = this.getUrlRule(url);
const ruleOptions = rule !== null && Type.isPlainObject(rule.options) ? rule.options : {};
const options = Type.isPlainObject(sliderOptions) ? sliderOptions : ruleOptions;
if (
Type.isPlainObject(ruleOptions.minimizeOptions)
&& Type.isPlainObject(sliderOptions)
&& !Type.isPlainObject(sliderOptions.minimizeOptions)
)
{
options.minimizeOptions = ruleOptions.minimizeOptions;
}
if (this.getToolbar() === null && options.minimizeOptions)
{
options.minimizeOptions = null;
}
const useGlobalOptions = sliderOptions?.useGlobalOptions ?? ruleOptions.useGlobalOptions ?? true;
const useRuleOptions = sliderOptions !== ruleOptions && useGlobalOptions;
const options: SliderOptions = {
...(useRuleOptions ? ruleOptions : {}),
...sliderOptions,
events: [useRuleOptions && ruleOptions.events, sliderOptions?.events],
};
const defaultOptions = SliderManager.getSliderDefaultOptions();
const priorityOptions = SliderManager.getSliderPriorityOptions();
@@ -803,12 +797,7 @@ export class SliderManager
}
}
rule.options = Type.isPlainObject(rule.options) ? rule.options : {};
if (Type.isStringFilled(rule.loader) && !Type.isStringFilled(rule.options.loader))
{
rule.options.loader = rule.loader;
delete rule.loader;
}
rule.options ??= {};
this.anchorRules.push(rule);
});
@@ -873,8 +862,7 @@ export class SliderManager
this.getTopSlider().showShadow();
}
this.getTopSlider().hideOrDarkenCloseBtn();
this.getTopSlider().hidePrintBtn();
this.getTopSlider().hideCloseBtn();
this.getTopSlider().hideExtraLabels();
}
else
@@ -884,9 +872,9 @@ export class SliderManager
this.#addOpenSlider(slider);
this.getOpenSliders().forEach((currentSlider: Slider, index: number, openSliders: Slider[]) => {
currentSlider.getLabel().moveAt(openSliders.length - index - 1); // move down
});
// this.getOpenSliders().forEach((currentSlider: Slider, index: number, openSliders: Slider[]) => {
// currentSlider.getLabel().moveAt(openSliders.length - index - 1); // move down
// });
this.losePageFocus();
@@ -951,9 +939,9 @@ export class SliderManager
this.exitFullScreen();
this.getOpenSliders().forEach((slider, index, openSliders) => {
slider.getLabel().moveAt(openSliders.length - index - 2); // move up
});
// this.getOpenSliders().forEach((slider, index, openSliders) => {
// slider.getLabel().moveAt(openSliders.length - index - 2); // move up
// });
let visibleSlider = null;
const openSliders = this.getOpenSliders();
@@ -976,7 +964,8 @@ export class SliderManager
{
previousSlider.unhideOverlay();
previousSlider.hideShadow();
previousSlider.showOrLightenCloseBtn();
previousSlider.showCloseBtn();
previousSlider.showExtraLabels();
if (topSlider)
{
@@ -1035,7 +1024,7 @@ export class SliderManager
this.getToolbar().expand(true);
const minimizeOptions = this.getMinimizeOptions(slider.getUrl());
const { entityType, entityId, url } = minimizeOptions || slider.getMinimizeOptions() || {};
const { entityType, entityId, url } = slider.getMinimizeOptions() || minimizeOptions || {};
const item = this.getToolbar().minimizeItem({
title,
@@ -1111,9 +1100,10 @@ export class SliderManager
handleEscapePress(event)
{
if (this.isOnTop() && this.getTopSlider() && this.getTopSlider().canCloseByEsc())
const topSlider = this.getTopSlider();
if (topSlider?.canCloseByEsc() && this.isOnTop(topSlider))
{
this.getTopSlider().close();
topSlider.close();
}
}
@@ -1127,21 +1117,16 @@ export class SliderManager
slider.unhideOverlay();
slider.hideShadow();
this.getOpenSliders().forEach((slider, index, openSliders) => {
slider.getLabel().moveAt(openSliders.length - index - 1); //update position
});
// this.getOpenSliders().forEach((slider, index, openSliders) => {
// slider.getLabel().moveAt(openSliders.length - index - 1); //update position
// });
if (this.getTopSlider())
{
this.getTopSlider().showOrLightenCloseBtn();
this.getTopSlider().unhideOverlay();
this.getTopSlider().hideShadow();
this.getTopSlider().showCloseBtn();
this.getTopSlider().showExtraLabels();
if (this.getTopSlider().isPrintable())
{
this.getTopSlider().showPrintBtn();
}
this.getTopSlider().focus();
}
else
@@ -1337,10 +1322,7 @@ export class SliderManager
event.preventDefault(); // otherwise an iframe loading can be cancelled by a browser
if (this.isOnTop() && this.getTopSlider() && this.getTopSlider().canCloseByEsc())
{
this.getTopSlider().close();
}
this.handleEscapePress();
}
/**
@@ -1372,8 +1354,18 @@ export class SliderManager
/**
* @private
*/
isOnTop(): boolean
isOnTop(slider: Slider): boolean
{
if (slider)
{
const popups = PopupManager.getPopups();
const isOnTopOfAllPopups = popups.every((popup) => slider.isOnTopOfPopup(popup));
if (!isOnTopOfAllPopups)
{
return false;
}
}
// Photo Slider or something else can cover Side Panel.
const centerX = document.documentElement.clientWidth / 2;
const centerY = document.documentElement.clientHeight / 2;
@@ -1456,7 +1448,14 @@ export class SliderManager
else
{
event.preventDefault();
this.open(link.url, rule.options);
if (Dom.attr(event.target, 'data-slider-maximize') === null)
{
this.open(link.url, rule.options);
}
else
{
this.maximize(link.url, rule.options);
}
}
}
@@ -1481,7 +1480,7 @@ export class SliderManager
else if (Type.isFunction(rule.handler))
{
rule.handler(
new Event(
new MouseEvent(
'slider',
{
bubbles: false,
@@ -1530,20 +1529,28 @@ export class SliderManager
if (matches && !this.hasStopParams(href, rule.stopParameters))
{
link.matches = matches;
let options = Type.isFunction(rule.options) ? rule.options(link) : rule.options;
const minimizeOptions = Type.isFunction(rule.minimizeOptions) ? rule.minimizeOptions(link) : null;
if (Type.isPlainObject(minimizeOptions))
{
if (Type.isPlainObject(rule.options))
if (Type.isPlainObject(options))
{
rule.options.minimizeOptions = minimizeOptions;
options.minimizeOptions = minimizeOptions;
}
else
{
rule.options = { minimizeOptions };
options = { minimizeOptions };
}
}
return rule;
if (Type.isStringFilled(rule.loader) && !Type.isStringFilled(options.loader))
{
options.loader = rule.loader;
delete rule.loader;
}
return { ...rule, options };
}
}
}
@@ -2,13 +2,14 @@ import { Type, Loc, Dom, Event, Runtime, Text, Browser, Uri, Tag, type JsonObjec
import { BaseEvent, EventEmitter } from 'main.core.events';
import { MemoryCache, type BaseCache } from 'main.core.cache';
import { ZIndexManager, type ZIndexComponent } from 'main.core.z-index-manager';
import type { Popup } from 'main.popup';
import { Dictionary } from './dictionary';
import { Label } from './label';
import { MessageEvent } from './message-event';
import { SliderEvent } from './slider-event';
import { type SliderOptions } from './types/slider-options';
import type { SliderOptions, SliderEvents } from './types/slider-options';
import { type MinimizeOptions } from './types/minimize-options';
import { type OuterBoundary } from './types/outer-boundary';
@@ -44,7 +45,7 @@ export class Slider
this.cacheable = options.cacheable !== false;
this.autoFocus = options.autoFocus !== false;
this.printable = options.printable === true;
this.allowChangeHistory = options.allowChangeHistory !== false;
this.allowChangeHistory = Type.isBoolean(options.allowChangeHistory) ? options.allowChangeHistory : null;
this.allowChangeTitle = Type.isBoolean(options.allowChangeTitle) ? options.allowChangeTitle : null;
this.allowCrossOrigin = options.allowCrossOrigin === true;
this.data = new Dictionary(Type.isPlainObject(options.data) ? options.data : {});
@@ -128,23 +129,14 @@ export class Slider
this.animationOptions = {};
this.minimizeOptions = null;
const minimizeOptions = options.minimizeOptions;
if (
Type.isPlainObject(minimizeOptions)
&& Type.isStringFilled(minimizeOptions.entityType)
&& (Type.isStringFilled(minimizeOptions.entityId) || Type.isNumber(minimizeOptions.entityId))
&& (Type.isStringFilled(minimizeOptions.url))
)
{
this.minimizeOptions = minimizeOptions;
}
this.setMinimizeOptions(options.minimizeOptions);
this.setToolbarOnOpen(options.hideToolbarOnOpen);
this.setDesignSystemContext(options.designSystemContext);
this.setAutoOffset(options.autoOffset);
this.label = new Label(this, {
iconClass: 'side-panel-label-icon-close',
className: '--close-label --ui-hoverable',
iconClass: 'side-panel-label-icon-close ui-icon-set --cross-l',
iconTitle: Loc.getMessage('MAIN_SIDEPANEL_CLOSE'),
onclick(label, slider)
{
@@ -157,31 +149,28 @@ export class Slider
this.label.setColor(labelOptions.color);
this.label.setBgColor(labelOptions.bgColor, labelOptions.opacity);
this.minimizeLabel = null;
this.minimizeLabel = new Label(this, {
className: '--ui-hoverable',
iconClass: 'side-panel-label-icon-minimize ui-icon-set --o-minimize',
iconTitle: Loc.getMessage('MAIN_SIDEPANEL_MINIMIZE'),
onclick: (label, slider) => {
if (this.isLoaded())
{
this.minimize();
}
},
visible: this.areMinimizeOptionsValid(this.minimizeOptions),
});
this.newWindowLabel = null;
this.copyLinkLabel = null;
this.printLabel = null;
if (!this.isSelfContained() && this.minimizeOptions !== null)
{
this.minimizeLabel = new Label(this, {
iconClass: 'side-panel-label-icon-minimize ui-icon-set --arrow-line',
iconTitle: Loc.getMessage('MAIN_SIDEPANEL_MINIMIZE'),
bgColor: ['#d9dcdf', 100],
onclick: (label, slider) => {
if (this.isLoaded())
{
this.minimize();
}
},
});
}
if (options.newWindowLabel === true && (!this.isSelfContained() || Type.isStringFilled(options.newWindowUrl)))
if (options.newWindowLabel === true && (this.canChangeHistory() || Type.isStringFilled(options.newWindowUrl)))
{
this.newWindowLabel = new Label(this, {
iconClass: 'side-panel-label-icon-new-window',
className: '--ui-hoverable',
iconClass: 'side-panel-label-icon-new-window ui-icon-set --go-to-l',
iconTitle: Loc.getMessage('MAIN_SIDEPANEL_NEW_WINDOW'),
bgColor: ['#d9dcdf', 100],
onclick(label, slider)
{
const newWindowUrl = Type.isStringFilled(options.newWindowUrl) ? options.newWindowUrl : slider.getUrl();
@@ -193,12 +182,12 @@ export class Slider
});
}
if (options.copyLinkLabel === true && (!this.isSelfContained() || Type.isStringFilled(options.newWindowUrl)))
if (options.copyLinkLabel === true && (this.canChangeHistory() || Type.isStringFilled(options.newWindowUrl)))
{
this.copyLinkLabel = new Label(this, {
iconClass: 'side-panel-label-icon-copy-link',
className: '--ui-hoverable',
iconClass: 'side-panel-label-icon-copy-link ui-icon-set --o-link',
iconTitle: Loc.getMessage('MAIN_SIDEPANEL_COPY_LINK'),
bgColor: ['#d9dcdf', 100],
});
BX.clipboard.bindCopyClick(
@@ -214,6 +203,14 @@ export class Slider
);
}
this.printLabel = new Label(this, {
hidden: !this.isPrintable(),
className: '--side-panel-label-print --ui-hoverable',
iconClass: 'side-panel-label-icon-print ui-icon-set --o-printer',
iconTitle: Loc.getMessage('MAIN_SIDEPANEL_PRINT'),
onclick: this.handlePrintBtnClick.bind(this),
});
// Compatibility
if (
this.url.includes('crm.activity.planner/slider.php')
@@ -229,9 +226,14 @@ export class Slider
};
}
if (Type.isPlainObject(options.events))
[options.events].flat().forEach((events: SliderEvents) => this.#subscribeEvents(events));
}
#subscribeEvents(events: SliderEvents): void
{
if (Type.isPlainObject(events))
{
for (const [eventName, fn] of Object.entries(options.events))
for (const [eventName, fn] of Object.entries(events))
{
if (Type.isFunction(fn))
{
@@ -397,7 +399,24 @@ export class Slider
this.animationOptions = Type.isPlainObject(options) ? options : {};
}
getMinimizeOptions(): MinimizeOptions
setMinimizeOptions(minimizeOptions: MinimizeOptions | null): void
{
const showMinimizeLabel = this.areMinimizeOptionsValid(minimizeOptions);
this.minimizeOptions = minimizeOptions;
this.minimizeLabel?.setVisible(showMinimizeLabel);
}
areMinimizeOptionsValid(minimizeOptions: ?MinimizeOptions): boolean
{
return Type.isPlainObject(minimizeOptions)
&& Type.isStringFilled(minimizeOptions.entityType)
&& (Type.isStringFilled(minimizeOptions.entityId) || Type.isNumber(minimizeOptions.entityId))
&& Type.isStringFilled(minimizeOptions.url)
;
}
getMinimizeOptions(): MinimizeOptions | null
{
return this.minimizeOptions;
}
@@ -678,12 +697,17 @@ export class Slider
canChangeHistory(): boolean
{
return (
this.allowChangeHistory
&& !this.allowCrossOrigin
&& !this.isSelfContained()
&& !/^\/bitrix\/(components|tools)\//i.test(this.getUrl())
);
if (this.allowCrossOrigin || /^\/bitrix\/(components|tools)\//i.test(this.getUrl()))
{
return false;
}
if (this.allowChangeHistory === null)
{
return !this.isSelfContained();
}
return this.allowChangeHistory;
}
canChangeTitle(): boolean
@@ -754,12 +778,12 @@ export class Slider
showCloseBtn(): void
{
this.getLabel().showIcon();
this.getLabel().show();
}
hideCloseBtn(): void
{
this.getLabel().hideIcon();
this.getLabel().hide();
}
showOrLightenCloseBtn(): void
@@ -788,22 +812,28 @@ export class Slider
showPrintBtn(): void
{
Dom.addClass(this.getPrintBtn(), 'side-panel-print-visible');
if (this.printLabel !== null)
{
this.printLabel.show();
}
}
hidePrintBtn(): void
{
Dom.removeClass(this.getPrintBtn(), 'side-panel-print-visible');
if (this.printLabel !== null)
{
this.printLabel.hide();
}
}
showExtraLabels(): void
{
Dom.style(this.getExtraLabelsContainer(), 'display', null);
Dom.removeClass(this.getExtraLabelsContainer(), '--hidden');
}
hideExtraLabels(): void
{
Dom.style(this.getExtraLabelsContainer(), 'display', 'none');
Dom.addClass(this.getExtraLabelsContainer(), '--hidden');
}
setContentClass(className: string): void
@@ -1268,7 +1298,7 @@ export class Slider
${
this.hideControls
? content
: [content, this.getLabelsContainer(), this.getPrintBtn()]
: [content, this.getLabelsContainer()]
}
</div>
`;
@@ -1321,9 +1351,10 @@ export class Slider
className: 'side-panel-extra-labels',
},
children: [
this.minimizeLabel ? this.minimizeLabel.getContainer() : null,
this.minimizeLabel.getContainer(),
this.newWindowLabel ? this.newWindowLabel.getContainer() : null,
this.copyLinkLabel ? this.copyLinkLabel.getContainer() : null,
this.printLabel ? this.printLabel.getContainer() : null,
],
});
});
@@ -1354,19 +1385,9 @@ export class Slider
return this.minimizeLabel;
}
getPrintBtn(): HTMLElement
getPrintLabel(): Label | null
{
return this.#refs.remember('print-btn', () => {
return Dom.create('span', {
props: {
className: 'side-panel-print',
title: Loc.getMessage('MAIN_SIDEPANEL_PRINT'),
},
events: {
click: this.handlePrintBtnClick.bind(this),
},
});
});
return this.printLabel;
}
/**
@@ -1733,11 +1754,6 @@ export class Slider
*/
animateOpening()
{
if (this.isPrintable())
{
this.showPrintBtn();
}
if (this.animation)
{
this.animation.stop();
@@ -2258,6 +2274,19 @@ export class Slider
this.fireFrameEvent('onEscapePress');
}
isOnTopOfPopup(popup: Popup): boolean
{
const sameStack = this.getZIndexComponent().getStack() === popup.getZIndexComponent().getStack();
const popupOnTop = sameStack && popup.getZindex() > this.getZindex();
let popupInside = this.getContainer().contains(popup.getPopupContainer());
if (this.getFrameWindow())
{
popupInside = this.getFrameWindow().document.contains(popup.getPopupContainer());
}
return !(popup.isShown() && (popupOnTop || popupInside));
}
/**
* @private
* @param {BaseEvent} event
@@ -2,7 +2,6 @@ import { Type, Cache, Text, Tag, Dom, type JsonObject } from 'main.core';
import { EventEmitter } from 'main.core.events';
import { PopupManager, Popup } from 'main.popup';
import { getInstance } from './get-instance';
import { type ToolbarItemOptions } from './types/toolbar-item-options';
export class ToolbarItem extends EventEmitter
@@ -18,7 +17,7 @@ export class ToolbarItem extends EventEmitter
this.title = '';
this.url = '';
this.entityType = '';
this.entityId = 0;
this.entityId = '0';
this.entityName = '';
this.refs = new Cache.MemoryCache();
@@ -91,7 +90,7 @@ export class ToolbarItem extends EventEmitter
{
if (Type.isNumber(entityId) || Type.isStringFilled(entityId))
{
this.entityId = entityId;
this.entityId = String(entityId);
}
}
@@ -112,8 +111,8 @@ export class ToolbarItem extends EventEmitter
{
return this.refs.remember('container', () => {
return Tag.render`
<div class="side-panel-toolbar-item"
onclick="${this.handleClick.bind(this)}"
<div
class="side-panel-toolbar-item"
onmouseenter="${this.handleMouseEnter.bind(this)}"
onmouseleave="${this.handleMouseLeave.bind(this)}"
>
@@ -138,7 +137,7 @@ export class ToolbarItem extends EventEmitter
<a
class="side-panel-toolbar-item-title"
href="${encodeURI(this.getUrl())}"
data-slider-ignore-autobinding="true"
data-slider-maximize="true"
>${Text.encode(this.getTitle())}</a>
`;
});
@@ -237,17 +236,6 @@ export class ToolbarItem extends EventEmitter
}
}
handleClick(event): void
{
if (event.ctrlKey || event.metaKey)
{
return;
}
event.preventDefault();
getInstance().maximize(this.getUrl());
}
handleMouseEnter(): void
{
this.showTooltip();
@@ -276,7 +276,7 @@ export class Toolbar extends EventEmitter
return this.collapsed;
}
getItems()
getItems(): ToolbarItem[]
{
return this.items;
}
@@ -571,7 +571,9 @@ export class Toolbar extends EventEmitter
getItem(entityType: string, entityId: string | number): ToolbarItem | null
{
return this.items.find((item) => item.getEntityType() === entityType && item.getEntityId() === entityId) || null;
return this.items.find((item) => {
return item.getEntityType() === entityType && item.getEntityId() === String(entityId);
}) || null;
}
getItemByUrl(url: string): ToolbarItem | null
@@ -5,7 +5,10 @@ export type LabelOptions = {
bgColor?: string | [string, number],
color?: string,
text?: string,
className?: string,
iconClass?: string,
iconTitle?: string,
hidden?: boolean,
visible?: boolean,
onclick?: (label: Label, slider: Slider) => void,
};
@@ -10,6 +10,6 @@ export type RuleOptions = {
allowCrossDomain?: boolean,
mobileFriendly?: boolean,
loader?: string,
options?: SliderOptions,
options?: SliderOptions | (link: LinkOptions) => SliderOptions,
minimizeOptions: (link: LinkOptions) => MinimizeOptions,
};
@@ -45,5 +45,8 @@ export type SliderOptions = {
copyLinkLabel?: boolean,
minimizeLabel?: boolean,
designSystemContext?: string,
events?: { [eventName: string]: (event: SliderEvent) => void },
events?: SliderEvents | SliderEvents[],
useGlobalOptions?: boolean,
};
export type SliderEvents = { [eventName: string]: (event: SliderEvent) => void };
@@ -817,27 +817,18 @@ insert into b_rating_weight (RATING_FROM, RATING_TO, WEIGHT, COUNT) VALUES (-100
CREATE TABLE b_event_log
(
/*SYSTEM GENERATED*/
ID INT not null auto_increment,
TIMESTAMP_X timestamp,
/*CALLER INFO*/
SEVERITY VARCHAR(50) not null, /*SECURITY, WARNING, NOTICE*/
AUDIT_TYPE_ID VARCHAR(50) not null, /*LOGIN_OK, LOGIN_WRONG_PASSWORD*/
MODULE_ID VARCHAR(50) not null, /*main, iblock, main.register */
ITEM_ID VARCHAR(255) not null, /*user login, element id*/
/*FROM $_SERVER*/
ID BIGINT not null auto_increment,
TIMESTAMP_X datetime,
SEVERITY VARCHAR(50) not null,
AUDIT_TYPE_ID VARCHAR(50) not null,
MODULE_ID VARCHAR(50) not null,
ITEM_ID VARCHAR(255) not null,
REMOTE_ADDR VARCHAR(40),
USER_AGENT TEXT, /*2000 for oracle and mssql*/
REQUEST_URI TEXT, /*2000 for oracle and mssql*/
/*FROM CONSTANTS AND VARIABLES*/
SITE_ID CHAR(2), /*if defined*/
USER_ID INT, /*if logged in*/
GUEST_ID INT, /* if statistics installed*/
/*ADDITIONAL*/
USER_AGENT TEXT,
REQUEST_URI TEXT,
SITE_ID CHAR(2),
USER_ID INT,
GUEST_ID INT,
DESCRIPTION MEDIUMTEXT,
PRIMARY KEY (ID),
INDEX ix_b_event_log_time(TIMESTAMP_X),
@@ -762,7 +762,7 @@ CREATE TABLE b_rating_weight (
);
CREATE TABLE b_event_log (
ID int GENERATED BY DEFAULT AS IDENTITY NOT NULL,
ID int8 GENERATED BY DEFAULT AS IDENTITY NOT NULL,
TIMESTAMP_X timestamp DEFAULT CURRENT_TIMESTAMP,
SEVERITY varchar(50) NOT NULL,
AUDIT_TYPE_ID varchar(50) NOT NULL,
@@ -73,14 +73,14 @@ function strip_tags(str)
}
function CAjaxForm(formName, target, hiddenField)
function CAjaxForm(formName, target, hiddenFields)
{
var form = document.forms[formName];
if (!form)
form = document.getElementById(formName);
this.nextStep = form.elements[hiddenField];
this.nextStepStage = form.elements[hiddenField+"Stage"];
this.hiddenFields = hiddenFields;
this.iframe = document.getElementById(target);
this.form = form;
this.form.target = target;
@@ -160,15 +160,15 @@ CAjaxForm.prototype.ShowError = function(errorMessage)
var skipButton = document.getElementById("error_skip_button");
var _this = this;
var nextStep = this.nextStep.value;
var nextStepStage = this.nextStepStage.value;
retryButton.onclick = function() {_this.HideError(); _this.Post(nextStep, nextStepStage,'');};
var nextStep = this.form.elements[this.hiddenFields.nextStep].value;
retryButton.onclick = function() {_this.HideError(); _this.Post({}, '');};
if (nextStep == "main")
skipButton.onclick = function() {_this.HideError(); _this.Post(nextStep, nextStepStage,'');};
skipButton.onclick = function() {_this.HideError(); _this.Post({}, '');};
else
skipButton.onclick = function() {_this.HideError(); _this.Post(nextStep, 'skip','');};
skipButton.onclick = function() {_this.HideError(); _this.Post({'nextStepStage': 'skip'}, '');};
}
CAjaxForm.prototype.HideError = function()
@@ -188,13 +188,18 @@ CAjaxForm.prototype.HideError = function()
waitWindow.style.display = "block";
}
CAjaxForm.prototype.Post = function(nextStep, nextStepStage, status)
CAjaxForm.prototype.Post = function(vars, status)
{
if (nextStep)
this.nextStep.value = nextStep;
if (nextStepStage)
this.nextStepStage.value = nextStepStage;
for (let key in vars)
{
if (vars.hasOwnProperty(key))
{
if (this.form.elements[this.hiddenFields[key]])
{
this.form.elements[this.hiddenFields[key]].value = vars[key];
}
}
}
this.form.submit();
@@ -221,9 +226,12 @@ CAjaxForm.prototype.SetStatus = function(percent, status)
if (!this.indicator)
this.indicator = document.getElementById("indicator");
if (!this.status)
this.status = document.getElementById("status");
this.status.innerHTML = status;
if (status)
{
if (!this.status)
this.status = document.getElementById("status");
this.status.innerHTML = status;
}
if (this.percent)
this.percent.innerHTML = percent + "%";
@@ -252,3 +260,39 @@ function PreloadImages()
}
}
function SubmitForm(formId, action, fields)
{
let form = document.getElementById(formId);
if (!form)
{
form = document.createElement('form');
form.setAttribute('id', formId);
form.setAttribute('method', 'post');
form.setAttribute('action', action);
form.setAttribute('target', '_blank');
for (let name in fields)
{
if (fields.hasOwnProperty(name))
{
let i = document.createElement('input');
i.setAttribute('type', 'hidden');
i.setAttribute('name', name);
form.appendChild(i);
}
}
document.getElementsByTagName('body')[0].appendChild(form);
}
for (let name in fields)
{
if (fields.hasOwnProperty(name))
{
form.elements[name].value = fields[name];
}
}
form.submit();
}
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
function CancelBubble(e){if(e.stopPropagation){e.preventDefault();e.stopPropagation()}else{e.cancelBubble=true;e.returnValue=false}}function NeedRootUser(){var e=document.getElementById("create_user_Y");var t=document.getElementById("create_db_Y");if(e.checked||t&&t.checked){document.getElementById("line1").style.display="";document.getElementById("line2").style.display="";document.getElementById("line3").style.display=""}else{document.getElementById("line1").style.display="none";document.getElementById("line2").style.display="none";document.getElementById("line3").style.display="none"}var n=document.getElementById("db_exists");var i=document.getElementById("db_new");if(n&&i){n.style.display=!t.checked?"block":"none";i.style.display=t.checked?"block":"none"}}function NeedUTFSection(e){if(e=="mssql"||e=="mssql_native"){document.getElementById("utf-row-two").style.display="none";document.getElementById("utf-row-one").style.display="none";document.getElementById("utf8_inst").checked=false;document.getElementsByName("__wiz_utf8")[0].value=""}else{document.getElementById("utf-row-one").style.display="";document.getElementById("utf-row-two").style.display=""}}function htmlspecialchars(e){if(typeof e!="string")return e;e=e.replace(/&/g,"&amp;");e=e.replace(/"/g,"&quot;");e=e.replace(/</g,"&lt;");e=e.replace(/>/g,"&gt;");return e}function strip_tags(e){return e.replace(/<\/?[^>]+>/gi,"")}function CAjaxForm(e,t,n){var i=document.forms[e];if(!i)i=document.getElementById(e);this.nextStep=i.elements[n];this.nextStepStage=i.elements[n+"Stage"];this.iframe=document.getElementById(t);this.form=i;this.form.target=t;var r=this;if(this.iframe.attachEvent)this.iframe.attachEvent("onload",function(){r.AjaxHandler()});else this.iframe.onload=function(){r.AjaxHandler()};this.percent=null;this.percent2=null;this.indicator=null;this.status=null}CAjaxForm.prototype.AjaxHandler=function(){if(this.iframe.contentWindow&&this.iframe.contentWindow.location.href.indexOf("http")!=0)return;if(this.iframe.contentDocument)var e=this.iframe.contentDocument;else var e=this.iframe.contentWindow.document;var t=e.body.innerHTML;if(t.length==0||e.getElementById("bitrix_install_template")){this.ShowError("Connection error. Empty response.");return}var n=new RegExp("\\[response\\]","i");var i=new RegExp("\\[/response\\]","i");var r=t.match(n);if(r===null){this.ShowError(t);return}var o=r.index+r[0].length;var s=t.search(i);if(s==-1){this.ShowError(t);return}t=t.substr(o,s-o);window.eval(t)};CAjaxForm.prototype.ShowError=function(e){var t=document.getElementById("error_container");var n=document.getElementById("error_text");if(!t||!n)return;var i=document.getElementById("wait");if(i)i.style.display="none";t.style.display="block";n.innerHTML=strip_tags(e);var r=document.getElementById("error_retry_button");var o=document.getElementById("error_skip_button");var s=this;var a=this.nextStep.value;var l=this.nextStepStage.value;r.onclick=function(){s.HideError();s.Post(a,l,"")};if(a=="main")o.onclick=function(){s.HideError();s.Post(a,l,"")};else o.onclick=function(){s.HideError();s.Post(a,"skip","")}};CAjaxForm.prototype.HideError=function(){var e=document.getElementById("error_container");var t=document.getElementById("error_text");if(!e||!t)return;while(t.firstChild)t.removeChild(t.firstChild);e.style.display="none";var n=document.getElementById("wait");if(n)n.style.display="block"};CAjaxForm.prototype.Post=function(e,t,n){if(e)this.nextStep.value=e;if(t)this.nextStepStage.value=t;this.form.submit();if(!this.status)this.status=document.getElementById("status");if(n.length>0)this.status.innerHTML=n+"..."};CAjaxForm.prototype.StopAjax=function(){this.iframe.onload=null;this.form.target="_self"};CAjaxForm.prototype.SetStatus=function(e,t){if(!this.percent)this.percent=document.getElementById("percent");if(!this.percent2)this.percent2=document.getElementById("percent2");if(!this.indicator)this.indicator=document.getElementById("indicator");if(!this.status)this.status=document.getElementById("status");this.status.innerHTML=t;if(this.percent)this.percent.innerHTML=e+"%";if(this.percent2)this.percent2.innerHTML=e+"%";this.indicator.style.width=e+"%"};function OnBeforeUserExit(e){if(!e)var e=window.event;e.returnValue=warningBeforeOnload}function PreloadImages(){var e=["prev.gif","error.gif","wait.gif","admin.gif","public.gif"];for(var t=0;t<e.length;t++){var n=new Image;n.src="/bitrix/images/install/"+e[t]}}
function CancelBubble(e){if(e.stopPropagation){e.preventDefault();e.stopPropagation()}else{e.cancelBubble=true;e.returnValue=false}}function NeedRootUser(){var e=document.getElementById("create_user_Y");var t=document.getElementById("create_db_Y");if(e.checked||t&&t.checked){document.getElementById("line1").style.display="";document.getElementById("line2").style.display="";document.getElementById("line3").style.display=""}else{document.getElementById("line1").style.display="none";document.getElementById("line2").style.display="none";document.getElementById("line3").style.display="none"}var n=document.getElementById("db_exists");var i=document.getElementById("db_new");if(n&&i){n.style.display=!t.checked?"block":"none";i.style.display=t.checked?"block":"none"}}function NeedUTFSection(e){if(e=="mssql"||e=="mssql_native"){document.getElementById("utf-row-two").style.display="none";document.getElementById("utf-row-one").style.display="none";document.getElementById("utf8_inst").checked=false;document.getElementsByName("__wiz_utf8")[0].value=""}else{document.getElementById("utf-row-one").style.display="";document.getElementById("utf-row-two").style.display=""}}function htmlspecialchars(e){if(typeof e!="string")return e;e=e.replace(/&/g,"&amp;");e=e.replace(/"/g,"&quot;");e=e.replace(/</g,"&lt;");e=e.replace(/>/g,"&gt;");return e}function strip_tags(e){return e.replace(/<\/?[^>]+>/gi,"")}function CAjaxForm(e,t,n){var i=document.forms[e];if(!i)i=document.getElementById(e);this.hiddenFields=n;this.iframe=document.getElementById(t);this.form=i;this.form.target=t;var r=this;if(this.iframe.attachEvent)this.iframe.attachEvent("onload",(function(){r.AjaxHandler()}));else this.iframe.onload=function(){r.AjaxHandler()};this.percent=null;this.percent2=null;this.indicator=null;this.status=null}CAjaxForm.prototype.AjaxHandler=function(){if(this.iframe.contentWindow&&this.iframe.contentWindow.location.href.indexOf("http")!=0)return;if(this.iframe.contentDocument)var e=this.iframe.contentDocument;else var e=this.iframe.contentWindow.document;var t=e.body.innerHTML;if(t.length==0||e.getElementById("bitrix_install_template")){this.ShowError("Connection error. Empty response.");return}var n=new RegExp("\\[response\\]","i");var i=new RegExp("\\[/response\\]","i");var r=t.match(n);if(r===null){this.ShowError(t);return}var o=r.index+r[0].length;var s=t.search(i);if(s==-1){this.ShowError(t);return}t=t.substr(o,s-o);window.eval(t)};CAjaxForm.prototype.ShowError=function(e){var t=document.getElementById("error_container");var n=document.getElementById("error_text");if(!t||!n)return;var i=document.getElementById("wait");if(i)i.style.display="none";t.style.display="block";n.innerHTML=strip_tags(e);var r=document.getElementById("error_retry_button");var o=document.getElementById("error_skip_button");var s=this;var l=this.form.elements[this.hiddenFields.nextStep].value;r.onclick=function(){s.HideError();s.Post({},"")};if(l=="main")o.onclick=function(){s.HideError();s.Post({},"")};else o.onclick=function(){s.HideError();s.Post({nextStepStage:"skip"},"")}};CAjaxForm.prototype.HideError=function(){var e=document.getElementById("error_container");var t=document.getElementById("error_text");if(!e||!t)return;while(t.firstChild)t.removeChild(t.firstChild);e.style.display="none";var n=document.getElementById("wait");if(n)n.style.display="block"};CAjaxForm.prototype.Post=function(e,t){for(let t in e){if(e.hasOwnProperty(t)){if(this.form.elements[this.hiddenFields[t]]){this.form.elements[this.hiddenFields[t]].value=e[t]}}}this.form.submit();if(!this.status)this.status=document.getElementById("status");if(t.length>0)this.status.innerHTML=t+"..."};CAjaxForm.prototype.StopAjax=function(){this.iframe.onload=null;this.form.target="_self"};CAjaxForm.prototype.SetStatus=function(e,t){if(!this.percent)this.percent=document.getElementById("percent");if(!this.percent2)this.percent2=document.getElementById("percent2");if(!this.indicator)this.indicator=document.getElementById("indicator");if(t){if(!this.status)this.status=document.getElementById("status");this.status.innerHTML=t}if(this.percent)this.percent.innerHTML=e+"%";if(this.percent2)this.percent2.innerHTML=e+"%";this.indicator.style.width=e+"%"};function OnBeforeUserExit(e){if(!e)var e=window.event;e.returnValue=warningBeforeOnload}function PreloadImages(){var e=["prev.gif","error.gif","wait.gif","admin.gif","public.gif"];for(var t=0;t<e.length;t++){var n=new Image;n.src="/bitrix/images/install/"+e[t]}}function SubmitForm(e,t,n){let i=document.getElementById(e);if(!i){i=document.createElement("form");i.setAttribute("id",e);i.setAttribute("method","post");i.setAttribute("action",t);i.setAttribute("target","_blank");for(let e in n){if(n.hasOwnProperty(e)){let t=document.createElement("input");t.setAttribute("type","hidden");t.setAttribute("name",e);i.appendChild(t)}}document.getElementsByTagName("body")[0].appendChild(i)}for(let e in n){if(n.hasOwnProperty(e)){i.elements[e].value=n[e]}}i.submit()}
//# sourceMappingURL=script.map.js
@@ -43,11 +43,11 @@ class WizardTemplate extends CWizardTemplate
include($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/.config.php");
}
$title = $bxProductConfig["product_wizard"]["product_name"] ?? $arWizardConfig["productName"] ?? InstallGetMessage("INS_TITLE3");
$title = $bxProductConfig["product_wizard"]["product_name"] ?? $arWizardConfig["productName"] ?? GetMessage("INS_TITLE3");
$titleSub = "";
if($title == InstallGetMessage("INS_TITLE3"))
$titleSub = '<div class="inst-title-label">'.InstallGetMessage("INS_TITLE2").'</div>';
if($title == GetMessage("INS_TITLE3"))
$titleSub = '<div class="inst-title-label">'.GetMessage("INS_TITLE2").'</div>';
$title = str_replace("#VERS#", $productVersion , $title);
$browserTitle = strip_tags(str_replace(Array("<br>", "<br />"), " ",$title));
@@ -56,16 +56,16 @@ class WizardTemplate extends CWizardTemplate
$copyright = $bxProductConfig["product_wizard"]["copyright"];
else
{
$copyright = InstallGetMessage("COPYRIGHT");
$copyright = GetMessage("COPYRIGHT");
if (isset($arWizardConfig["copyrightText"]))
$copyright .= $arWizardConfig["copyrightText"];
}
$copyright = str_replace("#CURRENT_YEAR#", date("Y") , $copyright);
$support = $bxProductConfig["product_wizard"]["links"] ?? $arWizardConfig["supportText"] ?? InstallGetMessage("SUPPORT");
$support = $bxProductConfig["product_wizard"]["links"] ?? $arWizardConfig["supportText"] ?? GetMessage("SUPPORT");
if (file_exists($_SERVER["DOCUMENT_ROOT"]."/readme.html"))
$support = InstallGetMessage("SUPPORT_README").$support;
$support = GetMessage("SUPPORT_README").$support;
//Images
$logoImage = "";
@@ -134,15 +134,15 @@ class WizardTemplate extends CWizardTemplate
$jsBeforeOnload = "";
if ($currentStep == "create_modules")
{
$jsBeforeOnload .= "var warningBeforeOnload = '".InstallGetMessage("INS_BEFORE_USER_EXIT")."';\n";
$jsBeforeOnload .= "var warningBeforeOnload = '".GetMessage("INS_BEFORE_USER_EXIT")."';\n";
$jsBeforeOnload .= "window.onbeforeunload = OnBeforeUserExit;";
}
$jsCode = "";
$jsCode = file_get_contents($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/install/wizard/script.js");
$instructionText = InstallGetMessage("GOTO_README");
$noscriptInfo = InstallGetMessage("INST_JAVASCRIPT_DISABLED");
$instructionText = GetMessage("GOTO_README");
$noscriptInfo = GetMessage("INST_JAVASCRIPT_DISABLED");
return <<<HTML
<!DOCTYPE html>
+264 -225
View File
@@ -1,6 +1,9 @@
<?php
function InstallGetMessage($name, $aReplace=null)
/**
* @deprecated
*/
function InstallGetMessage($name, $aReplace = null)
{
return GetMessage($name, $aReplace);
}
@@ -21,42 +24,44 @@ class BXInstallServices
$additionalInstallDefine = (NEED_PERSON_TYPE) ? 'define("NEED_PERSON_TYPE", true);' : 'define("NEED_PERSON_TYPE", false);';
}
$indexContent = '<'.'?'.
'define("WIZARD_DEFAULT_SITE_ID", "'.(defined("WIZARD_DEFAULT_SITE_ID") ? WIZARD_DEFAULT_SITE_ID : "s1").'");'.
$additionalInstallDefine.
$personTypeDefine.
'require('.'$'.'_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");'.
'require_once('.'$'.'_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/wizard.php");'.
'$'.'wizard = new CWizard("'.$wizardName.'");'.
'$'.'wizard->Install();'.
'require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php");'.
'?'.'>';
$indexContent = '<' . '?' .
'define("WIZARD_DEFAULT_SITE_ID", "' . (defined("WIZARD_DEFAULT_SITE_ID") ? WIZARD_DEFAULT_SITE_ID : "s1") . '");' .
$additionalInstallDefine .
$personTypeDefine .
'require(' . '$' . '_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");' .
'require_once(' . '$' . '_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/wizard.php");' .
'$' . 'wizard = new CWizard("' . $wizardName . '");' .
'$' . 'wizard->Install();' .
'require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php");' .
'?' . '>';
$p = $_SERVER["DOCUMENT_ROOT"]."/index.php";
$p = $_SERVER["DOCUMENT_ROOT"] . "/index.php";
if (defined("WIZARD_DEFAULT_SITE_ID"))
{
$rsSite = CSite::GetList("sort", "asc", array("ID" => WIZARD_DEFAULT_SITE_ID));
$rsSite = CSite::GetList("sort", "asc", ["ID" => WIZARD_DEFAULT_SITE_ID]);
$arSite = $rsSite->GetNext();
$p = CSite::GetSiteDocRoot($arSite["LID"]).$arSite["DIR"]."/index.php";
$p = CSite::GetSiteDocRoot($arSite["LID"]) . $arSite["DIR"] . "/index.php";
}
$handler = @fopen($p,"wb");
$handler = @fopen($p, "wb");
if (!$handler)
{
$errorMessage = InstallGetMessage("INST_WIZARD_INDEX_ACCESS_ERROR");
$errorMessage = GetMessage("INST_WIZARD_INDEX_ACCESS_ERROR");
return false;
}
$success = @fwrite($handler, $indexContent);
if (!$success)
{
$errorMessage = InstallGetMessage("INST_WIZARD_INDEX_ACCESS_ERROR");
$errorMessage = GetMessage("INST_WIZARD_INDEX_ACCESS_ERROR");
return false;
}
if (defined("BX_FILE_PERMISSIONS"))
@chmod($_SERVER["DOCUMENT_ROOT"]."/index.php", BX_FILE_PERMISSIONS);
{
@chmod($_SERVER["DOCUMENT_ROOT"] . "/index.php", BX_FILE_PERMISSIONS);
}
fclose($handler);
@@ -66,105 +71,141 @@ class BXInstallServices
public static function LoadWizardData($wizard)
{
$arTmp = explode(":", $wizard);
$ar = array();
$ar = [];
foreach ($arTmp as $a)
{
$a = preg_replace("#[^a-z0-9_.-]+#i", "", $a);
if ($a <> '')
{
$ar[] = $a;
}
}
if (count($ar) > 2)
$path = $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/".$ar[0]."/install/wizards/".$ar[1]."/".$ar[2];
{
$path = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/" . $ar[0] . "/install/wizards/" . $ar[1] . "/" . $ar[2];
}
elseif (count($ar) == 2)
$path = $_SERVER["DOCUMENT_ROOT"]."/bitrix/wizards/".$ar[0]."/".$ar[1];
{
$path = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/wizards/" . $ar[0] . "/" . $ar[1];
}
else
{
return false;
}
if (!file_exists($path."/.description.php") || !is_file($path."/.description.php"))
if (!file_exists($path . "/.description.php") || !is_file($path . "/.description.php"))
{
return false;
}
if (!defined("B_PROLOG_INCLUDED"))
{
define("B_PROLOG_INCLUDED", true);
}
global $MESS;
if(file_exists($path."/lang/en/.description.php"))
include($path."/lang/en/.description.php");
if (file_exists($path."/lang/".LANGUAGE_ID."/.description.php"))
include($path."/lang/".LANGUAGE_ID."/.description.php");
if (file_exists($path . "/lang/en/.description.php"))
{
include($path . "/lang/en/.description.php");
}
if (file_exists($path . "/lang/" . LANGUAGE_ID . "/.description.php"))
{
include($path . "/lang/" . LANGUAGE_ID . "/.description.php");
}
$arWizardDescription = array();
include($path."/.description.php");
$arWizardDescription = [];
include($path . "/.description.php");
if (empty($arWizardDescription))
{
return false;
}
if (!array_key_exists("WIZARD_TYPE", $arWizardDescription))
{
return false;
}
if (defined("WIZARD_DEFAULT_TONLY") && WIZARD_DEFAULT_TONLY === true && !defined("WIZARD_DEFAULT_DONLY") && strtoupper($arWizardDescription["WIZARD_TYPE"]) != "INSTALL")
{
return false;
}
if (defined("WIZARD_DEFAULT_TONLY") && WIZARD_DEFAULT_TONLY === true && defined("WIZARD_DEFAULT_DONLY") && strtoupper($arWizardDescription["WIZARD_TYPE"]) != "INSTALL" && strtoupper($arWizardDescription["WIZARD_TYPE"]) != "INSTALL_ONCE")
{
return false;
}
if ((!defined("WIZARD_DEFAULT_TONLY") || WIZARD_DEFAULT_TONLY !== true) && strtoupper($arWizardDescription["WIZARD_TYPE"]) != "INSTALL" && strtoupper($arWizardDescription["WIZARD_TYPE"]) != "INSTALL_ONCE")
{
return false;
}
if ($arWizardDescription["IMAGE"] <> '')
{
if (count($ar) > 2)
{
BXInstallServices::CopyDirFiles(
$path."/".$arWizardDescription["IMAGE"],
$_SERVER["DOCUMENT_ROOT"]."/bitrix/tmp/".$ar[1]."/".$ar[2]."/".$arWizardDescription["IMAGE"],
$path . "/" . $arWizardDescription["IMAGE"],
$_SERVER["DOCUMENT_ROOT"] . "/bitrix/tmp/" . $ar[1] . "/" . $ar[2] . "/" . $arWizardDescription["IMAGE"],
true
);
$arWizardDescription["IMAGE"] = "/bitrix/tmp/".$ar[1]."/".$ar[2]."/".$arWizardDescription["IMAGE"];
$arWizardDescription["IMAGE"] = "/bitrix/tmp/" . $ar[1] . "/" . $ar[2] . "/" . $arWizardDescription["IMAGE"];
}
else
{
$arWizardDescription["IMAGE"] = "/bitrix/wizards/".$ar[0]."/".$ar[1]."/".$arWizardDescription["IMAGE"];
$arWizardDescription["IMAGE"] = "/bitrix/wizards/" . $ar[0] . "/" . $ar[1] . "/" . $arWizardDescription["IMAGE"];
}
}
return array(
return [
"ID" => implode(":", $ar),
"NAME" => $arWizardDescription["NAME"],
"DESCRIPTION" => $arWizardDescription["DESCRIPTION"],
"IMAGE" => $arWizardDescription["IMAGE"],
"VERSION" => $arWizardDescription["VERSION"],
);
];
}
public static function GetWizardsList($moduleName = "")
{
$arWizardsList = array();
$arWizardsList = [];
if ($moduleName == '')
{
$path = $_SERVER["DOCUMENT_ROOT"]."/bitrix/wizards";
$path = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/wizards";
if ($h1 = opendir($path))
{
while (($f1 = readdir($h1)) !== false)
{
if ($f1 == "." || $f1 == "..")
{
continue;
}
if (!is_dir($path."/".$f1))
if (!is_dir($path . "/" . $f1))
{
continue;
}
if ($h2 = opendir($path."/".$f1))
if ($h2 = opendir($path . "/" . $f1))
{
while (($f2 = readdir($h2)) !== false)
{
if ($f2 == "." || $f2 == "..")
continue;
if (!is_dir($path."/".$f1."/".$f2))
continue;
if (!file_exists($path."/".$f1."/".$f2."/.description.php"))
continue;
if ($wizardData = BXInstallServices::LoadWizardData($f1.":".$f2))
{
$arWizardsList[$f1.":".$f2] = $wizardData;
continue;
}
if (!is_dir($path . "/" . $f1 . "/" . $f2))
{
continue;
}
if (!file_exists($path . "/" . $f1 . "/" . $f2 . "/.description.php"))
{
continue;
}
if ($wizardData = BXInstallServices::LoadWizardData($f1 . ":" . $f2))
{
$arWizardsList[$f1 . ":" . $f2] = $wizardData;
}
}
closedir($h2);
@@ -174,48 +215,68 @@ class BXInstallServices
}
}
$path = $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules";
$path = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules";
if ($h1 = opendir($path))
{
while (($f1 = readdir($h1)) !== false)
{
if ($f1 == "." || $f1 == "..")
{
continue;
}
if ($moduleName <> '' && $f1 != $moduleName)
{
continue;
}
if (!is_dir($path."/".$f1) || !file_exists($path."/".$f1."/install/wizards") || !is_dir($path."/".$f1."/install/wizards"))
if (!is_dir($path . "/" . $f1) || !file_exists($path . "/" . $f1 . "/install/wizards") || !is_dir($path . "/" . $f1 . "/install/wizards"))
{
continue;
}
if ($h2 = opendir($path."/".$f1."/install/wizards"))
if ($h2 = opendir($path . "/" . $f1 . "/install/wizards"))
{
while (($f2 = readdir($h2)) !== false)
{
if ($f2 == "." || $f2 == "..")
{
continue;
}
if (!is_dir($path."/".$f1."/install/wizards/".$f2))
if (!is_dir($path . "/" . $f1 . "/install/wizards/" . $f2))
{
continue;
}
if ($h3 = opendir($path."/".$f1."/install/wizards/".$f2))
if ($h3 = opendir($path . "/" . $f1 . "/install/wizards/" . $f2))
{
while (($f3 = readdir($h3)) !== false)
{
if ($f3 == "." || $f3 == "..")
{
continue;
}
if (!is_dir($path."/".$f1."/install/wizards/".$f2."/".$f3))
if (!is_dir($path . "/" . $f1 . "/install/wizards/" . $f2 . "/" . $f3))
{
continue;
}
if (array_key_exists($f2.":".$f3, $arWizardsList))
if (array_key_exists($f2 . ":" . $f3, $arWizardsList))
{
continue;
}
if (!file_exists($path."/".$f1."/install/wizards/".$f2."/".$f3."/.description.php"))
if (!file_exists($path . "/" . $f1 . "/install/wizards/" . $f2 . "/" . $f3 . "/.description.php"))
{
continue;
}
if ($wizardData = BXInstallServices::LoadWizardData($f1.":".$f2.":".$f3))
$arWizardsList[$f2.":".$f3] = $wizardData;
if ($wizardData = BXInstallServices::LoadWizardData($f1 . ":" . $f2 . ":" . $f3))
{
$arWizardsList[$f2 . ":" . $f3] = $wizardData;
}
}
closedir($h3);
}
@@ -226,8 +287,10 @@ class BXInstallServices
closedir($h1);
}
if(LANGUAGE_ID != 'ru')
if (LANGUAGE_ID != 'ru')
{
unset($arWizardsList['bitrix:demo']);
}
ksort($arWizardsList);
@@ -237,24 +300,30 @@ class BXInstallServices
public static function CopyDirFiles($path_from, $path_to, $rewrite = true)
{
if (str_starts_with($path_to . "/", $path_from . "/"))
{
return false;
}
if (is_dir($path_from))
{
BXInstallServices::CheckDirPath($path_to."/");
BXInstallServices::CheckDirPath($path_to . "/");
}
elseif (is_file($path_from))
{
$p = strrpos($path_to, "/");
$path_to_dir = substr($path_to, 0, $p);
BXInstallServices::CheckDirPath($path_to_dir."/");
BXInstallServices::CheckDirPath($path_to_dir . "/");
if (file_exists($path_to) && !$rewrite)
{
return false;
}
@copy($path_from, $path_to);
if(is_file($path_to) && defined("BX_FILE_PERMISSIONS"))
if (is_file($path_to) && defined("BX_FILE_PERMISSIONS"))
{
@chmod($path_to, BX_FILE_PERMISSIONS);
}
return true;
}
@@ -268,21 +337,25 @@ class BXInstallServices
while (($file = readdir($handle)) !== false)
{
if ($file == "." || $file == "..")
{
continue;
if (is_dir($path_from."/".$file))
{
BXInstallServices::CopyDirFiles($path_from."/".$file, $path_to."/".$file, $rewrite);
}
elseif (is_file($path_from."/".$file))
{
if (file_exists($path_to."/".$file) && !$rewrite)
continue;
@copy($path_from."/".$file, $path_to."/".$file);
if(defined("BX_FILE_PERMISSIONS"))
if (is_dir($path_from . "/" . $file))
{
BXInstallServices::CopyDirFiles($path_from . "/" . $file, $path_to . "/" . $file, $rewrite);
}
elseif (is_file($path_from . "/" . $file))
{
if (file_exists($path_to . "/" . $file) && !$rewrite)
{
@chmod($path_to."/".$file, BX_FILE_PERMISSIONS);
continue;
}
@copy($path_from . "/" . $file, $path_to . "/" . $file);
if (defined("BX_FILE_PERMISSIONS"))
{
@chmod($path_to . "/" . $file, BX_FILE_PERMISSIONS);
}
}
}
@@ -295,7 +368,6 @@ class BXInstallServices
global $arWizardConfig;
$dbTypes = [];
if (isset($arWizardConfig['pgsql']) && $arWizardConfig['pgsql'] === 'yes')
{
$dbTypes['pgsql'] = function_exists('pg_pconnect');
@@ -310,7 +382,7 @@ class BXInstallServices
public static function CheckDirPath($path, $dirPermissions = 0755)
{
$badDirs = Array();
$badDirs = [];
$path = str_replace("\\", "/", $path);
$path = str_replace("//", "/", $path);
@@ -320,8 +392,10 @@ class BXInstallServices
$path = substr($path, 0, $p);
}
while (strlen($path) > 1 && $path[strlen($path) - 1]=="/")
while (strlen($path) > 1 && $path[strlen($path) - 1] == "/")
{
$path = substr($path, 0, strlen($path) - 1);
}
$p = strrpos($path, "/");
while ($p > 0)
@@ -329,7 +403,9 @@ class BXInstallServices
if (file_exists($path) && is_dir($path))
{
if (!is_writable($path))
{
@chmod($path, $dirPermissions);
}
break;
}
$badDirs[] = substr($path, $p + 1);
@@ -337,12 +413,14 @@ class BXInstallServices
$p = strrpos($path, "/");
}
for ($i = count($badDirs)-1; $i>=0; $i--)
for ($i = count($badDirs) - 1; $i >= 0; $i--)
{
$path = $path."/".$badDirs[$i];
$path = $path . "/" . $badDirs[$i];
$success = @mkdir($path, $dirPermissions);
if (!$success)
{
return false;
}
}
return true;
@@ -351,7 +429,10 @@ class BXInstallServices
public static function DeleteDirRec($path)
{
$path = str_replace("\\", "/", $path);
if (!file_exists($path)) return;
if (!file_exists($path))
{
return;
}
if (!is_dir($path))
{
@unlink($path);
@@ -361,11 +442,18 @@ class BXInstallServices
{
while (($file = readdir($handle)) !== false)
{
if ($file == "." || $file == "..") continue;
if (is_dir($path."/".$file))
BXInstallServices::DeleteDirRec($path."/".$file);
if ($file == "." || $file == "..")
{
continue;
}
if (is_dir($path . "/" . $file))
{
BXInstallServices::DeleteDirRec($path . "/" . $file);
}
else
@unlink($path."/".$file);
{
@unlink($path . "/" . $file);
}
}
}
closedir($handle);
@@ -374,37 +462,57 @@ class BXInstallServices
public static function VersionCompare($strCurver, $strMinver, $strMaxver = "0.0.0")
{
$curver = explode(".", $strCurver);for ($i = 0; $i < 3; $i++) $curver[$i] = (isset($curver[$i]) ? intval($curver[$i]) : 0);
$minver = explode(".", $strMinver); for ($i = 0; $i < 3; $i++) $minver[$i] = (isset($minver[$i]) ? intval($minver[$i]) : 0);
$maxver = explode(".", $strMaxver); for ($i = 0; $i < 3; $i++) $maxver[$i] = (isset($maxver[$i]) ? intval($maxver[$i]) : 0);
$curver = explode(".", $strCurver);
for ($i = 0; $i < 3; $i++)
{
$curver[$i] = (isset($curver[$i]) ? intval($curver[$i]) : 0);
}
$minver = explode(".", $strMinver);
for ($i = 0; $i < 3; $i++)
{
$minver[$i] = (isset($minver[$i]) ? intval($minver[$i]) : 0);
}
$maxver = explode(".", $strMaxver);
for ($i = 0; $i < 3; $i++)
{
$maxver[$i] = (isset($maxver[$i]) ? intval($maxver[$i]) : 0);
}
if (($minver[0]>0 || $minver[1]>0 || $minver[2]>0)
if (($minver[0] > 0 || $minver[1] > 0 || $minver[2] > 0)
&&
($curver[0]<$minver[0]
|| (($curver[0]==$minver[0]) && ($curver[1]<$minver[1]))
|| (($curver[0]==$minver[0]) && ($curver[1]==$minver[1]) && ($curver[2]<$minver[2]))
($curver[0] < $minver[0]
|| (($curver[0] == $minver[0]) && ($curver[1] < $minver[1]))
|| (($curver[0] == $minver[0]) && ($curver[1] == $minver[1]) && ($curver[2] < $minver[2]))
))
{
return false;
elseif (($maxver[0]>0 || $maxver[1]>0 || $maxver[2]>0)
}
elseif (($maxver[0] > 0 || $maxver[1] > 0 || $maxver[2] > 0)
&&
($curver[0]>$maxver[0]
|| (($curver[0]==$maxver[0]) && ($curver[1]>$maxver[1]))
|| (($curver[0]==$maxver[0]) && ($curver[1]==$maxver[1]) && ($curver[2]>=$maxver[2]))
($curver[0] > $maxver[0]
|| (($curver[0] == $maxver[0]) && ($curver[1] > $maxver[1]))
|| (($curver[0] == $maxver[0]) && ($curver[1] == $maxver[1]) && ($curver[2] >= $maxver[2]))
))
{
return false;
}
else
{
return true;
}
}
public static function Add2Log($sText, $sErrorCode = "")
{
$MAX_LOG_SIZE = 1000000;
$READ_PSIZE = 8000;
$LOG_FILE = $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/install.log";
$LOG_FILE_TMP = $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/install_tmp.log";
$LOG_FILE = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/install.log";
$LOG_FILE_TMP = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/install_tmp.log";
if ($sText == '' && $sErrorCode == '')
{
return;
}
$old_abort_status = ignore_user_abort(true);
@@ -427,18 +535,20 @@ class BXInstallServices
return false;
}
$iSeekLen = intval($log_size-$MAX_LOG_SIZE/2.0);
$iSeekLen = intval($log_size - $MAX_LOG_SIZE / 2.0);
fseek($fp, $iSeekLen);
do
{
$data = fread($fp, $READ_PSIZE);
if ($data == '')
{
break;
}
@fwrite($fp1, $data);
}
while(true);
while (true);
@fclose($fp);
@fclose($fp1);
@@ -453,7 +563,7 @@ class BXInstallServices
{
if (flock($fp, LOCK_EX))
{
@fwrite($fp, date("Y-m-d H:i:s")." - ".$sErrorCode." - ".$sText."\n");
@fwrite($fp, date("Y-m-d H:i:s") . " - " . $sErrorCode . " - " . $sText . "\n");
@fflush($fp);
@flock($fp, LOCK_UN);
@fclose($fp);
@@ -462,14 +572,12 @@ class BXInstallServices
ignore_user_abort($old_abort_status);
}
public static function ParseForSql($sqlString)
{
}
public static function GetConfigWizard()
{
if (isset($GLOBALS["arWizardConfig"]) && array_key_exists("demoWizardName", $GLOBALS["arWizardConfig"]) && CWizardUtil::CheckName($GLOBALS["arWizardConfig"]["demoWizardName"]))
{
return $GLOBALS["arWizardConfig"]["demoWizardName"];
}
return false;
}
@@ -477,10 +585,14 @@ class BXInstallServices
public static function GetDemoWizard()
{
if (!defined("B_PROLOG_INCLUDED"))
define("B_PROLOG_INCLUDED",true);
{
define("B_PROLOG_INCLUDED", true);
}
if(($demo = self::GetConfigWizard()) !== false)
if (($demo = self::GetConfigWizard()) !== false)
{
return $demo;
}
$arWizards = CWizardUtil::GetWizardList();
@@ -497,12 +609,18 @@ class BXInstallServices
$position = strpos($wizardID, ":");
if ($position !== false)
{
$wizardName = substr($wizardID, $position + 1);
}
else
{
$wizardName = $wizardID;
}
if ($wizardName == "demo")
{
return $wizardID;
}
}
return $defaultWizard;
@@ -511,27 +629,35 @@ class BXInstallServices
public static function GetWizardCharset($wizardName)
{
if (!defined("B_PROLOG_INCLUDED"))
define("B_PROLOG_INCLUDED",true);
{
define("B_PROLOG_INCLUDED", true);
}
$wizardPath = CWizardUtil::GetRepositoryPath().CWizardUtil::MakeWizardPath($wizardName);
if (!file_exists($_SERVER["DOCUMENT_ROOT"].$wizardPath."/.description.php"))
$wizardPath = CWizardUtil::GetRepositoryPath() . CWizardUtil::MakeWizardPath($wizardName);
if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $wizardPath . "/.description.php"))
{
return false;
}
$arWizardDescription = Array();
include($_SERVER["DOCUMENT_ROOT"].$wizardPath."/.description.php");
$arWizardDescription = [];
include($_SERVER["DOCUMENT_ROOT"] . $wizardPath . "/.description.php");
if (array_key_exists("CHARSET", $arWizardDescription) && $arWizardDescription["CHARSET"] <> '')
{
return $arWizardDescription["CHARSET"];
}
return false;
}
public static function IsShortInstall()
{
$dbconnPath = $_SERVER["DOCUMENT_ROOT"].BX_PERSONAL_ROOT."/php_interface/dbconn.php";
$dbconnPath = $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/php_interface/dbconn.php";
if (!file_exists($dbconnPath))
{
return false;
}
@include($dbconnPath);
@@ -551,19 +677,23 @@ class BXInstallServices
{
$bCgi = (stristr(php_sapi_name(), "cgi") !== false);
$bFastCgi = ($bCgi && (array_key_exists('FCGI_ROLE', $_SERVER) || array_key_exists('FCGI_ROLE', $_ENV)));
if($bCgi && !$bFastCgi)
header("Status: ".$status);
if ($bCgi && !$bFastCgi)
{
header("Status: " . $status);
}
else
header($_SERVER["SERVER_PROTOCOL"]." ".$status);
{
header($_SERVER["SERVER_PROTOCOL"] . " " . $status);
}
}
public static function LocalRedirect($url)
{
global $HTTP_HOST, $SERVER_PORT;
$url = str_replace("&amp;","&",$url);
$url = str_replace ("\r", "", $url);
$url = str_replace ("\n", "", $url);
$url = str_replace("&amp;", "&", $url);
$url = str_replace("\r", "", $url);
$url = str_replace("\n", "", $url);
BXInstallServices::SetStatus("302 Found");
@@ -578,10 +708,12 @@ class BXInstallServices
}
else
{
if ($SERVER_PORT!="80" && $SERVER_PORT != 443 && $SERVER_PORT>0 && strpos($HTTP_HOST, ":".$SERVER_PORT) <= 0)
$HTTP_HOST .= ":".$SERVER_PORT;
if ($SERVER_PORT != "80" && $SERVER_PORT != 443 && $SERVER_PORT > 0 && strpos($HTTP_HOST, ":" . $SERVER_PORT) <= 0)
{
$HTTP_HOST .= ":" . $SERVER_PORT;
}
$protocol = ($_SERVER["SERVER_PORT"]==443 || strtolower($_SERVER["HTTPS"]) == "on" ? "https" : "http");
$protocol = ($_SERVER["SERVER_PORT"] == 443 || strtolower($_SERVER["HTTPS"]) == "on" ? "https" : "http");
header("Request-URI: $protocol://$HTTP_HOST$url");
header("Content-Location: $protocol://$HTTP_HOST$url");
@@ -590,11 +722,12 @@ class BXInstallServices
exit;
}
public static function SetSession()
{
if (!function_exists("session_start"))
{
return false;
}
session_start();
$_SESSION["session_check"] = "Y";
@@ -605,17 +738,19 @@ class BXInstallServices
public static function CheckSession()
{
if (!function_exists("session_start"))
{
return false;
}
session_start();
return ( isset($_SESSION["session_check"]) && $_SESSION["session_check"] == "Y" );
return (isset($_SESSION["session_check"]) && $_SESSION["session_check"] == "Y");
}
public static function GetWizardsSettings()
{
$arWizardConfig = [];
$configFile = $_SERVER["DOCUMENT_ROOT"]."/install.config";
$configFile = $_SERVER["DOCUMENT_ROOT"] . "/install.config";
require_once($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/classes/general/xml.php');
@@ -647,109 +782,13 @@ class BXInstallServices
return $arWizardConfig;
}
public static function GetRegistrationKey($lic_key_user_name, $lic_key_user_surname, $lic_key_email, $DBType)
public static function GetRegistrationUrl(): string
{
$lic_site = $_SERVER["HTTP_HOST"];
if($lic_site == '')
$lic_site = "localhost";
$arClientModules = Array();
$handle = @opendir($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules");
if ($handle)
return match (LANGUAGE_ID)
{
while (false !== ($dir = readdir($handle)))
{
if (is_dir($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/".$dir)
&& $dir!="." && $dir!="..")
{
$module_dir = $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/".$dir;
if (file_exists($module_dir."/install/index.php"))
{
$arClientModules[] = $dir;
}
}
}
closedir($handle);
}
$lic_edition = serialize($arClientModules);
if(LANGUAGE_ID == "ru")
$host = "www.1c-bitrix.ru";
else
$host = "www.bitrixsoft.com";
$maxUsers = 0;
$path = "/bsm_register_key.php";
$query = "sur_name=$lic_key_user_surname&first_name=$lic_key_user_name&email=$lic_key_email&site=$lic_site&modules=".urlencode($lic_edition)."&db=$DBType&lang=".LANGUAGE_ID."&bx=Y&max_users=".$maxUsers;
if(defined("install_license_type"))
$query .= "&cp_type=".install_license_type;
if(defined("install_edition"))
$query .= "&edition=".install_edition;
$page_content = "";
$fp = @fsockopen("ssl://" . $host, 443, $errnum, $errstr, 30);
if ($fp)
{
fputs($fp, "POST {$path} HTTP/1.1\r\n");
fputs($fp, "Host: {$host}\r\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded; charset=\"UTF-8\"\r\n");
fputs($fp, "User-Agent: bitrixKeyReq\r\n");
fputs($fp, "Content-length: " . strlen($query) . "\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $query."\r\n\r\n");
$headersEnded = 0;
while(!feof($fp))
{
$returned_data = fgets($fp, 128);
if($returned_data=="\r\n")
{
$headersEnded = 1;
}
if($headersEnded==1)
{
$page_content .= htmlspecialcharsbx($returned_data);
}
}
fclose($fp);
}
$arContent = explode("\n", $page_content);
$bOk = false;
$key = "";
foreach($arContent as $v)
{
if($v == "OK")
$bOk = true;
if(strlen($v) > 10)
$key = trim($v);
}
if($bOk && $key <> '')
return $key;
return false;
}
public static function CreateLicenseFile($licenseKey)
{
if ($licenseKey == '')
$licenseKey = "DEMO";
$filePath = $_SERVER["DOCUMENT_ROOT"]."/bitrix/license_key.php";
if (!$fp = @fopen($filePath, "wb"))
return false;
$fileContent = "<"."? \$"."LICENSE_KEY = \"".addslashes($licenseKey)."\"; ?".">";
if (!fwrite($fp, $fileContent))
return false;
@fclose($fp);
return true;
'en' => "https://store.bitrix24.com/profile/license-keys.php",
'de' => "https://store.bitrix24.de/profile/license-keys.php",
default => "https://www.1c-bitrix.ru/support/key_info.php",
};
}
}
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,5 @@
<?php
use Bitrix\Main\Text\HtmlFilter;
use Bitrix\Main\Grid\Editor\Types;
use Bitrix\Main\Grid\Panel;
use Bitrix\Main\Grid\Context;
@@ -11,6 +10,9 @@ use Bitrix\Main\UI\Filter;
use Bitrix\Main\Web\Uri;
use Bitrix\Main\Web\Json;
use Bitrix\UI\Toolbar\ButtonLocation;
use Bitrix\Main\ORM\Query\Query;
use Bitrix\Main\ORM\Data\DataManager;
use Bitrix\Main\ORM\Fields\ExpressionField;
class CAdminUiList extends CAdminList
{
@@ -1837,7 +1839,7 @@ class CAdminUiResult extends CAdminResult
/**
* @param string $tableId
* @param string $className Bitrix\Main\Entity\DataManager class name.
* @param string $className DataManager class name.
* @param array $getListParams
*/
public static function setNavParams($tableId, $className, &$getListParams)
@@ -1863,10 +1865,10 @@ class CAdminUiResult extends CAdminResult
if (class_exists($className))
{
/**
* @var Bitrix\Main\Entity\DataManager $className
* @var DataManager $className
*/
$countQuery = new Bitrix\Main\Entity\Query($className::getEntity());
$countQuery->addSelect(new Bitrix\Main\Entity\ExpressionField("CNT", "COUNT(1)"));
$countQuery = new Query($className::getEntity());
$countQuery->addSelect(new ExpressionField("CNT", "COUNT(1)"));
$countQuery->setFilter($getListParams["filter"]);
$totalCount = $countQuery->setLimit(null)->setOffset(null)->exec()->fetch();
unset($countQuery);
@@ -479,7 +479,6 @@ $MESS["SC_STOP_TEST_B"] = "Stop";
$MESS["SC_STRLEN_FAIL_PHP56"] = "String functions work incorrectly. ";
$MESS["SC_SUBTITLE_DISK"] = "Checking the disk access";
$MESS["SC_SUBTITLE_DISK_DESC"] = "The site scripts must have write access to site files. This is required for proper functioning of the file manager, file upload and the update system that is used to keep the site kernel up-to-date.";
$MESS["SC_SUPPORT_COMMENT"] = "If you have problems sending the message, please use the contact form at our site:";
$MESS["SC_SWF_WARN"] = "SWF objects may not run.";
$MESS["SC_SYSTEM_TEST"] = "System check";
$MESS["SC_TABLES_NEED_REPAIR"] = "Table integrity damaged, they need to be fixed.";
@@ -493,7 +492,6 @@ $MESS["SC_TABLE_ROW_FORMAT_ERRORS"] = "Not all of the InnoDB tables are in Dynam
$MESS["SC_TABLE_ROW_FORMAT_NA"] = "Not checked due to table storage format errors.";
$MESS["SC_TABLE_SIZE_WARN"] = "The size of the &quot;#TABLE#&quot; table is possibly too large (#SIZE# M).";
$MESS["SC_TAB_2"] = "Access check";
$MESS["SC_TAB_5"] = "Technical support";
$MESS["SC_TESTING"] = "Now checking...";
$MESS["SC_TESTING1"] = "Testing...";
$MESS["SC_TEST_CONFIG"] = "Configuration Check";
@@ -503,14 +501,6 @@ $MESS["SC_TEST_START"] = "Start test";
$MESS["SC_TEST_SUCCESS"] = "Success";
$MESS["SC_TEST_WARN"] = "The server configuration report is about to be collected.
If an error occurs, please uncheck the \"Send Test Log\" option and try again.";
$MESS["SC_TIK_ADD_TEST"] = "Send Test Log";
$MESS["SC_TIK_DESCR"] = "Problem description";
$MESS["SC_TIK_DESCR_DESCR"] = "sequence of operations that caused the error, error description,...";
$MESS["SC_TIK_LAST_ERROR"] = "Last error text";
$MESS["SC_TIK_LAST_ERROR_ADD"] = "attached";
$MESS["SC_TIK_SEND_MESS"] = "Send message";
$MESS["SC_TIK_SEND_SUCCESS"] = "The message has been sent successfully. Please check your inbox #EMAIL# after some time for confirmation of the message receipt from the technical support system.";
$MESS["SC_TIK_TITLE"] = "Send message to the technical support system";
$MESS["SC_TIME_DIFF"] = "The time is off by #VAL# seconds.";
$MESS["SC_TMP_FOLDER_PERMS"] = "Insufficient permission to write to temporary folder.";
$MESS["SC_T_APACHE"] = "Web server modules";
@@ -31,24 +31,16 @@ $MESS["SUP_INITIAL"] = "Initialising...";
$MESS["SUP_LICENSE_KEY"] = "License key";
$MESS["SUP_MARKET_SUBSCRIPTION"] = "Bitrix24.Market Plus is active till:";
$MESS["SUP_MARKET_SUBSCRIPTION_DEMO"] = "Market Plus trial period is valid till:";
$MESS["SUP_MSSQL_L4111"] = "You are using MS SQL #VERS#, but the system requires version 10.0 or higher (Microsoft SQL Server 2008 or higher). Please update your MS SQL installation or contact the techsupport.";
$MESS["SUP_MSSQL_LNATIVE"] = "You are using an ODBC driver to connect with the MSSQL server. Please switch to the SQLSRV expansion or refer to technical support.";
$MESS["SUP_MYSQL_COLL_ERROR"] = "Collation of your MySQL database '#CD#' does not match that of the connection '#CC#'.";
$MESS["SUP_MYSQL_L560"] = "As of June 30, 2019 only limited support will be provided for our products running on MySql versions below 5.6. MySql 5.7 or higher is recommended. You are currently using MySql #VERS#. Please update your MySql installation or contact your hosting service provider for assistance.";
$MESS["SUP_MYSQL_L4111"] = "You are using MySql version #VERS#, but the system requires version 5.6.0 or higher. Please update your MySql installation or contact the technical support.";
$MESS["SUP_MYSQL_LCP_ERROR"] = "Your MySQL database has '#CP1#' encoding while the Site Update system requires '#CP#' encoding. Please contact your MySQL administrator to run the following database query: alter database #DB# default character set #CP#";
$MESS["SUP_MYSQL_LERR_V"] = "You are using #DB# version #VERS#, but the system requires version #REQ# or higher. Please update your #DB# installation or contact the technical support.";
$MESS["SUP_MYSQL_LM1010"] = "As of June 30, 2019 only limited support will be provided for our products running on MariaDB versions below 10.0.5. You are currently using MariaDB #VERS#. Please update your MySql installation or contact your hosting service provider for assistance.";
$MESS["SUP_MYSQL_LWARN_V"] = "As of #DATE# only limited support will be provided for our products running on #DB# versions below #REQ#. #DB# #BEST_VERS# or higher is recommended. You are currently using #DB# #VERS#. Please update your #DB# installation or contact your hosting service provider for assistance.";
$MESS["SUP_NEW_UPDATE_SYSTEM_HINT"] = "The update system needs to be updated.";
$MESS["SUP_NO_DEFAULT_CHARSET_ERROR"] = "The default_charset option is not defined in your PHP. Please set the correct option value or contact your hosting service provider's helpdesk.";
$MESS["SUP_NO_MBSTRING"] = "As of May 01, 2020 the mbstring extension is required to use multibyte strings. This extension is not installed on your system. Please install or enable the extension, or contact your hosting provider technical support.";
$MESS["SUP_NO_MBSTRING_ERROR"] = "PHP mbstring extension to handle multi-byte strings is not installed. Please install the extension or contact your hosting service provider's helpdesk.";
$MESS["SUP_NO_MS_ORACLE"] = "As of January 1, 2017 we provide only limited support for Oracle Database and MS SQL Server based products. There will be no updates for these platforms. Should you have any questions, please contact our helpdesk.";
$MESS["SUP_PHP_L439"] = "You are using PHP version #VERS#, but the system requires version 5.3.0 or higher. Please update your PHP installation or contact the technical support.";
$MESS["SUP_PHP_L560"] = "As of January 1, 2018 we will no longer support PHP versions older than 5.6. You are currently using PHP version #VERS#. Please update your PHP version or contact your hosting provider's helpdesk. If you don't do that, your Bitrix24 installation may not function properly.";
$MESS["SUP_PHP_L560F"] = "You are using PHP version #VERS#, but the system requires version 5.6.0 or higher. Please update your PHP installation or contact the technical support.";
$MESS["SUP_PHP_L710"] = "As of June 30, 2019 only limited support will be provided for our products running on PHP versions below 7.1. You are currently using PHP #VERS#. Please update your PHP installation or contact your hosting service provider for assistance.";
$MESS["SUP_PHP_LERR_F"] = "You are using PHP version #VERS#, but the system requires version #REQ# or higher. Please update your PHP installation or contact the technical support.";
$MESS["SUP_PHP_LERR_F_NEW"] = "Your current PHP version is #VERS#. This version is outdated and may contain security vulterabilities. The system requires version #REQ# or higher. The latest stable build of PHP is recommended. <br>Please follow these steps: <br>(1) if the page shows MySQL version warning, update MySQL to the latest stable version, <br>(2) update your Bitrix24, <br>(3) update PHP or contact your hosting service provider's helpdesk.";
$MESS["SUP_PHP_LWARN_F"] = "As of #DATE# only limited support will be provided for our products running on PHP versions below #REQ#. PHP #BEST_VERS# or higher is recommended. You are currently using PHP #VERS#. Please update your PHP installation or contact your hosting service provider for assistance.";
@@ -78,50 +70,6 @@ $MESS["SUP_SUA_DOMAIN"] = "https://store.bitrix24.com/profile/license-keys.php";
$MESS["SUP_SUBA_ACTIVATE"] = "Activate license key";
$MESS["SUP_SUBA_ACTIVATE_BUTTON"] = "Activate key";
$MESS["SUP_SUBA_ACTIVATE_HINT"] = "You have to activate your license key before using the update system";
$MESS["SUP_SUBA_CONFIRM_ERROR"] = "Required fields not entered!";
$MESS["SUP_SUBA_FE_CONF_ERR"] = "The password confirmation does not match the password";
$MESS["SUP_SUBA_FE_CONTACT"] = "Contact information";
$MESS["SUP_SUBA_FE_CONTACT_EMAIL"] = "E-mail";
$MESS["SUP_SUBA_FE_CONTACT_PERSON"] = "Contact person";
$MESS["SUP_SUBA_FE_CONTACT_PHONE"] = "Phone";
$MESS["SUP_SUBA_FE_EMAIL"] = "Contact e-mail";
$MESS["SUP_SUBA_FE_ERRGEN"] = "Error activating the key";
$MESS["SUP_SUBA_FE_FNAME"] = "First name";
$MESS["SUP_SUBA_FE_LNAME"] = "Last name";
$MESS["SUP_SUBA_FE_LOGIN"] = "User login";
$MESS["SUP_SUBA_FE_NAME"] = "Company (or individual person) name";
$MESS["SUP_SUBA_FE_PASSWORD"] = "Password";
$MESS["SUP_SUBA_FE_PASSWORD_CONF"] = "Confirm password";
$MESS["SUP_SUBA_FE_PHONE"] = "Phone";
$MESS["SUP_SUBA_FE_PROMT"] = "Fields with errors";
$MESS["SUP_SUBA_FE_URI"] = "Site address";
$MESS["SUP_SUBA_REGINFO"] = "Registration information";
$MESS["SUP_SUBA_RI_CONTACT"] = "Contact information";
$MESS["SUP_SUBA_RI_CONTACT1"] = "Address and/or other contacts of the product copy owner";
$MESS["SUP_SUBA_RI_CONTACT_EMAIL"] = "E-mail address for technical contacts";
$MESS["SUP_SUBA_RI_CONTACT_EMAIL1"] = "E-mail address for technical contacts, registration information delivery and techsupport subscription reminders";
$MESS["SUP_SUBA_RI_CONTACT_PERSON"] = "Contact person responsible for this product copy";
$MESS["SUP_SUBA_RI_CONTACT_PERSON1"] = "First and last names of a person for legal contacts";
$MESS["SUP_SUBA_RI_CONTACT_PHONE"] = "Contact person phone";
$MESS["SUP_SUBA_RI_CONTACT_PHONE1"] = "Contact person phone";
$MESS["SUP_SUBA_RI_EMAIL"] = "E-mail address for licensing and usage contacts";
$MESS["SUP_SUBA_RI_EMAIL1"] = "This e-mail address can be used for correspondence regarding licensing and usage issues";
$MESS["SUP_SUBA_RI_NAME"] = "Key owner (company name or person)";
$MESS["SUP_SUBA_RI_NAME1"] = "The name of company or person who owns this product copy";
$MESS["SUP_SUBA_RI_PHONE"] = "Phone number of the product copy owner";
$MESS["SUP_SUBA_RI_PHONE1"] = "Phone number of the product copy owner (company or person)";
$MESS["SUP_SUBA_RI_URI"] = "Site address";
$MESS["SUP_SUBA_RI_URI1"] = "All domains that the site will operate, including those under construction";
$MESS["SUP_SUBA_UI_CREATE"] = "Create a user at <a href=\"https://store.bitrix24.com/profile/index.php?register=yes\" target=\"_blank\">store.bitrix24.com</a>";
$MESS["SUP_SUBA_UI_EXIST"] = "I already have a user account;";
$MESS["SUP_SUBA_UI_HINT"] = "If you are not registered at <a href=\"https://store.bitrix24.com\" target=\"_blank\">store.bitrix24.com</a>, please make sure that the \"Create user\" option is checked, and enter your information (your first and last names, login and password) in the form fields. Registering at store.bitrix24.com enables you to use the Helpdesk service on our <a href=\"https://helpdesk.bitrix24.com/ticket.php\" target=\"_blank\">site</a>, or via the support chat inside your system.";
$MESS["SUP_SUBA_UI_LASTNAME"] = "Last name";
$MESS["SUP_SUBA_UI_LOGIN"] = "Login (at least 3 symbols)";
$MESS["SUP_SUBA_UI_LOGIN_EXIST"] = "Existing user login";
$MESS["SUP_SUBA_UI_PASSWORD"] = "Password";
$MESS["SUP_SUBA_UI_PASSWORD_CONF"] = "Confirm password";
$MESS["SUP_SUBA_USERINFO"] = "Username at the Bitrix company site";
$MESS["SUP_SUBA__UI_NAME"] = "First name";
$MESS["SUP_SUBI_CHECK"] = "Last check for updates";
$MESS["SUP_SUBI_UPD"] = "Updates have been installed";
$MESS["SUP_SUBK_BUTTON"] = "Enter license key";
@@ -1,14 +1,4 @@
<?
$MESS ['SUPA_AERR_NAME'] = "Please enter the name of the company that owns the key";
$MESS ['SUPA_AERR_EMAIL'] = "Please enter the contact e-mail";
$MESS ['SUPA_AERR_EMAIL1'] = "Please check the e-mail address correctness";
$MESS ['SUPA_AERR_URI'] = "Please enter the address of the site that will be used with the key";
$MESS ['SUPA_AERR_FNAME'] = "Please enter the first name of a user for whom an account at <a href=\"https://www.bitrixsoft.com\">www.bitrixsoft.com</a> will be created";
$MESS ['SUPA_AERR_LNAME'] = "Please enter the last name of a user for whom an account at <a href=\"https://www.bitrixsoft.com\">www.bitrixsoft.com</a> will be created";
$MESS ['SUPA_AERR_LOGIN'] = "Please enter the login for use at <a href=\"https://www.bitrixsoft.com\">www.bitrixsoft.com</a>";
$MESS ['SUPA_AERR_LOGIN1'] = "Login name at <a href=\"https://www.bitrixsoft.com\">www.bitrixsoft.com</a> must contain at least 3 symbols";
$MESS ['SUPA_AERR_PASSW'] = "Please enter the password for use at <a href=\"https://www.bitrixsoft.com\">www.bitrixsoft.com</a>";
$MESS ['SUPA_AERR_PASSW_CONF'] = "The password and the password confirmation are different.";
$MESS ['SUPA_ASE_NO_LIST'] = "Cannot retrieve the list of modules";
$MESS ['SUPA_ASE_SOURCES'] = "Cannot download the source code";
$MESS ['SUPA_ASE_PACK'] = "Cannot extract files from archive";
@@ -20,9 +10,4 @@ $MESS ['SUPA_ACE_ACT'] = "Error trying to activate the coupon";
$MESS ['SUPA_ASTE_FLAG'] = "Cannot determine the beta version installation mode";
$MESS ['SUPA_AME_EMAIL'] = "The subscription e-mail address is missing";
$MESS ['SUPA_AME_SUBSCR'] = "Subscription error";
$MESS ['SUPA_AERR_PHONE'] = "Please type the phone number of the product copy owner";
$MESS ['SUPA_AERR_CONTACT_PERSON'] = "Please type the first and last names of a contact person";
$MESS ['SUPA_AERR_CONTACT_EMAIL'] = "Please type the e-mail address of a contact person";
$MESS ['SUPA_AERR_CONTACT_EMAIL1'] = "Please check the e-mail address of a contact person for correctness";
$MESS ['SUPA_AERR_CONTACT_PHONE'] = "Please type the phone number of a contact person";
?>
@@ -15,9 +15,7 @@ $MESS["SUP_HISTORY"] = "Update History";
$MESS["SUP_INITIAL"] = "Initializing...";
$MESS["SUP_LICENSE_KEY"] = "License Key";
$MESS["SUP_LICENSE_KEY_MD5"] = "License Key Hash (MD5)";
$MESS["SUP_MYSQL_L4111"] = "You are using MySQL version #VERS# while the system requires version 5.0.0 or higher. Please update your MySQL installation or contact the technical support.";
$MESS["SUP_MYSQL_LCP_ERROR"] = "Your MySQL database runs with '#CP1#' encoding while SiteUpdate requires '#CP#' encoding. Please contact your MySQL administrator to run the following database query: alter database #DB# default character set #CP#";
$MESS["SUP_PHP_L439"] = "You are using PHP version #VERS# while the system requires version 5.3.0 or higher. Please update your PHP installation or contact the technical support.";
$MESS["SUP_REGISTERED"] = "Registered For:";
$MESS["SUP_SERVER"] = "Update Server:";
$MESS["SUP_SERVER_ANSWER"] = "Update server response";
@@ -33,53 +31,6 @@ $MESS["SUP_SUAC_NO_COUP"] = "Please provide the coupon code to activate";
$MESS["SUP_SUAC_SUCCESS"] = "The module has been added successfully.";
$MESS["SUP_SUAC_TEXT"] = "Please activate your coupon to add a new solution.";
$MESS["SUP_SUAC_TEXT2"] = "Enter the coupon code:";
$MESS["SUP_SUBA_ACTIVATE"] = "Licence Key Activation ";
$MESS["SUP_SUBA_ACTIVATE_BUTTON"] = "Activate Key";
$MESS["SUP_SUBA_ACTIVATE_HINT"] = "You must activate your license key before using the update system.";
$MESS["SUP_SUBA_CONFIRM_ERROR"] = "Some required fields are missing!";
$MESS["SUP_SUBA_FE_CONF_ERR"] = "The password confirmation does not match the password";
$MESS["SUP_SUBA_FE_CONTACT"] = "Contact Information";
$MESS["SUP_SUBA_FE_CONTACT_EMAIL"] = "E-mail";
$MESS["SUP_SUBA_FE_CONTACT_PERSON"] = "Contact Person";
$MESS["SUP_SUBA_FE_CONTACT_PHONE"] = "Phone";
$MESS["SUP_SUBA_FE_EMAIL"] = "Contact e-mail";
$MESS["SUP_SUBA_FE_ERRGEN"] = "Key activation error";
$MESS["SUP_SUBA_FE_FNAME"] = "User Name";
$MESS["SUP_SUBA_FE_LNAME"] = "User Last Name";
$MESS["SUP_SUBA_FE_LOGIN"] = "User Login";
$MESS["SUP_SUBA_FE_NAME"] = "Company/Owner Name";
$MESS["SUP_SUBA_FE_PASSWORD"] = "Password";
$MESS["SUP_SUBA_FE_PASSWORD_CONF"] = "Confirm Password";
$MESS["SUP_SUBA_FE_PHONE"] = "Phone";
$MESS["SUP_SUBA_FE_PROMT"] = "The following fields contain errors:";
$MESS["SUP_SUBA_FE_URI"] = "Site Address";
$MESS["SUP_SUBA_REGINFO"] = "Registration Information";
$MESS["SUP_SUBA_RI_CONTACT"] = "Other important contacts:";
$MESS["SUP_SUBA_RI_CONTACT1"] = "Your address and other contact information you consider important.";
$MESS["SUP_SUBA_RI_CONTACT_EMAIL"] = "Contact person e-mail:";
$MESS["SUP_SUBA_RI_CONTACT_EMAIL1"] = "E-mail for contacts on technical issues, sending registration information and techsupport subscription renewal reminders.";
$MESS["SUP_SUBA_RI_CONTACT_PERSON"] = "Responsible contact person:";
$MESS["SUP_SUBA_RI_CONTACT_PERSON1"] = "Full name of a person responsible for the use of this product copy.";
$MESS["SUP_SUBA_RI_CONTACT_PHONE"] = "Contact person phone:";
$MESS["SUP_SUBA_RI_CONTACT_PHONE1"] = "Contact person phone";
$MESS["SUP_SUBA_RI_EMAIL"] = "Licensing and use contact e-mail:";
$MESS["SUP_SUBA_RI_EMAIL1"] = "An e-mail address of a company or private person for contacting about licensing and use.";
$MESS["SUP_SUBA_RI_NAME"] = "Full company or private person name";
$MESS["SUP_SUBA_RI_NAME1"] = "Company name or the first and last names of a person who owns this product copy.";
$MESS["SUP_SUBA_RI_PHONE"] = "The phone number of a product copy owner (company or person)";
$MESS["SUP_SUBA_RI_PHONE1"] = "The phone number of a product copy owner (company or person)";
$MESS["SUP_SUBA_RI_URI"] = "All domains that will be powered by Bitrix Site Manager including test domains";
$MESS["SUP_SUBA_RI_URI1"] = "All domains that will be powered by Bitrix Site Manager including test domains";
$MESS["SUP_SUBA_UI_CREATE"] = "I do not have an account at <a href=\"https://www.bitrixsoft.com\">www.bitrixsoft.com</a> and I want to create one";
$MESS["SUP_SUBA_UI_EXIST"] = "I already have a user account and want to use it to access the Helpdesk and Download site sections";
$MESS["SUP_SUBA_UI_HINT"] = "You can get access to <a href=\"https://www.bitrixsoft.com/support/\">techsupport service</a>, <a href=\"https://www.bitrixsoft.com/support/forum/forum7/\">private client forum</a>, and <a href=\"https://www.bitrixsoft.com/download/private/index.php\">download the system source codes</a> by creating an account at <a href=\"https://www.bitrixsoft.com\">www.bitrixsoft.com</a>:";
$MESS["SUP_SUBA_UI_LASTNAME"] = "Your Last Name";
$MESS["SUP_SUBA_UI_LOGIN"] = "Login (3 or more characters)";
$MESS["SUP_SUBA_UI_LOGIN_EXIST"] = "Existing user login";
$MESS["SUP_SUBA_UI_PASSWORD"] = "Password (6 or more characters)";
$MESS["SUP_SUBA_UI_PASSWORD_CONF"] = "Confirm Password";
$MESS["SUP_SUBA_USERINFO"] = "Bitrix Company Site User";
$MESS["SUP_SUBA__UI_NAME"] = "Your First Name";
$MESS["SUP_SUBI_CHECK"] = "Last update check";
$MESS["SUP_SUBI_UPD"] = "Updates installed";
$MESS["SUP_SUBK_BUTTON"] = "Submit License Key";
@@ -1,40 +1,76 @@
<?
$MESS["VRT_COMP_CAT_CONTENT"] = "Content";
$MESS["VRT_COMP_CAT_SERVICE"] = "Services";
$MESS["VRT_COMP_CAT_COMMUNICATION"] = "Communication";
$MESS["VRT_COMP_CAT_E-STORE"] = "e-Store";
$MESS["VRT_COMP_CAT_UTILITY"] = "Utilities";
$MESS["COMP_PROP_SEF_MODE"] = "Enable SEF (Search Engine Friendly Urls) support";
$MESS["COMP_PROP_SEF_MODE_NO"] = "No";
$MESS["COMP_PROP_SEF_MODE_YES"] = "Yes";
$MESS["COMP_PROP_SEF_FOLDER"] = "Folder for SEF (site-root-relative)";
$MESS["COMP_GROUP_SEF_MODE"] = "Page address management";
$MESS["COMP_PROP_SET_TITLE"] = "Set page title";
<?php
$MESS["COMP_GROUP_ADDITIONAL_SETTINGS"] = "Extended properties";
$MESS["COMP_GROUP_AJAX_SETTINGS"] = "AJAX mode settings";
$MESS["COMP_GROUP_BASE"] = "General parameters";
$MESS["COMP_GROUP_CACHE_SETTINGS"] = "Cache Settings";
$MESS["COMP_GROUP_COMPOSITE_SETTINGS"] = "Composite Site";
$MESS["COMP_GROUP_DATA_SOURCE"] = "Data source";
$MESS["COMP_GROUP_SEF_MODE"] = "Page address management";
$MESS["COMP_GROUP_URL_TEMPLATES"] = "URL templates";
$MESS["COMP_GROUP_USER_CONSENT"] = "User Consent";
$MESS["COMP_GROUP_VISUAL"] = "Visual appearance";
$MESS["COMP_NAME_TEMPLATE_JOHN_LLOYD_SMITH"] = "John Lloyd Smith";
$MESS["COMP_NAME_TEMPLATE_JOHN_L_SMITH"] = "John L. Smith";
$MESS["COMP_NAME_TEMPLATE_JOHN_SMITH"] = "John Smith";
$MESS["COMP_NAME_TEMPLATE_J_L_SMITH"] = "J. L. Smith";
$MESS["COMP_NAME_TEMPLATE_J_SMITH"] = "J. Smith";
$MESS["COMP_NAME_TEMPLATE_SMITH_COMMA_J"] = "Smith, L.";
$MESS["COMP_NAME_TEMPLATE_SMITH_COMMA_JOHN_LLOYD"] = "Smith, John Lloyd";
$MESS["COMP_NAME_TEMPLATE_SMITH_COMMA_J_L"] = "Smith, J.L.";
$MESS["COMP_NAME_TEMPLATE_SMITH_J"] = "Smith J.";
$MESS["COMP_NAME_TEMPLATE_SMITH_JOHN"] = "Smith John";
$MESS["COMP_NAME_TEMPLATE_SMITH_JOHN_LLOYD"] = "Smith John Lloyd";
$MESS["COMP_NAME_TEMPLATE_SMITH_J_L"] = "Smith J.L.";
$MESS["COMP_PARAM_CACHE_AUTO_OFF"] = "<span style=\"color:red\">off</span>";
$MESS["COMP_PARAM_CACHE_AUTO_ON"] = "on";
$MESS["COMP_PARAM_CACHE_MAN"] = "+ Managed";
$MESS["COMP_PARAM_CACHE_MANAGED_OFF"] = "<span style=\"color:red\">off</span>";
$MESS["COMP_PARAM_CACHE_MANAGED_ON"] = "on";
$MESS["COMP_PARAM_DATETIME_FORMAT_SITE"] = "Site date-time format";
$MESS["COMP_PARAM_DATE_FORMAT_SITE"] = "Site date format";
$MESS["COMP_PARAM_NAME_FORMAT_SITE"] = "Website format";
$MESS["COMP_PARAM_SEF_RULE"] = "SEF path template";
$MESS["COMP_PROP_AJAX_MODE"] = "Enable AJAX mode";
$MESS["COMP_PROP_AJAX_OPTIONS"] = "Additional settings";
$MESS["COMP_PROP_AJAX_OPTIONS_ADDITIONAL"] = "Additional ID";
$MESS["COMP_PROP_AJAX_OPTIONS_HISTORY"] = "Emulate browser navigation";
$MESS["COMP_PROP_AJAX_OPTIONS_JUMP"] = "Enable scrolling to component's top";
$MESS["COMP_PROP_AJAX_OPTIONS_SHADOW"] = "Enable shadowing";
$MESS["COMP_PROP_AJAX_OPTIONS_STYLE"] = "Enable styles loading";
$MESS["COMP_PROP_CACHE_NOTE"] = "Current Kernel settings: <b>autocache</b> is #AUTO_MODE#, <b>managed cache</b> is #MANAGED_MODE#. You can increase the cache lifetime if a component supports managed cache technology. <a href=\"/bitrix/admin/cache.php?lang=#LANG#\">Edit cache settings</a>.";
$MESS["COMP_PROP_CACHE_TIME"] = "Cache time (sec.)";
$MESS["COMP_PROP_CACHE_TYPE"] = "Cache type";
$MESS["COMP_PROP_CACHE_TYPE_AUTO"] = "Auto";
$MESS["COMP_PROP_CACHE_TYPE_YES"] = "Cache";
$MESS["COMP_PROP_CACHE_TYPE_NO"] = "Do not cache";
$MESS["COMP_GROUP_CACHE_SETTINGS"] = "Cache Settings";
$MESS["COMP_GROUP_URL_TEMPLATES"] = "URL templates";
$MESS["COMP_GROUP_VISUAL"] = "Visual appearance";
$MESS["COMP_GROUP_DATA_SOURCE"] = "Data source";
$MESS["COMP_GROUP_BASE"] = "General parameters";
$MESS["COMP_GROUP_AJAX_SETTINGS"] = "AJAX mode settings";
$MESS["COMP_PROP_AJAX_MODE"] = "Enable AJAX mode";
$MESS["COMP_PROP_AJAX_OPTIONS"] = "Additional settings";
$MESS["COMP_PROP_AJAX_OPTIONS_SHADOW"] = "Enable shadowing";
$MESS["COMP_PROP_AJAX_OPTIONS_JUMP"] = "Enable scrolling to component's top";
$MESS["COMP_PROP_AJAX_OPTIONS_STYLE"] = "Enable styles loading";
$MESS["COMP_PROP_AJAX_OPTIONS_HISTORY"] = "Emulate browser navigation";
$MESS["COMP_PROP_AJAX_OPTIONS_ADDITIONAL"] = "Additional ID";
$MESS["COMP_GROUP_USER_CONSENT"] = "User Consent";
$MESS["COMP_PROP_USER_CONSENT_USE"] = "Request Consent";
$MESS["COMP_PROP_CACHE_TYPE_YES"] = "Cache";
$MESS["COMP_PROP_COMPOSITE_FRAME_MODE"] = "Default component template vote";
$MESS["COMP_PROP_COMPOSITE_FRAME_MODE_AUTO"] = "Auto";
$MESS["COMP_PROP_COMPOSITE_FRAME_MODE_CONTRA"] = "Disable (requires manual configuration)";
$MESS["COMP_PROP_COMPOSITE_FRAME_MODE_PRO"] = "Enable";
$MESS["COMP_PROP_COMPOSITE_FRAME_TYPE"] = "Component content";
$MESS["COMP_PROP_COMPOSITE_FRAME_TYPE_AUTO"] = "Auto";
$MESS["COMP_PROP_COMPOSITE_FRAME_TYPE_DYNAMIC_WITHOUT_STUB"] = "Dynamic content without stub";
$MESS["COMP_PROP_COMPOSITE_FRAME_TYPE_DYNAMIC_WITH_STUB"] = "Dynamic content with stub";
$MESS["COMP_PROP_COMPOSITE_FRAME_TYPE_DYNAMIC_WITH_STUB_LOADING"] = "Dynamic content with loader";
$MESS["COMP_PROP_COMPOSITE_FRAME_TYPE_STATIC"] = "Static";
$MESS["COMP_PROP_SEF_FOLDER"] = "Folder for SEF (site-root-relative)";
$MESS["COMP_PROP_SEF_MODE"] = "Enable SEF (Search Engine Friendly Urls) support";
$MESS["COMP_PROP_SEF_MODE_NO"] = "No";
$MESS["COMP_PROP_SEF_MODE_YES"] = "Yes";
$MESS["COMP_PROP_SET_TITLE"] = "Set page title";
$MESS["COMP_PROP_USER_CONSENT_ID"] = "Consent";
$MESS["COMP_PROP_USER_CONSENT_IDS"] = "Consents";
$MESS["COMP_PROP_USER_CONSENT_ID_DEF"] = "(not set)";
$MESS["COMP_PROP_USER_CONSENT_IS_CHECKED"] = "Checkbox is ticked by default";
$MESS["COMP_PROP_USER_CONSENT_IS_CHECKED_WITH_NAME"] = "\"#NAME#\" is сhecked by default";
$MESS["COMP_PROP_USER_CONSENT_IS_LOADED"] = "Show Consent text automatically";
$MESS["COMP_PROP_USER_CONSENT_REQUIRED_WITH_NAME"] = "\"#NAME#\" is required";
$MESS["COMP_PROP_USER_CONSENT_USE"] = "Request Consent";
$MESS["VRT_COMP_CAT_COMMUNICATION"] = "Communication";
$MESS["VRT_COMP_CAT_CONTENT"] = "Content";
$MESS["VRT_COMP_CAT_E-STORE"] = "e-Store";
$MESS["VRT_COMP_CAT_SERVICE"] = "Services";
$MESS["VRT_COMP_CAT_UTILITY"] = "Utilities";
$MESS["comp_util_err1"] = "Empty component name";
$MESS["comp_util_err2"] = "'#NAME#' is not a component";
$MESS["comp_util_err3"] = "Incorrect name for the namespace '#NAME#'";
@@ -47,37 +83,3 @@ $MESS["comp_util_err9"] = "Template with the name '#T_NAME#' for the component '
$MESS["comp_util_err10"] = "Template for the target site is not specified";
$MESS["comp_util_err11"] = "Component template can not be copied to the same site template with the same name";
$MESS["comp_util_err12"] = "Template '#NAME#' already exists";
$MESS["COMP_NAME_TEMPLATE_SMITH_JOHN"] = "Smith John";
$MESS["COMP_NAME_TEMPLATE_SMITH_JOHN_LLOYD"] = "Smith John Lloyd";
$MESS["COMP_NAME_TEMPLATE_SMITH_COMMA_JOHN_LLOYD"] = "Smith, John Lloyd";
$MESS["COMP_NAME_TEMPLATE_JOHN_LLOYD_SMITH"] = "John Lloyd Smith";
$MESS["COMP_NAME_TEMPLATE_J_L_SMITH"] = "J. L. Smith";
$MESS["COMP_NAME_TEMPLATE_J_SMITH"] = "J. Smith";
$MESS["COMP_NAME_TEMPLATE_SMITH_J"] = "Smith J.";
$MESS["COMP_NAME_TEMPLATE_SMITH_J_L"] = "Smith J.L.";
$MESS["COMP_NAME_TEMPLATE_SMITH_COMMA_J"] = "Smith, L.";
$MESS["COMP_NAME_TEMPLATE_SMITH_COMMA_J_L"] = "Smith, J.L.";
$MESS["COMP_NAME_TEMPLATE_JOHN_SMITH"] = "John Smith";
$MESS["COMP_NAME_TEMPLATE_JOHN_L_SMITH"] = "John L. Smith";
$MESS["COMP_PROP_CACHE_NOTE"] = "Current Kernel settings: <b>autocache</b> is #AUTO_MODE#, <b>managed cache</b> is #MANAGED_MODE#. You can increase the cache lifetime if a component supports managed cache technology. <a href=\"/bitrix/admin/cache.php?lang=#LANG#\">Edit cache settings</a>.";
$MESS["COMP_PARAM_CACHE_AUTO_ON"] = "on";
$MESS["COMP_PARAM_CACHE_AUTO_OFF"] = "<span style=\"color:red\">off</span>";
$MESS["COMP_PARAM_CACHE_MANAGED_ON"] = "on";
$MESS["COMP_PARAM_CACHE_MANAGED_OFF"] = "<span style=\"color:red\">off</span>";
$MESS["COMP_PARAM_CACHE_MAN"] = "+ Managed";
$MESS["COMP_PARAM_DATE_FORMAT_SITE"] = "Site date format";
$MESS["COMP_PARAM_DATETIME_FORMAT_SITE"] = "Site date-time format";
$MESS["COMP_PARAM_NAME_FORMAT_SITE"] = "Website format";
$MESS["COMP_PARAM_SEF_RULE"] = "SEF path template";
$MESS["COMP_GROUP_COMPOSITE_SETTINGS"] = "Composite Site";
$MESS["COMP_PROP_COMPOSITE_FRAME_MODE"] = "Default component template vote";
$MESS["COMP_PROP_COMPOSITE_FRAME_MODE_AUTO"] = "Auto";
$MESS["COMP_PROP_COMPOSITE_FRAME_MODE_PRO"] = "Enable";
$MESS["COMP_PROP_COMPOSITE_FRAME_MODE_CONTRA"] = "Disable (requires manual configuration)";
$MESS["COMP_PROP_COMPOSITE_FRAME_TYPE"] = "Component content";
$MESS["COMP_PROP_COMPOSITE_FRAME_TYPE_AUTO"] = "Auto";
$MESS["COMP_PROP_COMPOSITE_FRAME_TYPE_STATIC"] = "Static";
$MESS["COMP_PROP_COMPOSITE_FRAME_TYPE_DYNAMIC_WITH_STUB"] = "Dynamic content with stub";
$MESS["COMP_PROP_COMPOSITE_FRAME_TYPE_DYNAMIC_WITHOUT_STUB"] = "Dynamic content without stub";
$MESS["COMP_PROP_COMPOSITE_FRAME_TYPE_DYNAMIC_WITH_STUB_LOADING"] = "Dynamic content with loader";
?>
@@ -31,6 +31,9 @@ $MESS["MAIN_EVENTLOG_USER_DELETE"] = "User deletion";
$MESS["MAIN_EVENTLOG_USER_INFO"] = "Password change request";
$MESS["MAIN_EVENTLOG_USER_LOGIN"] = "Logon errors";
$MESS["MAIN_EVENTLOG_USER_LOGINBYHASH_FAILED"] = "Login with stored authorization failed";
$MESS["MAIN_EVENTLOG_USER_LOGIN_BLOCKED"] = "Banned user attempted login";
$MESS["MAIN_EVENTLOG_USER_LOGIN_INCORRECT_CAPTCHA"] = "Attempted login with invalid CAPTCHA";
$MESS["MAIN_EVENTLOG_USER_LOGIN_NOT_FOUND"] = "Unknown user attempted login";
$MESS["MAIN_EVENTLOG_USER_LOGOUT"] = "Logoff";
$MESS["MAIN_EVENTLOG_USER_PASSWORD_CHANGED"] = "User password change";
$MESS["MAIN_EVENTLOG_USER_PERMISSIONS_FAIL"] = "File access error";
@@ -51,11 +51,15 @@ $MESS["HELP_INST"] = "Install help section";
$MESS["HELP_INST_PROMT"] = "Documentation";
$MESS["INSTALL_DEVSRV"] = "Development only:";
$MESS["INSTALL_DEVSRV_NOTE"] = "This installation will be used only for development purpose; no real visitors will see it.";
$MESS["INST_ACTIVATE"] = "Activate license key:";
$MESS["INST_ACTIVATE_BTN"] = "Activate key";
$MESS["INST_ACTIVATE_NOTE"] = "Your key needs to be activated to receive updates. Complete the form on our site, and then proceed with the installation.";
$MESS["INST_ALLOW_CALL_REFERENCE"] = "The allow_call_time_pass_reference parameter should be set to 1";
$MESS["INST_CREATE_ADMIN"] = "Create Administrator Account";
$MESS["INST_ERROR_ACCESS_FILES"] = "Cannot read from or write to the following files/folders:";
$MESS["INST_ERROR_NOTICE"] = "Please retry the current installation step. Skip the current step if error repeats.";
$MESS["INST_ERROR_OCCURED"] = "Warning! Installation failed at the current step.";
$MESS["INST_ERR_ACTIVATE"] = "License key was not found or inactive. Please enter a correct key and click \"Activate key\" button.";
$MESS["INST_INDEX_ACCESS_ERROR2"] = "Error: Cannot write to /index.php";
$MESS["INST_INSTALL_COMPLETE"] = "Installation has been completed";
$MESS["INST_INSTALL_DATABASE"] = "database";
@@ -70,6 +74,7 @@ $MESS["INST_ORACLE_CHARSET_ERROR"] = "Error detecting database encoding";
$MESS["INST_ORACLE_NLS_LANG_ERROR"] = "NLS_LANG environment variable should be set to UTF-8 (e.g. NLS_LANG=english.utf8).";
$MESS["INST_ORACLE_UTF_ERROR"] = "To install the system with UTF-8 encoding, you need to have the following database settings: NLS_CHARACTERSET=AL32UTF8, NLS_NCHAR_CHARACTERSET=UTF8";
$MESS["INST_PRODUCT_INSTALL"] = "System Installation";
$MESS["INST_PRODUCT_UPDATE"] = "System update";
$MESS["INST_REMOVE_HELP"] = "Deleting help files";
$MESS["INST_REMOVE_TEMP_FILES"] = "Deleting temporary files";
$MESS["INST_RETRY_BUTTON"] = "Retry this step";
@@ -80,7 +85,11 @@ $MESS["INST_SESSION_SUPPORT"] = "session support";
$MESS["INST_SHORT_INSTALL_ERROR"] = "Error checking system requirements";
$MESS["INST_SHOW_WIZARD"] = "Run site creation wizard";
$MESS["INST_SKIP_BUTTON"] = "Skip this step";
$MESS["INST_STATUS_CHECK"] = "Checking for updates";
$MESS["INST_STATUS_FINISH"] = "Your system has been updated";
$MESS["INST_STATUS_UPGRADE"] = "Updating the update system";
$MESS["INST_TEXT_ERROR"] = "Error text";
$MESS["INST_UPDATE_VERSION"] = "Installing update #VER#";
$MESS["INST_UTF8_DEFAULT_ENCODING"] = "The values of the default_charset and mbstring.internal_encoding parameters don't match. It is recommended that you delete the mbstring.internal_encoding parameter.";
$MESS["INST_UTF8_NOT_SUPPORT"] = "UTF-8 is not supported by PHP (mbstring library is not configured)";
$MESS["INST_UTF8_RECOMENDATION2"] = "To install the system in UTF-8 encoding, you have to install the mbstring library and add the parameter default_charset=UTF-8.";

Some files were not shown because too many files have changed in this diff Show More