Example #1
0
/**
 * Gets list of menu items for block menu
 *
 * @param mixed $value Default value of current block content item
 * @param array $block Block params
 * @param array $block_scheme Scheme of block
 * @return array List of menu items
 */
function fn_get_menu_items($value, $block, $block_scheme)
{
    $menu_items = array();
    if (!empty($block['content']['menu']) && Menu::getStatus($block['content']['menu']) == 'A') {
        $params = array('section' => 'A', 'get_params' => true, 'icon_name' => '', 'multi_level' => true, 'use_localization' => true, 'status' => 'A', 'generate_levels' => true, 'request' => array('menu_id' => $block['content']['menu']));
        $menu_items = fn_top_menu_form(fn_get_static_data($params));
        fn_dropdown_appearance_cut_second_third_levels($menu_items, 'subitems', $block['properties']);
    }
    return $menu_items;
}
Example #2
0
function fn_get_static_data_section($section = 'C', $get_params = false, $icon_name = '', $lang_code = CART_LANGUAGE)
{
    $params = array('section' => $section, 'get_params' => $get_params, 'icon_name' => $icon_name, 'multi_level' => true, 'use_localization' => true, 'status' => 'A');
    return fn_get_static_data($params, $lang_code);
}
Example #3
0
    if (!empty($section_data['owner_object']['check_owner_function']) && function_exists($section_data['owner_object']['check_owner_function'])) {
        if ($section_data['owner_object']['check_owner_function']($_REQUEST[$section_data['owner_object']['key']]) == false) {
            return array(CONTROLLER_STATUS_NO_PAGE);
        }
    }
    Registry::get('view')->assign('static_data', $static_data);
    Registry::get('view')->assign('section', $section);
} elseif ($mode == 'manage') {
    $schema = fn_get_schema('static_data', 'schema');
    $section_data = $schema[$section];
    Registry::get('view')->assign('section_data', $section_data);
    $params = array('section' => $_REQUEST['section'], 'multi_level' => !empty($section_data['multi_level']), 'generate_levels' => !empty($section_data['multi_level']), 'icon_name' => !empty($section_data['icon']) ? $section_data['icon']['type'] : '', 'get_params' => true);
    $static_data = fn_get_static_data($params);
    if (!empty($section_data['multi_level'])) {
        $params = array('section' => $_REQUEST['section'], 'generate_levels' => true, 'get_params' => true, 'multi_level' => true, 'plain' => true);
        Registry::get('view')->assign('parent_items', fn_get_static_data($params));
    }
    if (!empty($section_data['owner_object']['name_function']) && function_exists($section_data['owner_object']['name_function'])) {
        Registry::get('view')->assign('owner_object_name', $section_data['owner_object']['name_function']($_REQUEST[$section_data['owner_object']['key']]));
    }
    if (!empty($section_data['owner_object']['check_owner_function']) && function_exists($section_data['owner_object']['check_owner_function'])) {
        if ($section_data['owner_object']['check_owner_function']($_REQUEST[$section_data['owner_object']['key']]) == false) {
            return array(CONTROLLER_STATUS_NO_PAGE);
        }
    }
    Registry::get('view')->assign('static_data', $static_data);
    Registry::get('view')->assign('section', $section);
}
function fn_update_static_data($data, $param_id, $section, $lang_code = DESCR_SL)
{
    $current_id_path = '';
Example #4
0
    }
    if (!empty($section_data['multi_level'])) {
        $params = array('section' => $_REQUEST['section'], 'generate_levels' => true, 'get_params' => true, 'multi_level' => true, 'plain' => true);
        $view->assign('parent_items', fn_get_static_data($params));
    }
    $view->assign('static_data', $static_data);
    $view->assign('section', $section);
} elseif ($mode == 'manage') {
    $schema = fn_get_schema('static_data', 'schema');
    $section_data = $schema[$section];
    $view->assign('section_data', $section_data);
    $params = array('section' => $_REQUEST['section'], 'multi_level' => !empty($section_data['multi_level']), 'generate_levels' => !empty($section_data['multi_level']), 'icon_name' => !empty($section_data['icon']) ? $section_data['icon']['type'] : '', 'get_params' => true);
    $static_data = fn_get_static_data($params);
    if (!empty($section_data['multi_level'])) {
        $params = array('section' => $_REQUEST['section'], 'generate_levels' => true, 'get_params' => true, 'multi_level' => true, 'plain' => true);
        $view->assign('parent_items', fn_get_static_data($params));
    }
    $view->assign('static_data', $static_data);
    $view->assign('section', $section);
}
function fn_update_static_data($data, $param_id, $section, $lang_code = DESCR_SL)
{
    $current_id_path = '';
    $schema = fn_get_schema('static_data', 'schema');
    $section_data = $schema[$section];
    if (!empty($section_data['has_localization'])) {
        $data['localization'] = empty($data['localization']) ? '' : fn_implode_localizations($data['localization']);
    }
    if (!empty($data['megabox'])) {
        // parse megabox value
        foreach ($data['megabox']['type'] as $p => $v) {
Example #5
0
    if (!empty($section_data['owner_object']['check_owner_function']) && function_exists($section_data['owner_object']['check_owner_function'])) {
        if ($section_data['owner_object']['check_owner_function']($_REQUEST[$section_data['owner_object']['key']]) == false) {
            return array(CONTROLLER_STATUS_NO_PAGE);
        }
    }
    Tygh::$app['view']->assign('static_data', $static_data);
    Tygh::$app['view']->assign('section', $section);
} elseif ($mode == 'manage') {
    $schema = fn_get_schema('static_data', 'schema');
    $section_data = $schema[$section];
    Tygh::$app['view']->assign('section_data', $section_data);
    $params = array('section' => $_REQUEST['section'], 'multi_level' => !empty($section_data['multi_level']), 'generate_levels' => !empty($section_data['multi_level']), 'icon_name' => !empty($section_data['icon']) ? $section_data['icon']['type'] : '', 'get_params' => true);
    $static_data = fn_get_static_data($params);
    if (!empty($section_data['multi_level'])) {
        $params = array('section' => $_REQUEST['section'], 'generate_levels' => true, 'get_params' => true, 'multi_level' => true, 'plain' => true);
        Tygh::$app['view']->assign('parent_items', fn_get_static_data($params));
    }
    if (!empty($section_data['owner_object']['name_function']) && function_exists($section_data['owner_object']['name_function'])) {
        Tygh::$app['view']->assign('owner_object_name', $section_data['owner_object']['name_function']($_REQUEST[$section_data['owner_object']['key']]));
    }
    if (!empty($section_data['owner_object']['check_owner_function']) && function_exists($section_data['owner_object']['check_owner_function'])) {
        if ($section_data['owner_object']['check_owner_function']($_REQUEST[$section_data['owner_object']['key']]) == false) {
            return array(CONTROLLER_STATUS_NO_PAGE);
        }
    }
    Tygh::$app['view']->assign('static_data', $static_data);
    Tygh::$app['view']->assign('section', $section);
}
function fn_update_static_data($data, $param_id, $section, $lang_code = DESCR_SL)
{
    $current_id_path = '';