Example #1
0
/**
 * Get search objects data
 *
 * @param string $area Area ('A' for admin or 'C' for customer)
 * @return array Search objects data
 */
function fn_get_search_objects($area = AREA)
{
    $schema = fn_get_schema('search', 'schema');
    $search = array('conditions' => array('functions' => array(), 'values' => array()), 'more_data' => array(), 'titles' => array(), 'default' => array(), 'default_params' => array());
    foreach ($schema as $object => $object_data) {
        if (!empty($object_data['action_link']) && $area != 'C') {
            if (fn_check_view_permissions($object_data['action_link'], 'GET') == false) {
                continue;
            }
        }
        $search['conditions']['functions'][$object] = $object_data['condition_function'];
        $search['titles'][$object] = $object_data['title'];
        $search['more_data'][$object] = $object_data['more_data_function'];
        $search['bulk_data'][$object] = $object_data['bulk_data_function'];
        $search['default_params'][$object] = $object_data['default_params'];
        $search['action_links'][$object] = $object_data['action_link'];
        $search['detailed_links'][$object] = $object_data['detailed_link'];
        $search['show_in_search'][$object] = $object_data['show_in_search'];
        if (!empty($object_data['default']) && $object_data['default'] == true) {
            $search['default'][] = $object;
        }
    }
    /**
     * Additionally processes search schema
     *
     * @param array  $schema Search objects schema
     * @param string $area   Area ('A' for admin or 'C' for customer)
     * @param array  $search Search objects data
     */
    fn_set_hook('get_search_objects_post', $schema, $area, $search);
    return $search;
}
Example #2
0
 /**
  * Adds new node the breadcrumbs
  *
  * @param  string  $lang_value name of language variable
  * @param  string  $link       breadcrumb URL
  * @param  boolean $nofollow   Include or not "nofollow" attribute
  * @param  boolean $is_first   Flag that defines if parameter should be added to the beging (default false)
  * @return boolean True if breadcrumbs were added, false otherwise
  */
 public function addLink($title, $link = '', $nofollow = false, $is_first = false)
 {
     if ($this->_area == 'A' && !fn_check_view_permissions($link, 'GET')) {
         return false;
     }
     fn_set_hook('add_breadcrumb', $title, $link);
     $item = array('title' => $title, 'link' => $link, 'nofollow' => $nofollow);
     if ($is_first) {
         array_unshift($this->_links, $item);
     } else {
         $this->_links[] = $item;
     }
     return true;
 }
    function content_55db8bdb4d0b63_72912352($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_replace')) {
            include '/var/www/html/market/app/lib/vendor/smarty/smarty/libs/plugins/modifier.replace.php';
        }
        fn_preload_lang_vars(array('edit', 'view', 'view', 'edit', 'edit', 'add'));
        $_smarty_tpl->tpl_vars["method"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['method']->value) === null || $tmp === '' ? "POST" : $tmp, null, 0);
        $_smarty_tpl->tpl_vars['popup_params'] = new Smarty_variable(" id=\"opener_" . (string) $_smarty_tpl->tpl_vars['id']->value . "\" data-ca-target-id=\"content_" . (string) $_smarty_tpl->tpl_vars['id']->value . "\"", null, 0);
        if (!$_smarty_tpl->tpl_vars['content']->value) {
            $_smarty_tpl->tpl_vars['popup_params'] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['popup_params']->value . "  data-ca-dialog-title=\"" . (string) smarty_modifier_replace($_smarty_tpl->tpl_vars['text']->value, '"', '') . "\"", null, 0);
        }
        if ($_smarty_tpl->tpl_vars['runtime']->value['action'] && fn_check_view_permissions($_smarty_tpl->tpl_vars['runtime']->value['action'], $_smarty_tpl->tpl_vars['method']->value) || !$_smarty_tpl->tpl_vars['runtime']->value['action'] && fn_check_html_view_permissions($_smarty_tpl->tpl_vars['content']->value, $_smarty_tpl->tpl_vars['method']->value)) {
            if ($_smarty_tpl->tpl_vars['act']->value == "edit") {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["_href"] = new Smarty_variable(fn_url($_smarty_tpl->tpl_vars['href']->value), null, 0);
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["default_link_text"] = new Smarty_variable($_smarty_tpl->__("edit"), null, 0);
                ?>
    <?php 
                if (!fn_check_view_permissions($_smarty_tpl->tpl_vars['_href']->value)) {
                    ?>
        <?php 
                    $_smarty_tpl->tpl_vars["_link_text"] = new Smarty_variable($_smarty_tpl->__("view"), null, 0);
                    ?>
        <?php 
                    $_smarty_tpl->tpl_vars["default_link_text"] = new Smarty_variable($_smarty_tpl->__("view"), null, 0);
                    ?>
    <?php 
                }
                ?>
    <a <?php 
                if ($_smarty_tpl->tpl_vars['edit_onclick']->value) {
                    ?>
onclick="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['edit_onclick']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 class="hand <?php 
                if (!$_smarty_tpl->tpl_vars['no_icon_link']->value) {
                    if ($_smarty_tpl->tpl_vars['update_controller']->value == "addons") {
                        ?>
exicon-cog<?php 
                    }
                    if ($_smarty_tpl->tpl_vars['icon']->value) {
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['icon']->value, ENT_QUOTES, 'UTF-8');
                    }
                }
                ?>
 <?php 
                if (!$_smarty_tpl->tpl_vars['is_promo']->value) {
                    ?>
cm-dialog-opener<?php 
                }
                if ($_smarty_tpl->tpl_vars['is_promo']->value) {
                    ?>
cm-promo-popup<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['_href']->value && !$_smarty_tpl->tpl_vars['is_promo']->value) {
                    ?>
 <?php 
                    echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['opener_ajax_class']->value) === null || $tmp === '' ? 'cm-ajax' : $tmp, ENT_QUOTES, 'UTF-8');
                }
                if ($_smarty_tpl->tpl_vars['link_class']->value) {
                    ?>
 <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['link_class']->value, ENT_QUOTES, 'UTF-8');
                }
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['_href']->value && !$_smarty_tpl->tpl_vars['is_promo']->value) {
                    ?>
 href="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['_href']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                echo $_smarty_tpl->tpl_vars['popup_params']->value;
                ?>
 title="<?php 
                echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['link_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("edit") : $tmp, ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['drop_left']->value) {
                    ?>
data-placement="left"<?php 
                }
                ?>
><?php 
                if ($_smarty_tpl->tpl_vars['icon']->value) {
                    ?>
<i class="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['icon']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"></i><?php 
                }
                echo ($tmp = @$_smarty_tpl->tpl_vars['link_text']->value) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['default_link_text']->value : $tmp;
                ?>
</a>
<?php 
            } elseif ($_smarty_tpl->tpl_vars['act']->value == "edit_outside") {
                ?>
    <a <?php 
                if ($_smarty_tpl->tpl_vars['edit_onclick']->value) {
                    ?>
onclick="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['edit_onclick']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 class="hand btn cm-tooltip cm-dialog-opener <?php 
                if ($_smarty_tpl->tpl_vars['_href']->value) {
                    ?>
 <?php 
                    echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['opener_ajax_class']->value) === null || $tmp === '' ? 'cm-ajax' : $tmp, ENT_QUOTES, 'UTF-8');
                }
                if ($_smarty_tpl->tpl_vars['link_class']->value) {
                    ?>
 <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['link_class']->value, ENT_QUOTES, 'UTF-8');
                }
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['_href']->value) {
                    ?>
 href="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['_href']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                echo $_smarty_tpl->tpl_vars['popup_params']->value;
                ?>
 title="<?php 
                echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['link_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("edit") : $tmp, ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['drop_left']->value) {
                    ?>
data-placement="left"<?php 
                }
                ?>
>
        <?php 
                echo ($tmp = @$_smarty_tpl->tpl_vars['link_text']->value) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['default_link_text']->value : $tmp;
                ?>

    </a>
<?php 
            } elseif ($_smarty_tpl->tpl_vars['act']->value == "create") {
                ?>
    <?php 
                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_onclick' => $_smarty_tpl->tpl_vars['edit_onclick']->value, 'but_text' => $_smarty_tpl->tpl_vars['but_text']->value, 'but_role' => "add", 'but_target_id' => "content_" . (string) $_smarty_tpl->tpl_vars['id']->value, 'but_meta' => "btn cm-dialog-opener " . (string) $_smarty_tpl->tpl_vars['but_meta']->value, 'but_icon' => $_smarty_tpl->tpl_vars['icon']->value), 0);
                ?>

<?php 
            } elseif ($_smarty_tpl->tpl_vars['act']->value == "notes") {
                ?>
    <a <?php 
                echo $_smarty_tpl->tpl_vars['popup_params']->value;
                ?>
 class="cm-dialog-opener <?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['meta']->value, ENT_QUOTES, 'UTF-8');
                ?>
"><i class="<?php 
                echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['icon']->value) === null || $tmp === '' ? 'icon-question-sign' : $tmp, ENT_QUOTES, 'UTF-8');
                ?>
"></i></a>
<?php 
            } elseif ($_smarty_tpl->tpl_vars['act']->value == "general") {
                ?>
        <div class="btn-group <?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['meta']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
            <a class="btn cm-dialog-opener <?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['link_class']->value, ENT_QUOTES, 'UTF-8');
                ?>
 cm-tooltip" <?php 
                echo $_smarty_tpl->tpl_vars['popup_params']->value;
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['edit_onclick']->value) {
                    ?>
onclick="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['edit_onclick']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['href']->value) {
                    ?>
href="<?php 
                    echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['href']->value), ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['title']->value) {
                    ?>
title="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['title']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
><?php 
                if ($_smarty_tpl->tpl_vars['icon']->value) {
                    ?>
<i class="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['icon']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"></i><?php 
                }
                ?>
 <?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['link_text']->value, ENT_QUOTES, 'UTF-8');
                ?>
</a>
        </div>
<?php 
            } elseif ($_smarty_tpl->tpl_vars['act']->value == "button") {
                ?>
    <?php 
                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => $_smarty_tpl->tpl_vars['link_text']->value, 'but_href' => $_smarty_tpl->tpl_vars['but_href']->value, 'but_role' => $_smarty_tpl->tpl_vars['but_role']->value, 'but_id' => "opener_" . (string) $_smarty_tpl->tpl_vars['id']->value, 'but_onclick' => (string) $_smarty_tpl->tpl_vars['edit_onclick']->value, 'but_target_id' => "content_" . (string) $_smarty_tpl->tpl_vars['id']->value, 'but_meta' => "btn cm-dialog-opener"), 0);
                ?>

<?php 
            } elseif ($_smarty_tpl->tpl_vars['act']->value == "link") {
                ?>
    <a class="cm-dialog-opener <?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['link_class']->value, ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                echo $_smarty_tpl->tpl_vars['popup_params']->value;
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['edit_onclick']->value) {
                    ?>
onclick="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['edit_onclick']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['href']->value) {
                    ?>
href="<?php 
                    echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['href']->value), ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
><?php 
                echo ($tmp = @$_smarty_tpl->tpl_vars['link_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("add") : $tmp;
                ?>
</a>
<?php 
            } elseif ($_smarty_tpl->tpl_vars['act']->value == "default") {
                ?>
    <a<?php 
                if ($_smarty_tpl->tpl_vars['onclick']->value) {
                    ?>
 onclick="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['onclick']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['href']->value) {
                    ?>
 href="<?php 
                    echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['href']->value), ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 class="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['link_class']->value, ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['link_text']->value, ENT_QUOTES, 'UTF-8');
                ?>
</a>
<?php 
            }
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['content']->value) {
                ?>
<div class="hidden <?php 
                if (fn_allowed_for("ULTIMATE")) {
                    ?>
ufa<?php 
                }
                ?>
" title="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['text']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="content_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
    <?php 
                echo $_smarty_tpl->tpl_vars['content']->value;
                ?>

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

<?php 
        } else {
        }
    }
    function content_55ccef84663c03_45153615($_smarty_tpl)
    {
        if (!is_callable('smarty_function_script')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.script.php';
        }
        if (!is_callable('smarty_function_include_ext')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.include_ext.php';
        }
        fn_preload_lang_vars(array('general', 'status', 'name', 'show_tab_in_popup', 'block', 'select_block', 'select_block', 'global_status', 'active', 'disabled', 'disable_for', 'enable_for'));
        if ($_smarty_tpl->tpl_vars['tab_data']->value) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["id"] = new Smarty_variable($_smarty_tpl->tpl_vars['tab_data']->value['tab_id'], null, 0);
        } else {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["id"] = new Smarty_variable(0, null, 0);
        }
        ?>


<?php 
        echo smarty_function_script(array('src' => "js/tygh/tabs.js"), $_smarty_tpl);
        ?>


<?php 
        $_smarty_tpl->tpl_vars['html_id'] = new Smarty_variable("tab_" . (string) $_smarty_tpl->tpl_vars['id']->value, null, 0);
        ?>

<script type="text/javascript">
var html_id = "<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
        ?>
";

(function(_, $) {
    $(document).ready(function() {
        $(_.doc).on('click', '.cm-remove-block', function(e) {
            if (confirm(_.tr('text_are_you_sure_to_proceed')) != false) {
                var parent = $(this).parent();
                var block_id = parent.find('input[name="block_id"]').val();

                $.ceAjax('request', fn_url('block_manager.block.delete'), {
                    data: {block_id: block_id},
                    callback: function() {
                        parent.remove();
                    },
                    method: 'post'
                });
            }

            return false;
        });

        $(_.doc).on('click', '.cm-add-block', function(e) {
            /*
                Adding new block functionality
            */
            var action = $(this).prop('class').match(/bm-action-([a-zA-Z0-9-_]+)/)[1];
            
            if (action == 'new-block') {                
                var block_type = $(this).find('input[name="block_data[type]"]').val();

                var href = 'block_manager.update_block?';
                    href += 'block_data[type]=' + block_type;
                    href += '&ajax_update=1';
                    href += '&html_id=' + html_id;
                    href += '&force_close=' + 1;
                    href += '&assign_to=' + 'ajax_update_block_' + html_id;

                var prop_container = 'new_block_' + block_type;

                // Remove properties container if it exist
                if ($('#' + prop_container).length != 0) {
                    $('#' + prop_container).remove();
                }

                // Create properties container
                var container = $('<div id="' + prop_container + '"></div>').appendTo(_.body);

                $('#' + prop_container).ceDialog('open', {href: fn_url(href), title: Tygh.tr('add_block') + ': ' + $(this).find('strong').text()});
            } else if (action == 'existing-block') {
                var block_id = $(this).find('input[name="block_id"]').val();
                var block_title = $(this).find('.select-block-title').text();

                data = {
                    block_data: {
                        block_id: $(this).find('input[name="block_id"]').val()
                    },
                    assign_to: 'ajax_update_block_' + html_id,
                    force_close: '1'
                };

                $.ceAjax('request', fn_url('block_manager.update_block'), {
                    data: data,
                    method: 'post'
                });
            }

            $.ceDialog('get_last').ceDialog('close');
        });
    });

}(Tygh, Tygh.$));

</script>

<form action="<?php 
        echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
        ?>
" name="update_product_tab_form_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" method="post" class=" form-horizontal">
    
<div id="content_group_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
        ?>
">
    <input type="hidden" name="tab_data[tab_id]" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" />
    <input type="hidden" name="result_ids" value="content_group_tab_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" />

    <div class="tabs cm-j-tabs">
        <ul class="nav nav-tabs">
            <li id="general_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" class="cm-js<?php 
        if ($_smarty_tpl->tpl_vars['active_tab']->value == "block_general_" . (string) $_smarty_tpl->tpl_vars['html_id']->value) {
            ?>
 active<?php 
        }
        ?>
">
                <a><?php 
        echo $_smarty_tpl->__("general");
        ?>
</a>
            </li>
            <?php 
        if ($_smarty_tpl->tpl_vars['dynamic_object_scheme']->value && $_smarty_tpl->tpl_vars['id']->value > 0) {
            ?>
                <li id="tab_status_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
" class="cm-js<?php 
            if ($_smarty_tpl->tpl_vars['active_tab']->value == "block_status_" . (string) $_smarty_tpl->tpl_vars['html_id']->value) {
                ?>
 active<?php 
            }
            ?>
">
                    <a><?php 
            echo $_smarty_tpl->__("status");
            ?>
</a>
                </li>
            <?php 
        }
        ?>
        </ul>
    </div>

    <div class="cm-tabs-content" id="tabs_content_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
        ?>
">
        <div id="content_general_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
        ?>
">
            <fieldset>
                <div class="control-group">
                    <label class="cm-required control-label" for="elm_description_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
        ?>
"><?php 
        echo $_smarty_tpl->__("name");
        ?>
:</label>
                    <div class="controls">
                        <input type="text" name="tab_data[name]" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['tab_data']->value['name'], ENT_QUOTES, 'UTF-8');
        ?>
" id="elm_description_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" class="input-text" size="18" />
                    </div>
                </div>

                <?php 
        if (!$_smarty_tpl->tpl_vars['dynamic_object_scheme']->value) {
            ?>
                    <?php 
            echo $_smarty_tpl->getSubTemplate("common/select_status.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('input_name' => "tab_data[status]", 'id' => "elm_tab_data_" . (string) $_smarty_tpl->tpl_vars['html_id']->value, 'obj' => $_smarty_tpl->tpl_vars['tab_data']->value), 0);
            ?>

                <?php 
        }
        ?>

                <div class="control-group">
                    <label for="elm_show_in_popup_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" class="control-label"><?php 
        echo $_smarty_tpl->__("show_tab_in_popup");
        ?>
:</label>
                    <div class="controls">
                        <input type="hidden" name="tab_data[show_in_popup]" value="N" />
                        <input type="checkbox" name="tab_data[show_in_popup]" id="elm_show_in_popup_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" <?php 
        if ($_smarty_tpl->tpl_vars['tab_data']->value['show_in_popup'] == "Y") {
            ?>
checked="checked"<?php 
        }
        ?>
 value="Y">
                    </div>
                </div>

                <?php 
        if ($_smarty_tpl->tpl_vars['tab_data']->value['is_primary'] !== 'Y' && fn_check_view_permissions("block_manager.update_block")) {
            ?>
                    <div class="control-group">
                        <label for="ajax_update_block_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
" class="cm-required control-label"><?php 
            echo $_smarty_tpl->__("block");
            ?>
:</label>
                        <div class="controls clearfix help-inline-wrap">
                            <?php 
            echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('act' => "general", 'id' => "select_block_" . (string) $_smarty_tpl->tpl_vars['html_id']->value, 'text' => __("select_block"), 'link_text' => __("select_block"), 'href' => "block_manager.block_selection?extra_id=" . (string) $_smarty_tpl->tpl_vars['tab_data']->value['tab_id'] . "&on_product_tabs=1", 'action' => "block_manager.block_selection", 'opener_ajax_class' => "cm-ajax cm-ajax-force", 'content' => '', 'meta' => "pull-left"), 0);
            ?>

                            <br><br>
                            <div id="ajax_update_block_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
">
                                <input type="hidden" name="block_data[block_id]" id="ajax_update_block_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
" value="<?php 
            echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['tab_data']->value['block_id']) === null || $tmp === '' ? '' : $tmp, ENT_QUOTES, 'UTF-8');
            ?>
" />
                                <?php 
            if ($_smarty_tpl->tpl_vars['tab_data']->value['block_id'] > 0) {
                ?>
                                    <?php 
                echo $_smarty_tpl->getSubTemplate("views/block_manager/render/block.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('block_data' => $_smarty_tpl->tpl_vars['block_data']->value, 'external_render' => true, 'external_id' => $_smarty_tpl->tpl_vars['html_id']->value), 0);
                ?>
        
                                <?php 
            }
            ?>
                            <!--ajax_update_block_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
--></div>
                        </div>
                    </div>
                <?php 
        }
        ?>
            </fieldset>
        </div>
        <?php 
        if ($_smarty_tpl->tpl_vars['dynamic_object_scheme']->value && $_smarty_tpl->tpl_vars['id']->value > 0) {
            ?>
            <div id="content_tab_status_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
" >
                <fieldset>
                    <div class="control-group">
                        <label class="control-label"><?php 
            echo $_smarty_tpl->__("global_status");
            ?>
:</label>
                        <div class="controls">
                            <label class="radio text-value"><?php 
            if ($_smarty_tpl->tpl_vars['tab_data']->value['status'] == 'A') {
                echo $_smarty_tpl->__("active");
            } else {
                echo $_smarty_tpl->__("disabled");
            }
            ?>
</label>
                        </div>
                    </div>
                    <input type="hidden" class="cm-no-hide-input" name="snapping_data[object_type]" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['dynamic_object_scheme']->value['object_type'], ENT_QUOTES, 'UTF-8');
            ?>
" />
                    <div class="control-group">
                        <label class="control-label"><?php 
            if ($_smarty_tpl->tpl_vars['tab_data']->value['status'] == 'A') {
                echo $_smarty_tpl->__("disable_for");
            } else {
                echo $_smarty_tpl->__("enable_for");
            }
            ?>
:</label>
                        <div class="controls">
                            <?php 
            echo smarty_function_include_ext(array('file' => $_smarty_tpl->tpl_vars['dynamic_object_scheme']->value['picker'], 'data_id' => "tab_" . (string) $_smarty_tpl->tpl_vars['html_id']->value . "_product_ids", 'input_name' => "tab_data[product_ids]", 'item_ids' => $_smarty_tpl->tpl_vars['tab_data']->value['product_ids'], 'view_mode' => "links", 'params_array' => $_smarty_tpl->tpl_vars['dynamic_object_scheme']->value['picker_params']), $_smarty_tpl);
            ?>

                        </div>
                    </div>
                </fieldset>
            <!--content_tab_status_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
--></div>
        <?php 
        }
        ?>
    </div>

<!--content_group_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
        ?>
--></div>
<div class="buttons-container">
    <?php 
        echo $_smarty_tpl->getSubTemplate("buttons/save_cancel.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[tabs.update]", 'cancel_action' => "close", 'save' => $_smarty_tpl->tpl_vars['id']->value), 0);
        ?>

</div>
</form><?php 
    }
Example #5
0
function fn_dashboard_get_graphs_data($time_from, $time_to, $is_day)
{
    $company_condition = fn_get_company_condition('?:orders.company_id');
    $graphs = array();
    $graph_tabs = array();
    $time_to = mktime(23, 59, 59, date("n", $time_to), date("j", $time_to), date("Y", $time_to));
    if (fn_check_view_permissions("sales_reports.view", "GET")) {
        $graphs['dashboard_statistics_sales_chart'] = array();
        $paid_statuses = array('P', 'C');
        for ($i = $time_from; $i <= $time_to; $i = $i + ($is_day ? 60 * 60 : SECONDS_IN_DAY)) {
            $date = !$is_day ? date("Y, (n-1), j", $i) : date("H", $i);
            if (empty($graphs['dashboard_statistics_sales_chart'][$date])) {
                $graphs['dashboard_statistics_sales_chart'][$date] = array('cur' => 0, 'prev' => 0);
            }
        }
        $sales = db_get_array("SELECT " . "?:orders.timestamp, " . "?:orders.total " . "FROM ?:orders " . "WHERE ?:orders.timestamp BETWEEN ?i AND ?i " . "AND ?:orders.status IN (?a) " . "?p ", $time_from, $time_to, $paid_statuses, $company_condition);
        foreach ($sales as $sale) {
            $date = !$is_day ? date("Y, (n-1), j", $sale['timestamp']) : date("H", $sale['timestamp']);
            $graphs['dashboard_statistics_sales_chart'][$date]['cur'] += $sale['total'];
        }
        $sales_prev = db_get_array("SELECT " . "?:orders.timestamp, " . "?:orders.total " . "FROM ?:orders " . "WHERE ?:orders.timestamp BETWEEN ?i AND ?i " . "AND ?:orders.status IN (?a) " . "?p ", $time_from - ($time_to - $time_from), $time_from, $paid_statuses, $company_condition);
        foreach ($sales_prev as $sale) {
            $date = $sale['timestamp'] + ($time_to - $time_from);
            $date = !$is_day ? date("Y, (n-1), j", $date) : date("H", $date);
            $graphs['dashboard_statistics_sales_chart'][$date]['prev'] += $sale['total'];
        }
        $graph_tabs['sales_chart'] = array('title' => __('sales'), 'js' => true);
    }
    fn_set_hook('dashboard_get_graphs_data', $time_from, $time_to, $graphs, $graph_tabs, $is_day);
    Registry::set('navigation.tabs', $graph_tabs);
    return $graphs;
}
    function content_55e61f9b7722c4_18014718($_smarty_tpl)
    {
        if (!is_callable('smarty_function_script')) {
            include '/var/www/html/market/app/functions/smarty_plugins/function.script.php';
        }
        if (!is_callable('smarty_block_hook')) {
            include '/var/www/html/market/app/functions/smarty_plugins/block.hook.php';
        }
        fn_preload_lang_vars(array('add_post', 'add_post', 'no_data', 'text_enabled_testimonials_notice'));
        if ($_smarty_tpl->tpl_vars['discussion']->value && $_smarty_tpl->tpl_vars['discussion']->value['object_type'] && !$_smarty_tpl->tpl_vars['discussion']->value['is_empty']) {
            ?>

    <?php 
            $_smarty_tpl->tpl_vars['allow_save'] = new Smarty_variable(($_smarty_tpl->tpl_vars['discussion']->value['object_type'] != "M" || !$_smarty_tpl->tpl_vars['runtime']->value['company_id']) && fn_check_view_permissions("discussion.update"), null, 0);
            ?>

    <div id="content_discussion">
    <div class="clearfix">
        <div class="buttons-container buttons-bg pull-right">
            <?php 
            if (fn_check_view_permissions("discussion.add") && !(fn_allowed_for("MULTIVENDOR") && $_smarty_tpl->tpl_vars['runtime']->value['company_id'] && ($_smarty_tpl->tpl_vars['runtime']->value['company_id'] != $_smarty_tpl->tpl_vars['object_company_id']->value || $_smarty_tpl->tpl_vars['discussion']->value['object_type'] == 'M'))) {
                ?>
                <?php 
                if ($_smarty_tpl->tpl_vars['discussion']->value['object_type'] == "E") {
                    ?>
                    <?php 
                    $_smarty_tpl->_capture_stack[0][] = array("adv_buttons", null, null);
                    ob_start();
                    ?>
                        <?php 
                    echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_new_post", 'title' => __("add_post"), 'icon' => "icon-plus", 'act' => "general", 'link_class' => "cm-dialog-switch-avail"), 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 
                } else {
                    ?>
                    <?php 
                    echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_new_post", 'link_text' => __("add_post"), 'act' => "general", 'link_class' => "cm-dialog-switch-avail"), 0);
                    ?>

                <?php 
                }
                ?>
            <?php 
            }
            ?>
            <?php 
            if ($_smarty_tpl->tpl_vars['discussion']->value['posts'] && fn_check_view_permissions("discussion_manager")) {
                ?>
                <?php 
                $_smarty_tpl->tpl_vars['show_save_btn'] = new Smarty_variable(true, null, 2);
                $_ptr = $_smarty_tpl->parent;
                while ($_ptr != null) {
                    $_ptr->tpl_vars['show_save_btn'] = clone $_smarty_tpl->tpl_vars['show_save_btn'];
                    $_ptr = $_ptr->parent;
                }
                ?>
                <?php 
                if ($_smarty_tpl->tpl_vars['discussion']->value['object_type'] == "E") {
                    ?>
                    <?php 
                    $_smarty_tpl->_capture_stack[0][] = array("buttons_insert", null, null);
                    ob_start();
                    ?>
                <?php 
                }
                ?>
                <?php 
                if (fn_check_view_permissions("discussion.m_delete")) {
                    ?>
                    <?php 
                    $_smarty_tpl->_capture_stack[0][] = array("tools_list", null, null);
                    ob_start();
                    ?>
                        <li><?php 
                    smarty_template_function_btn($_smarty_tpl, array('type' => "delete_selected", 'dispatch' => "dispatch[discussion.m_delete]", 'form' => "update_posts_form"));
                    ?>
</li>
                    <?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 
                if ($_smarty_tpl->tpl_vars['discussion']->value['object_type'] == "E") {
                    ?>
                    <?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 
            }
            ?>
        </div>
    </div><br>

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

        <?php 
                echo smarty_function_script(array('src' => "js/addons/discussion/discussion.js"), $_smarty_tpl);
                ?>

        <?php 
                echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('save_current_page' => true, 'id' => "pagination_discussion", 'search' => $_smarty_tpl->tpl_vars['discussion']->value['search']), 0);
                ?>


        <div class="posts-container <?php 
                if ($_smarty_tpl->tpl_vars['allow_save']->value) {
                    ?>
cm-no-hide-input<?php 
                } else {
                    ?>
cm-hide-inputs<?php 
                }
                ?>
">
            <?php 
                $_smarty_tpl->tpl_vars["post"] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars["post"]->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['discussion']->value['posts'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars["post"]->key => $_smarty_tpl->tpl_vars["post"]->value) {
                    $_smarty_tpl->tpl_vars["post"]->_loop = true;
                    ?>
                <div class="post-item <?php 
                    if ($_smarty_tpl->tpl_vars['discussion']->value['object_type'] == "O") {
                        if ($_smarty_tpl->tpl_vars['post']->value['user_id'] == $_smarty_tpl->tpl_vars['user_id']->value) {
                            ?>
incoming<?php 
                        } else {
                            ?>
outgoing<?php 
                        }
                    }
                    ?>
">
                    <?php 
                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "discussion:items_list_row"));
                    $_block_repeat = true;
                    echo smarty_block_hook(array('name' => "discussion:items_list_row"), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>

                        <?php 
                        echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion_manager/components/post.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('post' => $_smarty_tpl->tpl_vars['post']->value, 'type' => $_smarty_tpl->tpl_vars['discussion']->value['type']), 0);
                        ?>

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

                </div>
            <?php 
                }
                ?>
        </div>
        <?php 
                echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "pagination_discussion", 'search' => $_smarty_tpl->tpl_vars['discussion']->value['search']), 0);
                ?>


    <?php 
            } else {
                ?>
        <p class="no-items"><?php 
                echo $_smarty_tpl->__("no_data");
                ?>
</p>
    <?php 
            }
            ?>

    </div>

<?php 
        } elseif ($_smarty_tpl->tpl_vars['discussion']->value['is_empty']) {
            ?>

    <?php 
            echo $_smarty_tpl->__("text_enabled_testimonials_notice", array("[link]" => fn_url("addons.manage#groupdiscussion")));
            ?>


<?php 
        }
    }
Example #7
0
function fn_check_html_view_permissions($data, $request_method = '')
{
    return fn_check_view_permissions($data, $request_method, true);
}
Example #8
0
$_dispatch = CONTROLLER . '.' . MODE;
$tab_selected = false;
$groups = array();
$is = array();
// Get static section
foreach ($xml as $root => $item) {
    if (!isset($navigation['static'][$root])) {
        $navigation['static'][$root] = array();
    }
    $_cache[] = $root;
    if (!isset($is[$root])) {
        $is[$root] = 0;
    }
    foreach ($item->item as $it) {
        $_cache[] = (string) $it['title'];
        if (fn_check_view_permissions($it['dispatch'], 'GET', !empty($it['extra']) ? (string) $it['extra'] : '') == false) {
            continue;
        }
        if (isset($it['active_option'])) {
            $_op = Registry::get((string) $it['active_option']);
            if (empty($_op) || $_op === 'N') {
                continue;
            }
        }
        $is[$root]++;
        if (isset($it['links_group'])) {
            if (!isset($groups[(string) $it['links_group']])) {
                $groups[(string) $it['links_group']] = $is[$root];
            }
        }
        $navigation['static'][$root][(string) $it['title']] = array('href' => (string) $it['dispatch'] . (!empty($it['extra']) ? '?' . (string) $it['extra'] : ''), 'position' => isset($it['links_group']) ? $groups[(string) $it['links_group']] : $is[$root]);
    function content_55d80a94078d20_57240326($_smarty_tpl)
    {
        fn_preload_lang_vars(array('view', 'edit'));
        if ($_smarty_tpl->tpl_vars['popup']->value) {
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['skip_check_permissions']->value || fn_check_view_permissions($_smarty_tpl->tpl_vars['href']->value)) {
                ?>
        <?php 
                echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => $_smarty_tpl->tpl_vars['id']->value, 'text' => $_smarty_tpl->tpl_vars['text']->value, 'link_text' => $_smarty_tpl->tpl_vars['link_text']->value, 'act' => $_smarty_tpl->tpl_vars['act']->value, 'href' => $_smarty_tpl->tpl_vars['href']->value, 'link_class' => $_smarty_tpl->tpl_vars['link_class']->value), 0);
                ?>

    <?php 
            }
        } elseif ($_smarty_tpl->tpl_vars['href']->value) {
            $_smarty_tpl->tpl_vars["_href"] = new Smarty_variable(fn_url($_smarty_tpl->tpl_vars['href']->value), null, 0);
            if (!fn_check_view_permissions($_smarty_tpl->tpl_vars['_href']->value)) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["link_text"] = new Smarty_variable($_smarty_tpl->__("view"), null, 0);
            }
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['act']->value == "link") {
                ?>
    <a href="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['_href']->value, ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                echo $_smarty_tpl->tpl_vars['link_extra']->value;
                ?>
 class="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['extra_class']->value, ENT_QUOTES, 'UTF-8');
                ?>
 cm-tooltip"><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['link_text']->value, ENT_QUOTES, 'UTF-8');
                ?>
</a>
<?php 
            } else {
                ?>
    <a href="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['_href']->value, ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                echo $_smarty_tpl->tpl_vars['link_extra']->value;
                ?>
 class="icon-edit <?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['extra_class']->value, ENT_QUOTES, 'UTF-8');
                ?>
 cm-tooltip" title="<?php 
                echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['link_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("edit") : $tmp, ENT_QUOTES, 'UTF-8');
                ?>
"></a>
<?php 
            }
            ?>

<?php 
        }
        if ($_smarty_tpl->tpl_vars['skip_check_permissions']->value || fn_check_view_permissions($_smarty_tpl->tpl_vars['tools_list']->value)) {
            ?>
    <?php 
            echo $_smarty_tpl->tpl_vars['tools_list']->value;
            ?>

<?php 
        }
    }
    function content_55d5c758cdc0b3_78592989($_smarty_tpl)
    {
        if (!is_callable('smarty_function_math')) {
            include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/function.math.php';
        }
        fn_preload_lang_vars(array('general', 'packages', 'product', 'quantity', 'deleted_product', 'sku', 'no_products_for_shipment', 'options', 'shipping_method', 'tracking_number', 'carrier', 'comments', 'order_status', 'do_not_change', 'text_order_status_notification', 'send_shipment_notification_to_customer', 'text_shipping_packages_info', 'package', 'weight', 'shipping_method'));
        ?>
<script type="text/javascript">
    var packages = [];
</script>

<form action="<?php 
        echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
        ?>
" method="post" name="shipments_form" class="form-horizontal form-edit">
<input type="hidden" name="shipment_data[order_id]" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['order_id'], ENT_QUOTES, 'UTF-8');
        ?>
" />

<?php 
        $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["shipping"]->_loop = false;
        $_smarty_tpl->tpl_vars["shipping_id"] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['order_info']->value['shipping'];
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["shipping"]->key => $_smarty_tpl->tpl_vars["shipping"]->value) {
            $_smarty_tpl->tpl_vars["shipping"]->_loop = true;
            $_smarty_tpl->tpl_vars["shipping_id"]->value = $_smarty_tpl->tpl_vars["shipping"]->key;
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['shipping']->value['packages_info']['packages']) {
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["has_packages"] = new Smarty_variable(true, null, 0);
                ?>
    <?php 
            }
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['has_packages']->value) {
            ?>
    <div class="tabs cm-j-tabs">
        <ul>
            <li id="tab_general" class="cm-js active"><a><?php 
            echo $_smarty_tpl->__("general");
            ?>
</a></li>
            <li id="tab_packages_info" class="cm-js"><a><?php 
            echo $_smarty_tpl->__("packages");
            ?>
</a></li>
        </ul>
    </div>
<?php 
        }
        ?>

<div class="cm-tabs-content" id="tabs_content">
    <div id="content_tab_general">

        <table class="table table-middle">
        <thead>
            <tr>
                <th><?php 
        echo $_smarty_tpl->__("product");
        ?>
</th>
                <th width="5%"><?php 
        echo $_smarty_tpl->__("quantity");
        ?>
</th>
            </tr>
        </thead>

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

        <?php 
        $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["product"]->_loop = false;
        $_smarty_tpl->tpl_vars["key"] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['order_info']->value['products'];
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) {
            $_smarty_tpl->tpl_vars["product"]->_loop = true;
            $_smarty_tpl->tpl_vars["key"]->value = $_smarty_tpl->tpl_vars["product"]->key;
            ?>
            <?php 
            if ($_smarty_tpl->tpl_vars['product']->value['shipment_amount'] > 0 && (!isset($_smarty_tpl->tpl_vars['product']->value['extra']['group_key']) || $_smarty_tpl->tpl_vars['product']->value['extra']['group_key'] == $_smarty_tpl->tpl_vars['group_key']->value)) {
                ?>
            <?php 
                $_smarty_tpl->tpl_vars["shipment_products"] = new Smarty_variable(true, null, 0);
                ?>

            <tr>
                <td>
                    <?php 
                $_smarty_tpl->tpl_vars['may_display_product_update_link'] = new Smarty_variable(fn_check_view_permissions("products.update"), null, 0);
                ?>
                    <?php 
                if ($_smarty_tpl->tpl_vars['may_display_product_update_link']->value && !$_smarty_tpl->tpl_vars['product']->value['deleted_product']) {
                    ?>
<a href="<?php 
                    echo htmlspecialchars(fn_url("products.update?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8');
                    ?>
"><?php 
                }
                echo ($tmp = @$_smarty_tpl->tpl_vars['product']->value['product']) === null || $tmp === '' ? $_smarty_tpl->__("deleted_product") : $tmp;
                if ($_smarty_tpl->tpl_vars['may_display_product_update_link']->value) {
                    ?>
</a><?php 
                }
                ?>
                    <?php 
                if ($_smarty_tpl->tpl_vars['product']->value['product_code']) {
                    ?>
<p><?php 
                    echo $_smarty_tpl->__("sku");
                    ?>
:&nbsp;<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_code'], ENT_QUOTES, 'UTF-8');
                    ?>
</p><?php 
                }
                ?>
                    <?php 
                if ($_smarty_tpl->tpl_vars['product']->value['product_options']) {
                    ?>
<div class="options-info"><?php 
                    echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['product']->value['product_options']), 0);
                    ?>
</div><?php 
                }
                ?>
                </td>
                <td class="center" nowrap="nowrap">
                        <?php 
                echo smarty_function_math(array('equation' => "amount + 1", 'amount' => $_smarty_tpl->tpl_vars['product']->value['shipment_amount'], 'assign' => "loop_amount"), $_smarty_tpl);
                ?>

                        <?php 
                if ($_smarty_tpl->tpl_vars['loop_amount']->value <= 100) {
                    ?>
                            <select id="shipment_data_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" class="input-small cm-shipments-product" name="shipment_data[products][<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
                    ?>
]">
                                <option value="0">0</option>
                            <?php 
                    if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['amount'])) {
                        unset($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']);
                    }
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['name'] = 'amount';
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'] = (int) 1;
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['loop'] = is_array($_loop = $_smarty_tpl->tpl_vars['loop_amount']->value) ? count($_loop) : max(0, (int) $_loop);
                    unset($_loop);
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['show'] = true;
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['loop'];
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'] = 1;
                    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'] < 0) {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'] = max($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'] > 0 ? 0 : -1, $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['loop'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start']);
                    } else {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'] = min($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'] > 0 ? $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['loop'] : $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['loop'] - 1);
                    }
                    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['show']) {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['total'] = min(ceil(($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'] > 0 ? $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['loop'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'] : $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'] + 1) / abs($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'])), $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['max']);
                        if ($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['total'] == 0) {
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['show'] = false;
                        }
                    } else {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['total'] = 0;
                    }
                    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['show']) {
                        for ($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['iteration'] = 1; $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['total']; $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['iteration']++) {
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['iteration'];
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'];
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'];
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['first'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['iteration'] == 1;
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['last'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['total'];
                            ?>
                                <option value="<?php 
                            echo htmlspecialchars($_smarty_tpl->getVariable('smarty')->value['section']['amount']['index'], ENT_QUOTES, 'UTF-8');
                            ?>
" <?php 
                            if ($_smarty_tpl->getVariable('smarty')->value['section']['amount']['last']) {
                                ?>
selected="selected"<?php 
                            }
                            ?>
><?php 
                            echo htmlspecialchars($_smarty_tpl->getVariable('smarty')->value['section']['amount']['index'], ENT_QUOTES, 'UTF-8');
                            ?>
</option>
                            <?php 
                        }
                    }
                    ?>
                            </select>
                        <?php 
                } else {
                    ?>
                            <input id="shipment_data_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" type="text" class="input-text" size="3" name="shipment_data[products][<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
                    ?>
]" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['shipment_amount'], ENT_QUOTES, 'UTF-8');
                    ?>
" />&nbsp;of&nbsp;<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['shipment_amount'], ENT_QUOTES, 'UTF-8');
                    ?>

                        <?php 
                }
                ?>
                </td>
            </tr>
            <?php 
            }
            ?>
        <?php 
        }
        ?>

        <?php 
        if (!$_smarty_tpl->tpl_vars['shipment_products']->value) {
            ?>
            <tr>
                <td colspan="2"><?php 
            echo $_smarty_tpl->__("no_products_for_shipment");
            ?>
</td>
            </tr>
        <?php 
        }
        ?>

        </table>

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


        <fieldset>
            <div class="control-group">
                <label class="control-label" for="shipping_name"><?php 
        echo $_smarty_tpl->__("shipping_method");
        ?>
</label>
                <div class="controls">
                    <select name="shipment_data[shipping_id]" id="shipping_name">
                        <?php 
        $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["shipping"]->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['shippings']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["shipping"]->key => $_smarty_tpl->tpl_vars["shipping"]->value) {
            $_smarty_tpl->tpl_vars["shipping"]->_loop = true;
            ?>
                            <option    value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8');
            ?>
"><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping'], ENT_QUOTES, 'UTF-8');
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                </div>
            </div>
            
            <div class="control-group">
                <label class="control-label" for="tracking_number"><?php 
        echo $_smarty_tpl->__("tracking_number");
        ?>
</label>
                <div class="controls">
                    <input type="text" name="shipment_data[tracking_number]" id="tracking_number" size="10" value="" />
                </div>
            </div>
            
            <div class="control-group">
                <label class="control-label" for="carrier_key"><?php 
        echo $_smarty_tpl->__("carrier");
        ?>
</label>
                <div class="controls">
                    <?php 
        echo $_smarty_tpl->getSubTemplate("common/carriers.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "carrier_key", 'name' => "shipment_data[carrier]"), 0);
        ?>

                </div>
            </div>
            
            <div class="control-group">
                <label class="control-label" for="shipment_comments"><?php 
        echo $_smarty_tpl->__("comments");
        ?>
</label>
                <div class="controls">
                    <textarea id="shipmentcomments" name="shipment_data[comments]" cols="55" rows="8" class="span9"></textarea>
                </div>
            </div>
            
            <div class="control-group">
                <label class="control-label" for="order_status"><?php 
        echo $_smarty_tpl->__("order_status");
        ?>
</label>
                <div class="controls">
                    <select id="order_status" name="shipment_data[order_status]">
                        <option value=""><?php 
        echo $_smarty_tpl->__("do_not_change");
        ?>
</option>
                        <?php 
        $_smarty_tpl->tpl_vars["status"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["status"]->_loop = false;
        $_smarty_tpl->tpl_vars["key"] = new Smarty_Variable();
        $_from = fn_get_simple_statuses(@constant('STATUSES_ORDER'));
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["status"]->key => $_smarty_tpl->tpl_vars["status"]->value) {
            $_smarty_tpl->tpl_vars["status"]->_loop = true;
            $_smarty_tpl->tpl_vars["key"]->value = $_smarty_tpl->tpl_vars["status"]->key;
            ?>
                            <option value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
            ?>
"><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['status']->value, ENT_QUOTES, 'UTF-8');
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                    <p class="description">
                        <?php 
        echo $_smarty_tpl->__("text_order_status_notification");
        ?>

                    </p>
                </div>
            </div>
        </fieldset>

        <div class="cm-toggle-button">
            <div class="control-group select-field notify-customer">
                <div class="controls">
                    <label for="shipment_notify_user" class="checkbox">
                    <input type="checkbox" name="notify_user" id="shipment_notify_user" value="Y" />
                    <?php 
        echo $_smarty_tpl->__("send_shipment_notification_to_customer");
        ?>
</label>
                </div>
            </div>
        </div>
    </div>
    
    <?php 
        if ($_smarty_tpl->tpl_vars['has_packages']->value) {
            ?>
        <div id="content_tab_packages_info">
            <span class="packages-info"><?php 
            echo $_smarty_tpl->__("text_shipping_packages_info");
            ?>
</span>
            <?php 
            $_smarty_tpl->tpl_vars["package_num"] = new Smarty_variable("1", null, 0);
            ?>

            <?php 
            $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["shipping"]->_loop = false;
            $_smarty_tpl->tpl_vars["shipping_id"] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['order_info']->value['shipping'];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["shipping"]->key => $_smarty_tpl->tpl_vars["shipping"]->value) {
                $_smarty_tpl->tpl_vars["shipping"]->_loop = true;
                $_smarty_tpl->tpl_vars["shipping_id"]->value = $_smarty_tpl->tpl_vars["shipping"]->key;
                ?>
                <?php 
                $_smarty_tpl->tpl_vars["package"] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars["package"]->_loop = false;
                $_smarty_tpl->tpl_vars["package_id"] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['shipping']->value['packages_info']['packages'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars["package"]->key => $_smarty_tpl->tpl_vars["package"]->value) {
                    $_smarty_tpl->tpl_vars["package"]->_loop = true;
                    $_smarty_tpl->tpl_vars["package_id"]->value = $_smarty_tpl->tpl_vars["package"]->key;
                    ?>
                    <?php 
                    $_smarty_tpl->tpl_vars["allowed"] = new Smarty_variable(true, null, 0);
                    ?>
                    
                    <?php 
                    $_smarty_tpl->_capture_stack[0][] = array("package_container", null, null);
                    ob_start();
                    ?>
                    <div class="package-container">
                        
                        
                        
                        <script type="text/javascript">
                            packages['package_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping_id']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['package_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
'] = [];
                        </script>
                        <h3>
                        <?php 
                    echo $_smarty_tpl->__("package");
                    ?>
 <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['package_num']->value, ENT_QUOTES, 'UTF-8');
                    ?>
 <?php 
                    if ($_smarty_tpl->tpl_vars['package']->value['shipping_params']) {
                        ?>
(<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['package']->value['shipping_params']['box_length'], ENT_QUOTES, 'UTF-8');
                        ?>
 x <?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['package']->value['shipping_params']['box_width'], ENT_QUOTES, 'UTF-8');
                        ?>
 x <?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['package']->value['shipping_params']['box_height'], ENT_QUOTES, 'UTF-8');
                        ?>
)<?php 
                    }
                    ?>
                        </h3>
                        <ul>
                        <?php 
                    $_smarty_tpl->tpl_vars["amount"] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars["amount"]->_loop = false;
                    $_smarty_tpl->tpl_vars["cart_id"] = new Smarty_Variable();
                    $_from = $_smarty_tpl->tpl_vars['package']->value['products'];
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars["amount"]->key => $_smarty_tpl->tpl_vars["amount"]->value) {
                        $_smarty_tpl->tpl_vars["amount"]->_loop = true;
                        $_smarty_tpl->tpl_vars["cart_id"]->value = $_smarty_tpl->tpl_vars["amount"]->key;
                        ?>
                            <script type="text/javascript">
                                packages['package_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping_id']->value, ENT_QUOTES, 'UTF-8');
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['package_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
']['<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['cart_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
'] = '<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['amount']->value, ENT_QUOTES, 'UTF-8');
                        ?>
';
                            </script>
                            <?php 
                        if ($_smarty_tpl->tpl_vars['order_info']->value['products'][$_smarty_tpl->tpl_vars['cart_id']->value]) {
                            ?>
                                <li><span><?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['amount']->value, ENT_QUOTES, 'UTF-8');
                            ?>
</span> x <?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['products'][$_smarty_tpl->tpl_vars['cart_id']->value]['product'], ENT_QUOTES, 'UTF-8');
                            ?>
 <?php 
                            if ($_smarty_tpl->tpl_vars['order_info']->value['products'][$_smarty_tpl->tpl_vars['cart_id']->value]['product_options']) {
                                ?>
(<?php 
                                echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['order_info']->value['products'][$_smarty_tpl->tpl_vars['cart_id']->value]['product_options']), 0);
                                ?>
)<?php 
                            }
                            ?>
</li>
                            <?php 
                        } else {
                            ?>
                                <?php 
                            $_smarty_tpl->tpl_vars["allowed"] = new Smarty_variable(false, null, 0);
                            ?>
                            <?php 
                        }
                        ?>
                        <?php 
                    }
                    ?>
                        </ul>
                        <span class="strong"><?php 
                    echo $_smarty_tpl->__("weight");
                    ?>
:</span> <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['package']->value['weight'], ENT_QUOTES, 'UTF-8');
                    ?>
<br />
                        <span class="strong"><?php 
                    echo $_smarty_tpl->__("shipping_method");
                    ?>
:</span> <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping'], ENT_QUOTES, 'UTF-8');
                    ?>

                    </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['allowed']->value) {
                        ?>
                        <?php 
                        echo Smarty::$_smarty_vars['capture']['package_container'];
                        ?>

                    <?php 
                    }
                    ?>
                    
                    <?php 
                    echo smarty_function_math(array('equation' => "num + 1", 'num' => $_smarty_tpl->tpl_vars['package_num']->value, 'assign' => "package_num"), $_smarty_tpl);
                    ?>

                <?php 
                }
                ?>
            <?php 
            }
            ?>
        </div>
    <?php 
        }
        ?>
</div>

<div class="buttons-container">
    <?php 
        echo $_smarty_tpl->getSubTemplate("buttons/save_cancel.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[shipments.add]", 'cancel_action' => "close"), 0);
        ?>

</div>


</form>


<script type="text/javascript">
    function fn_calculate_packages()
    {
        var products = [];
        
        Tygh.$('.cm-shipments-package:checked').each(function(id, elm) {
            jelm = Tygh.$(elm);
            id = jelm.prop('id');
            
            for (var i in packages[id]) {
                if (typeof(products[i]) == 'undefined') {
                    products[i] = parseInt(packages[id][i]);
                } else {
                    products[i] += parseInt(packages[id][i]);
                }
            }
        });
        
        // Set the values of the ship products to 0. We will change the values to the correct variants after
        Tygh.$('.cm-shipments-product').each(function() {
            Tygh.$(this).val(0);
        });
        
        if (products.length > 0) {
            for (var i in products) {
                Tygh.$('#shipment_data_' + i).val(products[i]);
            }
        }
    }
    Tygh.$(document).ready(function() {
        Tygh.$('.cm-shipments-package').on('change', fn_calculate_packages);
    });
</script>

<?php 
    }
    function content_55d4e48ea38fd8_14328752($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_unpuny')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/modifier.unpuny.php';
        }
        if (!is_callable('smarty_modifier_date_format')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/modifier.date_format.php';
        }
        if (!is_callable('smarty_block_hook')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php';
        }
        fn_preload_lang_vars(array('id', 'name', 'email', 'storefront', 'registered', 'status', 'view_vendor_products', 'view_vendor_users', 'view_vendor_orders', 'merge', 'edit', 'delete', 'notify_vendor', 'no_data', 'proceed', 'activate_selected', 'activate_selected', 'proceed', 'disable_selected', 'disable_selected', 'activate_selected', 'disable_selected', 'add_vendor', 'vendors'));
        echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_scripts.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 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="companies_form" id="companies_form">
<input type="hidden" name="fake" value="1" />

<?php 
        echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('save_current_page' => true, 'save_current_url' => true), 0);
        ?>


<?php 
        $_smarty_tpl->tpl_vars["return_current_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0);
        $_smarty_tpl->tpl_vars["c_url"] = new Smarty_variable(fn_query_remove($_smarty_tpl->tpl_vars['config']->value['current_url'], "sort_by", "sort_order"), null, 0);
        $_smarty_tpl->tpl_vars["c_icon"] = new Smarty_variable("<i class=\"exicon-" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_order_rev'] . "\"></i>", null, 0);
        $_smarty_tpl->tpl_vars["c_dummy"] = new Smarty_variable("<i class=\"exicon-dummy\"></i>", null, 0);
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['companies']->value) {
            ?>
<table width="100%" class="table table-middle">
<thead>
<tr>
    <th width="1%" class="left">
        <?php 
            echo $_smarty_tpl->getSubTemplate("common/check_items.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
            ?>
</th>
    <th width="6%"><a class="cm-ajax" href="<?php 
            echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['c_url']->value . "&sort_by=id&sort_order=" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_order_rev']), ENT_QUOTES, 'UTF-8');
            ?>
" data-ca-target-id="pagination_contents"><?php 
            echo $_smarty_tpl->__("id");
            if ($_smarty_tpl->tpl_vars['search']->value['sort_by'] == "id") {
                echo $_smarty_tpl->tpl_vars['c_icon']->value;
            } else {
                echo $_smarty_tpl->tpl_vars['c_dummy']->value;
            }
            ?>
</a></th>
    <th width="25%"><a class="cm-ajax" href="<?php 
            echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['c_url']->value . "&sort_by=company&sort_order=" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_order_rev']), ENT_QUOTES, 'UTF-8');
            ?>
" data-ca-target-id="pagination_contents"><?php 
            echo $_smarty_tpl->__("name");
            if ($_smarty_tpl->tpl_vars['search']->value['sort_by'] == "company") {
                echo $_smarty_tpl->tpl_vars['c_icon']->value;
            } else {
                echo $_smarty_tpl->tpl_vars['c_dummy']->value;
            }
            ?>
</a></th>
    <?php 
            if (!fn_allowed_for("ULTIMATE")) {
                ?>
        <th width="25%"><a class="cm-ajax" href="<?php 
                echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['c_url']->value . "&sort_by=email&sort_order=" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_order_rev']), ENT_QUOTES, 'UTF-8');
                ?>
" data-ca-target-id="pagination_contents"><?php 
                echo $_smarty_tpl->__("email");
                if ($_smarty_tpl->tpl_vars['search']->value['sort_by'] == "email") {
                    echo $_smarty_tpl->tpl_vars['c_icon']->value;
                } else {
                    echo $_smarty_tpl->tpl_vars['c_dummy']->value;
                }
                ?>
</a></th>
    <?php 
            }
            ?>
    <?php 
            if (fn_allowed_for("ULTIMATE")) {
                ?>
        <th width="25%"><a class="cm-ajax" href="<?php 
                echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['c_url']->value . "&sort_by=storefront&sort_order=" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_order_rev']), ENT_QUOTES, 'UTF-8');
                ?>
" data-ca-target-id="pagination_contents"><?php 
                echo $_smarty_tpl->__("storefront");
                if ($_smarty_tpl->tpl_vars['search']->value['sort_by'] == "storefront") {
                    echo $_smarty_tpl->tpl_vars['c_icon']->value;
                } else {
                    echo $_smarty_tpl->tpl_vars['c_dummy']->value;
                }
                ?>
</a></th>
    <?php 
            }
            ?>
    <th width="20%"><a class="cm-ajax" href="<?php 
            echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['c_url']->value . "&sort_by=date&sort_order=" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_order_rev']), ENT_QUOTES, 'UTF-8');
            ?>
" data-ca-target-id="pagination_contents"><?php 
            echo $_smarty_tpl->__("registered");
            if ($_smarty_tpl->tpl_vars['search']->value['sort_by'] == "date") {
                echo $_smarty_tpl->tpl_vars['c_icon']->value;
            } else {
                echo $_smarty_tpl->tpl_vars['c_dummy']->value;
            }
            ?>
</a></th>
    <th width="10%" class="nowrap">&nbsp;</th>
    <?php 
            if (!fn_allowed_for("ULTIMATE")) {
                ?>
        <th width="10%" class="right"><a class="cm-ajax" href="<?php 
                echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['c_url']->value . "&sort_by=status&sort_order=" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_order_rev']), ENT_QUOTES, 'UTF-8');
                ?>
" data-ca-target-id="pagination_contents"><?php 
                if ($_smarty_tpl->tpl_vars['search']->value['sort_by'] == "status") {
                    echo $_smarty_tpl->tpl_vars['c_icon']->value;
                } else {
                    echo $_smarty_tpl->tpl_vars['c_dummy']->value;
                }
                echo $_smarty_tpl->__("status");
                ?>
</a></th>
    <?php 
            }
            ?>
</tr>
</thead>
<?php 
            $_smarty_tpl->tpl_vars['company'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['company']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['companies']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['company']->key => $_smarty_tpl->tpl_vars['company']->value) {
                $_smarty_tpl->tpl_vars['company']->_loop = true;
                ?>
<tr class="cm-row-status-<?php 
                echo htmlspecialchars(mb_strtolower($_smarty_tpl->tpl_vars['company']->value['status'], 'UTF-8'), ENT_QUOTES, 'UTF-8');
                ?>
" data-ct-company-id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['company']->value['company_id'], ENT_QUOTES, 'UTF-8');
                ?>
">
    <td class="left">
        <input type="checkbox" name="company_ids[]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['company']->value['company_id'], ENT_QUOTES, 'UTF-8');
                ?>
" class="cm-item" /></td>
    <td class="row-status"><a href="<?php 
                echo htmlspecialchars(fn_url("companies.update?company_id=" . (string) $_smarty_tpl->tpl_vars['company']->value['company_id']), ENT_QUOTES, 'UTF-8');
                ?>
">&nbsp;<span><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['company']->value['company_id'], ENT_QUOTES, 'UTF-8');
                ?>
</span>&nbsp;</a></td>
    <td class="row-status"><a href="<?php 
                echo htmlspecialchars(fn_url("companies.update?company_id=" . (string) $_smarty_tpl->tpl_vars['company']->value['company_id']), ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['company']->value['company'], ENT_QUOTES, 'UTF-8');
                ?>
</a></td>
    <?php 
                if (!fn_allowed_for("ULTIMATE")) {
                    ?>
        <td class="row-status"><a href="mailto:<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['company']->value['email'], ENT_QUOTES, 'UTF-8');
                    ?>
"><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['company']->value['email'], ENT_QUOTES, 'UTF-8');
                    ?>
</a></td>
    <?php 
                }
                ?>
    <?php 
                if (fn_allowed_for("ULTIMATE")) {
                    ?>
        <td><a href="http://<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['company']->value['storefront'], ENT_QUOTES, 'UTF-8');
                    ?>
"><?php 
                    echo htmlspecialchars(smarty_modifier_unpuny($_smarty_tpl->tpl_vars['company']->value['storefront']), ENT_QUOTES, 'UTF-8');
                    ?>
</a></td>
    <?php 
                }
                ?>
    <td class="row-status"><?php 
                echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['company']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'] . ", " . (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format']), ENT_QUOTES, 'UTF-8');
                ?>
</td>
    <td class="nowrap">
        <?php 
                $_smarty_tpl->_capture_stack[0][] = array("tools_items", null, null);
                ob_start();
                ?>
        <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "companies:list_extra_links"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "companies:list_extra_links"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

            <li><?php 
                    smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'href' => "products.manage?company_id=" . (string) $_smarty_tpl->tpl_vars['company']->value['company_id'], 'text' => __("view_vendor_products")));
                    ?>
</li>
            <li><?php 
                    smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'href' => "profiles.manage?company_id=" . (string) $_smarty_tpl->tpl_vars['company']->value['company_id'], 'text' => __("view_vendor_users")));
                    ?>
</li>
            <li><?php 
                    smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'href' => "orders.manage?company_id=" . (string) $_smarty_tpl->tpl_vars['company']->value['company_id'], 'text' => __("view_vendor_orders")));
                    ?>
</li>
            <?php 
                    if (!fn_allowed_for("ULTIMATE") && !$_smarty_tpl->tpl_vars['runtime']->value['company_id']) {
                        ?>
                <li><?php 
                        smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'href' => "companies.merge?company_id=" . (string) $_smarty_tpl->tpl_vars['company']->value['company_id'], 'text' => __("merge")));
                        ?>
</li>
            <?php 
                    }
                    ?>
            <?php 
                    if (!$_smarty_tpl->tpl_vars['runtime']->value['company_id'] && fn_check_view_permissions("companies.update", "POST")) {
                        ?>
                <li class="divider"></li>
                <li><?php 
                        smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'href' => "companies.update?company_id=" . (string) $_smarty_tpl->tpl_vars['company']->value['company_id'], 'text' => __("edit")));
                        ?>
</li>
                <li><?php 
                        smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'class' => "cm-confirm", 'href' => "companies.delete?company_id=" . (string) $_smarty_tpl->tpl_vars['company']->value['company_id'] . "&redirect_url=" . (string) $_smarty_tpl->tpl_vars['return_current_url']->value, 'text' => __("delete")));
                        ?>
</li>
            <?php 
                    }
                    ?>
        <?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "companies:list_extra_links"), $_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();
                }
                ?>
        <div class="hidden-tools">
            <?php 
                smarty_template_function_dropdown($_smarty_tpl, array('content' => Smarty::$_smarty_vars['capture']['tools_items']));
                ?>

        </div>
    </td>
    <?php 
                if (!fn_allowed_for("ULTIMATE")) {
                    ?>
        <td class="right nowrap">
            <?php 
                    $_smarty_tpl->tpl_vars["notify"] = new Smarty_variable(true, null, 0);
                    ?>
            <?php 
                    echo $_smarty_tpl->getSubTemplate("common/select_popup.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => $_smarty_tpl->tpl_vars['company']->value['company_id'], 'status' => $_smarty_tpl->tpl_vars['company']->value['status'], 'object_id_name' => "company_id", 'hide_for_vendor' => $_smarty_tpl->tpl_vars['runtime']->value['company_id'], 'update_controller' => "companies", 'notify' => $_smarty_tpl->tpl_vars['notify']->value, 'notify_text' => __("notify_vendor")), 0);
                    ?>

        </td>
    <?php 
                }
                ?>
</tr>
<?php 
            }
            ?>
</table>
<?php 
        } else {
            ?>
    <p class="no-items"><?php 
            echo $_smarty_tpl->__("no_data");
            ?>
</p>
<?php 
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['companies']->value) {
            ?>
    <?php 
            if (!$_smarty_tpl->tpl_vars['runtime']->value['company_id']) {
                ?>
    <?php 
                $_smarty_tpl->_capture_stack[0][] = array("activate_selected", null, null);
                ob_start();
                ?>
        <?php 
                echo $_smarty_tpl->getSubTemplate("views/companies/components/reason_container.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('type' => "activate"), 0);
                ?>

        <div class="buttons-container">
            <?php 
                echo $_smarty_tpl->getSubTemplate("buttons/save_cancel.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("proceed"), 'but_name' => "dispatch[companies.m_activate]", 'cancel_action' => "close", 'but_meta' => "cm-process-items"), 0);
                ?>

        </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 
                echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "activate_selected", 'text' => __("activate_selected"), 'content' => Smarty::$_smarty_vars['capture']['activate_selected'], 'link_text' => __("activate_selected")), 0);
                ?>


    <?php 
                $_smarty_tpl->_capture_stack[0][] = array("disable_selected", null, null);
                ob_start();
                ?>
        <?php 
                echo $_smarty_tpl->getSubTemplate("views/companies/components/reason_container.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('type' => "disable"), 0);
                ?>

        <div class="buttons-container">
            <?php 
                echo $_smarty_tpl->getSubTemplate("buttons/save_cancel.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("proceed"), 'but_name' => "dispatch[companies.m_disable]", 'cancel_action' => "close", 'but_meta' => "cm-process-items"), 0);
                ?>

        </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 
                echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "disable_selected", 'text' => __("disable_selected"), 'content' => Smarty::$_smarty_vars['capture']['disable_selected'], 'link_text' => __("disable_selected")), 0);
                ?>

    <?php 
            }
        }
        ?>

<?php 
        echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 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();
        }
        $_smarty_tpl->_capture_stack[0][] = array("buttons", null, null);
        ob_start();
        ?>
    <?php 
        $_smarty_tpl->_capture_stack[0][] = array("tools_items", null, null);
        ob_start();
        ?>
        <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "companies:manage_tools_list"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "companies:manage_tools_list"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

            <?php 
            if (!$_smarty_tpl->tpl_vars['runtime']->value['company_id'] && fn_check_view_permissions("companies.update", "POST")) {
                ?>
                <li><?php 
                smarty_template_function_btn($_smarty_tpl, array('type' => "delete_selected", 'dispatch' => "dispatch[companies.m_delete]", 'form' => "companies_form"));
                ?>
</li>
            <?php 
            }
            ?>
        <?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "companies:manage_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_items']));
        ?>


    <?php 
        if ($_smarty_tpl->tpl_vars['companies']->value && !$_smarty_tpl->tpl_vars['runtime']->value['company_id']) {
            ?>
        <?php 
            if (!fn_allowed_for("ULTIMATE")) {
                ?>
            <?php 
                $_smarty_tpl->tpl_vars["but_class"] = new Smarty_variable("cm-process-items cm-dialog-opener btn-primary", null, 0);
                ?>
            <?php 
                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_target_id' => "content_activate_selected", 'but_target_form' => "companies_form", 'but_text' => __("activate_selected"), 'but_meta' => $_smarty_tpl->tpl_vars['but_class']->value, 'but_role' => "button_main", 'but_name' => $_smarty_tpl->tpl_vars['but_name']->value), 0);
                ?>

            <?php 
                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_target_id' => "content_disable_selected", 'but_target_form' => "companies_form", 'but_text' => __("disable_selected"), 'but_meta' => $_smarty_tpl->tpl_vars['but_class']->value, 'but_role' => "button_main", 'but_name' => $_smarty_tpl->tpl_vars['but_name']->value), 0);
                ?>

        <?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();
        }
        ?>

<?php 
        $_smarty_tpl->_capture_stack[0][] = array("adv_buttons", null, null);
        ob_start();
        ?>
    <?php 
        echo $_smarty_tpl->getSubTemplate("common/tools.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('tool_href' => "companies.add", 'prefix' => "top", 'hide_tools' => true, 'title' => __("add_vendor"), 'icon' => "icon-plus"), 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 
        $_smarty_tpl->_capture_stack[0][] = array("sidebar", null, null);
        ob_start();
        ?>
    <?php 
        echo $_smarty_tpl->getSubTemplate("common/saved_search.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('dispatch' => "companies.manage", 'view_type' => "companies"), 0);
        ?>

    <?php 
        echo $_smarty_tpl->getSubTemplate("views/companies/components/companies_search_form.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('dispatch' => "companies.manage"), 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 
        echo $_smarty_tpl->getSubTemplate("common/mainbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("vendors"), 'content' => Smarty::$_smarty_vars['capture']['mainbox'], 'buttons' => Smarty::$_smarty_vars['capture']['buttons'], 'adv_buttons' => Smarty::$_smarty_vars['capture']['adv_buttons'], 'sidebar' => Smarty::$_smarty_vars['capture']['sidebar']), 0);
        ?>

<?php 
    }
    function content_55db8bdb55d9a2_72459790($_smarty_tpl)
    {
        if (!is_callable('smarty_block_inline_script')) {
            include '/var/www/html/market/app/functions/smarty_plugins/block.inline_script.php';
        }
        fn_preload_lang_vars(array('editing_quick_menu_section', 'new_section', 'editing_quick_menu_link', 'new_link', 'quick_menu', 'remove_this_item', 'remove_this_item', 'add_link', 'show_menu_on_mouse_over', 'add_section', 'done', 'edit', 'name', 'link', 'position', 'use_current_link'));
        if (fn_check_view_permissions("tools.show_quick_menu")) {
            ?>

<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('inline_script', array());
            $_block_repeat = true;
            echo smarty_block_inline_script(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                echo '<script';
                ?>
 type="text/javascript">
    Tygh.tr('editing_quick_menu_section', '<?php 
                echo strtr($_smarty_tpl->__("editing_quick_menu_section"), array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\\/"));
                ?>
');
    Tygh.tr('new_section', '<?php 
                echo strtr($_smarty_tpl->__("new_section"), array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\\/"));
                ?>
');
    Tygh.tr('editing_quick_menu_link', '<?php 
                echo strtr($_smarty_tpl->__("editing_quick_menu_link"), array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\\/"));
                ?>
');
    Tygh.tr('new_link', '<?php 
                echo strtr($_smarty_tpl->__("new_link"), array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\\/"));
                ?>
');
<?php 
                echo '</script';
                ?>
><?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_inline_script(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>


<div class="quick-menu-container" id="quick_menu">
    <div class="quick-menu <?php 
            if ($_smarty_tpl->tpl_vars['settings']->value['show_menu_mouseover'] == "Y") {
                ?>
 quick-menu-show-on-hover<?php 
            }
            ?>
">
        <a id="sw_quick_menu_content" class="quick-menu-link <?php 
            if ($_smarty_tpl->tpl_vars['edit_quick_menu']->value || $_smarty_tpl->tpl_vars['expand_quick_menu']->value) {
                ?>
open<?php 
            }
            ?>
 cm-combination"><?php 
            echo $_smarty_tpl->__("quick_menu");
            ?>
</a>

        <div id="quick_menu_content" class="quick-menu-content cm-popup-box<?php 
            if (!$_smarty_tpl->tpl_vars['edit_quick_menu']->value && !$_smarty_tpl->tpl_vars['expand_quick_menu']->value) {
                ?>
 hidden<?php 
            }
            ?>
">
        <?php 
            if ($_smarty_tpl->tpl_vars['edit_quick_menu']->value) {
                ?>
            <div class="menu-container">
                <table width="100%">
                    <?php 
                $_smarty_tpl->tpl_vars['sect'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['sect']->_loop = false;
                $_smarty_tpl->tpl_vars['sect_id'] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['quick_menu']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['sect']->key => $_smarty_tpl->tpl_vars['sect']->value) {
                    $_smarty_tpl->tpl_vars['sect']->_loop = true;
                    $_smarty_tpl->tpl_vars['sect_id']->value = $_smarty_tpl->tpl_vars['sect']->key;
                    ?>
                        <tr data-ca-qm-item="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['sect_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" data-ca-qm-parent-id="0"
                            data-ca-qm-position="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['sect']->value['section']['position'], ENT_QUOTES, 'UTF-8');
                    ?>
">
                            <td class="nowrap section-header">
                                <strong class="cm-qm-name"><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['sect']->value['section']['name'], ENT_QUOTES, 'UTF-8');
                    ?>
</strong>
                            </td>
                            <td class="hidden-tools nowrap right">
                                <i title="<?php 
                    echo $_smarty_tpl->__("remove_this_item");
                    ?>
"
                                   class="icon-trash hand valign cm-delete-section"></i>
                                <i class="icon-edit hand cm-update-item"></i>
                            </td>
                        </tr>
                        <?php 
                    $_smarty_tpl->tpl_vars['subsect'] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars['subsect']->_loop = false;
                    $_from = $_smarty_tpl->tpl_vars['sect']->value['subsection'];
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars['subsect']->key => $_smarty_tpl->tpl_vars['subsect']->value) {
                        $_smarty_tpl->tpl_vars['subsect']->_loop = true;
                        ?>
                            <tr data-ca-qm-item="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['subsect']->value['menu_id'], ENT_QUOTES, 'UTF-8');
                        ?>
" data-ca-qm-parent-id="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['subsect']->value['parent_id'], ENT_QUOTES, 'UTF-8');
                        ?>
"
                                data-ca-qm-position="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['subsect']->value['position'], ENT_QUOTES, 'UTF-8');
                        ?>
">
                                <td class="nowrap">
                                    <a class="cm-qm-name" href="<?php 
                        echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['subsect']->value['url']), ENT_QUOTES, 'UTF-8');
                        ?>
"><?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['subsect']->value['name'], ENT_QUOTES, 'UTF-8');
                        ?>
</a>
                                </td>
                                <td class="hidden-tools nowrap right">
                                    <i title="<?php 
                        echo $_smarty_tpl->__("remove_this_item");
                        ?>
"
                                       class="icon-trash hand valign cm-delete-section"></i>
                                    <i class="icon-edit hand cm-update-item"></i>
                                </td>
                            </tr>
                        <?php 
                    }
                    ?>
                        <tr data-ca-qm-item="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['sect_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" data-ca-qm-parent-id="0"
                            data-ca-qm-position="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['sect']->value['section']['position'], ENT_QUOTES, 'UTF-8');
                    ?>
">
                            <td colspan="2" class="cm-add-link"><a class="edit cm-add-link"><?php 
                    echo $_smarty_tpl->__("add_link");
                    ?>
</a></td>
                        </tr>
                    <?php 
                }
                ?>
                </table>
            </div>
            <table width="100%" class="quick-menu-edit">
                <tr colspan="2">
                    <td>
                        <label class="checkbox" for="show_menu_mouseover">
                            <input class="cm-qm-show-hide" id="show_menu_mouseover" type="checkbox"
                                   name="show_menu_mouseover" value="Y"
                                   <?php 
                if ($_smarty_tpl->tpl_vars['settings']->value['show_menu_mouseover'] == "Y") {
                    ?>
checked="checked"<?php 
                }
                ?>
/><?php 
                echo $_smarty_tpl->__("show_menu_on_mouse_over");
                ?>

                            </label>
                    </td>
                </tr>
                <tr>
                    <td class="nowrap top">
                        <a class="edit cm-add-section"><?php 
                echo $_smarty_tpl->__("add_section");
                ?>
</a>
                        <a class="pull-right edit cm-ajax" data-ca-target-id="quick_menu"
                           href="<?php 
                echo htmlspecialchars(fn_url("tools.show_quick_menu"), ENT_QUOTES, 'UTF-8');
                ?>
"
                           data-ca-event="ce.quick_menu_content_switch_callback"><?php 
                echo $_smarty_tpl->__("done");
                ?>
</a>
                    </td>
                </tr>
            </table>
        <?php 
            } else {
                ?>
            <?php 
                if ($_smarty_tpl->tpl_vars['quick_menu']->value) {
                    ?>
                <div class="menu-container">
                    <ul class="unstyled">
                        <?php 
                    $_smarty_tpl->tpl_vars['sect'] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars['sect']->_loop = false;
                    $_from = $_smarty_tpl->tpl_vars['quick_menu']->value;
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars['sect']->key => $_smarty_tpl->tpl_vars['sect']->value) {
                        $_smarty_tpl->tpl_vars['sect']->_loop = true;
                        ?>
                            <li><span><?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['sect']->value['section']['name'], ENT_QUOTES, 'UTF-8');
                        ?>
</span></li>
                            <?php 
                        $_smarty_tpl->tpl_vars['subsect'] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars['subsect']->_loop = false;
                        $_from = $_smarty_tpl->tpl_vars['sect']->value['subsection'];
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars['subsect']->key => $_smarty_tpl->tpl_vars['subsect']->value) {
                            $_smarty_tpl->tpl_vars['subsect']->_loop = true;
                            ?>
                                <li><a href="<?php 
                            echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['subsect']->value['url']), ENT_QUOTES, 'UTF-8');
                            ?>
"><?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['subsect']->value['name'], ENT_QUOTES, 'UTF-8');
                            ?>
</a></li>
                            <?php 
                        }
                        ?>
                        <?php 
                    }
                    ?>
                    </ul>
                </div>
            <?php 
                }
                ?>
            <div class="quick-menu-actions right">
                <a class="edit cm-ajax" href="<?php 
                echo htmlspecialchars(fn_url("tools.show_quick_menu.edit"), ENT_QUOTES, 'UTF-8');
                ?>
" data-ca-target-id="quick_menu"
                   data-ca-event="ce.quick_menu_content_switch_callback" title="<?php 
                echo $_smarty_tpl->__("edit");
                ?>
"><i class="icon-edit hand"></i></a>
            </div>
        <?php 
            }
            ?>
    </div>
    </div>

    <?php 
            if ($_smarty_tpl->tpl_vars['show_quick_popup']->value) {
                ?>
        <div id="quick_box" class="hidden quick-menu-popup">

            <div id="quick_menu_language_selector">
                <?php 
                if (!fn_allowed_for("ULTIMATE:FREE")) {
                    ?>
                    <?php 
                    echo $_smarty_tpl->getSubTemplate("common/select_object.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('style' => "graphic", 'link_tpl' => fn_link_attach("tools.get_quick_menu_variant", "descr_sl="), 'items' => $_smarty_tpl->tpl_vars['languages']->value, 'selected_id' => @constant('DESCR_SL'), 'key_name' => "name", 'suffix' => "quick_menu", 'display_icons' => true, 'select_container_id' => "quick_menu_language_selector"), 0);
                    ?>

                <?php 
                }
                ?>
            </div>

            <form class="cm-ajax form-horizontal form-edit" name="quick_menu_form" action="<?php 
                echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
                ?>
" method="post">
                <input id="qm_item_id" type="hidden" name="item[id]" value=""/>
                <input id="qm_item_parent" type="hidden" name="item[parent_id]" value="0"/>
                <input id="qm_descr_sl" type="hidden" name="descr_sl" value=""/>
                <input type="hidden" name="result_ids" value="quick_menu"/>

                <div class="control-group">
                    <label class="cm-required control-label" for="qm_item_name"><?php 
                echo $_smarty_tpl->__("name");
                ?>
:</label>

                    <div class="controls">
                        <input id="qm_item_name" name="item[name]" type="text" value="" size="40"/>
                    </div>
                </div>

                <div class="control-group">
                    <label class="cm-required control-label" for="qm_item_link"><?php 
                echo $_smarty_tpl->__("link");
                ?>
:</label>

                    <div class="controls">
                        <input id="qm_item_link" name="item[url]" class="input-text-large" type="text" value=""
                               size="40"/>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="qm_item_position"><?php 
                echo $_smarty_tpl->__("position");
                ?>
:</label>

                    <div class="controls">
                        <input id="qm_item_position" name="item[position]" type="text" value="" size="6"/>
                    </div>
                </div>

                <div class="control-group">
                    <div class="controls">
                        <a id="qm_current_link"><?php 
                echo $_smarty_tpl->__("use_current_link");
                ?>
</a>
                    </div>
                </div>

                <div class="buttons-container">
                    <?php 
                echo $_smarty_tpl->getSubTemplate("buttons/save_cancel.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[tools.update_quick_menu_item.edit]", 'cancel_action' => "close"), 0);
                ?>

                </div>

            </form>
        </div>
    <?php 
            }
            ?>
    <!--quick_menu--></div>
<?php 
        }
    }
    function content_55cdb2acc11bd7_65040675($_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_modifier_date_format')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/modifier.date_format.php';
        }
        fn_preload_lang_vars(array('approved', 'disapprove', 'not_approved', 'approve', 'approved', 'not_approved', 'delete', 'ip_address'));
        $_smarty_tpl->tpl_vars["current_redirect_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0);
        if ($_smarty_tpl->tpl_vars['_REQUEST']->value['dispatch'] == 'products.update') {
            ?>
	<?php 
            $_smarty_tpl->tpl_vars["post"] = new Smarty_variable(fn_get_post_attributes(fn_get_post_title($_smarty_tpl->tpl_vars['post']->value), $_smarty_tpl->tpl_vars['_REQUEST']->value['product_id']), null, 0);
            ?>
	<?php 
            $_smarty_tpl->tpl_vars["attributes"] = new Smarty_variable(fn_get_review_attributes_work($_smarty_tpl->tpl_vars['_REQUEST']->value['product_id']), null, 0);
        }
        ?>
<div class="summary">
    <input type="text" name="posts[<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
        ?>
][name]" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['name'], ENT_QUOTES, 'UTF-8');
        ?>
" size="40" class="input-hidden">
	<input type="text" name="posts[<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
        ?>
][message_title]" class="input-hidden" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['message_title'], ENT_QUOTES, 'UTF-8');
        ?>
" />
    <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "discussion:update_post"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "discussion:update_post"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

        <?php 
            if ($_smarty_tpl->tpl_vars['type']->value == "C" || $_smarty_tpl->tpl_vars['type']->value == "B" || $_smarty_tpl->tpl_vars['type']->value == "R") {
                ?>
            <textarea name="posts[<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
                ?>
][message]" cols="80" rows="5" class="input-hidden"><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['message'], ENT_QUOTES, 'UTF-8');
                ?>
</textarea>
        <?php 
            }
            ?>
    <?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "discussion:update_post"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>

</div>
<div class="tools">
    <div class="pull-left">
        <?php 
        if (fn_check_view_permissions("discussion.m_delete")) {
            ?>
            <input type="checkbox" name="delete_posts[<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
            ?>
]" id="delete_checkbox_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
            ?>
"  class="pull-left cm-item" value="Y">
        <?php 
        }
        ?>
        <div class="hidden-tools pull-left cm-statuses">
            <?php 
        if (fn_check_view_permissions("discussion.update")) {
            ?>
                <span class="cm-status-a <?php 
            if ($_smarty_tpl->tpl_vars['post']->value['status'] == "D") {
                ?>
hidden<?php 
            }
            ?>
">
                    <span class="label label-success"><?php 
            echo $_smarty_tpl->__("approved");
            ?>
</span>
                    <a class="cm-status-switch icon-thumbs-down cm-tooltip" title="<?php 
            echo $_smarty_tpl->__("disapprove");
            ?>
" data-ca-status="D" data-ca-post-id="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
            ?>
"></a>
                </span>
                <span class="cm-status-d <?php 
            if ($_smarty_tpl->tpl_vars['post']->value['status'] == "A") {
                ?>
hidden<?php 
            }
            ?>
">
                    <span class="label label-important"><?php 
            echo $_smarty_tpl->__("not_approved");
            ?>
</span>
                    <a class="cm-status-switch icon-thumbs-up cm-tooltip" title="<?php 
            echo $_smarty_tpl->__("approve");
            ?>
" data-ca-status="A" data-ca-post-id="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
            ?>
"></a>
                </span>
            <?php 
        } else {
            ?>
                <span class="cm-status-<?php 
            echo htmlspecialchars(mb_strtolower($_smarty_tpl->tpl_vars['post']->value['status'], 'UTF-8'), ENT_QUOTES, 'UTF-8');
            ?>
">
                    <?php 
            if ($_smarty_tpl->tpl_vars['post']->value['status'] == "A") {
                ?>
                        <span class="label label-success"><?php 
                echo $_smarty_tpl->__("approved");
                ?>
</span>
                    <?php 
            } else {
                ?>
                        <span class="label label-important"><?php 
                echo $_smarty_tpl->__("not_approved");
                ?>
</span>
                    <?php 
            }
            ?>
                </span>
            <?php 
        }
        ?>
            <?php 
        if (fn_check_view_permissions("discussion.delete")) {
            ?>
                <a class="icon-trash cm-tooltip cm-confirm" href="<?php 
            echo htmlspecialchars(fn_url("discussion.delete?post_id=" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id'] . "&redirect_url=" . (string) $_smarty_tpl->tpl_vars['current_redirect_url']->value), ENT_QUOTES, 'UTF-8');
            ?>
" title="<?php 
            echo $_smarty_tpl->__("delete");
            ?>
"></a>
            <?php 
        }
        ?>
        </div>
    </div>


    <div class="pull-right">
        <span class="muted"><?php 
        echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['post']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'] . ", " . (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format']), ENT_QUOTES, 'UTF-8');
        ?>
 / <?php 
        echo $_smarty_tpl->__("ip_address");
        ?>
:&nbsp;<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['ip_address'], ENT_QUOTES, 'UTF-8');
        ?>
</span>

        <?php 
        if ($_smarty_tpl->tpl_vars['type']->value == "R" || $_smarty_tpl->tpl_vars['type']->value == "B") {
            ?>
			<?php 
            echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/review_attributes/components/rate.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('rate_id' => "rating_" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id'], 'rate_value' => $_smarty_tpl->tpl_vars['post']->value['rating_value'], 'rate_name' => "posts[" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id'] . "][rating_value]"), 0);
            ?>


        <?php 
        }
        ?>
    </div>

    <?php 
        if ($_smarty_tpl->tpl_vars['show_object_link']->value) {
            ?>
        <a href="<?php 
            echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['post']->value['object_data']['url']), ENT_QUOTES, 'UTF-8');
            ?>
" class="post-object" title="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['object_data']['description'], ENT_QUOTES, 'UTF-8');
            ?>
"><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['object_data']['description'], ENT_QUOTES, 'UTF-8');
            ?>
</a>
    <?php 
        }
        ?>
</div>
<?php 
    }
    function content_55ccdf864ee025_32708878($_smarty_tpl)
    {
        fn_preload_lang_vars(array('save', 'save_and_close', 'create', 'create_and_close', 'cancel'));
        if ($_smarty_tpl->tpl_vars['but_target_id']->value || $_smarty_tpl->tpl_vars['but_target_form']->value) {
            $_smarty_tpl->tpl_vars["but_role"] = new Smarty_variable("submit-link", null, 0);
        } else {
            $_smarty_tpl->tpl_vars["but_role"] = new Smarty_variable("button_main", null, 0);
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['save']->value) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["but_label"] = new Smarty_variable($_smarty_tpl->__("save"), null, 0);
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["but_label2"] = new Smarty_variable($_smarty_tpl->__("save_and_close"), null, 0);
        } else {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["but_label"] = new Smarty_variable($_smarty_tpl->__("create"), null, 0);
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["but_label2"] = new Smarty_variable($_smarty_tpl->__("create_and_close"), null, 0);
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['but_name']->value) {
            $_smarty_tpl->tpl_vars["r"] = new Smarty_variable($_smarty_tpl->tpl_vars['but_name']->value, null, 0);
        } else {
            $_smarty_tpl->tpl_vars["r"] = new Smarty_variable($_smarty_tpl->tpl_vars['but_href']->value, null, 0);
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['cancel_action']->value == "close") {
            ?>
    <a class="cm-dialog-closer cm-cancel tool-link btn"><?php 
            echo $_smarty_tpl->__("cancel");
            ?>
</a>
<?php 
        }
        ?>

<?php 
        if (fn_check_view_permissions($_smarty_tpl->tpl_vars['r']->value)) {
            ?>
    <?php 
            if (!$_smarty_tpl->tpl_vars['hide_first_button']->value) {
                ?>
        <?php 
                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => ($tmp = @$_smarty_tpl->tpl_vars['but_text']->value) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['but_label']->value : $tmp, 'but_onclick' => $_smarty_tpl->tpl_vars['but_onclick']->value, 'but_role' => $_smarty_tpl->tpl_vars['but_role']->value, 'but_name' => $_smarty_tpl->tpl_vars['but_name']->value, 'but_meta' => "btn-primary " . (string) $_smarty_tpl->tpl_vars['but_meta']->value), 0);
                ?>

    <?php 
            } else {
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["skip_or"] = new Smarty_variable(true, null, 0);
                ?>
    <?php 
            }
            ?>
    <?php 
            if (!$_smarty_tpl->tpl_vars['hide_second_button']->value && $_smarty_tpl->tpl_vars['cancel_action']->value != "close") {
                ?>
        <?php 
                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => $_smarty_tpl->tpl_vars['but_label2']->value, 'but_role' => $_smarty_tpl->tpl_vars['but_role']->value, 'but_name' => $_smarty_tpl->tpl_vars['but_name']->value, 'but_meta' => "cm-save-and-close btn-primary " . (string) $_smarty_tpl->tpl_vars['but_meta']->value, 'but_onclick' => $_smarty_tpl->tpl_vars['but_onclick']->value, 'allow_href' => true), 0);
                ?>

    <?php 
            }
        } else {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["skip_or"] = new Smarty_variable(true, null, 0);
        }
        ?>

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

<?php 
        }
    }
    function content_55cdb2ac85faf1_67964872($_smarty_tpl)
    {
        fn_preload_lang_vars(array('communication', 'and', 'rating', 'communication', 'rating', 'disabled', 'communication', 'and', 'rating', 'communication', 'rating', 'disabled'));
        ?>
<div class="control-group <?php 
        if ($_smarty_tpl->tpl_vars['no_hide_input']->value) {
            ?>
cm-no-hide-input<?php 
        }
        ?>
">
    <label class="control-label" for="discussion_type"><?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['title']->value, ENT_QUOTES, 'UTF-8');
        ?>
:</label>
    <div class="controls">
        <?php 
        $_smarty_tpl->tpl_vars["discussion"] = new Smarty_variable(fn_get_discussion($_smarty_tpl->tpl_vars['object_id']->value, $_smarty_tpl->tpl_vars['object_type']->value), null, 0);
        ?>

        <?php 
        if (fn_check_view_permissions("discussion.add")) {
            ?>
            <select name="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
[discussion_type]" id="discussion_type">
                <option <?php 
            if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") {
                ?>
selected="selected"<?php 
            }
            ?>
 value="B"><?php 
            echo $_smarty_tpl->__("communication");
            ?>
 <?php 
            echo $_smarty_tpl->__("and");
            ?>
 <?php 
            echo $_smarty_tpl->__("rating");
            ?>
</option>
                <option <?php 
            if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C") {
                ?>
selected="selected"<?php 
            }
            ?>
 value="C"><?php 
            echo $_smarty_tpl->__("communication");
            ?>
</option>
                <option <?php 
            if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R") {
                ?>
selected="selected"<?php 
            }
            ?>
 value="R"><?php 
            echo $_smarty_tpl->__("rating");
            ?>
</option>
                <option <?php 
            if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "D" || !$_smarty_tpl->tpl_vars['discussion']->value) {
                ?>
selected="selected"<?php 
            }
            ?>
 value="D"><?php 
            echo $_smarty_tpl->__("disabled");
            ?>
</option>
            </select>
        <?php 
        } else {
            ?>
            <span class="shift-input"><?php 
            if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") {
                echo $_smarty_tpl->__("communication");
                ?>
 <?php 
                echo $_smarty_tpl->__("and");
                ?>
 <?php 
                echo $_smarty_tpl->__("rating");
            } elseif ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C") {
                echo $_smarty_tpl->__("communication");
            } elseif ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R") {
                echo $_smarty_tpl->__("rating");
            } else {
                echo $_smarty_tpl->__("disabled");
            }
            ?>
</span>
        <?php 
        }
        ?>

    </div>
</div><?php 
    }
            function smarty_template_function_btn($_smarty_tpl, $params)
            {
                $saved_tpl_vars = $_smarty_tpl->tpl_vars;
                foreach ($_smarty_tpl->smarty->template_functions['btn']['parameter'] as $key => $value) {
                    $_smarty_tpl->tpl_vars[$key] = new Smarty_variable($value);
                }
                foreach ($params as $key => $value) {
                    $_smarty_tpl->tpl_vars[$key] = new Smarty_variable($value);
                }
                ?>
    <?php 
                if (fn_check_view_permissions($_smarty_tpl->tpl_vars['href']->value) && fn_check_view_permissions($_smarty_tpl->tpl_vars['dispatch']->value)) {
                    ?>
    
    <?php 
                    if ($_smarty_tpl->tpl_vars['type']->value == "text") {
                        ?>
        <a <?php 
                        if ($_smarty_tpl->tpl_vars['target']->value) {
                            ?>
target="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['target']->value, ENT_QUOTES, 'UTF-8');
                            ?>
"<?php 
                        }
                        ?>
 <?php 
                        if ($_smarty_tpl->tpl_vars['href']->value) {
                            ?>
href="<?php 
                            echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['href']->value), ENT_QUOTES, 'UTF-8');
                            ?>
"<?php 
                        }
                        ?>
 <?php 
                        if ($_smarty_tpl->tpl_vars['id']->value) {
                            ?>
id="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
"<?php 
                        }
                        ?>
 <?php 
                        if ($_smarty_tpl->tpl_vars['class']->value) {
                            ?>
class="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['class']->value, ENT_QUOTES, 'UTF-8');
                            ?>
"<?php 
                        }
                        ?>
 <?php 
                        if ($_smarty_tpl->tpl_vars['title']->value) {
                            ?>
title="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['title']->value, ENT_QUOTES, 'UTF-8');
                            ?>
"<?php 
                        }
                        ?>
        <?php 
                        if ($_smarty_tpl->tpl_vars['data']->value) {
                            ?>
            <?php 
                            $_smarty_tpl->tpl_vars['data_value'] = new Smarty_Variable();
                            $_smarty_tpl->tpl_vars['data_value']->_loop = false;
                            $_smarty_tpl->tpl_vars['data_name'] = new Smarty_Variable();
                            $_from = $_smarty_tpl->tpl_vars['data']->value;
                            if (!is_array($_from) && !is_object($_from)) {
                                settype($_from, 'array');
                            }
                            foreach ($_from as $_smarty_tpl->tpl_vars['data_value']->key => $_smarty_tpl->tpl_vars['data_value']->value) {
                                $_smarty_tpl->tpl_vars['data_value']->_loop = true;
                                $_smarty_tpl->tpl_vars['data_name']->value = $_smarty_tpl->tpl_vars['data_value']->key;
                                ?>
                <?php 
                                if ($_smarty_tpl->tpl_vars['data_value']->value) {
                                    ?>
                    <?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['data_name']->value, ENT_QUOTES, 'UTF-8');
                                    ?>
="<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['data_value']->value, ENT_QUOTES, 'UTF-8');
                                    ?>
"
                <?php 
                                }
                                ?>
            <?php 
                            }
                            ?>
        <?php 
                        }
                        ?>
        <?php 
                        if ($_smarty_tpl->tpl_vars['onclick']->value) {
                            ?>
onclick="<?php 
                            echo $_smarty_tpl->tpl_vars['onclick']->value;
                            ?>
; return false;"<?php 
                        }
                        ?>
        >
        <?php 
                        if ($_smarty_tpl->tpl_vars['icon']->value && $_smarty_tpl->tpl_vars['icon_first']->value) {
                            ?>
<i class="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['icon']->value, ENT_QUOTES, 'UTF-8');
                            ?>
"></i><?php 
                        }
                        ?>
        <?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['text']->value, ENT_QUOTES, 'UTF-8');
                        ?>

        <?php 
                        if ($_smarty_tpl->tpl_vars['icon']->value && !$_smarty_tpl->tpl_vars['icon_first']->value) {
                            ?>
<i class="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['icon']->value, ENT_QUOTES, 'UTF-8');
                            ?>
"></i><?php 
                        }
                        ?>
</a>
    <?php 
                    }
                    ?>

    
    <?php 
                    if ($_smarty_tpl->tpl_vars['type']->value == "list") {
                        ?>
        <?php 
                        if (!$_smarty_tpl->tpl_vars['href']->value && !$_smarty_tpl->tpl_vars['process']->value) {
                            ?>
            <?php 
                            $_smarty_tpl->tpl_vars['class'] = new Smarty_variable("cm-process-items cm-submit " . (string) $_smarty_tpl->tpl_vars['class']->value, null, 0);
                            ?>
        <?php 
                        }
                        ?>
        <?php 
                        $_smarty_tpl->createLocalArrayVariable('data', null, 0);
                        $_smarty_tpl->tpl_vars['data']->value['data-ca-target-form'] = $_smarty_tpl->tpl_vars['form']->value;
                        ?>
        <?php 
                        $_smarty_tpl->createLocalArrayVariable('data', null, 0);
                        $_smarty_tpl->tpl_vars['data']->value['data-ca-dispatch'] = $_smarty_tpl->tpl_vars['dispatch']->value;
                        ?>
        <?php 
                        smarty_template_function_btn($_smarty_tpl, array('type' => "text", 'target' => $_smarty_tpl->tpl_vars['target']->value, 'href' => $_smarty_tpl->tpl_vars['href']->value, 'data' => $_smarty_tpl->tpl_vars['data']->value, 'class' => $_smarty_tpl->tpl_vars['class']->value, 'onclick' => $_smarty_tpl->tpl_vars['onclick']->value, 'text' => $_smarty_tpl->tpl_vars['text']->value));
                        ?>

    <?php 
                    }
                    ?>

    
    <?php 
                    if ($_smarty_tpl->tpl_vars['type']->value == "delete_selected") {
                        ?>
        <?php 
                        if ($_smarty_tpl->tpl_vars['icon']->value) {
                            ?>
            <?php 
                            $_smarty_tpl->tpl_vars['class'] = new Smarty_variable("btn", null, 0);
                            ?>
            <?php 
                            $_smarty_tpl->tpl_vars['text'] = new Smarty_variable(" ", null, 0);
                            ?>
        <?php 
                        }
                        ?>
        <?php 
                        $_smarty_tpl->createLocalArrayVariable('data', null, 0);
                        $_smarty_tpl->tpl_vars['data']->value['data-ca-target-form'] = $_smarty_tpl->tpl_vars['form']->value;
                        ?>
        <?php 
                        $_smarty_tpl->createLocalArrayVariable('data', null, 0);
                        $_smarty_tpl->tpl_vars['data']->value['data-ca-dispatch'] = $_smarty_tpl->tpl_vars['dispatch']->value;
                        ?>
        <?php 
                        smarty_template_function_btn($_smarty_tpl, array('type' => "text", 'target' => $_smarty_tpl->tpl_vars['target']->value, 'href' => $_smarty_tpl->tpl_vars['href']->value, 'data' => $_smarty_tpl->tpl_vars['data']->value, 'class' => "cm-process-items cm-submit cm-confirm " . (string) $_smarty_tpl->tpl_vars['class']->value, 'click' => $_smarty_tpl->tpl_vars['click']->value, 'text' => ($tmp = @$_smarty_tpl->tpl_vars['text']->value) === null || $tmp === '' ? $_smarty_tpl->__("delete_selected") : $tmp));
                        ?>

    <?php 
                    }
                    ?>

    
    <?php 
                    if ($_smarty_tpl->tpl_vars['type']->value == "delete") {
                        ?>
        <?php 
                        $_smarty_tpl->createLocalArrayVariable('data', null, 0);
                        $_smarty_tpl->tpl_vars['data']->value['data-ca-target-form'] = $_smarty_tpl->tpl_vars['form']->value;
                        ?>
        <?php 
                        $_smarty_tpl->createLocalArrayVariable('data', null, 0);
                        $_smarty_tpl->tpl_vars['data']->value['data-ca-dispatch'] = $_smarty_tpl->tpl_vars['dispatch']->value;
                        ?>
        <?php 
                        smarty_template_function_btn($_smarty_tpl, array('type' => "text", 'target' => $_smarty_tpl->tpl_vars['target']->value, 'href' => $_smarty_tpl->tpl_vars['href']->value, 'data' => $_smarty_tpl->tpl_vars['data']->value, 'class' => (string) $_smarty_tpl->tpl_vars['class']->value, 'click' => $_smarty_tpl->tpl_vars['click']->value, 'text' => ($tmp = @$_smarty_tpl->tpl_vars['text']->value) === null || $tmp === '' ? $_smarty_tpl->__("delete") : $tmp));
                        ?>

    <?php 
                    }
                    ?>

    
    <?php 
                    if ($_smarty_tpl->tpl_vars['type']->value == "dialog") {
                        ?>
        <?php 
                        smarty_template_function_btn($_smarty_tpl, array('type' => "text", 'text' => $_smarty_tpl->tpl_vars['text']->value, 'class' => "cm-dialog-opener " . (string) $_smarty_tpl->tpl_vars['class']->value, 'href' => $_smarty_tpl->tpl_vars['href']->value, 'id' => $_smarty_tpl->tpl_vars['id']->value, 'title' => $_smarty_tpl->tpl_vars['title']->value, 'data' => array('data-ca-target-id' => $_smarty_tpl->tpl_vars['target_id']->value, 'data-ca-target-form' => $_smarty_tpl->tpl_vars['form']->value)));
                        ?>

    <?php 
                    }
                    ?>

    
    <?php 
                    if ($_smarty_tpl->tpl_vars['type']->value == "multiple") {
                        ?>
        <?php 
                        echo smarty_function_script(array('src' => "js/tygh/node_cloning.js"), $_smarty_tpl);
                        ?>


        <?php 
                        $_smarty_tpl->tpl_vars["tag_level"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['tag_level']->value) === null || $tmp === '' ? "1" : $tmp, null, 0);
                        ?>
        <?php 
                        if ($_smarty_tpl->tpl_vars['only_delete']->value != "Y") {
                            if (!$_smarty_tpl->tpl_vars['hide_add']->value) {
                                ?>
<li><?php 
                                smarty_template_function_btn($_smarty_tpl, array('type' => "text", 'onclick' => "Tygh." . "\$" . "('#box_' + this.id).cloneNode(" . (string) $_smarty_tpl->tpl_vars['tag_level']->value . "); " . (string) $_smarty_tpl->tpl_vars['on_add']->value, 'id' => $_smarty_tpl->tpl_vars['item_id']->value));
                                ?>
</li><?php 
                            }
                            if (!$_smarty_tpl->tpl_vars['hide_clone']->value) {
                                ?>
<li><?php 
                                smarty_template_function_btn($_smarty_tpl, array('type' => "text", 'onclick' => "Tygh." . "\$" . "('#box_' + this.id).cloneNode(" . (string) $_smarty_tpl->tpl_vars['tag_level']->value . ", true);", 'id' => $_smarty_tpl->tpl_vars['item_id']->value));
                                ?>
</li><?php 
                            }
                        }
                        ?>
<li><?php 
                        smarty_template_function_btn($_smarty_tpl, array('type' => "text", 'only_delete' => $_smarty_tpl->tpl_vars['only_delete']->value, 'class' => "cm-delete-row"));
                        ?>
</li>
    <?php 
                    }
                    ?>

    
    <?php 
                    if ($_smarty_tpl->tpl_vars['type']->value == "add") {
                        ?>
        <?php 
                        smarty_template_function_btn($_smarty_tpl, array('type' => "text", 'title' => $_smarty_tpl->tpl_vars['title']->value, 'class' => "cm-tooltip btn", 'icon' => "icon-plus", 'href' => $_smarty_tpl->tpl_vars['href']->value));
                        ?>

    <?php 
                    }
                    ?>

    
    <?php 
                    if ($_smarty_tpl->tpl_vars['type']->value == "text_add") {
                        ?>
        <?php 
                        smarty_template_function_btn($_smarty_tpl, array('type' => "text", 'text' => $_smarty_tpl->tpl_vars['text']->value, 'class' => "btn btn-primary", 'icon' => "icon-plus icon-white", 'icon_first' => true, 'href' => $_smarty_tpl->tpl_vars['href']->value));
                        ?>

    <?php 
                    }
                    ?>

    <?php 
                }
                $_smarty_tpl->tpl_vars = $saved_tpl_vars;
                foreach (Smarty::$global_tpl_vars as $key => $value) {
                    if (!isset($_smarty_tpl->tpl_vars[$key])) {
                        $_smarty_tpl->tpl_vars[$key] = $value;
                    }
                }
            }
    function content_55d5c759232616_54699455($_smarty_tpl)
    {
        fn_preload_lang_vars(array('discussion', 'discussion_title_order', 'disabled', 'enabled', 'enabled', 'disabled'));
        if ($_smarty_tpl->tpl_vars['runtime']->value['company_id'] && fn_allowed_for("ULTIMATE") || fn_allowed_for("MULTIVENDOR") || $_smarty_tpl->tpl_vars['runtime']->value['simple_ultimate']) {
            ?>

<?php 
            $_smarty_tpl->tpl_vars["discussion"] = new Smarty_variable(fn_get_discussion($_smarty_tpl->tpl_vars['order_info']->value['order_id'], "O"), null, 0);
            ?>

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


<div class="control-group">
    <label class="control-label"><?php 
            echo $_smarty_tpl->__("discussion_title_order");
            ?>
</label>
    <div class="controls">
        <?php 
            if (fn_check_view_permissions("discussion.add")) {
                ?>
	    <input type="hidden" name="discussion[object_id]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['order_id'], ENT_QUOTES, 'UTF-8');
                ?>
" />
	    <input type="hidden" name="discussion[object_type]" value="O" /> 
	    <select name="discussion[type]">
	        <option <?php 
                if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "D") {
                    ?>
selected="selected"<?php 
                }
                ?>
 value="D"><?php 
                echo $_smarty_tpl->__("disabled");
                ?>
</option>
	        <option <?php 
                if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C") {
                    ?>
selected="selected"<?php 
                }
                ?>
 value="C"><?php 
                echo $_smarty_tpl->__("enabled");
                ?>
</option>
	    </select>
        <?php 
            } else {
                ?>
            <span class="shift-input"><?php 
                if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C") {
                    echo $_smarty_tpl->__("enabled");
                } else {
                    echo $_smarty_tpl->__("disabled");
                }
                ?>
</span>
        <?php 
            }
            ?>
    </div>
</div>
<?php 
        }
    }
    function content_55cdb2acb94026_74420224($_smarty_tpl)
    {
        if (!is_callable('smarty_function_script')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.script.php';
        }
        if (!is_callable('smarty_block_hook')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php';
        }
        fn_preload_lang_vars(array('add_post', 'add_post', 'no_data', 'general', 'name', 'your_rating', 'your_message', 'images', 'ls_review_image_label', 'add', 'new_post', 'text_enabled_testimonials_notice'));
        ?>
<style>
    .ls_review_image_container, .ls_review_image_container2 {
        position: relative;
        text-align: center;
        width: 150px;
    }
    .ls_review_image_container > input, .ls_review_image_container2 > input {
        cursor: pointer;
        height: 100%;
        left: 0;
        opacity: 0;
        position: absolute;
        top: 0px;
    }
    .ls_review_image_container:hover .ls_upload_label, .ls_review_image_container2:hover .ls_upload_label2 {
        display: block;
    }

</style>

<?php 
        if ($_smarty_tpl->tpl_vars['discussion']->value && !$_smarty_tpl->tpl_vars['discussion']->value['is_empty']) {
            ?>

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

<?php 
            if (($_smarty_tpl->tpl_vars['discussion']->value['object_type'] != "M" || !$_smarty_tpl->tpl_vars['runtime']->value['company_id']) && fn_check_view_permissions("discussion.update")) {
                $_smarty_tpl->tpl_vars['allow_save'] = new Smarty_variable(true, null, 0);
            }
            ?>
<div class="<?php 
            if ($_smarty_tpl->tpl_vars['allow_save']->value) {
                ?>
cm-no-hide-input<?php 
            } else {
                ?>
cm-hide-inputs<?php 
            }
            ?>
" id="content_discussion">
<div class="clearfix">
    <div class="buttons-container buttons-bg pull-right">
    <?php 
            if ($_smarty_tpl->tpl_vars['allow_save']->value) {
                ?>
            <?php 
                if (fn_check_view_permissions("discussion_manager")) {
                    ?>
                <?php 
                    if ($_smarty_tpl->tpl_vars['discussion']->value['object_type'] == "E") {
                        ?>
                    <?php 
                        $_smarty_tpl->_capture_stack[0][] = array("adv_buttons", null, null);
                        ob_start();
                        ?>
                        <?php 
                        echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_new_post", 'title' => __("add_post"), 'icon' => "icon-plus", 'act' => "general", 'link_class' => "cm-dialog-switch-avail"), 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 
                    } else {
                        ?>
                    <?php 
                        echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_new_post", 'link_text' => __("add_post"), 'act' => "general", 'link_class' => "cm-dialog-switch-avail"), 0);
                        ?>

                <?php 
                    }
                    ?>
            <?php 
                }
                ?>
            <?php 
                if ($_smarty_tpl->tpl_vars['discussion']->value['posts']) {
                    ?>
                <?php 
                    $_smarty_tpl->tpl_vars['show_save_btn'] = new Smarty_variable(true, null, 2);
                    $_ptr = $_smarty_tpl->parent;
                    while ($_ptr != null) {
                        $_ptr->tpl_vars['show_save_btn'] = clone $_smarty_tpl->tpl_vars['show_save_btn'];
                        $_ptr = $_ptr->parent;
                    }
                    ?>
                <?php 
                    if ($_smarty_tpl->tpl_vars['discussion']->value['object_type'] == "E") {
                        ?>
                    <?php 
                        $_smarty_tpl->_capture_stack[0][] = array("buttons_insert", null, null);
                        ob_start();
                        ?>
                <?php 
                    }
                    ?>
                <?php 
                    if (fn_check_view_permissions("discussion.m_delete")) {
                        ?>
                    <?php 
                        $_smarty_tpl->_capture_stack[0][] = array("tools_list", null, null);
                        ob_start();
                        ?>
                        <li><?php 
                        smarty_template_function_btn($_smarty_tpl, array('type' => "delete_selected", 'dispatch' => "dispatch[discussion.m_delete]", 'form' => "update_posts_form"));
                        ?>
</li>
                    <?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 
                    if ($_smarty_tpl->tpl_vars['discussion']->value['object_type'] == "E") {
                        ?>
                    <?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 
                }
                ?>
    <?php 
            }
            ?>
    </div>
</div><br>


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

<?php 
                echo smarty_function_script(array('src' => "js/addons/discussion/discussion.js"), $_smarty_tpl);
                ?>


<?php 
                echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('save_current_page' => true, 'id' => "pagination_discussion", 'search' => $_smarty_tpl->tpl_vars['discussion']->value['search']), 0);
                ?>


<div class="posts-container">

<?php 
                $_smarty_tpl->tpl_vars["post"] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars["post"]->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['discussion']->value['posts'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars["post"]->key => $_smarty_tpl->tpl_vars["post"]->value) {
                    $_smarty_tpl->tpl_vars["post"]->_loop = true;
                    ?>
<div class="post-item <?php 
                    if ($_smarty_tpl->tpl_vars['discussion']->value['object_type'] == "O") {
                        if ($_smarty_tpl->tpl_vars['post']->value['user_id'] == $_smarty_tpl->tpl_vars['user_id']->value) {
                            ?>
incoming<?php 
                        } else {
                            ?>
outgoing<?php 
                        }
                    }
                    ?>
">
    <?php 
                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "discussion:items_list_row"));
                    $_block_repeat = true;
                    echo smarty_block_hook(array('name' => "discussion:items_list_row"), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>

		<?php 
                        echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/review_attributes/components/post.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('post' => $_smarty_tpl->tpl_vars['post']->value, 'type' => $_smarty_tpl->tpl_vars['discussion']->value['type']), 0);
                        ?>

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

</div>
<?php 
                }
                ?>
</div>
<?php 
                echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "pagination_discussion", 'search' => $_smarty_tpl->tpl_vars['discussion']->value['search']), 0);
                ?>


<?php 
            } else {
                ?>
    <p class="no-items"><?php 
                echo $_smarty_tpl->__("no_data");
                ?>
</p>
<?php 
            }
            ?>

<?php 
            if (fn_check_view_permissions("discussion_manager")) {
                ?>
    <?php 
                $_smarty_tpl->_capture_stack[0][] = array("add_new_picker", null, null);
                ob_start();
                ?>
    <div class="tabs cm-j-tabs">
        <ul class="nav nav-tabs">
            <li id="tab_add_post" class="cm-js cm-active active"><a><?php 
                echo $_smarty_tpl->__("general");
                ?>
</a></li>
        </ul>
    </div>

    <div class="cm-tabs-content" id="content_tab_add_post">
    <input type ="hidden" name="post_data[thread_id]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['discussion']->value['thread_id'], ENT_QUOTES, 'UTF-8');
                ?>
" />
    <input type ="hidden" name="redirect_url" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['config']->value['current_url'], ENT_QUOTES, 'UTF-8');
                ?>
&amp;selected_section=discussion" />

    <div class="control-group">
        <label for="post_data_name" class="cm-required control-label"><?php 
                echo $_smarty_tpl->__("name");
                ?>
:</label>
        <div class="controls">
            <input type="text" name="post_data[name]" id="post_data_name" value="<?php 
                if ($_smarty_tpl->tpl_vars['auth']->value['user_id']) {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['user_info']->value['firstname'], ENT_QUOTES, 'UTF-8');
                    ?>
 <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['user_info']->value['lastname'], ENT_QUOTES, 'UTF-8');
                }
                ?>
" disabled="disabled">
        </div>
    </div>

	<div class="control-group">
        <label for="post_data_message_title" class="control-label"><?php 
                echo $_smarty_tpl->__('subject');
                ?>
:</label>
        <div class="controls">
            <input type="text" name="post_data[message_title]" id="post_data_message_title" disabled="disabled">
        </div>
    </div>
	
	<?php 
                $_smarty_tpl->tpl_vars["attributes"] = new Smarty_variable(fn_get_review_attributes_work($_smarty_tpl->tpl_vars['product_data']->value['product_id']), null, 0);
                ?>

    <?php 
                if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") {
                    ?>
    <div class="control-group">
        <label for="rating_value" class="control-label cm-required cm-multiple-radios"><?php 
                    echo $_smarty_tpl->__("your_rating");
                    ?>
</label>
        <div class="controls clearfix">
			<?php 
                    if ($_smarty_tpl->tpl_vars['discussion']->value['object_type'] != 'P' || !$_smarty_tpl->tpl_vars['attributes']->value) {
                        ?>
	            <?php 
                        echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion_manager/components/rate.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('rate_id' => "rating_value", 'rate_name' => "post_data[rating_value]", 'disabled' => true), 0);
                        ?>

				<?php 
                    } elseif ($_smarty_tpl->tpl_vars['attributes']->value) {
                        ?>
                    
                    <?php 
                        $_smarty_tpl->tpl_vars["addon_images_path"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['images_dir']->value . "/addons/altteam_review_attributes/images/", null, 0);
                        ?>

					<table cellpadding="0" cellspacing="0" class="rating-table">
						<tr>
							<th>&nbsp;</th>
							<th><img src="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['addon_images_path']->value, ENT_QUOTES, 'UTF-8');
                        ?>
star_mini_full.png" /></th>
							<th><img src="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['addon_images_path']->value, ENT_QUOTES, 'UTF-8');
                        ?>
star_mini_full.png" /></th>
							<th><img src="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['addon_images_path']->value, ENT_QUOTES, 'UTF-8');
                        ?>
star_mini_full.png" /></th>
							<th><img src="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['addon_images_path']->value, ENT_QUOTES, 'UTF-8');
                        ?>
star_mini_full.png" /></th>
							<th><img src="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['addon_images_path']->value, ENT_QUOTES, 'UTF-8');
                        ?>
star_mini_full.png" /></th>
							<th>&nbsp;</th>
						</tr>
						<?php 
                        $_smarty_tpl->tpl_vars["attribute"] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars["attribute"]->_loop = false;
                        $_from = $_smarty_tpl->tpl_vars['attributes']->value;
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        $_smarty_tpl->tpl_vars['smarty']->value['foreach']["attr"]['iteration'] = 0;
                        foreach ($_from as $_smarty_tpl->tpl_vars["attribute"]->key => $_smarty_tpl->tpl_vars["attribute"]->value) {
                            $_smarty_tpl->tpl_vars["attribute"]->_loop = true;
                            $_smarty_tpl->tpl_vars['smarty']->value['foreach']["attr"]['iteration']++;
                            ?>
						<tr>
							<td class="right gray-line"><?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute']->value['attr_name'], ENT_QUOTES, 'UTF-8');
                            ?>
&nbsp;=&nbsp;</td>
							<td class="valign"><input type="radio" name="post_data[attributes][<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute']->value['attr_id'], ENT_QUOTES, 'UTF-8');
                            ?>
]" value="1" /></td>
							<td class="valign"><input type="radio" name="post_data[attributes][<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute']->value['attr_id'], ENT_QUOTES, 'UTF-8');
                            ?>
]" value="2" /></td>
							<td class="valign"><input type="radio" name="post_data[attributes][<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute']->value['attr_id'], ENT_QUOTES, 'UTF-8');
                            ?>
]" value="3" /></td>
							<td class="valign"><input type="radio" name="post_data[attributes][<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute']->value['attr_id'], ENT_QUOTES, 'UTF-8');
                            ?>
]" value="4" /></td>
							<td class="valign"><input type="radio" name="post_data[attributes][<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute']->value['attr_id'], ENT_QUOTES, 'UTF-8');
                            ?>
]" value="5" checked="checked" /></td>
							<td class="attr_val gray-line"> (<span id="value_attr_row_<?php 
                            echo htmlspecialchars($_smarty_tpl->getVariable('smarty')->value['foreach']['attr']['iteration'], ENT_QUOTES, 'UTF-8');
                            ?>
">5</span> <?php 
                            echo $_smarty_tpl->__('stars');
                            ?>
)</td>
						</tr>
						<?php 
                        }
                        ?>
					</table>

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

    <?php 
                    if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "R") {
                        ?>
    <div class="control-group">
        <label for="message" class="control-label"><?php 
                        echo $_smarty_tpl->__("your_message");
                        ?>
:</label>
        <div class="controls">
            <textarea name="post_data[message]" id="message" class="input-textarea-long" cols="70" rows="8" disabled="disabled"></textarea>
        </div>
    </div>
    <?php 
                    }
                    ?>
    <?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "discussion:add_post"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

    <?php 
                if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "R") {
                    ?>
    
    <div class="control-group ty-control-group">
	<label class="control-label"><?php 
                    echo $_smarty_tpl->__('age_group');
                    ?>
:</label>
        <select id="review_user_age_group" name="post_data[user_age]">
            <option value='1'><?php 
                    echo $_smarty_tpl->__('24&under');
                    ?>
</option>
            <option value='2'><?php 
                    echo $_smarty_tpl->__('between25and34');
                    ?>
</option>
            <option value='3'><?php 
                    echo $_smarty_tpl->__('between35and44');
                    ?>
</option>
            <option value='4'><?php 
                    echo $_smarty_tpl->__('between45and54');
                    ?>
</option>
            <option value='5'><?php 
                    echo $_smarty_tpl->__('between55and64');
                    ?>
</option>
            <option value='6'><?php 
                    echo $_smarty_tpl->__('65andafter');
                    ?>
</option>
        </select>
    </div>
    
    <div class="control-group ty-control-group">
        <label class="control-label"><?php 
                    echo $_smarty_tpl->__("images");
                    ?>
:</label>
        <div class="controls">
            <div class="ls_review_image_container <?php 
                    if (!$_smarty_tpl->tpl_vars['discussion']->value['post_data']['image1']) {
                        ?>
no-image<?php 
                    }
                    ?>
"> 
                <img id="ls_uploadPreview" src="/images/review_img/review_no_image.jpg" />
                <label class="ls_upload_label"><?php 
                    echo $_smarty_tpl->__("ls_review_image_label");
                    ?>
</label>
                <input id="ls_uploadImage" type="file" name="post_data[image1]" /> 
            </div>
            
        </div>
    </div>
    
    </div>
    <?php 
                }
                ?>
    <div class="buttons-container">
        <?php 
                echo $_smarty_tpl->getSubTemplate("buttons/save_cancel.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("add"), 'but_name' => "dispatch[discussion.add_extended]", 'cancel_action' => "close", 'hide_first_button' => false), 0);
                ?>

    </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 
                echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_new_post", 'text' => __("new_post"), 'content' => Smarty::$_smarty_vars['capture']['add_new_picker'], 'act' => "fake"), 0);
                ?>

<?php 
            }
            ?>

</div>

<?php 
        } elseif ($_smarty_tpl->tpl_vars['discussion']->value['is_empty']) {
            ?>

<?php 
            echo $_smarty_tpl->__("text_enabled_testimonials_notice", array("[link]" => fn_url("addons.manage#groupdiscussion")));
            ?>


<?php 
        }
        ?>

    
    <script type="text/javascript">
	
	//$(document).ready(function(){
            function ls_PreviewImage(file_field_id, file_field_preview_id) {

                var oFReader = new FileReader();
                //oFReader.readAsDataURL(document.getElementById("ls_uploadImage").files[0]);
                oFReader.readAsDataURL(document.getElementById(file_field_id).files[0]);
                oFReader.onload = function (oFREvent) {
                    //document.getElementById("ls_uploadPreview").src = oFREvent.target.result;
                    document.getElementById(file_field_preview_id).src = oFREvent.target.result;
                };
            }
            
	//});
            $(document).on("change", "#ls_uploadImage", function () {
                var file = this.files[0];
                if (file.size > 2 * 1024 * 1024) {
                 //Too large Image. Only image smaller than 2MB can be uploaded.");
                  if ($('#ls_frontend_language').text() == 'ro') {
                      var limit_warning="Dimensiunea imaginii trebuie sa fie sub 2MB";
                    } else {
                      var limit_warning="Too large Image. Only image smaller than 2MB can be uploaded.";
                    }
                    if (!$('.ls_warning_limit_image').length) {
                        var objectToAppend = $('.ls_user_image_container');
                        if($('.ls_review_image_container').length>0){

                            objectToAppend = $('.ls_review_image_container');
                        }

                        objectToAppend.append('<div class="ls_warning_limit_image">' + limit_warning + '</div>');
                        setTimeout(function(){ 
                            $('div.ls_warning_limit_image').remove(); }, 3000); 
                    }
                } else {
                    //do the image preview
                //    console.log('file size ok');
                    ls_PreviewImage('ls_uploadImage', 'ls_uploadPreview');
                    if($('.ls_review_image_container').length>0){
                        var label_text = $('label.ls_upload_label').html();
                        var newUploadTagHtml = '<div class="ls_review_image_container2 no-image"><img id="ls_uploadPreview2" src="/images/review_img/review_no_image.jpg" /><label class="ls_upload_label">'+label_text+'</label><input id="ls_uploadImage2" type="file" name="post_data[image2]" /></div>';
                        $('.ls_review_image_container').parent().append(newUploadTagHtml);
                    }
                }        
            });

            $(document).on("change", "#ls_uploadImage2", function () {
                var file = this.files[0];
                if (file.size > 2 * 1024 * 1024) {
                 //Too large Image. Only image smaller than 2MB can be uploaded.");
                  if ($('#ls_frontend_language').text() == 'ro') {
                      var limit_warning="Dimensiunea imaginii trebuie sa fie sub 2MB";
                    } else {
                      var limit_warning="Too large Image. Only image smaller than 2MB can be uploaded.";
                    }
                    if (!$('.ls_warning_limit_image2').length) {
                        var objectToAppend = $('.ls_user_image_container');
                        if($('.ls_review_image_container2').length>0){

                            objectToAppend = $('.ls_review_image_container2');
                        }

                        objectToAppend.append('<div class="ls_warning_limit_image2">' + limit_warning + '</div>');
                        setTimeout(function(){ 
                            $('div.ls_warning_limit_image2').remove(); }, 3000); 
                    }
                } else {
                    //do the image preview
                //    console.log('file size ok');
                    ls_PreviewImage('ls_uploadImage2', 'ls_uploadPreview2');
                }        
            });
	
</script><?php 
    }
    function content_55e61f9b8eb333_81074551($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_date_format')) {
            include '/var/www/html/market/app/functions/smarty_plugins/modifier.date_format.php';
        }
        if (!is_callable('smarty_block_hook')) {
            include '/var/www/html/market/app/functions/smarty_plugins/block.hook.php';
        }
        fn_preload_lang_vars(array('general', 'name', 'creation_date', 'your_rating', 'your_message', 'add', 'new_post'));
        if (fn_check_view_permissions("discussion.add") && !(fn_allowed_for("MULTIVENDOR") && $_smarty_tpl->tpl_vars['runtime']->value['company_id'] && ($_smarty_tpl->tpl_vars['runtime']->value['company_id'] != $_smarty_tpl->tpl_vars['object_company_id']->value || $_smarty_tpl->tpl_vars['discussion']->value['object_type'] == 'M'))) {
            ?>
    <?php 
            $_smarty_tpl->_capture_stack[0][] = array("add_new_picker", null, null);
            ob_start();
            ?>
        <div class="tabs cm-j-tabs">
            <ul class="nav nav-tabs">
                <li id="tab_add_post" class="cm-js active"><a><?php 
            echo $_smarty_tpl->__("general");
            ?>
</a></li>
            </ul>
        </div>
        <form id='form' action="<?php 
            echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
            ?>
" method="post" class="form-horizontal form-edit cm-disable-empty-files" enctype="multipart/form-data">

            <div class="cm-tabs-content cm-no-hide-input" id="content_tab_add_post">
                <input type ="hidden" name="post_data[thread_id]" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['discussion']->value['thread_id'], ENT_QUOTES, 'UTF-8');
            ?>
" />
                <input type ="hidden" name="redirect_url" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['config']->value['current_url'], ENT_QUOTES, 'UTF-8');
            ?>
&amp;selected_section=discussion" />

                <div class="control-group">
                    <label for="post_data_name" class="cm-required control-label"><?php 
            echo $_smarty_tpl->__("name");
            ?>
:</label>
                    <div class="controls">
                        <input type="text" name="post_data[name]" id="post_data_name" value="<?php 
            if ($_smarty_tpl->tpl_vars['auth']->value['user_id']) {
                echo htmlspecialchars($_smarty_tpl->tpl_vars['user_info']->value['firstname'], ENT_QUOTES, 'UTF-8');
                ?>
 <?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['user_info']->value['lastname'], ENT_QUOTES, 'UTF-8');
            }
            ?>
" disabled="disabled">
                    </div>
                </div>

                <div class="control-group">
                    <label for="post_data_timestamp" class="control-label"><?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' => "post_data_timestamp", 'date_name' => "post_data[date]", 'date_val' => ($tmp = @$_smarty_tpl->tpl_vars['post_data']->value['timestamp']) === null || $tmp === '' ? @constant('TIME') : $tmp, 'start_year' => $_smarty_tpl->tpl_vars['settings']->value['Company']['company_start_year']), 0);
            ?>

                        <input class="input-time" size="5" maxlength="5" type="text" name="post_data[time]" value="<?php 
            echo htmlspecialchars(smarty_modifier_date_format(@constant('TIME'), "%H:%M"), ENT_QUOTES, 'UTF-8');
            ?>
" placeholder="00:00" />
                    </div>
                </div>

                <?php 
            if (fn_check_view_permissions("discussion.update")) {
                ?>
                    <?php 
                if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") {
                    ?>
                        <div class="control-group">
                            <label for="rating_value" class="control-label cm-required cm-multiple-radios"><?php 
                    echo $_smarty_tpl->__("your_rating");
                    ?>
</label>
                            <div class="controls clearfix">
                                <?php 
                    echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion_manager/components/rate.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('rate_id' => "rating_value", 'rate_name' => "post_data[rating_value]", 'disabled' => true), 0);
                    ?>

                            </div>
                        </div>
                    <?php 
                }
                ?>
                <?php 
            }
            ?>

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

                <?php 
                if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") {
                    ?>
                    <div class="control-group">
                        <label for="message" class="control-label"><?php 
                    echo $_smarty_tpl->__("your_message");
                    ?>
:</label>
                        <div class="controls">
                            <textarea name="post_data[message]" id="message" class="input-textarea-long" cols="70" rows="8" disabled="disabled"></textarea>
                        </div>
                    </div>
                <?php 
                }
                ?>
                <?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "discussion:add_post"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

            </div>

            <div class="buttons-container">
                <?php 
            echo $_smarty_tpl->getSubTemplate("buttons/save_cancel.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("add"), 'but_name' => "dispatch[discussion.add]", 'cancel_action' => "close", 'hide_first_button' => false), 0);
            ?>

            </div>

        </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 
            echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_new_post", 'text' => __("new_post"), 'content' => Smarty::$_smarty_vars['capture']['add_new_picker'], 'act' => "fake"), 0);
            ?>

<?php 
        }
    }
    function content_55e61f9c6d62a3_00485796($_smarty_tpl)
    {
        if (!is_callable('smarty_function_script')) {
            include '/var/www/html/market/app/functions/smarty_plugins/function.script.php';
        }
        if (!is_callable('smarty_block_hook')) {
            include '/var/www/html/market/app/functions/smarty_plugins/block.hook.php';
        }
        fn_preload_lang_vars(array('block_settings', 'block_settings', 'block', 'editing_tab', 'no_data', 'new_tab', 'add_tab', 'product_tabs'));
        echo smarty_function_script(array('src' => "js/tygh/tabs.js"), $_smarty_tpl);
        ?>


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

<?php 
        $_smarty_tpl->tpl_vars["r_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0);
        if (fn_check_view_permissions("tabs.update")) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["non_editable"] = new Smarty_variable(false, null, 0);
        } else {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["non_editable"] = new Smarty_variable(true, null, 0);
        }
        ?>
<div class="items-container <?php 
        if (!$_smarty_tpl->tpl_vars['dynamic_object']->value) {
            ?>
cm-sortable<?php 
        }
        ?>
" data-ca-sortable-table="product_tabs" data-ca-sortable-id-name="tab_id"  id="manage_tabs_list">

<table width="100%" class="table table-middle table-objects">
    <tbody>
<?php 
        $_smarty_tpl->tpl_vars["tab"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["tab"]->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['product_tabs']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["tab"]->key => $_smarty_tpl->tpl_vars["tab"]->value) {
            $_smarty_tpl->tpl_vars["tab"]->_loop = true;
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['tab']->value['is_primary'] == "Y" || $_smarty_tpl->tpl_vars['dynamic_object']->value || $_smarty_tpl->tpl_vars['non_editable']->value) {
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["_href_delete"] = new Smarty_variable('', null, 0);
                ?>
    <?php 
            } else {
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["_href_delete"] = new Smarty_variable("tabs.delete?tab_id=" . (string) $_smarty_tpl->tpl_vars['tab']->value['tab_id'], null, 0);
                ?>
    <?php 
            }
            ?>

    <?php 
            if ($_smarty_tpl->tpl_vars['dynamic_object']->value) {
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["dynamic_object_href"] = new Smarty_variable("&dynamic_object[object_type]=" . (string) $_smarty_tpl->tpl_vars['dynamic_object']->value['object_type'] . "&dynamic_object[object_id]=" . (string) $_smarty_tpl->tpl_vars['dynamic_object']->value['object_id'] . "&selected_location=" . (string) $_smarty_tpl->tpl_vars['location']->value['location_id'] . "&hide_status=1", null, 0);
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["r_url"] = new Smarty_variable(urlencode("products.update?product_id=" . (string) $_smarty_tpl->tpl_vars['dynamic_object']->value['object_id'] . "&selected_section=product_tabs"), null, 0);
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["additional_class"] = new Smarty_variable('', null, 0);
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["draggable"] = new Smarty_variable(false, null, 0);
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["_href_update"] = new Smarty_variable('', null, 0);
                ?>
    <?php 
            } else {
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["dynamic_object_href"] = new Smarty_variable('', null, 0);
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["r_url"] = new Smarty_variable("tabs.manage", null, 0);
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["additional_class"] = new Smarty_variable("cm-sortable-row cm-sortable-id-" . (string) $_smarty_tpl->tpl_vars['tab']->value['tab_id'], null, 0);
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["draggable"] = new Smarty_variable(true, null, 0);
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["_href_update"] = new Smarty_variable("tabs.update?tab_data[tab_id]=" . (string) $_smarty_tpl->tpl_vars['tab']->value['tab_id'] . "&return_url=" . (string) $_smarty_tpl->tpl_vars['r_url']->value, null, 0);
                ?>
    <?php 
            }
            ?>

    <?php 
            if ($_smarty_tpl->tpl_vars['tab']->value['product_ids']) {
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["confirm"] = new Smarty_variable(true, null, 0);
                ?>
    <?php 
            } else {
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["confirm"] = new Smarty_variable('', null, 0);
                ?>
    <?php 
            }
            ?>

    <?php 
            $_smarty_tpl->_capture_stack[0][] = array("tool_items", null, null);
            ob_start();
            if ($_smarty_tpl->tpl_vars['tab']->value['tab_type'] == "B") {
                ?>
<span class="small-note lowercase">(<?php 
                if ($_smarty_tpl->tpl_vars['tab']->value['block_id'] && $_smarty_tpl->tpl_vars['dynamic_object']->value) {
                    echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "edit_block_properties_" . (string) $_smarty_tpl->tpl_vars['tab']->value['block_id'] . "_tab_" . (string) $_smarty_tpl->tpl_vars['tab']->value['tab_id'], 'text' => __("block_settings"), 'link_text' => __("block_settings"), 'act' => "link", 'href' => "block_manager.update_block?block_data[block_id]=" . (string) $_smarty_tpl->tpl_vars['tab']->value['block_id'] . "&r_url=" . (string) $_smarty_tpl->tpl_vars['r_url']->value . "&html_id=tab_" . (string) $_smarty_tpl->tpl_vars['tab']->value['tab_id'] . (string) $_smarty_tpl->tpl_vars['dynamic_object_href']->value, 'action' => "block_manager.update_block", 'opener_ajax_class' => "cm-ajax", 'link_class' => "cm-ajax-force", 'content' => ''), 0);
                } else {
                    echo $_smarty_tpl->__("block");
                }
                ?>
)</span>
        <?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();
            }
            ?>
    <?php 
            ob_start();
            echo $_smarty_tpl->__("editing_tab");
            $_tmp1 = ob_get_clean();
            echo $_smarty_tpl->getSubTemplate("common/object_group.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => $_smarty_tpl->tpl_vars['tab']->value['tab_id'], 'text' => $_smarty_tpl->tpl_vars['tab']->value['name'], 'href' => $_smarty_tpl->tpl_vars['_href_update']->value, 'href_delete' => $_smarty_tpl->tpl_vars['_href_delete']->value, 'delete_target_id' => "pagination_contents", 'header_text' => $_tmp1 . ": " . (string) $_smarty_tpl->tpl_vars['tab']->value['name'], 'table' => "product_tabs", 'object_id_name' => "tab_id", 'draggable' => $_smarty_tpl->tpl_vars['draggable']->value, 'update_controller' => 'tabs', 'dynamic_object' => $_smarty_tpl->tpl_vars['dynamic_object_href']->value, 'status' => $_smarty_tpl->tpl_vars['tab']->value['status'], 'additional_class' => $_smarty_tpl->tpl_vars['additional_class']->value, 'href_desc' => Smarty::$_smarty_vars['capture']['tool_items'], 'non_editable' => $_smarty_tpl->tpl_vars['dynamic_object']->value, 'no_table' => true, 'can_change_status' => true), 0);
            ?>

<?php 
        }
        if (!$_smarty_tpl->tpl_vars["tab"]->_loop) {
            ?>

    <p class="no-items"><?php 
            echo $_smarty_tpl->__("no_data");
            ?>
</p>

<?php 
        }
        ?>
    </tbody>
</table>
<!--manage_tabs_list--></div>

<div class="buttons-container">
    <?php 
        $_smarty_tpl->_capture_stack[0][] = array("extra_tools", null, null);
        ob_start();
        ?>
        <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "currencies:import_rates"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "currencies:import_rates"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "currencies:import_rates"), $_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();
        }
        ?>
</div>

<?php 
        if (!$_smarty_tpl->tpl_vars['dynamic_object']->value) {
            ?>
    <?php 
            $_smarty_tpl->_capture_stack[0][] = array("adv_buttons", null, null);
            ob_start();
            ?>
        <?php 
            echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('act' => "general", 'id' => "add_tab", 'text' => __("new_tab"), 'title' => __("add_tab"), 'icon' => "icon-plus", 'href' => "tabs.update", 'action' => "tabs.update", 'opener_ajax_class' => "cm-ajax", 'link_class' => "cm-ajax-force", 'content' => ''), 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 
        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['dynamic_object']->value) {
            ?>
    <?php 
            echo $_smarty_tpl->getSubTemplate("common/mainbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("product_tabs"), 'content' => Smarty::$_smarty_vars['capture']['mainbox'], 'adv_buttons' => Smarty::$_smarty_vars['capture']['adv_buttons'], 'select_languages' => true), 0);
            ?>

<?php 
        } else {
            ?>
    <?php 
            echo Smarty::$_smarty_vars['capture']['mainbox'];
            ?>

<?php 
        }
        ?>

<?php 
    }
 /**
  * Forms menu section from settings list
  * @param  array $menu menu items
  * @return array modified menu items
  */
 private function _getSettingsSections($menu)
 {
     if (fn_check_view_permissions('settings.manage', 'GET')) {
         //Get navigation for Settings section
         $sections = Settings::instance()->getCoreSections();
         foreach ($menu as $position => $menu_data) {
             foreach ($menu_data as $menu_id => $items) {
                 foreach ($items['items'] as $item_id => $item) {
                     if (!empty($item['type']) && $item['type'] == 'setting' && !empty($sections[$item_id])) {
                         $menu[$position][$menu_id]['items'][$item_id]['title'] = $sections[$item_id]['title'];
                         $menu[$position][$menu_id]['items'][$item_id]['description'] = $sections[$item_id]['description'];
                     }
                 }
             }
         }
     }
     return $menu;
 }
                    function smarty_template_function_show_log_row($_smarty_tpl, $params)
                    {
                        $saved_tpl_vars = $_smarty_tpl->tpl_vars;
                        foreach ($_smarty_tpl->smarty->template_functions['show_log_row']['parameter'] as $key => $value) {
                            $_smarty_tpl->tpl_vars[$key] = new Smarty_variable($value);
                        }
                        foreach ($params as $key => $value) {
                            $_smarty_tpl->tpl_vars[$key] = new Smarty_variable($value);
                        }
                        ?>
                    <?php 
                        if ($_smarty_tpl->tpl_vars['item']->value) {
                            ?>
                        <div class="item">
                            <?php 
                            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "index:recent_activity"));
                            $_block_repeat = true;
                            echo smarty_block_hook(array('name' => "index:recent_activity"), null, $_smarty_tpl, $_block_repeat);
                            while ($_block_repeat) {
                                ob_start();
                                ?>

                                <?php 
                                $_smarty_tpl->tpl_vars['_type'] = new Smarty_variable("log_type_" . (string) $_smarty_tpl->tpl_vars['item']->value['type'], null, 0);
                                ?>
                                <?php 
                                $_smarty_tpl->tpl_vars['_action'] = new Smarty_variable("log_action_" . (string) $_smarty_tpl->tpl_vars['item']->value['action'], null, 0);
                                ?>

                                <?php 
                                echo $_smarty_tpl->__($_smarty_tpl->tpl_vars['_type']->value);
                                if ($_smarty_tpl->tpl_vars['item']->value['action']) {
                                    ?>
&nbsp;(<?php 
                                    echo $_smarty_tpl->__($_smarty_tpl->tpl_vars['_action']->value);
                                    ?>
)<?php 
                                }
                                ?>
:

                                <?php 
                                if ($_smarty_tpl->tpl_vars['item']->value['type'] == "users" && fn_check_view_permissions(fn_url("profiles.update?user_id=" . (string) $_smarty_tpl->tpl_vars['item']->value['content']['id']), "GET")) {
                                    ?>
                                    <?php 
                                    if ($_smarty_tpl->tpl_vars['item']->value['content']['id']) {
                                        ?>
<a href="<?php 
                                        echo htmlspecialchars(fn_url("profiles.update?user_id=" . (string) $_smarty_tpl->tpl_vars['item']->value['content']['id']), ENT_QUOTES, 'UTF-8');
                                        ?>
"><?php 
                                    }
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['content']['user'], ENT_QUOTES, 'UTF-8');
                                    if ($_smarty_tpl->tpl_vars['item']->value['content']['id']) {
                                        ?>
</a><?php 
                                    }
                                    ?>
<br>
                                    
                                <?php 
                                } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "orders" && fn_check_view_permissions(fn_url("orders.details?order_id=" . (string) $_smarty_tpl->tpl_vars['item']->value['content']['id']), "GET")) {
                                    ?>
                                    <?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['content']['status'], ENT_QUOTES, 'UTF-8');
                                    ?>
<br>
                                    <a href="<?php 
                                    echo htmlspecialchars(fn_url("orders.details?order_id=" . (string) $_smarty_tpl->tpl_vars['item']->value['content']['id']), ENT_QUOTES, 'UTF-8');
                                    ?>
"><?php 
                                    echo $_smarty_tpl->__("order");
                                    ?>
&nbsp;<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['content']['order'], ENT_QUOTES, 'UTF-8');
                                    ?>
</a><br>
                                <?php 
                                } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "products" && fn_check_view_permissions(fn_url("products.update?product_id=" . (string) $_smarty_tpl->tpl_vars['item']->value['content']['id']), "GET")) {
                                    ?>
                                    <a href="<?php 
                                    echo htmlspecialchars(fn_url("products.update?product_id=" . (string) $_smarty_tpl->tpl_vars['item']->value['content']['id']), ENT_QUOTES, 'UTF-8');
                                    ?>
"><?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['content']['product'], ENT_QUOTES, 'UTF-8');
                                    ?>
</a><br>

                                <?php 
                                } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "categories" && fn_check_view_permissions(fn_url("categories.update?category_id=" . (string) $_smarty_tpl->tpl_vars['item']->value['content']['id']), "GET")) {
                                    ?>
                                    <a href="<?php 
                                    echo htmlspecialchars(fn_url("categories.update?category_id=" . (string) $_smarty_tpl->tpl_vars['item']->value['content']['id']), ENT_QUOTES, 'UTF-8');
                                    ?>
"><?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['content']['category'], ENT_QUOTES, 'UTF-8');
                                    ?>
</a><br>                        
                                <?php 
                                }
                                ?>

                                <?php 
                                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "index:recent_activity_item"));
                                $_block_repeat = true;
                                echo smarty_block_hook(array('name' => "index:recent_activity_item"), null, $_smarty_tpl, $_block_repeat);
                                while ($_block_repeat) {
                                    ob_start();
                                    $_block_content = ob_get_clean();
                                    $_block_repeat = false;
                                    echo smarty_block_hook(array('name' => "index:recent_activity_item"), $_block_content, $_smarty_tpl, $_block_repeat);
                                }
                                array_pop($_smarty_tpl->smarty->_tag_stack);
                                ?>


                                <span class="date"><?php 
                                echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['item']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'] . ", " . (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format']), ENT_QUOTES, 'UTF-8');
                                ?>
</span>
                            <?php 
                                $_block_content = ob_get_clean();
                                $_block_repeat = false;
                                echo smarty_block_hook(array('name' => "index:recent_activity"), $_block_content, $_smarty_tpl, $_block_repeat);
                            }
                            array_pop($_smarty_tpl->smarty->_tag_stack);
                            ?>

                        </div>
                    <?php 
                        }
                        ?>
                <?php 
                        $_smarty_tpl->tpl_vars = $saved_tpl_vars;
                        foreach (Smarty::$global_tpl_vars as $key => $value) {
                            if (!isset($_smarty_tpl->tpl_vars[$key])) {
                                $_smarty_tpl->tpl_vars[$key] = $value;
                            }
                        }
                    }
    function content_55db8bdb361cd8_44258580($_smarty_tpl)
    {
        if (!is_callable('smarty_block_hook')) {
            include '/var/www/html/market/app/functions/smarty_plugins/block.hook.php';
        }
        if (!is_callable('smarty_modifier_truncate')) {
            include '/var/www/html/market/app/functions/smarty_plugins/modifier.truncate.php';
        }
        if (!is_callable('smarty_block_inline_script')) {
            include '/var/www/html/market/app/functions/smarty_plugins/block.inline_script.php';
        }
        fn_preload_lang_vars(array('all_vendors', 'view_storefront', 'storefront_url_not_defined', 'manage_stores', 'vendor', 'manage_stores', 'view_storefront', 'vendor', 'manage_vendors', 'signed_in_as', 'edit_profile', 'sign_out', 'feedback_values', 'send_feedback', 'search_tooltip', 'go'));
        if (defined("THEMES_PANEL")) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars['sticky_scroll'] = new Smarty_variable(5, null, 0);
            ?>
    <?php 
            $_smarty_tpl->tpl_vars['sticky_padding'] = new Smarty_variable(36, null, 0);
        } else {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars['sticky_scroll'] = new Smarty_variable(41, null, 0);
            ?>
    <?php 
            $_smarty_tpl->tpl_vars['sticky_padding'] = new Smarty_variable(0, null, 0);
        }
        ?>

<?php 
        if (!function_exists('smarty_template_function_menu_attrs')) {
            function smarty_template_function_menu_attrs($_smarty_tpl, $params)
            {
                $saved_tpl_vars = $_smarty_tpl->tpl_vars;
                foreach ($_smarty_tpl->smarty->template_functions['menu_attrs']['parameter'] as $key => $value) {
                    $_smarty_tpl->tpl_vars[$key] = new Smarty_variable($value);
                }
                foreach ($params as $key => $value) {
                    $_smarty_tpl->tpl_vars[$key] = new Smarty_variable($value);
                }
                ?>
    <?php 
                $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['value']->_loop = false;
                $_smarty_tpl->tpl_vars['attr'] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['attrs']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
                    $_smarty_tpl->tpl_vars['value']->_loop = true;
                    $_smarty_tpl->tpl_vars['attr']->value = $_smarty_tpl->tpl_vars['value']->key;
                    ?>
        <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['attr']->value, ENT_QUOTES, 'UTF-8');
                    ?>
="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['value']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" 
    <?php 
                }
                $_smarty_tpl->tpl_vars = $saved_tpl_vars;
                foreach (Smarty::$global_tpl_vars as $key => $value) {
                    if (!isset($_smarty_tpl->tpl_vars[$key])) {
                        $_smarty_tpl->tpl_vars[$key] = $value;
                    }
                }
            }
        }
        ?>

<div class="navbar-admin-top">
    <!--Navbar-->
    <div class="navbar navbar-inverse" id="header_navbar">
        <div class="navbar-inner">

        <?php 
        if ($_smarty_tpl->tpl_vars['runtime']->value['company_data']['company']) {
            ?>
            <?php 
            $_smarty_tpl->tpl_vars['name'] = new Smarty_variable($_smarty_tpl->tpl_vars['runtime']->value['company_data']['company'], null, 0);
            ?>
        <?php 
        } else {
            ?>
            <?php 
            $_smarty_tpl->tpl_vars['name'] = new Smarty_variable($_smarty_tpl->tpl_vars['settings']->value['Company']['company_name'], null, 0);
            ?>
        <?php 
        }
        ?>

        <?php 
        if (fn_allowed_for("ULTIMATE")) {
            ?>
            <div class="nav-ult">
                <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "menu:storefront_icon"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "menu:storefront_icon"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

                <?php 
                if (!$_smarty_tpl->tpl_vars['runtime']->value['company_data']['company_id']) {
                    ?>
                    <?php 
                    $_smarty_tpl->tpl_vars["name"] = new Smarty_variable($_smarty_tpl->__("all_vendors"), null, 0);
                    ?>
                <?php 
                }
                ?>
                <li class="nav-company">
                <?php 
                if ($_smarty_tpl->tpl_vars['runtime']->value['company_data']['storefront']) {
                    ?>
                    <a href="<?php 
                    echo htmlspecialchars(fn_url("?company_id=" . (string) $_smarty_tpl->tpl_vars['runtime']->value['company_data']['company_id'], "C"), ENT_QUOTES, 'UTF-8');
                    ?>
" target="_blank" class="brand" title="<?php 
                    echo $_smarty_tpl->__("view_storefront");
                    ?>
">
                        <i class="icon-shopping-cart icon-white"></i>
                    </a>
                <?php 
                } else {
                    ?>
                    <a class="brand" title="<?php 
                    echo $_smarty_tpl->__("storefront_url_not_defined");
                    ?>
"><i class="icon-shopping-cart icon-white cm-tooltip"></i></a>
                <?php 
                }
                ?>
                </li>
                <?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "menu:storefront_icon"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

                <?php 
            if ($_smarty_tpl->tpl_vars['runtime']->value['companies_available_count'] > 1) {
                ?>
                    <ul class="nav">
                    <?php 
                $_smarty_tpl->_capture_stack[0][] = array("extra_content", null, null);
                ob_start();
                ?>
                        <?php 
                if (fn_check_view_permissions("companies.manage", "GET")) {
                    ?>
                            <li class="divider"></li>
                            <li><a href="<?php 
                    echo htmlspecialchars(fn_url("companies.manage?switch_company_id=0"), ENT_QUOTES, 'UTF-8');
                    ?>
"><?php 
                    echo $_smarty_tpl->__("manage_stores");
                    ?>
...</a></li>
                        <?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();
                }
                ?>

                    <?php 
                echo $_smarty_tpl->getSubTemplate("common/ajax_select_object.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('data_url' => "companies.get_companies_list?show_all=Y&action=href", 'text' => $_smarty_tpl->tpl_vars['name']->value, 'id' => "top_company_id", 'type' => "list", 'extra_content' => Smarty::$_smarty_vars['capture']['extra_content']), 0);
                ?>


                    </ul>
                <?php 
            } else {
                ?>
                    <ul class="nav">
                        <?php 
                if ($_smarty_tpl->tpl_vars['auth']->value['company_id']) {
                    ?>
                            <li class="dropdown">
                                <a href="<?php 
                    echo htmlspecialchars(fn_url("companies.update?company_id=" . (string) $_smarty_tpl->tpl_vars['runtime']->value['company_id']), ENT_QUOTES, 'UTF-8');
                    ?>
"><?php 
                    echo $_smarty_tpl->__("vendor");
                    ?>
: <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['runtime']->value['company_data']['company'], ENT_QUOTES, 'UTF-8');
                    ?>
</a>
                            </li>
                        <?php 
                } else {
                    ?>
                            <?php 
                    if (fn_check_view_permissions("companies.manage", "GET")) {
                        ?>
                                <li class="dropdown vendor-submenu">
                                    <a class=" dropdown-toggle" data-toggle="dropdown">
                                        <span><?php 
                        echo htmlspecialchars(smarty_modifier_truncate($_smarty_tpl->tpl_vars['name']->value, 60, "...", true), ENT_QUOTES, 'UTF-8');
                        ?>
</span><b class="caret"></b>
                                    </a>
                                    <ul class="dropdown-menu" id="top_company_id_ajax_select_object">
                                        <li><a href="<?php 
                        echo htmlspecialchars(fn_url("companies.manage?switch_company_id=0"), ENT_QUOTES, 'UTF-8');
                        ?>
"><?php 
                        echo $_smarty_tpl->__("manage_stores");
                        ?>
...</a></li>
                                    </ul>
                                </li>
                            <?php 
                    }
                    ?>
                        <?php 
                }
                ?>
                    </ul>
                <?php 
            }
            ?>
            </div>
        <?php 
        }
        ?>

        <?php 
        if (fn_allowed_for("MULTIVENDOR") && !$_smarty_tpl->tpl_vars['runtime']->value['simple_ultimate']) {
            ?>
            <ul class="nav">
                <li class="nav-company">
                    <a href="<?php 
            echo htmlspecialchars(htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['config']->value['http_location']), ENT_QUOTES, 'UTF-8', true), ENT_QUOTES, 'UTF-8');
            ?>
" target="_blank" class="brand" title="<?php 
            echo $_smarty_tpl->__("view_storefront");
            ?>
">
                        <i class="icon-shopping-cart icon-white"></i>
                    </a>
                    <a href="<?php 
            echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
            ?>
" class="brand"><?php 
            echo htmlspecialchars(smarty_modifier_truncate($_smarty_tpl->tpl_vars['settings']->value['Company']['company_name'], 60, "...", true), ENT_QUOTES, 'UTF-8');
            ?>
</a>
                    <?php 
            if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['live_editor']) {
                ?>
                        <?php 
                $_smarty_tpl->tpl_vars["company_name"] = new Smarty_variable($_smarty_tpl->tpl_vars['runtime']->value['company_data']['company'], null, 0);
                ?>
                    <?php 
            } else {
                ?>
                        <?php 
                $_smarty_tpl->tpl_vars["company_name"] = new Smarty_variable(smarty_modifier_truncate($_smarty_tpl->tpl_vars['runtime']->value['company_data']['company'], 43, "...", true), null, 0);
                ?>
                    <?php 
            }
            ?>
                </li>
                <?php 
            if ($_smarty_tpl->tpl_vars['auth']->value['company_id']) {
                ?>
                    <li class="dropdown">
                        <a href="<?php 
                echo htmlspecialchars(fn_url("companies.update?company_id=" . (string) $_smarty_tpl->tpl_vars['runtime']->value['company_id']), ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo $_smarty_tpl->__("vendor");
                ?>
: <?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['runtime']->value['company_data']['company'], ENT_QUOTES, 'UTF-8');
                ?>
</a>
                    </li>
                <?php 
            } else {
                ?>
                    <?php 
                if (fn_check_view_permissions("companies.get_companies_list", "GET")) {
                    ?>
                        <?php 
                    $_smarty_tpl->_capture_stack[0][] = array("extra_content", null, null);
                    ob_start();
                    ?>
                            <li class="divider"></li>
                            <li><a href="<?php 
                    echo htmlspecialchars(fn_url("companies.manage?switch_company_id=0"), ENT_QUOTES, 'UTF-8');
                    ?>
"><?php 
                    echo $_smarty_tpl->__("manage_vendors");
                    ?>
...</a></li>
                        <?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 
                    echo $_smarty_tpl->getSubTemplate("common/ajax_select_object.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('data_url' => "companies.get_companies_list?show_all=Y&action=href", 'text' => $_smarty_tpl->tpl_vars['company_name']->value, 'id' => "top_company_id", 'type' => "list", 'extra_content' => Smarty::$_smarty_vars['capture']['extra_content']), 0);
                    ?>

                    <?php 
                } else {
                    ?>
                        <li class="dropdown">
                            <a class="unedited-element"><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['company_name']->value, ENT_QUOTES, 'UTF-8');
                    ?>
</a>
                        </li>
                    <?php 
                }
                ?>
                <?php 
            }
            ?>
            </ul>
        <?php 
        }
        ?>
            <ul class="nav hover-show navbar-right">
            <?php 
        if ($_smarty_tpl->tpl_vars['auth']->value['user_id'] && $_smarty_tpl->tpl_vars['navigation']->value['static']) {
            ?>

                <?php 
            $_smarty_tpl->tpl_vars['m'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['m']->_loop = false;
            $_smarty_tpl->tpl_vars['first_level_title'] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['navigation']->value['static']['top'];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['m']->key => $_smarty_tpl->tpl_vars['m']->value) {
                $_smarty_tpl->tpl_vars['m']->_loop = true;
                $_smarty_tpl->tpl_vars['first_level_title']->value = $_smarty_tpl->tpl_vars['m']->key;
                ?>
                    <li class="dropdown dropdown-top-menu-item<?php 
                if ($_smarty_tpl->tpl_vars['first_level_title']->value == $_smarty_tpl->tpl_vars['navigation']->value['selected_tab']) {
                    ?>
 active<?php 
                }
                ?>
">
                        <a id="elm_menu_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['first_level_title']->value, ENT_QUOTES, 'UTF-8');
                ?>
" href="#" class="dropdown-toggle <?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['first_level_title']->value, ENT_QUOTES, 'UTF-8');
                ?>
" data-toggle="dropdown">
                            <?php 
                echo $_smarty_tpl->__($_smarty_tpl->tpl_vars['first_level_title']->value);
                ?>

                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <?php 
                $_smarty_tpl->tpl_vars["second_level"] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars["second_level"]->_loop = false;
                $_smarty_tpl->tpl_vars['second_level_title'] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['m']->value['items'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars["second_level"]->key => $_smarty_tpl->tpl_vars["second_level"]->value) {
                    $_smarty_tpl->tpl_vars["second_level"]->_loop = true;
                    $_smarty_tpl->tpl_vars['second_level_title']->value = $_smarty_tpl->tpl_vars["second_level"]->key;
                    ?>
                                <li class="<?php 
                    if ($_smarty_tpl->tpl_vars['second_level']->value['subitems']) {
                        ?>
dropdown-submenu<?php 
                    }
                    if ($_smarty_tpl->tpl_vars['second_level_title']->value == $_smarty_tpl->tpl_vars['navigation']->value['subsection']) {
                        ?>
 active<?php 
                    }
                    ?>
 <?php 
                    if ($_smarty_tpl->tpl_vars['second_level']->value['is_promo']) {
                        ?>
cm-promo-popup<?php 
                    }
                    ?>
 <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['second_level']->value['attrs']['class'], ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    smarty_template_function_menu_attrs($_smarty_tpl, array('attrs' => $_smarty_tpl->tpl_vars['second_level']->value['attrs']['main']));
                    ?>
>
                                    <?php 
                    if ($_smarty_tpl->tpl_vars['second_level']->value['type'] == "title") {
                        ?>
                                        <a id="elm_menu_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['first_level_title']->value, ENT_QUOTES, 'UTF-8');
                        ?>
_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['second_level_title']->value, ENT_QUOTES, 'UTF-8');
                        ?>
" <?php 
                        if ($_smarty_tpl->tpl_vars['second_level']->value['attrs']['class_href']) {
                            ?>
class="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['second_level']->value['attrs']['class_href'], ENT_QUOTES, 'UTF-8');
                            ?>
"<?php 
                        }
                        ?>
 <?php 
                        smarty_template_function_menu_attrs($_smarty_tpl, array('attrs' => $_smarty_tpl->tpl_vars['second_level']->value['attrs']['href']));
                        ?>
><?php 
                        echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['second_level']->value['title']) === null || $tmp === '' ? $_smarty_tpl->__($_smarty_tpl->tpl_vars['second_level_title']->value) : $tmp, ENT_QUOTES, 'UTF-8');
                        ?>
</a>
                                    <?php 
                    } elseif ($_smarty_tpl->tpl_vars['second_level']->value['type'] != "divider") {
                        ?>
                                        <a id="elm_menu_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['first_level_title']->value, ENT_QUOTES, 'UTF-8');
                        ?>
_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['second_level_title']->value, ENT_QUOTES, 'UTF-8');
                        ?>
" <?php 
                        if ($_smarty_tpl->tpl_vars['second_level']->value['attrs']['class_href']) {
                            ?>
class="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['second_level']->value['attrs']['class_href'], ENT_QUOTES, 'UTF-8');
                            ?>
"<?php 
                        }
                        ?>
 href="<?php 
                        echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['second_level']->value['href']), ENT_QUOTES, 'UTF-8');
                        ?>
" <?php 
                        smarty_template_function_menu_attrs($_smarty_tpl, array('attrs' => $_smarty_tpl->tpl_vars['second_level']->value['attrs']['href']));
                        ?>
><?php 
                        echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['second_level']->value['title']) === null || $tmp === '' ? $_smarty_tpl->__($_smarty_tpl->tpl_vars['second_level_title']->value) : $tmp, ENT_QUOTES, 'UTF-8');
                        ?>
</a>
                                    <?php 
                    }
                    ?>
                                    <?php 
                    if ($_smarty_tpl->tpl_vars['second_level']->value['subitems']) {
                        ?>
                                        <ul class="dropdown-menu">
                                            <?php 
                        $_smarty_tpl->tpl_vars['sm'] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars['sm']->_loop = false;
                        $_smarty_tpl->tpl_vars['subitem_title'] = new Smarty_Variable();
                        $_from = $_smarty_tpl->tpl_vars['second_level']->value['subitems'];
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars['sm']->key => $_smarty_tpl->tpl_vars['sm']->value) {
                            $_smarty_tpl->tpl_vars['sm']->_loop = true;
                            $_smarty_tpl->tpl_vars['subitem_title']->value = $_smarty_tpl->tpl_vars['sm']->key;
                            ?>
                                                <li class="<?php 
                            if ($_smarty_tpl->tpl_vars['sm']->value['active']) {
                                ?>
active<?php 
                            }
                            ?>
 <?php 
                            if ($_smarty_tpl->tpl_vars['sm']->value['is_promo']) {
                                ?>
cm-promo-popup<?php 
                            }
                            ?>
 <?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['second_level']->value['attrs']['class'], ENT_QUOTES, 'UTF-8');
                            ?>
" <?php 
                            smarty_template_function_menu_attrs($_smarty_tpl, array('attrs' => $_smarty_tpl->tpl_vars['sm']->value['attrs']['main']));
                            ?>
>
                                                    <?php 
                            if ($_smarty_tpl->tpl_vars['sm']->value['type'] == "title") {
                                ?>
                                                        <?php 
                                echo $_smarty_tpl->__($_smarty_tpl->tpl_vars['subitem_title']->value);
                                ?>

                                                    <?php 
                            } elseif ($_smarty_tpl->tpl_vars['sm']->value['type'] != "divider") {
                                ?>
                                                        <a id="elm_menu_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['first_level_title']->value, ENT_QUOTES, 'UTF-8');
                                ?>
_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['second_level_title']->value, ENT_QUOTES, 'UTF-8');
                                ?>
_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['subitem_title']->value, ENT_QUOTES, 'UTF-8');
                                ?>
" href="<?php 
                                echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['sm']->value['href']), ENT_QUOTES, 'UTF-8');
                                ?>
" <?php 
                                smarty_template_function_menu_attrs($_smarty_tpl, array('attrs' => $_smarty_tpl->tpl_vars['sm']->value['attrs']['href']));
                                ?>
><?php 
                                echo $_smarty_tpl->__($_smarty_tpl->tpl_vars['subitem_title']->value);
                                ?>
</a>
                                                    <?php 
                            }
                            ?>
                                                </li>
                                                <?php 
                            if ($_smarty_tpl->tpl_vars['sm']->value['type'] == "divider") {
                                ?>
                                                    <li class="divider"></li>
                                                <?php 
                            }
                            ?>
                                            <?php 
                        }
                        ?>
                                        </ul>
                                    <?php 
                    }
                    ?>
                                </li>
                                <?php 
                    if ($_smarty_tpl->tpl_vars['second_level']->value['type'] == "divider") {
                        ?>
                                    <li class="divider"></li>
                                <?php 
                    }
                    ?>
                            <?php 
                }
                ?>
                        </ul>
                    </li>
                <?php 
            }
            ?>
            <?php 
        }
        ?>
                <!-- end navbar-->

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

                <?php 
            if (sizeof($_smarty_tpl->tpl_vars['languages']->value) > 1 || sizeof($_smarty_tpl->tpl_vars['currencies']->value) > 1) {
                ?>
                    <li class="divider-vertical"></li>
                <?php 
            }
            ?>

                <!--language-->
                <?php 
            if (!fn_allowed_for("ULTIMATE:FREE")) {
                ?>
                    <?php 
                if (sizeof($_smarty_tpl->tpl_vars['languages']->value) > 1) {
                    ?>
                        <?php 
                    echo $_smarty_tpl->getSubTemplate("common/select_object.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('style' => "dropdown", 'link_tpl' => fn_link_attach($_smarty_tpl->tpl_vars['config']->value['current_url'], "sl="), 'items' => $_smarty_tpl->tpl_vars['languages']->value, 'selected_id' => @constant('CART_LANGUAGE'), 'display_icons' => true, 'key_name' => "name", 'key_selected' => "lang_code", 'class' => "languages"), 0);
                    ?>

                    <?php 
                }
                ?>
                <?php 
            }
            ?>
                <!--end language-->

                <!--Curriencies-->
                <?php 
            if (sizeof($_smarty_tpl->tpl_vars['currencies']->value) > 1) {
                ?>
                <?php 
                echo $_smarty_tpl->getSubTemplate("common/select_object.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('style' => "dropdown", 'link_tpl' => fn_link_attach($_smarty_tpl->tpl_vars['config']->value['current_url'], "currency="), 'items' => $_smarty_tpl->tpl_vars['currencies']->value, 'selected_id' => $_smarty_tpl->tpl_vars['secondary_currency']->value, 'display_icons' => false, 'key_name' => "description", 'key_selected' => "currency_code"), 0);
                ?>

                <?php 
            }
            ?>
                <!--end curriencies-->

                <li class="divider-vertical"></li>

                <!-- user menu -->
                <li class="dropdown dropdown-top-menu-item">
                    <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "index:top_links"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "index:top_links"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

                        <a class="dropdown-toggle" data-toggle="dropdown">
                            <i class="icon-white icon-user"></i>
                            <b class="caret"></b>
                        </a>
                    <?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "index:top_links"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

                    <ul class="dropdown-menu pull-right">
                        <li class="disabled">
                            <a><strong><?php 
            echo $_smarty_tpl->__("signed_in_as");
            ?>
</strong><br><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['user_info']->value['email'], ENT_QUOTES, 'UTF-8');
            ?>
</a>
                        </li>
                        <li class="divider"></li>
                        <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "menu:profile"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "menu:profile"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

                        <li><a href="<?php 
                echo htmlspecialchars(fn_url("profiles.update?user_id=" . (string) $_smarty_tpl->tpl_vars['auth']->value['user_id']), ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo $_smarty_tpl->__("edit_profile");
                ?>
</a></li>
                        <li><a href="<?php 
                echo htmlspecialchars(fn_url("auth.logout"), ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo $_smarty_tpl->__("sign_out");
                ?>
</a></li>
                        <?php 
                if (!$_smarty_tpl->tpl_vars['runtime']->value['company_id']) {
                    ?>
                            <li class="divider"></li>
                            <li>
                                <?php 
                    echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "group" . (string) $_smarty_tpl->tpl_vars['id_prefix']->value . "feedback", 'edit_onclick' => $_smarty_tpl->tpl_vars['onclick']->value, 'text' => __("feedback_values"), 'act' => "link", 'picker_meta' => "cm-clear-content", 'link_text' => __("send_feedback", array("[product]" => @constant('PRODUCT_NAME'))), 'content' => Smarty::$_smarty_vars['capture']['update_block'], 'href' => "feedback.prepare", 'no_icon_link' => true, 'but_name' => "dispatch[feedback.send]", 'opener_ajax_class' => "cm-ajax"), 0);
                    ?>

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

                    </ul>
                </li>
                <!--end user menu -->
            <?php 
        }
        ?>
            </ul>

        </div>
    <!--header_navbar--></div>

    <!--Subnav-->
    <div class="subnav cm-sticky-scroll" data-ce-top="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['sticky_scroll']->value, ENT_QUOTES, 'UTF-8');
        ?>
" data-ce-padding="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['sticky_padding']->value, ENT_QUOTES, 'UTF-8');
        ?>
" id="header_subnav">
        <!--quick search-->
        <div class="search pull-right">
            <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "index:global_search"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "index:global_search"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

                <form id="global_search" method="get" action="<?php 
            echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
            ?>
">
                    <input type="hidden" name="dispatch" value="search.results" />
                    <input type="hidden" name="compact" value="Y" />
                    <button class="icon-search cm-tooltip " type="submit" title="<?php 
            echo $_smarty_tpl->__("search_tooltip");
            ?>
" id="search_button"><?php 
            echo $_smarty_tpl->__("go");
            ?>
</button>
                    <label for="gs_text"><input type="text" class="cm-autocomplete-off" id="gs_text" name="q" value="<?php 
            echo htmlspecialchars($_REQUEST['q'], ENT_QUOTES, 'UTF-8');
            ?>
" /></label>
                </form>
            <?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "index:global_search"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>


        </div>
        <!--end quick search-->

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

        <!-- end quick menu -->

        <ul class="nav hover-show nav-pills">
            <li><a href="<?php 
        echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
        ?>
" class="home"><i class="icon-home"></i></a></li>
        <?php 
        if ($_smarty_tpl->tpl_vars['auth']->value['user_id'] && $_smarty_tpl->tpl_vars['navigation']->value['static']) {
            ?>
            <?php 
            $_smarty_tpl->tpl_vars['m'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['m']->_loop = false;
            $_smarty_tpl->tpl_vars['first_level_title'] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['navigation']->value['static']['central'];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['m']->key => $_smarty_tpl->tpl_vars['m']->value) {
                $_smarty_tpl->tpl_vars['m']->_loop = true;
                $_smarty_tpl->tpl_vars['first_level_title']->value = $_smarty_tpl->tpl_vars['m']->key;
                ?>
                <li class="dropdown <?php 
                if ($_smarty_tpl->tpl_vars['first_level_title']->value == $_smarty_tpl->tpl_vars['navigation']->value['selected_tab']) {
                    ?>
 active<?php 
                }
                ?>
 ">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" >
                        <?php 
                echo $_smarty_tpl->__($_smarty_tpl->tpl_vars['first_level_title']->value);
                ?>

                        <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                        <?php 
                $_smarty_tpl->tpl_vars["second_level"] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars["second_level"]->_loop = false;
                $_smarty_tpl->tpl_vars['second_level_title'] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['m']->value['items'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars["second_level"]->key => $_smarty_tpl->tpl_vars["second_level"]->value) {
                    $_smarty_tpl->tpl_vars["second_level"]->_loop = true;
                    $_smarty_tpl->tpl_vars['second_level_title']->value = $_smarty_tpl->tpl_vars["second_level"]->key;
                    ?>
                            <li class="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['second_level_title']->value, ENT_QUOTES, 'UTF-8');
                    if ($_smarty_tpl->tpl_vars['second_level']->value['subitems']) {
                        ?>
 dropdown-submenu<?php 
                    }
                    if ($_smarty_tpl->tpl_vars['second_level_title']->value == $_smarty_tpl->tpl_vars['navigation']->value['subsection'] && $_smarty_tpl->tpl_vars['first_level_title']->value == $_smarty_tpl->tpl_vars['navigation']->value['selected_tab']) {
                        ?>
 active<?php 
                    }
                    ?>
" <?php 
                    smarty_template_function_menu_attrs($_smarty_tpl, array('attrs' => $_smarty_tpl->tpl_vars['second_level']->value['attrs']['main']));
                    ?>
><a class="<?php 
                    if ($_smarty_tpl->tpl_vars['second_level']->value['is_promo']) {
                        ?>
cm-promo-popup<?php 
                    }
                    ?>
 <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['second_level']->value['attrs']['class'], ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if (!$_smarty_tpl->tpl_vars['second_level']->value['is_promo']) {
                        ?>
href="<?php 
                        echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['second_level']->value['href']), ENT_QUOTES, 'UTF-8');
                        ?>
"<?php 
                    }
                    ?>
 <?php 
                    smarty_template_function_menu_attrs($_smarty_tpl, array('attrs' => $_smarty_tpl->tpl_vars['second_level']->value['attrs']['href']));
                    ?>
>
                                <span><?php 
                    echo $_smarty_tpl->__($_smarty_tpl->tpl_vars['second_level_title']->value);
                    if ($_smarty_tpl->tpl_vars['second_level']->value['attrs']['class'] == 'is-addon') {
                        ?>
<i class="icon-is-addon"></i><?php 
                    }
                    ?>
</span>
                                <?php 
                    if ($_smarty_tpl->__($_smarty_tpl->tpl_vars['second_level']->value['description']) != "_" . (string) $_smarty_tpl->tpl_vars['second_level_title']->value . "_menu_description") {
                        if ($_smarty_tpl->tpl_vars['settings']->value['Appearance']['show_menu_descriptions'] == "Y") {
                            ?>
<span class="hint"><?php 
                            echo $_smarty_tpl->__($_smarty_tpl->tpl_vars['second_level']->value['description']);
                            ?>
</span><?php 
                        }
                    }
                    ?>
</a>

                                <?php 
                    if ($_smarty_tpl->tpl_vars['second_level']->value['subitems']) {
                        ?>
                                    <ul class="dropdown-menu">
                                        <?php 
                        $_smarty_tpl->tpl_vars['sm'] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars['sm']->_loop = false;
                        $_smarty_tpl->tpl_vars['subitem_title'] = new Smarty_Variable();
                        $_from = $_smarty_tpl->tpl_vars['second_level']->value['subitems'];
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars['sm']->key => $_smarty_tpl->tpl_vars['sm']->value) {
                            $_smarty_tpl->tpl_vars['sm']->_loop = true;
                            $_smarty_tpl->tpl_vars['subitem_title']->value = $_smarty_tpl->tpl_vars['sm']->key;
                            ?>
                                            <li class="<?php 
                            if ($_smarty_tpl->tpl_vars['sm']->value['active']) {
                                ?>
active<?php 
                            }
                            ?>
 <?php 
                            if ($_smarty_tpl->tpl_vars['sm']->value['is_promo']) {
                                ?>
cm-promo-popup<?php 
                            }
                            ?>
 <?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['second_level']->value['attrs']['class'], ENT_QUOTES, 'UTF-8');
                            ?>
" <?php 
                            smarty_template_function_menu_attrs($_smarty_tpl, array('attrs' => $_smarty_tpl->tpl_vars['sm']->value['attrs']['main']));
                            ?>
><a href="<?php 
                            echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['sm']->value['href']), ENT_QUOTES, 'UTF-8');
                            ?>
" <?php 
                            smarty_template_function_menu_attrs($_smarty_tpl, array('attrs' => $_smarty_tpl->tpl_vars['sm']->value['attrs']['href']));
                            ?>
><?php 
                            echo $_smarty_tpl->__($_smarty_tpl->tpl_vars['subitem_title']->value);
                            ?>
</a></li>
                                        <?php 
                        }
                        ?>
                                    </ul>
                                <?php 
                    }
                    ?>
                            </li>
                        <?php 
                }
                ?>
                    </ul>
                </li>
            <?php 
            }
            ?>
        <?php 
        }
        ?>
        </ul>
    <!--header_subnav--></div>
</div>

<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('inline_script', array());
        $_block_repeat = true;
        echo smarty_block_inline_script(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            echo '<script';
            ?>
 type="text/javascript">
    (function(_, $) {
        $('.navbar-right li').hover(function() {
            var pagePosition = $(".admin-content").offset();
            var adminContentWidth = 1240;

            if($(this).hasClass('dropdown-submenu')) {
                var elmPosition = $(this).find('.dropdown-menu').offset().left + $(this).find('.dropdown-menu').width();
                if((elmPosition - pagePosition.left) > adminContentWidth) {
                    $(this).find('.dropdown-menu').addClass('dropdown-menu-to-right');
                }
            }
        }, function() {
            $(this).find('.dropdown-menu').removeClass('dropdown-menu-to-right');
        });
    }(Tygh, Tygh.$));
<?php 
            echo '</script';
            ?>
><?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_inline_script(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>

<?php 
    }
    function content_55db8bf940d335_37587061($_smarty_tpl)
    {
        if ($_smarty_tpl->tpl_vars['but_role']->value == "text") {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["class"] = new Smarty_variable('', null, 0);
            ?>
    <?php 
        } else {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["class"] = new Smarty_variable("btn", null, 0);
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['but_name']->value) {
            $_smarty_tpl->tpl_vars["r"] = new Smarty_variable($_smarty_tpl->tpl_vars['but_name']->value, null, 0);
        } else {
            $_smarty_tpl->tpl_vars["r"] = new Smarty_variable($_smarty_tpl->tpl_vars['but_href']->value, null, 0);
        }
        $_smarty_tpl->tpl_vars["method"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['method']->value) === null || $tmp === '' ? "POST" : $tmp, null, 0);
        if (fn_check_view_permissions($_smarty_tpl->tpl_vars['r']->value, $_smarty_tpl->tpl_vars['method']->value)) {
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['but_group']->value) {
                ?>
<div class="btn-group"><?php 
            }
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['but_role']->value == "submit" || $_smarty_tpl->tpl_vars['but_role']->value == "button_main" || $_smarty_tpl->tpl_vars['but_type']->value || $_smarty_tpl->tpl_vars['but_role']->value == "big") {
                ?>
 
    <input <?php 
                if ($_smarty_tpl->tpl_vars['but_id']->value) {
                    ?>
id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 class="btn <?php 
                if ($_smarty_tpl->tpl_vars['but_meta']->value) {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_meta']->value, ENT_QUOTES, 'UTF-8');
                } else {
                    ?>
 btn-primary<?php 
                }
                ?>
" type="<?php 
                echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['but_type']->value) === null || $tmp === '' ? "submit" : $tmp, ENT_QUOTES, 'UTF-8');
                ?>
"<?php 
                if ($_smarty_tpl->tpl_vars['but_name']->value) {
                    ?>
 name="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_name']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_onclick']->value) {
                    ?>
 onclick="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_onclick']->value, ENT_QUOTES, 'UTF-8');
                    ?>
;<?php 
                    if (!$_smarty_tpl->tpl_vars['allow_href']->value) {
                        ?>
 return false;<?php 
                    }
                    ?>
"<?php 
                }
                ?>
 value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['but_text']->value, ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['tabindex']->value) {
                    ?>
tabindex="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['tabindex']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_external_click_id']->value) {
                    ?>
 data-ca-external-click-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_external_click_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target_form']->value) {
                    ?>
 data-ca-target-form="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_form']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target_id']->value) {
                    ?>
 data-ca-target-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_check_filter']->value) {
                    ?>
 data-ca-check-filter="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_check_filter']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_disabled']->value) {
                    ?>
disabled="disabled"<?php 
                }
                ?>
  />

<?php 
            } elseif ($_smarty_tpl->tpl_vars['but_role']->value && $_smarty_tpl->tpl_vars['but_role']->value != "submit" && $_smarty_tpl->tpl_vars['but_role']->value != "action" && $_smarty_tpl->tpl_vars['but_role']->value != "submit-link" && $_smarty_tpl->tpl_vars['but_role']->value != "advanced-search" && $_smarty_tpl->tpl_vars['but_role']->value != "button" && $_smarty_tpl->tpl_vars['but_role']->value != "submit-button") {
                ?>
 
    <a <?php 
                if ($_smarty_tpl->tpl_vars['but_id']->value) {
                    ?>
id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_href']->value) {
                    ?>
 href="<?php 
                    echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['but_href']->value), ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_onclick']->value) {
                    ?>
 onclick="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_onclick']->value, ENT_QUOTES, 'UTF-8');
                    ?>
;<?php 
                    if (!$_smarty_tpl->tpl_vars['allow_href']->value) {
                        ?>
 return false;<?php 
                    }
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target']->value) {
                    ?>
 target="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_external_click_id']->value) {
                    ?>
 data-ca-external-click-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_external_click_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target_form']->value) {
                    ?>
 data-ca-target-form="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_form']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target_id']->value) {
                    ?>
 data-ca-target-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 class="<?php 
                if ($_smarty_tpl->tpl_vars['but_meta']->value) {
                    ?>
 <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_meta']->value, ENT_QUOTES, 'UTF-8');
                }
                ?>
"<?php 
                if ($_smarty_tpl->tpl_vars['title']->value) {
                    ?>
 title="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['title']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
><?php 
                if ($_smarty_tpl->tpl_vars['but_icon']->value) {
                    ?>
<i class="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_icon']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"></i><?php 
                }
                ?>
 <?php 
                echo $_smarty_tpl->tpl_vars['but_text']->value;
                ?>
</a>

<?php 
            } elseif ($_smarty_tpl->tpl_vars['but_role']->value == "action" || $_smarty_tpl->tpl_vars['but_role']->value == "advanced-search" || $_smarty_tpl->tpl_vars['but_role']->value == "submit-link") {
                ?>
 
    <a <?php 
                if ($_smarty_tpl->tpl_vars['but_id']->value) {
                    ?>
id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_href']->value) {
                    ?>
 href="<?php 
                    echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['but_href']->value), ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_onclick']->value) {
                    ?>
onclick="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_onclick']->value, ENT_QUOTES, 'UTF-8');
                    ?>
;<?php 
                    if (!$_smarty_tpl->tpl_vars['allow_href']->value) {
                        ?>
 return false;<?php 
                    }
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_target']->value) {
                    ?>
target="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_name']->value) {
                    ?>
 data-ca-dispatch="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_name']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_external_click_id']->value) {
                    ?>
 data-ca-external-click-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_external_click_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target_form']->value) {
                    ?>
 data-ca-target-form="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_form']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target_id']->value) {
                    ?>
 data-ca-target-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 class="btn<?php 
                if ($_smarty_tpl->tpl_vars['but_role']->value == "submit-link") {
                    ?>
 btn-primary cm-submit<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_meta']->value) {
                    ?>
 <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_meta']->value, ENT_QUOTES, 'UTF-8');
                }
                ?>
"><?php 
                if ($_smarty_tpl->tpl_vars['but_icon']->value) {
                    ?>
<i class="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_icon']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"></i><?php 
                }
                ?>
 <?php 
                echo $_smarty_tpl->tpl_vars['but_text']->value;
                ?>
</a>

<?php 
            } elseif ($_smarty_tpl->tpl_vars['but_role']->value == "submit-button") {
                ?>
    <button type="submit" <?php 
                if ($_smarty_tpl->tpl_vars['but_id']->value) {
                    ?>
id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_onclick']->value) {
                    ?>
onclick="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_onclick']->value, ENT_QUOTES, 'UTF-8');
                    ?>
;<?php 
                    if (!$_smarty_tpl->tpl_vars['allow_href']->value) {
                        ?>
 return false;<?php 
                    }
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_target']->value) {
                    ?>
target="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_name']->value) {
                    ?>
 data-ca-dispatch="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_name']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_external_click_id']->value) {
                    ?>
 data-ca-external-click-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_external_click_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target_form']->value) {
                    ?>
 data-ca-target-form="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_form']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target_id']->value) {
                    ?>
 data-ca-target-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 class="btn btn-primary cm-submit<?php 
                if ($_smarty_tpl->tpl_vars['but_meta']->value) {
                    ?>
 <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_meta']->value, ENT_QUOTES, 'UTF-8');
                }
                ?>
" form="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_form']->value, ENT_QUOTES, 'UTF-8');
                ?>
" name="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['but_name']->value, ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                if ($_smarty_tpl->tpl_vars['but_icon']->value) {
                    ?>
<i class="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_icon']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"></i><?php 
                }
                ?>
 <?php 
                echo $_smarty_tpl->tpl_vars['but_text']->value;
                ?>
</button>
    
<?php 
            } elseif ($_smarty_tpl->tpl_vars['but_role']->value == "button") {
                ?>
    <input <?php 
                if ($_smarty_tpl->tpl_vars['but_id']->value) {
                    ?>
id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_meta']->value) {
                    ?>
class="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_meta']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 type="button" <?php 
                if ($_smarty_tpl->tpl_vars['but_onclick']->value) {
                    ?>
onclick="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_onclick']->value, ENT_QUOTES, 'UTF-8');
                    ?>
;<?php 
                    if (!$_smarty_tpl->tpl_vars['allow_href']->value) {
                        ?>
 return false;<?php 
                    }
                    ?>
"<?php 
                }
                ?>
 value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['but_text']->value, ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['tabindex']->value) {
                    ?>
tabindex="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['tabindex']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_external_click_id']->value) {
                    ?>
 data-ca-external-click-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_external_click_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target_form']->value) {
                    ?>
 data-ca-target-form="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_form']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target_id']->value) {
                    ?>
 data-ca-target-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 />

<?php 
            } elseif ($_smarty_tpl->tpl_vars['but_role']->value == "icon") {
                ?>
 
    <a <?php 
                if ($_smarty_tpl->tpl_vars['but_id']->value) {
                    ?>
id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_href']->value) {
                    ?>
 href="<?php 
                    echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['but_href']->value), ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_onclick']->value) {
                    ?>
onclick="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_onclick']->value, ENT_QUOTES, 'UTF-8');
                    ?>
;<?php 
                    if (!$_smarty_tpl->tpl_vars['allow_href']->value) {
                        ?>
 return false;<?php 
                    }
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_target']->value) {
                    ?>
target="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_external_click_id']->value) {
                    ?>
 data-ca-external-click-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_external_click_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target_form']->value) {
                    ?>
 data-ca-target-form="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_form']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target_id']->value) {
                    ?>
 data-ca-target-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 class="<?php 
                if ($_smarty_tpl->tpl_vars['but_meta']->value) {
                    ?>
 <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_meta']->value, ENT_QUOTES, 'UTF-8');
                }
                ?>
"><?php 
                echo $_smarty_tpl->tpl_vars['but_text']->value;
                ?>
</a>

<?php 
            } elseif (!$_smarty_tpl->tpl_vars['but_role']->value || !$_smarty_tpl->tpl_vars['but_name']->value) {
                ?>
 
    <input <?php 
                if ($_smarty_tpl->tpl_vars['but_id']->value) {
                    ?>
id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 class="btn <?php 
                if ($_smarty_tpl->tpl_vars['but_meta']->value) {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_meta']->value, ENT_QUOTES, 'UTF-8');
                }
                ?>
" type="<?php 
                echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['but_type']->value) === null || $tmp === '' ? "submit" : $tmp, ENT_QUOTES, 'UTF-8');
                ?>
"<?php 
                if ($_smarty_tpl->tpl_vars['but_name']->value) {
                    ?>
 name="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_name']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_onclick']->value) {
                    ?>
 onclick="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_onclick']->value, ENT_QUOTES, 'UTF-8');
                    ?>
;<?php 
                    if (!$_smarty_tpl->tpl_vars['allow_href']->value) {
                        ?>
 return false;<?php 
                    }
                    ?>
"<?php 
                }
                ?>
 value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['but_text']->value, ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['tabindex']->value) {
                    ?>
tabindex="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['tabindex']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_external_click_id']->value) {
                    ?>
 data-ca-external-click-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_external_click_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target_form']->value) {
                    ?>
 data-ca-target-form="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_form']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                if ($_smarty_tpl->tpl_vars['but_target_id']->value) {
                    ?>
 data-ca-target-id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['but_target_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['but_disabled']->value) {
                    ?>
disabled="disabled"<?php 
                }
                ?>
  />
<?php 
            }
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['but_group']->value) {
                ?>
</div><?php 
            }
        }
    }
    function content_55ccecb49ec841_92991784($_smarty_tpl)
    {
        if ($_smarty_tpl->tpl_vars['skip_check_permissions']->value || fn_check_html_view_permissions($_smarty_tpl->tpl_vars['tools_list']->value)) {
            ?>
<div class="btn-group <?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['tool_meta']->value, ENT_QUOTES, 'UTF-8');
            ?>
">
    <?php 
            if (!$_smarty_tpl->tpl_vars['hide_tools']->value && $_smarty_tpl->tpl_vars['tools_list']->value) {
                ?>
    <a class="<?php 
                if ($_smarty_tpl->tpl_vars['override_meta']->value) {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['override_meta']->value, ENT_QUOTES, 'UTF-8');
                } else {
                    ?>
btn<?php 
                }
                ?>
 btn dropdown-toggle" data-toggle="dropdown">
        <?php 
                if ($_smarty_tpl->tpl_vars['link_text']->value) {
                    ?>
            <?php 
                    echo $_smarty_tpl->tpl_vars['link_text']->value;
                    ?>

        <?php 
                }
                ?>
        <?php 
                if ($_smarty_tpl->tpl_vars['icon']->value) {
                    ?>
<i class="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['icon']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"></i><?php 
                }
                ?>
        <?php 
                if ($_smarty_tpl->tpl_vars['caret']->value) {
                    ?>
<span class="caret"></span><?php 
                }
                ?>
    </a>
    <ul id="tools_list_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
                ?>
" class="dropdown-menu cm-smart-position">
        <?php 
                echo $_smarty_tpl->tpl_vars['tools_list']->value;
                ?>

    </ul>
    <?php 
            }
            ?>
    <?php 
            if (!$_smarty_tpl->tpl_vars['hide_actions']->value) {
                ?>
        <?php 
                if (fn_check_view_permissions($_smarty_tpl->tpl_vars['tool_href']->value)) {
                    ?>
            <a class="btn cm-tooltip" <?php 
                    if ($_smarty_tpl->tpl_vars['tool_id']->value) {
                        ?>
 id="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['tool_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
"<?php 
                    }
                    if ($_smarty_tpl->tpl_vars['tool_href']->value) {
                        ?>
 href="<?php 
                        echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['tool_href']->value), ENT_QUOTES, 'UTF-8');
                        ?>
"<?php 
                    }
                    if ($_smarty_tpl->tpl_vars['tool_onclick']->value) {
                        ?>
 onclick="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['tool_onclick']->value, ENT_QUOTES, 'UTF-8');
                        ?>
; return false;"<?php 
                    }
                    ?>
 <?php 
                    if ($_smarty_tpl->tpl_vars['title']->value) {
                        ?>
title="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['title']->value, ENT_QUOTES, 'UTF-8');
                        ?>
"<?php 
                    }
                    ?>
>
                <?php 
                    if ($_smarty_tpl->tpl_vars['icon']->value) {
                        ?>
                    <i class="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['icon']->value, ENT_QUOTES, 'UTF-8');
                        ?>
"></i>
                <?php 
                    } else {
                        ?>
                    <i class="icon-plus"></i>
                <?php 
                    }
                    ?>
                <?php 
                    echo $_smarty_tpl->tpl_vars['link_text']->value;
                    ?>

            </a>
        <?php 
                }
                ?>
    <?php 
            }
            ?>
</div>
<?php 
        }
    }
    function content_55cdec34b1dc00_06212453($_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_modifier_date_format')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/modifier.date_format.php';
        }
        fn_preload_lang_vars(array('approved', 'disapprove', 'not_approved', 'approve', 'approved', 'not_approved', 'delete', 'ip_address'));
        ?>
<style>
    div.review_post_images{
        display: block;
    }
    div.review_post_image{
        display: inline-block;
        padding: 5px;
    }
    div.review_post_image > img{
        max-width: 150px;
        
    }
</style>
<?php 
        $_smarty_tpl->tpl_vars["current_redirect_url"] = new Smarty_variable(rawurlencode(fn_link_attach($_smarty_tpl->tpl_vars['config']->value['current_url'], "selected_section=discussion")), null, 0);
        ?>
<div class="summary">
    <input type="text" name="posts[<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
        ?>
][name]" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['name'], ENT_QUOTES, 'UTF-8');
        ?>
" size="40" class="input-hidden">
    
    <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "discussion:update_post"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "discussion:update_post"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

        <?php 
            if ($_smarty_tpl->tpl_vars['type']->value == "C" || $_smarty_tpl->tpl_vars['type']->value == "B") {
                ?>
            <textarea name="posts[<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
                ?>
][message]" cols="80" rows="5" class="input-hidden"><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['message'], ENT_QUOTES, 'UTF-8');
                ?>
</textarea>
            <div class="review_post_images">
                <?php 
                if ($_smarty_tpl->tpl_vars['post']->value['image1']) {
                    ?>
                    <div class="review_post_image">
                        
                        
                            <img id="det_img_review_img_1" class="img_review_post_image" src="/images/review_img/<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['image1'], ENT_QUOTES, 'UTF-8');
                    ?>
" alt="img"  border="0">
                        
                    </div>
                <?php 
                }
                ?>
                <?php 
                if ($_smarty_tpl->tpl_vars['post']->value['image2']) {
                    ?>
                    <div class="review_post_image">
                        
                        <img class="img_review_post_image" src="/images/review_img/<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['image2'], ENT_QUOTES, 'UTF-8');
                    ?>
">
                    </div>
                <?php 
                }
                ?>
            </div>
        <?php 
            }
            ?>
    <?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "discussion:update_post"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>

</div>
<div class="tools">
    
    <div class="pull-left">
        <div style="display: inline-block;margin-left:10px;"><?php 
        if (intval($_smarty_tpl->tpl_vars['post']->value['user_product_ordered']) === 0) {
            echo $_smarty_tpl->__('user_not_ordered_the_product');
        }
        ?>
</div>
        <?php 
        if (fn_check_view_permissions("discussion.m_delete")) {
            ?>
            <input type="checkbox" name="delete_posts[<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
            ?>
]" id="delete_checkbox_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
            ?>
"  class="pull-left cm-item" value="Y">
        <?php 
        }
        ?>
        <div class="hidden-tools pull-left cm-statuses">
            <?php 
        if (fn_check_view_permissions("discussion.update")) {
            ?>
                <span class="cm-status-a <?php 
            if ($_smarty_tpl->tpl_vars['post']->value['status'] == "D") {
                ?>
hidden<?php 
            }
            ?>
">
                    <span class="label label-success"><?php 
            echo $_smarty_tpl->__("approved");
            ?>
</span>
                    <a class="cm-status-switch icon-thumbs-down cm-tooltip" title="<?php 
            echo $_smarty_tpl->__("disapprove");
            ?>
" data-ca-status="D" data-ca-post-id="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
            ?>
"></a>
                </span>
                <span class="cm-status-d <?php 
            if ($_smarty_tpl->tpl_vars['post']->value['status'] == "A") {
                ?>
hidden<?php 
            }
            ?>
">
                    <span class="label label-important"><?php 
            echo $_smarty_tpl->__("not_approved");
            ?>
</span>
                    <a class="cm-status-switch icon-thumbs-up cm-tooltip" title="<?php 
            echo $_smarty_tpl->__("approve");
            ?>
" data-ca-status="A" data-ca-post-id="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8');
            ?>
"></a>
                </span>
            <?php 
        } else {
            ?>
                <span class="cm-status-<?php 
            echo htmlspecialchars(mb_strtolower($_smarty_tpl->tpl_vars['post']->value['status'], 'UTF-8'), ENT_QUOTES, 'UTF-8');
            ?>
">
                    <?php 
            if ($_smarty_tpl->tpl_vars['post']->value['status'] == "A") {
                ?>
                        <span class="label label-success"><?php 
                echo $_smarty_tpl->__("approved");
                ?>
</span>
                    <?php 
            } else {
                ?>
                        <span class="label label-important"><?php 
                echo $_smarty_tpl->__("not_approved");
                ?>
</span>
                    <?php 
            }
            ?>
                </span>
            <?php 
        }
        ?>
            <?php 
        if (fn_check_view_permissions("discussion.delete")) {
            ?>
                <a class="icon-trash cm-tooltip cm-confirm" href="<?php 
            echo htmlspecialchars(fn_url("discussion.delete?post_id=" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id'] . "&redirect_url=" . (string) $_smarty_tpl->tpl_vars['current_redirect_url']->value), ENT_QUOTES, 'UTF-8');
            ?>
" title="<?php 
            echo $_smarty_tpl->__("delete");
            ?>
"></a>
            <?php 
        }
        ?>
        </div>
    </div>


    <div class="pull-right">
        <span class="muted"><?php 
        echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['post']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'] . ", " . (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format']), ENT_QUOTES, 'UTF-8');
        ?>
 / <?php 
        echo $_smarty_tpl->__("ip_address");
        ?>
:&nbsp;<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['ip_address'], ENT_QUOTES, 'UTF-8');
        ?>
</span>

        <?php 
        if (($_smarty_tpl->tpl_vars['type']->value == "R" || $_smarty_tpl->tpl_vars['type']->value == "B") && $_smarty_tpl->tpl_vars['post']->value['rating_value'] > 0) {
            ?>
            <?php 
            if ($_smarty_tpl->tpl_vars['allow_save']->value) {
                ?>
                <?php 
                echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion_manager/components/rate.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('rate_id' => "rating_" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id'], 'rate_value' => $_smarty_tpl->tpl_vars['post']->value['rating_value'], 'rate_name' => "posts[" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id'] . "][rating_value]"), 0);
                ?>

            <?php 
            } else {
                ?>
                <?php 
                echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion_manager/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => $_smarty_tpl->tpl_vars['post']->value['rating_value']), 0);
                ?>

            <?php 
            }
            ?>
        <?php 
        }
        ?>
    </div>

    <?php 
        if ($_smarty_tpl->tpl_vars['show_object_link']->value) {
            ?>
        <a href="<?php 
            echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['post']->value['object_data']['url']), ENT_QUOTES, 'UTF-8');
            ?>
" class="post-object" title="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['object_data']['description'], ENT_QUOTES, 'UTF-8');
            ?>
"><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['object_data']['description'], ENT_QUOTES, 'UTF-8');
            ?>
</a>
    <?php 
        }
        ?>
</div>
<?php 
    }