示例#1
0
function fn_get_products_layout($params)
{
    /**
     * Change params for getting products layout
     *
     * @param array $params Params for getting products layout
     */
    fn_set_hook('get_products_layout_pre', $params);
    if (!isset($_SESSION['products_layout'])) {
        $_SESSION['products_layout'] = Registry::get('settings.Appearance.save_selected_view') == 'Y' ? array() : '';
    }
    $active_layouts = fn_get_products_views(false, true);
    $default_layout = Registry::get('settings.Appearance.default_products_view');
    if (!empty($params['category_id'])) {
        $_layout = db_get_row("SELECT default_layout, selected_layouts FROM ?:categories WHERE category_id = ?i", $params['category_id']);
        $category_default_layout = $_layout['default_layout'];
        $category_layouts = unserialize($_layout['selected_layouts']);
        if (!empty($category_layouts)) {
            if (!empty($category_default_layout)) {
                $default_layout = $category_default_layout;
            }
            $active_layouts = $category_layouts;
        }
        $ext_id = $params['category_id'];
    } else {
        $ext_id = 'search';
    }
    if (!empty($params['layout'])) {
        $layout = $params['layout'];
    } elseif (Registry::get('settings.Appearance.save_selected_view') == 'Y' && !empty($_SESSION['products_layout'][$ext_id])) {
        $layout = $_SESSION['products_layout'][$ext_id];
    } elseif (Registry::get('settings.Appearance.save_selected_view') == 'N' && !empty($_SESSION['products_layout'])) {
        $layout = $_SESSION['products_layout'];
    }
    $selected_layout = !empty($layout) && !empty($active_layouts[$layout]) ? $layout : $default_layout;
    /**
     * Change selected layout
     *
     * @param array $selected_layout Selected layout
     * @param array $params          Params for getting products layout
     */
    fn_set_hook('get_products_layout_post', $selected_layout, $params);
    if (!empty($params['layout']) && $params['layout'] == $selected_layout) {
        if (Registry::get('settings.Appearance.save_selected_view') == 'Y') {
            if (!is_array($_SESSION['products_layout'])) {
                $_SESSION['products_layout'] = array();
            }
            $_SESSION['products_layout'][$ext_id] = $selected_layout;
        } else {
            $_SESSION['products_layout'] = $selected_layout;
        }
    }
    return $selected_layout;
}
    function content_55d3121d99fdc5_69663562($_smarty_tpl)
    {
        if (!is_callable('smarty_block_hook')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php';
        }
        if (!is_callable('smarty_function_set_id')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php';
        }
        fn_preload_lang_vars(array('search_results', 'advanced_search', 'products_found', 'text_no_matching_products_found', 'search_results', 'advanced_search', 'products_found', 'text_no_matching_products_found'));
        if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") {
            $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null);
            ob_start();
            ?>
<div id="products_search_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['block_id'], ENT_QUOTES, 'UTF-8');
            ?>
" class="testsearchtpl">
<?php 
            if ($_smarty_tpl->tpl_vars['search']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["_title"] = new Smarty_variable($_smarty_tpl->__("search_results"), null, 0);
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["_collapse"] = new Smarty_variable(true, null, 0);
            } else {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["_title"] = new Smarty_variable($_smarty_tpl->__("advanced_search"), null, 0);
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["_collapse"] = new Smarty_variable(false, null, 0);
            }
            ?>

<?php 
            echo $_smarty_tpl->getSubTemplate("views/products/components/products_search_form.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('dispatch' => "products.search", 'collapse' => $_smarty_tpl->tpl_vars['_collapse']->value), 0);
            ?>


<?php 
            if ($_smarty_tpl->tpl_vars['search']->value) {
                ?>
    <?php 
                if ($_smarty_tpl->tpl_vars['products']->value) {
                    ?>
        <?php 
                    ob_start();
                    echo $_smarty_tpl->__("products_found");
                    $_tmp1 = ob_get_clean();
                    $_smarty_tpl->tpl_vars["title_extra"] = new Smarty_variable($_tmp1 . ": " . (string) $_smarty_tpl->tpl_vars['search']->value['total_items'], null, 0);
                    ?>
        <?php 
                    $_smarty_tpl->tpl_vars["layouts"] = new Smarty_variable(fn_get_products_views('', false, 0), null, 0);
                    ?>
        <?php 
                    if ($_smarty_tpl->tpl_vars['category_data']->value['product_columns']) {
                        ?>
            <?php 
                        $_smarty_tpl->tpl_vars["product_columns"] = new Smarty_variable($_smarty_tpl->tpl_vars['category_data']->value['product_columns'], null, 0);
                        ?>
        <?php 
                    } else {
                        ?>
            <?php 
                        $_smarty_tpl->tpl_vars["product_columns"] = new Smarty_variable($_smarty_tpl->tpl_vars['settings']->value['Appearance']['columns_in_products_list'], null, 0);
                        ?>
        <?php 
                    }
                    ?>
        
        <?php 
                    if ($_smarty_tpl->tpl_vars['layouts']->value[$_smarty_tpl->tpl_vars['selected_layout']->value]['template']) {
                        ?>
            <?php 
                        echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['layouts']->value[$_smarty_tpl->tpl_vars['selected_layout']->value]['template'], $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('columns' => $_smarty_tpl->tpl_vars['product_columns']->value, 'show_qty' => true), 0);
                        ?>

        <?php 
                    }
                    ?>
    <?php 
                } else {
                    ?>
        <?php 
                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:search_results_no_matching_found"));
                    $_block_repeat = true;
                    echo smarty_block_hook(array('name' => "products:search_results_no_matching_found"), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>

            <p class="ty-no-items"><?php 
                        echo $_smarty_tpl->__("text_no_matching_products_found");
                        ?>
</p>
        <?php 
                        $_block_content = ob_get_clean();
                        $_block_repeat = false;
                        echo smarty_block_hook(array('name' => "products:search_results_no_matching_found"), $_block_content, $_smarty_tpl, $_block_repeat);
                    }
                    array_pop($_smarty_tpl->smarty->_tag_stack);
                    ?>

    <?php 
                }
                ?>

<?php 
            }
            ?>

<!--products_search_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['block_id'], ENT_QUOTES, 'UTF-8');
            ?>
--></div>

<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:search_results_mainbox_title"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "products:search_results_mainbox_title"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

<?php 
                $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null);
                ob_start();
                ?>
<span class="ty-mainbox-title__left"><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['_title']->value, ENT_QUOTES, 'UTF-8');
                ?>
</span><span class="ty-mainbox-title__right"><?php 
                echo $_smarty_tpl->tpl_vars['title_extra']->value;
                ?>
</span><?php 
                list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                if (!empty($_capture_buffer)) {
                    if (isset($_capture_assign)) {
                        $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                    }
                    if (isset($_capture_append)) {
                        $_smarty_tpl->append($_capture_append, ob_get_contents());
                    }
                    Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                } else {
                    $_smarty_tpl->capture_error();
                }
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:search_results_mainbox_title"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if (trim(Smarty::$_smarty_vars['capture']['template_content'])) {
                if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") {
                    ?>
<span class="cm-template-box template-box" data-ca-te-template="views/products/search.tpl" id="<?php 
                    echo smarty_function_set_id(array('name' => "views/products/search.tpl"), $_smarty_tpl);
                    ?>
"><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php 
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                    ?>
<!--[/tpl_id]--></span><?php 
                } else {
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                }
            }
        } else {
            ?>
<div id="products_search_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['block_id'], ENT_QUOTES, 'UTF-8');
            ?>
" class="testsearchtpl">
<?php 
            if ($_smarty_tpl->tpl_vars['search']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["_title"] = new Smarty_variable($_smarty_tpl->__("search_results"), null, 0);
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["_collapse"] = new Smarty_variable(true, null, 0);
            } else {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["_title"] = new Smarty_variable($_smarty_tpl->__("advanced_search"), null, 0);
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["_collapse"] = new Smarty_variable(false, null, 0);
            }
            ?>

<?php 
            echo $_smarty_tpl->getSubTemplate("views/products/components/products_search_form.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('dispatch' => "products.search", 'collapse' => $_smarty_tpl->tpl_vars['_collapse']->value), 0);
            ?>


<?php 
            if ($_smarty_tpl->tpl_vars['search']->value) {
                ?>
    <?php 
                if ($_smarty_tpl->tpl_vars['products']->value) {
                    ?>
        <?php 
                    ob_start();
                    echo $_smarty_tpl->__("products_found");
                    $_tmp2 = ob_get_clean();
                    $_smarty_tpl->tpl_vars["title_extra"] = new Smarty_variable($_tmp2 . ": " . (string) $_smarty_tpl->tpl_vars['search']->value['total_items'], null, 0);
                    ?>
        <?php 
                    $_smarty_tpl->tpl_vars["layouts"] = new Smarty_variable(fn_get_products_views('', false, 0), null, 0);
                    ?>
        <?php 
                    if ($_smarty_tpl->tpl_vars['category_data']->value['product_columns']) {
                        ?>
            <?php 
                        $_smarty_tpl->tpl_vars["product_columns"] = new Smarty_variable($_smarty_tpl->tpl_vars['category_data']->value['product_columns'], null, 0);
                        ?>
        <?php 
                    } else {
                        ?>
            <?php 
                        $_smarty_tpl->tpl_vars["product_columns"] = new Smarty_variable($_smarty_tpl->tpl_vars['settings']->value['Appearance']['columns_in_products_list'], null, 0);
                        ?>
        <?php 
                    }
                    ?>
        
        <?php 
                    if ($_smarty_tpl->tpl_vars['layouts']->value[$_smarty_tpl->tpl_vars['selected_layout']->value]['template']) {
                        ?>
            <?php 
                        echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['layouts']->value[$_smarty_tpl->tpl_vars['selected_layout']->value]['template'], $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('columns' => $_smarty_tpl->tpl_vars['product_columns']->value, 'show_qty' => true), 0);
                        ?>

        <?php 
                    }
                    ?>
    <?php 
                } else {
                    ?>
        <?php 
                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:search_results_no_matching_found"));
                    $_block_repeat = true;
                    echo smarty_block_hook(array('name' => "products:search_results_no_matching_found"), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>

            <p class="ty-no-items"><?php 
                        echo $_smarty_tpl->__("text_no_matching_products_found");
                        ?>
</p>
        <?php 
                        $_block_content = ob_get_clean();
                        $_block_repeat = false;
                        echo smarty_block_hook(array('name' => "products:search_results_no_matching_found"), $_block_content, $_smarty_tpl, $_block_repeat);
                    }
                    array_pop($_smarty_tpl->smarty->_tag_stack);
                    ?>

    <?php 
                }
                ?>

<?php 
            }
            ?>

<!--products_search_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['block_id'], ENT_QUOTES, 'UTF-8');
            ?>
--></div>

<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:search_results_mainbox_title"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "products:search_results_mainbox_title"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

<?php 
                $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null);
                ob_start();
                ?>
<span class="ty-mainbox-title__left"><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['_title']->value, ENT_QUOTES, 'UTF-8');
                ?>
</span><span class="ty-mainbox-title__right"><?php 
                echo $_smarty_tpl->tpl_vars['title_extra']->value;
                ?>
</span><?php 
                list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                if (!empty($_capture_buffer)) {
                    if (isset($_capture_assign)) {
                        $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                    }
                    if (isset($_capture_append)) {
                        $_smarty_tpl->append($_capture_append, ob_get_contents());
                    }
                    Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                } else {
                    $_smarty_tpl->capture_error();
                }
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:search_results_mainbox_title"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
        }
    }
示例#3
0
function fn_settings_variants_appearance_default_products_view_templates()
{
    return fn_get_products_views(true);
}
    function content_55ccf2ea8e5fe6_74616504($_smarty_tpl)
    {
        if (!is_callable('smarty_block_hook')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php';
        }
        if (!is_callable('smarty_function_set_id')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php';
        }
        fn_preload_lang_vars(array('text_no_products', 'text_no_products'));
        if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") {
            $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null);
            ob_start();
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "categories:view"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "categories:view"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

<div id="category_products_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['block_id'], ENT_QUOTES, 'UTF-8');
                ?>
" class="testviewtpl2">


<?php 
                if ($_REQUEST['advanced_filter']) {
                    ?>

    <?php 
                    echo $_smarty_tpl->getSubTemplate("views/products/components/product_filters_advanced_form.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('separate_form' => true), 0);
                    ?>

<?php 
                }
                ?>


<?php 
                if ($_smarty_tpl->tpl_vars['products']->value) {
                    ?>

<?php 
                    $_smarty_tpl->tpl_vars["layouts"] = new Smarty_variable(fn_get_products_views('', false, 0), null, 0);
                    ?>

<?php 
                    if ($_smarty_tpl->tpl_vars['category_data']->value['product_columns']) {
                        ?>

    <?php 
                        $_smarty_tpl->tpl_vars["product_columns"] = new Smarty_variable($_smarty_tpl->tpl_vars['category_data']->value['product_columns'], null, 0);
                        ?>

<?php 
                    } else {
                        ?>

    <?php 
                        $_smarty_tpl->tpl_vars["product_columns"] = new Smarty_variable($_smarty_tpl->tpl_vars['settings']->value['Appearance']['columns_in_products_list'], null, 0);
                        ?>

<?php 
                    }
                    ?>


<?php 
                    if ($_smarty_tpl->tpl_vars['layouts']->value[$_smarty_tpl->tpl_vars['selected_layout']->value]['template']) {
                        ?>

    <?php 
                        echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['layouts']->value[$_smarty_tpl->tpl_vars['selected_layout']->value]['template'], $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('columns' => $_smarty_tpl->tpl_vars['product_columns']->value), 0);
                        ?>

<?php 
                    }
                    ?>


<?php 
                } elseif (!$_smarty_tpl->tpl_vars['subcategories']->value || $_smarty_tpl->tpl_vars['show_no_products_block']->value) {
                    ?>

<p class="ty-no-items cm-pagination-container"><?php 
                    echo $_smarty_tpl->__("text_no_products");
                    ?>
</p>
<?php 
                } else {
                    ?>

<div class="cm-pagination-container"></div>
<?php 
                }
                ?>

<!--category_products_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['block_id'], ENT_QUOTES, 'UTF-8');
                ?>
--></div>

<?php 
                $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null);
                ob_start();
                echo htmlspecialchars($_smarty_tpl->tpl_vars['category_data']->value['category'], ENT_QUOTES, 'UTF-8');
                list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                if (!empty($_capture_buffer)) {
                    if (isset($_capture_assign)) {
                        $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                    }
                    if (isset($_capture_append)) {
                        $_smarty_tpl->append($_capture_append, ob_get_contents());
                    }
                    Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                } else {
                    $_smarty_tpl->capture_error();
                }
                ?>

<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "categories:view"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if (trim(Smarty::$_smarty_vars['capture']['template_content'])) {
                if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") {
                    ?>
<span class="cm-template-box template-box" data-ca-te-template="views/categories/view.tpl" id="<?php 
                    echo smarty_function_set_id(array('name' => "views/categories/view.tpl"), $_smarty_tpl);
                    ?>
"><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php 
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                    ?>
<!--[/tpl_id]--></span><?php 
                } else {
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                }
            }
        } else {
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "categories:view"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "categories:view"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

<div id="category_products_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['block_id'], ENT_QUOTES, 'UTF-8');
                ?>
" class="testviewtpl2">


<?php 
                if ($_REQUEST['advanced_filter']) {
                    ?>

    <?php 
                    echo $_smarty_tpl->getSubTemplate("views/products/components/product_filters_advanced_form.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('separate_form' => true), 0);
                    ?>

<?php 
                }
                ?>


<?php 
                if ($_smarty_tpl->tpl_vars['products']->value) {
                    ?>

<?php 
                    $_smarty_tpl->tpl_vars["layouts"] = new Smarty_variable(fn_get_products_views('', false, 0), null, 0);
                    ?>

<?php 
                    if ($_smarty_tpl->tpl_vars['category_data']->value['product_columns']) {
                        ?>

    <?php 
                        $_smarty_tpl->tpl_vars["product_columns"] = new Smarty_variable($_smarty_tpl->tpl_vars['category_data']->value['product_columns'], null, 0);
                        ?>

<?php 
                    } else {
                        ?>

    <?php 
                        $_smarty_tpl->tpl_vars["product_columns"] = new Smarty_variable($_smarty_tpl->tpl_vars['settings']->value['Appearance']['columns_in_products_list'], null, 0);
                        ?>

<?php 
                    }
                    ?>


<?php 
                    if ($_smarty_tpl->tpl_vars['layouts']->value[$_smarty_tpl->tpl_vars['selected_layout']->value]['template']) {
                        ?>

    <?php 
                        echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['layouts']->value[$_smarty_tpl->tpl_vars['selected_layout']->value]['template'], $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('columns' => $_smarty_tpl->tpl_vars['product_columns']->value), 0);
                        ?>

<?php 
                    }
                    ?>


<?php 
                } elseif (!$_smarty_tpl->tpl_vars['subcategories']->value || $_smarty_tpl->tpl_vars['show_no_products_block']->value) {
                    ?>

<p class="ty-no-items cm-pagination-container"><?php 
                    echo $_smarty_tpl->__("text_no_products");
                    ?>
</p>
<?php 
                } else {
                    ?>

<div class="cm-pagination-container"></div>
<?php 
                }
                ?>

<!--category_products_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['block_id'], ENT_QUOTES, 'UTF-8');
                ?>
--></div>

<?php 
                $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null);
                ob_start();
                echo htmlspecialchars($_smarty_tpl->tpl_vars['category_data']->value['category'], ENT_QUOTES, 'UTF-8');
                list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                if (!empty($_capture_buffer)) {
                    if (isset($_capture_assign)) {
                        $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                    }
                    if (isset($_capture_append)) {
                        $_smarty_tpl->append($_capture_append, ob_get_contents());
                    }
                    Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                } else {
                    $_smarty_tpl->capture_error();
                }
                ?>

<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "categories:view"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
        }
    }
    function content_55ccf2ea3eb161_07733351($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_replace')) {
            include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/modifier.replace.php';
        }
        $_smarty_tpl->tpl_vars["curl"] = new Smarty_variable(fn_query_remove($_smarty_tpl->tpl_vars['config']->value['current_url'], "sort_by", "sort_order", "result_ids", "layout"), null, 0);
        ?>

<?php 
        $_smarty_tpl->tpl_vars["sorting"] = new Smarty_variable(fn_get_products_sorting(''), null, 0);
        ?>

<?php 
        $_smarty_tpl->tpl_vars["sorting_orders"] = new Smarty_variable(fn_get_products_sorting_orders(''), null, 0);
        ?>

<?php 
        $_smarty_tpl->tpl_vars["layouts"] = new Smarty_variable(fn_get_products_views('', false, false), null, 0);
        ?>

<?php 
        $_smarty_tpl->tpl_vars["pagination_id"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['id']->value) === null || $tmp === '' ? "pagination_contents" : $tmp, null, 0);
        ?>

<?php 
        $_smarty_tpl->tpl_vars["avail_sorting"] = new Smarty_variable($_smarty_tpl->tpl_vars['settings']->value['Appearance']['available_product_list_sortings'], null, 0);
        ?>

<?php 
        if (!(count($_smarty_tpl->tpl_vars['category_data']->value['selected_layouts']) == 1 || count($_smarty_tpl->tpl_vars['category_data']->value['selected_layouts']) == 0 && count(fn_get_products_views('', true)) <= 1) && !$_smarty_tpl->tpl_vars['hide_layouts']->value) {
            ?>

<div class="ty-sort-container__views-icons">
<?php 
            $_smarty_tpl->tpl_vars["item"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["item"]->_loop = false;
            $_smarty_tpl->tpl_vars["layout"] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['layouts']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["item"]->key => $_smarty_tpl->tpl_vars["item"]->value) {
                $_smarty_tpl->tpl_vars["item"]->_loop = true;
                $_smarty_tpl->tpl_vars["layout"]->value = $_smarty_tpl->tpl_vars["item"]->key;
                ?>

<?php 
                if ($_smarty_tpl->tpl_vars['category_data']->value['selected_layouts'][$_smarty_tpl->tpl_vars['layout']->value] || !$_smarty_tpl->tpl_vars['category_data']->value['selected_layouts'] && $_smarty_tpl->tpl_vars['item']->value['active']) {
                    ?>

    <?php 
                    if ($_smarty_tpl->tpl_vars['layout']->value == $_smarty_tpl->tpl_vars['selected_layout']->value) {
                        ?>

        <?php 
                        $_smarty_tpl->tpl_vars['sort_order'] = new Smarty_variable($_smarty_tpl->tpl_vars['search']->value['sort_order_rev'], null, 0);
                        ?>

    <?php 
                    } else {
                        ?>

        <?php 
                        $_smarty_tpl->tpl_vars['sort_order'] = new Smarty_variable($_smarty_tpl->tpl_vars['search']->value['sort_order'], null, 0);
                        ?>

    <?php 
                    }
                    ?>

<a class="ty-sort-container__views-a <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['ajax_class']->value, ENT_QUOTES, 'UTF-8');
                    ?>
 <?php 
                    if ($_smarty_tpl->tpl_vars['layout']->value == $_smarty_tpl->tpl_vars['selected_layout']->value) {
                        ?>
active<?php 
                    }
                    ?>
" data-ca-target-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['pagination_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" href="<?php 
                    echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['curl']->value . "&sort_by=" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_by'] . "&sort_order=" . (string) $_smarty_tpl->tpl_vars['sort_order']->value . "&layout=" . (string) $_smarty_tpl->tpl_vars['layout']->value), ENT_QUOTES, 'UTF-8');
                    ?>
" rel="nofollow">
    <i class="ty-icon-<?php 
                    echo htmlspecialchars(smarty_modifier_replace($_smarty_tpl->tpl_vars['layout']->value, "_", "-"), ENT_QUOTES, 'UTF-8');
                    ?>
"></i>
</a>
<?php 
                }
                ?>

<?php 
            }
            ?>

</div>
<?php 
        }
    }
    function content_55ccf2ea448c55_01077073($_smarty_tpl)
    {
        fn_preload_lang_vars(array('per_page'));
        ?>
<div class="ty-sort-container">
<?php 
        if (!$_smarty_tpl->tpl_vars['config']->value['tweaks']['disable_dhtml']) {
            ?>

    <?php 
            $_smarty_tpl->tpl_vars["ajax_class"] = new Smarty_variable("cm-ajax", null, 0);
            ?>

<?php 
        }
        ?>


<?php 
        $_smarty_tpl->tpl_vars["curl"] = new Smarty_variable(fn_query_remove($_smarty_tpl->tpl_vars['config']->value['current_url'], "sort_by", "sort_order", "result_ids", "layout"), null, 0);
        ?>

<?php 
        $_smarty_tpl->tpl_vars["sorting"] = new Smarty_variable(fn_get_products_sorting(''), null, 0);
        ?>

<?php 
        $_smarty_tpl->tpl_vars["sorting_orders"] = new Smarty_variable(fn_get_products_sorting_orders(''), null, 0);
        ?>

<?php 
        $_smarty_tpl->tpl_vars["layouts"] = new Smarty_variable(fn_get_products_views('', false, false), null, 0);
        ?>

<?php 
        $_smarty_tpl->tpl_vars["pagination_id"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['id']->value) === null || $tmp === '' ? "pagination_contents" : $tmp, null, 0);
        ?>

<?php 
        $_smarty_tpl->tpl_vars["avail_sorting"] = new Smarty_variable($_smarty_tpl->tpl_vars['settings']->value['Appearance']['available_product_list_sortings'], null, 0);
        ?>


<?php 
        if ($_smarty_tpl->tpl_vars['search']->value['sort_order_rev'] == "asc") {
            ?>

    <?php 
            $_smarty_tpl->_capture_stack[0][] = array("sorting_text", null, null);
            ob_start();
            ?>

        <a><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['sorting']->value[$_smarty_tpl->tpl_vars['search']->value['sort_by']]['description'], ENT_QUOTES, 'UTF-8');
            ?>
<i class="ty-icon-up-dir"></i></a>
    <?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            ?>

<?php 
        } else {
            ?>

    <?php 
            $_smarty_tpl->_capture_stack[0][] = array("sorting_text", null, null);
            ob_start();
            ?>

        <a><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['sorting']->value[$_smarty_tpl->tpl_vars['search']->value['sort_by']]['description'], ENT_QUOTES, 'UTF-8');
            ?>
<i class="ty-icon-down-dir"></i></a>
    <?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            ?>

<?php 
        }
        ?>




<?php 
        if ($_smarty_tpl->tpl_vars['avail_sorting']->value) {
            ?>

    <?php 
            echo $_smarty_tpl->getSubTemplate("common/sorting.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
            ?>

<?php 
        }
        ?>


<?php 
        $_smarty_tpl->tpl_vars["pagination"] = new Smarty_variable(fn_generate_pagination($_smarty_tpl->tpl_vars['search']->value), null, 0);
        ?>


<?php 
        if ($_smarty_tpl->tpl_vars['pagination']->value['total_items']) {
            ?>

<?php 
            $_smarty_tpl->tpl_vars["range_url"] = new Smarty_variable(fn_query_remove($_smarty_tpl->tpl_vars['curl']->value, "items_per_page", "page"), null, 0);
            ?>

<?php 
            $_smarty_tpl->tpl_vars["product_steps"] = new Smarty_variable(fn_get_product_pagination_steps($_smarty_tpl->tpl_vars['settings']->value['Appearance']['columns_in_products_list'], $_smarty_tpl->tpl_vars['settings']->value['Appearance']['products_per_page']), null, 0);
            ?>

<!--div class="ty-sort-dropdown">
<a id="sw_elm_pagination_steps" class="ty-sort-dropdown__wrapper cm-combination"><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['pagination']->value['items_per_page'], ENT_QUOTES, 'UTF-8');
            ?>
 <?php 
            echo $_smarty_tpl->__("per_page");
            ?>
<i class="ty-sort-dropdown__icon ty-icon-down-micro"></i></a>
    <ul id="elm_pagination_steps" class="ty-sort-dropdown__content cm-popup-box hidden">
        
    </ul>
</div-->
<?php 
        }
        ?>




    
    

</div><?php 
    }
    function content_55ddd1046232f5_25391883($_smarty_tpl)
    {
        if (!is_callable('smarty_block_hook')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php';
        }
        fn_preload_lang_vars(array('information', 'name', 'location', 'root_level', 'location', 'root_level', 'description', 'images', 'text_category_icon', 'text_category_detailed_image', 'seo_meta_data', 'page_title', 'ttc_page_title', 'meta_description', 'meta_keywords', 'availability', 'usergroups', 'ttc_usergroups', 'to_all_subcats', 'position', 'creation_date', 'product_details_view', 'use_custom_view', 'product_columns', 'available_views', 'default_category_view', 'add_subcategory', 'add_product', 'preview', 'view_products', 'delete_this_category', 'categories', 'new_category', 'editing_category'));
        if ($_smarty_tpl->tpl_vars['category_data']->value['category_id']) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["id"] = new Smarty_variable($_smarty_tpl->tpl_vars['category_data']->value['category_id'], null, 0);
        } else {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["id"] = new Smarty_variable(0, null, 0);
        }
        ?>

<?php 
        $_smarty_tpl->_capture_stack[0][] = array("mainbox", null, null);
        ob_start();
        ?>
<form action="<?php 
        echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
        ?>
" method="post" name="category_update_form" class="form-horizontal form-edit <?php 
        if (fn_check_form_permissions('')) {
            ?>
 cm-hide-inputs<?php 
        }
        ?>
" enctype="multipart/form-data">
<input type="hidden" name="fake" value="1" />
<input type="hidden" name="category_id" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" />
<input type="hidden" name="selected_section" value="<?php 
        echo htmlspecialchars($_REQUEST['selected_section'], ENT_QUOTES, 'UTF-8');
        ?>
" />

<?php 
        $_smarty_tpl->_capture_stack[0][] = array("tabsbox", null, null);
        ob_start();
        ?>

<div id="content_detailed">

    <?php 
        echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("information"), 'target' => "#acc_information"), 0);
        ?>

    <div id="acc_information" class="collapsed in">
    <div class="control-group">
        <label for="elm_category_name" class="control-label cm-required"><?php 
        echo $_smarty_tpl->__("name");
        ?>
:</label>
        <div class="controls">
            <input type="text" name="category_data[category]" id="elm_category_name" size="55" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['category_data']->value['category'], ENT_QUOTES, 'UTF-8');
        ?>
" class="input-large" />
        </div>
    </div>
    <div class="control-group">
        <?php 
        if (fn_show_picker("categories", @constant('CATEGORY_THRESHOLD'))) {
            ?>
            <label class="control-label cm-required" for="elm_category_parent_id"><?php 
            echo $_smarty_tpl->__("location");
            ?>
:</label>
            <div class="controls">
                <?php 
            echo $_smarty_tpl->getSubTemplate("pickers/categories/picker.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('data_id' => "location_category", 'input_name' => "category_data[parent_id]", 'item_ids' => ($tmp = @$_smarty_tpl->tpl_vars['category_data']->value['parent_id']) === null || $tmp === '' ? "0" : $tmp, 'hide_link' => true, 'hide_delete_button' => true, 'default_name' => __("root_level"), 'display_input_id' => "elm_category_parent_id", 'except_id' => $_smarty_tpl->tpl_vars['id']->value), 0);
            ?>

            </div>
        <?php 
        } else {
            ?>
            <label class="control-label" for="elm_category_parent_id"><?php 
            echo $_smarty_tpl->__("location");
            ?>
:</label>

            <div class="controls">
            <select name="category_data[parent_id]" id="elm_category_parent_id">
                <option value="0" <?php 
            if ($_smarty_tpl->tpl_vars['category_data']->value['parent_id'] == "0") {
                ?>
selected="selected"<?php 
            }
            ?>
>- <?php 
            echo $_smarty_tpl->__("root_level");
            ?>
 -</option>
                <?php 
            $_smarty_tpl->tpl_vars["cat"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["cat"]->_loop = false;
            $_from = fn_get_plain_categories_tree(0, false);
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            $_smarty_tpl->tpl_vars["cat"]->index = -1;
            foreach ($_from as $_smarty_tpl->tpl_vars["cat"]->key => $_smarty_tpl->tpl_vars["cat"]->value) {
                $_smarty_tpl->tpl_vars["cat"]->_loop = true;
                $_smarty_tpl->tpl_vars["cat"]->index++;
                $_smarty_tpl->tpl_vars["cat"]->first = $_smarty_tpl->tpl_vars["cat"]->index === 0;
                $_smarty_tpl->tpl_vars['smarty']->value['foreach']["categories"]['first'] = $_smarty_tpl->tpl_vars["cat"]->first;
                ?>
                <?php 
                if (!fn_allowed_for("ULTIMATE")) {
                    ?>
                    <?php 
                    if (strpos($_smarty_tpl->tpl_vars['cat']->value['id_path'], (string) $_smarty_tpl->tpl_vars['category_data']->value['id_path'] . "/") === false && $_smarty_tpl->tpl_vars['cat']->value['category_id'] != $_smarty_tpl->tpl_vars['id']->value || !$_smarty_tpl->tpl_vars['id']->value) {
                        ?>
                        <option value="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['cat']->value['category_id'], ENT_QUOTES, 'UTF-8');
                        ?>
" <?php 
                        if ($_smarty_tpl->tpl_vars['cat']->value['disabled']) {
                            ?>
disabled="disabled"<?php 
                        }
                        ?>
 <?php 
                        if ($_smarty_tpl->tpl_vars['category_data']->value['parent_id'] == $_smarty_tpl->tpl_vars['cat']->value['category_id']) {
                            ?>
selected="selected"<?php 
                        }
                        ?>
><?php 
                        echo preg_replace('!^!m', str_repeat("&#166;&nbsp;&nbsp;&nbsp;&nbsp;", $_smarty_tpl->tpl_vars['cat']->value['level']), htmlspecialchars($_smarty_tpl->tpl_vars['cat']->value['category'], ENT_QUOTES, 'UTF-8', true));
                        ?>
</option>
                    <?php 
                    }
                    ?>
                <?php 
                }
                ?>
                <?php 
                if (fn_allowed_for("ULTIMATE")) {
                    ?>
                    <?php 
                    if ($_smarty_tpl->tpl_vars['cat']->value['store']) {
                        ?>
                        <?php 
                        if (!$_smarty_tpl->getVariable('smarty')->value['foreach']['categories']['first']) {
                            ?>
                            </optgroup>
                        <?php 
                        }
                        ?>
                        <optgroup label="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['cat']->value['category'], ENT_QUOTES, 'UTF-8');
                        ?>
">
                    <?php 
                    } else {
                        ?>
                        <?php 
                        if (strpos($_smarty_tpl->tpl_vars['cat']->value['id_path'], (string) $_smarty_tpl->tpl_vars['category_data']->value['id_path'] . "/") === false && $_smarty_tpl->tpl_vars['cat']->value['category_id'] != $_smarty_tpl->tpl_vars['id']->value || !$_smarty_tpl->tpl_vars['id']->value) {
                            ?>
                            <option value="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['cat']->value['category_id'], ENT_QUOTES, 'UTF-8');
                            ?>
" <?php 
                            if ($_smarty_tpl->tpl_vars['cat']->value['disabled']) {
                                ?>
disabled="disabled"<?php 
                            }
                            ?>
 <?php 
                            if ($_smarty_tpl->tpl_vars['category_data']->value['parent_id'] == $_smarty_tpl->tpl_vars['cat']->value['category_id']) {
                                ?>
selected="selected"<?php 
                            }
                            ?>
><?php 
                            echo preg_replace('!^!m', str_repeat("&#166;&nbsp;&nbsp;&nbsp;&nbsp;", $_smarty_tpl->tpl_vars['cat']->value['level']), htmlspecialchars($_smarty_tpl->tpl_vars['cat']->value['category'], ENT_QUOTES, 'UTF-8', true));
                            ?>
</option>
                        <?php 
                        }
                        ?>
                    <?php 
                    }
                    ?>
                <?php 
                }
                ?>
                <?php 
            }
            ?>
            </select>
            </div>
        <?php 
        }
        ?>
    </div>

    <div class="control-group">
        <label class="control-label" for="elm_category_descr"><?php 
        echo $_smarty_tpl->__("description");
        ?>
:</label>
        <div class="controls">
            <textarea id="elm_category_descr" name="category_data[description]" cols="55" rows="8" class="input-large cm-wysiwyg input-textarea-long"><?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['category_data']->value['description'], ENT_QUOTES, 'UTF-8');
        ?>
</textarea>
        </div>
    </div>

    <?php 
        echo $_smarty_tpl->getSubTemplate("common/select_status.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('input_name' => "category_data[status]", 'id' => "elm_category_status", 'obj' => $_smarty_tpl->tpl_vars['category_data']->value, 'hidden' => true), 0);
        ?>


    <?php 
        if (fn_allowed_for("ULTIMATE")) {
            ?>
    <?php 
            echo $_smarty_tpl->getSubTemplate("views/companies/components/company_field.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('name' => "category_data[company_id]", 'id' => "category_data_company_id", 'selected' => $_smarty_tpl->tpl_vars['category_data']->value['company_id']), 0);
            ?>

    <?php 
        }
        ?>

    <div class="control-group">
        <label class="control-label"><?php 
        echo $_smarty_tpl->__("images");
        ?>
:</label>
        <div class="controls">
            <?php 
        echo $_smarty_tpl->getSubTemplate("common/attach_images.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_name' => "category_main", 'image_object_type' => "category", 'image_pair' => $_smarty_tpl->tpl_vars['category_data']->value['main_pair'], 'image_object_id' => $_smarty_tpl->tpl_vars['id']->value, 'icon_text' => __("text_category_icon"), 'detailed_text' => __("text_category_detailed_image"), 'no_thumbnail' => true), 0);
        ?>

        </div>
    </div>

    </div>
    <hr />

    <?php 
        echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("seo_meta_data"), 'target' => "#acc_seo"), 0);
        ?>


    <div id="acc_seo" class="collapsed in">
    <div class="control-group">
        <label class="control-label" for="elm_category_page_title"><?php 
        echo $_smarty_tpl->__("page_title");
        echo $_smarty_tpl->getSubTemplate("common/tooltip.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('tooltip' => __("ttc_page_title")), 0);
        ?>
:</label>
        <div class="controls">
            <input type="text" name="category_data[page_title]" id="elm_category_page_title" size="55" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['category_data']->value['page_title'], ENT_QUOTES, 'UTF-8');
        ?>
" class="input-large" />
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="elm_category_meta_description"><?php 
        echo $_smarty_tpl->__("meta_description");
        ?>
:</label>
        <div class="controls">
            <textarea name="category_data[meta_description]" id="elm_category_meta_description" cols="55" rows="4" class="input-large"><?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['category_data']->value['meta_description'], ENT_QUOTES, 'UTF-8');
        ?>
</textarea>
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="elm_category_meta_keywords"><?php 
        echo $_smarty_tpl->__("meta_keywords");
        ?>
:</label>
        <div class="controls">
            <textarea name="category_data[meta_keywords]" id="elm_category_meta_keywords" cols="55" rows="4" class="input-large"><?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['category_data']->value['meta_keywords'], ENT_QUOTES, 'UTF-8');
        ?>
</textarea>
        </div>
    </div>
    </div>
    <hr />
    <?php 
        if (!fn_allowed_for("ULTIMATE:FREE")) {
            ?>
    <?php 
            echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("availability"), 'target' => "#acc_availability"), 0);
            ?>

    <div id="acc_availability">
    <div class="control-group">
        <label class="control-label"><?php 
            echo $_smarty_tpl->__("usergroups");
            echo $_smarty_tpl->getSubTemplate("common/tooltip.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('tooltip' => __("ttc_usergroups")), 0);
            ?>
:</label>
            <div class="controls">
                <?php 
            echo $_smarty_tpl->getSubTemplate("common/select_usergroups.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "ug_id", 'name' => "category_data[usergroup_ids]", 'usergroups' => fn_get_usergroups("C", @constant('DESCR_SL')), 'usergroup_ids' => $_smarty_tpl->tpl_vars['category_data']->value['usergroup_ids'], 'input_extra' => '', 'list_mode' => false), 0);
            ?>

                <label class="checkbox" for="usergroup_to_subcats"><?php 
            echo $_smarty_tpl->__("to_all_subcats");
            ?>

                    <input id="usergroup_to_subcats" type="checkbox" name="category_data[usergroup_to_subcats]" value="Y" />
                </label>
            </div>
    </div>
    <?php 
        }
        ?>

    <div class="control-group">
        <label class="control-label" for="elm_category_position"><?php 
        echo $_smarty_tpl->__("position");
        ?>
:</label>
        <div class="controls">
            <input type="text" name="category_data[position]" id="elm_category_position" size="10" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['category_data']->value['position'], ENT_QUOTES, 'UTF-8');
        ?>
" class="input-text-short" />
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="elm_category_creation_date"><?php 
        echo $_smarty_tpl->__("creation_date");
        ?>
:</label>
        <div class="controls">
            <?php 
        echo $_smarty_tpl->getSubTemplate("common/calendar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('date_id' => "elm_category_creation_date", 'date_name' => "category_data[timestamp]", 'date_val' => ($tmp = @$_smarty_tpl->tpl_vars['category_data']->value['timestamp']) === null || $tmp === '' ? @constant('TIME') : $tmp, 'start_year' => $_smarty_tpl->tpl_vars['settings']->value['Company']['company_start_year']), 0);
        ?>

        </div>
    </div>

    <?php 
        echo $_smarty_tpl->getSubTemplate("views/localizations/components/select.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('data_from' => $_smarty_tpl->tpl_vars['category_data']->value['localization'], 'data_name' => "category_data[localization]"), 0);
        ?>

</div>
</div>

<div id="content_views">
    <div id="extra">
        <div class="control-group">
            <label class="control-label" for="elm_category_product_layout"><?php 
        echo $_smarty_tpl->__("product_details_view");
        ?>
:</label>
            <div class="controls">
            <select id="elm_category_product_layout" name="category_data[product_details_layout]">
                <?php 
        $_smarty_tpl->tpl_vars["item"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["item"]->_loop = false;
        $_smarty_tpl->tpl_vars["layout"] = new Smarty_Variable();
        $_from = fn_get_product_details_views("category");
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["item"]->key => $_smarty_tpl->tpl_vars["item"]->value) {
            $_smarty_tpl->tpl_vars["item"]->_loop = true;
            $_smarty_tpl->tpl_vars["layout"]->value = $_smarty_tpl->tpl_vars["item"]->key;
            ?>
                    <option <?php 
            if ($_smarty_tpl->tpl_vars['category_data']->value['product_details_layout'] == $_smarty_tpl->tpl_vars['layout']->value) {
                ?>
selected="selected"<?php 
            }
            ?>
 value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['layout']->value, ENT_QUOTES, 'UTF-8');
            ?>
"><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value, ENT_QUOTES, 'UTF-8');
            ?>
</option>
                <?php 
        }
        ?>
            </select>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="elm_category_use_custom_templates"><?php 
        echo $_smarty_tpl->__("use_custom_view");
        ?>
:</label>
            <div class="controls">
            <input type="hidden" value="N" name="category_data[use_custom_templates]"/>
            <input type="checkbox" class="cm-toggle-checkbox" value="Y" name="category_data[use_custom_templates]" id="elm_category_use_custom_templates"<?php 
        if ($_smarty_tpl->tpl_vars['category_data']->value['selected_layouts']) {
            ?>
 checked="checked"<?php 
        }
        ?>
 />
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="elm_category_product_columns"><?php 
        echo $_smarty_tpl->__("product_columns");
        ?>
:</label>
            <div class="controls">
            <input type="text" name="category_data[product_columns]" id="elm_category_product_columns" size="10" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['category_data']->value['product_columns'], ENT_QUOTES, 'UTF-8');
        ?>
" class="cm-toggle-element" <?php 
        if (!$_smarty_tpl->tpl_vars['category_data']->value['selected_layouts']) {
            ?>
disabled="disabled"<?php 
        }
        ?>
 />
            </div>
        </div>

        <?php 
        $_smarty_tpl->tpl_vars["layouts"] = new Smarty_variable(fn_get_products_views('', false, false), null, 0);
        ?>
        <div class="control-group">
            <label class="control-label"><?php 
        echo $_smarty_tpl->__("available_views");
        ?>
:</label>
            <div class="controls">
                <?php 
        $_smarty_tpl->tpl_vars["item"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["item"]->_loop = false;
        $_smarty_tpl->tpl_vars["layout"] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['layouts']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["item"]->key => $_smarty_tpl->tpl_vars["item"]->value) {
            $_smarty_tpl->tpl_vars["item"]->_loop = true;
            $_smarty_tpl->tpl_vars["layout"]->value = $_smarty_tpl->tpl_vars["item"]->key;
            ?>
                    <label class="checkbox" for="elm_category_layout_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['layout']->value, ENT_QUOTES, 'UTF-8');
            ?>
"><input type="checkbox" class="cm-combo-checkbox cm-toggle-element" name="category_data[selected_layouts][<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['layout']->value, ENT_QUOTES, 'UTF-8');
            ?>
]" id="elm_category_layout_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['layout']->value, ENT_QUOTES, 'UTF-8');
            ?>
" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['layout']->value, ENT_QUOTES, 'UTF-8');
            ?>
" <?php 
            if ($_smarty_tpl->tpl_vars['category_data']->value['selected_layouts'][$_smarty_tpl->tpl_vars['layout']->value] || !$_smarty_tpl->tpl_vars['category_data']->value['selected_layouts'] && $_smarty_tpl->tpl_vars['item']->value['active']) {
                ?>
checked="checked"<?php 
            }
            ?>
 <?php 
            if (!$_smarty_tpl->tpl_vars['category_data']->value['selected_layouts']) {
                ?>
disabled="disabled"<?php 
            }
            ?>
 /><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['title'], ENT_QUOTES, 'UTF-8');
            ?>
</label>
                <?php 
        }
        ?>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="elm_category_default_layout"><?php 
        echo $_smarty_tpl->__("default_category_view");
        ?>
:</label>
            <div class="controls">
            <select id="elm_category_default_layout" class="cm-combo-select cm-toggle-element" name="category_data[default_layout]" <?php 
        if (!$_smarty_tpl->tpl_vars['category_data']->value['selected_layouts']) {
            ?>
disabled="disabled"<?php 
        }
        ?>
>
                <?php 
        $_smarty_tpl->tpl_vars["item"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["item"]->_loop = false;
        $_smarty_tpl->tpl_vars["layout"] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['layouts']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["item"]->key => $_smarty_tpl->tpl_vars["item"]->value) {
            $_smarty_tpl->tpl_vars["item"]->_loop = true;
            $_smarty_tpl->tpl_vars["layout"]->value = $_smarty_tpl->tpl_vars["item"]->key;
            ?>
                    <?php 
            if ($_smarty_tpl->tpl_vars['category_data']->value['selected_layouts'][$_smarty_tpl->tpl_vars['layout']->value] || !$_smarty_tpl->tpl_vars['category_data']->value['selected_layouts'] && $_smarty_tpl->tpl_vars['item']->value['active']) {
                ?>
                        <option <?php 
                if ($_smarty_tpl->tpl_vars['category_data']->value['default_layout'] == $_smarty_tpl->tpl_vars['layout']->value) {
                    ?>
selected="selected"<?php 
                }
                ?>
 value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['layout']->value, ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['title'], ENT_QUOTES, 'UTF-8');
                ?>
</option>
                    <?php 
            }
            ?>
                <?php 
        }
        ?>
            </select>
            </div>
        </div>
    </div>
</div>

<div id="content_addons">
<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "categories:detailed_content"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "categories:detailed_content"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "categories:detailed_content"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>

</div>

<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "categories:tabs_content"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "categories:tabs_content"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "categories:tabs_content"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>


<?php 
        $_smarty_tpl->_capture_stack[0][] = array("buttons", null, null);
        ob_start();
        ?>
    <?php 
        if ($_smarty_tpl->tpl_vars['id']->value) {
            ?>
        <?php 
            echo $_smarty_tpl->getSubTemplate("common/view_tools.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('url' => "categories.update?category_id="), 0);
            ?>


        <?php 
            $_smarty_tpl->tpl_vars['view_uri'] = new Smarty_variable(fn_get_preview_url("categories.view?category_id=" . (string) $_smarty_tpl->tpl_vars['id']->value, $_smarty_tpl->tpl_vars['category_data']->value, $_smarty_tpl->tpl_vars['auth']->value['user_id']), null, 0);
            ?>

        <?php 
            $_smarty_tpl->_capture_stack[0][] = array("tools_list", null, null);
            ob_start();
            ?>
            <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "categories:update_tools_list"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "categories:update_tools_list"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

                <li><?php 
                smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'href' => "categories.add?parent_id=" . (string) $_smarty_tpl->tpl_vars['id']->value, 'text' => __("add_subcategory")));
                ?>
</li>
                <li><?php 
                smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'href' => "products.add?category_id=" . (string) $_smarty_tpl->tpl_vars['id']->value, 'text' => __("add_product")));
                ?>
</li>
                <li><?php 
                smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'target' => "_blank", 'text' => __("preview"), 'href' => $_smarty_tpl->tpl_vars['view_uri']->value));
                ?>
</li>
                <li class="divider"></li>
                <li><?php 
                smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'href' => "products.manage?cid=" . (string) $_smarty_tpl->tpl_vars['id']->value, 'text' => __("view_products")));
                ?>
</li>
                <li><?php 
                smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'class' => "cm-confirm", 'text' => __("delete_this_category"), 'href' => "categories.delete?category_id=" . (string) $_smarty_tpl->tpl_vars['id']->value));
                ?>
</li>
            <?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "categories:update_tools_list"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

        <?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            ?>
        <?php 
            smarty_template_function_dropdown($_smarty_tpl, array('content' => Smarty::$_smarty_vars['capture']['tools_list']));
            ?>

    <?php 
        }
        ?>
    <?php 
        echo $_smarty_tpl->getSubTemplate("buttons/save_cancel.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => "submit-link", 'but_target_form' => "category_update_form", 'but_name' => "dispatch[categories.update]", 'save' => $_smarty_tpl->tpl_vars['id']->value), 0);
        ?>

<?php 
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['id']->value) {
            ?>
    <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "categories:tabs_extra"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "categories:tabs_extra"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

    <?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "categories:tabs_extra"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
        ?>

<?php 
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        echo $_smarty_tpl->getSubTemplate("common/tabsbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('content' => Smarty::$_smarty_vars['capture']['tabsbox'], 'group_name' => $_smarty_tpl->tpl_vars['runtime']->value['controller'], 'active_tab' => $_REQUEST['selected_section'], 'track' => true), 0);
        ?>

</form>
<?php 
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        ?>

<?php 
        $_smarty_tpl->_capture_stack[0][] = array("sidebar", null, null);
        ob_start();
        if ($_smarty_tpl->tpl_vars['categories_tree']->value) {
            ?>
    <div class="sidebar-row">
        <h6><?php 
            echo $_smarty_tpl->__("categories");
            ?>
</h6>
        <div class="nested-tree">
            <?php 
            echo $_smarty_tpl->getSubTemplate("views/categories/components/categories_links_tree.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('show_all' => false, 'categories_tree' => $_smarty_tpl->tpl_vars['categories_tree']->value), 0);
            ?>

        </div>
    </div>
<?php 
        }
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        ?>

<?php 
        if (!$_smarty_tpl->tpl_vars['id']->value) {
            ?>
    <?php 
            echo $_smarty_tpl->getSubTemplate("common/mainbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("new_category"), 'sidebar' => Smarty::$_smarty_vars['capture']['sidebar'], 'sidebar_position' => "left", 'content' => Smarty::$_smarty_vars['capture']['mainbox'], 'buttons' => Smarty::$_smarty_vars['capture']['buttons']), 0);
            ?>

<?php 
        } else {
            ?>
    <?php 
            ob_start();
            echo $_smarty_tpl->__("editing_category");
            $_tmp1 = ob_get_clean();
            echo $_smarty_tpl->getSubTemplate("common/mainbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('sidebar' => Smarty::$_smarty_vars['capture']['sidebar'], 'sidebar_position' => "left", 'title' => $_tmp1 . ": " . (string) $_smarty_tpl->tpl_vars['category_data']->value['category'], 'content' => Smarty::$_smarty_vars['capture']['mainbox'], 'select_languages' => true, 'buttons' => Smarty::$_smarty_vars['capture']['buttons'], 'adv_buttons' => Smarty::$_smarty_vars['capture']['adv_buttons']), 0);
            ?>

<?php 
        }
        ?>


<?php 
    }
示例#8
0
function fn_get_products_layout($params)
{
    static $result = null;
    // Function returns incorrect value when called more than once, this is a simple workaround.
    if ($result !== null) {
        return $result;
    }
    /**
     * Change params for getting products layout
     *
     * @param array $params Params for getting products layout
     */
    fn_set_hook('get_products_layout_pre', $params);
    if (!isset($_SESSION['products_layout'])) {
        $_SESSION['products_layout'] = Registry::get('settings.Appearance.save_selected_view') == 'Y' ? array() : '';
    }
    $active_views = fn_get_products_views(false, true);
    $default_view = Registry::get('settings.Appearance.default_products_view');
    if (!empty($params['category_id'])) {
        $_layout = db_get_row("SELECT default_view, selected_views FROM ?:categories WHERE category_id = ?i", $params['category_id']);
        $category_default_view = $_layout['default_view'];
        $category_views = unserialize($_layout['selected_views']);
        if (!empty($category_views)) {
            if (!empty($category_default_view)) {
                $default_view = $category_default_view;
            }
            $active_views = $category_views;
        }
        $ext_id = $params['category_id'];
    } else {
        $ext_id = 'search';
    }
    if (!empty($params['layout'])) {
        $layout = $params['layout'];
    } elseif (Registry::get('settings.Appearance.save_selected_view') == 'Y' && !empty($_SESSION['products_layout'][$ext_id])) {
        $layout = $_SESSION['products_layout'][$ext_id];
    } elseif (Registry::get('settings.Appearance.save_selected_view') == 'N' && !empty($_SESSION['products_layout'])) {
        $layout = $_SESSION['products_layout'];
    }
    $selected_view = !empty($layout) && !empty($active_views[$layout]) ? $layout : $default_view;
    /**
     * Change selected layout
     *
     * @param array $selected_view Selected layout
     * @param array $params        Params for getting products layout
     */
    fn_set_hook('get_products_layout_post', $selected_view, $params);
    if (!empty($params['layout']) && $params['layout'] == $selected_view) {
        if (Registry::get('settings.Appearance.save_selected_view') == 'Y') {
            if (!is_array($_SESSION['products_layout'])) {
                $_SESSION['products_layout'] = array();
            }
            $_SESSION['products_layout'][$ext_id] = $selected_view;
        } else {
            $_SESSION['products_layout'] = $selected_view;
        }
    }
    $result = $selected_view;
    return $selected_view;
}