Ejemplo n.º 1
0
function CreateForm($arForm, $arFormFields, $langFile)
{
    if (!CModule::IncludeModule("form")) {
        return false;
    }
    // set defaults
    $arFieldDefaults = array("ACTIVE" => "Y", "C_SORT" => 0, "ADDITIONAL" => "N", "TITLE_TYPE" => "text", "IN_RESULTS_TABLE" => "Y", "IN_EXCEL_TABLE" => "Y");
    foreach ($arFormFields as $key => $arField) {
        if ($arFormFields['ADDITIONAL'] == 'Y' && !is_set($arFormFields['C_SORT'])) {
            $arFormFields['C_SORT'] = 5000;
        }
        $arFieldDefaults["C_SORT"] += 100;
        $arFormFields[$key] = array_merge($arFieldDefaults, $arField);
        $arFormFields[$key]["TITLE"] = GetMessage($arField["SID"] . "_QUESTION");
    }
    $rsLanguage = CLanguage::GetList($by, $order, array());
    while ($arLanguage = $rsLanguage->Fetch()) {
        WizardServices::IncludeServiceLang($langFile, $arLanguage["LID"]);
        $arForm["arMENU"][$arLanguage["LID"]] = GetMessage(substr($arForm["SID"], 0, -3) . "_MENU_NAME");
    }
    $dbForm = CForm::GetBySID($arForm["SID"]);
    if ($dbForm->Fetch()) {
        return;
    }
    WizardServices::IncludeServiceLang("status.php");
    if ($formID = CForm::Set($arForm, false, "N")) {
        // setup form fields
        foreach ($arFormFields as $key => $arField) {
            $arField["FORM_ID"] = $formID;
            $fieldID = CFormField::Set($arField, false, "N");
        }
        if ($arTemplates = CForm::SetMailTemplate($formID)) {
            CForm::Set(array('SID' => $arForm['SID'], 'arMAIL_TEMPLATE' => $arTemplates), $formID, 'N');
        }
        $arStatuses = array(array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_NEW"), "C_SORT" => 100, "ACTIVE" => "Y", "DEFAULT_VALUE" => "Y", "CSS" => "statusgray", "arPERMISSION_VIEW" => array(0), "arPERMISSION_MOVE" => array(0), "arPERMISSION_EDIT" => array(0), "arPERMISSION_DELETE" => array(0)), array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_RECEIVED"), "C_SORT" => 200, "ACTIVE" => "Y", "DEFAULT_VALUE" => "N", "CSS" => "statusblue", "arPERMISSION_VIEW" => array(0)), array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_DONE"), "C_SORT" => 300, "ACTIVE" => "Y", "DEFAULT_VALUE" => "N", "CSS" => "statusgreen", "arPERMISSION_VIEW" => array(0)), array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_REFUSE"), "C_SORT" => 400, "ACTIVE" => "Y", "DEFAULT_VALUE" => "N", "CSS" => "statusred", "arPERMISSION_VIEW" => array(0)));
        foreach ($arStatuses as $key => $arStatus) {
            if ($STATUS_ID = CFormStatus::Set($arStatus, false, "N")) {
                if ($arStatus['DEFAULT_VALUE'] == 'N' && ($arTemplates = CFormStatus::SetMailTemplate($formID, $STATUS_ID))) {
                    foreach ($arTemplates as $TEMPLATE_ID) {
                        if (null == $em) {
                            $em = new CEventMessage();
                        }
                        $em->Update($TEMPLATE_ID, array('MESSAGE' => GetMessage('STATUS_MESSAGE')));
                    }
                    CFormStatus::Set(array('FORM_ID' => $formID, 'arMAIL_TEMPLATE' => $arTemplates), $STATUS_ID, 'N');
                }
            }
        }
    }
    return $formID;
}
Ejemplo n.º 2
0
    $arSites = array();
    $db_res = CIBlock::GetSite($iblockID);
    while ($res = $db_res->Fetch()) {
        $arSites[] = $res["LID"];
    }
    if (!in_array(WIZARD_SITE_ID, $arSites)) {
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
}
$arProperty = array();
$dbProperty = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $iblockID));
while ($arProp = $dbProperty->Fetch()) {
    $arProperty[$arProp["CODE"]] = $arProp["ID"];
}
$codeProperty = '4 => "' . $arProperty['E_MAIL'] . '", 5 => "' . $arProperty['URL'] . '",  6 => "' . $arProperty['PHONE'] . '", ';
$dbSite = CSite::GetByID(WIZARD_SITE_ID);
if ($arSite = $dbSite->Fetch()) {
    $lang = $arSite["LANGUAGE_ID"];
}
if (strlen($lang) <= 0) {
    $lang = "ru";
}
WizardServices::IncludeServiceLang("board.php", $lang);
CUserOptions::SetOption("form", "form_element_" . $iblockID, array('tabs' => 'edit1--#--' . GetMessage("WZD_OPTION_BOARD_1") . '--,--ACTIVE--#--' . GetMessage("WZD_OPTION_BOARD_1") . '--,--ACTIVE_FROM--#--' . GetMessage("WZD_OPTION_BOARD_2") . '--,--ACTIVE_TO--#--' . GetMessage("WZD_OPTION_BOARD_24") . '--,--NAME--#--' . GetMessage("WZD_OPTION_BOARD_3") . '--,--PREVIEW_TEXT--#--' . GetMessage("WZD_OPTION_BOARD_4") . '--,--PREVIEW_PICTURE--#--' . GetMessage("WZD_OPTION_BOARD_5") . '--,--PROPERTY_' . $arProperty['E_MAIL'] . '--#--' . GetMessage("WZD_OPTION_BOARD_6") . '--,--PROPERTY_' . $arProperty['URL'] . '--#--' . GetMessage("WZD_OPTION_BOARD_7") . '--,--PROPERTY_' . $arProperty['PHONE'] . '--#--' . GetMessage("WZD_OPTION_BOARD_8") . '--,--PROPERTY_' . $arProperty['USER_ID'] . '--#--' . GetMessage("WZD_OPTION_BOARD_9") . '--,--SECTIONS--#--' . GetMessage("WZD_OPTION_BOARD_13") . '--;--'));
CUserOptions::SetOption("form", "form_section_" . $iblockID, array('tabs' => 'edit1--#--' . GetMessage("WZD_OPTION_BOARD_20") . '--,--NAME--#--' . GetMessage("WZD_OPTION_BOARD_21") . '--,--CODE--#--' . GetMessage("WZD_OPTION_BOARD_22") . '--,--SORT--#--' . GetMessage("WZD_OPTION_BOARD_23") . '--;--'));
CUserOptions::SetOption("list", "tbl_iblock_list_" . md5($iblockType . "." . $iblockID), array('columns' => 'NAME,ACTIVE,DATE_ACTIVE_FROM', 'by' => 'timestamp_x', 'order' => 'desc', 'page_size' => '20'));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/board/index.php", array("BOARD_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/board/my/index.php", array("BOARD_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/board/my/index.php", array("IDS_CODE_PROPERTY" => $codeProperty));
Ejemplo n.º 3
0
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
}
$arProperty = array();
$codeProperty = '';
$i = 4;
$dbProperty = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $iblockID));
while ($arProp = $dbProperty->Fetch()) {
    $arProperty[$arProp["CODE"]] = $arProp["ID"];
    $codeProperty .= $i++ . ' => "' . $arProp["ID"] . '",';
}
$codeRequired = '3 => "' . $arProperty['FIO'] . '", 4 => "' . $arProperty['SEX'] . '",  5 => "' . $arProperty['AGE'] . '",  6 => "' . $arProperty['EMAIL'] . '", ';
$dbSite = CSite::GetByID(WIZARD_SITE_ID);
if ($arSite = $dbSite->Fetch()) {
    $lang = $arSite["LANGUAGE_ID"];
}
if (strlen($lang) <= 0) {
    $lang = "ru";
}
WizardServices::IncludeServiceLang("resume.php", $lang);
CUserOptions::SetOption("form", "form_element_" . $iblockID, array('tabs' => 'edit1--#--' . GetMessage("WZD_OPTION_RESUME_0") . '--,--ACTIVE--#--' . GetMessage("WZD_OPTION_RESUME_1") . '--,--ACTIVE_FROM--#--' . GetMessage("WZD_OPTION_RESUME_2") . '--,--ACTIVE_TO--#--' . GetMessage("WZD_OPTION_RESUME_24") . '--,--NAME--#--' . GetMessage("WZD_OPTION_RESUME_3") . '--,--PROPERTY_' . $arProperty['FIO'] . '--#--' . GetMessage("WZD_OPTION_RESUME_6") . '--,--PROPERTY_' . $arProperty['SEX'] . '--#--' . GetMessage("WZD_OPTION_RESUME_7") . '--,--PROPERTY_' . $arProperty['AGE'] . '--#--' . GetMessage("WZD_OPTION_RESUME_8") . '--,--PROPERTY_' . $arProperty['EDUCATION'] . '--#--' . GetMessage("WZD_OPTION_RESUME_9") . '--,--PROPERTY_' . $arProperty['EDUCATIONAL'] . '--#--' . GetMessage("WZD_OPTION_RESUME_10") . '--,--PROPERTY_' . $arProperty['PROFESSION'] . '--#--' . GetMessage("WZD_OPTION_RESUME_11") . '--,--PROPERTY_' . $arProperty['ADDEDUCATION'] . '--#--' . GetMessage("WZD_OPTION_RESUME_12") . '--,--PROPERTY_' . $arProperty['EXPERIENCE'] . '--#--' . GetMessage("WZD_OPTION_RESUME_13") . '--,--PROPERTY_' . $arProperty['REMUNERATION'] . '--#--' . GetMessage("WZD_OPTION_RESUME_14") . '--,--PROPERTY_' . $arProperty['SCHEDULE'] . '--#--' . GetMessage("WZD_OPTION_RESUME_15") . '--,--PROPERTY_' . $arProperty['SKILLS'] . '--#--' . GetMessage("WZD_OPTION_RESUME_16") . '--,--PROPERTY_' . $arProperty['PERSON'] . '--#--' . GetMessage("WZD_OPTION_RESUME_17") . '--,--PROPERTY_' . $arProperty['PHONE'] . '--#--' . GetMessage("WZD_OPTION_RESUME_18") . '--,--PROPERTY_' . $arProperty['EMAIL'] . '--#--' . GetMessage("WZD_OPTION_RESUME_19") . '--,--PREVIEW_TEXT--#--' . GetMessage("WZD_OPTION_RESUME_4") . '--;--'));
CUserOptions::SetOption("form", "form_section_" . $iblockID, array('tabs' => 'edit1--#--' . GetMessage("WZD_OPTION_RESUME_20") . '--,--NAME--#--' . GetMessage("WZD_OPTION_RESUME_21") . '--,--CODE--#--' . GetMessage("WZD_OPTION_RESUME_22") . '--,--SORT--#--' . GetMessage("WZD_OPTION_RESUME_23") . '--;--'));
CUserOptions::SetOption("list", "tbl_iblock_list_" . md5($iblockType . "." . $iblockID), array('columns' => 'NAME,ACTIVE,DATE_ACTIVE_FROM', 'by' => 'timestamp_x', 'order' => 'desc', 'page_size' => '20'));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/job/index.php", array("RESUME_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/job/resume/index.php", array("RESUME_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/job/resume/my/index.php", array("RESUME_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/job/resume/my/index.php", array("IDS_CODE_PROPERTY" => $codeProperty));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/job/resume/my/index.php", array("IDS_CODE_REQUIRED" => $codeRequired));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/sect_rbottom.php", array("RESUME_IBLOCK_ID" => $iblockID));
Ejemplo n.º 4
0
            } else {
                $strError = "Couldn't delete catalog iblock";
            }
            //die($strError);
        }
    }
    if ($boolFlag) {
        $IBLOCK_CATALOG_ID = false;
    }
}
$dbResultList = CCatalogGroup::GetList(array(), array("BASE" => "Y"));
if (!$dbResultList->Fetch()) {
    $arFields = array();
    $rsLanguage = CLanguage::GetList($by, $order, array());
    while ($arLanguage = $rsLanguage->Fetch()) {
        WizardServices::IncludeServiceLang("catalog.php", $arLanguage["ID"]);
        $arFields["USER_LANG"][$arLanguage["ID"]] = GetMessage("WIZ_PRICE_NAME");
    }
    $arFields["BASE"] = "Y";
    $arFields["SORT"] = 100;
    $arFields["NAME"] = "BASE";
    $arFields["USER_GROUP"] = array(1);
    $arFields["USER_GROUP_BUY"] = array(1);
    CCatalogGroup::Add($arFields);
}
if ($IBLOCK_CATALOG_ID == false) {
    $permissions = array("1" => "X", "2" => "R");
    $dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "sale_administrator"));
    if ($arGroup = $dbGroup->Fetch()) {
        $permissions[$arGroup["ID"]] = 'W';
    }
Ejemplo n.º 5
0
 function OnPostForm()
 {
     $wizard =& $this->GetWizard();
     if ($wizard->IsPrevButtonClick()) {
         return;
     }
     if (!$this->ldp) {
         $this->SetError(GetMessage("wiz_ldap_error"), "ldapServer");
         return;
     } elseif (!$this->ldp->BindAdmin()) {
         $this->SetError(GetMessage("wiz_ldap_error1"), "ldapLogin");
         return;
     }
     if ($this->IsServerCheck()) {
         $this->connSuccessString = GetMessage("wiz_ldap_success");
         $wizard->SetCurrentStep("ldap_settings");
     } elseif ($this->ldp) {
         $dbGroup = $this->ldp->GetGroupList();
         if (!$dbGroup->Fetch()) {
             $this->SetError(GetMessage("wiz_ldap_error_root"), "ldapBaseDN");
             return;
         }
     }
     if ($wizard->GetVar('ldapNTLM') == 'Y' && strlen($wizard->GetVar('ldapNTLMDomain')) <= 0) {
         $this->SetError(GetMessage('wiz_ldap_error_domain'), "ldapNTLMDomain");
         return;
     }
     $wizardPath = $wizard->GetPath();
     $servicePath = $_SERVER["DOCUMENT_ROOT"] . $wizardPath . "/site/services/main/groups.php";
     if (file_exists($servicePath)) {
         define("WIZARD_IS_RERUN", true);
         define("WIZARD_SERVICE_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . $wizardPath . "/site/services/main");
         WizardServices::IncludeServiceLang("groups.php");
         include_once $servicePath;
     }
 }
Ejemplo n.º 6
0
$dbExistsGroup = CForumGroup::GetListEx(array(), array("LID" => LANGUAGE_ID));
while ($arExistsGroup = $dbExistsGroup->Fetch()) {
    foreach ($arGroupID as $xmlID => $ID) {
        if ($arExistsGroup["NAME"] == GetMessage($xmlID . "_GROUP_NAME")) {
            $arGroupID[$xmlID] = $arExistsGroup["ID"];
        }
    }
}
$sort = 1;
foreach ($arGroupID as $xmlID => $groupID) {
    if ($groupID > 0) {
        continue;
    }
    $arNewGroup = array("SORT" => $sort++, "LANG" => array());
    foreach ($arLanguages as $languageID) {
        $arMessages = WizardServices::IncludeServiceLang("index.php", $languageID, $bReturnArray = true);
        $arNewGroup["LANG"][] = array("LID" => $languageID, "NAME" => array_key_exists($xmlID . "_GROUP_NAME", $arMessages) ? $arMessages[$xmlID . "_GROUP_NAME"] : GetMessage($xmlID . "_GROUP_NAME"), "DESCRIPTION" => array_key_exists($xmlID . "_GROUP_DESCRIPTION", $arMessages) ? $arMessages[$xmlID . "_GROUP_DESCRIPTION"] : GetMessage($xmlID . "_GROUP_DESCRIPTION"));
    }
    $arGroupID[$xmlID] = CForumGroup::Add($arNewGroup);
}
$rsUser = CUser::GetByID(1);
if ($arUser = $rsUser->Fetch()) {
    $userName = $arUser["NAME"] . (strlen($arUser["NAME"]) <= 0 || strlen($arUser["LAST_NAME"]) <= 0 ? "" : " ") . $arUser["LAST_NAME"];
    $authorName = strlen(trim($userName)) > 0 ? $userName : $arUser["LOGIN"];
} else {
    $authorName = "admin";
}
$arForums = array(array("XML_ID" => "NEWS_COMMENTS", "NAME" => GetMessage("NEWS_COMMENTS_FORUM_NAME"), "DESCRIPTION" => GetMessage("NEWS_COMMENTS_FORUM_DESCRIPTION"), "SORT" => 2, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "DEDUPLICATION" => "N", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["COMMENTS"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "M", WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y")), array("XML_ID" => "PHOTOGALLERY_COMMENTS", "NAME" => GetMessage("PHOTOGALLERY_COMMENTS_FORUM_NAME"), "DESCRIPTION" => GetMessage("PHOTOGALLERY_COMMENTS_FORUM_DESCRIPTION"), "SORT" => 3, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "DEDUPLICATION" => "N", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "M", WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y")), array("XML_ID" => "USERS_AND_GROUPS", "NAME" => GetMessage("USERS_AND_GROUPS_FORUM_NAME"), "DESCRIPTION" => GetMessage("USERS_AND_GROUPS_FORUM_DESCRIPTION"), "SORT" => 4, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "A", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "DEDUPLICATION" => "N", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array(WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y")), array("XML_ID" => "DOCS_SHARED_COMMENTS", "NAME" => GetMessage("DOCS_SHARED_COMMENTS_NAME"), "DESCRIPTION" => GetMessage("DOCS_SHARED_COMMENTS_DECRIPTION"), "SORT" => 5, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "DEDUPLICATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "M", WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y")), array("XML_ID" => "DOCS_SALES_COMMENTS", "NAME" => GetMessage("DOCS_SALES_COMMENTS_NAME"), "DESCRIPTION" => GetMessage("DOCS_SALES_COMMENTS_DECRIPTION"), "SORT" => 6, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "DEDUPLICATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "A", WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y", WIZARD_EMPLOYEES_GROUP => "M", WIZARD_MARKETING_AND_SALES_GROUP => "M")), array("XML_ID" => "DOCS_DIRECTORS_COMMENTS", "NAME" => GetMessage("DOCS_DIRECTORS_COMMENTS_NAME"), "DESCRIPTION" => GetMessage("DOCS_DIRECTORS_COMMENTS_DECRIPTION"), "SORT" => 6, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "DEDUPLICATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "A", WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y", WIZARD_DIRECTION_GROUP => "M")), array("XML_ID" => "GROUPS_AND_USERS_FILES_COMMENTS", "NAME" => GetMessage("GROUPS_AND_USERS_COMMENTS_NAME"), "DESCRIPTION" => GetMessage("GROUPS_AND_USERS_COMMENTS_DESCRIPTION"), "SORT" => 6, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "DEDUPLICATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "M", WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y")));
foreach ($arForums as $arForum) {
    $dbForum = CForumNew::GetList(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => $arForum["XML_ID"]));
    if ($dbForum->Fetch()) {
Ejemplo n.º 7
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("iblock")) {
    return;
}
$arTypes = array(array(), array("ID" => "news", "SECTIONS" => "Y", "IN_RSS" => "N", "SORT" => 50, "LANG" => array()), array("ID" => "portfolio", "SECTIONS" => "Y", "IN_RSS" => "N", "SORT" => 100, "LANG" => array()), array("ID" => "price", "SECTIONS" => "Y", "IN_RSS" => "N", "SORT" => 150, "LANG" => array()), array("ID" => "reviews", "SECTIONS" => "Y", "IN_RSS" => "N", "SORT" => 200, "LANG" => array()), array("ID" => "services", "SECTIONS" => "Y", "IN_RSS" => "N", "SORT" => 250, "LANG" => array()), array("ID" => "slider", "SECTIONS" => "Y", "IN_RSS" => "N", "SORT" => 300, "LANG" => array()));
$arLanguages = array();
$rsLanguage = CLanguage::GetList($by, $order, array());
while ($arLanguage = $rsLanguage->Fetch()) {
    $arLanguages[] = $arLanguage["LID"];
}
$iblockType = new CIBlockType();
foreach ($arTypes as $arType) {
    $dbType = CIBlockType::GetList(array(), array("=ID" => $arType["ID"]));
    if ($dbType->Fetch()) {
        continue;
    }
    foreach ($arLanguages as $languageID) {
        WizardServices::IncludeServiceLang("type.php", $languageID);
        $code = strtoupper($arType["ID"]);
        $arType["LANG"][$languageID]["NAME"] = GetMessage($code . "_TYPE_NAME");
        $arType["LANG"][$languageID]["ELEMENT_NAME"] = GetMessage($code . "_ELEMENT_NAME");
        if ($arType["SECTIONS"] == "Y") {
            $arType["LANG"][$languageID]["SECTION_NAME"] = GetMessage($code . "_SECTION_NAME");
        }
    }
    $iblockType->Add($arType);
}
Ejemplo n.º 8
0
    if ($iblockID < 1) {
        return;
    }
    //IBlock fields
    $iblock = new CIBlock();
    $arFields = array("ACTIVE" => "Y", "FIELDS" => array('IBLOCK_SECTION' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'Y'), 'ACTIVE_FROM' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '=today'), 'ACTIVE_TO' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SORT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'NAME' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => ''), 'PREVIEW_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('FROM_DETAIL' => 'N', 'SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N', 'METHOD' => 'resample', 'COMPRESSION' => 95, 'DELETE_WITH_DETAIL' => 'N', 'UPDATE_WITH_DETAIL' => 'N')), 'PREVIEW_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'PREVIEW_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'DETAIL_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N', 'METHOD' => 'resample', 'COMPRESSION' => 95)), 'DETAIL_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'DETAIL_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'XML_ID' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'CODE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => array('UNIQUE' => 'Y', 'TRANSLITERATION' => 'Y', 'TRANS_LEN' => 100, 'TRANS_CASE' => 'L', 'TRANS_SPACE' => '_', 'TRANS_OTHER' => '_', 'TRANS_EAT' => 'Y', 'USE_GOOGLE' => 'Y')), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SECTION_NAME' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => ''), 'SECTION_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('FROM_DETAIL' => 'N', 'SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N', 'METHOD' => 'resample', 'COMPRESSION' => 95, 'DELETE_WITH_DETAIL' => 'N', 'UPDATE_WITH_DETAIL' => 'N')), 'SECTION_DESCRIPTION_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'SECTION_DESCRIPTION' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SECTION_DETAIL_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N', 'METHOD' => 'resample', 'COMPRESSION' => 95)), 'SECTION_XML_ID' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SECTION_CODE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('UNIQUE' => 'N', 'TRANSLITERATION' => 'N', 'TRANS_LEN' => 100, 'TRANS_CASE' => 'L', 'TRANS_SPACE' => '_', 'TRANS_OTHER' => '_', 'TRANS_EAT' => 'Y', 'USE_GOOGLE' => 'N'))), "CODE" => "news", "XML_ID" => $iblockCode);
    $iblock->Update($iblockID, $arFields);
} else {
    $arSites = array();
    $db_res = CIBlock::GetSite($iblockID);
    while ($res = $db_res->Fetch()) {
        $arSites[] = $res["LID"];
    }
    if (!in_array(WIZARD_SITE_ID, $arSites)) {
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
}
$dbSite = CSite::GetByID(WIZARD_SITE_ID);
if ($arSite = $dbSite->Fetch()) {
    $lang = $arSite["LANGUAGE_ID"];
}
if (strlen($lang) <= 0) {
    $lang = "ru";
}
WizardServices::IncludeServiceLang("news.php", $lang);
//CUserOptions::SetOption("form", "form_element_".$iblockID, array ( 'tabs' => 'edit1--#--'.GetMessage("WZD_OPTION_NEWS_1").'--,--ACTIVE--#--'.GetMessage("WZD_OPTION_NEWS_2").'--,--ACTIVE_FROM--#--'.GetMessage("WZD_OPTION_NEWS_3").'--,--NAME--#--'.GetMessage("WZD_OPTION_NEWS_5").'--,--CODE--#--'.GetMessage("WZD_OPTION_NEWS_6").'--,--PREVIEW_TEXT--#--'.GetMessage("WZD_OPTION_NEWS_8").'--,--DETAIL_TEXT--#--'.GetMessage("WZD_OPTION_NEWS_10").'--;--', ));
//CUserOptions::SetOption("list", "tbl_iblock_list_".md5($iblockType.".".$iblockID), array ( 'columns' => 'NAME,ACTIVE,DATE_ACTIVE_FROM', 'by' => 'timestamp_x', 'order' => 'desc', 'page_size' => '20', ));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/news/index.php", array("NEWS_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/sect_bottom.php", array("NEWS_IBLOCK_ID" => $iblockID));
Ejemplo n.º 9
0
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
}
//template
CWizardUtil::ReplaceMacros($_SERVER["DOCUMENT_ROOT"] . "/bitrix/templates/webfly_san/footer.php", array("WF_IB_FEEDBACK" => $iblockID));
// creating event
function UET($EVENT_NAME, $NAME, $LID, $DESCRIPTION)
{
    $et = new CEventType();
    $et->Add(array("LID" => $LID, "EVENT_NAME" => $EVENT_NAME, "NAME" => $NAME, "DESCRIPTION" => $DESCRIPTION));
}
$em = new CEventMessage();
$langs = CLanguage::GetList($b = "", $o = "");
$evtMsg = 0;
while ($lang = $langs->Fetch()) {
    WizardServices::IncludeServiceLang("feedback.php", $lang["LID"]);
    $arSites = array();
    $sites = CLang::GetList($by, $order, array("LANGUAGE_ID" => $lang["LID"]));
    while ($site = $sites->Fetch()) {
        $arSites[] = $site["LID"];
    }
    ///////////////////// FEEDBACK_FORM /////////////////////
    $fres = CEventType::GetList(array("EVENT_NAME" => "NEW_FEEDBACK_FORM", "LID" => $lang["LID"]));
    if (!$fres->Fetch()) {
        UET("NEW_FEEDBACK_FORM", GetMessage("FEEDBACK_FORM_NAME"), $lang["LID"], "\n\t\t\t#AUTHOR# - " . GetMessage("FEEDBACK_FORM_AUTHOR") . "\n      #AUTHOR_EMAIL# - " . GetMessage("FEEDBACK_FORM_EMAIL") . "\n      #TEXT# - " . GetMessage("FEEDBACK_FORM_TEXT") . "\n      #EMAIL_FROM# - " . GetMessage("FEEDBACK_FORM_EMAIL_FROM") . "\n      #EMAIL_TO# - " . GetMessage("FEEDBACK_FORM_EMAIL_TO") . "\n      #LINK# " . GetMessage("FEEDBACK_FORM_EMAIL_TO"));
        if (is_array($arSites) && count($arSites) > 0) {
            //****************************************************************
            $evtMsg = $em->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "NEW_FEEDBACK_FORM", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => "#SITE_NAME#: " . GetMessage("FEEDBACK_FORM_DESC"), "MESSAGE" => GetMessage("FEEDBACK_FORM_BODY"), "BODY_TYPE" => "text"));
            //****************************************************************
        }
    } else {
Ejemplo n.º 10
0
$Set_ID = $_SESSION["WF_IBL_SETTINGS_ID"];
unset($_SESSION["WF_IBL_SETTINGS_ID"]);
//Creating default values
$hldata = HL\HighloadBlockTable::getById($Set_ID)->fetch();
$hlentity = HL\HighloadBlockTable::compileEntity($hldata);
$hlHandler = $hlentity->getDataClass();
$getList = new Entity\Query($hlHandler);
$getList->setSelect(array('*'));
$getList->setOrder(array("ID" => "ASC"));
$getList->setFilter(array("ID" => 1));
$result = $getList->exec();
$result = new CDBResult($result);
if ($row = $result->Fetch()) {
} else {
    $arData = array("UF_THEME" => "default", "UF_SHADOWS" => "default", "UF_BUTTONS" => "coral", "UF_BG" => "default");
    $hlHandler::add($arData);
}
$Brand_ID = $_SESSION["WF_IBL_BRANDS_ID"];
unset($_SESSION["WF_IBL_BRANDS_ID"]);
$hldata = HL\HighloadBlockTable::getById($Brand_ID)->fetch();
$hlentity = HL\HighloadBlockTable::compileEntity($hldata);
$hlHandler = $hlentity->getDataClass();
$sort = 100;
$arBrandsUt = array("1 Marka" => "ref_files/7e44ec9828b17ace0d8f75a349b8de43.png", "Apollo" => "ref_files/61441e895fdde98034964c624e295f90.png", "AquaVita" => "ref_files/9d8f6c21dbd87f76b88a8b35e3cd0572.png", "BAS" => "ref_files/7eaea2afe6729ef29a25aeb82aba2513.png", "Cersanit" => "ref_files/9fe61dfbd7454a7ee27e41e0066fd3ba.png", "EAGO" => "ref_files/7d6f158e6fba7b90963c489c218fb8ef.png", "Kolpa-san" => "ref_files/a1906e21f88ebf48c6550117fb77b69f.png", "Loranto" => "ref_files/794eda4bc38c0decfb66455b436919e2.png", "RELISAN" => "ref_files/a3a02d848afdf90036f1def792d5adaf.png", "Roca" => "ref_files/bddd67008a780c90950540be078685a0.png", "Triton" => "ref_files/f75713924bd7964c999de3fbea43c2de.png", "Vayer" => "ref_files/5841ebf40c33bc9858245adfe7336427.png", "IDDIS" => "ref_files/85f24f3d3a9da494f411baa869b9df69.png", "Grohe" => "ref_files/6a2820fa128435a333ca473d06a78895.png", "Hansgrohe" => "ref_files/82499c22bd8a60b4ced944606973a91a.png");
WizardServices::IncludeServiceLang("highloadblocks.php", "ru");
foreach ($arBrandsUt as $brandName => $BrandIMG) {
    $lowerName = str_replace(array(" ", "-"), "", strtolower($brandName));
    $arData = array("UF_NAME" => $brandName, "UF_FILE" => array("name" => $lowerName . ".png", "type" => "image/png", "tmp_name" => WIZARD_ABSOLUTE_PATH . "/site/services/iblock/" . $BrandIMG), "UF_SORT" => $sort, "UF_DESCRIPTION" => GetMessage("SHORT_DESC_" . $lowerName), "UF_FULL_DESCRIPTION" => GetMessage("LONG_DESC_" . $lowerName), "UF_LINK" => $lowerName, "UF_EXTERNAL_CODE" => "", "UF_XML_ID" => $lowerName);
    $result = $hlHandler::add($arData);
    $sort = $sort + 10;
}
Ejemplo n.º 11
0
        $arSites[] = $res["LID"];
    }
    if (!in_array(WIZARD_SITE_ID, $arSites)) {
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
}
$arProperty = array();
$dbProperty = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $iblockID));
while ($arProp = $dbProperty->Fetch()) {
    $arProperty[$arProp["CODE"]] = $arProp["ID"];
}
$dbSite = CSite::GetByID(WIZARD_SITE_ID);
if ($arSite = $dbSite->Fetch()) {
    $lang = $arSite["LANGUAGE_ID"];
}
if (strlen($lang) <= 0) {
    $lang = "ru";
}
WizardServices::IncludeServiceLang("catalog.php", $lang);
//for element edit
CUserOptions::SetOption("form", "form_element_" . $iblockID, array('tabs' => 'edit1--#--' . GetMessage("WZD_OPTION_CATALOG_1") . '--,--NAME--#--' . GetMessage("WZD_OPTION_CATALOG_3") . '--,--CODE--#--' . GetMessage("WZD_OPTION_CATALOG_4") . '--,--PROPERTY_' . $arProperty["TITLE"] . '--#--' . GetMessage("WZD_OPTION_CATALOG_35") . '--,--PROPERTY_' . $arProperty["HEADER1"] . '--#--' . GetMessage("WZD_OPTION_CATALOG_36") . '--,--PROPERTY_' . $arProperty["KEYWORDS"] . '--#--' . GetMessage("WZD_OPTION_CATALOG_37") . '--,--PROPERTY_' . $arProperty["META_DESCRIPTION"] . '--#--' . GetMessage("WZD_OPTION_CATALOG_38") . '--,--ACTIVE--#--' . GetMessage("WZD_OPTION_CATALOG_2") . '--,--PROPERTY_' . $arProperty["SALELEADER"] . '--#--' . GetMessage("WZD_OPTION_CATALOG_29") . '--,--PROPERTY_' . $arProperty["NEWPRODUCT"] . '--#--' . GetMessage("WZD_OPTION_CATALOG_11") . '--,--PROPERTY_' . $arProperty["SPECIALOFFER"] . '--#--' . GetMessage("WZD_OPTION_CATALOG_10") . '--,--PREVIEW_TEXT--#--' . GetMessage("WZD_OPTION_CATALOG_6") . '--,--DETAIL_TEXT--#--' . GetMessage("WZD_OPTION_CATALOG_7") . '--,--DETAIL_PICTURE--#--' . GetMessage("WZD_OPTION_CATALOG_5") . '--,--PROPERTY_' . $arProperty["MORE_PHOTO"] . '--#--' . GetMessage("WZD_OPTION_CATALOG_18") . '--,--SECTIONS--#--' . GetMessage("WZD_OPTION_CATALOG_39") . '--,--IBLOCK_ELEMENT_PROPERTY--#--' . GetMessage("WZD_OPTION_CATALOG_32") . '--,--CATALOG--#--' . GetMessage("WZD_OPTION_CATALOG_20") . '--;--cedit1--#--' . GetMessage("WZD_OPTION_CATALOG_33") . '--,--PROPERTY_' . $arProperty["RECOMMEND"] . '--#--' . GetMessage("WZD_OPTION_CATALOG_31") . '--;--edit8--#--' . GetMessage("WZD_OPTION_CATALOG_34") . '--,--OFFERS--#--' . GetMessage("WZD_OPTION_CATALOG_34") . '--;--'));
//for section edit
CUserOptions::SetOption("form", "form_section_" . $iblockID, array('tabs' => 'edit1--#--' . GetMessage("WZD_OPTION_CATALOG_21") . '--,--ACTIVE--#--' . GetMessage("WZD_OPTION_CATALOG_22") . '--,--IBLOCK_SECTION_ID--#--' . GetMessage("WZD_OPTION_CATALOG_23") . '--,--NAME--#--' . GetMessage("WZD_OPTION_CATALOG_24") . '--,--CODE--#--' . GetMessage("WZD_OPTION_CATALOG_25") . '--,--UF_BROWSER_TITLE--#--' . GetMessage("WZD_OPTION_CATALOG_35") . '--,--UF_TITLE_H1--#--' . GetMessage("WZD_OPTION_CATALOG_36") . '--,--UF_KEYWORDS--#--' . GetMessage("WZD_OPTION_CATALOG_37") . '--,--UF_META_DESCRIPTION--#--' . GetMessage("WZD_OPTION_CATALOG_38") . '--,--SORT--#--' . GetMessage("WZD_OPTION_CATALOG_28") . '--,--PICTURE--#--' . GetMessage("WZD_OPTION_CATALOG_26") . '--,--DESCRIPTION--#--' . GetMessage("WZD_OPTION_CATALOG_27") . '--;--edit1_csection2--#--' . GetMessage("WZD_OPTION_CATALOG_40") . '--,--SECTION_PROPERTY--#--' . GetMessage("WZD_OPTION_CATALOG_41") . '--;--edit4--#--' . GetMessage("WZD_OPTION_CATALOG_41") . '--;--'));
CUserOptions::SetOption("list", "tbl_iblock_list_" . md5($iblockType . "." . $iblockID), array('columns' => 'DETAIL_PICTURE,PROPERTY_' . $arProperty["ARTNUMBER"] . ',NAME,CATALOG_GROUP_1,PROPERTY_' . $arProperty["SPECIALOFFER"] . ',PROPERTY_' . $arProperty["NEWPRODUCT"] . ',PROPERTY_' . $arProperty["SALELEADER"] . '', 'by' => 'timestamp_x', 'order' => 'desc', 'page_size' => '20'));
CUserOptions::SetOption("list", "tbl_product_admin_" . md5($iblockType . "." . $iblockID), array('columns' => 'DETAIL_PICTURE,NAME,CATALOG_GROUP_1,ACTIVE,SORT,CATALOG_QUANTITY,ID,TIMESTAMP_X' . '', 'by' => 'timestamp_x', 'order' => 'desc', 'page_size' => '20'));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/catalog/index.php", array("CATALOG_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/sect_inc.php", array("CATALOG_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/_index.php", array("CATALOG_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/catalog/sect_sidebar.php.php", array("CATALOG_IBLOCK_ID" => $iblockID));
Ejemplo n.º 12
0
    //IBlock fields
    $iblock = new CIBlock();
    $arFields = array("ACTIVE" => "Y", "FIELDS" => array('IBLOCK_SECTION' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'Y'), 'ACTIVE_FROM' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE_TO' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SORT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'NAME' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => ''), 'PREVIEW_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('FROM_DETAIL' => 'N', 'SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N', 'METHOD' => 'resample', 'COMPRESSION' => 95, 'DELETE_WITH_DETAIL' => 'N', 'UPDATE_WITH_DETAIL' => 'N')), 'PREVIEW_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'PREVIEW_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'DETAIL_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N', 'METHOD' => 'resample', 'COMPRESSION' => 95)), 'DETAIL_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'DETAIL_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'XML_ID' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'CODE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('UNIQUE' => 'N', 'TRANSLITERATION' => 'N', 'TRANS_LEN' => 100, 'TRANS_CASE' => 'L', 'TRANS_SPACE' => '_', 'TRANS_OTHER' => '_', 'TRANS_EAT' => 'Y', 'USE_GOOGLE' => 'N')), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SECTION_NAME' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => ''), 'SECTION_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('FROM_DETAIL' => 'N', 'SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N', 'METHOD' => 'resample', 'COMPRESSION' => 95, 'DELETE_WITH_DETAIL' => 'N', 'UPDATE_WITH_DETAIL' => 'N')), 'SECTION_DESCRIPTION_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'SECTION_DESCRIPTION' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SECTION_DETAIL_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N', 'METHOD' => 'resample', 'COMPRESSION' => 95)), 'SECTION_XML_ID' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SECTION_CODE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('UNIQUE' => 'N', 'TRANSLITERATION' => 'N', 'TRANS_LEN' => 100, 'TRANS_CASE' => 'L', 'TRANS_SPACE' => '_', 'TRANS_OTHER' => '_', 'TRANS_EAT' => 'Y', 'USE_GOOGLE' => 'N'))), "CODE" => "faq", "XML_ID" => $iblockCode);
    $iblock->Update($iblockID, $arFields);
} else {
    $arSites = array();
    $db_res = CIBlock::GetSite($iblockID);
    while ($res = $db_res->Fetch()) {
        $arSites[] = $res["LID"];
    }
    if (!in_array(WIZARD_SITE_ID, $arSites)) {
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
}
$dbSite = CSite::GetByID(WIZARD_SITE_ID);
if ($arSite = $dbSite->Fetch()) {
    $lang = $arSite["LANGUAGE_ID"];
}
if (strlen($lang) <= 0) {
    $lang = "ru";
}
WizardServices::IncludeServiceLang("faq.php", $lang);
CUserOptions::SetOption("form", "form_element_" . $iblockID, array('tabs' => 'edit1--#--' . GetMessage("WZD_OPTION_FAQ_1") . '--,--ACTIVE--#--' . GetMessage("WZD_OPTION_FAQ_2") . '--,--SORT--#--' . GetMessage("WZD_OPTION_FAQ_3") . '--,--NAME--#--' . GetMessage("WZD_OPTION_FAQ_4") . '--,--DETAIL_TEXT--#--' . GetMessage("WZD_OPTION_FAQ_5") . '--;--'));
CUserOptions::SetOption("list", "tbl_iblock_list_" . md5($iblockType . "." . $iblockID), array('columns' => 'NAME,SORT,ACTIVE', 'by' => 'timestamp_x', 'order' => 'desc', 'page_size' => '20'));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/about/faq/index.php", array("FAQ_IBLOCK_ID" => $iblockID));
$dbSection = CIBlockSection::GetList(array(), array("IBLOCK_ID" => $iblockID));
if ($arSection = $dbSection->Fetch()) {
    CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/about/faq/index.php", array("FAQ_SECTION_ID" => $arSection["ID"]));
}
Ejemplo n.º 13
0
 protected function __createIBlockType($typeID)
 {
     if (!array_key_exists($typeID, $this->_arConfig['IBLOCK_TYPE'])) {
         return false;
     }
     $arType = array('ID' => $typeID, 'SECTIONS' => $this->_arConfig['IBLOCK_TYPE'][$typeID]['SECTIONS'], 'IN_RSS' => $this->_arConfig['IBLOCK_TYPE'][$typeID]['IN_RSS'], 'SORT' => $this->_arConfig['IBLOCK_TYPE'][$typeID]['SORT'], 'LANG' => array());
     if ($this->_arConfig['IBLOCK_TYPE'][$typeID]['IS_EXISTS'] == true) {
         return true;
     }
     $dbType = \CIBlockType::GetList(array(), array('=ID' => $arType['ID']));
     if ($dbType->Fetch()) {
         $this->_arConfig['IBLOCK_TYPE'][$typeID]['IS_EXISTS'] = true;
         return true;
     }
     $arLanguages = self::getLanguages();
     foreach ($arLanguages as $languageID) {
         \WizardServices::IncludeServiceLang('_iblock_types.php', $languageID);
         $code = strtoupper($arType['ID']);
         $arType['LANG'][$languageID]['NAME'] = GetMessage($code . '_TYPE_NAME');
         $arType['LANG'][$languageID]['ELEMENT_NAME'] = GetMessage($code . '_ELEMENT_NAME');
         if ($arType['SECTIONS'] == 'Y') {
             $arType['LANG'][$languageID]['SECTION_NAME'] = GetMessage($code . '_SECTION_NAME');
         }
     }
     $iblockType = new \CIBlockType();
     global $DB;
     $DB->StartTransaction();
     $res = $iblockType->Add($arType);
     if (!$res) {
         $DB->Rollback();
         echo 'Error creating iblock type: ' . $iblockType->LAST_ERROR . '<br>';
         die;
     } else {
         $this->_arConfig['IBLOCK_TYPE'][$typeID]['IS_EXISTS'] = true;
         $DB->Commit();
     }
     return true;
 }
Ejemplo n.º 14
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
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"))), false, $siteID);
COption::SetOptionInt("search", "suggest_save_days", 250);
COption::SetOptionString("search", "use_tf_cache", "Y");
COption::SetOptionString("search", "use_word_distance", "Y");
COption::SetOptionString("search", "use_social_rating", "Y");
COption::SetOptionString("iblock", "use_htmledit", "Y");
//socialservices
if (COption::GetOptionString("socialservices", "auth_services") == "") {
    $bRu = LANGUAGE_ID == 'ru';
    $arServices = array("VKontakte" => "Y", "MyMailRu" => "N", "Twitter" => "Y", "Facebook" => "Y", "Livejournal" => "N", "YandexOpenID" => "N", "Rambler" => "N", "MailRuOpenID" => "N", "Liveinternet" => "N", "Blogger" => "N", "OpenID" => "N", "LiveID" => "N");
    COption::SetOptionString("socialservices", "auth_services", serialize($arServices));
}
//Subscription
if (!CModule::IncludeModule("subscribe")) {
    return;
}
$rubrika = new CRubric();
$sort = array("SORT" => "ASC");
$res = $rubrika->GetList($sort);
$r = $res->Fetch();
if (!$r) {
    WizardServices::IncludeServiceLang("news.php", "ru");
    $arFieldsSBS = array("LID" => WIZARD_SITE_ID, "NAME" => GetMessage("SBS_NEWS_HEAD"), "ACTIVE" => "Y", "DESCRIPTION" => GetMessage("SBS_NEWS_DESC"), "VISIBLE" => "Y", "SORT" => "100");
    $rubrika->Add($arFieldsSBS);
}
Ejemplo n.º 15
0
		$dbVat = CCatalogVat::GetList(array(), Array("SITE_ID" => WIZARD_SITE_ID));
		if(!($dbVat->Fetch()))
		{
			$arF = Array ("ACTIVE" => "Y", "SORT" => "100", "NAME" => GetMessage("WIZ_VAT_1"), "RATE" => 0);
			CCatalogVat::Set($arF);
			$arF = Array ("ACTIVE" => "Y", "SORT" => "200", "NAME" => GetMessage("WIZ_VAT_2"), "RATE" => GetMessage("WIZ_VAT_2_VALUE"));
			CCatalogVat::Set($arF);
		}
		$dbResultList = CCatalogGroup::GetList(Array(), Array("CODE" => "BASE"));
		if($arRes = $dbResultList->Fetch())
		{
			$arFields = Array();
			foreach($arLanguages as $langID)
			{
				WizardServices::IncludeServiceLang("step1.php", $langID);
				$arFields["USER_LANG"][$langID] = GetMessage("WIZ_PRICE_NAME");
			}
			$arFields["BASE"] = "Y";
			if($wizard->GetVar("installPriceBASE") == "Y"){
				$db_res = CCatalogGroup::GetGroupsList(array("CATALOG_GROUP_ID"=>'1', "BUY"=>"Y"));
				if ($ar_res = $db_res->Fetch())
				{
					$wizGroupId[] = $ar_res['GROUP_ID'];
				}
				$wizGroupId[] = 2;
				$arFields["USER_GROUP"] = $wizGroupId;
				$arFields["USER_GROUP_BUY"] = $wizGroupId;
			}
			CCatalogGroup::Update($arRes["ID"], $arFields);
		}
Ejemplo n.º 16
0
$arLanguages = Array();
$rsLanguage = CLanguage::GetList($by, $order, array());
while($arLanguage = $rsLanguage->Fetch())
	$arLanguages[] = $arLanguage["LID"];

$obUserField  = new CUserTypeEntity;
foreach ($arUserFields as $arFields)
{
	$dbRes = CUserTypeEntity::GetList(Array(), Array("ENTITY_ID" => $arFields["ENTITY_ID"], "FIELD_NAME" => $arFields["FIELD_NAME"]));
	if ($dbRes->Fetch())
		continue;

	$arLabelNames = Array();
	foreach($arLanguages as $languageID)
	{
		WizardServices::IncludeServiceLang("references.php", $languageID);
		$arLabelNames[$languageID] = GetMessage($arFields["FIELD_NAME"]);
	}

	$arFields["EDIT_FORM_LABEL"] = $arLabelNames;
	$arFields["LIST_COLUMN_LABEL"] = $arLabelNames;
	$arFields["LIST_FILTER_LABEL"] = $arLabelNames;

	$ID_USER_FIELD = $obUserField->Add($arFields);
}

/*if(!CModule::IncludeModule("iblock"))
	return;

$iblockXMLFile = WIZARD_SERVICE_RELATIVE_PATH."/xml/".LANGUAGE_ID."/references.xml";
$iblockCode = "clothes_colors_".WIZARD_SITE_ID;
Ejemplo n.º 17
0
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
}
$arProperty = array();
$codeProperty = '';
$i = 4;
$dbProperty = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $iblockID));
while ($arProp = $dbProperty->Fetch()) {
    $arProperty[$arProp["CODE"]] = $arProp["ID"];
    $codeProperty .= $i++ . ' => "' . $arProp["ID"] . '",';
}
$codeRequired = '3 => "' . $arProperty['FIRM'] . '", 4 => "' . $arProperty['PHONE'] . '",  5 => "' . $arProperty['EMAIL'] . '", ';
$dbSite = CSite::GetByID(WIZARD_SITE_ID);
if ($arSite = $dbSite->Fetch()) {
    $lang = $arSite["LANGUAGE_ID"];
}
if (strlen($lang) <= 0) {
    $lang = "ru";
}
WizardServices::IncludeServiceLang("vacancy.php", $lang);
CUserOptions::SetOption("form", "form_element_" . $iblockID, array('tabs' => 'edit1--#--' . GetMessage("WZD_OPTION_VACANCY_0") . '--,--ACTIVE--#--' . GetMessage("WZD_OPTION_VACANCY_1") . '--,--ACTIVE_FROM--#--' . GetMessage("WZD_OPTION_VACANCY_2") . '--,--ACTIVE_TO--#--' . GetMessage("WZD_OPTION_VACANCY_24") . '--,--NAME--#--' . GetMessage("WZD_OPTION_VACANCY_3") . '--,--PROPERTY_' . $arProperty['SEX'] . '--#--' . GetMessage("WZD_OPTION_VACANCY_7") . '--,--PROPERTY_' . $arProperty['AGE'] . '--#--' . GetMessage("WZD_OPTION_VACANCY_8") . '--,--PROPERTY_' . $arProperty['EDUCATION'] . '--#--' . GetMessage("WZD_OPTION_VACANCY_9") . '--,--PROPERTY_' . $arProperty['EXPERIENCE'] . '--#--' . GetMessage("WZD_OPTION_VACANCY_10") . '--,--PROPERTY_' . $arProperty['SCHEDULE'] . '--#--' . GetMessage("WZD_OPTION_VACANCY_11") . '--,--PROPERTY_' . $arProperty['REMUNERATION'] . '--#--' . GetMessage("WZD_OPTION_VACANCY_12") . '--,--PROPERTY_' . $arProperty['SKILLS'] . '--#--' . GetMessage("WZD_OPTION_VACANCY_13") . '--,--PROPERTY_' . $arProperty['FIRM'] . '--#--' . GetMessage("WZD_OPTION_VACANCY_14") . '--,--PROPERTY_' . $arProperty['PERSON'] . '--#--' . GetMessage("WZD_OPTION_VACANCY_15") . '--,--PROPERTY_' . $arProperty['PHONE'] . '--#--' . GetMessage("WZD_OPTION_VACANCY_16") . '--,--PROPERTY_' . $arProperty['EMAIL'] . '--#--' . GetMessage("WZD_OPTION_VACANCY_17") . '--,--PROPERTY_' . $arProperty['URL'] . '--#--' . GetMessage("WZD_OPTION_VACANCY_18") . '--,--PREVIEW_TEXT--#--' . GetMessage("WZD_OPTION_VACANCY_4") . '--;--'));
CUserOptions::SetOption("form", "form_section_" . $iblockID, array('tabs' => 'edit1--#--' . GetMessage("WZD_OPTION_VACANCY_20") . '--,--NAME--#--' . GetMessage("WZD_OPTION_VACANCY_21") . '--,--CODE--#--' . GetMessage("WZD_OPTION_VACANCY_22") . '--,--SORT--#--' . GetMessage("WZD_OPTION_VACANCY_23") . '--;--'));
CUserOptions::SetOption("list", "tbl_iblock_list_" . md5($iblockType . "." . $iblockID), array('columns' => 'NAME,ACTIVE,DATE_ACTIVE_FROM', 'by' => 'timestamp_x', 'order' => 'desc', 'page_size' => '20'));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/job/index.php", array("VACANCY_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/job/vacancy/index.php", array("VACANCY_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/job/vacancy/my/index.php", array("VACANCY_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/job/vacancy/my/index.php", array("IDS_CODE_PROPERTY" => $codeProperty));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/job/vacancy/my/index.php", array("IDS_CODE_REQUIRED" => $codeRequired));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/sect_rbottom.php", array("VACANCY_IBLOCK_ID" => $iblockID));
Ejemplo n.º 18
0
}
if (strlen($lang) <= 0) {
    $lang = "ru";
}
$bRus = false;
if ($lang == "ru") {
    $bRus = true;
}
$defCurrency = "EUR";
if ($lang == "ru") {
    $defCurrency = "RUB";
} elseif ($lang == "en") {
    $defCurrency = "USD";
}
$delivery = $wizard->GetVar("delivery");
WizardServices::IncludeServiceLang("step2.php", $lang);
if (COption::GetOptionString("eshop", "wizard_installed", "N", WIZARD_SITE_ID) != "Y" || WIZARD_INSTALL_DEMO_DATA) {
    $locationGroupID = 0;
    $arLocation4Delivery = array();
    $arLocationArr = array();
    $dbLocation = CSaleLocation::GetList(array(), array("LID" => $lang));
    while ($arLocation = $dbLocation->Fetch()) {
        $arLocation4Delivery[] = array("LOCATION_ID" => $arLocation["ID"], "LOCATION_TYPE" => "L");
        $arLocationArr[] = $arLocation["ID"];
    }
    $dbGroup = CSaleLocationGroup::GetList();
    if ($arGroup = $dbGroup->Fetch()) {
        $arLocation4Delivery[] = array("LOCATION_ID" => $arGroup["ID"], "LOCATION_TYPE" => "G");
    } else {
        $groupLang = array(array("LID" => "en", "NAME" => "Group 1"));
        if ($bRus) {
Ejemplo n.º 19
0
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
}
if (empty($iblockID)) {
    $_SESSION["WF_SETUP_ERRORS"][] = "Failed to export options IB!";
}
//public_files
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/catalog/index.php", array("IBLOCK_OPTIONS" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/favorites/index.php", array("IBLOCK_OPTIONS" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "_index.php", array("IBLOCK_OPTIONS" => $iblockID));
//template files
$templatePath = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/templates/webfly_san/components/bitrix";
CWizardUtil::ReplaceMacros($templatePath . "/catalog/santech1_5/bitrix/catalog.element/advance/result_modifier.php", array("IBLOCK_OPTIONS" => $iblockID));
CWizardUtil::ReplaceMacros($_SERVER["DOCUMENT_ROOT"] . "/bitrix/templates/webfly_san/ajax/buy.php", array("IBLOCK_OPTIONS" => $iblockID));
//creating options link
$ib = new CIBlock();
$res = $ib->GetList(array(), array("CODE" => "santech"));
$catalog = $res->Fetch();
$catalogId = $catalog["ID"];
if (!empty($catalogId)) {
    WizardServices::IncludeServiceLang("texts.php", "ru");
    $ibProp = new CIBlockProperty();
    $arPropNew = array("NAME" => GetMessage("PROP_OPTIONS"), "CODE" => "PRODUCT", "ACTIVE" => "Y", "SORT" => 100, "USER_TYPE" => 'EList', "MULTIPLE" => "Y", "PROPERTY_TYPE" => "E", "IBLOCK_ID" => $catalogId, "HINT" => GetMessage("PROP_OPTIONS_HINT"), "LINK_IBLOCK_ID" => $iblockID);
    $arPropID = $ibProp->Add($arPropNew);
    if (empty($arPropID)) {
        $_SESSION["WF_SETUP_ERRORS"][] = "Failed to create options property!";
    }
} else {
    $_SESSION["WF_SETUP_ERRORS"][] = "Failed to found catalog!";
}
Ejemplo n.º 20
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("highloadblock")) {
    return;
}
if (!WIZARD_INSTALL_DEMO_DATA) {
    return;
}
WizardServices::IncludeServiceLang("references.php", LANGUAGE_ID);
use Bitrix\Highloadblock as HL;
global $USER_FIELD_MANAGER;
$COLOR_ID = $_SESSION["YOUSTORE_HBLOCK_COLOR_ID"];
unset($_SESSION["YOUSTORE_HBLOCK_COLOR_ID"]);
if ($COLOR_ID) {
    $hldata = HL\HighloadBlockTable::getById($COLOR_ID)->fetch();
    $hlentity = HL\HighloadBlockTable::compileEntity($hldata);
    $entity_data_class = $hlentity->getDataClass();
    $arColors = array("red", "black", "green", "cyan", "MPisaU0L", "yellow");
    $sort = 0;
    foreach ($arColors as $colorName) {
        $sort += 100;
        $arData = array('UF_NAME' => GetMessage("WZD_REF_COLOR_" . ToUpper($colorName)), 'UF_FILE' => array('name' => $colorName . ".jpg", 'type' => 'image/jpg', 'tmp_name' => WIZARD_ABSOLUTE_PATH . "/site/services/iblock/colors/" . $colorName . '.jpg'), 'UF_SORT' => $sort, 'UF_DEF' => $sort > 100 ? "0" : "1", 'UF_XML_ID' => $colorName, 'UF_DARK_COLOR' => $colorName == 'yellow' ? "0" : "1");
        $USER_FIELD_MANAGER->EditFormAddFields('HLBLOCK_' . $COLOR_ID, $arData);
        $USER_FIELD_MANAGER->checkFields('HLBLOCK_' . $COLOR_ID, null, $arData);
        $result = $entity_data_class::add($arData);
    }
}
$BACK_ID = $_SESSION["YOUSTORE_HBLOCK_BACK_ID"];
Ejemplo n.º 21
0
    $arSites = array();
    $db_res = CIBlock::GetSite($iblockID);
    while ($res = $db_res->Fetch()) {
        $arSites[] = $res["LID"];
    }
    if (!in_array(WIZARD_SITE_ID, $arSites)) {
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
}
$arProperty = array();
$dbProperty = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $iblockID));
while ($arProp = $dbProperty->Fetch()) {
    $arProperty[$arProp["CODE"]] = $arProp["ID"];
}
$codeProperty = '4 => "' . $arProperty['URL'] . '", ';
$dbSite = CSite::GetByID(WIZARD_SITE_ID);
if ($arSite = $dbSite->Fetch()) {
    $lang = $arSite["LANGUAGE_ID"];
}
if (strlen($lang) <= 0) {
    $lang = "ru";
}
WizardServices::IncludeServiceLang("links.php", $lang);
CUserOptions::SetOption("form", "form_element_" . $iblockID, array('tabs' => 'edit1--#--' . GetMessage("WZD_OPTION_LINKS_0") . '--,--ACTIVE--#--' . GetMessage("WZD_OPTION_LINKS_1") . '--,--ACTIVE_FROM--#--' . GetMessage("WZD_OPTION_LINKS_2") . '--,--NAME--#--' . GetMessage("WZD_OPTION_LINKS_3") . '--,--PREVIEW_TEXT--#--' . GetMessage("WZD_OPTION_LINKS_4") . '--,--PROPERTY_' . $arProperty['E_MAIL'] . '--#--' . GetMessage("WZD_OPTION_LINKS_6") . '--,--PROPERTY_' . $arProperty['URL'] . '--#--' . GetMessage("WZD_OPTION_LINKS_7") . '--,--PROPERTY_' . $arProperty['USER_ID'] . '--#--' . GetMessage("WZD_OPTION_LINKS_9") . '--,--SECTIONS--#--' . GetMessage("WZD_OPTION_LINKS_13") . '--;--'));
CUserOptions::SetOption("form", "form_section_" . $iblockID, array('tabs' => 'edit1--#--' . GetMessage("WZD_OPTION_LINKS_20") . '--,--NAME--#--' . GetMessage("WZD_OPTION_LINKS_21") . '--,--CODE--#--' . GetMessage("WZD_OPTION_LINKS_22") . '--,--SORT--#--' . GetMessage("WZD_OPTION_LINKS_23") . '--;--'));
CUserOptions::SetOption("list", "tbl_iblock_list_" . md5($iblockType . "." . $iblockID), array('columns' => 'NAME,ACTIVE,DATE_ACTIVE_FROM', 'by' => 'timestamp_x', 'order' => 'desc', 'page_size' => '20'));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/information/links/index.php", array("LINKS_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/information/links/my/index.php", array("LINKS_IBLOCK_ID" => $iblockID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/information/links/my/index.php", array("IDS_CODE_PROPERTY" => $codeProperty));
Ejemplo n.º 22
0
     $index->startIndex();
     $index->continueIndex(0);
     $index->endIndex();
     \Bitrix\Iblock\PropertyIndex\Manager::checkAdminNotification();
 }
 //user fields for sections
 $arLanguages = array();
 $rsLanguage = CLanguage::GetList($by, $order, array());
 while ($arLanguage = $rsLanguage->Fetch()) {
     $arLanguages[] = $arLanguage["LID"];
 }
 $arUserFields = array("UF_BROWSER_TITLE", "UF_KEYWORDS", "UF_META_DESCRIPTION");
 foreach ($arUserFields as $userField) {
     $arLabelNames = array();
     foreach ($arLanguages as $languageID) {
         WizardServices::IncludeServiceLang("property_names.php", $languageID);
         $arLabelNames[$languageID] = GetMessage($userField);
     }
     $arProperty["EDIT_FORM_LABEL"] = $arLabelNames;
     $arProperty["LIST_COLUMN_LABEL"] = $arLabelNames;
     $arProperty["LIST_FILTER_LABEL"] = $arLabelNames;
     $dbRes = CUserTypeEntity::GetList(array(), array("ENTITY_ID" => 'IBLOCK_' . $IBLOCK_CATALOG_ID . '_SECTION', "FIELD_NAME" => $userField));
     if ($arRes = $dbRes->Fetch()) {
         $userType = new CUserTypeEntity();
         $userType->Update($arRes["ID"], $arProperty);
     }
     //if($ex = $APPLICATION->GetException())
     //$strError = $ex->GetString();
 }
 //demo discount
 $dbDiscount = CCatalogDiscount::GetList(array(), array("SITE_ID" => WIZARD_SITE_ID));
Ejemplo n.º 23
0
    $hlentity = HL\HighloadBlockTable::compileEntity($hldata);
    //adding user fields
    $arUserFields = array(array('ENTITY_ID' => 'HLBLOCK_' . $Brand_ID, 'FIELD_NAME' => 'UF_NAME', 'USER_TYPE_ID' => 'string', 'XML_ID' => 'UF_BRAND_NAME', 'SORT' => '100', 'MULTIPLE' => 'N', 'MANDATORY' => 'N', 'SHOW_FILTER' => 'N', 'SHOW_IN_LIST' => 'Y', 'EDIT_IN_LIST' => 'Y', 'IS_SEARCHABLE' => 'Y'), array('ENTITY_ID' => 'HLBLOCK_' . $Brand_ID, 'FIELD_NAME' => 'UF_FILE', 'USER_TYPE_ID' => 'file', 'XML_ID' => 'UF_BRAND_FILE', 'SORT' => '200', 'MULTIPLE' => 'N', 'MANDATORY' => 'N', 'SHOW_FILTER' => 'N', 'SHOW_IN_LIST' => 'Y', 'EDIT_IN_LIST' => 'Y', 'IS_SEARCHABLE' => 'Y'), array('ENTITY_ID' => 'HLBLOCK_' . $Brand_ID, 'FIELD_NAME' => 'UF_LINK', 'USER_TYPE_ID' => 'string', 'XML_ID' => 'UF_BRAND_LINK', 'SORT' => '300', 'MULTIPLE' => 'N', 'MANDATORY' => 'N', 'SHOW_FILTER' => 'N', 'SHOW_IN_LIST' => 'Y', 'EDIT_IN_LIST' => 'Y', 'IS_SEARCHABLE' => 'Y'), array('ENTITY_ID' => 'HLBLOCK_' . $Brand_ID, 'FIELD_NAME' => 'UF_DESCRIPTION', 'USER_TYPE_ID' => 'string', 'XML_ID' => 'UF_BRAND_DESCR', 'SORT' => '400', 'MULTIPLE' => 'N', 'MANDATORY' => 'N', 'SHOW_FILTER' => 'N', 'SHOW_IN_LIST' => 'Y', 'EDIT_IN_LIST' => 'Y', 'IS_SEARCHABLE' => 'Y'), array('ENTITY_ID' => 'HLBLOCK_' . $Brand_ID, 'FIELD_NAME' => 'UF_FULL_DESCRIPTION', 'USER_TYPE_ID' => 'string', 'XML_ID' => 'UF_BRAND_FULL_DESCR', 'SORT' => '500', 'MULTIPLE' => 'N', 'MANDATORY' => 'N', 'SHOW_FILTER' => 'N', 'SHOW_IN_LIST' => 'Y', 'EDIT_IN_LIST' => 'Y', 'IS_SEARCHABLE' => 'Y'), array('ENTITY_ID' => 'HLBLOCK_' . $Brand_ID, 'FIELD_NAME' => 'UF_SORT', 'USER_TYPE_ID' => 'double', 'XML_ID' => 'UF_BRAND_SORT', 'SORT' => '600', 'MULTIPLE' => 'N', 'MANDATORY' => 'N', 'SHOW_FILTER' => 'N', 'SHOW_IN_LIST' => 'Y', 'EDIT_IN_LIST' => 'Y', 'IS_SEARCHABLE' => 'N'), array('ENTITY_ID' => 'HLBLOCK_' . $Brand_ID, 'FIELD_NAME' => 'UF_EXTERNAL_CODE', 'USER_TYPE_ID' => 'string', 'XML_ID' => 'UF_BRAND_EXTERNAL_CODE', 'SORT' => '700', 'MULTIPLE' => 'N', 'MANDATORY' => 'N', 'SHOW_FILTER' => 'N', 'SHOW_IN_LIST' => 'Y', 'EDIT_IN_LIST' => 'Y', 'IS_SEARCHABLE' => 'N'), array('ENTITY_ID' => 'HLBLOCK_' . $Brand_ID, 'FIELD_NAME' => 'UF_XML_ID', 'USER_TYPE_ID' => 'string', 'XML_ID' => 'UF_BRAND_XML_ID', 'SORT' => '800', 'MULTIPLE' => 'N', 'MANDATORY' => 'Y', 'SHOW_FILTER' => 'N', 'SHOW_IN_LIST' => 'Y', 'EDIT_IN_LIST' => 'Y', 'IS_SEARCHABLE' => 'N'));
    $arLanguages = array();
    $rsLanguage = CLanguage::GetList($by, $order, array());
    while ($arLanguage = $rsLanguage->Fetch()) {
        $arLanguages[] = $arLanguage["LID"];
    }
    $obUserField = new CUserTypeEntity();
    foreach ($arUserFields as $arFields) {
        $dbRes = CUserTypeEntity::GetList(array(), array("ENTITY_ID" => $arFields["ENTITY_ID"], "FIELD_NAME" => $arFields["FIELD_NAME"]));
        if ($dbRes->Fetch()) {
            continue;
        }
        $arLabelNames = array();
        foreach ($arLanguages as $languageID) {
            WizardServices::IncludeServiceLang("highloadblocks.php", $languageID);
            $arLabelNames[$languageID] = GetMessage($arFields["FIELD_NAME"]);
        }
        $arFields["EDIT_FORM_LABEL"] = $arLabelNames;
        $arFields["LIST_COLUMN_LABEL"] = $arLabelNames;
        $arFields["LIST_FILTER_LABEL"] = $arLabelNames;
        $ID_USER_FIELD = $obUserField->Add($arFields);
    }
} else {
    $Brand_ID = $fres["ID"];
}
$_SESSION["WF_IBL_BRANDS_ID"] = $Brand_ID;
//public
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/brands/index.php", array("HLB_BRANDS" => $Brand_ID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/brands/detail.php", array("HLB_BRANDS" => $Brand_ID));