Exemplo n.º 1
0
        $file = Registry::get('runtime.company_id') . '/' . $file;
    }
    if (!empty($_REQUEST['to_screen'])) {
        header("Content-type: text/xml");
        readfile(Registry::get('config.dir.layouts') . $file);
        exit;
    } else {
        fn_get_file(Registry::get('config.dir.layouts') . $file);
    }
} elseif ($mode == 'show_objects') {
    if (!empty($_REQUEST['object_type']) && !empty($_REQUEST['block_id'])) {
        Registry::get('view')->assign('object_type', $_REQUEST['object_type']);
        Registry::get('view')->assign('block_id', $_REQUEST['block_id']);
        Registry::get('view')->assign('object_ids', Block::instance()->getChangedContentsIds($_REQUEST['object_type'], $_REQUEST['block_id']));
        Registry::get('view')->assign('params', array('type' => 'links'));
        Registry::get('view')->assign('dynamic_object_scheme', SchemesManager::getDynamicObjectByType($_REQUEST['object_type'], $_REQUEST));
    }
}
function fn_get_selected_location($params)
{
    if (isset($params['selected_location']) && !empty($params['selected_location'])) {
        $selected_location = Location::instance()->getById($params['selected_location'], DESCR_SL);
    } else {
        $selected_location = Location::instance()->getDefault(DESCR_SL);
    }
    return $selected_location;
}
function fn_get_default_layouts_sources($theme_name = '', $themes_path = '')
{
    $layouts_sources = array();
    if (empty($themes_path)) {
Exemplo n.º 2
0
        $file = Registry::get('runtime.company_id') . '/' . $file;
    }
    if (!empty($_REQUEST['to_screen'])) {
        header("Content-type: text/xml");
        readfile(Registry::get('config.dir.layouts') . $file);
        exit;
    } else {
        fn_get_file(Registry::get('config.dir.layouts') . $file);
    }
} elseif ($mode == 'show_objects') {
    if (!empty($_REQUEST['object_type']) && !empty($_REQUEST['block_id'])) {
        Tygh::$app['view']->assign('object_type', $_REQUEST['object_type']);
        Tygh::$app['view']->assign('block_id', $_REQUEST['block_id']);
        Tygh::$app['view']->assign('object_ids', Block::instance()->getChangedContentsIds($_REQUEST['object_type'], $_REQUEST['block_id']));
        Tygh::$app['view']->assign('params', array('type' => 'links'));
        Tygh::$app['view']->assign('dynamic_object_scheme', SchemesManager::getDynamicObjectByType($_REQUEST['object_type'], $_REQUEST));
    }
}
function fn_get_selected_location($params)
{
    if (isset($params['selected_location']) && !empty($params['selected_location'])) {
        $selected_location = Location::instance()->getById($params['selected_location'], DESCR_SL);
    } else {
        $selected_location = Location::instance()->getDefault(DESCR_SL);
    }
    return $selected_location;
}
function fn_get_default_layouts_sources($theme_name = '', $themes_path = '')
{
    $layouts_sources = array();
    if (empty($themes_path)) {
Exemplo n.º 3
0
    if ($mode == 'manage_in_tab') {
        Registry::get('view')->display('views/tabs/manage_in_tab.tpl');
        exit;
    }
} elseif ($mode == 'delete') {
    if (!empty($_REQUEST['tab_id'])) {
        ProductTabs::instance()->delete($_REQUEST['tab_id']);
    }
    return array(CONTROLLER_STATUS_OK, "tabs.manage");
} elseif ($mode == 'update') {
    $tab_id = isset($_REQUEST['tab_data']['tab_id']) ? $_REQUEST['tab_data']['tab_id'] : 0;
    $tab_type = isset($_REQUEST['tab_data']['tab_type']) ? $_REQUEST['tab_data']['tab_type'] : 'T';
    if (!empty($_REQUEST['dynamic_object'])) {
        Registry::get('view')->assign('dynamic_object', $_REQUEST['dynamic_object']);
    }
    $dynamic_object_scheme = SchemesManager::getDynamicObjectByType('products');
    $selected_location = Location::instance()->get('products.view', array(), DESCR_SL);
    Registry::get('view')->assign('location', $selected_location);
    Registry::get('view')->assign('dynamic_object_scheme', $dynamic_object_scheme);
    if (!empty($_REQUEST['tab_data'])) {
        $tab_data = $_REQUEST['tab_data'];
    } else {
        $tab_data = array();
    }
    // If edit block
    if ($tab_id > 0 && empty($_REQUEST['tab_data']['content'])) {
        $tab_data = current(ProductTabs::instance()->getList(db_quote(' AND ?:product_tabs.tab_id=?i', $tab_id), 0, DESCR_SL));
    }
    if (isset($tab_data['block_id']) && $tab_data['block_id'] > 0) {
        if (!empty($_REQUEST['dynamic_object'])) {
            $dynamic_object = $_REQUEST['dynamic_object'];