示例#1
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$currentDir = dirname(__FILE__);
include $currentDir . '/../form/lib.php';
$dataDir = $currentDir . '/data';
__IncludeLang($currentDir . "/lang/" . LANGUAGE_ID . '/' . basename(__FILE__));
if ($FORM_ID = __form_CreateForm('ANKETA', $dataDir)) {
    $search = array("#FORM.ID(ID=form-anketa)#");
    $replace = array($FORM_ID);
    //Create directory and copy files
    __form_CopyFiles($currentDir . "/public/communication/", "/communication/", false);
    __form_CopyFiles($currentDir . "/public/communication/web-forms/", "/communication/web-forms/", false);
    __form_CopyFiles($currentDir . "/public/communication/web-forms/anketa/", "/communication/web-forms/anketa/", false, $search, $replace);
    $arMenuItems = array(array('menu' => '/communication/.left.menu.php', 'item' => array(GetMessage('WIZDEMO_FORM_ANKETA_PUBLIC_SECTION_TITLE'), "/communication/web-forms/", array(), array(), "")), array('menu' => '/communication/web-forms/.left.menu.php', 'item' => array(GetMessage('WIZDEMO_FORM_ANKETA_NAME'), "/communication/web-forms/anketa/", array(), array(), "")));
    foreach ($arMenuItems as $arMenuItem) {
        DemoSiteUtil::AddMenuItem($arMenuItem['menu'], $arMenuItem['item']);
    }
    //Communication section
    include dirname(__FILE__) . "/../communication/install.php";
}
示例#2
0
    if (strlen($package->LAST_ERROR) > 0) {
        return;
    }
    $success = $package->ImportPackage();
    if ($success) {
        $dbResult = CCourse::GetList(array(), array("CODE" => "BX-ADM001"));
        $arCourse = $dbResult->Fetch();
    }
}
if (isset($arCourse["ID"])) {
    CCourse::SetPermission($arCourse["ID"], array("2" => "R"));
}
//Public files
CopyDirFiles($pathToService . "/" . LANGUAGE_ID . "/public", $_SERVER["DOCUMENT_ROOT"] . "/communication/learning", $rewrite = false, $recursive = true);
//Left menu
DemoSiteUtil::AddMenuItem("/communication/.left.menu.php", array(GetMessage("SERVICE_LEARNING"), "/communication/learning/", array(), array(), ""));
//Template
CopyDirFiles($pathToService . "/" . LANGUAGE_ID . "/template", $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/learning", $rewrite = true, $recursive = true);
$obSite = CSite::GetByID("s1");
if (!($arSite = $obSite->Fetch())) {
    return;
}
$arTemplates = array();
$obTemplate = CSite::GetTemplateList("s1");
while ($arTemplate = $obTemplate->Fetch()) {
    $arTemplates[] = $arTemplate;
}
$arTemplates[] = array("CONDITION" => "CSite::InDir('/communication/learning/course/')", "SORT" => 150, "TEMPLATE" => "learning");
$obSite = new CSite();
$obSite->Update("s1", array("TEMPLATE" => $arTemplates, "NAME" => $arSite["NAME"]));
//Communication section
示例#3
0
    function ShowStep()
    {
        $this->SetAutoSubmit(false);
        $wizard =& $this->GetWizard();
        $servicePath = $_SERVER["DOCUMENT_ROOT"] . $wizard->GetPath() . "/modules/";
        $arServiceSelected = $wizard->GetVar("services");
        if (!$arServiceSelected) {
            $arServiceSelected = array();
        }
        $arServices = DemoSiteUtil::GetServices($servicePath, $arFilter = array("SERVICES" => $arServiceSelected));
        /*$package =& $wizard->GetPackage();
        		$arServiceSelected = array_keys(DemoSiteUtil::GetSelectedServices($package->GetSiteStructureID()));
        		*/
        //$this->content .= "<pre>".print_r($wizard->GetVar("services"), true)."</pre>";
        list($firstService, $stage, $status) = $this->GetFirstStep($arServices);
        $this->content .= '
			<table border="0" cellspacing="0" cellpadding="2" width="550">
				<tr>
					<td colspan="2"><div id="status"></div></td>
				</tr>
				<tr>
					<td width="90%" height="10">
						<div style="border:1px solid #B9CBDF; width:100%;"><div id="indicator" style="height:10px; width:0%; background-color:#B9CBDF"></div></div>
					</td>
					<td width="10%">&nbsp;<span id="percent">0%</span></td>
				</tr>
			</table>
			<div id="wait" align=center>
			<br />
			<table width=200 cellspacing=0 cellpadding=0 border=0 style="border:1px solid #EFCB69" bgcolor="#FFF7D7">
				<tr>
					<td height=50 width="50" valign="middle" align=center><img src="/bitrix/wizards/bitrix/demo/images/wait.gif"></td>
					<td height=50 width=150>' . GetMessage("MAIN_WIZARD_WAIT_WINDOW_TEXT") . '</td>
				</tr>
			</table>
		</div><br />
			<br />
			<div id="error_container" style="display:none">
				<div id="error_notice"><span style="color:red;">' . GetMessage("INST_ERROR_OCCURED") . '<br />' . GetMessage("INST_TEXT_ERROR") . ':</span></div>
				<div id="error_text"></div>
				<div><span style="color:red;">' . GetMessage("INST_ERROR_NOTICE") . '</span></div>
				<div id="error_buttons" align="center">
				<br /><input type="button" value="' . GetMessage("INST_RETRY_BUTTON") . '" id="error_retry_button" onclick="" />&nbsp;<input type="button" id="error_skip_button" value="' . GetMessage("INST_SKIP_BUTTON") . '" onclick="" />&nbsp;</div>
			</div>

		' . $this->ShowHiddenField("nextStep", $firstService) . '
		' . $this->ShowHiddenField("nextStepStage", $stage) . '
		<iframe style="display:none;" id="iframe-post-form" name="iframe-post-form" src="javascript:\'\'"></iframe>';
        $wizard =& $this->GetWizard();
        $formName = $wizard->GetFormName();
        $nextButtonID = $wizard->GetNextButtonID();
        $NextStepVarName = $wizard->GetRealName("nextStep");
        $this->content .= '
		<script type="text/javascript">
			var ajaxForm = new CAjaxForm("' . $formName . '", "iframe-post-form", "' . $NextStepVarName . '");
			ajaxForm.Post("' . $firstService . '", "' . $stage . '", "' . $status . '");
		</script>';
        $package =& $wizard->GetPackage();
        //$this->content = print_r($package->GetSiteStructureID(), true);
        //$this->content .= "<pre>".print_r($arServices, true)."</pre>";
        //setTimeout(function () {document.forms["'.$formName.'"].elements["'.$nextButtonID.'"].style.display = "none"}, 1000);
    }
示例#4
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
//Communication section
include dirname(__FILE__) . "/../communication/install.php";
if (!CModule::IncludeModule('support')) {
    return;
}
__IncludeLang(GetLangFileName(dirname(__FILE__) . "/lang/", "/" . basename(__FILE__)));
$pathToService = str_replace("\\", "/", dirname(__FILE__));
//Left menu
DemoSiteUtil::AddMenuItem("/communication/.left.menu.php", array(GetMessage("SUPP_DEMO_INSTALL_MENUITEM"), "/communication/support/?show_wizard=Y", array("/communication/support/"), array(), ""));
$arCategories = array(GetMessage('SUPP_DEMO_INSTALL_COMMON_QUESTION') => array('NAME' => GetMessage('SUPP_DEMO_INSTALL_COMMON_QUESTION'), 'arrSITE' => array('s1'), 'C_TYPE' => 'C', 'C_SORT' => 100, 'EVENT1' => 'ticket'), GetMessage('SUPP_DEMO_INSTALL_ESTORE_QUESTION') => array('NAME' => GetMessage('SUPP_DEMO_INSTALL_ESTORE_QUESTION'), 'arrSITE' => array('s1'), 'C_TYPE' => 'C', 'C_SORT' => 100, 'EVENT1' => 'ticket'));
$dbCategory = CTicketDictionary::GetList($by = "s_id", $order = "asc", array("TYPE" => "C", "TYPE_EXACT_MATCH" => "Y"), $is_filtered);
while ($arCategory = $dbCategory->Fetch()) {
    if (array_key_exists($arCategory["NAME"], $arCategories)) {
        unset($arCategories[$arCategory["NAME"]]);
    }
}
foreach ($arCategories as $arCategory) {
    $categoryID = (int) CTicketDictionary::Add($arCategory);
}
COption::SetOptionString("support", "SUPPORT_MAX_FILESIZE", "10000");
$dbResult = CGroup::GetList($by, $order, array("STRING_ID" => "REGISTERED_USERS"));
if ($arGroup = $dbResult->Fetch()) {
    $APPLICATION->SetGroupRight("support", $arGroup["ID"], "R");
}
//Create support admins group if needed
$rsGroup = CGroup::GetList($by = "c_sort", $order = "asc", array("STRING_ID_EXACT_MATCH" => "Y", "STRING_ID" => "SUPPORT_ADMINISTRATORS"));
示例#5
0
COption::SetOptionString("main", 'CAPTCHA_textAngel_1', '-15');
COption::SetOptionString("main", 'CAPTCHA_textAngel_2', '15');
COption::SetOptionString("main", 'CAPTCHA_textDistance_1', '-2');
COption::SetOptionString("main", 'CAPTCHA_textDistance_2', '-2');
COption::SetOptionString("main", 'CAPTCHA_bWaveTransformation', 'N');
COption::SetOptionString("main", 'CAPTCHA_arBorderColor', '000000');
COption::SetOptionString("main", 'CAPTCHA_arTTFFiles', 'bitrix_captcha.ttf');
SetMenuTypes(array("left" => GetMessage("LEFT_MENU_NAME"), "top" => GetMessage("TOP_MENU_NAME")), "s1");
SetMenuTypes(array("left" => GetMessage("LEFT_MENU_NAME"), "top" => GetMessage("TOP_MENU_NAME")), "");
COption::SetOptionString("fileman", "default_edit", "html");
COption::SetOptionString("fileman", "propstypes", serialize(array("description" => GetMessage("MAIN_OPT_DESCRIPTION"), "keywords" => GetMessage("MAIN_OPT_KEYWORDS"), "title" => GetMessage("MAIN_OPT_TITLE"), "keywords_inner" => GetMessage("MAIN_OPT_KEYWORDS_INNER"))));
if (LANGUAGE_ID != 'ru' && COption::GetOptionString('seo', 'counters', '') == '') {
    COption::SetOptionString('seo', 'counters', '<a href="http://www.webdew.ro/utils.php"><img src="http://www.webdew.ro/pagerank/free-pagerank-display.php?a=getCode&amp;s=goo" title="Free PageRank Display Code" border="0px" alt="PageRank" /></a>');
}
//user options
DemoSiteUtil::SetUserOption("global", "settings", array("start_menu_preload" => "Y", "start_menu_title" => "N"), $common = true);
//Gadgets
CUserOptions::SetOption('intranet', '~gadgets_holder1', unserialize(GetMessage("MAIN_SETTINGS_GADGETS")), true);
//Print template
$pathToService = str_replace("\\", "/", dirname(__FILE__));
CopyDirFiles($wizardPath . "/misc/print_template/" . LANGUAGE_ID, $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/print", $rewrite = true, $recursive = true);
$obSite = CSite::GetByID("s1");
if (!($arSite = $obSite->Fetch())) {
    return;
}
$arTemplates = array();
$obTemplate = CSite::GetTemplateList("s1");
while ($arTemplate = $obTemplate->Fetch()) {
    $arTemplates[] = $arTemplate;
}
$arTemplates[] = array("CONDITION" => "\$_GET['print']=='Y'", "SORT" => 150, "TEMPLATE" => "print");
示例#6
0
                CForumTopic::Delete($TID);
            }
        }
    }
}
//Copy public files with "on the fly" translation
$source = "/public/forum/";
$target = "/communication/forum/";
$source_base = dirname(__FILE__);
$source_abs = $source_base . $source;
$source_abs = str_replace(array("\\", "//"), "/", $source_base . $source . "/");
$target_abs = $_SERVER['DOCUMENT_ROOT'] . $target;
if (!empty($arReplaceForums)) {
    $tmp = array();
    $ii = 0;
    foreach ($arReplaceForums as $val) {
        $tmp[] = "" . $ii . " => " . $val . "";
        $ii++;
    }
    if (!empty($tmp)) {
        $arFieldsParams["FORUMS_ID"] = implode(", ", $tmp);
    }
}
__CopyForumFiles($source_abs, $target_abs, false, $arFieldsParams);
$arFields = array("CONDITION" => "#^/communication/forum/#", "RULE" => "", "ID" => "bitrix:forum", "PATH" => "/communication/forum/index.php");
CUrlRewriter::Add($arFields);
//Left menu
DemoSiteUtil::AddMenuItem("/communication/.left.menu.php", array(GetMessage("F_FORUM"), "/communication/forum/", array(), array(), ""));
//Communication section
include dirname(__FILE__) . "/../communication/install.php";
return true;
示例#7
0
CopyDirFiles($pathToService . "/public/" . LANGUAGE_ID, $_SERVER["DOCUMENT_ROOT"] . "/communication/voting", $rewrite = false, $recursive = true);
$strIndexIncVote = '<div class="information-block"> 	 	 
  <div class="information-block-head">' . GetMessage('VOTING_INSTALL_II_VOTE') . '</div>
 	<?$APPLICATION->IncludeComponent(
	"bitrix:voting.current",
	"main_page",
	Array(
		"CHANNEL_SID" => "ANKETA",
		"CACHE_TYPE"	=>	"A",
		"CACHE_TIME"	=>	"3600",
		"AJAX_MODE" => "Y", 
		"AJAX_OPTION_SHADOW" => "Y", 
		"AJAX_OPTION_JUMP" => "Y", 
		"AJAX_OPTION_STYLE" => "Y", 
		"AJAX_OPTION_HISTORY" => "N", 		
	)
);?> </div>';
CWizardUtil::ReplaceMacros($_SERVER["DOCUMENT_ROOT"] . "/index_inc.php", array('<!--VOTE_FORM-->' => $strIndexIncVote), $skipSharp = true);
$strBooksIndexIncVote = '<div class="information-block"><?$APPLICATION->IncludeComponent(
	"bitrix:voting.current",
	"main_page",
	Array(
		"CHANNEL_SID" => "BOOKS_VOTE",
		"CACHE_TYPE"	=>	"A",
		"CACHE_TIME"	=>	"3600",
	)
);?> </div>';
CWizardUtil::ReplaceMacros($_SERVER["DOCUMENT_ROOT"] . "/e-store/books/index_inc.php", array('<!--VOTE_FORM-->' => $strBooksIndexIncVote), $skipSharp = true);
DemoSiteUtil::AddMenuItem('/communication/.left.menu.php', array(GetMessage('VOTING_INSTALL_MENU_ITEM'), '/communication/voting/', array(), array(), ''));
//Communication section
include dirname(__FILE__) . "/../communication/install.php";
示例#8
0
        $id = CSalePaySystem::Add(array("LID" => $siteID, "CURRENCY" => $bRus ? "RUB" : "USD", "NAME" => $val["NAME"], "ACTIVE" => "Y", "SORT" => $val["SORT"], "DESCRIPTION" => $val["DESCRIPTION"]));
        foreach ($val["ACTION"] as $action) {
            $action["PAY_SYSTEM_ID"] = $id;
            CSalePaySystemAction::Add($action);
        }
    }
    //discounts
    CSaleDiscount::Add(array("LID" => $siteID, "PRICE_FROM" => 800, "PRICE_TO" => 1500, "CURRENCY" => $bRus ? "RUB" : "USD", "DISCOUNT_VALUE" => 20, "DISCOUNT_TYPE" => "P", "ACTIVE" => "Y", "SORT" => 200, "ACTIVE_FROM" => "", "ACTIVE_TO" => ""));
    CSaleDiscount::Add(array("LID" => $siteID, "PRICE_FROM" => 500, "PRICE_TO" => 800, "CURRENCY" => $bRus ? "RUB" : "USD", "DISCOUNT_VALUE" => 15, "DISCOUNT_TYPE" => "P", "ACTIVE" => "Y", "SORT" => 100, "ACTIVE_FROM" => "", "ACTIVE_TO" => ""));
    CSaleDiscount::Add(array("LID" => $siteID, "PRICE_FROM" => 1500, "PRICE_TO" => 0, "CURRENCY" => $bRus ? "RUB" : "USD", "DISCOUNT_VALUE" => 25, "DISCOUNT_TYPE" => "P", "ACTIVE" => "Y", "SORT" => 300, "ACTIVE_FROM" => "", "ACTIVE_TO" => ""));
    if ($bRus) {
        //1C export
        $val = serialize(array("AGENT_NAME" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["CONTACT_PERSON"]), "FULL_NAME" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["CONTACT_PERSON"]), "SURNAME" => array("TYPE" => "USER", "VALUE" => "LAST_NAME"), "NAME" => array("TYPE" => "USER", "VALUE" => "NAME"), "ADDRESS_FULL" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["ADDRESS"]), "INDEX" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["INDEX"]), "COUNTRY" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["LOCATION"] . "_COUNTRY"), "CITY" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["LOCATION"] . "_CITY"), "STREET" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["STREET"]), "EMAIL" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["EMAIL"]), "CONTACT_PERSON" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["CONTACT_PERSON"]), "IS_FIZ" => "Y"));
        CSaleExport::Add(array("PERSON_TYPE_ID" => $arGeneralInfo["personType"]["fiz"], "VARS" => $val));
        $val = serialize(array("AGENT_NAME" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["F_COMPANY_NAME"]), "FULL_NAME" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["F_COMPANY_NAME"]), "ADDRESS_FULL" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["F_ADDRESS_FULL"]), "COUNTRY" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["F_LOCATION"] . "_COUNTRY"), "CITY" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["F_LOCATION"] . "_CITY"), "STREET" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["F_ADDRESS_FULL"]), "INN" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["F_INN"]), "KPP" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["F_KPP"]), "PHONE" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["F_PHONE"]), "EMAIL" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["F_EMAIL"]), "CONTACT_PERSON" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["F_NAME"]), "F_ADDRESS_FULL" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["F_ADDRESS"]), "F_COUNTRY" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["F_LOCATION"] . "_COUNTRY"), "F_CITY" => array("TYPE" => "PROPERTY", "VALUE" => $arGeneralInfo["propCodeID"]["F_LOCATION"] . "_CITY"), "IS_FIZ" => "N"));
        CSaleExport::Add(array("PERSON_TYPE_ID" => $arGeneralInfo["personType"]["ur"], "VARS" => $val));
    }
    $affiliatePlan = CSaleAffiliatePlan::Add(array("SITE_ID" => $siteID, "NAME" => GetMessage("SALE_WIZARD_AFFILIATE_PLAN"), "ACTIVE" => "Y", "BASE_RATE" => 5, "BASE_RATE_TYPE" => "P", "MIN_PAY" => 0, "MIN_PAY_VALUE" => 1));
    CSaleAffiliate::Add(array("SITE_ID" => $siteID, "USER_ID" => 1, "PLAN_ID" => $affiliatePlan, "ACTIVE" => "Y", "DATE_CREATE" => ConvertTimeStamp(), "AFF_SITE" => "www.bitrixsoft.com", "AFF_DESCRIPTION" => GetMessage("SALE_WIZARD_AFFILIATE"), "FIX_PLAN" => "N"));
}
DemoSiteUtil::AddMenuItem("/personal/.left.menu.php", array(GetMessage("SALE_WIZARD_MENU_ORDERS"), "/personal/order/", array(), array(), ""));
DemoSiteUtil::AddMenuItem("/personal/.left.menu.php", array(GetMessage("SALE_WIZARD_MENU_CART"), "/personal/cart/", array(), array(), ""));
DemoSiteUtil::AddMenuItem("/personal/.left.menu.php", array(GetMessage("SALE_WIZARD_MENU_REGULAR_PAYMENT"), "/personal/regular-payment/", array(), array(), ""));
DemoSiteUtil::AddMenuItem("/personal/.left.menu.php", array(GetMessage("SALE_WIZARD_MENU_PROFILES"), "/personal/customer-profiles/", array(), array(), ""));
DemoSiteUtil::AddMenuItem("/personal/.left.menu.php", array(GetMessage("SALE_WIZARD_MENU_ACCOUNTS"), "/personal/account/", array(), array(), ""));
DemoSiteUtil::AddMenuItem("/e-store/.left.menu.php", array(GetMessage("SALE_WIZARD_MENU_AFFILIATE"), "/e-store/affiliates/", array(), array(), ""));
$source_base = dirname(__FILE__);
CopyDirFiles($source_base . "/public/personal/" . $lang, $_SERVER["DOCUMENT_ROOT"] . "/personal/", false, true);
CopyDirFiles($source_base . "/public/affiliate/" . $lang, $_SERVER["DOCUMENT_ROOT"] . "/e-store", $rewrite = false, $recursive = true);
include dirname(__FILE__) . "/../e-store/index.php";
return true;
示例#9
0
}
if (IsModuleInstalled('photogallery') && file_exists($_SERVER["DOCUMENT_ROOT"] . "/content/gallery") && CModule::IncludeModule("iblock")) {
    CopyDirFiles($source_base . "/public/" . $LID . "/gallery", $_SERVER["DOCUMENT_ROOT"] . "/club/gallery", false, true);
    //replace default gallery infoblock with user gallery
    $res = CIBlock::GetList(array(), array("CODE" => "gallery"));
    $res_arr = $res->Fetch();
    $photo_id = $res_arr["ID"];
    $res = CIBlock::GetList(array(), array("CODE" => "car_photo_user_demo"));
    $res_arr = $res->Fetch();
    $socnet_photo_id = $res_arr["ID"];
    $photo_forum_id = 0;
    if (CModule::IncludeModule("forum")) {
        $db_res = CForumNew::GetList(array("SORT" => "ASC"), array("XML_ID" => "multiuser"));
        if ($db_res && ($res = $db_res->Fetch())) {
            $photo_forum_id = intVal($res["ID"]);
        }
    }
    CWizardUtil::ReplaceMacros($_SERVER["DOCUMENT_ROOT"] . "/club/gallery/index.php", array('IBLOCK_ID_GALLERY' => $photo_id, 'FORUM_ID' => $photo_forum_id));
    CWizardUtil::ReplaceMacros($_SERVER["DOCUMENT_ROOT"] . "/club/index.php", array('"PHOTO_USER_IBLOCK_TYPE" => "car_gallery_demo"' => '"PHOTO_USER_IBLOCK_TYPE" => "gallery"', '"PHOTO_USER_IBLOCK_ID" => "' . $socnet_photo_id . '"' => '"PHOTO_USER_IBLOCK_ID" => "' . $photo_id . '"', '"PHOTO_USE_COMMENTS" => "N"' => '"PHOTO_USE_COMMENTS" => "Y",
	"PHOTO_FORUM_ID" => "' . $photo_forum_id . '"'), $skipSharp = true);
    DemoSiteUtil::AddMenuItem("/club/.left.menu.php", array(GetMessage("SOCNET_MENU_GALLERY"), "gallery/", array(), array(), ""));
    $arFields = array("CONDITION" => "#^/club/gallery/#", "RULE" => "", "ID" => "bitrix:photogallery_user", "PATH" => "/club/gallery/index.php");
    CUrlRewriter::Add($arFields);
}
if (IsModuleInstalled('forum') && file_exists($_SERVER["DOCUMENT_ROOT"] . "/communication/forum")) {
    CopyDirFiles($source_base . "/public/" . $LID . "/forum", $_SERVER["DOCUMENT_ROOT"] . "/club/forum", false, true);
    DemoSiteUtil::AddMenuItem("/club/.left.menu.php", array(GetMessage("SOCNET_MENU_FORUM"), "forum/", array(), array(), ""));
    $arFields = array("CONDITION" => "#^/club/forum/#", "RULE" => "", "ID" => "bitrix:forum", "PATH" => "/club/forum/index.php");
    CUrlRewriter::Add($arFields);
}
return true;
示例#10
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
__IncludeLang(GetLangFileName(dirname(__FILE__) . "/lang/", "/" . basename(__FILE__)));
$pathToService = str_replace("\\", "/", dirname(__FILE__));
//Public files
CopyDirFiles($pathToService . "/public/" . LANGUAGE_ID, $_SERVER["DOCUMENT_ROOT"] . "/communication/", $rewrite = false, $recursive = true);
//Top menu
DemoSiteUtil::AddMenuItem("/.top.menu.php", array(GetMessage("COMMUNICATION_MENU_NAME"), "/communication/", array(), array(), ""));
示例#11
0
                }
            }
            //Write to the destination directory
            $fh = fopen($target_file, "wb");
            fwrite($fh, $php_source);
            fclose($fh);
            @chmod($target_file, BX_FILE_PERMISSIONS);
        }
    }
}
$arFields = array("CONDITION" => "#^" . $target . "#", "RULE" => "", "ID" => "bitrix:photogallery", "PATH" => $target . "index.php");
CUrlRewriter::Add($arFields);
$PhotoRandom = '
	<div class="information-block">
		<div class="information-block-head">' . GetMessage("P_DAY_PHOTO") . '</div>
		<?$APPLICATION->IncludeComponent(
	"bitrix:photo.random",
	"",
	Array("IBLOCK_TYPE" => "gallery", 
		"IBLOCKS" => Array("' . $iBlockId . '"), 
		"DETAIL_URL" => "' . $target . '#SECTION_ID#/#ELEMENT_ID#/", 
		"CACHE_TYPE" => "N",
		"CACHE_TIME" => "180")
	);?></div>';
$arReplace = array("<!--PHOTO_RANDOM-->" => $PhotoRandom);
CWizardUtil::ReplaceMacros($_SERVER['DOCUMENT_ROOT'] . "/index_inc.php", $arReplace, $skipSharp = true);
//Left menu
DemoSiteUtil::AddMenuItem("/content/.left.menu.php", array(GetMessage("P_MENU_ITEM"), "/content/photo/", array(), array(), ""));
//Content section
include dirname(__FILE__) . "/../content/index.php";
return true;
示例#12
0
}
if (LANGUAGE_ID !== "ru") {
    return;
}
//Library
include_once dirname(__FILE__) . "/iblock_tools.php";
__IncludeLang(GetLangFileName(dirname(__FILE__) . "/lang/", "/" . basename(__FILE__)));
//Parameters
if (!is_array($arParams)) {
    $arParams = array();
}
if (strlen($arParams["site_id"]) <= 0) {
    $arParams["site_id"] = "s1";
}
$search = array("#IBLOCK.ID(XML_ID=FUTURE-1C-CATALOG)#");
$replace = array(CIBlockCMLImport::GetIBlockByXML_ID("FUTURE-1C-CATALOG"));
//Create directory and copy files
DEMO_IBlock_CopyFiles("/public/e-store/xml_catalog/", "/e-store/xml_catalog/", false, $search, $replace);
CopyDirFiles(dirname(__FILE__) . "/public/language/" . LANGUAGE_ID . "/e-store/xml_catalog/", $_SERVER["DOCUMENT_ROOT"] . "/e-store/xml_catalog", false, true);
//Add menu item
DEMO_IBlock_AddMenuItem("/e-store/.left.menu.php", array(GetMessage("DEMO_IBLOCK_ESTORE_XMLCAT_MENU"), "/e-store/xml_catalog/", array(), array(), ""));
if (IsModuleInstalled('catalog')) {
    //Create group and add it to importers
    $XMLCATALOG_GROUP_ID = DEMO_IBlock_AddUserGroup("1c_integration", GetMessage("DEMO_IBLOCK_XMLCATALOG_GROUP_NAME"), GetMessage("DEMO_IBLOCK_XMLCATALOG_GROUP_DESC"));
    //Tune 1C exchange
    if ($XMLCATALOG_GROUP_ID) {
        DemoSiteUtil::SetFilePermission(array($arParams["site_id"], "/bitrix/admin"), array($XMLCATALOG_GROUP_ID => "R"));
        COption::SetOptionString("catalog", "1C_GROUP_PERMISSIONS", $XMLCATALOG_GROUP_ID);
        COption::SetOptionString("catalog", "1C_SITE_LIST", $arParams["site_id"]);
    }
}
示例#13
0
 function ShowStep()
 {
     $wizard =& $this->GetWizard();
     $package =& $wizard->GetPackage();
     $servicePath = $_SERVER["DOCUMENT_ROOT"] . $wizard->GetPath() . "/modules/";
     $arServices = DemoSiteUtil::GetServices($servicePath, $skipFilter = array("SKIP_INSTALL_ONLY" => "Y"));
     //$this->content .= "<pre>".print_r($arServices, true)."</pre>";
     $this->content .= '<table width="100%" cellspacing="1" cellpadding="0">';
     foreach ($arServices as $serviceID => $arService) {
         $this->content .= '<tr>';
         if (!isset($arService["DEFAULT"]) || $arService["DEFAULT"] != "N") {
             $wizard->SetDefaultVar("services[]", $serviceID);
         }
         $this->content .= '<td valign="top">' . $this->ShowCheckboxField("services[]", $serviceID, array("id" => $serviceID)) . '</td>';
         $this->content .= '<td valign="top">';
         if (isset($arService["ICON"]) && strlen($arService["ICON"]) > 0) {
             $this->content .= '<label for="' . $serviceID . '"><img src="' . $package->GetPath() . '/' . $arService["ICON"] . '" /></label>';
         }
         $this->content .= '</td>';
         $this->content .= '<td valign="top" width="100%">';
         $this->content .= '<label for="' . $serviceID . '">&nbsp;' . $arService["NAME"] . '</label><br />';
         if (isset($arService["DESCRIPTION"]) && strlen($arService["DESCRIPTION"]) > 0) {
             $this->content .= '<div style="margin-left:20px;"><label for="' . $serviceID . '"><i>' . $arService["DESCRIPTION"] . '</i></label></div>';
         }
         $this->content .= '</td>';
         $this->content .= '</tr>';
     }
     $this->content .= '</table>';
 }
示例#14
0
        $blogID = CBlog::Add(array("NAME" => GetMessage("BLG_NAME") . " " . $arUser["NAME"] . " " . $arUser["LAST_NAME"], "DESCRIPTION" => "", "GROUP_ID" => $SocNetGroupID, "ENABLE_IMG_VERIF" => 'Y', "EMAIL_NOTIFY" => 'Y', "USE_SOCNET" => 'Y', "ENABLE_RSS" => "Y", "ALLOW_HTML" => "Y", "URL" => str_replace(" ", "_", $arUser["LOGIN"]) . "-blog", "ACTIVE" => "Y", "=DATE_CREATE" => $DB->GetNowFunction(), "=DATE_UPDATE" => $DB->GetNowFunction(), "OWNER_ID" => 1, "PERMS_POST" => array("1" => BLOG_PERMS_READ, "2" => BLOG_PERMS_READ), "PERMS_COMMENT" => array("1" => BLOG_PERMS_WRITE, "2" => BLOG_PERMS_WRITE)));
        CBlog::AddSocnetRead($blogID);
        $categoryID[] = CBlogCategory::Add(array("BLOG_ID" => $blogID, "NAME" => GetMessage("BLOG_DEMO_CATEGORY_1")));
        $categoryID[] = CBlogCategory::Add(array("BLOG_ID" => $blogID, "NAME" => GetMessage("BLOG_DEMO_CATEGORY_2")));
        $postID = CBlogPost::Add(array("TITLE" => GetMessage("BLOG_DEMO_MESSAGE_TITLE_1"), "DETAIL_TEXT" => str_replace('[IMG ID=1]', "[IMG ID=2]", GetMessage("BLOG_DEMO_MESSAGE_BODY_1")), "DETAIL_TEXT_TYPE" => "text", "BLOG_ID" => $blogID, "AUTHOR_ID" => 1, "=DATE_CREATE" => $DB->GetNowFunction(), "=DATE_PUBLISH" => $DB->GetNowFunction(), "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "ENABLE_TRACKBACK" => 'N', "ENABLE_COMMENTS" => 'Y', "CATEGORY_ID" => implode(",", $categoryID), "PERMS_P" => array(1 => BLOG_PERMS_READ, 2 => BLOG_PERMS_READ), "PERMS_C" => array(1 => BLOG_PERMS_WRITE, 2 => BLOG_PERMS_WRITE)));
        foreach ($categoryID as $v) {
            CBlogPostCategory::Add(array("BLOG_ID" => $blogID, "POST_ID" => $postID, "CATEGORY_ID" => $v));
        }
        $arImage = CFile::MakeFileArray(dirname(__FILE__) . '/images/' . GetMessage("BLOG_DEMO_IMG"));
        $arImage["MODULE_ID"] = "blog";
        $arFields = array("BLOG_ID" => $blogID, "POST_ID" => $postID, "USER_ID" => 1, "=TIMESTAMP_X" => $DB->GetNowFunction(), "TITLE" => GetMessage("BLOG_DEMO_IMG_TITLE"), "IMAGE_SIZE" => $arImage["size"], "FILE_ID" => $arImage);
        CBlogImage::Add($arFields);
        CBlogComment::Add(array("TITLE" => GetMessage("BLOG_DEMO_COMMENT_TITLE"), "POST_TEXT" => GetMessage("BLOG_DEMO_COMMENT_BODY"), "BLOG_ID" => $blogID, "POST_ID" => $postID, "PARENT_ID" => 0, "AUTHOR_ID" => 1, "DATE_CREATE" => ConvertTimeStamp(false, "FULL"), "AUTHOR_IP" => "192.168.0.108", "PERMS_P" => array(), "PERMS_C" => array()));
    }
}
DemoSiteUtil::AddMenuItem("/communication/.left.menu.php", array(GetMessage("BLOG_DEMO_LEFT_MENU_1"), "/communication/blog/", array(), array(), ""));
/*
DemoSiteUtil::AddMenuItem("/communication/blog/.left.menu.php", Array(
	GetMessage("BLOG_DEMO_LEFT_MENU_2"), 
	"/communication/blog/index.php", 
	Array(), 
	Array(), 
	"" 
));	
*/
$source_base = dirname(__FILE__);
CopyDirFiles($source_base . "/public/" . $LID, $_SERVER["DOCUMENT_ROOT"] . "/communication/blog", true, true);
if (!function_exists("file_get_contents")) {
    function file_get_contents($filename)
    {
        $fd = fopen("{$filename}", "rb");