403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/skyweb24.popuppro/admin/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/skyweb24.popuppro/admin/skyweb24_popuppro.php
<? require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php");


use \Bitrix\Main\Application,
    Bitrix\Main\Page\Asset,
    Bitrix\Main\Request,
    Bitrix\Main\Localization\Loc,
    Bitrix\Sale\Internals;

Loc::loadMessages(__FILE__);
$module_id = 'skyweb24.popuppro';

if (!\Bitrix\Main\Loader::includeModule($module_id)) {
    require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php");
    \Skyweb24\Popuppro\Core\Informer::createInfo($module_id);
    require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php");
}
\Bitrix\Main\Loader::includeModule('iblock');




CJSCore::RegisterExt(
    'popuppro_admin',
    [
        'js'   => [
            "/bitrix/js/fileman/block_editor/dialog.js",
            "/bitrix/js/skyweb24.popuppro/admin/roulette.js",
            "/bitrix/js/skyweb24.popuppro/admin/Field.js",
            "/bitrix/js/skyweb24.popuppro/admin/preview.js",
            "/bitrix/js/skyweb24.popuppro/admin/slider.js",
            "/bitrix/js/skyweb24.popuppro/admin/button.js",
            "/bitrix/js/skyweb24.popuppro/admin/templates.js",
            "/bitrix/js/skyweb24.popuppro/admin/constructor-prize.js",
            "/bitrix/js/skyweb24.popuppro/admin/timer.js",
            "/bitrix/js/skyweb24.popuppro/script.js",
            "/bitrix/js/main/amcharts/3.3/amcharts.js",
            "/bitrix/js/main/amcharts/3.3/pie.js",
            "/bitrix/js/main/amcharts/3.3/funnel.min.js",
            "/bitrix/js/main/amcharts/3.3/serial.js",
            "/bitrix/js/main/amcharts/3.3/themes/light.js",
            "/bitrix/js/skyweb24.popuppro/amcharts_themes.js",
        ],
        "lang" => [
            "/bitrix/modules/skyweb24.popuppro/lang/ru/admin/skyweb24_popuppro.php"
        ],
        "css"  => [
            "/bitrix/css/skyweb24.popuppro/animation.css",
            "/bitrix/themes/.default/skyweb24.popuppro/styles.css",
            "/bitrix/css/main/font-awesome.min.css"
        ],
        'rel'  => [
            "jquery", "ajax", "fx", 'drag_drop', 'color_picker'
        ]
    ]
);
CJSCore::Init(['popuppro_admin']);



if (\Bitrix\Main\Loader::includeModule('catalog')) {
    CJSCore::Init(['core_condtree']);
}
else {
    CJSCore::Init(['core', 'date', 'window']);
    Asset::getInstance()->addJs('/bitrix/js/skyweb24.popuppro/core_tree.js');
    Asset::getInstance()->addString("<link href='/bitrix/themes/.default/skyweb24.popuppro/catalog_cond.css' rel='stylesheet' type='text/css'>");
    Asset::getInstance()->addString("<script type='text/javascript'>(window.BX||top.BX).message({'JC_CORE_TREE_SELECT_CONTROL':'" . GetMessage('skyweb24.JC_CORE_TREE_SELECT_CONTROL') . "','JC_CORE_TREE_ADD_CONTROL':'" . GetMessage('skyweb24.JC_CORE_TREE_ADD_CONTROL') . "','JC_CORE_TREE_DELETE_CONTROL':'" . GetMessage('skyweb24.JC_CORE_TREE_DELETE_CONTROL') . "','JC_CORE_TREE_CONTROL_DATETIME_ICON':'" . GetMessage('skyweb24.JC_CORE_TREE_CONTROL_DATETIME_ICON') . "','JC_CORE_TREE_CONDITION_ERROR':'" . GetMessage('skyweb24.JC_CORE_TREE_CONDITION_ERROR') . "','JC_CORE_TREE_CONDITION_FATAL_ERROR':'" . GetMessage('skyweb24.popuppro_IMG_BLOCK_DELIMG') . "'});</script>");
}

$context = Application::getInstance()->getContext();
$request = $context->getRequest();

function imageBusy($popupArr, $img)
{
    $impPropArr = ['IMG_1_SRC', 'IMG_2_SRC', 'IMG_3_SRC', 'IMG_4_SRC', 'IMG_5_SRC'];
    foreach ($popupArr as $keyPopup => $valPopup) {
        foreach ($impPropArr as $nextProp) {
            if (
                !empty($valPopup['view']['props'][$nextProp])
                && (
                    $valPopup['view']['props'][$nextProp] == $img['id']
                    || $valPopup['view']['props'][$nextProp] == $img['path']
                )
            ) {
                return $keyPopup;
            }
        }
    }
    return false;
}


if (!empty($request['action_button']) && $request['action_button'] == 'copy' && !empty($request['ID'])) {
    $editableWindow = new popupproEdit();
    $newIdPopup = $editableWindow->CopyPopup($request['ID']);
    global $APPLICATION;
    $CURRENT_PAGE = (CMain::IsHTTPS()) ? "https://" : "http://";
    $CURRENT_PAGE .= $_SERVER["HTTP_HOST"];
    header("Location: " . $CURRENT_PAGE . "/bitrix/admin/skyweb24_popuppro.php?id=" . $newIdPopup);
}


//ajax operations
if (!empty($request['ajax']) && $request['ajax'] == 'y') {

    if (!empty($request['command'])) {
        if ($request['command'] == 'gettemplate') {
            global $APPLICATION;
            $APPLICATION->IncludeComponent(
                "skyweb24:popup.pro",
                $request['template'],
                [
                    "MODE"     => "TEMPLATE",
                    "ID_POPUP" => "NEW"
                ]
            );
        }
        elseif ($request['command'] == 'gettemplate_ws') {

            global $APPLICATION;
            $APPLICATION->IncludeComponent(
                "skyweb24:popup.pro",
                $request->get("template"),
                [
                    "MODE"     => "WS_TEMPLATE",
                    "ID_POPUP" => "NEW"
                ]
            );

        }
        elseif ($request['command'] == 'gettemplatepath') {

            global $APPLICATION;
            $APPLICATION->IncludeComponent(
                "skyweb24:popup.pro",
                $request['template'],
                [
                    "MODE"     => "GET_PATH",
                    "ID_POPUP" => "NEW"
                ]
            );
        }
        elseif ($request['command'] == 'gettimertemplate') {
            global $APPLICATION;
            $APPLICATION->IncludeComponent(
                "skyweb24:popup.pro.timer", ''
            );
        }
        elseif ($request['command'] == 'get_img') {
            $editableWindow = new popupproEdit();
            $allSettings = $editableWindow->getAllPopups();
            $firstQueue = $lastQueue = '';
            $res = CFile::GetList(["ID" => "desc"], ["MODULE_ID" => $module_id]);
            while ($res_arr = $res->GetNext()) {
                $keyPopup = imageBusy($allSettings, ['id' => $res_arr['ID'], 'path' => '/upload/' . $res_arr['SUBDIR'] . '/' . $res_arr['FILE_NAME']]);
                $deleteLink = '<a href="javascript:void(0);" onclick="delPopupImg(this);" class="del_img" title="' . GetMessage("skyweb24.popuppro_IMG_BLOCK_DELIMG") . '" data-id="' . $res_arr['ID'] . '">&nbsp;</a>';
                $existKey = '';
                if ($keyPopup !== false) {
                    $deleteLink = '';
                    $existKey = 'popup [' . $keyPopup . ']';
                }
                $tmpFigure = '<figure>' .
                    $deleteLink
                    . '<img title="' . GetMessage("skyweb24.popuppro_IMG_BLOCK_ALTIMG") . '" alt="' . GetMessage("skyweb24.popuppro_IMG_BLOCK_ALTIMG") . '" data-id="' . $res_arr['ID'] . '" src="/upload/' . $res_arr['SUBDIR'] . '/' . $res_arr['FILE_NAME'] . '" />
						<figcaption>' . $existKey . '</figcaption>
					</figure>';
                if ($keyPopup !== false) {
                    $firstQueue .= $tmpFigure;
                }
                else {
                    $lastQueue .= $tmpFigure;
                }
            }
            echo $firstQueue . $lastQueue . '<a href="javascript:void(0);" onclick="showHideImgs(\'show_all\')" class="show_all">' . GetMessage("skyweb24.popuppro_IMG_SHOWALL") . '</a><a href="javascript:void(0);" onclick="showHideImgs(\'hide_all\')" class="hide_all">' . GetMessage("skyweb24.popuppro_IMG_HIDEALL") . '</a>';
        }
        elseif ($request['command'] == 'del_img') {
            CFile::Delete($request['id']);
            echo json_encode('success');

        }
        elseif ($request['command'] == 'add_custom_colortheme') {

            foreach ($_REQUEST as $key => $value) {
                if (is_numeric(strpos($key, "theme_color"))) {
                    $data[$key] = $value;
                }
            }

            if (!empty($data)) {
                $retArr = \Skyweb24\Popuppro\Themes::setCustomTheme($_REQUEST["name"], $_REQUEST["template"], serialize($data));
            }
            else {
                $retArr = ['status' => 'do not data'];
            }

            echo \Bitrix\Main\Web\Json::encode($retArr);
            die();

        }
        elseif ($request['command'] == 'edit_custom_colortheme') {

            foreach ($_REQUEST as $key => $value) {
                if (is_numeric(strpos($key, "theme_color"))) {
                    $data[$key] = $value;
                }
            }

            if (!empty($data)) {
                $retArr = \Skyweb24\Popuppro\Themes::editCustomTheme($_REQUEST["template"], $_REQUEST['ID'], $_REQUEST["name"], serialize($data));
            }
            else {
                $retArr = ['status' => 'do not data'];
            }

            echo \Bitrix\Main\Web\Json::encode($retArr);
            die();

        }
        elseif ($request['command'] == 'add_custom_template') {

            $editableWindow = new popupproEdit();
            $dataStatus = true;
            $requiredVal = ['template', 'name', 'type'];
            foreach ($requiredVal as $nextVal) {
                if (empty($request[$nextVal])) {
                    $dataStatus = false;
                    break;
                }
            }
            if ($dataStatus) {
                $retArr = $editableWindow->setTemplate(
                    $request['type'],
                    $request['template'],
                    $request['name'],
                    $request->get("color_style"),
                    $request->get("parentTemplate")
                );
                if ($retArr === false) {
                    $retArr = ['status' => 'error copy'];
                }
            }
            else {
                $retArr = ['status' => 'do not data'];
            }
            echo json_encode($retArr);
        }
        elseif ($request['command'] == 'statTableSort') {
            $statistics = new \Skyweb24\Popuppro\Statistics($request['idPopup'], false, false);
            $dataStatisticConversion = $statistics->getStatActivePage($request['sort']);
            foreach ($dataStatisticConversion as $key => $nextData) {

                $rowId = $key + 1;
                $number = $key + 1;

                if (!empty($nextData['shows_popup']) AND !empty($nextData['target'])) {
                    $conversion = round((int)$nextData['target'] / (int)$nextData['shows_popup'] * 100);
                }
                else {
                    $conversion = 0;
                }

                ?>
                <tr class="adm-list-table-row">
                    <td class="adm-list-table-cell"><?= $rowId ?></td>
                    <td class="adm-list-table-cell">
                        <a target="_blank" href="<?= $nextData['url']; ?>">
                            <?= $nextData['url']; ?>
                        </a>
                    </td>
                    <td class="adm-list-table-cell"><?= $nextData['shows_popup']; ?></td>
                    <td class="adm-list-table-cell"><?= $nextData['target']; ?></td>
                    <td class="adm-list-table-cell"><?= $conversion; ?>%</td>
                </tr>
                <?
            }
            die();
        }
        elseif ($request['command'] == 'statistic_reset') {
            $statistics = new \Skyweb24\Popuppro\Statistics($request->get("popupId"), false, false);
            echo $statistics->reset();
        }
    }
    die();
}


$editableWindow = new popupproEdit();

if (!empty($request['id'])) {
    $idPopup = $request['id'];
    $APPLICATION->SetTitle(GetMessage("skyweb24.popuppro_MAIN_TITLE"));
}
else {
    $APPLICATION->SetTitle(GetMessage("skyweb24.popuppro_LIST_TITLE"));

    $sTableID = $editableWindow->getTableSetting();

    $oSort = new CAdminSorting($sTableID, "ID", "desc");
    $lAdmin = new CAdminList($sTableID, $oSort);

    if ($lAdmin->EditAction()) {
        foreach ($FIELDS as $ID => $arFields) {
            if (!$lAdmin->IsUpdated($ID))
                continue;
            $editableWindow->editFromTableList($ID, $arFields);
        }
    }

    if ($arID = $lAdmin->GroupAction()) {
        if ($_REQUEST['action_target'] == 'selected') {
            $rsData = $DB->Query('SELECT * FROM ' . $sTableID . ';', false, $err_mess . __LINE__);
            while ($arRes = $rsData->Fetch()) {
                $arID[] = $arRes['id'];
            }
        }
        foreach ($arID as $ID) {
            if (strlen($ID) <= 0)
                continue;
            $ID = IntVal($ID);
            switch ($_REQUEST['action']) {
                case "delete":
                    $DB->Query('DELETE FROM ' . $sTableID . ' WHERE id=' . $ID . ';', false, $err_mess . __LINE__);
                    break;
                case "activate":
                case "deactivate":
                    $cData = $DB->Query('SELECT * FROM ' . $sTableID . ' WHERE id=' . $ID . ';', false, $err_mess . __LINE__);
                    if ($arFields = $cData->Fetch()) {
                        $arFields["active"] = ($_REQUEST['action'] == "activate" ? "Y" : "N");
                        $tmpSetting = unserialize($arFields['settings']);
                        $tmpSetting['condition']['active'] = $arFields['active'];
                        $DB->Query('UPDATE ' . $sTableID . ' SET active="' . $arFields["active"] . '", settings=\'' . $DB->ForSql(serialize($tmpSetting)) . '\' WHERE id=' . $ID . ';', false, $err_mess . __LINE__);
                    }
                    else
                        $lAdmin->AddGroupError(GetMessage("skyweb24.popuppro_SAVE_ERROR") . " " . GetMessage("skyweb24.popuppro_POPUP_EMPTY"), $ID);
                    break;
            }
        }
    }

    $rsData = $DB->Query('SELECT * FROM ' . $sTableID . ' order by ' . $by . ' ' . $order . ';', false, $err_mess . __LINE__);
    $rsData->NavStart(CAdminResult::GetNavSize());
    $rsData = new CAdminResult($rsData, $sTableID);
    $lAdmin->NavText($rsData->GetNavPrint(GetMessage("skyweb24.popuppro_TABLELIST_PAGINATOR")));
    $lAdmin->AddHeaders([
        ["id"      => "ID",
         "content" => "ID",
         "sort"    => "id",
         "default" => true,
        ],
        ["id"      => "SORT",
         "content" => GetMessage("skyweb24.popuppro_TABLELIST_SORT"),
         "sort"    => "sort",
         "default" => true,
        ],
        ["id"      => "active",
         "content" => GetMessage("skyweb24.popuppro_TABLELIST_ACTIVE"),
         "sort"    => "active",
         "default" => true,
        ],
        ["id"      => "NAME",
         "content" => GetMessage("skyweb24.popuppro_TABLELIST_NAME"),
         "sort"    => "name",
         "default" => true,
        ],
        ["id"      => "TYPE",
         "content" => GetMessage("skyweb24.popuppro_TABLELIST_TYPE"),
         "sort"    => "type",
         "default" => true,
        ],
        ["id"      => "STAT_SHOW",
         "content" => GetMessage("skyweb24.popuppro_TABLELIST_STAT_SHOW"),
         "sort"    => "stat_show",
         "default" => true,
        ],
        ["id"      => "STAT_TIME",
         "content" => GetMessage("skyweb24.popuppro_TABLELIST_STAT_TIME"),
         "sort"    => "stat_time",
         "default" => true,
        ],
        ["id"      => "STAT_ACTION",
         "content" => GetMessage("skyweb24.popuppro_TABLELIST_STAT_ACTION"),
         "sort"    => "stat_action",
         "default" => true,
        ]
    ]);



    $types = $editableWindow->getTypes();

    while ($arRes = $rsData->NavNext(true, "f_")) {
        $row = $lAdmin->AddRow($f_id, $arRes);
        $row->AddViewField("ID", '<a href="./skyweb24_popuppro.php?lang=' . SITE_ID . '&id=' . $f_id . '">' . $f_id . '</a>');
        $row->AddViewField("SORT", $f_sort);
        $row->AddInputField("SORT", ["size" => 10, 'value' => $f_sort]);
        $row->AddCheckField("active");
        $row->AddInputField("NAME", ["size" => 15, 'value' => $f_name]);
        $row->AddViewField("NAME", '<a href="./skyweb24_popuppro.php?lang=' . SITE_ID . '&id=' . $f_id . '">' . $f_name . '</a>');
        $f_type = (empty($types[$f_type])) ? $f_type : $types[$f_type]['name'];

        $row->AddViewField("TYPE", $f_type);
        $row->AddViewField("STAT_SHOW", number_format((double)$f_stat_show, 0, '.', ' '));
        $row->AddViewField("STAT_TIME", popuppro::convertTimeFromSecond($f_stat_time));
        $row->AddViewField("STAT_ACTION", number_format((double)$f_stat_action, 0, '.', ' '));
        $f_settings = unserialize($arRes['settings']);

        $arActions = [];
        $arActions[] = [
            "ICON"    => "edit",
            "DEFAULT" => true,
            "TEXT"    => GetMessage("skyweb24.popuppro_TABLE_EDIT"),
            "ACTION"  => $lAdmin->ActionRedirect("./skyweb24_popuppro.php?id=" . $f_id)
        ];
        $arActions[] = [
            "ICON"   => "copy",
            "TEXT"   => GetMessage("skyweb24.popuppro_TABLE_COPY"),
            "ACTION" => "if(confirm('" . GetMessage('skyweb24.popuppro_TABLE_COPY_CONFIRM') . "')) " . $lAdmin->ActionRedirect("skyweb24_popuppro.php?action_button=copy&ID=" . $f_id)
        ];
        $arActions[] = [
            "ICON"   => "delete",
            "TEXT"   => GetMessage("skyweb24.popuppro_TABLE_DELETE"),
            "ACTION" => "if(confirm('" . GetMessage('skyweb24.popuppro_TABLE_DELETE_CONFIRM') . "')) " . $lAdmin->ActionDoGroup($f_id, "delete")
        ];

        $row->AddActions($arActions);
    }

    $lAdmin->AddFooter(
        [
            ["title" => GetMessage("MAIN_ADMIN_LIST_SELECTED"), "value" => $rsData->SelectedRowsCount()], // ���-�� ���������
            ["counter" => true, "title" => GetMessage("MAIN_ADMIN_LIST_CHECKED"), "value" => "0"], // ����� ������ ���������
        ]
    );
    $lAdmin->AddGroupActionTable([
        "delete"     => GetMessage("MAIN_ADMIN_LIST_DELETE"),
        "activate"   => GetMessage("MAIN_ADMIN_LIST_ACTIVATE"),
        "deactivate" => GetMessage("MAIN_ADMIN_LIST_DEACTIVATE")
    ]);

    $aContext = [
        [
            "TEXT"  => GetMessage("skyweb24.popuppro_LIST_CREATE_NEW_POPUP"),
            "LINK"  => "skyweb24_popuppro.php?lang=" . LANG . "&id=new",
            "TITLE" => GetMessage("skyweb24.popuppro_LIST_CREATE_NEW_POPUP"),
            "ICON"  => "btn_new",
        ]
    ];
    $lAdmin->AddAdminContextMenu($aContext);

    $lAdmin->CheckListMode();
}

require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php");
\Skyweb24\Popuppro\Core\Informer::createInfo($module_id);

if (\Bitrix\Main\Loader::includeModule($module_id)) {

    $APPLICATION->SetAdditionalCSS("/bitrix/js/fileman/block_editor/dialog.css");

    $editFlag = $request->getPost("id_popup");

    if (!empty($editFlag)) {
        $editableWindow->setPopupId($editFlag);

        $upd = $editableWindow->editPopup($request);
        if ($upd['status'] == 'error') {
            CAdminMessage::ShowMessage(["TYPE" => "ERROR", "MESSAGE" => GetMessage("skyweb24.popuppro_ERROR_SAVE") . ':' . $upd['data']]);
        }
        else {
            if ($idPopup == 'new') {
                $tmpMess = GetMessage("skyweb24.popuppro_SUCCESS_ADD", ['ID' => $upd['data']]);
                $idPopup = $upd['data'];
            }
            else {
                $tmpMess = GetMessage("skyweb24.popuppro_SUCCESS_UPDATE", ['ID' => $upd['data']]);
            }
            CAdminMessage::ShowMessage(["TYPE" => "OK", "MESSAGE" => $tmpMess]);
        }
    }


    $APPLICATION->IncludeFile("/bitrix/modules/" . $module_id . "/include/statPopupType.php", []);



    $consentOutMessage = new CAdminMessage([
        'TYPE'    => 'ERROR',
        'MESSAGE' => GetMessage("skyweb24.popuppro_CONSENT_OUT"),
        "HTML"    => true
    ]);

    $tmpConsent = $editableWindow->getConsentList();

    if (empty($idPopup)) {
        $lAdmin->DisplayList();
        if (count($tmpConsent) == 0) {
            echo $consentOutMessage->Show();
        }
    }
    else {

        $editableWindow->setPopupId($idPopup);
        $types = $editableWindow->getTypes();
        $templates = $editableWindow->getTemplates();


        $formType = '';
        foreach ($types as $nextType) {
            $activeClass = '';
            if (!empty($nextType['active']) && $nextType['active'] == true) {
                $activeClass = ' active';
                $formType = $nextType['code'];
            }
        }

        if (count($tmpConsent) == 0) {
            echo $consentOutMessage->Show();
        }

        ?>
        <script>
            (window.BX || top.BX).message({'JSADM_FILES': '<?=GetMessage("skyweb24.popuppro_JSADM_FILES")?>'});
            var typeSettings = <?=CUtil::PhpToJSObject($typeSettings);?>;
            var templatesType = <?=CUtil::PhpToJSObject($types)?>;
            var templatesPopup = <?=CUtil::PhpToJSObject($templates)?>;

        </script>

        <section class="popuppro_detail">
            <form action="<? echo $APPLICATION->GetCurPage() ?>?lang=<?= LANGUAGE_ID ?>&id=<?= $idPopup ?>"
                  enctype="multipart/form-data" method="post" name="detail_popup">
                <input type="hidden" name="id_popup" value="<?= $idPopup ?>"/>
                <?

                $aTabs[] = ["DIV" => "sw24_popup_settings", "TAB" => GetMessage("skyweb24.popuppro_TAB_SETTING_NAME"), "TITLE" => GetMessage("skyweb24.popuppro_TAB_SETTING_DESC"), "ONSELECT" => 'selectPreviewTab()'];

                $aTabs[] = ["DIV" => "sw24_popup_window_success", "TAB" => GetMessage("skyweb24.popuppro_TAB_WINDOW_SUCCESS_NAME"), "TITLE" => GetMessage("skyweb24.popuppro_TAB_WINDOW_SUCCESS_DESC")];

                $aTabs[] = ["DIV" => "sw24_popup_button", "TAB" => GetMessage("skyweb24.popuppro_TAB_BUTTON_NAME"), "TITLE" => GetMessage("skyweb24.popuppro_TAB_BUTTON_DESC")];

                $aTabs[] = ["DIV" => "sw24_popup_condition", "TAB" => GetMessage("skyweb24.popuppro_TAB_CONDITION_NAME"), "TITLE" => GetMessage("skyweb24.popuppro_TAB_CONDITION_DESC")];

                $aTabs[] = ["DIV" => "sw24_popup_statistics", "TAB" => GetMessage("skyweb24.popuppro_TAB_STATISCTICS_NAME"), "ONSELECT" => "managerPopupPro.initStatCharts()", "TITLE" => GetMessage("skyweb24.popuppro_TAB_STATISCTICS_DESC")];

                $aTabs[] = ["DIV" => "sw24_popup_integration", "TAB" => GetMessage("skyweb24.popuppro_TAB_INTEGRATION_NAME"), "TITLE" => GetMessage("skyweb24.popuppro_TAB_INTEGRATION_DESC")];

                $editableWindow->getSetting($editableWindow->getId());
                $tabControl = new CAdminTabControl("tabControl" . $nextPopup["id"], $aTabs);
                $tabControl->Begin();

                $tabControl->BeginNextTab(); ?>
                    <? require_once "includes/tab_main.php"; ?>

                <? $tabControl->BeginNextTab(); ?>
                    <? require_once "includes/tab_success.php"; ?>

                <? $tabControl->BeginNextTab(); ?>
                    <? require_once "includes/tab_button.php"; ?>

                <? $tabControl->BeginNextTab(); ?>
                    <? require_once "includes/tab_conditions.php"; ?>

                <? $tabControl->BeginNextTab(); ?>
                    <? if ($idPopup != "new") require_once "includes/tab_statistic.php"; ?>

                <? $tabControl->BeginNextTab(); ?>
                    <? require_once "includes/tab_integration.php"; ?>



                <? $tabControl->Buttons(); ?>
                    <input type="submit" class="adm-btn-save" name="save"
                           value="<?= GetMessage("skyweb24.popuppro_TAB_BUTTON_SAVE") ?>"
                           title="<?= GetMessage("skyweb24.popuppro_TAB_BUTTON_SAVE") ?>"/>&nbsp;
                    <input type="submit" class="button" name="apply"
                           value="<?= GetMessage("skyweb24.popuppro_TAB_BUTTON_APPLY") ?>"
                           title="<?= GetMessage("skyweb24.popuppro_TAB_BUTTON_APPLY") ?>"/>&nbsp;
                    <input type="button" name="cancel" value="<?= GetMessage("skyweb24.popuppro_TAB_BUTTON_CANCEL") ?>"
                           title="<?= GetMessage("skyweb24.popuppro_TAB_BUTTON_CANCEL") ?>"/>
                <? $tabControl->End(); ?>

                <script>
                    <?
                    $agreements = $editableWindow->getAgreements(['button_caption' => '#BUTTON_TEXT#']);
                    if(count($agreements) > 0) : ?>
                    var agreements = <?=\CUtil::phpToJSObject($agreements);?>
                    <? endif; ?>

                    <? $personalize = Skyweb24\Popuppro\Tools::getPersonalizationValues(); ?>
                    var personalize = <?=\CUtil::phpToJSObject($personalize);?>;

                    var popupMessages = {
                        'uploadImg': '<?=GetMessage("skyweb24.popuppro_IMG_BLOCK_UPLOADIMG")?>',
                        'titlePopupImgBlock': '<?=GetMessage("skyweb24.popuppro_POPUP_IMGBLOCKTITLE")?>',
                        'titleSetcontent': '<?=GetMessage("skyweb24.popuppro_SET_CONTENT")?>',
                        'titleSetservice': '<?=GetMessage("skyweb24.popuppro_SET_SETTINGS")?>',
                        'titleSeteffects': '<?=GetMessage("skyweb24.popuppro_SET_EFFECTS")?>',
                        'titleSetpositionpopup': '<?=GetMessage("skyweb24.popuppro_TABCOND_WINDOW_POSITION")?>',
                        'errorContactTabSetting': '<?=GetMessage("skyweb24.popuppro_ERROR_CONTACT_TAB_SETTING")?>',
                        'hideBlock': '<?=GetMessage("skyweb24.popuppro_HIDE_BLOCK")?>',
                        'ShowBlock': '<?=GetMessage("skyweb24.popuppro_SHOW_BLOCK")?>',
                        'selectImg': '<?=GetMessage("skyweb24.popuppro_JS_SELECT_IMG")?>',
                        'nameInputCustomColorTheme': '<?=GetMessage("skyweb24.popuppro_NAME_INPUT_CUSTOME_COLOR_THEME")?>',
                        'placeholderInputCustomColorTheme': '<?=GetMessage("skyweb24.popuppro_PLACEHOLDER_INPUT_CUSTOME_COLOR_THEME")?>',
                        'saveColorTheme': '<?=GetMessage("skyweb24.popuppro_ADD_COLOR_THEME")?>',
                        'addColorTemplate': '<?=GetMessage("skyweb24.popuppro_ADD_TEMPLATE")?>',
                        'confirmAddColorTheme': '<?=GetMessage("skyweb24.popuppro_CONFIRM_ADD_COLOR_THEME")?>',
                        'create': '<?=GetMessage("skyweb24.popuppro_CREATE_BLOCK")?>',
                        'cancel': '<?=GetMessage("skyweb24.popuppro_CANCEL")?>',
                        'saveEdit': '<?=GetMessage("skyweb24.popuppro_SAVE_EDIT")?>',
                        'enterName': '<?=GetMessage("skyweb24.popuppro_CONFIRM_ADD_TEMPLATE_ENTERNAME")?>',
                        'enterNameColor': '<?=GetMessage("skyweb24.popuppro_CONFIRM_ADD_COLOR_ENTERNAME")?>',
                        'nameIsRequired': '<?=GetMessage("skyweb24.popuppro_NAMEISREQUIRED_BLOCK")?>',
                        'colorThemeCreateSuccess': '<?=GetMessage("skyweb24.popuppro_COLORTHEME_CREATESUCCESS")?>',
                        'customTemplateCreateSuccess': '<?=GetMessage("skyweb24.popuppro_CUSTOMTEMPLATE_CREATESUCCESS")?>',
                        'apply': '<?=GetMessage("skyweb24.popuppro_APPLY")?>',
                        'edit': '<?=GetMessage("skyweb24.popuppro_TABLE_EDIT")?>',
                        'additional': '<?=GetMessage("skyweb24.popuppro_TABLE_ADDITIONAL")?>',
                        'personalisation': '<?=GetMessage("skyweb24.popuppro_PERSONALISATION_LINK")?>',
                        'personalisationMarker': '<?=GetMessage("skyweb24.popuppro_PERSON_HINT")?>',
                        'showPostTemplate': '<?=GetMessage("skyweb24.popuppro_CONTACT_EMAIL_TEMPLATE")?>',

                        'color_main': '<?=GetMessage("skyweb24.popuppro_COLOR_MAIN")?>',
                        'color_grad': '<?=GetMessage("skyweb24.popuppro_COLOR_GRAD")?>',
                        'color_ca': '<?=GetMessage("skyweb24.popuppro_COLOR_CA")?>',
                        'color_au': '<?=GetMessage("skyweb24.popuppro_COLOR_AU")?>',
                        'color_ru': '<?=GetMessage("skyweb24.popuppro_COLOR_RU")?>',

                        'addColorTheme': '<?=GetMessage("skyweb24.popuppro_BTN_ADD_CUSTOM_THEME")?>',
                        'editColorTheme': '<?=GetMessage("skyweb24.popuppro_BTN_EDIT_CUSTOM_THEME")?>',


                    };

                </script>
            </form>
        </section>

        <?
    } ?>

    <?
    if (isset($_REQUEST['save']) && $_REQUEST['save'] == GetMessage("skyweb24.popuppro_TAB_BUTTON_SAVE") && !empty($_REQUEST['id'])) {
        $CURRENT_PAGE = (CMain::IsHTTPS()) ? "https://" : "http://";
        $CURRENT_PAGE .= $_SERVER["HTTP_HOST"];
        $CURRENT_PAGE .= $APPLICATION->GetCurPage(true);
        header('Location: ' . $CURRENT_PAGE);
        exit;
    }
}
else {
    CAdminMessage::ShowMessage(["TYPE" => "ERROR", "HTML" => true, "MESSAGE" => GetMessage("skyweb24.popuppro_NOT_INCLUDE")]);
}
?>
<? if(!empty($request->get("id"))): ?>
<script>
    BX.ready(function () {
        BX.ManagerPopup = new BX.ManagerPopup(
            '<?=$request->get("id");?>',
            {},
            new BX.PopupproAdminPreview(),
            new BX.PopupproAdminSlider(),
            new BX.PopupproAdminButton(),
            new BX.PopupproAdminTimer(),
            new BX.PopupproAdminTemplates(templatesType, templatesPopup),
            new BX.PopupproAdminRoulette()
        );
    })
</script>
<? endif; ?>
<? require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php"); ?>

Youez - 2016 - github.com/yon3zu
LinuXploit