Esempio n. 1
0
 function OnParseSocNetComponentPath(&$arUrlTemplates, &$arCustomPagesPath, $arParams)
 {
     if ($arParams["SEF_MODE"] == "N") {
         $arMyUrlTemplates = array("group_lists" => "page=group_lists&group_id=#group_id#", "group_list_view" => "page=group_list_view&group_id=#group_id#&list_id=#list_id#&section_id=#section_id#", "group_list_sections" => "page=group_list_sections&group_id=#group_id#&list_id=#list_id#&section_id=#section_id#", "group_list_edit" => "page=group_list_edit&group_id=#group_id#&list_id=#list_id#", "group_list_fields" => "page=group_list_fields&group_id=#group_id#&list_id=#list_id#", "group_list_field_edit" => "page=group_list_field_edit&group_id=#group_id#&list_id=#list_id#&field_id=#field_id#", "group_list_element_edit" => "page=group_list_element_edit&group_id=#group_id#&list_id=#list_id#&section_id=#section_id#&element_id=#element_id#", "group_list_file" => "page=group_list_file&group_id=#group_id#&list_id=#list_id#&section_id=#section_id#&element_id=#element_id#&field_id=#field_id#&file_id=#file_id#", "group_bizproc_log" => "page=group_bizproc_log&group_id=#group_id#&list_id=#list_id#&document_state_id=#document_state_id#", "group_bizproc_workflow_start" => "page=group_bizproc_workflow_start&group_id=#group_id#&list_id=#list_id#&element_id=#element_id#", "group_bizproc_task" => "page=group_bizproc_task&group_id=#group_id#&list_id=#list_id#&section_id=#section_id#&element_id=#element_id#&task_id=#task_id#", "group_bizproc_workflow_admin" => "page=group_bizproc_workflow_admin&group_id=#group_id#&list_id=#list_id#", "group_bizproc_workflow_edit" => "page=group_bizproc_workflow_admin&group_id=#group_id#&list_id=#list_id#&ID=#ID#", "group_list_export_excel" => "page=group_list_export_excel&group_id=#group_id#&list_id=#list_id#");
     } else {
         $arMyUrlTemplates = array("group_lists" => "group/#group_id#/lists/", "group_list_view" => "group/#group_id#/lists/#list_id#/view/#section_id#/", "group_list_sections" => "group/#group_id#/lists/#list_id#/edit/#section_id#/", "group_list_edit" => "group/#group_id#/lists/#list_id#/edit/", "group_list_fields" => "group/#group_id#/lists/#list_id#/fields/", "group_list_field_edit" => "group/#group_id#/lists/#list_id#/field/#field_id#/", "group_list_element_edit" => "group/#group_id#/lists/#list_id#/element/#section_id#/#element_id#/", "group_list_file" => "group/#group_id#/lists/#list_id#/file/#section_id#/#element_id#/#field_id#/#file_id#/", "group_bizproc_log" => "group/#group_id#/lists/#list_id#/bp_log/#document_state_id#/", "group_bizproc_workflow_start" => "group/#group_id#/lists/#list_id#/bp_start/#element_id#/", "group_bizproc_task" => "group/#group_id#/lists/#list_id#/bp_task/#section_id#/#element_id#/#task_id#/", "group_bizproc_workflow_admin" => "group/#group_id#/lists/#list_id#/bp_admin/", "group_bizproc_workflow_edit" => "group/#group_id#/lists/#list_id#/bp_edit/#ID#/", "group_list_export_excel" => "group/#group_id#/lists/#list_id#/excel/");
     }
     static $base_path = false;
     if (!$base_path) {
         if (file_exists($_SERVER["DOCUMENT_ROOT"] . "/bitrix/php_interface/lists/" . SITE_ID . "/group_lists.php")) {
             $base_path = "/bitrix/php_interface/lists/" . SITE_ID . "/";
         } elseif (file_exists($_SERVER["DOCUMENT_ROOT"] . "/bitrix/php_interface/lists/group_lists.php")) {
             $base_path = "/bitrix/php_interface/lists/";
         } else {
             $base_path = "/bitrix/modules/lists/socnet/";
         }
     }
     foreach ($arMyUrlTemplates as $page => $url) {
         $arUrlTemplates[$page] = $url;
         $arCustomPagesPath[$page] = $base_path;
     }
     Bitrix\Main\UrlPreview\Router::setRouteHandler($arParams['SEF_FOLDER'] . $arUrlTemplates['group_list_element_edit'], 'lists', '\\Bitrix\\Lists\\Preview\\Element', array('listId' => '$list_id', 'sectionId' => '$section_id', 'elementId' => '$element_id', 'IBLOCK_TYPE_ID' => COption::GetOptionString("lists", "socnet_iblock_type_id")));
 }
Esempio n. 2
0
    $path = str_replace(array("\\", "//"), "/", dirname(__FILE__) . "/include/forum.php");
    if (!file_exists($path)) {
        $arParams["ERROR_MESSAGE"] = "Forum file is not exist.";
        $res = 0;
    } else {
        $res = (include_once $path);
    }
    $arParams["FATAL_ERROR"] = $res <= 0 ? "Y" : "N";
} elseif (strPos($componentPage, "user_content_search") !== false || strPos($componentPage, "group_content_search") !== false) {
    $path = str_replace(array("\\", "//"), "/", dirname(__FILE__) . "/include/search.php");
    if (!file_exists($path)) {
        $arParams["ERROR_MESSAGE"] = "Content search file is not exist.";
        $res = 0;
    } else {
        $res = (include_once $path);
    }
    $arParams["FATAL_ERROR"] = $res <= 0 ? "Y" : "N";
}
/********************************************************************
				/Content search
********************************************************************/
//registering routes for building preview
if (\Bitrix\Main\ModuleManager::isModuleInstalled('tasks')) {
    Bitrix\Main\UrlPreview\Router::setRouteHandler($arParams['SEF_FOLDER'] . $arUrlTemplates['group_tasks_task'], 'tasks', '\\Bitrix\\Tasks\\Ui\\Preview\\Task', array('taskId' => '$task_id', 'groupId' => '$group_id', 'action' => '$action', 'PATH_TO_USER_PROFILE' => $arParams['SEF_FOLDER'] . $arUrlTemplates['user']));
}
CUtil::InitJSCore(array("window", "ajax"));
$this->IncludeComponentTemplate($componentPage, array_key_exists($componentPage, $arCustomPagesPath) ? $arCustomPagesPath[$componentPage] : "");
//top panel button to reindex
if ($GLOBALS['USER']->IsAdmin()) {
    $GLOBALS['APPLICATION']->AddPanelButton(array("HREF" => $arResult["PATH_TO_GROUP_REINDEX"], "ICON" => "bx-panel-reindex-icon", "ALT" => GetMessage('SONET_PANEL_REINDEX_TITLE'), "TEXT" => GetMessage('SONET_PANEL_REINDEX'), "MAIN_SORT" => "1000", "SORT" => 100));
}
Esempio n. 3
0
        $arVariables = array('list_id' => $_GET['list_id'], 'element_id' => $_GET['element_id'], 'section_id' => 0);
    } elseif ($_GET['bp_constants'] == 'y') {
        $componentPage = "bizproc_workflow_constants";
        $arVariables = array('list_id' => $_GET['list_id'], 'ID' => $_GET['id']);
    } elseif ($processes && $_GET["bp_catalog"] == "y") {
        $componentPage = "catalog_processes";
    } else {
        $componentPage = CComponentEngine::ParseComponentPath($arParams["SEF_FOLDER"], $arUrlTemplates, $arVariables);
    }
    if (!$componentPage) {
        $componentPage = "lists";
    }
    CComponentEngine::InitComponentVariables($componentPage, $arComponentVariables, $arVariableAliases, $arVariables);
    $arResult = array("FOLDER" => $arParams["SEF_FOLDER"], "URL_TEMPLATES" => $arUrlTemplates, "VARIABLES" => $arVariables, "ALIASES" => $arVariableAliases);
    // Registering routes for building preview by url
    Bitrix\Main\UrlPreview\Router::setRouteHandler($arParams["SEF_FOLDER"] . $arUrlTemplates['list_element_edit'], 'lists', '\\Bitrix\\Lists\\Preview\\Element', array('listId' => '$list_id', 'sectionId' => '$section_id', 'elementId' => '$element_id', 'IBLOCK_TYPE_ID' => $arParams['IBLOCK_TYPE_ID']));
} else {
    $arVariables = array();
    if (!isset($arParams["VARIABLE_ALIASES"]["ID"])) {
        $arParams["VARIABLE_ALIASES"]["ID"] = "ID";
    }
    $arVariableAliases = CComponentEngine::MakeComponentVariableAliases($arDefaultVariableAliases, $arParams["VARIABLE_ALIASES"]);
    if (!isset($arVariableAliases["file_id"])) {
        $arVariableAliases["file_id"] = "file_id";
    }
    if ($_GET['livefeed'] == 'y') {
        $componentPage = 'list_element_edit';
        $arVariables = array('list_id' => $_GET['list_id'], 'element_id' => $_GET['element_id'], 'section_id' => 0);
    } elseif ($_GET['bp_constants'] == 'y') {
        $componentPage = "bizproc_workflow_constants";
        $arVariables = array('list_id' => $_GET['list_id'], 'ID' => $_GET['id']);