* 3���ϴ���¼�������ݿ��Թ����û��ϴ�ͼƬ */ header('Content-Type: text/html; charset=UTF-8'); $attachDir = 'upload'; //�ϴ��ļ�����·������β��Ҫ��/ $dirType = 1; //1:��������Ŀ¼ 2:���´���Ŀ¼ 3:����չ����Ŀ¼ ����ʹ�ð����� $maxAttachSize = 2097152; //�����ϴ���С��Ĭ����2M $upExt = "jpg,jpeg,gif,png"; //�ϴ���չ�� ini_set('date.timezone', 'Asia/Shanghai'); //ʱ�� //����Զ���ļ� function saveRemoteImg($sUrl) { global $upExt, $maxAttachSize; $reExt = '(' . str_replace(',', '|', $upExt) . ')'; if (substr($sUrl, 0, 10) == 'data:image') { //base64������ͼƬ�����ܳ�����firefoxճ��������ijЩ��վ�ϣ�����googleͼƬ if (!preg_match('/^data:image\\/' . $reExt . '/i', $sUrl, $sExt)) { return false; } $sExt = $sExt[1]; $imgContent = base64_decode(substr($sUrl, strpos($sUrl, 'base64,') + 7)); } else { //urlͼƬ if (!preg_match('/\\.' . $reExt . '$/i', $sUrl, $sExt)) { return false; } $sExt = $sExt[1]; $imgContent = getUrl($sUrl); }
* 3,上传记录存入数据库以管理用户上传图片 */ header('Content-Type: text/html; charset=UTF-8'); $attachDir = 'upload'; //上传文件保存路径,结尾不要带/ $dirType = 1; //1:按天存入目录 2:按月存入目录 3:按扩展名存目录 建议使用按天存 $maxAttachSize = 2097152; //最大上传大小,默认是2M $upExt = "jpg,jpeg,gif,png"; //上传扩展名 ini_set('date.timezone', 'Asia/Shanghai'); //时区 //保存远程文件 function saveRemoteImg($sUrl) { global $upExt, $maxAttachSize; $reExt = '(' . str_replace(',', '|', $upExt) . ')'; if (substr($sUrl, 0, 10) == 'data:image') { //base64编码的图片,可能出现在firefox粘贴,或者某些网站上,例如google图片 if (!preg_match('/^data:image\\/' . $reExt . '/i', $sUrl, $sExt)) { return false; } $sExt = $sExt[1]; $imgContent = base64_decode(substr($sUrl, strpos($sUrl, 'base64,') + 7)); } else { //url图片 if (!preg_match('/\\.' . $reExt . '$/i', $sUrl, $sExt)) { return false; } $sExt = $sExt[1]; $imgContent = getUrl($sUrl); }
public static function getVersion($moduleName) { $moduleName = preg_replace("/[^a-zA-Z0-9_.]+/i", "", trim($moduleName)); if ($moduleName == '') { return false; } if (!self::isModuleInstalled($moduleName)) { return false; } $version = false; if ($moduleName == 'main') { if (!defined("SM_VERSION")) { include_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/version.php"; } $version = SM_VERSION; } else { $modulePath = getLocalPath("modules/" . $moduleName . "/install/version.php"); if ($modulePath === false) { return false; } include $_SERVER["DOCUMENT_ROOT"] . $modulePath; $version = array_key_exists("VERSION", $arModuleVersion) ? $arModuleVersion["VERSION"] : false; } return $version; }
function print_admin_panel($page) { global $domain; if (!isset($_SESSION['username'])) { $username = ""; } else { $username = $_SESSION['username']; } echo '<script src="http://' . getLocalPath() . '/admin.js"></script>'; echo "<h1>Admin Panel</h1>\n Welcome " . htmlspecialchars($username) . "<br>"; echo "Your balance is: \$" . get_fed_balance(); //<li><a href=\"".$domain."admin/panel.php?page=transfer_internal_funds\">Transfer Internal User Funds</a></li> echo "<h2>Welcome to the Admin Panel</h2>\n Add the twitter feed here to see user feedback.<br />\n <ul>\n <li><a href=\"" . $domain . "admin/panel.php?page=add_user\">Add User</a></li>\n <li><a href=\"" . $domain . "admin/panel.php?page=change_fed_password\">Change Fed Password</a></li>\n <li><a href=\"" . $domain . "admin/panel.php?page=change_fed_pin\">Change Fed PIN</a></li>\n <li><a href=\"" . $domain . "admin/panel.php?page=transfer_to_bank\">Transfer Money to Other Bank</a></li>\n Transfers to external accounts must not exceed the bank's balance in the fed.\n Transfers to other banks must not exceed \$5000 within a 30 minute period.\n <li><a href=\"" . $domain . "admin/panel.php?page=view_account_funds\">View Internal User Funds</a></li>\n <li><a href=\"" . $domain . "admin/panel.php?page=view_transactions\">View Transaction List</a></li>\n <li><a href=\"" . $domain . "admin/panel.php?page=pay_bill\">Pay Bill</a></li>\n <li><a href=\"" . $domain . "admin/panel.php?page=change_page\">Modify Page</a></li>\n <li><a href=\"" . $domain . "admin/panel.php?page=change_local_password\">Change My Local Password</a></li>\n </ul>\n <div id=\"admin_content\">"; get_content($page); echo "</div>\n"; }
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/prolog.php"; if (!$USER->CanDoOperation('edit_other_settings') && !$USER->CanDoOperation('view_other_settings') || !check_bitrix_sessid()) { $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED")); } $ID = str_replace("\\", "", $_REQUEST["ID"]); $ID = str_replace("/", "", $ID); $bUseCompression = True; if (!extension_loaded('zlib') || !function_exists("gzcompress")) { $bUseCompression = False; } require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/tar_gz.php"; CheckDirPath($_SERVER['DOCUMENT_ROOT'] . BX_PERSONAL_ROOT . "/tmp/templates/"); $tmpfname = $_SERVER['DOCUMENT_ROOT'] . BX_PERSONAL_ROOT . "/tmp/templates/" . md5(uniqid(rand(), true) . ".tar.gz"); $HTTP_ACCEPT_ENCODING = ""; $strError = ""; $path = getLocalPath("templates/" . $ID, BX_PERSONAL_ROOT); if (is_dir($_SERVER["DOCUMENT_ROOT"] . $path)) { $oArchiver = new CArchiver($tmpfname, $bUseCompression); $tres = $oArchiver->add("\"" . $_SERVER["DOCUMENT_ROOT"] . $path . "\"", false, $_SERVER["DOCUMENT_ROOT"] . $path); if (!$tres) { $strError = "Archiver error"; $arErrors =& $oArchiver->GetErrors(); if (count($arErrors) > 0) { $strError .= ":<br>"; foreach ($arErrors as $value) { $strError .= "[" . $value[0] . "] " . $value[1] . "<br>"; } } else { $strError .= ".<br>"; } }
public function GetIcons() { /** @global CMain $APPLICATION */ global $USER, $APPLICATION; $arIcons = array(); $arPanelParams = array(); $arComponentDescription = CComponentUtil::GetComponentDescr($this->componentName); $bComponentAccess = $USER->CanDoOperation('edit_php') || $this->bSrcFound && $USER->CanDoFileOperation('fm_lpa', array(SITE_ID, $this->sSrcFile)); if ($bComponentAccess && !$this->parentComponent && $this->bSrcFound) { $url = $APPLICATION->GetPopupLink(array('URL' => "/freetrix/admin/component_props.php?" . "component_name=" . urlencode(CUtil::addslashes($this->componentName)) . "&component_template=" . urlencode(CUtil::addslashes($this->componentTemplate)) . "&template_id=" . urlencode(CUtil::addslashes(SITE_TEMPLATE_ID)) . "&lang=" . urlencode(CUtil::addslashes(LANGUAGE_ID)) . "&src_path=" . urlencode(CUtil::addslashes($this->sSrcFile)) . "&src_line=" . $this->iSrcLine . "&src_page=" . urlencode(CUtil::addslashes($APPLICATION->GetCurPage())) . "&src_site=" . urlencode(CUtil::addslashes(SITE_ID)), "PARAMS" => array("min_width" => 450))); $arIcons[] = array('URL' => 'javascript:' . $url, 'TYPE' => 'components2_props', 'ICON' => "bx-context-toolbar-settings-icon", 'TITLE' => GetMessage("main_incl_file_comp_param"), 'DEFAULT' => true); $aMenuItem = array("TEXT" => $arComponentDescription["NAME"], "TITLE" => GetMessage("main_comp_button_menu_title") . ' ' . $this->componentName, "ICON" => "parameters-2", "ACTION" => $url); $APPLICATION->AddPanelButtonMenu("components", $aMenuItem); } if ($bComponentAccess) { $template = $this->component->GetTemplate(); if (is_null($template)) { if ($this->component->InitComponentTemplate()) { $template = $this->component->GetTemplate(); } } if (!is_null($template)) { $urlCopy = ''; if ($this->bSrcFound && $template->IsInTheme() == false) { //copy template dialog $urlCopy = "/freetrix/admin/template_copy.php?" . "lang=" . urlencode(CUtil::addslashes(LANGUAGE_ID)) . "&component_name=" . urlencode(CUtil::addslashes($this->componentName)) . "&component_template=" . urlencode(CUtil::addslashes($this->componentTemplate)) . "&template_id=" . urlencode(CUtil::addslashes(SITE_TEMPLATE_ID)) . "&template_site_template=" . urlencode(CUtil::addslashes($template->GetSiteTemplate())) . "&src_path=" . urlencode(CUtil::addslashes($this->sSrcFile)) . "&src_line=" . $this->iSrcLine . "&src_site=" . urlencode(CUtil::addslashes(SITE_ID)) . "&edit_file=" . urlencode($template->GetPageName()) . "&back_path=" . urlencode($_SERVER["REQUEST_URI"]); $arIcons[] = array('URL' => 'javascript:' . $APPLICATION->GetPopupLink(array('URL' => $urlCopy, "PARAMS" => array("min_width" => 450))), 'ICON' => "copy-2", 'TITLE' => GetMessage("main_comp_copy_templ"), 'IN_MENU' => true); } if ($USER->CanDoOperation('edit_php') && strlen($template->GetSiteTemplate()) > 0) { //edit template copied to site template $arIcons[] = array('URL' => 'javascript:' . $APPLICATION->GetPopupLink(array('URL' => "/freetrix/admin/public_file_edit_src.php?site=" . SITE_ID . "&" . 'path=' . urlencode($template->GetFile()) . "&back_url=" . urlencode($_SERVER["REQUEST_URI"]) . "&lang=" . LANGUAGE_ID, 'PARAMS' => array('width' => 770, 'height' => 470, 'resize' => true, "dialog_type" => 'EDITOR'))), 'ICON' => 'edit-2', 'TITLE' => GetMessage("main_comp_edit_templ"), 'IN_MENU' => true); if (strlen($template->GetFolder()) > 0) { if (file_exists($_SERVER["DOCUMENT_ROOT"] . $template->GetFolder() . "/style.css")) { //edit template CSS copied to site template $arIcons[] = array('URL' => 'javascript:' . $APPLICATION->GetPopupLink(array('URL' => "/freetrix/admin/public_file_edit_src.php?site=" . SITE_ID . "&" . 'path=' . urlencode($template->GetFolder() . "/style.css") . "&back_url=" . urlencode($_SERVER["REQUEST_URI"]) . "&lang=" . LANGUAGE_ID, 'PARAMS' => array('width' => 770, 'height' => 470, 'resize' => true, "dialog_type" => 'EDITOR'))), 'ICON' => 'edit-css', 'TITLE' => GetMessage("main_comp_edit_css"), 'IN_MENU' => true); } $bWasSep = false; if (file_exists($_SERVER["DOCUMENT_ROOT"] . $template->GetFolder() . "/result_modifier.php")) { $bWasSep = true; $arIcons[] = array('SEPARATOR' => true); $arIcons[] = array('URL' => 'javascript:' . $APPLICATION->GetPopupLink(array('URL' => "/freetrix/admin/public_file_edit_src.php?site=" . SITE_ID . "&" . 'path=' . urlencode($template->GetFolder() . "/result_modifier.php") . "&back_url=" . urlencode($_SERVER["REQUEST_URI"]) . "&lang=" . LANGUAGE_ID, 'PARAMS' => array('width' => 770, 'height' => 470, 'resize' => true, "dialog_type" => 'EDITOR'))), 'TITLE' => GetMessage("main_comp_edit_res_mod"), 'IN_MENU' => true); } if (file_exists($_SERVER["DOCUMENT_ROOT"] . $template->GetFolder() . "/component_epilog.php")) { if (!$bWasSep) { $arIcons[] = array('SEPARATOR' => true); } $arIcons[] = array('URL' => 'javascript:' . $APPLICATION->GetPopupLink(array('URL' => "/freetrix/admin/public_file_edit_src.php?site=" . SITE_ID . "&" . 'path=' . urlencode($template->GetFolder() . "/component_epilog.php") . "&back_url=" . urlencode($_SERVER["REQUEST_URI"]) . "&lang=" . LANGUAGE_ID, 'PARAMS' => array('width' => 770, 'height' => 470, 'resize' => true, "dialog_type" => 'EDITOR'))), 'TITLE' => GetMessage("main_comp_edit_epilog"), 'IN_MENU' => true); } } } elseif ($urlCopy != '') { //copy template for future editing $urlCopy .= '&system_template=Y'; $arIcons[] = array('URL' => 'javascript:' . $APPLICATION->GetPopupLink(array('URL' => $urlCopy, "PARAMS" => array("min_width" => 450))), 'ICON' => "edit-2", 'TITLE' => GetMessage("main_comp_edit_templ"), 'ALT' => GetMessage("main_comp_copy_title"), 'IN_MENU' => true); } } } $aAddIcons = array(); $arPanelParams['COMPONENT'] = $this->componentName; if ($arComponentDescription && is_array($arComponentDescription)) { $arPanelParams['COMPONENT_DESCRIPTION'] = $arComponentDescription; //component bar tooltip $arPanelParams['TOOLTIP'] = array('TITLE' => $arComponentDescription["NAME"], 'TEXT' => '(' . GetMessage('main_incl_comp_component') . ' ' . $this->componentName . ')' . (isset($arComponentDescription["DESCRIPTION"]) && $arComponentDescription["DESCRIPTION"] != "" ? '<br />' . $arComponentDescription["DESCRIPTION"] : '')); //clear cache if (array_key_exists("CACHE_PATH", $arComponentDescription) && $USER->CanDoOperation('cache_control')) { if (strlen($arComponentDescription["CACHE_PATH"]) > 0) { $arIcons[] = array("URL" => "javascript:jsComponentUtils.ClearCache('component_name=" . urlencode(CUtil::addslashes($this->componentName)) . "&site_id=" . SITE_ID . "&" . freetrix_sessid_get() . "');", "ICON" => "del-cache", "TITLE" => GetMessage("MAIN_FX_COMPONENT_CACHE_CLEAR"), 'IN_MENU' => true); $APPLICATION->aCachedComponents[] = $this->componentName; } } //additional buttons from component description if (array_key_exists("AREA_BUTTONS", $arComponentDescription)) { $componentRelativePath = CComponentEngine::MakeComponentPath($this->componentName); $localPath = getLocalPath("components" . $componentRelativePath); foreach ($arComponentDescription["AREA_BUTTONS"] as $value) { if (array_key_exists("SRC", $value)) { $value["SRC"] = $localPath . $value["SRC"]; } $aAddIcons[] = $value; } } } if (!empty($arIcons) && !empty($aAddIcons)) { $arIcons[] = array("SEPARATOR" => true); } $arIcons = array_merge($arIcons, $aAddIcons); $aAddIcons = $this->component->GetIncludeAreaIcons(); if (!empty($arIcons) && !empty($aAddIcons)) { $arIcons[] = array("SEPARATOR" => true); } $arIcons = array_merge($arIcons, $aAddIcons); // enable/disable menu item if ($bComponentAccess && !$this->parentComponent && $this->bSrcFound) { if (!empty($arIcons)) { $arIcons[] = array("SEPARATOR" => true); } $arIcons[] = array("URL" => "javascript:jsComponentUtils.EnableComponent('component_name=" . urlencode(CUtil::addslashes($this->componentName)) . "&lang=" . urlencode(CUtil::addslashes(LANGUAGE_ID)) . "&src_path=" . urlencode(CUtil::addslashes($this->sSrcFile)) . "&src_line=" . $this->iSrcLine . "&src_site=" . urlencode(CUtil::addslashes(SITE_ID)) . '&active=' . ($this->bComponentEnabled ? 'N' : 'Y') . '&' . freetrix_sessid_get() . "');", "TITLE" => $this->bComponentEnabled ? GetMessage("main_comp_disable") : GetMessage("main_comp_enable"), "ALT" => $this->bComponentEnabled ? GetMessage("main_comp_disable_title") : GetMessage("main_comp_enable_title"), 'IN_MENU' => true); } if ($this->bSrcFound) { $arPanelParams['COMPONENT_ID'] = md5($arPanelParams['COMPONENT'] . '|' . $this->sSrcFile . ':' . $this->iSrcLine); } return array("icons" => $arIcons, "parameters" => $arPanelParams); }
if (getLocalPath("modules/" . $module . "/install/index.php") === false || getLocalPath("modules/" . $module . "/options.php") === false) { continue; } $info = CModule::CreateModuleObject($module); $name = $info->MODULE_NAME; $sort = $info->MODULE_SORT; } else { if (!$USER->CanDoOperation('view_other_settings')) { continue; } $name = GetMessage("MAIN_MENU_MAIN_MODULE"); $sort = -1; } $aModule = array("text" => $name, "url" => "settings.php?lang=" . LANGUAGE_ID . "&mid=" . $module . "&mid_menu=1", "more_url" => array("settings.php?lang=" . LANGUAGE_ID . "&mid=" . $module . "&mid_menu=1"), "title" => GetMessage("MAIN_MENU_MODULE_SETT") . " "" . $name . """, "sort" => $sort); if (BX_SEARCH_ADMIN === true) { $lfile = getLocalPath("modules/" . $module . "/lang/" . LANGUAGE_ID . "/options.php"); if ($lfile !== false) { $aModule["keywords"] = implode(' ', __IncludeLang($_SERVER["DOCUMENT_ROOT"] . $lfile, true)); } } $aModuleItems[] = $aModule; } usort($aModuleItems, create_function('$a, $b', 'if($a["sort"] == $b["sort"]) return strcasecmp($a["text"], $b["text"]); return ($a["sort"] < $b["sort"])? -1 : 1;')); } } $aItems = array(); $aItems[] = array("text" => GetMessage("MAIN_MENU_SITES"), "title" => GetMessage("MAIN_MENU_SITES_TITLE"), "items_id" => "menu_site", "items" => array(array("text" => GetMessage("MAIN_MENU_SITES_LIST"), "url" => "site_admin.php?lang=" . LANGUAGE_ID, "more_url" => array("site_edit.php"), "title" => GetMessage("MAIN_MENU_SITES_ALT")), array("text" => GetMessage("MAIN_MENU_TEMPLATE"), "title" => GetMessage("MAIN_MENU_TEMPL_TITLE"), "url" => "template_admin.php?lang=" . LANGUAGE_ID, "more_url" => array("template_edit.php", "template_load.php")))); $aItems[] = array("text" => GetMessage("main_menu_lang_param"), "title" => GetMessage("main_menu_lang_param_title"), "items_id" => "menu_lang", "items" => array(array("text" => GetMessage("MAIN_MENU_LANG"), "url" => "lang_admin.php?lang=" . LANGUAGE_ID, "more_url" => array("lang_edit.php"), "title" => GetMessage("MAIN_MENU_LANGS_ALT")), array("text" => GetMessage("main_menu_reg_sett"), "url" => "culture_admin.php?lang=" . LANGUAGE_ID, "more_url" => array("culture_edit.php"), "title" => GetMessage("main_menu_reg_sett_title")))); $aItems[] = array("text" => GetMessage("MAIN_MENU_EVENT"), "title" => GetMessage("MAIN_MENU_EVENT_TITLE"), "items_id" => "menu_templates", "items" => array(array("text" => GetMessage("MAIN_MENU_TEMPLATES"), "url" => "message_admin.php?lang=" . LANGUAGE_ID, "more_url" => array("message_edit.php"), "title" => GetMessage("MAIN_MENU_TEMPLATES_ALT")), array("text" => GetMessage("MAIN_MENU_EVENT_TYPES"), "title" => GetMessage("MAIN_MENU_EVENT_TYPES_TITLE"), "url" => "type_admin.php?lang=" . LANGUAGE_ID, "more_url" => array("type_edit.php")), array("text" => GetMessage("MAIN_MENU_EVENT_THEMES"), "title" => GetMessage("MAIN_MENU_EVENT_THEMES_TITLE"), "url" => "message_theme_admin.php?lang=" . LANGUAGE_ID, "more_url" => array("message_theme_edit.php")))); $aItems[] = array("text" => GetMessage("MAIN_MENU_MODULES"), "url" => "module_admin.php?lang=" . LANGUAGE_ID, "more_url" => array("module_edit.php"), "title" => GetMessage("MAIN_MENU_MODULES_ALT")); $aItems[] = array("text" => GetMessage("MAIN_MENU_MODULE_SETTINGS"), "url" => "settings.php?lang=" . LANGUAGE_ID, "title" => GetMessage("MAIN_MENU_SETTINGS_ALT"), "dynamic" => true, "module_id" => "main", "items_id" => "menu_module_settings", "items" => $aModuleItems);
/** * Возвращает инстанс frontend'a * * @param string|false $pathToFrontend Если не указан ищется в текущем шаблоне (или в .default если не найден) * Можно указать имя шаблона в котором будет искаться frontend * Либо указывается путь до папки frontend * @param array $resolverOptions Опции для PathResolver * @return \TAO\Frontend */ public static function frontend($pathToFrontend = false, $resolverOptions = array()) { if (!$pathToFrontend) { $pathToFrontend = rtrim($_SERVER['DOCUMENT_ROOT'], '/') . self::app()->GetTemplatePath('frontend'); } elseif (!file_exists($pathToFrontend)) { if ($path = getLocalPath("templates/{$pathToFrontend}/frontend")) { $pathToFrontend = '.' . $path; } } $resolver = new \Techart\Frontend\PathResolver($pathToFrontend, array_merge(array('twigCachePath' => dirname($pathToFrontend) . '/twig'), $resolverOptions)); return self::$frontends[$pathToFrontend] ?: (self::$frontends[$pathToFrontend] = new \TAO\Frontend(self::env(), $resolver)); }
public static function GetCurTemplate() { /** @noinspection PhpUnusedLocalVariableInspection */ global $DB, $APPLICATION, $USER, $CACHE_MANAGER; if (CACHED_b_site_template === false) { $strSql = "\n\t\t\t\tSELECT\n\t\t\t\t\t" . CMain::__GetConditionFName() . ",\n\t\t\t\t\tTEMPLATE\n\t\t\t\tFROM\n\t\t\t\t\tb_site_template\n\t\t\t\tWHERE\n\t\t\t\t\tSITE_ID = '" . SITE_ID . "'\n\t\t\t\tORDER BY\n\t\t\t\t\tif(length(" . CMain::__GetConditionFName() . ")>0, 1, 2), SORT\n\t\t\t\t"; $dbr = $DB->Query($strSql); while ($ar = $dbr->Fetch()) { $strCondition = trim($ar["CONDITION"]); if (strlen($strCondition) > 0 && !@eval("return " . $strCondition . ";")) { continue; } if (($path = getLocalPath("templates/" . $ar["TEMPLATE"], BX_PERSONAL_ROOT)) !== false && is_dir($_SERVER["DOCUMENT_ROOT"] . $path)) { return $ar["TEMPLATE"]; } } } else { if ($CACHE_MANAGER->Read(CACHED_b_site_template, "b_site_template")) { $arSiteTemplateBySite = $CACHE_MANAGER->Get("b_site_template"); } else { $dbr = $DB->Query("\n\t\t\t\t\tSELECT\n\t\t\t\t\t\t" . CMain::__GetConditionFName() . ",\n\t\t\t\t\t\tTEMPLATE,\n\t\t\t\t\t\tSITE_ID\n\t\t\t\t\tFROM\n\t\t\t\t\t\tb_site_template\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\tSITE_ID, if(length(" . CMain::__GetConditionFName() . ")>0, 1, 2), SORT\n\t\t\t\t"); $arSiteTemplateBySite = array(); while ($ar = $dbr->Fetch()) { $arSiteTemplateBySite[$ar['SITE_ID']][] = $ar; } $CACHE_MANAGER->Set("b_site_template", $arSiteTemplateBySite); } if (is_array($arSiteTemplateBySite[SITE_ID])) { foreach ($arSiteTemplateBySite[SITE_ID] as $ar) { $strCondition = trim($ar["CONDITION"]); if (strlen($strCondition) > 0 && !@eval("return " . $strCondition . ";")) { continue; } if (($path = getLocalPath("templates/" . $ar["TEMPLATE"], BX_PERSONAL_ROOT)) !== false && is_dir($_SERVER["DOCUMENT_ROOT"] . $path)) { return $ar["TEMPLATE"]; } } } } return ".default"; }
?> </head> <body id="bx-admin-prefix"> <!--[if lte IE 7]> <style type="text/css"> #bx-panel {display:none !important;} .adm-main-wrap { display:none !important; } </style> <div id="bx-panel-error"> <?php echo GetMessage("admin_panel_browser"); ?> </div><![endif]--> <?php } if (($adminHeader = getLocalPath("php_interface/admin_header.php", BX_PERSONAL_ROOT)) !== false) { include $_SERVER["DOCUMENT_ROOT"] . $adminHeader; } ?> <table class="adm-main-wrap"> <tr> <td class="adm-header-wrap" colspan="2"> <?php require $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/interface/top_panel.php"; require $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/interface/favorite_menu.php"; ?> </td> </tr> <tr> <?php CJSCore::Init(array('admin_interface'));
$sVer = $GLOBALS['USER']->CanDoOperation('view_other_settings') ? " " . SM_VERSION : ""; $sCopyright = str_replace("#VERSION#", $sVer, $sCopyright); if (isset($bxProductConfig["admin"]["links"])) { $sLinks = $bxProductConfig["admin"]["links"]; } else { $sLinks = '<a href="' . GetMessage("EPILOG_ADMIN_URL_MAIN_" . $vendor) . '">' . GetMessage("EPILOG_ADMIN_URL_MAIN_TEXT_" . $vendor) . '</a> | <a href="' . GetMessage("EPILOG_ADMIN_URL_SUPPORT_" . $vendor) . '" class="adm-main-support-link">' . GetMessage("epilog_support_link") . '</a>'; } ?> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td><?php echo $sCopyright; ?> </td> <td align="right"><?php if (($siteSupport = getLocalPath("php_interface/this_site_support.php", BX_PERSONAL_ROOT)) !== false) { include $_SERVER["DOCUMENT_ROOT"] . $siteSupport; } else { echo $sLinks; } ?> </td> </tr> </table> <?php //End of Footer ?> </td> </tr> </table> <div id="fav_cont_item" class="adm-favorites-main" style="display:none;">
CHTTP::SetStatus(___1901741453(485)); die; } } if (!$GLOBALS['____1514955144'][89](___1901741453(486)) || ADMIN_SECTION !== true) { if (isset($_REQUEST[___1901741453(487)]) && $_REQUEST[___1901741453(488)] != ___1901741453(489) && $GLOBALS[___1901741453(490)]->{$GLOBALS}['_____967299403'][35](___1901741453(491))) { $_1002116244 = CSiteTemplate::$GLOBALS['_____967299403'][36]($_REQUEST[___1901741453(492)]); if ($_2011309894 = $_1002116244->{$GLOBALS}['_____967299403'][37]()) { $GLOBALS['____1514955144'][90](___1901741453(493), $_2011309894[___1901741453(494)]); } else { $GLOBALS['____1514955144'][91](___1901741453(495), CSite::GetCurTemplate()); } } else { $GLOBALS['____1514955144'][92](___1901741453(496), CSite::GetCurTemplate()); } $GLOBALS['____1514955144'][93](___1901741453(497), getLocalPath(___1901741453(498) . SITE_TEMPLATE_ID, BX_PERSONAL_ROOT)); } if (isset($_GET[___1901741453(499)])) { if ($_GET[___1901741453(500)] == ___1901741453(501) || $_GET[___1901741453(502)] == ___1901741453(503)) { $_SESSION[___1901741453(504)] = $_GET[___1901741453(505)]; } } if (isset($_GET[___1901741453(506)])) { if ($_GET[___1901741453(507)] == ___1901741453(508) || $_GET[___1901741453(509)] == ___1901741453(510)) { $_SESSION[___1901741453(511)] = $_GET[___1901741453(512)]; } } if (isset($_GET[___1901741453(513)]) && $_GET[___1901741453(514)] != ___1901741453(515)) { $GLOBALS[___1901741453(516)]->SetShowIncludeAreas($_GET[___1901741453(517)] == ___1901741453(518)); } if ($GLOBALS[___1901741453(519)]->{$GLOBALS}['_____967299403'][38]()) {
OnModuleInstalledEvent($id, 'Y', $Module); if($Module->DoInstall() !== false) { LocalRedirect($APPLICATION->GetCurPage()."?lang=".LANGUAGE_ID."&mod=".$id."&result=OK"); } else { $errorMessage = GetMessage("MOD_INSTALL_ERROR", Array("#CODE#" => $id)); if($e = $APPLICATION->GetException()) $errorMessageFull = $e->GetString(); } } elseif(!$Module->IsInstalled() && strlen($_REQUEST["clear"]) > 0) { if(strlen($Module->MODULE_ID) > 0 && ($mdir = getLocalPath("modules/".$Module->MODULE_ID)) !== false) { DeleteDirFilesEx($mdir."/"); LocalRedirect($APPLICATION->GetCurPage()."?lang=".LANGUAGE_ID."&mod=".$id."&result=CLEAROK"); } } } } $sTableID = "upd_partner_modules_all"; $lAdmin = new CAdminList($sTableID); $sTableID1 = "upd_partner_modules_new"; $lAdmin1 = new CAdminList($sTableID1); $lAdmin->BeginPrologContent();
/** * Function initializes the component. Returns true on success. * * <p>It is absolutly necessery to call this function before any component usage.</p> * @param string $componentName * @param string|bool $componentTemplate * @return bool * */ public final function initComponent($componentName, $componentTemplate = false) { $this->__bInited = false; $componentName = trim($componentName); if ($componentName == '') { $this->__ShowError("Empty component name"); return false; } $path2Comp = CComponentEngine::MakeComponentPath($componentName); if ($path2Comp == '') { $this->__ShowError(sprintf("'%s' is not a valid component name", $componentName)); return false; } $componentPath = getLocalPath("components" . $path2Comp); $this->classOfComponent = self::__getClassForPath($componentPath); if ($this->classOfComponent === "") { $componentFile = $_SERVER["DOCUMENT_ROOT"] . $componentPath . "/component.php"; if (!file_exists($componentFile) || !is_file($componentFile)) { $this->__ShowError(sprintf("'%s' is not a component", $componentName)); return false; } } if (!isset(self::$__componentCounter[$componentName])) { self::$__componentCounter[$componentName] = 1; } else { self::$__componentCounter[$componentName]++; } $this->__currentCounter = self::$__componentCounter[$componentName]; $this->__name = $componentName; $this->__relativePath = $path2Comp; $this->__path = $componentPath; $this->arResult = array(); $this->arParams = array(); $this->__parent = null; $this->__arIncludeAreaIcons = array(); $this->__cache = null; if ($componentTemplate !== false) { $this->__templateName = $componentTemplate; } $this->__bInited = true; return true; }
function DirsRecursive($ID, $path = "", $depth = 0, $maxDepth = 1) { $arRes = array(); $depth++; $templPath = getLocalPath("templates/" . $ID, BX_PERSONAL_ROOT); if ($templPath === false) { return $arRes; } GetDirList($templPath . "/" . $path, $arDirsTmp, $arResTmp); foreach ($arResTmp as $file) { switch ($file["NAME"]) { case "chain_template.php": $file["DESCRIPTION"] = GetMessage("MAIN_TEMPLATE_NAV"); break; case "": $file["DESCRIPTION"] = ""; break; default: if (($p = strpos($file["NAME"], ".menu_template.php")) !== false) { $file["DESCRIPTION"] = str_replace("#MENU_TYPE#", substr($file["NAME"], 0, $p), GetMessage("MAIN_TEMPLATE_MENU")); } elseif (($p = strpos($file["NAME"], "authorize_registration.php")) !== false) { $file["DESCRIPTION"] = GetMessage("MAIN_TEMPLATE_AUTH_REG"); } elseif (($p = strpos($file["NAME"], "forgot_password.php")) !== false) { $file["DESCRIPTION"] = GetMessage("MAIN_TEMPLATE_SEND_PWD"); } elseif (($p = strpos($file["NAME"], "change_password.php")) !== false) { $file["DESCRIPTION"] = GetMessage("MAIN_TEMPLATE_CHN_PWD"); } elseif (($p = strpos($file["NAME"], "authorize.php")) !== false) { $file["DESCRIPTION"] = GetMessage("MAIN_TEMPLATE_AUTH"); } elseif (($p = strpos($file["NAME"], "registration.php")) !== false) { $file["DESCRIPTION"] = GetMessage("MAIN_TEMPLATE_REG"); } } $arRes[] = $file; } $nTemplateLen = strlen($templPath . "/"); foreach ($arDirsTmp as $dir) { $arDir = $dir; $arDir["DEPTH_LEVEL"] = $depth; $arRes[] = $arDir; if ($depth < $maxDepth) { $dirPath = substr($arDir["ABS_PATH"], $nTemplateLen); $arRes = array_merge($arRes, CSiteTemplate::DirsRecursive($ID, $dirPath, $depth, $maxDepth)); } } return $arRes; }
public static function GetCurTemplate() { /** @noinspection PhpUnusedLocalVariableInspection */ global $APPLICATION, $USER, $CACHE_MANAGER; $connection = Main\Application::getConnection(); $helper = $connection->getSqlHelper(); $conditionQuoted = $helper->quote("CONDITION"); $siteTemplate = ""; if (CACHED_b_site_template === false) { $strSql = "\n\t\t\t\tSELECT\n\t\t\t\t\t" . $conditionQuoted . ",\n\t\t\t\t\tTEMPLATE\n\t\t\t\tFROM\n\t\t\t\t\tb_site_template\n\t\t\t\tWHERE\n\t\t\t\t\tSITE_ID='" . SITE_ID . "'\n\t\t\t\tORDER BY\n\t\t\t\t\tCASE\n\t\t\t\t\t\tWHEN " . $helper->getIsNullFunction($helper->getLengthFunction($conditionQuoted), 0) . "=0 THEN 2\n\t\t\t\t\t\tELSE 1\n\t\t\t\t\tEND,\n\t\t\t\t\tSORT\n\t\t\t\t"; $dbr = $connection->query($strSql); while ($ar = $dbr->fetch()) { $strCondition = trim($ar["CONDITION"]); if (strlen($strCondition) > 0 && !@eval("return " . $strCondition . ";")) { continue; } if (($path = getLocalPath("templates/" . $ar["TEMPLATE"], BX_PERSONAL_ROOT)) !== false && is_dir($_SERVER["DOCUMENT_ROOT"] . $path)) { $siteTemplate = $ar["TEMPLATE"]; break; } } } else { if ($CACHE_MANAGER->Read(CACHED_b_site_template, "b_site_template")) { $arSiteTemplateBySite = $CACHE_MANAGER->Get("b_site_template"); } else { $dbr = $connection->query("\n\t\t\t\t\tSELECT\n\t\t\t\t\t\t" . $conditionQuoted . ",\n\t\t\t\t\t\tTEMPLATE,\n\t\t\t\t\t\tSITE_ID\n\t\t\t\t\tFROM\n\t\t\t\t\t\tb_site_template\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\tSITE_ID,\n\t\t\t\t\t\tCASE\n\t\t\t\t\t\t\tWHEN " . $helper->getIsNullFunction($helper->getLengthFunction($conditionQuoted), 0) . "=0 THEN 2\n\t\t\t\t\t\t\tELSE 1\n\t\t\t\t\t\tEND,\n\t\t\t\t\t\tSORT\n\t\t\t\t"); $arSiteTemplateBySite = array(); while ($ar = $dbr->fetch()) { $arSiteTemplateBySite[$ar['SITE_ID']][] = $ar; } $CACHE_MANAGER->Set("b_site_template", $arSiteTemplateBySite); } if (is_array($arSiteTemplateBySite[SITE_ID])) { foreach ($arSiteTemplateBySite[SITE_ID] as $ar) { $strCondition = trim($ar["CONDITION"]); if (strlen($strCondition) > 0 && !@eval("return " . $strCondition . ";")) { continue; } if (($path = getLocalPath("templates/" . $ar["TEMPLATE"], BX_PERSONAL_ROOT)) !== false && is_dir($_SERVER["DOCUMENT_ROOT"] . $path)) { $siteTemplate = $ar["TEMPLATE"]; break; } } } } if ($siteTemplate == "") { $siteTemplate = ".default"; } $event = new Main\Event("main", "OnGetCurrentSiteTemplate", array("template" => $siteTemplate)); $event->send(); foreach ($event->getResults() as $evenResult) { if (($result = $evenResult->getParameters()) != '') { //only the first result matters $siteTemplate = $result; break; } } return $siteTemplate; }
require_once $_SERVER[___1676470017(346)] . BX_ROOT . ___1676470017(347) . $DBType . ___1676470017(348); require_once $_SERVER[___1676470017(349)] . BX_ROOT . ___1676470017(350) . $DBType . ___1676470017(351); require_once $_SERVER[___1676470017(352)] . BX_ROOT . ___1676470017(353); $GLOBALS['_____769810859'][13](___1676470017(354), ___1676470017(355), array(___1676470017(356), ___1676470017(357))); require_once $_SERVER[___1676470017(358)] . BX_ROOT . ___1676470017(359) . $DBType . ___1676470017(360); if ($GLOBALS['____450717392'][70]($_1922162857 = $_SERVER[___1676470017(361)] . BX_ROOT . ___1676470017(362))) { $US_HOST_PROCESS_MAIN = False; include $_1922162857; } if ($GLOBALS['____450717392'][71]($_1922162857 = $_SERVER[___1676470017(363)] . ___1676470017(364))) { include_once $_1922162857; } if (($_1922162857 = getLocalPath(___1676470017(365), BX_PERSONAL_ROOT)) !== false) { include_once $_SERVER[___1676470017(366)] . $_1922162857; } if (($_1922162857 = getLocalPath(___1676470017(367) . SITE_ID . ___1676470017(368), BX_PERSONAL_ROOT)) !== false) { include_once $_SERVER[___1676470017(369)] . $_1922162857; } if (!$GLOBALS['____450717392'][72](___1676470017(370))) { $GLOBALS['____450717392'][73](___1676470017(371), round(0 + 105 + 105 + 105 + 105)); } if (!$GLOBALS['____450717392'][74](___1676470017(372))) { $GLOBALS['____450717392'][75](___1676470017(373), round(0 + 98.59999999999999 + 98.59999999999999 + 98.59999999999999 + 98.59999999999999 + 98.59999999999999)); } $GLOBALS[___1676470017(374)] = $GLOBALS[___1676470017(375)]->{$GLOBALS}['_____769810859'][14](); if (!($GLOBALS['____450717392'][76](___1676470017(376)) && STATISTIC_ONLY && $GLOBALS['____450717392'][77]($GLOBALS[___1676470017(377)]->{$GLOBALS}['_____769810859'][15](), 1208 / 2 - 604, $GLOBALS['____450717392'][78](BX_ROOT . ___1676470017(378))) != BX_ROOT . ___1676470017(379)) && COption::$GLOBALS['_____769810859'][16](___1676470017(380), ___1676470017(381), ___1676470017(382)) == ___1676470017(383) && $GLOBALS['____450717392'][79](LANG_CHARSET) > 1152 / 2 - 576) { $GLOBALS['____450717392'][80](___1676470017(384) . LANG_CHARSET); } if (COption::$GLOBALS['_____769810859'][17](___1676470017(385), ___1676470017(386), ___1676470017(387)) == ___1676470017(388)) { $GLOBALS['____450717392'][81](___1676470017(389)); }
protected static function GetDescriptions($module) { static $descriptions = array(); if (preg_match("/[^a-z0-9._]/i", $module)) { return array(); } if (!isset($descriptions[$module])) { if (($path = getLocalPath("modules/" . $module . "/admin/operation_description.php")) !== false) { $descriptions[$module] = (include $_SERVER["DOCUMENT_ROOT"] . $path); } else { $descriptions[$module] = array(); } } return $descriptions[$module]; }
} else { echo str_replace("#RENT_DATE#", COption::GetOptionString('main', '~support_finish_date'), $bxProductConfig["saas"]["public_warning_expired"]); } } else { if ($daysToExpire == 0) { echo $bxProductConfig["saas"]["public_trial_expired"]; } } } elseif ($daysToExpire == 0) { echo GetMessage("expire_mess1"); } } if (COption::GetOptionString("main", "site_stopped", "N") == "Y" && !$USER->CanDoOperation('edit_other_settings')) { if (($siteClosed = getLocalPath("php_interface/" . LANG . "/site_closed.php", BX_PERSONAL_ROOT)) !== false) { include $_SERVER["DOCUMENT_ROOT"] . $siteClosed; } elseif (($siteClosed = getLocalPath("php_interface/include/site_closed.php", BX_PERSONAL_ROOT)) !== false) { include $_SERVER["DOCUMENT_ROOT"] . $siteClosed; } else { include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/site_closed.php"; } die; } $sPreviewFile = $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/tmp/templates/__bx_preview/header.php"; if (defined("SITE_TEMPLATE_PREVIEW_MODE") && file_exists($sPreviewFile)) { include_once $sPreviewFile; } else { \Bitrix\Main\Page\Asset::getInstance()->startTarget('TEMPLATE'); include_once $_SERVER["DOCUMENT_ROOT"] . SITE_TEMPLATE_PATH . "/header.php"; \Bitrix\Main\Page\Asset::getInstance()->startTarget('PAGE'); } /* Draw edit menu for whole content */
CHTTP::SetStatus(___1325703887(485)); die; } } if (!$GLOBALS['____291210897'][89](___1325703887(486)) || ADMIN_SECTION !== true) { if (isset($_REQUEST[___1325703887(487)]) && $_REQUEST[___1325703887(488)] != ___1325703887(489) && $GLOBALS[___1325703887(490)]->{$GLOBALS}['_____1480315984'][35](___1325703887(491))) { $_39336451 = CSiteTemplate::$GLOBALS['_____1480315984'][36]($_REQUEST[___1325703887(492)]); if ($_2091540869 = $_39336451->{$GLOBALS}['_____1480315984'][37]()) { $GLOBALS['____291210897'][90](___1325703887(493), $_2091540869[___1325703887(494)]); } else { $GLOBALS['____291210897'][91](___1325703887(495), CSite::GetCurTemplate()); } } else { $GLOBALS['____291210897'][92](___1325703887(496), CSite::GetCurTemplate()); } $GLOBALS['____291210897'][93](___1325703887(497), getLocalPath(___1325703887(498) . SITE_TEMPLATE_ID, BX_PERSONAL_ROOT)); } if (isset($_GET[___1325703887(499)])) { if ($_GET[___1325703887(500)] == ___1325703887(501) || $_GET[___1325703887(502)] == ___1325703887(503)) { $_SESSION[___1325703887(504)] = $_GET[___1325703887(505)]; } } if (isset($_GET[___1325703887(506)])) { if ($_GET[___1325703887(507)] == ___1325703887(508) || $_GET[___1325703887(509)] == ___1325703887(510)) { $_SESSION[___1325703887(511)] = $_GET[___1325703887(512)]; } } if (isset($_GET[___1325703887(513)]) && $_GET[___1325703887(514)] != ___1325703887(515)) { $GLOBALS[___1325703887(516)]->SetShowIncludeAreas($_GET[___1325703887(517)] == ___1325703887(518)); } if ($GLOBALS[___1325703887(519)]->{$GLOBALS}['_____1480315984'][38]()) {
} if (strpos($_REQUEST["back_url_settings"], '/') !== 0) { $_REQUEST["back_url_settings"] = ''; } IncludeModuleLangFile(__FILE__); $arModules = array("main" => array("PAGE" => $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/options.php", "NAME" => GetMessage("MAIN_KERNEL"), "SORT" => -1)); $adminPage->Init(); foreach ($adminPage->aModules as $module) { if ($APPLICATION->GetGroupRight($module) < "R") { continue; } if ($module == "main") { continue; } $ifile = getLocalPath("modules/" . $module . "/install/index.php"); $ofile = getLocalPath("modules/" . $module . "/options.php"); if ($ifile !== false && $ofile !== false) { $info = CModule::CreateModuleObject($module); $arModules[$module]["PAGE"] = $_SERVER["DOCUMENT_ROOT"] . $ofile; $arModules[$module]["NAME"] = $info->MODULE_NAME; $arModules[$module]["SORT"] = $info->MODULE_SORT; } } uasort($arModules, create_function('$a, $b', 'if($a["SORT"] == $b["SORT"]) return strcasecmp($a["NAME"], $b["NAME"]); return ($a["SORT"] < $b["SORT"])? -1 : 1;')); $mid = $_REQUEST["mid"]; if ($mid == "" || !isset($arModules[$mid]) || !file_exists($arModules[$mid]["PAGE"])) { $mid = "main"; } ob_start(); include $arModules[$mid]["PAGE"]; $strModuleSettingsTabs = ob_get_contents();
CHTTP::SetStatus(___253155201(485)); die; } } if (!$GLOBALS['____891427501'][89](___253155201(486)) || ADMIN_SECTION !== true) { if (isset($_REQUEST[___253155201(487)]) && $_REQUEST[___253155201(488)] != ___253155201(489) && $GLOBALS[___253155201(490)]->{$GLOBALS}['_____451545984'][35](___253155201(491))) { $_321599465 = CSiteTemplate::$GLOBALS['_____451545984'][36]($_REQUEST[___253155201(492)]); if ($_1102221243 = $_321599465->{$GLOBALS}['_____451545984'][37]()) { $GLOBALS['____891427501'][90](___253155201(493), $_1102221243[___253155201(494)]); } else { $GLOBALS['____891427501'][91](___253155201(495), CSite::GetCurTemplate()); } } else { $GLOBALS['____891427501'][92](___253155201(496), CSite::GetCurTemplate()); } $GLOBALS['____891427501'][93](___253155201(497), getLocalPath(___253155201(498) . SITE_TEMPLATE_ID, BX_PERSONAL_ROOT)); } if (isset($_GET[___253155201(499)])) { if ($_GET[___253155201(500)] == ___253155201(501) || $_GET[___253155201(502)] == ___253155201(503)) { $_SESSION[___253155201(504)] = $_GET[___253155201(505)]; } } if (isset($_GET[___253155201(506)])) { if ($_GET[___253155201(507)] == ___253155201(508) || $_GET[___253155201(509)] == ___253155201(510)) { $_SESSION[___253155201(511)] = $_GET[___253155201(512)]; } } if (isset($_GET[___253155201(513)]) && $_GET[___253155201(514)] != ___253155201(515)) { $GLOBALS[___253155201(516)]->SetShowIncludeAreas($_GET[___253155201(517)] == ___253155201(518)); } if ($GLOBALS[___253155201(519)]->{$GLOBALS}['_____451545984'][38]()) {
public static function CopyTemplate($componentName, $templateName, $siteTemplate, $newSiteTemplate, $newName = false, $bRewrite = false) { global $APPLICATION; $componentName = trim($componentName); if (strlen($componentName) <= 0) { $APPLICATION->ThrowException(GetMessage("comp_util_err1"), "EMPTY_COMPONENT_NAME"); return false; } $path2Comp = CComponentEngine::MakeComponentPath($componentName); if (strlen($path2Comp) <= 0) { $APPLICATION->ThrowException(str_replace("#NAME#", $componentName, GetMessage("comp_util_err2")), "ERROR_NOT_COMPONENT"); return false; } $componentPath = getLocalPath("components" . $path2Comp); if (!CComponentUtil::isComponent($componentPath)) { $APPLICATION->ThrowException(str_replace("#NAME#", $componentName, GetMessage("comp_util_err2")), "ERROR_NOT_COMPONENT"); return false; } if (strlen($templateName) <= 0) { $templateName = ".default"; } $templateNameTmp = preg_replace("#[^A-Za-z0-9_.-]#i", "", $templateName); if ($templateNameTmp != $templateName) { $APPLICATION->ThrowException(str_replace("#NAME#", $templateName, GetMessage("comp_util_err7")), "ERROR_BAD_TEMPLATE_NAME"); return false; } if (strlen($siteTemplate) <= 0) { $siteTemplate = false; } if ($siteTemplate != false) { $siteTemplateDir = getLocalPath("templates/" . $siteTemplate, BX_PERSONAL_ROOT); if ($siteTemplateDir === false || !is_dir($_SERVER["DOCUMENT_ROOT"] . $siteTemplateDir)) { $APPLICATION->ThrowException(str_replace("#NAME#", $siteTemplate, GetMessage("comp_util_err8")), "ERROR_NO_SITE_TEMPL"); return false; } } if ($siteTemplate != false) { $path = getLocalPath("templates/" . $siteTemplate . "/components" . $path2Comp . "/" . $templateName, BX_PERSONAL_ROOT); } else { $path = getLocalPath("components" . $path2Comp . "/templates/" . $templateName); } if ($path === false || !file_exists($_SERVER["DOCUMENT_ROOT"] . $path)) { $APPLICATION->ThrowException(str_replace("#C_NAME#", $componentName, str_replace("#T_NAME#", $templateName, GetMessage("comp_util_err9"))), "ERROR_NO_TEMPL"); return false; } if (strlen($newSiteTemplate) <= 0) { $APPLICATION->ThrowException(GetMessage("comp_util_err10"), "ERROR_EMPTY_SITE_TEMPL"); return false; } $newSiteTemplateDir = getLocalPath("templates/" . $newSiteTemplate, BX_PERSONAL_ROOT); if ($newSiteTemplateDir === false || !is_dir($_SERVER["DOCUMENT_ROOT"] . $newSiteTemplateDir)) { $APPLICATION->ThrowException(str_replace("#NAME#", $newSiteTemplate, GetMessage("comp_util_err8")), "ERROR_NO_SITE_TEMPL"); return false; } if ($siteTemplate !== false && $siteTemplate == $newSiteTemplate && ($newName === false || $newName !== false && $templateName == $newName)) { $APPLICATION->ThrowException(GetMessage("comp_util_err11"), "ERROR_DUPL1"); return false; } if ($newName !== false) { $templateNameNew = $newName; } else { $templateNameNew = $templateName; } $templateNameNewTmp = preg_replace("#[^A-Za-z0-9_.-]#i", "", $templateNameNew); if ($templateNameNewTmp != $templateNameNew) { $APPLICATION->ThrowException(str_replace("#NAME#", $templateNameNew, GetMessage("comp_util_err7")), "ERROR_BAD_TEMPLATE_NAME"); return false; } $pathNew = $newSiteTemplateDir . "/components" . $path2Comp . "/" . $templateNameNew; if (file_exists($_SERVER["DOCUMENT_ROOT"] . $pathNew)) { if (!$bRewrite) { $APPLICATION->ThrowException(str_replace("#NAME#", $templateNameNew, GetMessage("comp_util_err12")), "ERROR_EXISTS"); return false; } else { DeleteDirFilesEx($pathNew); } } CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . $path, $_SERVER["DOCUMENT_ROOT"] . $pathNew, true, true, false); return true; }
$_1344278139 = $_822381766->unsign($_REQUEST[___2022025961(553)], ___2022025961(554) . bitrix_sessid()); $_1711870086 = CSiteTemplate::$GLOBALS['_____499363063'][38]($_1344278139); if ($_151889002 = $_1711870086->{$GLOBALS}['_____499363063'][39]()) { $_751848921 = $_151889002[___2022025961(555)]; if (isset($_GET[___2022025961(556)]) && $_GET[___2022025961(557)] == ___2022025961(558) && $GLOBALS[___2022025961(559)]->{$GLOBALS}['_____499363063'][40](___2022025961(560))) { $GLOBALS['____1709102065'][141](___2022025961(561), true); } } } catch (\Bitrix\Main\Security\Sign\BadSignatureException $_584874849) { } } if ($_751848921 == ___2022025961(562)) { $_751848921 = CSite::GetCurTemplate(); } $GLOBALS['____1709102065'][142](___2022025961(563), $_751848921); $GLOBALS['____1709102065'][143](___2022025961(564), getLocalPath(___2022025961(565) . SITE_TEMPLATE_ID, BX_PERSONAL_ROOT)); } if (isset($_GET[___2022025961(566)])) { if ($_GET[___2022025961(567)] == ___2022025961(568) || $_GET[___2022025961(569)] == ___2022025961(570)) { $_SESSION[___2022025961(571)] = $_GET[___2022025961(572)]; } } if (isset($_GET[___2022025961(573)])) { if ($_GET[___2022025961(574)] == ___2022025961(575) || $_GET[___2022025961(576)] == ___2022025961(577)) { $_SESSION[___2022025961(578)] = $_GET[___2022025961(579)]; } } if (isset($_GET[___2022025961(580)]) && $_GET[___2022025961(581)] != ___2022025961(582)) { $GLOBALS[___2022025961(583)]->SetShowIncludeAreas($_GET[___2022025961(584)] == ___2022025961(585)); } if ($GLOBALS[___2022025961(586)]->{$GLOBALS}['_____499363063'][41]()) {
} OnModuleInstalledEvent($id); $Module->DoInstall(); LocalRedirect($APPLICATION->GetCurPage()."?lang=".LANG); } } } elseif(isset($_REQUEST["action"]) && $_REQUEST["action"] == "version_down") { require_once($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_js.php"); if($_REQUEST["id"] == "main") $fn = $_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/classes/general/version.php"; else $fn = $_SERVER["DOCUMENT_ROOT"].getLocalPath("modules/".preg_replace("/[^a-z0-9.]/", "", $_REQUEST["id"])."/install/version.php"); if(file_exists($fn) && is_file($fn)) { $fc = file_get_contents($fn); if(preg_match("/(\\d+)\\.(\\d+)\\.(\\d+)/", $fc, $match)) { if($match[3] > 20) $match[3] -= 10; elseif($match[3] > 0) $match[3] -= 1; else { $match[3] = 99; if($match[2] == 5) $match[2] = 0;
/** * Uninstall and remove module directory. */ public function remove() { if ($this->isRegistered()) { $this->unRegister(); } $path = getLocalPath('modules/' . $this->getName()); if ($path) { (new Filesystem())->remove($_SERVER['DOCUMENT_ROOT'] . $path); } unset($this->object); return $this; }
$code = ($arComponent["DATA"]["VARIABLE"] ? $arComponent["DATA"]["VARIABLE"] . "=" : "") . "\$APPLICATION->IncludeComponent(\"" . $arComponent["DATA"]["COMPONENT_NAME"] . "\", " . "\"" . $sTemplateName . "\", " . "array(\n\t" . PHPParser::ReturnPHPStr2($aPostValues) . "\n\t)" . ",\n\t" . (strlen($arComponent["DATA"]["PARENT_COMP"]) > 0 ? $arComponent["DATA"]["PARENT_COMP"] : "false") . (!empty($arComponent["DATA"]["FUNCTION_PARAMS"]) ? ",\n\t" . "array(\n\t" . PHPParser::ReturnPHPStr2($arComponent["DATA"]["FUNCTION_PARAMS"]) . "\n\t)" : "") . "\n);"; $filesrc_for_save = substr($filesrc, 0, $arComponent["START"]) . $code . substr($filesrc, $arComponent["END"]); $f = $io->GetFile($abs_path); $arUndoParams = array('module' => 'fileman', 'undoType' => 'edit_component_props', 'undoHandler' => 'CFileman::UndoEditFile', 'arContent' => array('absPath' => $abs_path, 'content' => $f->GetContents())); if ($APPLICATION->SaveFileContent($abs_path, $filesrc_for_save)) { CUndo::ShowUndoMessage(CUndo::Add($arUndoParams)); $obJSPopup->Close(); } else { $strWarning .= GetMessage("comp_prop_err_save") . "<br>"; } } } } $componentPath = CComponentEngine::MakeComponentPath($_GET["component_name"]); $arComponentDescription["ICON"] = ltrim($arComponentDescription["ICON"], "/"); $localPath = getLocalPath("components" . $componentPath); if ($localPath !== false && $arComponentDescription["ICON"] != "" && $io->FileExists($io->RelativeToAbsolutePath($localPath . "/" . $arComponentDescription["ICON"]))) { $sIcon = $localPath . "/" . $arComponentDescription["ICON"]; } else { $sIcon = "/bitrix/images/fileman/htmledit2/component.gif"; } $obJSPopup->StartDescription($sIcon); if ($arComponentDescription["NAME"] != "") { ?> <p title="<?php echo GetMessage("comp_prop_name"); ?> " class="title"><?php echo htmlspecialcharsbx($arComponentDescription["NAME"]); ?> </p>
} elseif (!$GLOBALS[___1149546406(506)]->{$GLOBALS}['_____296732968'][35]()) { $GLOBALS[___1149546406(507)]->LoginHitByHash(); } } if (!$GLOBALS['____787902325'][123](___1149546406(508)) || ADMIN_SECTION !== true) { if (isset($_REQUEST[___1149546406(509)]) && $_REQUEST[___1149546406(510)] != ___1149546406(511) && $GLOBALS[___1149546406(512)]->{$GLOBALS}['_____296732968'][36](___1149546406(513))) { $_1087376384 = CSiteTemplate::$GLOBALS['_____296732968'][37]($_REQUEST[___1149546406(514)]); if ($_451015458 = $_1087376384->{$GLOBALS}['_____296732968'][38]()) { $GLOBALS['____787902325'][124](___1149546406(515), $_451015458[___1149546406(516)]); } else { $GLOBALS['____787902325'][125](___1149546406(517), CSite::GetCurTemplate()); } } else { $GLOBALS['____787902325'][126](___1149546406(518), CSite::GetCurTemplate()); } $GLOBALS['____787902325'][127](___1149546406(519), getLocalPath(___1149546406(520) . SITE_TEMPLATE_ID, BX_PERSONAL_ROOT)); } if (isset($_GET[___1149546406(521)])) { if ($_GET[___1149546406(522)] == ___1149546406(523) || $_GET[___1149546406(524)] == ___1149546406(525)) { $_SESSION[___1149546406(526)] = $_GET[___1149546406(527)]; } } if (isset($_GET[___1149546406(528)])) { if ($_GET[___1149546406(529)] == ___1149546406(530) || $_GET[___1149546406(531)] == ___1149546406(532)) { $_SESSION[___1149546406(533)] = $_GET[___1149546406(534)]; } } if (isset($_GET[___1149546406(535)]) && $_GET[___1149546406(536)] != ___1149546406(537)) { $GLOBALS[___1149546406(538)]->SetShowIncludeAreas($_GET[___1149546406(539)] == ___1149546406(540)); } if ($GLOBALS[___1149546406(541)]->{$GLOBALS}['_____296732968'][39]()) {
function Init($modules) { /** @noinspection PhpUnusedLocalVariableInspection */ global $APPLICATION, $USER, $DB, $MESS; if($this->bInit) return; $this->bInit = true; $aOptMenu = CUserOptions::GetOption("admin_menu", "pos", array()); $this->AddOpenedSections($aOptMenu["sections"]); $aModuleMenu = array(); if(is_array($modules)) { foreach($modules as $module) { $module = _normalizePath($module); //trying to include file menu.php in the /admin/ folder of the current module $fname = getLocalPath("modules/".$module."/admin/menu.php"); if($fname !== false) { $menu = CAdminMenu::_IncludeMenu($_SERVER["DOCUMENT_ROOT"].$fname); if(is_array($menu) && !empty($menu)) { if(isset($menu["parent_menu"]) && $menu["parent_menu"] <> "") { //one section $aModuleMenu[] = $menu; } else { //multiple sections foreach($menu as $submenu) $aModuleMenu[] = $submenu; } } } } } //additional user menu $aMenuLinks = array(); if(file_exists($_SERVER["DOCUMENT_ROOT"].FX_ROOT."/admin/.left.menu.php")) include($_SERVER["DOCUMENT_ROOT"].FX_ROOT."/admin/.left.menu.php"); if(!empty($aMenuLinks)) { $bWasSeparator = false; $menu = array(); foreach($aMenuLinks as $module_menu) { if($module_menu[3]["SEPARATOR"] == "Y") { //first level if(!empty($menu)) $aModuleMenu[] = $menu; $menu = array( "parent_menu" => "global_menu_services", "icon" => "default_menu_icon", "page_icon" => "default_page_icon", "items_id"=>$module_menu[3]["SECTION_ID"], "items"=>array(), "sort"=>$module_menu[3]["SORT"], "text" => $module_menu[0], ); $bWasSeparator = true; } elseif($bWasSeparator && $module_menu[3]["SECTION_ID"] == "") { //section items $menu["items"][] = array( "text" => $module_menu[0], "title"=>$module_menu[3]["ALT"], "url" => $module_menu[1], "more_url"=>$module_menu[2], ); } elseif($module_menu[3]["SECTION_ID"] == "" || $module_menu[3]["SECTION_ID"] == "statistic" || $module_menu[3]["SECTION_ID"] == "sale") { //item in root $aModuleMenu[] = array( "parent_menu" => ($module_menu[3]["SECTION_ID"] == "statistic"? "global_menu_statistics" : ($module_menu[3]["SECTION_ID"] == "sale"? "global_menu_store":"global_menu_services")), "icon" => "default_menu_icon", "page_icon" => "default_page_icon", "sort"=>$module_menu[3]["SORT"], "text" => $module_menu[0], "title"=>$module_menu[3]["ALT"], "url" => $module_menu[1], "more_url"=>$module_menu[2], ); } else { //item in section foreach($aModuleMenu as $i=>$section) { if($section["section"] == $module_menu[3]["SECTION_ID"]) { if(!is_array($aModuleMenu[$i]["items"])) $aModuleMenu[$i]["items"] = array(); $aModuleMenu[$i]["items"][] = array( "text" => $module_menu[0], "title"=>$module_menu[3]["ALT"], "url" => $module_menu[1], "more_url"=>$module_menu[2], ); break; } } } } if(!empty($menu)) $aModuleMenu[] = $menu; } $this->aGlobalMenu = array( "global_menu_content" => array( "menu_id" => "content", //"icon" => "button_content", "page_icon" => "content_title_icon", "index_icon" => "content_page_icon", "text" => GetMessage("admin_lib_menu_content"), "title" => GetMessage("admin_lib_menu_content_title"), "sort" => 100, "items_id" => "global_menu_content", "help_section" => "content", "items" => array() ), "global_menu_services" => array( "menu_id" => "services", //"icon" => "button_services", "page_icon" => "services_title_icon", "index_icon" => "services_page_icon", "text" => GetMessage("admin_lib_menu_services"), "title" => GetMessage("admin_lib_menu_service_title"), "sort" => 200, "items_id" => "global_menu_services", "help_section" => "service", "items" => array() ), "global_menu_store" => array( "menu_id" => "store", //"icon" => "button_store", "page_icon" => "store_title_icon", "index_icon" => "store_page_icon", "text" => GetMessage("admin_lib_menu_store"), "title" => GetMessage("admin_lib_menu_store_title"), "sort" => 300, "items_id" => "global_menu_store", "help_section" => "store", "items" => array() ), "global_menu_statistics" => array( "menu_id" => "analytics", //"icon" => "button_statistics", "page_icon" => "statistics_title_icon", "index_icon" => "statistics_page_icon", "text" => GetMessage("admin_lib_menu_stat"), "title" => GetMessage("admin_lib_menu_stat_title"), "sort" => 400, "items_id" => "global_menu_statistics", "help_section" => "statistic", "items" => array() ), "global_menu_settings" => array( "menu_id" => "settings", //"icon" => "button_settings", "page_icon" => "settings_title_icon", "index_icon" => "settings_page_icon", "text" => GetMessage("admin_lib_menu_settings"), "title" => GetMessage("admin_lib_menu_settings_title"), "sort" => 500, "items_id" => "global_menu_settings", "help_section" => "settings", "items" => array() ), ); //User defined global sections $bSort = false; foreach(GetModuleEvents("main", "OnBuildGlobalMenu", true) as $arEvent) { $bSort = true; $arRes = ExecuteModuleEventEx($arEvent, array(&$this->aGlobalMenu, &$aModuleMenu)); if(is_array($arRes)) $this->aGlobalMenu = array_merge($this->aGlobalMenu, $arRes); } if($bSort) uasort($this->aGlobalMenu, array($this, '_sort')); foreach($aModuleMenu as $menu) $this->aGlobalMenu[$menu["parent_menu"]]["items"][] = $menu; $sort_func = array($this, '_sort'); foreach($this->aGlobalMenu as $key => $menu) { if(empty($menu["items"]) && $key != "global_menu_desktop") { unset($this->aGlobalMenu[$key]); } elseif(is_array($this->aGlobalMenu[$key]["items"])) { usort($this->aGlobalMenu[$key]["items"], $sort_func); } } foreach($this->aGlobalMenu as $key=>$menu) if($this->_SetActiveItems($this->aGlobalMenu[$key])) break; }
function GetAllTemplateParams($templateID, $site, $findcomponent = true, $arAdditionalParams = array()) { global $APPLICATION; $db_templ = CSiteTemplate::GetByID($templateID); if (!($ar_templ = $db_templ->Fetch())) { $templateID = ""; $db_site_templ = CSite::GetTemplateList($site); while ($ar_site_templ = $db_site_templ->Fetch()) { if (strlen($ar_site_templ["CONDITION"]) <= 0) { $templateID = $ar_site_templ["TEMPLATE"]; break; } } if (strlen($templateID) > 0) { $db_templ = CSiteTemplate::GetByID($templateID); $ar_templ = $db_templ->Fetch(); } } if ($ar_templ) { $arResult = array("ID" => $ar_templ["ID"], "NAME" => $ar_templ["NAME"]); if (is_set($ar_templ, "STYLES")) { // Fetch @import and include it to CSS - will include css from comments also :(. $pattern = '/^@import(.*)$/im'; $matches = array(); if (preg_match_all($pattern, $ar_templ["STYLES"], $matches)) { for ($j = 0, $l = count($matches[0]); $j < $l; $j++) { $str = $matches[0][$j]; $url = trim(trim($matches[1][$j]), '"\';'); $css = ""; if (substr($url, -5) != 'print') { $url = trim(trim($url), ' "\';'); if (substr($url, 0, 4) == 'url(' && substr($url, -1) == ')') { $url = trim(substr($url, 4, -1), ' "\''); } $url = trim(trim($url), '\'";'); if (substr($url, 0, 1) != '/' && file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . $ar_templ["ID"] . "/" . $url)) { $css = "\n" . $APPLICATION->GetFileContent($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . $ar_templ["ID"] . "/" . $url) . "\n"; } else { if (file_exists($_SERVER["DOCUMENT_ROOT"] . $url)) { $css = "\n" . $APPLICATION->GetFileContent($_SERVER["DOCUMENT_ROOT"] . $url) . "\n"; } } } $ar_templ["STYLES"] = str_replace($matches[0][$j], $css, $ar_templ["STYLES"]); } } $arResult["STYLES"] = $ar_templ["STYLES"]; $arResult["STYLES_TITLE"] = $ar_templ["STYLES_TITLE"]; $arResult["EDITOR_STYLES"] = $ar_templ["EDITOR_STYLES"]; } } else { $arResult = array("ID" => ".default", "NAME" => GetMessage("FILEMAN_DDEF_TEMPLATE")); $templateID = ""; } if (!is_set($arResult, "STYLES") || $arResult["STYLES"] == false) { if (file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/php_interface/" . (strlen($site) <= 0 ? LANGUAGE_ID : $site) . "/styles.css")) { $arResult["STYLES"] = $APPLICATION->GetFileContent($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/php_interface/" . (strlen($site) <= 0 ? LANGUAGE_ID : $site) . "/styles.css"); $arResult["STYLES_TITLE"] = CSiteTemplate::__GetByStylesTitle($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/php_interface/" . (strlen($site) <= 0 ? LANGUAGE_ID : $site) . "/.styles.php"); } elseif (file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/php_interface/styles.css")) { $arResult["STYLES"] = $APPLICATION->GetFileContent($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/php_interface/styles.css"); $arResult["STYLES_TITLE"] = CSiteTemplate::__GetByStylesTitle($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/php_interface/.styles.php"); } else { $arResult["STYLES"] = $APPLICATION->GetFileContent($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/.default/styles.css"); $arResult["STYLES_TITLE"] = CSiteTemplate::__GetByStylesTitle($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/.default/.styles.php"); } } if (isset($arAdditionalParams['additionalCSS'])) { $additionalCSS = $arAdditionalParams['additionalCSS']; for ($i = 0, $l = count($additionalCSS); $i < $l; $i++) { $css_file_path = $additionalCSS[$i]; $arResult["STYLES"] .= "\r\n" . $APPLICATION->GetFileContent($css_file_path); } } if (strlen($templateID) > 0 && file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . $templateID . "/editor.css")) { $arResult["STYLES"] .= "\r\n" . $APPLICATION->GetFileContent($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . $templateID . "/editor.css"); } elseif (file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/.default/editor.css")) { $arResult["STYLES"] .= "\r\n" . $APPLICATION->GetFileContent($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/.default/editor.css"); } elseif (file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/php_interface/" . $site . "/editor.css")) { $arResult["STYLES"] .= "\r\n" . $APPLICATION->GetFileContent($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/php_interface/" . (strlen($site) <= 0 ? LANGUAGE_ID : $site) . "/editor.css"); } elseif (file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/php_interface/editor.css")) { $arResult["STYLES"] .= "\r\n" . $APPLICATION->GetFileContent($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/php_interface/editor.css"); } $arResult["STYLES"] = preg_replace("/\r\n/", " ", $arResult["STYLES"]); $arResult["STYLES"] = preg_replace("/\n/", " ", $arResult["STYLES"]); $arResult["SITE_TEMPLATE_PATH"] = getLocalPath('templates/' . $templateID, BX_PERSONAL_ROOT); return $arResult; }