当前位置: 首页>>代码示例>>PHP>>正文


PHP WizardServices::ImportIBlockFromXML方法代码示例

本文整理汇总了PHP中WizardServices::ImportIBlockFromXML方法的典型用法代码示例。如果您正苦于以下问题:PHP WizardServices::ImportIBlockFromXML方法的具体用法?PHP WizardServices::ImportIBlockFromXML怎么用?PHP WizardServices::ImportIBlockFromXML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WizardServices的用法示例。


在下文中一共展示了WizardServices::ImportIBlockFromXML方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("iblock")) {
    return;
}
$iblockXMLFile = WIZARD_SERVICE_RELATIVE_PATH . "/xml/" . LANGUAGE_ID . "/state_history.xml";
$iblockCode = "state_history";
$iblockType = "structure";
$rsIBlock = CIBlock::GetList(array(), array("CODE" => $iblockCode, "TYPE" => $iblockType));
$iblockID = false;
if ($arIBlock = $rsIBlock->Fetch()) {
    $iblockID = $arIBlock["ID"];
}
if ($iblockID == false) {
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "state_history", $iblockType, WIZARD_SITE_ID, $permissions = array("1" => "X", "2" => "R"));
    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' => ''), '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')), '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')), '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' => ''), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '')), "CODE" => $iblockCode, "XML_ID" => $iblockCode);
    $iblock->Update($iblockID, $arFields);
    $arProperties = array("USER", "USER_ACTIVE", "DEPARTMENT", "POST", "STATE");
    foreach ($arProperties as $propertyName) {
        ${$propertyName . "_PROPERTY_ID"} = 0;
        $properties = CIBlockProperty::GetList(array(), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblockID, "CODE" => $propertyName));
        if ($arProperty = $properties->Fetch()) {
            ${$propertyName . "_PROPERTY_ID"} = $arProperty["ID"];
        }
    }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:state_history.php

示例2: array

$iblockXMLFile = WIZARD_SERVICE_RELATIVE_PATH . "/xml/" . LANGUAGE_ID . "/group_files.xml";
$iblockCode = "group_files_" . WIZARD_SITE_ID;
$iblockType = "library";
$rsIBlock = CIBlock::GetList(array(), array("XML_ID" => $iblockCode, "TYPE" => $iblockType));
$iblockID = false;
if ($arIBlock = $rsIBlock->Fetch()) {
    $iblockID = $arIBlock["ID"];
}
if ($iblockID == false && WIZARD_SITE_ID == "s1") {
    $rsIBlock = CIBlock::GetList(array(), array("CODE" => "group_files", "TYPE" => $iblockType));
    if ($arIBlock = $rsIBlock->Fetch()) {
        $iblockID = $arIBlock["ID"];
    }
}
if ($iblockID == false) {
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "group_files_temp", $iblockType, WIZARD_SITE_ID, $permissions = array("1" => "X", "2" => "R", WIZARD_PORTAL_ADMINISTRATION_GROUP => "X"));
    if ($iblockID < 1) {
        return;
    }
    $arProperties = array("FILE");
    foreach ($arProperties as $propertyName) {
        ${$propertyName . "_PROPERTY_ID"} = 0;
        $properties = CIBlockProperty::GetList(array(), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblockID, "CODE" => $propertyName));
        if ($arProperty = $properties->Fetch()) {
            ${$propertyName . "_PROPERTY_ID"} = $arProperty["ID"];
        }
    }
    WizardServices::SetIBlockFormSettings($iblockID, array('tabs' => GetMessage("W_IB_GROUP_FILES_TAB1") . $FILE_PROPERTY_ID . GetMessage("W_IB_GROUP_FILES_TAB2")));
    //IBlock fields
    $iblock = new CIBlock();
    $arFields = array("ACTIVE" => "Y", "BIZPROC" => "Y", "WORKFLOW" => "N", "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')), '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')), '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' => ''), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '')), "CODE" => $iblockCode, "XML_ID" => $iblockCode);
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:group_files.php

示例3: array

$iblockXMLFile = WIZARD_SERVICE_RELATIVE_PATH . "/xml/" . LANGUAGE_ID . "/vacancy.xml";
$iblockCode = "vacancy_" . WIZARD_SITE_ID;
$iblockType = "services";
$rsIBlock = CIBlock::GetList(array(), array("XML_ID" => $iblockCode, "TYPE" => $iblockType));
$iblockID = false;
if ($arIBlock = $rsIBlock->Fetch()) {
    $iblockID = $arIBlock["ID"];
}
if ($iblockID == false && WIZARD_SITE_ID == "s1") {
    $rsIBlock = CIBlock::GetList(array(), array("CODE" => "vacancy", "TYPE" => $iblockType));
    if ($arIBlock = $rsIBlock->Fetch()) {
        $iblockID = $arIBlock["ID"];
    }
}
if ($iblockID == false) {
    $iblockID = WizardServices::ImportIBlockFromXML(WIZARD_SERVICE_RELATIVE_PATH . "/xml/" . LANGUAGE_ID . "/vacancy.xml", "vacancy_temp", $iblockType, WIZARD_SITE_ID, $permissions = array("1" => "X", "2" => "R", WIZARD_PORTAL_ADMINISTRATION_GROUP => "X", WIZARD_PERSONNEL_DEPARTMENT_GROUP => "W"));
    if ($iblockID < 1) {
        return;
    }
    $arProperties = array("office", "department");
    foreach ($arProperties as $propertyName) {
        ${$propertyName . "_property_id"} = 0;
        $properties = CIBlockProperty::GetList(array(), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblockID, "CODE" => $propertyName));
        if ($arProperty = $properties->Fetch()) {
            ${$propertyName . "_property_id"} = $arProperty["ID"];
        }
    }
    WizardServices::SetIBlockFormSettings($iblockID, array('tabs' => GetMessage("W_IB_VACANCY_TAB1") . $office_property_id . GetMessage("W_IB_VACANCY_TAB2") . $department_property_id . GetMessage("W_IB_VACANCY_TAB3")));
    //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')), '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')), 'DETAIL_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'html'), 'DETAIL_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => GetMessage("W_IB_VACANCY_TEXT")), 'XML_ID' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'CODE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '')), "CODE" => $iblockCode, "XML_ID" => $iblockCode);
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:vacancy.php

示例4: array

             $obTask->Add($task);
         }
     }
 }
 // tasks
 $tasksIblockId = 0;
 $tasksForumId = 0;
 if (CModule::IncludeModule("iblock")) {
     $iblockCode = "intranet_tasks";
     $iblockType = "services";
     $rsIBlock = CIBlock::GetList(array(), array("XML_ID" => $iblockCode, "TYPE" => $iblockType));
     if ($arIBlock = $rsIBlock->Fetch()) {
         $tasksIblockId = $arIBlock["ID"];
     }
     if ($tasksIblockId == 0) {
         $tasksIblockId = WizardServices::ImportIBlockFromXML(WIZARD_SERVICE_RELATIVE_PATH . "/xml/" . LANGUAGE_ID . "/tasks.xml", $iblockCode, $iblockType, WIZARD_SITE_ID, array("1" => "X", "2" => "R", WIZARD_PORTAL_ADMINISTRATION_GROUP => "X"));
         $iblock = new CIBlock();
         $arFields = array("CODE" => $iblockCode, "XML_ID" => $iblockCode);
         $iblock->Update($tasksIblockId, $arFields);
     } else {
         $arSites = array();
         $db_res = CIBlock::GetSite($tasksIblockId);
         while ($res = $db_res->Fetch()) {
             $arSites[] = $res["LID"];
         }
         if (!in_array(WIZARD_SITE_ID, $arSites)) {
             $arSites[] = WIZARD_SITE_ID;
             $iblock = new CIBlock();
             $iblock->Update($tasksIblockId, array("LID" => $arSites));
         }
     }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:index.php

示例5: array

$rsIBlock = CIBlock::GetList(array(), array("CODE" => $iblockCode, "TYPE" => $iblockType));
$iblockID = false;
if ($arIBlock = $rsIBlock->Fetch()) {
    $iblockID = $arIBlock["ID"];
    if (WIZARD_REINSTALL_DATA) {
        CIBlock::Delete($arIBlock["ID"]);
        $iblockID = false;
    }
}
if ($iblockID == false) {
    $permissions = array("1" => "X", "2" => "R");
    $dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "content_editor"));
    if ($arGroup = $dbGroup->Fetch()) {
        $permissions[$arGroup["ID"]] = 'W';
    }
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "stroika_slider", $iblockType, WIZARD_SITE_ID, $permissions);
    if ($iblockID < 1) {
        return;
    }
    //WizardServices::SetIBlockFormSettings($iblockID, Array ( 'tabs' => GetMessage("W_IB_GROUP_PHOTOG_TAB1").$REAL_PICTURE_PROPERTY_ID.GetMessage("W_IB_GROUP_PHOTOG_TAB2").$rating_PROPERTY_ID.GetMessage("W_IB_GROUP_PHOTOG_TAB3").$vote_count_PROPERTY_ID.GetMessage("W_IB_GROUP_PHOTOG_TAB4").$vote_sum_PROPERTY_ID.GetMessage("W_IB_GROUP_PHOTOG_TAB5").$APPROVE_ELEMENT_PROPERTY_ID.GetMessage("W_IB_GROUP_PHOTOG_TAB6").$PUBLIC_ELEMENT_PROPERTY_ID.GetMessage("W_IB_GROUP_PHOTOG_TAB7"), ));
    //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')), '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')), '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' => ''), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '')), "CODE" => $iblockCode, "XML_ID" => $iblockCode, "NAME" => $iblock->GetArrayByID($iblockID, "NAME"));
    $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)) {
开发者ID:sharapudinov,项目名称:arenda-yamobura.com,代码行数:31,代码来源:slider.php

示例6: array

$rsIBlock = CIBlock::GetList(array(), array("XML_ID" => $iblockCode, "TYPE" => $iblockType));
$iblockID = false;
if ($arIBlock = $rsIBlock->Fetch()) {
    $iblockID = $arIBlock["ID"];
    if (WIZARD_INSTALL_DEMO_DATA) {
        CIBlock::Delete($arIBlock["ID"]);
        $iblockID = false;
    }
}
if ($iblockID == false) {
    $permissions = array("1" => "X", "2" => "R");
    $dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "content_editor"));
    if ($arGroup = $dbGroup->Fetch()) {
        $permissions[$arGroup["ID"]] = 'W';
    }
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "clothes_news", $iblockType, WIZARD_SITE_ID, $permissions);
    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;
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:news.php

示例7: var_dump

$iblockID = false;
if ($arIBlock = $rsIBlock->Fetch()) {
    $iblockID = $arIBlock["ID"];
    var_dump(WIZARD_INSTALL_DEMO_DATA);
    if (WIZARD_INSTALL_DEMO_DATA) {
        CIBlock::Delete($arIBlock["ID"]);
        $iblockID = false;
    }
}
if ($iblockID == false) {
    $permissions = array("1" => "X", "2" => "R");
    $dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "content_editor"));
    if ($arGroup = $dbGroup->Fetch()) {
        $permissions[$arGroup["ID"]] = 'W';
    }
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "corp_vacancies", $iblockType, WIZARD_SITE_ID, $permissions);
    if ($iblockID < 1) {
        return;
    }
    //WizardServices::SetIBlockFormSettings($iblockID, Array ( 'tabs' => GetMessage("W_IB_GROUP_PHOTOG_TAB1").$REAL_PICTURE_PROPERTY_ID.GetMessage("W_IB_GROUP_PHOTOG_TAB2").$rating_PROPERTY_ID.GetMessage("W_IB_GROUP_PHOTOG_TAB3").$vote_count_PROPERTY_ID.GetMessage("W_IB_GROUP_PHOTOG_TAB4").$vote_sum_PROPERTY_ID.GetMessage("W_IB_GROUP_PHOTOG_TAB5").$APPROVE_ELEMENT_PROPERTY_ID.GetMessage("W_IB_GROUP_PHOTOG_TAB6").$PUBLIC_ELEMENT_PROPERTY_ID.GetMessage("W_IB_GROUP_PHOTOG_TAB7"), ));
    //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')), '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')), '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' => ''), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '')), "CODE" => $iblockCode, "XML_ID" => $iblockCode, "NAME" => $iblock->GetArrayByID($iblockID, "NAME"));
    $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)) {
开发者ID:k-kalashnikov,项目名称:geekcon,代码行数:31,代码来源:vacancies.php

示例8: array

if ($arIBlock = $rsIBlock->Fetch())
{
    $arSites = array();
    $db_res = CIBlock::GetSite($arIBlock['ID']);
    while ($res = $db_res->Fetch())
        $arSites[] = $res["LID"];
    if (!in_array(WIZARD_SITE_ID, $arSites))
    {
        $arSites[] = WIZARD_SITE_ID;
        $iBlock = new CIBlock;
        $iBlock->Update($arIBlock['ID'], array("LID" => $arSites));
    }
    $iblockID = $arIBlock['ID'];
} else {
    $iblockID = WizardServices::ImportIBlockFromXML(
        WIZARD_SERVICE_RELATIVE_PATH . "/xml/" . LANGUAGE_ID . "/products.xml",
        "aqw_shop_products",
        "catalog",
        WIZARD_SITE_ID
    );

}

if ($iblockID > 0){
    $arReplaceSub = array(
        'AQW_SHOP_PRODUCTS' => $iblockID,
    );
    CWizardUtil::ReplaceMacros(getenv("DOCUMENT_ROOT")."/bitrix/php_interface/".WIZARD_SITE_ID."/init.php", $arReplaceSub);

}
?>
开发者ID:ASDAFF,项目名称:bitrix_marketplace_module,代码行数:31,代码来源:products.php

示例9: array

    $arFields["USER_GROUP"] = array(1, 2);
    $arFields["USER_GROUP_BUY"] = array(1, 2);
    CCatalogGroup::Add($arFields);
}
if ($iblockID == 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';
    }
    $dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "content_editor"));
    if ($arGroup = $dbGroup->Fetch()) {
        $permissions[$arGroup["ID"]] = 'W';
    }
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "furniture", $iblockType, WIZARD_SITE_ID, $permissions);
    $iblockID1 = WizardServices::ImportIBlockFromXML($iblockXMLFilePrices, "furniture", $iblockType . "_prices", WIZARD_SITE_ID, $permissions);
    if ($iblockID < 1) {
        return;
    }
    //IBlock fields
    $iblock = new CIBlock();
    $arFields = array("ACTIVE" => "Y", "FIELDS" => array('IBLOCK_SECTION' => array('IS_REQUIRED' => 'Y', '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' => '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' => 'Y', 'DEFAULT_VALUE' => array('UNIQUE' => 'Y', 'TRANSLITERATION' => 'Y', 'TRANS_LEN' => 100, 'TRANS_CASE' => 'L', 'TRANS_SPACE' => '_', 'TRANS_OTHER' => '_', 'TRANS_EAT' => 'Y', 'USE_GOOGLE' => 'Y'))), "CODE" => "furniture", "XML_ID" => $iblockCode);
    $iblock->Update($iblockID, $arFields);
    //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) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:catalog.php

示例10: OnPostForm


//.........这里部分代码省略.........
							$langs = new CLang;
							if ($langs->Update($ST, $arFields) === false) {
								$arErrors[] = array('LID'=>$ST, 'NAME'=>$arSites[$ST]['NAME'], 'MSG'=>GetMessage('WD_TPL_NOT_ASSIGN'));
							}
							$arSitesPassed[] = $ST;
						}
						else {
							$this->SetError( GetMessage('WD_STEP_2_NOT_INSTALLED') );
						}
					}
					else {
						if (WizardServices::CopyDirFilesEx(str_replace('\\', '/', dirname(__FILE__)) . '/public_files', $doc_root) !== false) {
							
							$pub_files[] = '[' . $arSites[$ST]['LID'] . '] ' . $arSites[$ST]['NAME'];
							
							$langs = new CLang;
							if ($langs->Update($ST, $arFields) === false) {
								$arErrors[] = array('LID'=>$ST, 'NAME'=>$arSites[$ST]['NAME'], 'MSG'=>GetMessage('WD_TPL_NOT_ASSIGN'));
							}
							$arSitesPassed[] = $ST;
						}
						else {
							$this->SetError( GetMessage('WD_STEP_2_NOT_INSTALLED') );
						}
					}
				}
			}
			$wizard->SetVar('errors', $arErrors);
			$wizard->SetVar('public_files_installed', $pub_files);
			//$install_data = $wizard->GetVar('install_data');
			if (count($arSitesPassed) && count($pub_data)) {
				CModule::IncludeModule('iblock');
				// create iblock type
				$arType = array(
					'ID'=>'BT',
					"SECTIONS" => "Y",
					"IN_RSS" => "N",
					"SORT" => 100,
					"LANG" => Array(),
				);
				$arLanguages = Array();
				$rsLanguage = CLanguage::GetList($by, $order, array());
				while($arLanguage = $rsLanguage->Fetch())
					$arLanguages[] = $arLanguage["LID"];	
					
				$bIBType = true;
				$dbType = CIBlockType::GetList(Array(),Array("=ID" => $arType["ID"]));
				if(! $dbType->Fetch()) {
					foreach($arLanguages as $languageID)
					{
						$arType["LANG"][$languageID]["NAME"] = 'Bitrixtemplates';
						$arType["LANG"][$languageID]["ELEMENT_NAME"] = 'Item';
						$arType["LANG"][$languageID]["SECTION_NAME"] = 'Section';
					}
					$iblockType = new CIBlockType;
					$bIBType = $iblockType->Add($arType);
				}
				
				if ($bIBType) {
					$arCodeToId = array();
					foreach($pub_data as $arF) {
						$iblockCode = $arF['name'];
						$rsIBlock = CIBlock::GetList(array(), array("CODE" => $iblockCode, "TYPE" => $arType['ID']));
						if ($arIBlock = $rsIBlock->Fetch())
						{
							CIBlock::Delete($arIBlock["ID"]); 
						}
						$filepath = str_replace('\\', '/', dirname(__FILE__)) . '/public_data/'.$arF['filepath'];
						$filepath = preg_replace('#^.+?\/bitrix\/#','/bitrix/', $filepath);
						//echo $filepath;
						$iblockID = WizardServices::ImportIBlockFromXML(
							$filepath,
							$iblockCode,
							$arType['ID'],
							$arSitesPassed
						);
						$arCodeToId[$iblockCode] = $iblockID;
					}
					if ($pub_updater) {
						$updater = str_replace('\\', '/', dirname(__FILE__)) . '/public_data/'.$pub_updater;
						$arUpdate = array();
						include($updater);
						if (is_array($arUpdate)) {
							foreach($arUpdate as $arData) {
								$file = $_SERVER[DOCUMENT_ROOT].$arData['file'];
								//echo $file;
								//print_r($arCodeToId);
								$iblockCode = ToUpper($arData['code']).'_IBLOCK_CODE';
								$iblockId = ToUpper($arData['code']).'_IBLOCK_ID';
								$id = $arCodeToId[$arData['code']];
								if (file_exists($file) && $id) {
									CWizardUtil::ReplaceMacros($file, array($iblockCode => $arType['ID'], $iblockId => $id));
								}
							}
						}
					}
				}
			}
		}
	}
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:101,代码来源:wizard.php

示例11: array

        $iblockID = false;
        COption::SetOptionString("eshop", "demo_deleted", "N", "", WIZARD_SITE_ID);
    }
}
CModule::IncludeModule("catalog");
if ($iblockID == 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';
    }
    $dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "content_editor"));
    if ($arGroup = $dbGroup->Fetch()) {
        $permissions[$arGroup["ID"]] = 'W';
    }
    $IBLOCK_OFFERS_ID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "furniture_offers", $iblockType, WIZARD_SITE_ID, $permissions);
    if ($IBLOCK_OFFERS_ID < 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' => ''), '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' => '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' => 'N', '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' => 'N', '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' => 'Y', 'TRANSLITERATION' => 'Y', 'TRANS_LEN' => 100, 'TRANS_CASE' => 'L', 'TRANS_SPACE' => '_', 'TRANS_OTHER' => '_', 'TRANS_EAT' => 'Y', 'USE_GOOGLE' => 'Y'))), "CODE" => "furniture_offers", "XML_ID" => $iblockCode);
    $iblock->Update($IBLOCK_OFFERS_ID, $arFields);
    $iblockCodeFur = "furniture_" . WIZARD_SITE_ID;
    $iblockTypeFur = "catalog";
    $rsIBlockFur = CIBlock::GetList(array(), array("XML_ID" => $iblockCodeFur, "TYPE" => $iblockTypeFur));
    if ($arIBlockFur = $rsIBlockFur->Fetch()) {
        $ID_SKU = CCatalog::LinkSKUIBlock($arIBlockFur["ID"], $IBLOCK_OFFERS_ID);
    }
    $arCatalog = CCatalog::GetByID($IBLOCK_OFFERS_ID);
    if ($arCatalog) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:catalog_offers.php

示例12: importXMLData

 public function importXMLData()
 {
     if (!$this->_bIBlockSelected) {
         return false;
     }
     $bTypeSuccess = $this->createIBlockType();
     if (!$bTypeSuccess) {
         return false;
     }
     if (!$this->deleteOldIBlockData()) {
         return false;
     }
     // Это если мы реинсталлируем данные инфоблоков
     if ($this->_iblockID == 0) {
         $arFields = Tools::arrayMergeRecursiveDistinct(self::$_arDefaultIBlockFields, $this->_arConfig['IBLOCK'][$this->_iblockCode]);
         $arPermissions = $arFields['PERMISSIONS'];
         $dbGroup = \CGroup::GetList($by = "", $order = "", array("STRING_ID" => "content_editor"));
         if ($arGroup = $dbGroup->Fetch()) {
             $arPermissions[$arGroup["ID"]] = 'W';
         }
         unset($arFields['IBLOCK_TYPE_ID']);
         unset($arFields['XML_FILE']);
         unset($arFields['FORM_SETTINGS']);
         unset($arFields['PERMISSIONS']);
         $arFields['CODE'] = $this->_iblockCode;
         $arFields['LID'] = WIZARD_SITE_ID;
         $this->_iblockID = \WizardServices::ImportIBlockFromXML($this->_iblockXMLFile, $this->_iblockCode, $this->_iblockType, WIZARD_SITE_ID, $arPermissions);
         if ($this->_iblockID < 1) {
             die('Error importing xml-data:' . "<br /> \n" . 'xml file: "' . htmlspecialchars($this->_iblockXMLFile) . '"' . ",<br /> \n" . 'iblock code: "' . htmlspecialchars($this->_iblockCode) . '"' . ",<br /> \n" . 'iblock type: "' . htmlspecialchars($this->_iblockType) . '"');
         }
         $iblock = new \CIBlock();
         $iblock->Update($this->_iblockID, $arFields);
     } else {
         $arSites = self::getIBlockSites($this->_iblockID);
         if (!in_array(WIZARD_SITE_ID, $arSites)) {
             $arSites[] = WIZARD_SITE_ID;
             $iblock = new \CIBlock();
             $iblock->Update($this->_iblockID, array("LID" => $arSites));
         }
     }
 }
开发者ID:OpenBX,项目名称:obx.core,代码行数:41,代码来源:importiblock.php

示例13: array

$iblockXMLFile = WIZARD_SERVICE_RELATIVE_PATH . "/xml/" . LANGUAGE_ID . "/shared_files.xml";
$iblockCode = "shared_files_" . WIZARD_SITE_ID;
$iblockType = "library";
$rsIBlock = CIBlock::GetList(array(), array("XML_ID" => $iblockCode, "TYPE" => $iblockType));
$iblockID = false;
if ($arIBlock = $rsIBlock->Fetch()) {
    $iblockID = $arIBlock["ID"];
}
if ($iblockID == false && WIZARD_SITE_ID == "s1") {
    $rsIBlock = CIBlock::GetList(array(), array("CODE" => "shared_files", "TYPE" => $iblockType));
    if ($arIBlock = $rsIBlock->Fetch()) {
        $iblockID = $arIBlock["ID"];
    }
}
if ($iblockID == false) {
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "shared_files_temp", $iblockType, WIZARD_SITE_ID, $permissions = array("1" => "X", "2" => "R", WIZARD_PORTAL_ADMINISTRATION_GROUP => "X", WIZARD_DIRECTION_GROUP => "W", WIZARD_EMPLOYEES_GROUP => "W"));
    if ($iblockID < 1) {
        return;
    }
    $arProperties = array("FILE");
    foreach ($arProperties as $propertyName) {
        ${$propertyName . "_PROPERTY_ID"} = 0;
        $properties = CIBlockProperty::GetList(array(), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblockID, "CODE" => $propertyName));
        if ($arProperty = $properties->Fetch()) {
            ${$propertyName . "_PROPERTY_ID"} = $arProperty["ID"];
        }
    }
    WizardServices::SetIBlockFormSettings($iblockID, array('tabs' => GetMessage("W_IB_SHARED_FILES_TAB1") . $FILE_PROPERTY_ID . GetMessage("W_IB_SHARED_FILES_TAB2")));
    //IBlock fields
    $iblock = new CIBlock();
    $arFields = array("ACTIVE" => "Y", "BIZPROC" => "N", "WORKFLOW" => "N", "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')), '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')), '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' => ''), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '')), "CODE" => $iblockCode, "XML_ID" => $iblockCode, "RIGHTS_MODE" => "E", "GROUP_ID" => CIBlock::GetGroupPermissions($iblockID));
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:shared_files.php

示例14: array

    $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';
    }
    $dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "content_editor"));
    if ($arGroup = $dbGroup->Fetch()) {
        $permissions[$arGroup["ID"]] = 'W';
    }
    $IBLOCK_CATALOG_ID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "clothes", $iblockType, WIZARD_SITE_ID, $permissions);
    $IBLOCK_CATALOG_ID1 = WizardServices::ImportIBlockFromXML($iblockXMLFilePrices, "clothes", $iblockType . "_prices", WIZARD_SITE_ID, $permissions);
    if ($IBLOCK_CATALOG_ID < 1) {
        return;
    }
    $_SESSION["WIZARD_CATALOG_IBLOCK_ID"] = $IBLOCK_CATALOG_ID;
} else {
    $arSites = array();
    $db_res = CIBlock::GetSite($IBLOCK_CATALOG_ID);
    while ($res = $db_res->Fetch()) {
        $arSites[] = $res["LID"];
    }
    if (!in_array(WIZARD_SITE_ID, $arSites)) {
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($IBLOCK_CATALOG_ID, array("LID" => $arSites));
    }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:catalog.php

示例15: array

    return;
}
$iblockXMLFile = WIZARD_SERVICE_RELATIVE_PATH . "/xml/" . LANGUAGE_ID . "/user_photogallery.xml";
$iblockCode = "photogallery_personal_" . WIZARD_SITE_ID;
$iblockType = "photos";
$iblockID = false;
$rsIBlock = CIBlock::GetList(array(), array("CODE" => $iblockCode, "TYPE" => $iblockType));
if ($rsIBlock && ($arIBlock = $rsIBlock->Fetch())) {
    $iblockID = $arIBlock["ID"];
    if (WIZARD_INSTALL_DEMO_DATA) {
        CIBlock::Delete($arIBlock["ID"]);
        $iblockID = false;
    }
}
if ($iblockID == false) {
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "photogallery_personal", $iblockType, WIZARD_SITE_ID, $permissions = array("1" => "X", "2" => "R"));
    if ($iblockID < 1) {
        return;
    }
    if ($iblockID > 0) {
        $arGalleries = unserialize(COption::GetOptionString("photogallery", "UF_GALLERY_SIZE"));
        $arGalleries = is_array($arGalleries) ? $arGalleries : array();
        if (!$arGalleries[$iblockID]) {
            $arGalleries[$iblockID] = array("status" => "done", "step" => 1, "elements_cnt" => 13, "element_number" => 13, "element_id" => "", "id" => "123456", "date" => "");
            COption::SetOptionString("photogallery", "UF_GALLERY_SIZE", serialize($arGalleries));
        }
    }
    $ibSection = new CIBlockSection();
    $dbSection = CIBlockSection::GetList(array(), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblockID));
    while ($arSection = $dbSection->Fetch()) {
        $arFields = array("ACTIVE" => "Y", "CREATED_BY" => 1, "SOCNET_GROUP_ID" => false);
开发者ID:k-kalashnikov,项目名称:geekcon,代码行数:31,代码来源:user_photogallery.php


注:本文中的WizardServices::ImportIBlockFromXML方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。