本文整理汇总了PHP中WizardServices::GetTemplatesPath方法的典型用法代码示例。如果您正苦于以下问题:PHP WizardServices::GetTemplatesPath方法的具体用法?PHP WizardServices::GetTemplatesPath怎么用?PHP WizardServices::GetTemplatesPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WizardServices
的用法示例。
在下文中一共展示了WizardServices::GetTemplatesPath方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowStep
function ShowStep()
{
$wizard =& $this->GetWizard();
$templatesPath = WizardServices::GetTemplatesPath($wizard->GetPath() . "/site");
$arTemplates = WizardServices::GetTemplates($templatesPath);
/*if (empty($arTemplates))
return; */
$arTemplateOrder = array();
if (in_array("eshop_adapt", array_keys($arTemplates))) {
$arTemplateOrder[] = "eshop_adapt_horizontal";
// $arTemplateOrder[] = "eshop_adapt_vertical";
}
if (in_array("eshop", array_keys($arTemplates))) {
$arTemplateOrder[] = "eshop_horizontal";
$arTemplateOrder[] = "eshop_vertical";
$arTemplateOrder[] = "eshop_vertical_popup";
}
$defaultTemplateID = COption::GetOptionString("main", "wizard_template_id", "eshop_adapt_horizontal", $wizard->GetVar("siteID"));
if (!in_array($defaultTemplateID, array("eshop_adapt_horizontal", "eshop_adapt_vertical", "eshop_vertical", "eshop_horizontal", "eshop_vertical_popup"))) {
$defaultTemplateID = "eshop_adapt_horizontal";
}
$wizard->SetDefaultVar("wizTemplateID", $defaultTemplateID);
$arTemplateInfo = array("eshop_adapt_horizontal" => array("NAME" => GetMessage("WIZ_TEMPLATE_ADAPT_HORIZONTAL"), "DESCRIPTION" => "", "PREVIEW" => $wizard->GetPath() . "/site/templates/eshop_adapt/images/" . LANGUAGE_ID . "/preview_horizontal.gif", "SCREENSHOT" => $wizard->GetPath() . "/site/templates/eshop_adapt/images/" . LANGUAGE_ID . "/screen_horizontal.gif"), "eshop_adapt_vertical" => array("NAME" => GetMessage("WIZ_TEMPLATE_ADAPT_VERTICAL"), "DESCRIPTION" => "", "PREVIEW" => $wizard->GetPath() . "/site/templates/eshop_adapt/images/" . LANGUAGE_ID . "/preview_vertical.gif", "SCREENSHOT" => $wizard->GetPath() . "/site/templates/eshop_adapt/images/" . LANGUAGE_ID . "/screen_vertical.gif"), "eshop_horizontal" => array("NAME" => GetMessage("WIZ_TEMPLATE_HORIZONTAL"), "DESCRIPTION" => "", "PREVIEW" => $wizard->GetPath() . "/site/templates/eshop/lang/" . LANGUAGE_ID . "/preview_horizontal.gif", "SCREENSHOT" => $wizard->GetPath() . "/site/templates/eshop/lang/" . LANGUAGE_ID . "/screen_horizontal.gif"), "eshop_vertical" => array("NAME" => GetMessage("WIZ_TEMPLATE_VERTICAL"), "DESCRIPTION" => "", "PREVIEW" => $wizard->GetPath() . "/site/templates/eshop/lang/" . LANGUAGE_ID . "/preview_vertical.gif", "SCREENSHOT" => $wizard->GetPath() . "/site/templates/eshop/lang/" . LANGUAGE_ID . "/screen_vertical.gif"), "eshop_vertical_popup" => array("NAME" => GetMessage("WIZ_TEMPLATE_VERTICAL_POPUP"), "DESCRIPTION" => "", "PREVIEW" => $wizard->GetPath() . "/site/templates/eshop/lang/" . LANGUAGE_ID . "/preview_vertical_popup.gif", "SCREENSHOT" => $wizard->GetPath() . "/site/templates/eshop/lang/" . LANGUAGE_ID . "/screen_vertical_popup.gif"));
// $this->content .= "<input type='hidden' value='eshop' name='templateID' id='templateID'>";//$this->ShowInputField('hidden', 'templateID', array("id" => "templateID", "value" => "eshop"));
global $SHOWIMAGEFIRST;
$SHOWIMAGEFIRST = true;
$this->content .= '<div class="inst-template-list-block">';
foreach ($arTemplateOrder as $templateID) {
$arTemplate = $arTemplateInfo[$templateID];
if (!$arTemplate) {
continue;
}
$this->content .= '<div class="inst-template-description">';
$this->content .= $this->ShowRadioField("wizTemplateID", $templateID, array("id" => $templateID, "class" => "inst-template-list-inp"));
global $SHOWIMAGEFIRST;
$SHOWIMAGEFIRST = true;
if ($arTemplate["SCREENSHOT"] && $arTemplate["PREVIEW"]) {
$this->content .= CFile::Show2Images($arTemplate["PREVIEW"], $arTemplate["SCREENSHOT"], 150, 150, ' class="inst-template-list-img"');
} else {
$this->content .= CFile::ShowImage($arTemplate["SCREENSHOT"], 150, 150, ' class="inst-template-list-img"', "", true);
}
$this->content .= '<label for="' . $templateID . '" class="inst-template-list-label">' . $arTemplate["NAME"] . "</label>";
$this->content .= "</div>";
}
$this->content .= "</div>";
}
示例2: InstallService
function InstallService($serviceID, $serviceStage)
{
$wizard =& $this->GetWizard();
$siteID = WizardServices::GetCurrentSiteID($wizard->GetVar("siteID"));
define("WIZARD_SITE_ID", $siteID);
define("WIZARD_SITE_ROOT_PATH", $_SERVER["DOCUMENT_ROOT"]);
$rsSites = CSite::GetByID($siteID);
if ($arSite = $rsSites->Fetch()) {
define("WIZARD_SITE_DIR", $arSite["DIR"]);
} else {
define("WIZARD_SITE_DIR", "/");
}
define("WIZARD_SITE_PATH", str_replace("//", "/", WIZARD_SITE_ROOT_PATH . "/" . WIZARD_SITE_DIR . "/"));
$wizardPath = $wizard->GetPath();
define("WIZARD_RELATIVE_PATH", $wizardPath);
define("WIZARD_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . $wizardPath);
$templatesPath = WizardServices::GetTemplatesPath(WIZARD_RELATIVE_PATH . "/site");
$arTemplates = WizardServices::GetTemplates($templatesPath);
$templateID = $wizard->GetVar("templateID");
define("WIZARD_TEMPLATE_ID", $templateID);
define("WIZARD_TEMPLATE_RELATIVE_PATH", $templatesPath . "/" . WIZARD_TEMPLATE_ID);
define("WIZARD_TEMPLATE_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . WIZARD_TEMPLATE_RELATIVE_PATH);
$themeID = $wizard->GetVar($templateID . "_themeID");
$arThemes = WizardServices::GetThemes(WIZARD_TEMPLATE_RELATIVE_PATH . "/themes");
define("WIZARD_THEME_ID", $themeID);
define("WIZARD_THEME_RELATIVE_PATH", WIZARD_TEMPLATE_RELATIVE_PATH . "/themes/" . WIZARD_THEME_ID);
define("WIZARD_THEME_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . WIZARD_THEME_RELATIVE_PATH);
$servicePath = WIZARD_RELATIVE_PATH . "/site/services/" . $serviceID;
define("WIZARD_SERVICE_RELATIVE_PATH", $servicePath);
define("WIZARD_SERVICE_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . $servicePath);
define("WIZARD_IS_RERUN", $_SERVER["PHP_SELF"] != "/index.php");
define("WIZARD_SITE_LOGO", intval($wizard->GetVar("siteLogo")));
define("WIZARD_INSTALL_DEMO_DATA", $wizard->GetVar("installDemoData") == "Y");
define("WIZARD_REINSTALL_DATA", false);
define("WIZARD_FIRST_INSTAL", $firstStep = COption::GetOptionString("main", "wizard_first" . substr($wizard->GetID(), 7) . "_" . $wizard->GetVar("siteID"), false, $wizard->GetVar("siteID")));
$dbUsers = CGroup::GetList($by = "id", $order = "asc", array("ACTIVE" => "Y"));
while ($arUser = $dbUsers->Fetch()) {
define("WIZARD_" . $arUser["STRING_ID"] . "_GROUP", $arUser["ID"]);
}
if (!file_exists(WIZARD_SERVICE_ABSOLUTE_PATH . "/" . $serviceStage)) {
return false;
}
if (LANGUAGE_ID != "en" && LANGUAGE_ID != "ru") {
if (file_exists($fname = WIZARD_SERVICE_ABSOLUTE_PATH . "/lang/" . LangSubst(LANGUAGE_ID) . "/" . $serviceStage)) {
__IncludeLang($fname, false, true);
}
}
if (file_exists($fname = WIZARD_SERVICE_ABSOLUTE_PATH . "/lang/" . LANGUAGE_ID . "/" . $serviceStage)) {
__IncludeLang($fname, false, true);
}
@set_time_limit(3600);
global $DB, $DBType, $APPLICATION, $USER, $CACHE_MANAGER;
include WIZARD_SERVICE_ABSOLUTE_PATH . "/" . $serviceStage;
}
示例3: CopyDirFiles
//echo "WIZARD_ABSOLUTE_PATH=".WIZARD_ABSOLUTE_PATH." | ";
//echo "WIZARD_TEMPLATE_ID=".WIZARD_TEMPLATE_ID." | ";
//echo "WIZARD_TEMPLATE_RELATIVE_PATH=".WIZARD_TEMPLATE_RELATIVE_PATH." | ";
//echo "WIZARD_TEMPLATE_ABSOLUTE_PATH=".WIZARD_TEMPLATE_ABSOLUTE_PATH." | ";
//echo "WIZARD_THEME_ID=".WIZARD_THEME_ID." | ";
//echo "WIZARD_THEME_RELATIVE_PATH=".WIZARD_THEME_RELATIVE_PATH." | ";
//echo "WIZARD_THEME_ABSOLUTE_PATH=".WIZARD_THEME_ABSOLUTE_PATH." | ";
//echo "WIZARD_SERVICE_RELATIVE_PATH=".WIZARD_SERVICE_RELATIVE_PATH." | ";
//echo "WIZARD_SERVICE_ABSOLUTE_PATH=".WIZARD_SERVICE_ABSOLUTE_PATH." | ";
//echo "WIZARD_IS_RERUN=".WIZARD_IS_RERUN." | ";
//die();
if (!defined("WIZARD_TEMPLATE_ID")) {
return;
}
$bitrixTemplateDir = $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . WIZARD_TEMPLATE_ID;
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . WizardServices::GetTemplatesPath(WIZARD_RELATIVE_PATH . "/site") . "/" . WIZARD_TEMPLATE_ID, $bitrixTemplateDir, $rewrite = true, $recursive = true, $delete_after_copy = false);
//Attach template to default site
$obSite = CSite::GetList($by = "def", $order = "desc", array("LID" => WIZARD_SITE_ID));
if ($arSite = $obSite->Fetch()) {
$arTemplates = array();
$found = false;
$foundEmpty = false;
$obTemplate = CSite::GetTemplateList($arSite["LID"]);
while ($arTemplate = $obTemplate->Fetch()) {
if (!$found && strlen(trim($arTemplate["CONDITION"])) <= 0) {
$arTemplate["TEMPLATE"] = WIZARD_TEMPLATE_ID;
$found = true;
}
if ($arTemplate["TEMPLATE"] == "empty") {
$foundEmpty = true;
continue;
示例4: ShowStep
function ShowStep()
{
$wizard =& $this->GetWizard();
$templatesPath = WizardServices::GetTemplatesPath($wizard->GetPath() . "/site");
$arTemplates = WizardServices::GetTemplates($templatesPath);
/*if (empty($arTemplates))
return; */
$arTemplateOrder = array();
$arT = array("youstore_default");
if (in_array("youstore", array_keys($arTemplates))) {
$arTemplateOrder = $arT;
}
$defaultTemplateID = COption::GetOptionString("main", "wizard_template_id", "youstore_default", $wizard->GetVar("siteID"));
if (!in_array($defaultTemplateID, $arT)) {
$defaultTemplateID = "youstore_();";
}
$wizard->SetDefaultVar("wizTemplateID", $defaultTemplateID);
$arTemplateInfo = array();
$arThemes = array("default");
foreach ($arThemes as $templ) {
$arTemplateInfo['youstore_' . $templ] = array("NAME" => GetMessage("WIZ_TEMPLATE_youstore_" . $templ), "DESCRIPTION" => "", "PREVIEW" => $wizard->GetPath() . "/images/ru/small/" . $templ . ".png", "SCREENSHOT" => $wizard->GetPath() . "/images/ru/big/" . $templ . ".png");
}
// $this->content .= "<input type='hidden' value='youstore' name='templateID' id='templateID'>";//$this->ShowInputField('hidden', 'templateID', array("id" => "templateID", "value" => "youstore"));
global $SHOWIMAGEFIRST;
$SHOWIMAGEFIRST = true;
$this->content .= '<div class="inst-template-list-block">';
foreach ($arTemplateOrder as $templateID) {
$arTemplate = $arTemplateInfo[$templateID];
if (!$arTemplate) {
continue;
}
$this->content .= '<div class="inst-template-description">';
$this->content .= $this->ShowRadioField("wizTemplateID", $templateID, array("id" => $templateID, "class" => "inst-template-list-inp"));
global $SHOWIMAGEFIRST;
$SHOWIMAGEFIRST = true;
if ($arTemplate["SCREENSHOT"] && $arTemplate["PREVIEW"]) {
$this->content .= CFile::Show2Images($arTemplate["PREVIEW"], $arTemplate["SCREENSHOT"], 150, 150, ' class="inst-template-list-img"');
} else {
$this->content .= CFile::ShowImage($arTemplate["SCREENSHOT"], 150, 150, ' class="inst-template-list-img"', "", true);
}
$this->content .= '<label for="' . $templateID . '" class="inst-template-list-label">' . $arTemplate["NAME"] . "</label>";
$this->content .= "</div>";
}
$this->content .= "</div>";
$this->content .= '<script>
function ImgShw(ID, width, height, alt)
{
var scroll = "no";
var top=0, left=0;
if(width > screen.width-10 || height > screen.height-28) scroll = "yes";
if(height < screen.height-28) top = Math.floor((screen.height - height)/2-14);
if(width < screen.width-10) left = Math.floor((screen.width - width)/2-5);
width = Math.min(width, screen.width-10);
height = Math.min(height, screen.height-28);
var wnd = window.open("","","scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",left="+left+",top="+top);
wnd.document.write(
"<html><head>"+
"<"+"script type=\\"text/javascript\\">"+
"function KeyPress()"+
"{"+
" if(window.event.keyCode == 27) "+
" window.close();"+
"}"+
"</"+"script>"+
"<title></title></head>"+
"<body topmargin=\\"0\\" leftmargin=\\"0\\" marginwidth=\\"0\\" marginheight=\\"0\\" onKeyPress=\\"KeyPress()\\">"+
"<img src=\\""+ID+"\\" border=\\"0\\" alt=\\""+alt+"\\" />"+
"</body></html>"
);
wnd.document.close();
}
</script>';
}
示例5: define
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!defined("WIZARD_TEMPLATE_ID")) {
return;
}
if (!defined("WIZARD_TEMPLATE_ID")) {
define("WIZARD_TEMPLATE_ID", "webfly_san");
}
$bitrixTemplateDir = $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . WIZARD_TEMPLATE_ID;
$pathFrom = $_SERVER["DOCUMENT_ROOT"] . WizardServices::GetTemplatesPath(WIZARD_RELATIVE_PATH . "/site") . "/" . WIZARD_TEMPLATE_ID;
CopyDirFiles($pathFrom, $bitrixTemplateDir, $rewrite = true, $recursive = true, $delete_after_copy = false);
COption::SetOptionString("webfly.santech", "wizard_template_id", WIZARD_TEMPLATE_ID, false, WIZARD_SITE_ID);
示例6: CopyDirFiles
//echo "WIZARD_TEMPLATE_ID=".WIZARD_TEMPLATE_ID." | ";
//echo "WIZARD_TEMPLATE_RELATIVE_PATH=".WIZARD_TEMPLATE_RELATIVE_PATH." | ";
//echo "WIZARD_TEMPLATE_ABSOLUTE_PATH=".WIZARD_TEMPLATE_ABSOLUTE_PATH." | ";
//echo "WIZARD_THEME_ID=".WIZARD_THEME_ID." | ";
//echo "WIZARD_THEME_RELATIVE_PATH=".WIZARD_THEME_RELATIVE_PATH." | ";
//echo "WIZARD_THEME_ABSOLUTE_PATH=".WIZARD_THEME_ABSOLUTE_PATH." | ";
//echo "WIZARD_SERVICE_RELATIVE_PATH=".WIZARD_SERVICE_RELATIVE_PATH." | ";
//echo "WIZARD_SERVICE_ABSOLUTE_PATH=".WIZARD_SERVICE_ABSOLUTE_PATH." | ";
//echo "WIZARD_IS_RERUN=".WIZARD_IS_RERUN." | ";
//die();
if (!defined("WIZARD_TEMPLATE_ID")) {
return;
}
$bitrixTemplateDir = $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . WIZARD_TEMPLATE_ID . "_" . WIZARD_THEME_ID;
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . WizardServices::GetTemplatesPath(WIZARD_RELATIVE_PATH . "/site") . "/" . WIZARD_TEMPLATE_ID, $bitrixTemplateDir, $rewrite = true, $recursive = true, $delete_after_copy = false, $exclude = "themes");
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . WizardServices::GetTemplatesPath(WIZARD_RELATIVE_PATH . "/site") . "/" . WIZARD_TEMPLATE_ID . "/lang/" . LANGUAGE_ID . "/images/", $bitrixTemplateDir, $rewrite = true, $recursive = true);
//Attach template to default site
$obSite = CSite::GetList($by = "def", $order = "desc", array("LID" => WIZARD_SITE_ID));
if ($arSite = $obSite->Fetch()) {
$arTemplates = array();
$found = false;
$foundEmpty = false;
$obTemplate = CSite::GetTemplateList($arSite["LID"]);
while ($arTemplate = $obTemplate->Fetch()) {
if (!$found && strlen(trim($arTemplate["CONDITION"])) <= 0) {
$arTemplate["TEMPLATE"] = WIZARD_TEMPLATE_ID . "_" . WIZARD_THEME_ID;
$found = true;
}
if ($arTemplate["TEMPLATE"] == "empty") {
$foundEmpty = true;
continue;
示例7: ShowStep
function ShowStep()
{
$wizard =& $this->GetWizard();
$templatesPath = WizardServices::GetTemplatesPath($wizard->GetPath()."/site");
$arTemplates = WizardServices::GetTemplates($templatesPath);
/*if (empty($arTemplates))
return; */
$arTemplateOrder = array();
if (in_array("eshop_adapt", array_keys($arTemplates)))
{
$arTemplateOrder[] = "eshop_adapt_horizontal";
}
if (in_array("eshop", array_keys($arTemplates)))
{
$arTemplateOrder[] = "eshop_horizontal";
$arTemplateOrder[] = "eshop_vertical";
$arTemplateOrder[] = "eshop_vertical_popup";
}
$defaultTemplateID = COption::GetOptionString("main", "wizard_template_id", "eshop_adapt_horizontal", $wizard->GetVar("siteID"));
if (!in_array($defaultTemplateID, array("eshop_adapt_horizontal", "eshop_vertical", "eshop_horizontal", "eshop_vertical_popup"))) $defaultTemplateID = "eshop_adapt_horizontal";
$wizard->SetDefaultVar("wizTemplateID", $defaultTemplateID);
$arTemplateInfo = array(
"eshop_adapt_horizontal" => array(
"NAME" => GetMessage("WIZ_TEMPLATE_ADAPT_HORIZONTAL"),
"DESCRIPTION" => "",
"PREVIEW" => $wizard->GetPath()."/site/templates/eshop_adapt/images/".LANGUAGE_ID."/preview_horizontal.gif",
"SCREENSHOT" => $wizard->GetPath()."/site/templates/eshop_adapt/images/".LANGUAGE_ID."/screen_horizontal.gif",
),
"eshop_horizontal" => array(
"NAME" => GetMessage("WIZ_TEMPLATE_HORIZONTAL"),
"DESCRIPTION" => "",
"PREVIEW" => $wizard->GetPath()."/site/templates/eshop/lang/".LANGUAGE_ID."/preview_horizontal.gif",
"SCREENSHOT" => $wizard->GetPath()."/site/templates/eshop/lang/".LANGUAGE_ID."/screen_horizontal.gif",
),
"eshop_vertical" => array(
"NAME" => GetMessage("WIZ_TEMPLATE_VERTICAL"),
"DESCRIPTION" => "",
"PREVIEW" => $wizard->GetPath()."/site/templates/eshop/lang/".LANGUAGE_ID."/preview_vertical.gif",
"SCREENSHOT" => $wizard->GetPath()."/site/templates/eshop/lang/".LANGUAGE_ID."/screen_vertical.gif",
),
"eshop_vertical_popup" => array(
"NAME" => GetMessage("WIZ_TEMPLATE_VERTICAL_POPUP"),
"DESCRIPTION" => "",
"PREVIEW" => $wizard->GetPath()."/site/templates/eshop/lang/".LANGUAGE_ID."/preview_vertical_popup.gif",
"SCREENSHOT" => $wizard->GetPath()."/site/templates/eshop/lang/".LANGUAGE_ID."/screen_vertical_popup.gif",
),
);
// $this->content .= "<input type='hidden' value='eshop' name='templateID' id='templateID'>";//$this->ShowInputField('hidden', 'templateID', array("id" => "templateID", "value" => "eshop"));
global $SHOWIMAGEFIRST;
$SHOWIMAGEFIRST = true;
$this->content .= '<div class="inst-template-list-block">';
foreach ($arTemplateOrder as $templateID)
{
$arTemplate = $arTemplateInfo[$templateID];
if (!$arTemplate)
continue;
$this->content .= '<div class="inst-template-description">';
$this->content .= $this->ShowRadioField("wizTemplateID", $templateID, Array("id" => $templateID, "class" => "inst-template-list-inp"));
global $SHOWIMAGEFIRST;
$SHOWIMAGEFIRST = true;
if ($arTemplate["SCREENSHOT"] && $arTemplate["PREVIEW"])
$this->content .= CFile::Show2Images($arTemplate["PREVIEW"], $arTemplate["SCREENSHOT"], 150, 150, ' class="inst-template-list-img"');
else
$this->content .= CFile::ShowImage($arTemplate["SCREENSHOT"], 150, 150, ' class="inst-template-list-img"', "", true);
$this->content .= '<label for="'.$templateID.'" class="inst-template-list-label">'.$arTemplate["NAME"]."</label>";
$this->content .= "</div>";
}
$this->content .= "</div>";
$this->content .= '<script>
function ImgShw(ID, width, height, alt)
{
var scroll = "no";
var top=0, left=0;
if(width > screen.width-10 || height > screen.height-28) scroll = "yes";
if(height < screen.height-28) top = Math.floor((screen.height - height)/2-14);
if(width < screen.width-10) left = Math.floor((screen.width - width)/2-5);
width = Math.min(width, screen.width-10);
height = Math.min(height, screen.height-28);
var wnd = window.open("","","scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",left="+left+",top="+top);
wnd.document.write(
"<html><head>"+
"<"+"script type=\"text/javascript\">"+
"function KeyPress()"+
"{"+
//.........这里部分代码省略.........
示例8: InstallService
function InstallService($serviceID, $serviceStage)
{
$wizard =& $this->GetWizard();
$siteID = WizardServices::GetCurrentSiteID($wizard->GetVar("siteID"));
define("WIZARD_SITE_ID", $siteID);
define("WIZARD_SITE_ROOT_PATH", $_SERVER["DOCUMENT_ROOT"]);
$siteFolder = COption::GetOptionString("main", "wizard_site_folder", "", WIZARD_SITE_ID);
if ($siteFolder) {
define("WIZARD_SITE_DIR", $siteFolder);
} else {
$rsSites = CSite::GetByID($siteID);
if ($arSite = $rsSites->Fetch()) {
define("WIZARD_SITE_DIR", $arSite["DIR"]);
} else {
define("WIZARD_SITE_DIR", "/");
}
}
define("WIZARD_SITE_PATH", str_replace("//", "/", WIZARD_SITE_ROOT_PATH . "/" . WIZARD_SITE_DIR . "/"));
$wizardPath = $wizard->GetPath();
define("WIZARD_RELATIVE_PATH", $wizardPath);
define("WIZARD_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . $wizardPath);
$templatesPath = WizardServices::GetTemplatesPath("/bitrix/modules/intranet/install");
//$arTemplates = WizardServices::GetTemplates($templatesPath, , $wizard->GetPath());
$templateID = $wizard->GetVar("templateID");
define("WIZARD_TEMPLATE_ID", $templateID);
define("WIZARD_TEMPLATE_RELATIVE_PATH", $templatesPath . "/" . WIZARD_TEMPLATE_ID);
define("WIZARD_TEMPLATE_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . WIZARD_TEMPLATE_RELATIVE_PATH);
$themeID = $wizard->GetVar($templateID . "_themeID");
//$arThemes = WizardServices::GetThemes(WIZARD_TEMPLATE_RELATIVE_PATH."/themes");
define("WIZARD_THEME_ID", $themeID);
define("WIZARD_THEME_RELATIVE_PATH", WIZARD_TEMPLATE_RELATIVE_PATH . "/themes/" . WIZARD_THEME_ID);
define("WIZARD_THEME_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . WIZARD_THEME_RELATIVE_PATH);
$servicePath = WIZARD_RELATIVE_PATH . "/site/services/" . $serviceID;
define("WIZARD_SERVICE_RELATIVE_PATH", $servicePath);
define("WIZARD_SERVICE_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . $servicePath);
define("WIZARD_IS_RERUN", $_SERVER["PHP_SELF"] != "/index.php");
$b24ToCp = file_exists($_SERVER["DOCUMENT_ROOT"] . "/.superleft.menu.php") ? true : false;
define("WIZARD_B24_TO_CP", $b24ToCp);
//b24 to cp
$firstStep = COption::GetOptionString("main", "wizard_first" . substr($wizard->GetID(), 7) . "_" . $wizard->GetVar("siteID"), false, $wizard->GetVar("siteID"));
if ($b24ToCp) {
$firstStep = "Y";
}
define("WIZARD_FIRST_INSTAL", $firstStep);
define("WIZARD_USE_SITE_LOGO", $wizard->GetVar("useSiteLogo") == "Y");
define("WIZARD_SITE_NAME", $wizard->GetVar("siteName"));
define("WIZARD_SITE_DEPARTAMENT", $wizard->GetVar("departamentID"));
COption::SetOptionString("main", "wizard_departament", $wizard->GetVar("departamentID"), "", $siteID);
define("WIZARD_SITE_LOGO", intval($wizard->GetVar("siteLogo")));
define("WIZARD_INSTALL_DEMO_DATA", $wizard->GetVar("installDemoData") == "Y");
define("WIZARD_INSTALL_DEMO_STRUCTURE", $wizard->GetVar("installStructureData") == "Y");
define("WIZARD_INSTALL_MOBILE", $wizard->GetVar("installMobile") == "Y");
if ($firstStep == "N" || $wizard->GetVar("installDemoData") == "Y") {
COption::SetOptionString("main", "wizard_clear_exec", "N", "", $siteID);
}
if ($_SERVER["PHP_SELF"] == "/index.php") {
COption::SetOptionString("main", "wizard_new_2011", "Y");
}
define("WIZARD_NEW_2011", COption::GetOptionString("main", "wizard_new_2011", false));
$dbGroupUsers = CGroup::GetList($by = "id", $order = "asc", array("ACTIVE" => "Y"));
$arGroupsId = array("ADMIN_SECTION", "SUPPORT", "CREATE_GROUPS", "PERSONNEL_DEPARTMENT", "DIRECTION", "MARKETING_AND_SALES", "RATING_VOTE", "RATING_VOTE_AUTHORITY");
while ($arGroupUser = $dbGroupUsers->Fetch()) {
if (in_array($arGroupUser["STRING_ID"], $arGroupsId)) {
define("WIZARD_" . $arGroupUser["STRING_ID"] . "_GROUP", $arGroupUser["ID"]);
} else {
if (substr($arGroupUser["STRING_ID"], -2) == $wizard->GetVar("siteID")) {
define("WIZARD_" . substr($arGroupUser["STRING_ID"], 0, -3) . "_GROUP", $arGroupUser["ID"]);
}
}
}
if (!file_exists(WIZARD_SERVICE_ABSOLUTE_PATH . "/" . $serviceStage)) {
return false;
}
if (LANGUAGE_ID != "en" && LANGUAGE_ID != "ru") {
if (file_exists(WIZARD_SERVICE_ABSOLUTE_PATH . "/lang/en/" . $serviceStage)) {
__IncludeLang(WIZARD_SERVICE_ABSOLUTE_PATH . "/lang/en/" . $serviceStage);
}
}
if (file_exists(WIZARD_SERVICE_ABSOLUTE_PATH . "/lang/" . LANGUAGE_ID . "/" . $serviceStage)) {
__IncludeLang(WIZARD_SERVICE_ABSOLUTE_PATH . "/lang/" . LANGUAGE_ID . "/" . $serviceStage);
}
@set_time_limit(3600);
global $DB, $DBType, $APPLICATION, $USER, $CACHE_MANAGER;
include WIZARD_SERVICE_ABSOLUTE_PATH . "/" . $serviceStage;
}