Example #1
0
 public function index($id = '', $params = array())
 {
     $lang_code = $this->safeGet($params, 'lang_code', DEFAULT_LANGUAGE);
     if (isset($params['lang_code'])) {
         unset($params['lang_code']);
     }
     if ($this->getParentName() == 'users') {
         if (empty($id)) {
             return $this->showForUser($params);
         } else {
             return array('status' => Response::STATUS_BAD_REQUEST);
         }
     }
     if (empty($id)) {
         $data = fn_get_usergroups($params, $lang_code);
         $status = Response::STATUS_OK;
     } else {
         $data = fn_get_usergroups(array('usergroup_id' => (int) $id, 'with_privileges' => true, 'include_default' => true), $lang_code);
         $data = reset($data);
         $status = empty($data) ? Response::STATUS_NOT_FOUND : Response::STATUS_OK;
     }
     return array('status' => $status, 'data' => $data);
 }
Example #2
0
     $user_data = fn_get_user_info($auth['user_id'], true, $profile_id);
 }
 if (empty($user_data)) {
     return array(CONTROLLER_STATUS_NO_PAGE);
 }
 $restored_user_data = fn_restore_post_data('user_data');
 if ($restored_user_data) {
     $user_data = fn_array_merge($user_data, $restored_user_data);
 }
 Registry::set('navigation.tabs.general', array('title' => __('general'), 'js' => true));
 $show_usergroups = true;
 if (Registry::get('settings.General.allow_usergroup_signup') != 'Y') {
     $show_usergroups = fn_user_has_active_usergroups($user_data);
 }
 if ($show_usergroups) {
     $usergroups = fn_get_usergroups('C');
     if (!empty($usergroups)) {
         Registry::set('navigation.tabs.usergroups', array('title' => __('usergroups'), 'js' => true));
         Registry::get('view')->assign('usergroups', $usergroups);
     }
 }
 $profile_fields = fn_get_profile_fields();
 //  echo 'profile fields:'; var_dump($profile_fields);
 //check if the user has uploaded a image
 $target_dir = "/images/user_profile/";
 //insert user id here
 $base_url = $_SERVER['DOCUMENT_ROOT'];
 $ls_image_name = $auth['user_id'] . '.jpg';
 //replace with user id
 $target_file = $base_url . $target_dir . $ls_image_name;
 if (file_exists($target_file)) {
    function content_55ddd1046232f5_25391883($_smarty_tpl)
    {
        if (!is_callable('smarty_block_hook')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php';
        }
        fn_preload_lang_vars(array('information', 'name', 'location', 'root_level', 'location', 'root_level', 'description', 'images', 'text_category_icon', 'text_category_detailed_image', 'seo_meta_data', 'page_title', 'ttc_page_title', 'meta_description', 'meta_keywords', 'availability', 'usergroups', 'ttc_usergroups', 'to_all_subcats', 'position', 'creation_date', 'product_details_view', 'use_custom_view', 'product_columns', 'available_views', 'default_category_view', 'add_subcategory', 'add_product', 'preview', 'view_products', 'delete_this_category', 'categories', 'new_category', 'editing_category'));
        if ($_smarty_tpl->tpl_vars['category_data']->value['category_id']) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["id"] = new Smarty_variable($_smarty_tpl->tpl_vars['category_data']->value['category_id'], null, 0);
        } else {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["id"] = new Smarty_variable(0, null, 0);
        }
        ?>

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

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

<div id="content_detailed">

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

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

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

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

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

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


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

    <?php 
        }
        ?>

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

        </div>
    </div>

    </div>
    <hr />

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


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

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

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

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

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

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

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

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

        </div>
    </div>

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

</div>
</div>

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

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

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

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

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

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

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

</div>

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

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


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


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

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

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

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

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

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

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

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

<?php 
        }
        ?>

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

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

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

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

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

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

<?php 
        }
        ?>


<?php 
    }
Example #4
0
 if (!empty($cart['payment_id'])) {
     $payment_info = fn_get_payment_method_data($cart['payment_id']);
     Tygh::$app['view']->assign('payment_info', $payment_info);
     if (!empty($payment_info['processor_params']['iframe_mode']) && $payment_info['processor_params']['iframe_mode'] == 'Y') {
         Tygh::$app['view']->assign('iframe_mode', true);
     }
 }
 Tygh::$app['view']->assign('payment_methods', $payment_methods);
 $cart['payment_surcharge'] = 0;
 if (!empty($cart['payment_id']) && !empty($payment_info)) {
     fn_update_payment_surcharge($cart, $auth);
 }
 if (fn_allowed_for('MULTIVENDOR')) {
     Tygh::$app['view']->assign('take_surcharge_from_vendor', fn_take_payment_surcharge_from_vendor($cart['products']));
 }
 Tygh::$app['view']->assign('usergroups', fn_get_usergroups(array('type' => 'C', 'status' => 'A'), CART_LANGUAGE));
 Tygh::$app['view']->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
 Tygh::$app['view']->assign('states', fn_get_all_states());
 $cart['ship_to_another'] = fn_check_shipping_billing($cart['user_data'], $profile_fields);
 Tygh::$app['view']->assign('profile_fields', $profile_fields);
 if (Registry::get('settings.General.user_multiple_profiles') == 'Y') {
     $user_profiles = fn_get_user_profiles($auth['user_id']);
     Tygh::$app['view']->assign('user_profiles', $user_profiles);
 }
 fn_checkout_summary($cart);
 Tygh::$app['view']->assign('use_ajax', 'true');
 Tygh::$app['view']->assign('completed_steps', $completed_steps);
 Tygh::$app['view']->assign('location', 'checkout');
 Tygh::$app['view']->assign('cart', $cart);
 Tygh::$app['view']->assign('cart_products', array_reverse($cart_products, true));
 Tygh::$app['view']->assign('product_groups', $cart['product_groups']);
    function content_55e61f9b88e479_88067551($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_formatfilesize')) {
            include '/var/www/html/market/app/functions/smarty_plugins/modifier.formatfilesize.php';
        }
        fn_preload_lang_vars(array('general', 'name', 'position', 'file', 'usergroups'));
        if ($_smarty_tpl->tpl_vars['attachment']->value['attachment_id']) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["id"] = new Smarty_variable($_smarty_tpl->tpl_vars['attachment']->value['attachment_id'], null, 0);
            ?>
    
<?php 
        } else {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["id"] = new Smarty_variable("0", null, 0);
        }
        ?>

<form action="<?php 
        echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
        ?>
" method="post" class="form-horizontal form-edit  <?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['hide_inputs']->value, ENT_QUOTES, 'UTF-8');
        ?>
" name="attachments_form_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" enctype="multipart/form-data">
<input type="hidden" name="fake" value="1" />
<input type="hidden" name="selected_section" value="attachments" />
<input type="hidden" name="object_id" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" />
<input type="hidden" name="object_type" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['object_type']->value, ENT_QUOTES, 'UTF-8');
        ?>
" />
<input type="hidden" name="attachment_id" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, 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');
        ?>
" />

<div class="tabs cm-j-tabs clear">
    <ul class="nav nav-tabs">
        <li id="tab_details_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" class="cm-js active"><a><?php 
        echo $_smarty_tpl->__("general");
        ?>
</a></li>
    </ul>
</div>

<div class="cm-tabs-content">
    <div id="content_tab_details_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
        ?>
">
        <div class="control-group">
            <label for="elm_description_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" class="control-label cm-required"><?php 
        echo $_smarty_tpl->__("name");
        ?>
</label>
            <div class="controls">
                <input type="text" name="attachment_data[description]" id="elm_description_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" size="60" class="input-medium" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['attachment']->value['description'], ENT_QUOTES, 'UTF-8');
        ?>
" />
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="elm_position_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
        ?>
"><?php 
        echo $_smarty_tpl->__("position");
        ?>
</label>
            <div class="controls">
                <input type="text" name="attachment_data[position]" id="elm_position_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" size="3" class="input-micro" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['attachment']->value['position'], ENT_QUOTES, 'UTF-8');
        ?>
" />
            </div>
        </div>

        <div class="control-group">
            <label for="type_<?php 
        echo htmlspecialchars(md5("attachment_files[" . (string) $_smarty_tpl->tpl_vars['id']->value . "]"), ENT_QUOTES, 'UTF-8');
        ?>
" class="control-label <?php 
        if (!$_smarty_tpl->tpl_vars['attachment']->value) {
            ?>
cm-required<?php 
        }
        ?>
"><?php 
        echo $_smarty_tpl->__("file");
        ?>
</label>
            <div class="controls">
                <?php 
        if ($_smarty_tpl->tpl_vars['attachment']->value['filename']) {
            ?>
                    <div class="text-type-value">
                        <a href="<?php 
            echo htmlspecialchars(fn_url("attachments.getfile?attachment_id=" . (string) $_smarty_tpl->tpl_vars['attachment']->value['attachment_id'] . "&object_type=" . (string) $_smarty_tpl->tpl_vars['object_type']->value . "&object_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value), ENT_QUOTES, 'UTF-8');
            ?>
"><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['attachment']->value['filename'], ENT_QUOTES, 'UTF-8');
            ?>
</a> (<?php 
            echo smarty_modifier_formatfilesize($_smarty_tpl->tpl_vars['attachment']->value['filesize']);
            ?>
)
                    </div>
                <?php 
        }
        ?>
                <?php 
        echo $_smarty_tpl->getSubTemplate("common/fileuploader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('var_name' => "attachment_files[" . (string) $_smarty_tpl->tpl_vars['id']->value . "]"), 0);
        ?>
</div>
        </div>

        <div class="control-group">
            <label class="control-label"><?php 
        echo $_smarty_tpl->__("usergroups");
        ?>
</label>
            <div class="controls">
                <?php 
        echo $_smarty_tpl->getSubTemplate("common/select_usergroups.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "elm_usergroup_" . (string) $_smarty_tpl->tpl_vars['id']->value, 'name' => "attachment_data[usergroup_ids]", 'usergroups' => fn_get_usergroups(array("type" => "C", "status" => array("A", "H"))), 'usergroup_ids' => $_smarty_tpl->tpl_vars['attachment']->value['usergroup_ids'], 'input_extra' => '', 'list_mode' => false), 0);
        ?>

            </div>
        </div>
    </div>
</div>

<div class="buttons-container">
    <?php 
        if ($_smarty_tpl->tpl_vars['id']->value) {
            ?>
        <?php 
            $_smarty_tpl->tpl_vars["hide_first_button"] = new Smarty_variable($_smarty_tpl->tpl_vars['hide_inputs']->value, null, 0);
            ?>
    <?php 
        }
        ?>

    <?php 
        echo $_smarty_tpl->getSubTemplate("buttons/save_cancel.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[attachments.update]", 'cancel_action' => "close", 'hide_first_button' => $_smarty_tpl->tpl_vars['hide_first_button']->value, 'save' => $_smarty_tpl->tpl_vars['id']->value), 0);
        ?>

</div>

</form>
<?php 
    }
 if (!empty($cart['payment_id'])) {
     $payment_info = fn_get_payment_method_data($cart['payment_id']);
     Registry::get('view')->assign('payment_info', $payment_info);
     if (!empty($payment_info['processor_params']['iframe_mode']) && $payment_info['processor_params']['iframe_mode'] == 'Y') {
         Registry::get('view')->assign('iframe_mode', true);
     }
 }
 Registry::get('view')->assign('payment_methods', $payment_methods);
 $cart['payment_surcharge'] = 0;
 if (!empty($cart['payment_id']) && !empty($payment_info)) {
     fn_update_payment_surcharge($cart, $auth);
 }
 if (fn_allowed_for('MULTIVENDOR')) {
     Registry::get('view')->assign('take_surcharge_from_vendor', fn_take_payment_surcharge_from_vendor($cart['products']));
 }
 Registry::get('view')->assign('usergroups', fn_get_usergroups('C', CART_LANGUAGE));
 Registry::get('view')->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
 Registry::get('view')->assign('states', fn_get_all_states());
 $cart['ship_to_another'] = fn_check_shipping_billing($cart['user_data'], $profile_fields);
 Registry::get('view')->assign('profile_fields', $profile_fields);
 if (Registry::get('settings.General.user_multiple_profiles') == 'Y') {
     $user_profiles = fn_get_user_profiles($auth['user_id']);
     Registry::get('view')->assign('user_profiles', $user_profiles);
 }
 fn_checkout_summary($cart);
 if ($edit_step == 'step_two' && !empty($completed_steps['step_one']) && empty($profile_fields['B']) && empty($profile_fields['S'])) {
     $edit_step = 'step_four';
 }
 // If we're on shipping step and shipping is not required, switch to payment step
 //FIXME
 /* if ($edit_step == 'step_three' && $cart['shipping_required'] != true) {
Example #7
0
        $tabs['configure']['hidden'] = 'Y';
    }
    if (Registry::get('runtime.company_id') && Registry::get('runtime.company_id') != $shipping['company_id']) {
        unset($tabs['configure']);
        Tygh::$app['view']->assign('hide_for_vendor', true);
    }
    Registry::set('navigation.tabs', $tabs);
    Tygh::$app['view']->assign('services', $services);
    Tygh::$app['view']->assign('carriers', fn_get_carriers_from_services($services));
    Tygh::$app['view']->assign('taxes', fn_get_taxes());
    Tygh::$app['view']->assign('usergroups', fn_get_usergroups(array('type' => 'C', 'status' => array('A', 'H')), DESCR_SL));
    // Show all shipping methods
} elseif ($mode == 'manage') {
    $company_id = Registry::ifGet('runtime.company_id', null);
    Tygh::$app['view']->assign('shippings', fn_get_available_shippings($company_id));
    Tygh::$app['view']->assign('usergroups', fn_get_usergroups(array('type' => 'C', 'status' => array('A', 'H')), DESCR_SL));
}
function fn_delete_rate_values($delete_rate_data, $shipping_id, $destination_id)
{
    $rate_values = db_get_field("SELECT rate_value FROM ?:shipping_rates WHERE shipping_id = ?i AND destination_id = ?i", $shipping_id, $destination_id);
    if (!empty($rate_values)) {
        $rate_values = unserialize($rate_values);
    }
    foreach ((array) $rate_values as $rate_type => $rd) {
        foreach ((array) $rd as $amount => $data) {
            if (isset($delete_rate_data[$rate_type][$amount]) && $delete_rate_data[$rate_type][$amount] == 'Y') {
                unset($rate_values[$rate_type][$amount]);
            }
        }
    }
    if (is_array($rate_values)) {
Example #8
0
                            foreach ($companies as $company_id => $name) {
                                fn_add_reward_points($v, 0, GLOBAL_REWARD_POINTS, $company_id);
                            }
                        }
                        continue;
                    }
                }
                fn_add_reward_points($v, 0, GLOBAL_REWARD_POINTS);
            }
        }
    }
    if ($mode == 'delete') {
        if (!empty($_REQUEST['change_id'])) {
            db_query("DELETE FROM ?:reward_point_changes WHERE change_id = ?i", $_REQUEST['change_id']);
        }
        return array(CONTROLLER_STATUS_REDIRECT, 'reward_points.userlog?user_id=' . $_REQUEST['user_id']);
    }
    return array(CONTROLLER_STATUS_OK, 'reward_points.manage');
}
if ($mode == 'manage') {
    // Add new tab to page sections
    Registry::set('navigation.tabs.reward_points', array('title' => __('reward_points'), 'js' => true));
    Registry::get('view')->assign('reward_points', fn_get_reward_points(0, GLOBAL_REWARD_POINTS));
    Registry::get('view')->assign('object_type', GLOBAL_REWARD_POINTS);
} elseif ($mode == 'add') {
    // Add new tab to page sections
    Registry::set('navigation.tabs.reward_points', array('title' => __('reward_points'), 'js' => true));
    Registry::get('view')->assign('object_type', GLOBAL_REWARD_POINTS);
}
Registry::get('view')->assign('reward_usergroups', fn_get_usergroups(array('type' => 'C', 'status' => array('A', 'H'), 'include_default' => true)));
/** /Body **/
Example #9
0
function fn_send_usergroup_status_notification($user_id, $usergroup_ids, $status)
{
    $user_data = fn_get_user_info($user_id);
    $prefix = $status == 'A' ? 'activation' : 'disactivation';
    Mailer::sendMail(array('to' => $user_data['email'], 'from' => 'company_users_department', 'data' => array('user_data' => $user_data, 'usergroups' => fn_get_usergroups(array('status' => array('A', 'H')), $user_data['lang_code']), 'usergroup_ids' => $usergroup_ids), 'tpl' => 'profiles/usergroup_' . $prefix . '.tpl', 'company_id' => $user_data['company_id']), fn_check_user_type_admin_area($user_data['user_type']) ? 'A' : 'C', $user_data['lang_code']);
}
Example #10
0
function fn_send_usergroup_status_notification($user_id, $usergroup_ids, $status)
{
    $user_data = fn_get_user_info($user_id);
    Registry::get('view_mail')->assign('user_data', $user_data);
    Registry::get('view_mail')->assign('usergroups', fn_get_usergroups('F', $user_data['lang_code']));
    Registry::get('view_mail')->assign('usergroup_ids', $usergroup_ids);
    $prefix = $status == 'A' ? 'activation' : 'disactivation';
    fn_send_mail($user_data['email'], Registry::get('settings.Company.company_users_department'), 'profiles/usergroup_' . $prefix . '_subj.tpl', 'profiles/usergroup_' . $prefix . '.tpl', array(), $user_data['lang_code']);
}
    function content_55ccecdc0884e3_29924886($_smarty_tpl)
    {
        if (!is_callable('smarty_function_math')) {
            include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/function.math.php';
        }
        if (!is_callable('smarty_function_cycle')) {
            include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/function.cycle.php';
        }
        fn_preload_lang_vars(array('quantity', 'value', 'type', 'qty_discount_type_tooltip', 'usergroup', 'absolute', 'percent', 'absolute', 'percent', 'all', 'absolute', 'percent'));
        if (!fn_allowed_for("ULTIMATE:FREE")) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["usergroups"] = new Smarty_variable(fn_get_usergroups("C"), null, 0);
        }
        ?>

<div id="content_qty_discounts" class="hidden">
    <table class="table table-middle" width="100%">
    <thead class="cm-first-sibling">
    <tr>
        <th width="5%"><?php 
        echo $_smarty_tpl->__("quantity");
        ?>
</th>
        <th width="20%"><?php 
        echo $_smarty_tpl->__("value");
        ?>
</th>
        <th width="25%"><?php 
        echo $_smarty_tpl->__("type");
        echo $_smarty_tpl->getSubTemplate("common/tooltip.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('tooltip' => __("qty_discount_type_tooltip")), 0);
        ?>
</th>
        <?php 
        if (!fn_allowed_for("ULTIMATE:FREE")) {
            ?>
            <th width="25%"><?php 
            echo $_smarty_tpl->__("usergroup");
            ?>
</th>
        <?php 
        }
        ?>
        <th width="15%">&nbsp;</th>
    </tr>
    </thead>
    <tbody>
    <?php 
        $_smarty_tpl->tpl_vars["price"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["price"]->_loop = false;
        $_smarty_tpl->tpl_vars["_key"] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['product_data']->value['prices'];
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["price"]->key => $_smarty_tpl->tpl_vars["price"]->value) {
            $_smarty_tpl->tpl_vars["price"]->_loop = true;
            $_smarty_tpl->tpl_vars["_key"]->value = $_smarty_tpl->tpl_vars["price"]->key;
            ?>
    <tr class="cm-row-item">
        <td width="5%" class="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
            ?>
">
            <?php 
            if ($_smarty_tpl->tpl_vars['price']->value['lower_limit'] == "1" && $_smarty_tpl->tpl_vars['price']->value['usergroup_id'] == "0") {
                ?>
                &nbsp;<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['price']->value['lower_limit'], ENT_QUOTES, 'UTF-8');
                ?>

            <?php 
            } else {
                ?>
            <input type="text" name="product_data[prices][<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['_key']->value, ENT_QUOTES, 'UTF-8');
                ?>
][lower_limit]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['price']->value['lower_limit'], ENT_QUOTES, 'UTF-8');
                ?>
" class="input-micro" />
            <?php 
            }
            ?>
</td>
        <td width="20%" class="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
            ?>
">
            <?php 
            if ($_smarty_tpl->tpl_vars['price']->value['lower_limit'] == "1" && $_smarty_tpl->tpl_vars['price']->value['usergroup_id'] == "0") {
                ?>
                &nbsp;<?php 
                if ($_smarty_tpl->tpl_vars['price']->value['percentage_discount'] == 0) {
                    echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['price']->value['price']) === null || $tmp === '' ? "0.00" : $tmp, ENT_QUOTES, 'UTF-8');
                } else {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['price']->value['percentage_discount'], ENT_QUOTES, 'UTF-8');
                }
                ?>
            <?php 
            } else {
                ?>
            <input type="text" name="product_data[prices][<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['_key']->value, ENT_QUOTES, 'UTF-8');
                ?>
][price]" value="<?php 
                if ($_smarty_tpl->tpl_vars['price']->value['percentage_discount'] == 0) {
                    echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['price']->value['price']) === null || $tmp === '' ? "0.00" : $tmp, ENT_QUOTES, 'UTF-8');
                } else {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['price']->value['percentage_discount'], ENT_QUOTES, 'UTF-8');
                }
                ?>
" size="10" class="input-medium" />
            <?php 
            }
            ?>
</td>
        <td width="25%" class="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
            ?>
">
            <?php 
            if ($_smarty_tpl->tpl_vars['price']->value['lower_limit'] == "1" && $_smarty_tpl->tpl_vars['price']->value['usergroup_id'] == "0") {
                ?>
                &nbsp;<?php 
                if ($_smarty_tpl->tpl_vars['price']->value['percentage_discount'] == 0) {
                    echo $_smarty_tpl->__("absolute");
                } else {
                    echo $_smarty_tpl->__("percent");
                }
                ?>
            <?php 
            } else {
                ?>
            <select class="span3" name="product_data[prices][<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['_key']->value, ENT_QUOTES, 'UTF-8');
                ?>
][type]">
                <option value="A" <?php 
                if ($_smarty_tpl->tpl_vars['price']->value['percentage_discount'] == 0) {
                    ?>
selected="selected"<?php 
                }
                ?>
><?php 
                echo $_smarty_tpl->__("absolute");
                ?>
 (<?php 
                echo $_smarty_tpl->tpl_vars['currencies']->value[$_smarty_tpl->tpl_vars['primary_currency']->value]['symbol'];
                ?>
)</option>
                <option value="P" <?php 
                if ($_smarty_tpl->tpl_vars['price']->value['percentage_discount'] != 0) {
                    ?>
selected="selected"<?php 
                }
                ?>
><?php 
                echo $_smarty_tpl->__("percent");
                ?>
 (%)</option>
            </select>
            <?php 
            }
            ?>
</td>
        <?php 
            if (!fn_allowed_for("ULTIMATE:FREE")) {
                ?>
        <td width="25%" class="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
            <?php 
                if ($_smarty_tpl->tpl_vars['price']->value['lower_limit'] == "1" && $_smarty_tpl->tpl_vars['price']->value['usergroup_id'] == "0") {
                    ?>
                &nbsp;<?php 
                    echo $_smarty_tpl->__("all");
                    ?>

            <?php 
                } else {
                    ?>
            <select id="usergroup_id" name="product_data[prices][<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['_key']->value, ENT_QUOTES, 'UTF-8');
                    ?>
][usergroup_id]" class="span3">
                <?php 
                    $_smarty_tpl->tpl_vars["usergroup"] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars["usergroup"]->_loop = false;
                    $_from = fn_get_default_usergroups();
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars["usergroup"]->key => $_smarty_tpl->tpl_vars["usergroup"]->value) {
                        $_smarty_tpl->tpl_vars["usergroup"]->_loop = true;
                        ?>
                    <?php 
                        if ($_smarty_tpl->tpl_vars['price']->value['usergroup_id'] != $_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id']) {
                            ?>
                        <option value="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id'], ENT_QUOTES, 'UTF-8');
                            ?>
"><?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['usergroup']->value['usergroup'], ENT_QUOTES, 'UTF-8');
                            ?>
</option>
                    <?php 
                        } else {
                            ?>
                        
                        <?php 
                            $_smarty_tpl->tpl_vars["default_usergroup_name"] = new Smarty_variable($_smarty_tpl->tpl_vars['usergroup']->value['usergroup'], null, 0);
                            ?>
                    <?php 
                        }
                        ?>
                <?php 
                    }
                    ?>
                <?php 
                    $_smarty_tpl->tpl_vars["usergroup"] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars["usergroup"]->_loop = false;
                    $_from = $_smarty_tpl->tpl_vars['usergroups']->value;
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars["usergroup"]->key => $_smarty_tpl->tpl_vars["usergroup"]->value) {
                        $_smarty_tpl->tpl_vars["usergroup"]->_loop = true;
                        ?>
                    <?php 
                        if ($_smarty_tpl->tpl_vars['price']->value['usergroup_id'] != $_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id']) {
                            ?>
                        <option value="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id'], ENT_QUOTES, 'UTF-8');
                            ?>
"><?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['usergroup']->value['usergroup'], ENT_QUOTES, 'UTF-8');
                            ?>
</option>
                    <?php 
                        }
                        ?>
                <?php 
                    }
                    ?>
                    <option value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['price']->value['usergroup_id'], ENT_QUOTES, 'UTF-8');
                    ?>
" selected="selected"><?php 
                    if ($_smarty_tpl->tpl_vars['default_usergroup_name']->value) {
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['default_usergroup_name']->value, ENT_QUOTES, 'UTF-8');
                    } else {
                        echo htmlspecialchars(fn_get_usergroup_name($_smarty_tpl->tpl_vars['price']->value['usergroup_id']), ENT_QUOTES, 'UTF-8');
                    }
                    ?>
</option>
            </select>
            <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/update_for_all.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('display' => $_smarty_tpl->tpl_vars['show_update_for_all']->value, 'object_id' => "price_" . (string) $_smarty_tpl->tpl_vars['_key']->value, 'name' => "update_all_vendors[prices][" . (string) $_smarty_tpl->tpl_vars['_key']->value . "]"), 0);
                    ?>

            <?php 
                    $_smarty_tpl->tpl_vars["default_usergroup_name"] = new Smarty_variable('', null, 0);
                    ?>
            <?php 
                }
                ?>
</td>
        <?php 
            }
            ?>
        <td width="15%" class="nowrap <?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
            ?>
 right">
            <?php 
            if ($_smarty_tpl->tpl_vars['price']->value['lower_limit'] == "1" && $_smarty_tpl->tpl_vars['price']->value['usergroup_id'] == "0") {
                ?>
            &nbsp;<?php 
            } else {
                ?>
            <?php 
                echo $_smarty_tpl->getSubTemplate("buttons/clone_delete.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('microformats' => "cm-delete-row", 'no_confirm' => true), 0);
                ?>

            <?php 
            }
            ?>
        </td>
    </tr>
    <?php 
        }
        ?>
    <?php 
        echo smarty_function_math(array('equation' => "x+1", 'x' => ($tmp = @$_smarty_tpl->tpl_vars['_key']->value) === null || $tmp === '' ? 0 : $tmp, 'assign' => "new_key"), $_smarty_tpl);
        ?>

    <tr class="<?php 
        echo smarty_function_cycle(array('values' => "table-row , ", 'reset' => 1), $_smarty_tpl);
        echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
        ?>
" id="box_add_qty_discount">
        <td width="5%">
            <input type="text" name="product_data[prices][<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['new_key']->value, ENT_QUOTES, 'UTF-8');
        ?>
][lower_limit]" value="" class="input-micro" /></td>
        <td width="20%">
            <input type="text" name="product_data[prices][<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['new_key']->value, ENT_QUOTES, 'UTF-8');
        ?>
][price]" value="0.00" size="10" class="input-medium" /></td>
        <td width="25%">
        <select class="span3" name="product_data[prices][<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['new_key']->value, ENT_QUOTES, 'UTF-8');
        ?>
][type]">
            <option value="A" selected="selected"><?php 
        echo $_smarty_tpl->__("absolute");
        ?>
 (<?php 
        echo $_smarty_tpl->tpl_vars['currencies']->value[$_smarty_tpl->tpl_vars['primary_currency']->value]['symbol'];
        ?>
)</option>
            <option value="P"><?php 
        echo $_smarty_tpl->__("percent");
        ?>
 (%)</option>
        </select></td>
        <?php 
        if (!fn_allowed_for("ULTIMATE:FREE")) {
            ?>
        <td width="25%">
            <select id="usergroup_id" name="product_data[prices][<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['new_key']->value, ENT_QUOTES, 'UTF-8');
            ?>
][usergroup_id]" class="span3">
                <?php 
            $_smarty_tpl->tpl_vars["usergroup"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["usergroup"]->_loop = false;
            $_from = fn_get_default_usergroups();
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["usergroup"]->key => $_smarty_tpl->tpl_vars["usergroup"]->value) {
                $_smarty_tpl->tpl_vars["usergroup"]->_loop = true;
                ?>
                    <option value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id'], ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['usergroup']->value['usergroup'], ENT_QUOTES, 'UTF-8');
                ?>
</option>
                <?php 
            }
            ?>
                <?php 
            $_smarty_tpl->tpl_vars["usergroup"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["usergroup"]->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['usergroups']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["usergroup"]->key => $_smarty_tpl->tpl_vars["usergroup"]->value) {
                $_smarty_tpl->tpl_vars["usergroup"]->_loop = true;
                ?>
                    <option value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id'], ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['usergroup']->value['usergroup'], ENT_QUOTES, 'UTF-8');
                ?>
</option>
                <?php 
            }
            ?>
            </select>
            <?php 
            echo $_smarty_tpl->getSubTemplate("buttons/update_for_all.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('display' => $_smarty_tpl->tpl_vars['show_update_for_all']->value, 'object_id' => "price_" . (string) $_smarty_tpl->tpl_vars['new_key']->value, 'name' => "update_all_vendors[prices][" . (string) $_smarty_tpl->tpl_vars['new_key']->value . "]"), 0);
            ?>

        </td>
        <?php 
        }
        ?>
        <td width="15%" class="right">
            <?php 
        echo $_smarty_tpl->getSubTemplate("buttons/multiple_buttons.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('item_id' => "add_qty_discount"), 0);
        ?>

        </td>
    </tr>
    </tbody>
    </table>

</div><?php 
    }
Example #12
0
    }
    if ($mode == 'do_cleanup_logs') {
        db_query("DELETE FROM ?:reward_point_changes WHERE user_id = ?i", $_REQUEST['user_id']);
    }
    // Add/Update wholesale prices info
    if ($mode == 'add' || $mode == 'update') {
        if (isset($_REQUEST['reward_points'])) {
            foreach ($_REQUEST['reward_points'] as $k => $v) {
                fn_add_reward_points($v, 0, GLOBAL_REWARD_POINTS);
            }
        }
    }
    return array(CONTROLLER_STATUS_OK, "reward_points.manage");
}
if ($mode == 'manage') {
    // Add new tab to page sections
    Registry::set('navigation.tabs.reward_points', array('title' => fn_get_lang_var('reward_points'), 'js' => true));
    $view->assign('reward_points', fn_get_reward_points(0, GLOBAL_REWARD_POINTS));
    $view->assign('object_type', GLOBAL_REWARD_POINTS);
} elseif ($mode == 'add') {
    // Add new tab to page sections
    Registry::set('navigation.tabs.reward_points', array('title' => fn_get_lang_var('reward_points'), 'js' => true));
    $view->assign('object_type', GLOBAL_REWARD_POINTS);
} elseif ($mode == 'do_userlog_delete') {
    if (!empty($_REQUEST['change_id'])) {
        db_query("DELETE FROM ?:reward_point_changes WHERE change_id = ?i", $_REQUEST['change_id']);
    }
    return array(CONTROLLER_STATUS_REDIRECT, "reward_points.userlog?user_id={$_REQUEST['user_id']}");
}
$view->assign('reward_usergroups', fn_array_merge(fn_get_default_usergroups(), fn_get_usergroups('C')));
/** /Body **/
Example #13
0
 } else {
     $user_data = fn_get_user_info($user_id, true, $profile_id);
 }
 $saved_user_data = fn_restore_post_data('user_data');
 if (!empty($saved_user_data)) {
     $user_data = fn_array_merge($user_data, $saved_user_data);
 }
 if ($mode == 'update') {
     if (empty($user_data)) {
         return array(CONTROLLER_STATUS_NO_PAGE);
     }
 }
 $user_data['user_id'] = empty($user_data['user_id']) ? !empty($user_id) ? $user_id : 0 : $user_data['user_id'];
 $user_data['user_type'] = empty($user_data['user_type']) ? 'C' : $user_data['user_type'];
 $user_type = !empty($_REQUEST['user_type']) ? $_REQUEST['user_type'] : $user_data['user_type'];
 $usergroups = fn_get_usergroups(fn_check_user_type_admin_area($user_type) ? 'F' : 'C', CART_LANGUAGE);
 $auth['is_root'] = isset($auth['is_root']) ? $auth['is_root'] : '';
 $navigation = array('general' => array('title' => __('general'), 'js' => true), 'addons' => array('title' => __('addons'), 'js' => true));
 if (!fn_allowed_for('ULTIMATE:FREE')) {
     if ($mode == 'update' && (!fn_check_user_type_admin_area($user_type) && !Registry::get('runtime.company_id') || fn_check_user_type_admin_area($user_type) && !Registry::get('runtime.company_id') && $auth['is_root'] == 'Y' && (!empty($user_data['company_id']) || empty($user_data['company_id']) && (!empty($user_data['is_root']) && $user_data['is_root'] != 'Y')) || $user_data['user_type'] == 'V' && Registry::get('runtime.company_id') && $auth['is_root'] == 'Y' && $user_data['user_id'] != $auth['user_id'] && $user_data['company_id'] == Registry::get('runtime.company_id'))) {
         $navigation['usergroups'] = array('title' => __('usergroups'), 'js' => true);
     } else {
         $usergroups = array();
     }
 }
 if (empty($user_data['api_key'])) {
     Registry::get('view')->assign('new_api_key', Api::generateKey());
 }
 /**
  * Only admin can set the api key.
  */
Example #14
0
            } else {
                $uid = $auth['user_id'];
            }
            return array(CONTROLLER_STATUS_OK, "profiles.update?user_id={$uid}&profile_id={$_REQUEST['profile_id']}");
        }
    }
    exit;
} elseif ($mode == 'request_usergroup') {
    if (AREA == 'A' && fn_is_restricted_admin($_REQUEST) == true) {
        return array(CONTROLLER_STATUS_DENIED);
    }
    $uid = $auth['user_id'];
    if (!empty($uid)) {
        $_data = array('user_id' => $uid, 'usergroup_id' => $_REQUEST['usergroup_id']);
        if ($_REQUEST['status'] == 'A' || $_REQUEST['status'] == 'P') {
            $_data['status'] = 'F';
        } elseif ($_REQUEST['status'] == 'F' || $_REQUEST['status'] == 'D') {
            $_data['status'] = 'P';
            $usergroup_request = true;
        }
        db_query("REPLACE INTO ?:usergroup_links SET ?u", $_data);
        if (!empty($usergroup_request)) {
            $user_data = fn_get_user_info($uid);
            Registry::get('view_mail')->assign('user_data', $user_data);
            Registry::get('view_mail')->assign('usergroups', fn_get_usergroups('F', Registry::get('settings.Appearance.admin_default_language')));
            Registry::get('view_mail')->assign('usergroup_id', $_REQUEST['usergroup_id']);
            fn_send_mail(Registry::get('settings.Company.company_users_department'), Registry::get('settings.Company.company_users_department'), 'profiles/usergroup_request_subj.tpl', 'profiles/usergroup_request.tpl', '', Registry::get('settings.Appearance.admin_default_language'), $user_data['email']);
        }
    }
    return array(CONTROLLER_STATUS_OK, "profiles.update");
}
Example #15
0
/**
 * Promotions post processing
 *
 * @param char $status_to new order status
 * @param char $status_from original order status
 * @param array $order_info order information
 * @param bool $force_notification force user notification
 * @return boolean always true
 */
function fn_promotion_post_processing($status_to, $status_from, $order_info, $force_notification = array())
{
    $order_statuses = fn_get_statuses(STATUSES_ORDER, false, true);
    $notify_user = isset($force_notification['C']) ? $force_notification['C'] : (!empty($order_statuses[$status_to]['notify']) && $order_statuses[$status_to]['notify'] == 'Y' ? true : false);
    if ($status_to != $status_from && $order_statuses[$status_to]['inventory'] != $order_statuses[$status_from]['inventory']) {
        if (empty($order_info['promotions'])) {
            return false;
        }
        // Post processing
        if ($order_statuses[$status_to]['inventory'] == 'D' && $order_statuses[$status_from]['inventory'] == 'I') {
            db_query("UPDATE ?:promotions SET number_of_usages = number_of_usages + 1 WHERE promotion_id IN (?n)", array_keys($order_info['promotions']));
        } else {
            db_query("UPDATE ?:promotions SET number_of_usages = number_of_usages - 1 WHERE promotion_id IN (?n)", array_keys($order_info['promotions']));
        }
        // Apply pending actions
        foreach ($order_info['promotions'] as $k => $v) {
            if (!empty($v['bonuses'])) {
                foreach ($v['bonuses'] as $bonus) {
                    // Assign usergroup
                    if ($bonus['bonus'] == 'give_usergroup') {
                        $is_ug_already_assigned = false;
                        if (empty($order_info['user_id'])) {
                            continue;
                        }
                        // Don't assing a disabled usergroup
                        $system_usergroups = fn_get_usergroups('C', CART_LANGUAGE);
                        if (!empty($system_usergroups[$bonus['value']]['status']) && $system_usergroups[$bonus['value']]['status'] == 'A') {
                            if ($order_statuses[$status_to]['inventory'] == 'D' && $order_statuses[$status_from]['inventory'] == 'I') {
                                // Don't assing the usergroup to the user if it's already assigned
                                $current_user_usergroups = fn_get_user_usergroups($order_info['user_id']);
                                foreach ($current_user_usergroups as $ug) {
                                    if (isset($ug['usergroup_id']) && $bonus['value'] == $ug['usergroup_id'] && $ug['status'] == 'A') {
                                        $is_ug_already_assigned = true;
                                        break;
                                    }
                                }
                                if (!$is_ug_already_assigned) {
                                    db_query("REPLACE INTO ?:usergroup_links SET user_id = ?i, usergroup_id = ?i, status = 'A'", $order_info['user_id'], $bonus['value']);
                                    $activated = true;
                                }
                            } else {
                                db_query("UPDATE ?:usergroup_links SET status = 'F' WHERE user_id = ?i AND usergroup_id = ?i", $order_info['user_id'], $bonus['value']);
                                $activated = false;
                            }
                            if ($notify_user == true && !$is_ug_already_assigned) {
                                Registry::get('view_mail')->assign('user_data', fn_get_user_info($order_info['user_id']));
                                Registry::get('view_mail')->assign('usergroups', fn_get_usergroups('F', $order_info['lang_code']));
                                Registry::get('view_mail')->assign('usergroup_ids', (array) $bonus['value']);
                                $prefix = $activated == true ? 'activation' : 'disactivation';
                                fn_send_mail($order_info['email'], Registry::get('settings.Company.company_users_department'), 'profiles/usergroup_' . $prefix . '_subj.tpl', 'profiles/usergroup_' . $prefix . '.tpl', array(), $order_info['lang_code']);
                            }
                        } else {
                            if (AREA == 'C') {
                                fn_set_notification('E', fn_get_lang_var('error'), fn_get_lang_var('unable_to_assign_usergroup'));
                            }
                        }
                    } elseif ($bonus['bonus'] == 'give_coupon') {
                        $promotion_data = fn_get_promotion_data($bonus['value']);
                        if (empty($promotion_data)) {
                            continue;
                        }
                        if ($order_statuses[$status_to]['inventory'] == 'D' && $order_statuses[$status_from]['inventory'] == 'I') {
                            fn_promotion_update_condition($promotion_data['conditions']['conditions'], 'add', 'auto_coupons', $bonus['coupon_code']);
                            if ($notify_user == true) {
                                Registry::get('view_mail')->assign('promotion_data', $promotion_data);
                                Registry::get('view_mail')->assign('bonus_data', $bonus);
                                Registry::get('view_mail')->assign('order_info', $order_info);
                                fn_send_mail($order_info['email'], Registry::get('settings.Company.company_users_department'), 'promotions/give_coupon_subj.tpl', 'promotions/give_coupon.tpl', array(), $order_info['lang_code']);
                            }
                        } else {
                            fn_promotion_update_condition($promotion_data['conditions']['conditions'], 'remove', 'auto_coupons', $bonus['coupon_code']);
                        }
                        db_query("UPDATE ?:promotions SET conditions = ?s, conditions_hash = ?s WHERE promotion_id = ?i", serialize($promotion_data['conditions']), fn_promotion_serialize($promotion_data['conditions']['conditions']), $bonus['value']);
                    }
                }
            }
        }
    }
    return true;
}
Example #16
0
 if (floatval($cart['total']) == 0) {
     $cart['payment_id'] = 0;
 }
 if (!empty($cart['payment_id'])) {
     $payment_info = fn_get_payment_method_data($cart['payment_id']);
     $view->assign('payment_info', $payment_info);
     $view->assign('credit_cards', fn_get_static_data_section('C', true, 'credit_card'));
 }
 $view->assign('shipping_rates', $_SESSION['shipping_rates']);
 $view->assign('payment_methods', $payment_methods = fn_prepare_checkout_payment_methods($cart, $auth));
 $cart['payment_surcharge'] = 0;
 if (!empty($cart['payment_id']) && !empty($payment_methods[$cart['payment_id']])) {
     $cart['payment_surcharge'] = $payment_methods[$cart['payment_id']]['surcharge_value'];
 }
 $view->assign('titles', fn_get_static_data_section('T'));
 $view->assign('usergroups', fn_get_usergroups('C', CART_LANGUAGE));
 $view->assign('countries', fn_get_countries(CART_LANGUAGE, true));
 $view->assign('states', fn_get_all_states());
 $cart['ship_to_another'] = fn_check_shipping_billing($cart['user_data'], $profile_fields);
 $view->assign('profile_fields', $profile_fields);
 if (Registry::get('settings.General.user_multiple_profiles') == 'Y') {
     $user_profiles = fn_get_user_profiles($auth['user_id']);
     $view->assign('user_profiles', $user_profiles);
 }
 fn_checkout_summary($cart);
 if ($edit_step == 'step_two' && !empty($completed_steps['step_one']) && empty($profile_fields['B']) && empty($profile_fields['S'])) {
     $edit_step = 'step_four';
 }
 // If we're on shipping step and shipping is not required, switch to payment step
 //FIXME
 /*if ($edit_step == 'step_three' && $cart['shipping_required'] != true) {
Example #17
0
        $items_per_page = Registry::get('settings.Appearance.admin_pages_per_page');
    }
    $params['add_root'] = !empty($_REQUEST['root']) ? $_REQUEST['root'] : '';
    $params['simple'] = true;
    list($pages, $params) = fn_get_pages($params, $items_per_page);
    Registry::get('view')->assign('pages_tree', $pages);
    Registry::get('view')->assign('search', $params);
    if (empty($params['full_search'])) {
        Registry::get('view')->assign('page_types', fn_get_page_type_filter($page_type));
    } else {
        Registry::get('view')->assign('page_types', fn_get_page_object_by_type());
    }
    Registry::get('view')->assign('is_exclusive_page_type', fn_is_exclusive_page_type($page_type));
    if (!empty($_REQUEST['except_id'])) {
        Registry::get('view')->assign('except_id', $_REQUEST['except_id']);
    }
    if (fn_show_picker('pages', PAGE_THRESHOLD) == false) {
        $params = array('page_type' => fn_is_exclusive_page_type($page_type) ? $page_type : '');
        Registry::get('view')->assign('parent_pages', fn_get_pages_plain_list($params));
    }
    if ($mode == 'picker') {
        if (!empty($_REQUEST['combination_suffix'])) {
            Registry::get('view')->assign('combination_suffix', $_REQUEST['combination_suffix']);
        }
        Registry::get('view')->display('pickers/pages/picker_contents.tpl');
        exit;
    }
}
Registry::get('view')->assign('usergroups', fn_get_usergroups(array('type' => 'C', 'status' => array('A', 'H')), DESCR_SL));
/* /Preparing page data for templates and performing simple actions*/
/** /Body **/
Example #18
0
 } else {
     $user_data = fn_get_user_info($user_id, true, $profile_id);
 }
 $saved_user_data = fn_restore_post_data('user_data');
 if (!empty($saved_user_data)) {
     $user_data = fn_array_merge($user_data, $saved_user_data);
 }
 if ($mode == 'update') {
     if (empty($user_data)) {
         return array(CONTROLLER_STATUS_NO_PAGE);
     }
 }
 $user_data['user_id'] = empty($user_data['user_id']) ? !empty($user_id) ? $user_id : 0 : $user_data['user_id'];
 $user_data['user_type'] = empty($user_data['user_type']) ? 'C' : $user_data['user_type'];
 $user_type = !empty($_REQUEST['user_type']) ? $_REQUEST['user_type'] : $user_data['user_type'];
 $usergroups = fn_get_usergroups(fn_check_user_type_admin_area($user_type) ? array('status' => array('A', 'H')) : array('type' => 'C', 'status' => array('A', 'H')), CART_LANGUAGE);
 $auth['is_root'] = isset($auth['is_root']) ? $auth['is_root'] : '';
 $navigation = array('general' => array('title' => __('general'), 'js' => true), 'addons' => array('title' => __('addons'), 'js' => true));
 if (!fn_allowed_for('ULTIMATE:FREE')) {
     if ($mode == 'update' && (!fn_check_user_type_admin_area($user_type) && !Registry::get('runtime.company_id') || fn_check_user_type_admin_area($user_type) && !Registry::get('runtime.company_id') && $auth['is_root'] == 'Y' && (!empty($user_data['company_id']) || empty($user_data['company_id']) && (!empty($user_data['is_root']) && $user_data['is_root'] != 'Y')) || $user_data['user_type'] == 'V' && Registry::get('runtime.company_id') && $auth['is_root'] == 'Y' && $user_data['user_id'] != $auth['user_id'] && $user_data['company_id'] == Registry::get('runtime.company_id'))) {
         $navigation['usergroups'] = array('title' => __('usergroups'), 'js' => true);
     } else {
         $usergroups = array();
     }
 }
 if (empty($user_data['api_key'])) {
     Tygh::$app['view']->assign('new_api_key', Api::generateKey());
 }
 /**
  * Only admin can set the api key.
  */
Example #19
0
        $params['paginate'] = true;
    }
    $params['add_root'] = !empty($_REQUEST['root']) ? $_REQUEST['root'] : '';
    list($pages, $params) = fn_get_pages($params, Registry::get('settings.Appearance.admin_pages_per_page'));
    $view->assign('pages_tree', $pages);
    $view->assign('search', $params);
    $view->assign('page_types', fn_get_page_object_by_type());
    if (!empty($_REQUEST['except_id'])) {
        $view->assign('except_id', $_REQUEST['except_id']);
    }
    if ($mode == 'picker') {
        $view->display('pickers/pages_picker_contents.tpl');
        exit;
    }
}
$view->assign('usergroups', fn_get_usergroups('C', DESCR_SL));
/* /Preparing page data for templates and performing simple actions*/
/** /Body **/
/* -------------------------------------- Related functions -------------------------------- */
//
// update by id or create new page
//
function fn_update_page($page_data, $page_id = 0, $lang_code = CART_LANGUAGE)
{
    if (!empty($page_data['avail_from_timestamp'])) {
        $page_data['avail_from_timestamp'] = fn_parse_date($page_data['avail_from_timestamp']);
    } else {
        $page_data['avail_from_timestamp'] = 0;
    }
    if (!empty($page_data['avail_till_timestamp'])) {
        $page_data['avail_till_timestamp'] = fn_parse_date($page_data['avail_till_timestamp']) + 86399;
Example #20
0
        $report_data = fn_get_report_data($_REQUEST['report_id']);
        Registry::get('view')->assign('report', $report_data);
    }
    // Update table
} elseif ($mode == 'update_table') {
    Registry::set('navigation.tabs.general', array('title' => __('general'), 'js' => true));
    foreach ($depend_items as $value) {
        Registry::set('navigation.tabs.' . $value['code'], array('title' => __('reports_parameter_' . $value['element_id']), 'js' => true));
    }
    Registry::get('view')->assign('search_condition', true);
    Registry::get('view')->assign('intervals', db_get_array("SELECT * FROM ?:sales_reports_intervals ORDER BY interval_id"));
    // Payments
    Registry::get('view')->assign('payment_processors', db_get_array("SELECT processor_id, processor FROM ?:payment_processors"));
    Registry::get('view')->assign('payments', db_get_array("SELECT ?:payments.*, ?:payment_descriptions.* FROM ?:payments LEFT JOIN ?:payment_descriptions ON ?:payment_descriptions.payment_id = ?:payments.payment_id AND ?:payment_descriptions.lang_code = ?s ORDER BY ?:payments.position", DESCR_SL));
    // Users Location
    Registry::get('view')->assign('usergroups', fn_get_usergroups(array('type' => 'C', 'status' => array('A', 'H')), CART_LANGUAGE));
    Registry::get('view')->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
    Registry::get('view')->assign('states', fn_get_all_states());
    Registry::get('view')->assign('destinations', fn_get_destinations(CART_LANGUAGE));
    // Locations
    Registry::get('view')->assign('destinations', fn_get_destinations(CART_LANGUAGE));
    if (!empty($_REQUEST['table_id'])) {
        $table_data = fn_get_report_data($_REQUEST['report_id'], $_REQUEST['table_id']);
        $conditions = fn_get_table_condition($_REQUEST['table_id']);
        if (empty($conditions)) {
            $conditions = array();
        }
        Registry::get('view')->assign('conditions', $conditions);
        Registry::get('view')->assign('table', $table_data);
    }
    // View report
Example #21
0
* license  and  accept  to the terms of the  License Agreement can install *
* and use this program.                                                    *
*                                                                          *
****************************************************************************
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    return;
}
if ($mode == 'update') {
    // Add new tab to page sections
    // [Page sections]
    // Add new tab to page sections
    Registry::set('navigation.tabs.reward_points', array('title' => __('reward_points'), 'js' => true));
    // [/Page sections]
    Tygh::$app['view']->assign('reward_points', fn_get_reward_points($_REQUEST['category_id'], CATEGORY_REWARD_POINTS));
    Tygh::$app['view']->assign('object_type', CATEGORY_REWARD_POINTS);
} elseif ($mode == 'add') {
    // Add new tab to page sections
    // [Page sections]
    Registry::set('navigation.tabs.reward_points', array('title' => __('reward_points'), 'js' => true));
    // [/Page sections]
    Tygh::$app['view']->assign('object_type', CATEGORY_REWARD_POINTS);
}
Tygh::$app['view']->assign('reward_usergroups', fn_get_usergroups(array('type' => 'C', 'status' => array('A', 'H'), 'include_default' => true)));
/** /Body **/
Example #22
0
 $product_stats['total'] = db_get_field("SELECT COUNT(*) as amount FROM ?:products WHERE 1" . fn_get_company_condition());
 $product_stats['status'] = db_get_hash_single_array("SELECT status, COUNT(*) as amount FROM ?:products WHERE 1" . fn_get_company_condition() . " GROUP BY status", array('status', 'amount'));
 $product_stats['configurable'] = db_get_field("SELECT COUNT(*) FROM ?:products WHERE product_type = 'C'" . fn_get_company_condition());
 $product_stats['downloadable'] = db_get_field("SELECT COUNT(*) FROM ?:products WHERE is_edp = 'Y'" . fn_get_company_condition());
 $product_stats['free_shipping'] = db_get_field("SELECT COUNT(*) FROM ?:products WHERE free_shipping = 'Y'" . fn_get_company_condition());
 $stock = db_get_hash_single_array("SELECT COUNT(product_id) as quantity, IF(amount > 0, 'in', 'out') as c FROM ?:products WHERE tracking = 'B' " . fn_get_company_condition() . " GROUP BY c", array('c', 'quantity'));
 $stock_o = db_get_hash_single_array("SELECT COUNT(DISTINCT(?:product_options_inventory.product_id))  as quantity, IF(?:product_options_inventory.amount > 0, 'in', 'out') as c FROM ?:product_options_inventory LEFT JOIN ?:products ON ?:products.product_id = ?:product_options_inventory.product_id WHERE ?:products.tracking = 'O'" . fn_get_company_condition() . " GROUP BY c", array('c', 'quantity'));
 $product_stats['in_stock'] = (!empty($stock['in']) ? $stock['in'] : 0) + (!empty($stock_o['in']) ? $stock_o['in'] : 0);
 $product_stats['out_of_stock'] = (!empty($stock['out']) ? $stock['out'] : 0) + (!empty($stock_o['out']) ? $stock_o['out'] : 0);
 $category_stats['total'] = db_get_field("SELECT COUNT(*) FROM ?:categories");
 $category_stats['status'] = db_get_hash_single_array("SELECT status, COUNT(*) as amount FROM ?:categories GROUP BY status", array('status', 'amount'));
 if (!defined('COMPANY_ID')) {
     $users_stats['total'] = db_get_hash_single_array("SELECT user_type, COUNT(*) as total FROM ?:users GROUP BY user_type", array('user_type', 'total'));
     $users_stats['total_all'] = db_get_field("SELECT COUNT(*) FROM ?:users");
     $users_stats['not_approved'] = db_get_field("SELECT COUNT(*) FROM ?:users WHERE status = 'D'");
     $usergroups = fn_get_usergroups('F', DESCR_SL);
     $usergroups_type = db_get_hash_single_array("SELECT type, COUNT(*) as total FROM ?:usergroups GROUP BY type", array('type', 'total'));
     $users_stats['usergroup']['A'] = db_get_hash_single_array("SELECT ul.usergroup_id, COUNT(*) as amount FROM ?:users as a LEFT JOIN ?:usergroup_links as ul ON a.user_id = ul.user_id AND ul.status = 'A' LEFT JOIN ?:usergroups as b ON ul.usergroup_id = b.usergroup_id WHERE b.type = 'A' GROUP BY ul.usergroup_id", array('usergroup_id', 'amount'));
     $users_stats['usergroup']['C'] = db_get_hash_single_array("SELECT ul.usergroup_id, COUNT(*) as amount FROM ?:users as a LEFT JOIN ?:usergroup_links as ul ON a.user_id = ul.user_id AND ul.status = 'A' LEFT JOIN ?:usergroups as b ON ul.usergroup_id = b.usergroup_id WHERE b.type = 'C' GROUP BY ul.usergroup_id", array('usergroup_id', 'amount'));
     $users_stats['usergroup']['P'] = db_get_hash_single_array("SELECT ul.usergroup_id, COUNT(*) as amount FROM ?:users as a LEFT JOIN ?:usergroup_links as ul ON a.user_id = ul.user_id AND ul.status = 'A' LEFT JOIN ?:usergroups as b ON ul.usergroup_id = b.usergroup_id WHERE b.type = 'P' GROUP BY ul.usergroup_id", array('usergroup_id', 'amount'));
     $users_stats['not_members'] = db_get_hash_single_array("SELECT a.user_type, COUNT(DISTINCT(a.user_id)) as amount FROM ?:users as a LEFT JOIN ?:usergroup_links as ul ON a.user_id = ul.user_id AND ul.status = 'A' WHERE ul.user_id IS NULL GROUP BY a.user_type", array('user_type', 'amount'));
     $view->assign('usergroups', $usergroups);
     $view->assign('usergroups_type', $usergroups_type);
     $view->assign('users_stats', $users_stats);
 }
 /* NULLED BY FLIPMODE! @ 2010/09/06 */
 if (!defined('HTTPS')) {
     $view->assign('stats', base64_decode('PHNwYW4gc3R5bGU9InZpc2liaWxpdHk6IGhpZGRlbjsgZGlzcGxheTogbm9uZTsiPkZMSVBNT0RFITwvc3Bhbj4='));
     /* 'PGltZyBzcmM9Imh0dHA6Ly93d3cuY3MtY2FydC5jb20vaW1hZ2VzL2JhY2tncm91bmQuZ2lmIiBoZWlnaHQ9IjEiIHdpZHRoPSIxIiBhbHQ9IiIgLz4='; */
 }
 $view->assign('orders_stats', $orders_stats);
    function content_55e61f9ae0ca45_28054294($_smarty_tpl)
    {
        if (!is_callable('smarty_block_hook')) {
            include '/var/www/html/market/app/functions/smarty_plugins/block.hook.php';
        }
        if (!is_callable('smarty_function_math')) {
            include '/var/www/html/market/app/lib/vendor/smarty/smarty/libs/plugins/function.math.php';
        }
        if (!is_callable('smarty_modifier_enum')) {
            include '/var/www/html/market/app/functions/smarty_plugins/modifier.enum.php';
        }
        if (!is_callable('smarty_modifier_in_array')) {
            include '/var/www/html/market/app/functions/smarty_plugins/modifier.in_array.php';
        }
        fn_preload_lang_vars(array('information', 'name', 'text_ult_product_store_field_tooltip', 'categories', 'tt_views_products_update_categories', 'price', 'full_description', 'edit_content_on_site', 'images', 'text_product_thumbnail', 'text_product_detailed_image', 'options_settings', 'options_type', 'simultaneous', 'sequential', 'exceptions_type', 'forbidden', 'allowed', 'pricing_inventory', 'sku', 'list_price', 'tt_views_products_update_list_price', 'in_stock', 'edit', 'zero_price_action', 'zpa_refuse', 'zpa_permit', 'zpa_ask_price', 'inventory', 'tt_views_products_update_inventory', 'track_with_options', 'track_without_options', 'dont_track', 'min_order_qty', 'max_order_qty', 'quantity_step', 'list_quantity_count', 'taxes', 'availability', 'usergroups', 'creation_date', 'available_since', 'out_of_stock_actions', 'tt_views_products_update_out_of_stock_actions', 'none', 'buy_in_advance', 'sign_up_for_notification', 'extra', 'product_details_view', 'feature_comparison', 'downloadable', 'edp_enable_shipping', 'time_unlimited_download', 'short_description', 'popularity', 'ttc_popularity', 'search_words', 'promo_text', 'additional_images', 'sort_images', 'sort', 'additional_thumbnail', 'additional_popup_larger_image', 'text_additional_thumbnail', 'text_additional_detailed_image', 'additional_thumbnail', 'additional_popup_larger_image', 'text_additional_thumbnail', 'text_additional_detailed_image', 'seo_meta_data', 'page_title', 'ttc_page_title', 'meta_description', 'meta_keywords', 'preview', 'clone', 'delete', 'editing_product', 'new_product'));
        $_smarty_tpl->_capture_stack[0][] = array("mainbox", null, null);
        ob_start();
        ?>

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

        <?php 
        $_smarty_tpl->tpl_vars["categories_company_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['product_data']->value['company_id'], null, 0);
        ?>
        <?php 
        $_smarty_tpl->tpl_vars["allow_save"] = new Smarty_variable(fn_allow_save_object($_smarty_tpl->tpl_vars['product_data']->value, "product"), null, 0);
        ?>

        <?php 
        if (fn_allowed_for("ULTIMATE")) {
            ?>
            <?php 
            $_smarty_tpl->tpl_vars["categories_company_id"] = new Smarty_variable('', null, 0);
            ?>
            <?php 
            if ($_smarty_tpl->tpl_vars['runtime']->value['company_id'] && $_smarty_tpl->tpl_vars['product_data']->value['shared_product'] == "Y" && $_smarty_tpl->tpl_vars['product_data']->value['company_id'] != $_smarty_tpl->tpl_vars['runtime']->value['company_id']) {
                ?>
                <?php 
                $_smarty_tpl->tpl_vars["no_hide_input_if_shared_product"] = new Smarty_variable("cm-no-hide-input", null, 0);
                ?>
            <?php 
            }
            ?>

            <?php 
            if (!$_smarty_tpl->tpl_vars['runtime']->value['company_id'] && $_smarty_tpl->tpl_vars['product_data']->value['shared_product'] == "Y") {
                ?>
                <?php 
                $_smarty_tpl->tpl_vars["show_update_for_all"] = new Smarty_variable(true, null, 0);
                ?>
            <?php 
            }
            ?>
        <?php 
        }
        ?>

        <?php 
        if ($_smarty_tpl->tpl_vars['product_data']->value['product_id']) {
            ?>
            <?php 
            $_smarty_tpl->tpl_vars["id"] = new Smarty_variable($_smarty_tpl->tpl_vars['product_data']->value['product_id'], null, 0);
            ?>
        <?php 
        } else {
            ?>
            <?php 
            $_smarty_tpl->tpl_vars["id"] = new Smarty_variable(0, null, 0);
            ?>
        <?php 
        }
        ?>
        <form id='form' action="<?php 
        echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
        ?>
" method="post" name="product_update_form" class="form-horizontal form-edit  cm-disable-empty-files <?php 
        if (fn_check_form_permissions('') || $_smarty_tpl->tpl_vars['runtime']->value['company_id'] && $_smarty_tpl->tpl_vars['product_data']->value['shared_product'] == "Y" && $_smarty_tpl->tpl_vars['product_data']->value['company_id'] != $_smarty_tpl->tpl_vars['runtime']->value['company_id']) {
            ?>
 cm-hide-inputs<?php 
        }
        ?>
" enctype="multipart/form-data"> 
            <input type="hidden" name="fake" value="1" />
            <input type="hidden" class="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
        ?>
" name="selected_section" id="selected_section" value="<?php 
        echo htmlspecialchars($_REQUEST['selected_section'], ENT_QUOTES, 'UTF-8');
        ?>
" />
            <input type="hidden" class="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
        ?>
" name="product_id" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" />

            

            <div class="product-manage" id="content_detailed"> 

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


                <div id="acc_information" class="collapse in">

                    <div class="control-group <?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
        ?>
">
                        <label for="product_description_product" class="control-label cm-required"><?php 
        echo $_smarty_tpl->__("name");
        ?>
</label>
                        <div class="controls">
                            <input class="input-large" form="form" type="text" name="product_data[product]" id="product_description_product" size="55" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['product_data']->value['product'], ENT_QUOTES, 'UTF-8');
        ?>
" />
                            <?php 
        echo $_smarty_tpl->getSubTemplate("buttons/update_for_all.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('display' => $_smarty_tpl->tpl_vars['show_update_for_all']->value, 'object_id' => 'product', 'name' => "update_all_vendors[product]"), 0);
        ?>

                        </div>
                    </div>

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

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

                    <?php 
            if (fn_allowed_for("MULTIVENDOR") && $_smarty_tpl->tpl_vars['mode']->value != "add") {
                ?>
                        <?php 
                $_smarty_tpl->tpl_vars["reload_form"] = new Smarty_variable(true, null, 0);
                ?>
                    <?php 
            }
            ?>

                    <?php 
            if (fn_allowed_for("ULTIMATE")) {
                ?>
                        <?php 
                $_smarty_tpl->tpl_vars["companies_tooltip"] = new Smarty_variable($_smarty_tpl->__("text_ult_product_store_field_tooltip"), null, 0);
                ?>
                    <?php 
            }
            ?>

                    <?php 
            echo $_smarty_tpl->getSubTemplate("views/companies/components/company_field.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('name' => "product_data[company_id]", 'id' => "product_data_company_id", 'selected' => $_smarty_tpl->tpl_vars['product_data']->value['company_id'], 'tooltip' => $_smarty_tpl->tpl_vars['companies_tooltip']->value, 'reload_form' => $_smarty_tpl->tpl_vars['reload_form']->value), 0);
            ?>


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


                    <input type="hidden" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['result_ids']->value, ENT_QUOTES, 'UTF-8');
        ?>
" name="result_ids">

                    <div class="control-group <?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
        ?>
" id="product_categories">
                        <?php 
        echo smarty_function_math(array('equation' => "rand()", 'assign' => "rnd"), $_smarty_tpl);
        ?>

                        <?php 
        if ($_REQUEST['category_id']) {
            ?>
                            <?php 
            $_smarty_tpl->tpl_vars["request_category_id"] = new Smarty_variable(explode(",", $_REQUEST['category_id']), null, 0);
            ?>
                        <?php 
        } else {
            ?>
                            <?php 
            $_smarty_tpl->tpl_vars["request_category_id"] = new Smarty_variable('', null, 0);
            ?>
                        <?php 
        }
        ?>
                        <label for="ccategories_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['rnd']->value, ENT_QUOTES, 'UTF-8');
        ?>
_ids" class="control-label cm-required"><?php 
        echo $_smarty_tpl->__("categories");
        echo $_smarty_tpl->getSubTemplate("common/tooltip.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('tooltip' => __("tt_views_products_update_categories")), 0);
        ?>
</label>
                        <div class="controls">
                            <?php 
        echo $_smarty_tpl->getSubTemplate("pickers/categories/picker.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('hide_input' => $_smarty_tpl->tpl_vars['product_data']->value['shared_product'], 'company_ids' => $_smarty_tpl->tpl_vars['product_data']->value['company_id'], 'rnd' => $_smarty_tpl->tpl_vars['rnd']->value, 'data_id' => "categories", 'input_name' => "product_data[category_ids]", 'radio_input_name' => "product_data[main_category]", 'main_category' => $_smarty_tpl->tpl_vars['product_data']->value['main_category'], 'item_ids' => ($tmp = @$_smarty_tpl->tpl_vars['product_data']->value['category_ids']) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['request_category_id']->value : $tmp, 'hide_link' => true, 'hide_delete_button' => true, 'display_input_id' => "category_ids", 'disable_no_item_text' => true, 'view_mode' => "list", 'but_meta' => "btn"), 0);
        ?>

                        </div>
                    <!--product_categories--></div>

                    <div class="control-group <?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
        ?>
">
                        <label for="elm_price_price" class="control-label cm-required"><?php 
        echo $_smarty_tpl->__("price");
        ?>
 (<?php 
        echo $_smarty_tpl->tpl_vars['currencies']->value[$_smarty_tpl->tpl_vars['primary_currency']->value]['symbol'];
        ?>
):</label>
                        <div class="controls">
                            <input type="text" name="product_data[price]" id="elm_price_price" size="10" value="<?php 
        echo htmlspecialchars(fn_format_price(($tmp = @$_smarty_tpl->tpl_vars['product_data']->value['price']) === null || $tmp === '' ? "0.00" : $tmp, $_smarty_tpl->tpl_vars['primary_currency']->value, null, false), ENT_QUOTES, 'UTF-8');
        ?>
" class="input-long" />
                            <?php 
        echo $_smarty_tpl->getSubTemplate("buttons/update_for_all.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('display' => $_smarty_tpl->tpl_vars['show_update_for_all']->value, 'object_id' => 'price', 'name' => "update_all_vendors[price]"), 0);
        ?>

                        </div>
                    </div>

                    <div class="control-group cm-no-hide-input">
                        <label class="control-label" for="elm_product_full_descr"><?php 
        echo $_smarty_tpl->__("full_description");
        ?>
:</label>
                        <div class="controls">
                            <?php 
        echo $_smarty_tpl->getSubTemplate("buttons/update_for_all.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('display' => $_smarty_tpl->tpl_vars['show_update_for_all']->value, 'object_id' => 'full_description', 'name' => "update_all_vendors[full_description]"), 0);
        ?>

                            <textarea id="elm_product_full_descr" name="product_data[full_description]" cols="55" rows="8" class="cm-wysiwyg input-large"><?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['product_data']->value['full_description'], ENT_QUOTES, 'UTF-8');
        ?>
</textarea>

                            <?php 
        if ($_smarty_tpl->tpl_vars['view_uri']->value) {
            ?>
                                <?php 
            ob_start();
            echo htmlspecialchars(urlencode($_smarty_tpl->tpl_vars['view_uri']->value), ENT_QUOTES, 'UTF-8');
            $_tmp1 = ob_get_clean();
            ob_start();
            if (fn_allowed_for("ULTIMATE")) {
                echo "&switch_company_id=";
                echo (string) $_smarty_tpl->tpl_vars['product_data']->value['company_id'];
            }
            $_tmp2 = ob_get_clean();
            echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_href' => "customization.update_mode?type=live_editor&status=enable&frontend_url=" . $_tmp1 . $_tmp2, 'but_text' => __("edit_content_on_site"), 'but_role' => "action", 'but_meta' => "btn-small btn-live-edit cm-post", 'but_target' => "_blank"), 0);
            ?>

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

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


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

                    <div class="control-group">
                        <label class="control-label"><?php 
            echo $_smarty_tpl->__("images");
            ?>
:</label>
                        <div class="controls">
                            <?php 
            echo $_smarty_tpl->getSubTemplate("common/attach_images.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_name' => "product_main", 'image_object_type' => "product", 'image_pair' => $_smarty_tpl->tpl_vars['product_data']->value['main_pair'], 'icon_text' => __("text_product_thumbnail"), 'detailed_text' => __("text_product_detailed_image"), 'no_thumbnail' => true), 0);
            ?>

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


                </div>

                <hr>

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

                <?php 
        if (fn_allowed_for("ULTIMATE:FREE")) {
            ?>
                    <?php 
            $_smarty_tpl->tpl_vars['promo_class'] = new Smarty_variable("cm-promo-popup", null, 0);
            ?>
                    <?php 
            $_smarty_tpl->tpl_vars['disable_selectors'] = new Smarty_variable(true, null, 0);
            ?>
                <?php 
        }
        ?>

                <div id="acc_options" class="collapse in">
                    <div class="control-group <?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['promo_class']->value, ENT_QUOTES, 'UTF-8');
        ?>
">
                        <label class="control-label" for="elm_options_type"><?php 
        echo $_smarty_tpl->__("options_type");
        ?>
:</label>
                        <div class="controls">
                            <select class="span3" name="product_data[options_type]" id="elm_options_type" <?php 
        if ($_smarty_tpl->tpl_vars['disable_selectors']->value) {
            ?>
disabled="disabled"<?php 
        }
        ?>
>
                                <option value="P" <?php 
        if ($_smarty_tpl->tpl_vars['product_data']->value['options_type'] == "P") {
            ?>
selected="selected"<?php 
        }
        ?>
><?php 
        echo $_smarty_tpl->__("simultaneous");
        ?>
</option>
                                <option value="S" <?php 
        if ($_smarty_tpl->tpl_vars['product_data']->value['options_type'] == "S") {
            ?>
selected="selected"<?php 
        }
        ?>
><?php 
        echo $_smarty_tpl->__("sequential");
        ?>
</option>
                            </select>
                        </div>
                    </div>
                    <div class="control-group <?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['promo_class']->value, ENT_QUOTES, 'UTF-8');
        ?>
">
                        <label class="control-label" for="elm_exceptions_type"><?php 
        echo $_smarty_tpl->__("exceptions_type");
        ?>
:</label>
                        <div class="controls">
                            <select class="span3" name="product_data[exceptions_type]" id="elm_exceptions_type" <?php 
        if ($_smarty_tpl->tpl_vars['disable_selectors']->value) {
            ?>
disabled="disabled"<?php 
        }
        ?>
>
                                <option value="F" <?php 
        if ($_smarty_tpl->tpl_vars['product_data']->value['exceptions_type'] == "F") {
            ?>
selected="selected"<?php 
        }
        ?>
><?php 
        echo $_smarty_tpl->__("forbidden");
        ?>
</option>
                                <option value="A" <?php 
        if ($_smarty_tpl->tpl_vars['product_data']->value['exceptions_type'] == "A") {
            ?>
selected="selected"<?php 
        }
        ?>
><?php 
        echo $_smarty_tpl->__("allowed");
        ?>
</option>
                            </select>
                        </div>
                    </div>
                </div>

                <hr>

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

                <div id="acc_pricing_inventory" class="collapse in">
                    <div class="control-group">
                        <label class="control-label" for="elm_product_code"><?php 
        echo $_smarty_tpl->__("sku");
        ?>
:</label>
                        <div class="controls">
                            <input type="text" name="product_data[product_code]" id="elm_product_code" size="20" maxlength="32"  value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['product_data']->value['product_code'], ENT_QUOTES, 'UTF-8');
        ?>
" class="input-long" />
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="elm_list_price"><?php 
        echo $_smarty_tpl->__("list_price");
        ?>
 (<?php 
        echo $_smarty_tpl->tpl_vars['currencies']->value[$_smarty_tpl->tpl_vars['primary_currency']->value]['symbol'];
        ?>
) <?php 
        echo $_smarty_tpl->getSubTemplate("common/tooltip.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('tooltip' => __("tt_views_products_update_list_price")), 0);
        ?>
:</label>
                        <div class="controls">
                            <input type="text" name="product_data[list_price]" id="elm_list_price" size="10" value="<?php 
        echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['product_data']->value['list_price']) === null || $tmp === '' ? "0.00" : $tmp, ENT_QUOTES, 'UTF-8');
        ?>
" class="input-long" />
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="elm_in_stock"><?php 
        echo $_smarty_tpl->__("in_stock");
        ?>
:</label>
                        <div class="controls">
                            <?php 
        if ($_smarty_tpl->tpl_vars['product_data']->value['tracking'] == smarty_modifier_enum("ProductTracking::TRACK_WITH_OPTIONS")) {
            ?>
                                <?php 
            echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("edit"), 'but_href' => "product_options.inventory?product_id=" . (string) $_smarty_tpl->tpl_vars['id']->value, 'but_role' => "edit"), 0);
            ?>

                            <?php 
        } else {
            ?>
                                <input type="text" name="product_data[amount]" id="elm_in_stock" size="10" value="<?php 
            echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['product_data']->value['amount']) === null || $tmp === '' ? "1" : $tmp, ENT_QUOTES, 'UTF-8');
            ?>
" class="input-small" />
                            <?php 
        }
        ?>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="elm_zero_price_action"><?php 
        echo $_smarty_tpl->__("zero_price_action");
        ?>
:</label>
                        <div class="controls">
                            <select class="span5" name="product_data[zero_price_action]" id="elm_zero_price_action">
                                <option value="R" <?php 
        if ($_smarty_tpl->tpl_vars['product_data']->value['zero_price_action'] == "R") {
            ?>
selected="selected"<?php 
        }
        ?>
><?php 
        echo $_smarty_tpl->__("zpa_refuse");
        ?>
</option>
                                <option value="P" <?php 
        if ($_smarty_tpl->tpl_vars['product_data']->value['zero_price_action'] == "P") {
            ?>
selected="selected"<?php 
        }
        ?>
><?php 
        echo $_smarty_tpl->__("zpa_permit");
        ?>
</option>
                                <option value="A" <?php 
        if ($_smarty_tpl->tpl_vars['product_data']->value['zero_price_action'] == "A") {
            ?>
selected="selected"<?php 
        }
        ?>
><?php 
        echo $_smarty_tpl->__("zpa_ask_price");
        ?>
</option>
                            </select>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="elm_product_tracking"><?php 
        echo $_smarty_tpl->__("inventory");
        echo $_smarty_tpl->getSubTemplate("common/tooltip.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('tooltip' => __("tt_views_products_update_inventory")), 0);
        ?>
:</label>
                        <div class="controls">
                            <select class="span3" name="product_data[tracking]" id="elm_product_tracking" <?php 
        if ($_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "N") {
            ?>
disabled="disabled"<?php 
        }
        ?>
>
                                <?php 
        if ($_smarty_tpl->tpl_vars['product_options']->value) {
            ?>
                                    <option value="<?php 
            echo htmlspecialchars(smarty_modifier_enum("ProductTracking::TRACK_WITH_OPTIONS"), ENT_QUOTES, 'UTF-8');
            ?>
" <?php 
            if ($_smarty_tpl->tpl_vars['product_data']->value['tracking'] == smarty_modifier_enum("ProductTracking::TRACK_WITH_OPTIONS") && $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y") {
                ?>
selected="selected"<?php 
            }
            ?>
><?php 
            echo $_smarty_tpl->__("track_with_options");
            ?>
</option>
                                <?php 
        }
        ?>
                                <option value="<?php 
        echo htmlspecialchars(smarty_modifier_enum("ProductTracking::TRACK_WITHOUT_OPTIONS"), ENT_QUOTES, 'UTF-8');
        ?>
" <?php 
        ob_start();
        echo htmlspecialchars(smarty_modifier_enum("ProductTracking::TRACK_WITHOUT_OPTIONS"), ENT_QUOTES, 'UTF-8');
        $_tmp3 = ob_get_clean();
        if ($_smarty_tpl->tpl_vars['product_data']->value['tracking'] == $_tmp3 && $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y") {
            ?>
selected="selected"<?php 
        }
        ?>
><?php 
        echo $_smarty_tpl->__("track_without_options");
        ?>
</option>
                                <option value="<?php 
        echo htmlspecialchars(smarty_modifier_enum("ProductTracking::DO_NOT_TRACK"), ENT_QUOTES, 'UTF-8');
        ?>
" <?php 
        ob_start();
        echo htmlspecialchars(smarty_modifier_enum("ProductTracking::DO_NOT_TRACK"), ENT_QUOTES, 'UTF-8');
        $_tmp4 = ob_get_clean();
        if ($_smarty_tpl->tpl_vars['product_data']->value['tracking'] == $_tmp4 || $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "N") {
            ?>
selected="selected"<?php 
        }
        ?>
><?php 
        echo $_smarty_tpl->__("dont_track");
        ?>
</option>
                            </select>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="elm_min_qty"><?php 
        echo $_smarty_tpl->__("min_order_qty");
        ?>
:</label>
                        <div class="controls">
                            <input type="text" name="product_data[min_qty]" size="10" id="elm_min_qty" value="<?php 
        echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['product_data']->value['min_qty']) === null || $tmp === '' ? "0" : $tmp, ENT_QUOTES, 'UTF-8');
        ?>
" class="input-small" />
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="elm_max_qty"><?php 
        echo $_smarty_tpl->__("max_order_qty");
        ?>
:</label>
                        <div class="controls">
                            <input type="text" name="product_data[max_qty]" id="elm_max_qty" size="10" value="<?php 
        echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['product_data']->value['max_qty']) === null || $tmp === '' ? "0" : $tmp, ENT_QUOTES, 'UTF-8');
        ?>
" class="input-small" />
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="elm_qty_step"><?php 
        echo $_smarty_tpl->__("quantity_step");
        ?>
:</label>
                        <div class="controls">
                            <input type="text" name="product_data[qty_step]" id="elm_qty_step" size="10" value="<?php 
        echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['product_data']->value['qty_step']) === null || $tmp === '' ? "0" : $tmp, ENT_QUOTES, 'UTF-8');
        ?>
" class="input-small" />
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="elm_list_qty_count"><?php 
        echo $_smarty_tpl->__("list_quantity_count");
        ?>
:</label>
                        <div class="controls">
                            <input type="text" name="product_data[list_qty_count]" id="elm_list_qty_count" size="10" value="<?php 
        echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['product_data']->value['list_qty_count']) === null || $tmp === '' ? "0" : $tmp, ENT_QUOTES, 'UTF-8');
        ?>
" class="input-small" />
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label"><?php 
        echo $_smarty_tpl->__("taxes");
        ?>
:</label>
                        <div class="controls">
                            <input type="hidden" name="product_data[tax_ids]" value="" />
                            <?php 
        $_smarty_tpl->tpl_vars["tax"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["tax"]->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['taxes']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["tax"]->key => $_smarty_tpl->tpl_vars["tax"]->value) {
            $_smarty_tpl->tpl_vars["tax"]->_loop = true;
            ?>
                                <label class="checkbox inline" for="elm_taxes_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['tax']->value['tax_id'], ENT_QUOTES, 'UTF-8');
            ?>
">
                                    <input type="checkbox" name="product_data[tax_ids][<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['tax']->value['tax_id'], ENT_QUOTES, 'UTF-8');
            ?>
]" id="elm_taxes_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['tax']->value['tax_id'], ENT_QUOTES, 'UTF-8');
            ?>
" <?php 
            if (smarty_modifier_in_array($_smarty_tpl->tpl_vars['tax']->value['tax_id'], $_smarty_tpl->tpl_vars['product_data']->value['tax_ids'])) {
                ?>
checked="checked"<?php 
            }
            ?>
 value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['tax']->value['tax_id'], ENT_QUOTES, 'UTF-8');
            ?>
" />
                                    <?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['tax']->value['tax'], ENT_QUOTES, 'UTF-8');
            ?>
</label>
                                <?php 
        }
        if (!$_smarty_tpl->tpl_vars["tax"]->_loop) {
            ?>
                                &ndash;
                            <?php 
        }
        ?>
                        </div>
                    </div>
                </div>

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

                <div id="acc_availability" class="collapse in">
                    <?php 
        if (!fn_allowed_for("ULTIMATE:FREE")) {
            ?>
                        <div class="control-group">
                            <label class="control-label"><?php 
            echo $_smarty_tpl->__("usergroups");
            ?>
:</label>
                            <div class="controls">
                                <?php 
            echo $_smarty_tpl->getSubTemplate("common/select_usergroups.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "ug_id", 'name' => "product_data[usergroup_ids]", 'usergroups' => fn_get_usergroups(array("type" => "C", "status" => array("A", "H")), @constant('DESCR_SL')), 'usergroup_ids' => $_smarty_tpl->tpl_vars['product_data']->value['usergroup_ids'], 'input_extra' => '', 'list_mode' => false), 0);
            ?>

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

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

                        </div>
                    </div>

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

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="elm_out_of_stock_actions"><?php 
        echo $_smarty_tpl->__("out_of_stock_actions");
        echo $_smarty_tpl->getSubTemplate("common/tooltip.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('tooltip' => __("tt_views_products_update_out_of_stock_actions")), 0);
        ?>
:</label>
                        <div class="controls">
                            <select class="span3" name="product_data[out_of_stock_actions]" id="elm_out_of_stock_actions">
                                <option value="N" <?php 
        if ($_smarty_tpl->tpl_vars['product_data']->value['out_of_stock_actions'] == "N") {
            ?>
selected="selected"<?php 
        }
        ?>
><?php 
        echo $_smarty_tpl->__("none");
        ?>
</option>
                                <option value="B" <?php 
        if ($_smarty_tpl->tpl_vars['product_data']->value['out_of_stock_actions'] == "B") {
            ?>
selected="selected"<?php 
        }
        ?>
><?php 
        echo $_smarty_tpl->__("buy_in_advance");
        ?>
</option>
                                <option value="S" <?php 
        if ($_smarty_tpl->tpl_vars['product_data']->value['out_of_stock_actions'] == "S") {
            ?>
selected="selected"<?php 
        }
        ?>
><?php 
        echo $_smarty_tpl->__("sign_up_for_notification");
        ?>
</option>
                            </select>
                        </div>
                    </div>
                </div>

                <hr>

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

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

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

                    <?php 
        if ($_smarty_tpl->tpl_vars['settings']->value['General']['enable_edp'] == "Y") {
            ?>
                    <div class="control-group">
                        <label class="control-label" for="elm_product_is_edp"><?php 
            echo $_smarty_tpl->__("downloadable");
            ?>
:</label>
                        <div class="controls">
                            <label class="checkbox">
                                <input type="hidden" name="product_data[is_edp]" value="N" />
                                <input type="checkbox" name="product_data[is_edp]" id="elm_product_is_edp" value="Y" <?php 
            if ($_smarty_tpl->tpl_vars['product_data']->value['is_edp'] == "Y") {
                ?>
checked="checked"<?php 
            }
            ?>
 onclick="Tygh.$('#edp_shipping').toggleBy(); Tygh.$('#edp_unlimited').toggleBy();"/>
                            </label>
                        </div>
                    </div>

                    <div class="control-group <?php 
            if ($_smarty_tpl->tpl_vars['product_data']->value['is_edp'] != "Y") {
                ?>
hidden<?php 
            }
            ?>
" id="edp_shipping">
                        <label class="control-label" for="elm_product_edp_shipping"><?php 
            echo $_smarty_tpl->__("edp_enable_shipping");
            ?>
:</label>
                        <div class="controls">
                            <label class="checkbox">
                                <input type="hidden" name="product_data[edp_shipping]" value="N" />
                                <input type="checkbox" name="product_data[edp_shipping]" id="elm_product_edp_shipping" value="Y"<?php 
            if ($_smarty_tpl->tpl_vars['product_data']->value['edp_shipping'] == "Y") {
                ?>
checked="checked"<?php 
            }
            ?>
 />
                            </label>
                        </div>
                    </div>

                    <div class="control-group <?php 
            if ($_smarty_tpl->tpl_vars['product_data']->value['is_edp'] != "Y") {
                ?>
hidden<?php 
            }
            ?>
" id="edp_unlimited">
                        <label class="control-label" for="elm_product_edp_unlimited"><?php 
            echo $_smarty_tpl->__("time_unlimited_download");
            ?>
:</label>
                        <div class="controls">
                            <label class="checkbox">
                                <input type="hidden" name="product_data[unlimited_download]" value="N" />
                                <input type="checkbox" name="product_data[unlimited_download]" id="elm_product_edp_unlimited" value="Y" <?php 
            if ($_smarty_tpl->tpl_vars['product_data']->value['unlimited_download'] == "Y") {
                ?>
checked="checked"<?php 
            }
            ?>
 />
                            </label>
                        </div>
                    </div>
                    <?php 
        }
        ?>

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


                    <div class="control-group <?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
        ?>
">
                        <label class="control-label" for="elm_product_short_descr"><?php 
        echo $_smarty_tpl->__("short_description");
        ?>
:</label>
                        <div class="controls">
                            <textarea id="elm_product_short_descr" name="product_data[short_description]" cols="55" rows="2" class="cm-wysiwyg input-large"><?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['product_data']->value['short_description'], ENT_QUOTES, 'UTF-8');
        ?>
</textarea>
                            <?php 
        echo $_smarty_tpl->getSubTemplate("buttons/update_for_all.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('display' => $_smarty_tpl->tpl_vars['show_update_for_all']->value, 'object_id' => "short_description", 'name' => "update_all_vendors[short_description]"), 0);
        ?>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="elm_product_popularity"><?php 
        echo $_smarty_tpl->__("popularity");
        echo $_smarty_tpl->getSubTemplate("common/tooltip.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('tooltip' => __("ttc_popularity")), 0);
        ?>
:</label>
                        <div class="controls">
                            <input type="text" name="product_data[popularity]" id="elm_product_popularity" size="55" value="<?php 
        echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['product_data']->value['popularity']) === null || $tmp === '' ? 0 : $tmp, ENT_QUOTES, 'UTF-8');
        ?>
" class="input-long" />
                        </div>
                    </div>

                    <div class="control-group <?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
        ?>
">
                        <label class="control-label" for="elm_product_search_words"><?php 
        echo $_smarty_tpl->__("search_words");
        ?>
:</label>
                        <div class="controls">
                            <textarea name="product_data[search_words]" id="elm_product_search_words" cols="55" rows="2" class="input-large"><?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['product_data']->value['search_words'], ENT_QUOTES, 'UTF-8');
        ?>
</textarea>
                            <?php 
        echo $_smarty_tpl->getSubTemplate("buttons/update_for_all.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('display' => $_smarty_tpl->tpl_vars['show_update_for_all']->value, 'object_id' => 'search_words', 'name' => "update_all_vendors[search_words]"), 0);
        ?>

                        </div>
                    </div>

                    <div class="control-group <?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
        ?>
">
                        <label class="control-label" for="elm_product_promo_text"><?php 
        echo $_smarty_tpl->__("promo_text");
        ?>
:</label>
                        <div class="controls">
                            <textarea id="elm_product_promo_text" name="product_data[promo_text]" cols="55" rows="2" class="cm-wysiwyg input-large"><?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['product_data']->value['promo_text'], ENT_QUOTES, 'UTF-8');
        ?>
</textarea>
                            <?php 
        echo $_smarty_tpl->getSubTemplate("buttons/update_for_all.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('display' => $_smarty_tpl->tpl_vars['show_update_for_all']->value, 'object_id' => "promo_text", 'name' => "update_all_vendors[promo_text]"), 0);
        ?>

                        </div>
                    </div>
                </div>
                <!--content_detailed--></div> 

            

            
            <div id="content_images" class="hidden clearfix"> 
                <?php 
        echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("additional_images")), 0);
        ?>

                <?php 
        if ($_smarty_tpl->tpl_vars['product_data']->value['image_pairs']) {
            ?>
                    <div class="cm-sortable sortable-box" data-ca-sortable-table="images_links" data-ca-sortable-id-name="pair_id" id="additional_images">
                        <?php 
            $_smarty_tpl->tpl_vars["new_image_position"] = new Smarty_variable("0", null, 0);
            ?>
                        <?php 
            $_smarty_tpl->tpl_vars['pair'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['pair']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['product_data']->value['image_pairs'];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['pair']->key => $_smarty_tpl->tpl_vars['pair']->value) {
                $_smarty_tpl->tpl_vars['pair']->_loop = true;
                ?>
                            <div class="cm-row-item cm-sortable-id-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['pair']->value['pair_id'], ENT_QUOTES, 'UTF-8');
                ?>
 cm-sortable-box">
                                <div class="cm-sortable-handle sortable-bar"><img src="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['images_dir']->value, ENT_QUOTES, 'UTF-8');
                ?>
/icon_sort_bar.gif" width="26" height="25" border="0" title="<?php 
                echo $_smarty_tpl->__("sort_images");
                ?>
" alt="<?php 
                echo $_smarty_tpl->__("sort");
                ?>
" class="valign" /></div>
                                <div class="sortable-item">
                                    <?php 
                echo $_smarty_tpl->getSubTemplate("common/attach_images.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_name' => "product_additional", 'image_object_type' => "product", 'image_key' => $_smarty_tpl->tpl_vars['pair']->value['pair_id'], 'image_type' => "A", 'image_pair' => $_smarty_tpl->tpl_vars['pair']->value, 'icon_title' => __("additional_thumbnail"), 'detailed_title' => __("additional_popup_larger_image"), 'icon_text' => __("text_additional_thumbnail"), 'detailed_text' => __("text_additional_detailed_image"), 'delete_pair' => true, 'no_thumbnail' => true), 0);
                ?>

                                </div>
                                <div class="clear"></div>
                            </div>
                            <?php 
                if ($_smarty_tpl->tpl_vars['new_image_position']->value <= $_smarty_tpl->tpl_vars['pair']->value['position']) {
                    ?>
                                <?php 
                    $_smarty_tpl->tpl_vars["new_image_position"] = new Smarty_variable($_smarty_tpl->tpl_vars['pair']->value['position'], null, 0);
                    ?>
                            <?php 
                }
                ?>
                        <?php 
            }
            ?>
                    </div>
                <?php 
        }
        ?>

                <div id="box_new_image">
                    <div class="clear cm-row-item">
                        <input type="hidden" name="product_add_additional_image_data[0][position]" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['new_image_position']->value, ENT_QUOTES, 'UTF-8');
        ?>
" class="cm-image-field" />
                        <div class="image-upload-wrap pull-left"><?php 
        echo $_smarty_tpl->getSubTemplate("common/attach_images.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_name' => "product_add_additional", 'image_object_type' => "product", 'image_type' => "A", 'icon_title' => __("additional_thumbnail"), 'detailed_title' => __("additional_popup_larger_image"), 'icon_text' => __("text_additional_thumbnail"), 'detailed_text' => __("text_additional_detailed_image"), 'no_thumbnail' => true), 0);
        ?>
</div>
                        <div class="pull-right"><?php 
        echo $_smarty_tpl->getSubTemplate("buttons/multiple_buttons.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('item_id' => "new_image"), 0);
        ?>
</div>
                    </div>
                </div>

            </div> 
            

            
            <div id="content_seo" class="hidden">

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

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

                <div id="acc_seo_meta" class="collapse in">
                    <div class="control-group <?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
            ?>
">
                        <label class="control-label" for="elm_product_page_title"><?php 
            echo $_smarty_tpl->__("page_title");
            echo $_smarty_tpl->getSubTemplate("common/tooltip.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('tooltip' => __("ttc_page_title")), 0);
            ?>
:</label>
                        <div class="controls">
                            <input type="text" name="product_data[page_title]" id="elm_product_page_title" size="55" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['product_data']->value['page_title'], ENT_QUOTES, 'UTF-8');
            ?>
" class="input-large" />
                            <?php 
            echo $_smarty_tpl->getSubTemplate("buttons/update_for_all.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('display' => $_smarty_tpl->tpl_vars['show_update_for_all']->value, 'object_id' => "page_title", 'name' => "update_all_vendors[page_title]"), 0);
            ?>

                        </div>
                    </div>

                    <div class="control-group <?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
            ?>
">
                        <label class="control-label" for="elm_product_meta_descr"><?php 
            echo $_smarty_tpl->__("meta_description");
            ?>
:</label>
                        <div class="controls">
                            <textarea name="product_data[meta_description]" id="elm_product_meta_descr" cols="55" rows="2" class="input-large"><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['product_data']->value['meta_description'], ENT_QUOTES, 'UTF-8');
            ?>
</textarea>
                            <?php 
            echo $_smarty_tpl->getSubTemplate("buttons/update_for_all.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('display' => $_smarty_tpl->tpl_vars['show_update_for_all']->value, 'object_id' => "meta_description", 'name' => "update_all_vendors[meta_description]"), 0);
            ?>

                        </div>
                    </div>

                    <div class="control-group <?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
            ?>
">
                        <label class="control-label" for="elm_product_meta_keywords"><?php 
            echo $_smarty_tpl->__("meta_keywords");
            ?>
:</label>
                        <div class="controls">
                            <textarea name="product_data[meta_keywords]" id="elm_product_meta_keywords" cols="55" rows="2" class="input-large"><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['product_data']->value['meta_keywords'], ENT_QUOTES, 'UTF-8');
            ?>
</textarea>
                            <?php 
            echo $_smarty_tpl->getSubTemplate("buttons/update_for_all.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('display' => $_smarty_tpl->tpl_vars['show_update_for_all']->value, 'object_id' => "meta_keywords", 'name' => "update_all_vendors[meta_keywords]"), 0);
            ?>

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

            </div>
            

            
            <div id="content_shippings" class="hidden"> 
                <?php 
        echo $_smarty_tpl->getSubTemplate("views/products/components/products_shipping_settings.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
        ?>

            </div> 
            

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

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

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

            
            
            <?php 
        echo $_smarty_tpl->getSubTemplate("views/products/components/products_update_features.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_id' => $_smarty_tpl->tpl_vars['product_data']->value['product_id']), 0);
        ?>

            


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

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

            </div>


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

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


            
            <?php 
        $_smarty_tpl->_capture_stack[0][] = array("buttons", null, null);
        ob_start();
        ?>
                <?php 
        echo $_smarty_tpl->getSubTemplate("common/view_tools.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('url' => "products.update?product_id="), 0);
        ?>


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

                            <?php 
                if ($_smarty_tpl->tpl_vars['view_uri']->value) {
                    ?>
                                <li><?php 
                    smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'target' => "_blank", 'text' => __("preview"), 'href' => $_smarty_tpl->tpl_vars['view_uri']->value));
                    ?>
</li>
                                <li class="divider"></li>
                            <?php 
                }
                ?>
                            <li><?php 
                smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => __("clone"), 'class' => "cm-post", 'href' => "products.clone?product_id=" . (string) $_smarty_tpl->tpl_vars['id']->value));
                ?>
</li>
                            <?php 
                if ($_smarty_tpl->tpl_vars['allow_save']->value) {
                    ?>
                                <li><?php 
                    smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => __("delete"), 'class' => "cm-confirm cm-post", 'href' => "products.delete?product_id=" . (string) $_smarty_tpl->tpl_vars['id']->value));
                    ?>
</li>
                            <?php 
                }
                ?>
                        <?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:update_tools_list"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

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

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

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

        </form> 

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


        <?php 
        if ($_smarty_tpl->tpl_vars['id']->value) {
            ?>
            
            <div class="cm-hide-save-button hidden" id="content_options">
                <?php 
            echo $_smarty_tpl->getSubTemplate("views/products/components/products_update_options.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
            ?>

            </div>
            

            
            <?php 
            if ($_smarty_tpl->tpl_vars['settings']->value['General']['enable_edp'] == "Y") {
                ?>
            <div id="content_files" class="cm-hide-save-button hidden">
                <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:content_files"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "products:content_files"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

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

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

            </div>
            <?php 
            }
            ?>
            

            
            <div id="content_subscribers" class="cm-hide-save-button hidden">
                <?php 
            echo $_smarty_tpl->getSubTemplate("views/products/components/product_subscribers.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_id' => $_smarty_tpl->tpl_vars['id']->value), 0);
            ?>

            </div>
            
        <?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/tabsbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('content' => Smarty::$_smarty_vars['capture']['tabsbox'], 'group_name' => $_smarty_tpl->tpl_vars['runtime']->value['controller'], 'active_tab' => $_REQUEST['selected_section'], 'track' => true), 0);
        ?>


<?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->smarty->_tag_stack[] = array('hook', array('name' => "products:update_mainbox_params"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "products:update_mainbox_params"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>


<?php 
            if ($_smarty_tpl->tpl_vars['id']->value) {
                ?>
    <?php 
                $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null);
                ob_start();
                ?>
        <?php 
                ob_start();
                echo $_smarty_tpl->__("editing_product");
                $_tmp5 = ob_get_clean();
                echo htmlspecialchars(preg_replace('!<[^>]*?>!', ' ', $_tmp5 . ": " . (string) $_smarty_tpl->tpl_vars['product_data']->value['product']), ENT_QUOTES, 'UTF-8');
                ?>

    <?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();
                }
            } else {
                ?>
    <?php 
                $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null);
                ob_start();
                ?>
        <?php 
                echo $_smarty_tpl->__("new_product");
                ?>

    <?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 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "products:update_mainbox_params"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>


<?php 
        echo $_smarty_tpl->getSubTemplate("common/mainbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => Smarty::$_smarty_vars['capture']['mainbox_title'], 'content' => Smarty::$_smarty_vars['capture']['mainbox'], 'select_languages' => $_smarty_tpl->tpl_vars['id']->value, 'buttons' => Smarty::$_smarty_vars['capture']['buttons'], 'adv_buttons' => Smarty::$_smarty_vars['capture']['adv_buttons']), 0);
    }
* license  and  accept  to the terms of the  License Agreement can install *
* and use this program.                                                    *
*                                                                          *
****************************************************************************
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    return;
}
if ($mode == 'update') {
    // Add new tab to page sections
    // [Page sections]
    // Add new tab to page sections
    Registry::set('navigation.tabs.reward_points', array('title' => __('reward_points'), 'js' => true));
    // [/Page sections]
    Registry::get('view')->assign('reward_points', fn_get_reward_points($_REQUEST['category_id'], CATEGORY_REWARD_POINTS));
    Registry::get('view')->assign('object_type', CATEGORY_REWARD_POINTS);
} elseif ($mode == 'add') {
    // Add new tab to page sections
    // [Page sections]
    Registry::set('navigation.tabs.reward_points', array('title' => __('reward_points'), 'js' => true));
    // [/Page sections]
    Registry::get('view')->assign('object_type', CATEGORY_REWARD_POINTS);
}
Registry::get('view')->assign('reward_usergroups', fn_array_merge(fn_get_default_usergroups(), fn_get_usergroups('C')));
/** /Body **/
Example #25
0
/**
 * Promotions post processing
 *
 * @param string $status_to new order status
 * @param string $status_from original order status
 * @param array $order_info order information
 * @param array $force_notification Array with notification rules
 * @return boolean always true
 */
function fn_promotion_post_processing($status_to, $status_from, $order_info, $force_notification = array())
{
    $order_statuses = fn_get_statuses(STATUSES_ORDER, array(), true);
    $notify_user = isset($force_notification['C']) ? $force_notification['C'] : (!empty($order_statuses[$status_to]['params']['notify']) && $order_statuses[$status_to]['params']['notify'] == 'Y' ? true : false);
    $status_from_is_positive = fn_status_is_positive($order_statuses[$status_from]);
    $status_to_is_positive = fn_status_is_positive($order_statuses[$status_to]);
    if (empty($order_info['promotions'])) {
        return false;
    }
    // Process numbers of usage for Open statuses
    if ($status_to != $status_from && fn_status_is_positive($order_statuses[$status_from], true) != fn_status_is_positive($order_statuses[$status_to], true)) {
        // Post processing
        if (fn_status_is_positive($order_statuses[$status_to], true)) {
            db_query("UPDATE ?:promotions SET number_of_usages = number_of_usages + 1 WHERE promotion_id IN (?n)", array_keys($order_info['promotions']));
        } else {
            db_query("UPDATE ?:promotions SET number_of_usages = number_of_usages - 1 WHERE promotion_id IN (?n)", array_keys($order_info['promotions']));
        }
    }
    if ($status_to != $status_from && $status_from_is_positive != $status_to_is_positive) {
        // Apply pending actions
        foreach ($order_info['promotions'] as $k => $v) {
            if (!empty($v['bonuses'])) {
                foreach ($v['bonuses'] as $bonus) {
                    // Assign usergroup
                    if ($bonus['bonus'] == 'give_usergroup') {
                        $is_ug_already_assigned = false;
                        if (empty($order_info['user_id'])) {
                            continue;
                        }
                        // Don't assing a disabled usergroup
                        $system_usergroups = fn_get_usergroups(array('type' => 'C', 'status' => array('A', 'H')), CART_LANGUAGE);
                        if (!empty($system_usergroups[$bonus['value']]['status']) && in_array($system_usergroups[$bonus['value']]['status'], array('A', 'H'))) {
                            if ($order_statuses[$status_to]['params']['inventory'] == 'D') {
                                // Don't assing the usergroup to the user if it's already assigned
                                $current_user_usergroups = fn_get_user_usergroups($order_info['user_id']);
                                foreach ($current_user_usergroups as $ug) {
                                    if (isset($ug['usergroup_id']) && $bonus['value'] == $ug['usergroup_id'] && in_array($ug['status'], array('A', 'H'))) {
                                        $is_ug_already_assigned = true;
                                        break;
                                    }
                                }
                                if (!$is_ug_already_assigned) {
                                    db_query("REPLACE INTO ?:usergroup_links SET user_id = ?i, usergroup_id = ?i, status = 'A'", $order_info['user_id'], $bonus['value']);
                                    $activated = true;
                                }
                            } else {
                                db_query("UPDATE ?:usergroup_links SET status = 'F' WHERE user_id = ?i AND usergroup_id = ?i", $order_info['user_id'], $bonus['value']);
                                $activated = false;
                            }
                            if ($notify_user == true && !$is_ug_already_assigned) {
                                $prefix = $activated == true ? 'activation' : 'disactivation';
                                Mailer::sendMail(array('to' => $order_info['email'], 'from' => 'company_users_department', 'data' => array('user_data' => fn_get_user_info($order_info['user_id']), 'usergroups' => fn_get_usergroups(array('status' => array('A', 'H')), $order_info['lang_code']), 'usergroup_ids' => (array) $bonus['value']), 'tpl' => 'profiles/usergroup_' . $prefix . '.tpl', 'company_id' => $order_info['company_id']), 'C', $order_info['lang_code']);
                            }
                        } else {
                            if (AREA == 'C') {
                                fn_set_notification('E', __('error'), __('unable_to_assign_usergroup'));
                            }
                        }
                    } elseif ($bonus['bonus'] == 'give_coupon') {
                        $promotion_data = fn_get_promotion_data($bonus['value']);
                        if (empty($promotion_data)) {
                            continue;
                        }
                        if ($status_to_is_positive) {
                            fn_promotion_update_condition($promotion_data['conditions']['conditions'], 'add', 'auto_coupons', $bonus['coupon_code']);
                            if ($notify_user == true) {
                                Mailer::sendMail(array('to' => $order_info['email'], 'from' => 'company_users_department', 'data' => array('promotion_data' => $promotion_data, 'bonus_data' => $bonus, 'order_info' => $order_info), 'tpl' => 'promotions/give_coupon.tpl', 'company_id' => $order_info['company_id']), 'C', $order_info['lang_code']);
                            }
                        } else {
                            fn_promotion_update_condition($promotion_data['conditions']['conditions'], 'remove', 'auto_coupons', $bonus['coupon_code']);
                        }
                        db_query("UPDATE ?:promotions SET conditions = ?s, conditions_hash = ?s, users_conditions_hash = ?s WHERE promotion_id = ?i", serialize($promotion_data['conditions']), fn_promotion_serialize($promotion_data['conditions']['conditions']), fn_promotion_serialize_users_conditions($promotion_data['conditions']['conditions']), $bonus['value']);
                    }
                }
            }
        }
    }
    return true;
}
Example #26
0
    Registry::get('view')->assign('search', $params);
    Registry::get('view')->assign('page_types', fn_get_page_object_by_type());
    if (!empty($_REQUEST['except_id'])) {
        Registry::get('view')->assign('except_id', $_REQUEST['except_id']);
    }
    if ($mode == 'picker') {
        if (!empty($_REQUEST['combination_suffix'])) {
            Registry::get('view')->assign('combination_suffix', $_REQUEST['combination_suffix']);
        }
        Registry::get('view')->display('pickers/pages/picker_contents.tpl');
        exit;
    }
} elseif ($mode == 'get_parent_pages') {
    $page_data = array();
    if (isset($_REQUEST['page_id'])) {
        Registry::get('view')->assign('page_id', $_REQUEST['page_id']);
        $page_data = fn_get_page_data($_REQUEST['page_id'], DESCR_SL);
    } else {
        Registry::get('view')->assign('show_all', true);
    }
    if (!empty($_REQUEST['parent_id'])) {
        $page_data['parent_id'] = $_REQUEST['parent_id'];
    }
    Registry::get('view')->assign('page_data', $page_data);
    Registry::get('view')->assign('parent_pages', fn_get_pages_plain_list());
    Registry::get('view')->display('views/pages/components/parent_page_selector.tpl');
    exit;
}
Registry::get('view')->assign('usergroups', fn_get_usergroups('C', DESCR_SL));
/* /Preparing page data for templates and performing simple actions*/
/** /Body **/
    function content_55dc7cc5c1a670_13636549($_smarty_tpl)
    {
        if (!is_callable('smarty_block_hook')) {
            include '/var/www/html/market/app/functions/smarty_plugins/block.hook.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('information', 'name', 'description', 'edit_content_on_site', 'seo_meta_data', 'page_title', 'ttc_page_title', 'meta_description', 'meta_keywords', 'availability', 'usergroups', 'creation_date', 'use_avail_period', 'avail_from', 'avail_till', 'preview', 'clone_this_page', 'delete_this_page', 'pages'));
        if ($_smarty_tpl->tpl_vars['page_data']->value['page_id']) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["id"] = new Smarty_variable($_smarty_tpl->tpl_vars['page_data']->value['page_id'], null, 0);
        } else {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["id"] = new Smarty_variable(0, null, 0);
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['id']->value && $_smarty_tpl->tpl_vars['page_type']->value != @constant('PAGE_TYPE_LINK') && (!fn_allowed_for("ULTIMATE") || $_smarty_tpl->tpl_vars['runtime']->value['company_id'])) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars['view_uri'] = new Smarty_variable(fn_get_preview_url("pages.view?page_id=" . (string) $_smarty_tpl->tpl_vars['id']->value, $_smarty_tpl->tpl_vars['page_data']->value, $_smarty_tpl->tpl_vars['auth']->value['user_id']), null, 0);
        }
        ?>

<?php 
        $_smarty_tpl->tpl_vars["allow_save"] = new Smarty_variable(true, null, 0);
        if (fn_allowed_for("ULTIMATE")) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["allow_save"] = new Smarty_variable(fn_allow_save_object($_smarty_tpl->tpl_vars['page_data']->value, "pages"), null, 0);
        }
        $_smarty_tpl->tpl_vars['show_save_btn'] = new Smarty_variable($_smarty_tpl->tpl_vars['allow_save']->value, 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;
        }
        $_smarty_tpl->_capture_stack[0][] = array("mainbox", null, null);
        ob_start();
        ?>

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

<form action="<?php 
        echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
        ?>
" method="post" name="page_update_form" class="form-horizontal form-edit  <?php 
        if (!$_smarty_tpl->tpl_vars['allow_save']->value) {
            ?>
cm-hide-inputs<?php 
        }
        ?>
" enctype="multipart/form-data">

<div id="update_page_form_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['page_data']->value['page_id'], ENT_QUOTES, 'UTF-8');
        ?>
">
    <input type="hidden" class="cm-no-hide-input" id="selected_section" name="selected_section" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['selected_section']->value, ENT_QUOTES, 'UTF-8');
        ?>
"/>
    <input type="hidden" class="cm-no-hide-input" id="page_id" name="page_id" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
        ?>
" />
    <input type="hidden" class="cm-no-hide-input" name="page_data[page_type]" id="page_type" size="55" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['page_type']->value, ENT_QUOTES, 'UTF-8');
        ?>
"/>
    <input type="hidden" class="cm-no-hide-input" name="come_from" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['come_from']->value, ENT_QUOTES, 'UTF-8');
        ?>
" />
    <input type="hidden" class="cm-no-hide-input" name="result_ids" value="update_page_form_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['page_data']->value['page_id'], ENT_QUOTES, 'UTF-8');
        ?>
"/>

    <div id="content_basic">

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

    <div id="pages_information_setting" class="in collapse">
    <fieldset>
        <?php 
        echo $_smarty_tpl->getSubTemplate("views/pages/components/parent_page_selector.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
        ?>


        <div class="control-group">
            <label for="elm_page_name" class="control-label cm-required"><?php 
        echo $_smarty_tpl->__("name");
        ?>
:</label>
            <div class="controls">
                <input type="text" name="page_data[page]" id="elm_page_name" size="55" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['page_data']->value['page'], ENT_QUOTES, 'UTF-8');
        ?>
" class="input-large" />
            </div>
        </div>

        <?php 
        if ($_smarty_tpl->tpl_vars['page_data']->value['parent_id'] != 0 && $_smarty_tpl->tpl_vars['page_data']->value['page_id'] != 0) {
            ?>
            <?php 
            $_smarty_tpl->tpl_vars["disable_company_picker"] = new Smarty_variable(true, null, 0);
            ?>
        <?php 
        }
        ?>
        <?php 
        if (fn_allowed_for("MULTIVENDOR")) {
            ?>
            <?php 
            $_smarty_tpl->tpl_vars["zero_company_id_name_lang_var"] = new Smarty_variable("none", null, 0);
            ?>
        <?php 
        }
        ?>
        <?php 
        echo $_smarty_tpl->getSubTemplate("views/companies/components/company_field.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('name' => "page_data[company_id]", 'id' => "elm_page_data_company_id", 'zero_company_id_name_lang_var' => $_smarty_tpl->tpl_vars['zero_company_id_name_lang_var']->value, 'selected' => $_smarty_tpl->tpl_vars['page_data']->value['company_id'], 'reload_form' => true, 'disable_company_picker' => $_smarty_tpl->tpl_vars['disable_company_picker']->value), 0);
        ?>


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


        <?php 
            if ($_smarty_tpl->tpl_vars['page_type']->value != @constant('PAGE_TYPE_LINK')) {
                ?>
        <div class="control-group">
            <label class="control-label" for="elm_page_descr"><?php 
                echo $_smarty_tpl->__("description");
                ?>
:</label>
            <div class="controls">
                <textarea id="elm_page_descr" name="page_data[description]" cols="55" rows="8" class="cm-wysiwyg input-large"><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['page_data']->value['description'], ENT_QUOTES, 'UTF-8');
                ?>
</textarea>

                <?php 
                if ($_smarty_tpl->tpl_vars['view_uri']->value) {
                    ?>
                    <?php 
                    ob_start();
                    echo htmlspecialchars(urlencode($_smarty_tpl->tpl_vars['view_uri']->value), ENT_QUOTES, 'UTF-8');
                    $_tmp1 = ob_get_clean();
                    ob_start();
                    if (fn_allowed_for("ULTIMATE")) {
                        echo "&switch_company_id=";
                        echo (string) $_smarty_tpl->tpl_vars['page_data']->value['company_id'];
                    }
                    $_tmp2 = ob_get_clean();
                    echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_href' => "customization.update_mode?type=live_editor&status=enable&frontend_url=" . $_tmp1 . $_tmp2, 'but_text' => __("edit_content_on_site"), 'but_role' => "action", 'but_meta' => "btn-small btn-live-edit cm-post", 'but_target' => "_blank"), 0);
                    ?>

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

        <?php 
            if ($_smarty_tpl->tpl_vars['page_type']->value == @constant('PAGE_TYPE_LINK')) {
                ?>
            <?php 
                echo $_smarty_tpl->getSubTemplate("views/pages/components/pages_link.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
                ?>

        <?php 
            }
            ?>

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


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


    </fieldset>
    </div>

    <?php 
        if ($_smarty_tpl->tpl_vars['page_type']->value != @constant('PAGE_TYPE_LINK')) {
            ?>
    <?php 
            echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("seo_meta_data"), 'target' => "#pages_seo_meta_data_setting"), 0);
            ?>

    <div id="pages_seo_meta_data_setting" class="in collapse">
        <fieldset>

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

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

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

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

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


  <div id="pages_availability_setting" class="in collapse">
      <fieldset>
          <?php 
        if (!fn_allowed_for("ULTIMATE:FREE")) {
            ?>
              <div class="control-group">
                  <label class="control-label"><?php 
            echo $_smarty_tpl->__("usergroups");
            ?>
:</label>
                      <div class="controls">
                          <?php 
            echo $_smarty_tpl->getSubTemplate("common/select_usergroups.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "ug_id", 'name' => "page_data[usergroup_ids]", 'usergroups' => fn_get_usergroups(array("type" => "C", "status" => array("A", "H")), @constant('DESCR_SL')), 'usergroup_ids' => $_smarty_tpl->tpl_vars['page_data']->value['usergroup_ids'], 'input_extra' => '', 'list_mode' => false), 0);
            ?>

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

              </div>
          </div>

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


          <div class="control-group">
              <label class="control-label" for="elm_page_use_avail_period"><?php 
        echo $_smarty_tpl->__("use_avail_period");
        ?>
:</label>
              <div class="controls">
                  <input type="hidden" name="page_data[use_avail_period]" value="N">
                    <span class="checkbox">
                        <input type="checkbox" name="page_data[use_avail_period]" id="elm_page_use_avail_period" <?php 
        if ($_smarty_tpl->tpl_vars['page_data']->value['use_avail_period'] == "Y") {
            ?>
checked="checked"<?php 
        }
        ?>
 value="Y"  onclick="fn_activate_calendar(this);">
                    </span>
              </div>
          </div>

          <?php 
        $_smarty_tpl->_capture_stack[0][] = array("calendar_disable", null, null);
        ob_start();
        if ($_smarty_tpl->tpl_vars['page_data']->value['use_avail_period'] != "Y") {
            ?>
disabled="disabled"<?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="control-group">
              <label class="control-label" for="elm_page_avail_from"><?php 
        echo $_smarty_tpl->__("avail_from");
        ?>
:</label>
              <div class="controls">
                  <?php 
        echo $_smarty_tpl->getSubTemplate("common/calendar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('date_id' => "elm_page_avail_from", 'date_name' => "page_data[avail_from_timestamp]", 'date_val' => ($tmp = @$_smarty_tpl->tpl_vars['page_data']->value['avail_from_timestamp']) === null || $tmp === '' ? @constant('TIME') : $tmp, 'start_year' => $_smarty_tpl->tpl_vars['settings']->value['Company']['company_start_year'], 'extra' => Smarty::$_smarty_vars['capture']['calendar_disable']), 0);
        ?>

              </div>
          </div>

          <div class="control-group">
              <label class="control-label" for="elm_page_avail_till"><?php 
        echo $_smarty_tpl->__("avail_till");
        ?>
:</label>
              <div class="controls">
                  <?php 
        echo $_smarty_tpl->getSubTemplate("common/calendar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('date_id' => "elm_page_avail_till", 'date_name' => "page_data[avail_till_timestamp]", 'date_val' => ($tmp = @$_smarty_tpl->tpl_vars['page_data']->value['avail_till_timestamp']) === null || $tmp === '' ? @constant('TIME') : $tmp, 'start_year' => $_smarty_tpl->tpl_vars['settings']->value['Company']['company_start_year'], 'extra' => Smarty::$_smarty_vars['capture']['calendar_disable']), 0);
        ?>

              </div>
          </div>
    </fieldset>
  </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';
            ?>
 language="javascript">
                function fn_activate_calendar(el)
                {
                    Tygh.$('#elm_page_avail_from').prop('disabled', !el.checked);
                    Tygh.$('#elm_page_avail_till').prop('disabled', !el.checked);
                }
            <?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>

    <div id="content_addons">
        <?php 
        if ($_smarty_tpl->tpl_vars['page_type']->value != @constant('PAGE_TYPE_LINK')) {
            ?>
            <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "pages:detailed_content"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "pages:detailed_content"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

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

        <?php 
        }
        ?>
    </div>

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

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


<?php 
        if (!$_smarty_tpl->tpl_vars['id']->value) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["_title"] = new Smarty_variable($_smarty_tpl->__($_smarty_tpl->tpl_vars['page_type_data']->value['new_name']), null, 0);
        } else {
            ?>
    <?php 
            ob_start();
            echo $_smarty_tpl->__($_smarty_tpl->tpl_vars['page_type_data']->value['edit_name']);
            $_tmp3 = ob_get_clean();
            $_smarty_tpl->tpl_vars["_title"] = new Smarty_variable($_tmp3 . ": " . (string) $_smarty_tpl->tpl_vars['page_data']->value['page'], null, 0);
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["select_languages"] = new Smarty_variable(true, null, 0);
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['view_uri']->value) {
                ?>
        <?php 
                $_smarty_tpl->_capture_stack[0][] = array("preview", null, null);
                ob_start();
                ?>
            <li><?php 
                smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'target' => "_blank", 'text' => __("preview"), 'href' => $_smarty_tpl->tpl_vars['view_uri']->value));
                ?>
</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 
            }
        }
        ?>

<?php 
        $_smarty_tpl->_capture_stack[0][] = array("buttons", null, null);
        ob_start();
        ?>
    <?php 
        if ($_smarty_tpl->tpl_vars['id']->value) {
            ?>
        <?php 
            $_smarty_tpl->_capture_stack[0][] = array("tools_list", null, null);
            ob_start();
            ?>

            <?php 
            $_smarty_tpl->tpl_vars["_p"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["_p"]->_loop = false;
            $_smarty_tpl->tpl_vars["_k"] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['page_types']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["_p"]->key => $_smarty_tpl->tpl_vars["_p"]->value) {
                $_smarty_tpl->tpl_vars["_p"]->_loop = true;
                $_smarty_tpl->tpl_vars["_k"]->value = $_smarty_tpl->tpl_vars["_p"]->key;
                ?>
                <li><?php 
                smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => __($_smarty_tpl->tpl_vars['_p']->value['add_name']), 'href' => "pages.add?page_type=" . (string) $_smarty_tpl->tpl_vars['_k']->value . "&parent_id=" . (string) $_smarty_tpl->tpl_vars['id']->value . "&come_from=" . (string) $_smarty_tpl->tpl_vars['come_from']->value));
                ?>
</li>
            <?php 
            }
            ?>

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

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

            <li class="divider"></li>
            <?php 
            echo Smarty::$_smarty_vars['capture']['preview'];
            ?>

            <?php 
            if ($_smarty_tpl->tpl_vars['id']->value) {
                ?>
                <li><?php 
                smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'class' => "cm-post", 'text' => __("clone_this_page"), 'href' => "pages.clone?page_id=" . (string) $_smarty_tpl->tpl_vars['id']->value . "&come_from=" . (string) $_smarty_tpl->tpl_vars['come_from']->value));
                ?>
</li>
            <?php 
            }
            ?>
            <?php 
            if ($_smarty_tpl->tpl_vars['allow_save']->value) {
                ?>
                <li><?php 
                smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => __("delete_this_page"), 'class' => "cm-confirm cm-post", 'href' => "pages.delete?page_id=" . (string) $_smarty_tpl->tpl_vars['id']->value . "&come_from=" . (string) $_smarty_tpl->tpl_vars['come_from']->value));
                ?>
</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 
        }
        ?>
    <?php 
        smarty_template_function_dropdown($_smarty_tpl, array('content' => Smarty::$_smarty_vars['capture']['tools_list']));
        ?>


    <?php 
        if (!$_smarty_tpl->tpl_vars['show_save_btn']->value) {
            ?>
        <?php 
            $_smarty_tpl->tpl_vars["hide_first_button"] = new Smarty_variable(true, null, 0);
            ?>
        <?php 
            $_smarty_tpl->tpl_vars["hide_second_button"] = new Smarty_variable(true, null, 0);
            ?>
    <?php 
        }
        ?>
    <?php 
        echo $_smarty_tpl->getSubTemplate("buttons/save_cancel.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[pages.update]", 'hide_first_button' => $_smarty_tpl->tpl_vars['hide_first_button']->value, 'hide_second_button' => $_smarty_tpl->tpl_vars['hide_second_button']->value, 'but_target_form' => "page_update_form", 'save' => $_smarty_tpl->tpl_vars['id']->value), 0);
        ?>

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

<!--update_page_form_<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['page_data']->value['page_id'], ENT_QUOTES, 'UTF-8');
        ?>
--></div>
</form>

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

<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "pages:tabs_extra"), $_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();
        }
        echo $_smarty_tpl->getSubTemplate("common/tabsbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('content' => Smarty::$_smarty_vars['capture']['tabsbox'], 'track' => true), 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();
        if ($_smarty_tpl->tpl_vars['pages_tree']->value) {
            ?>
    <div class="sidebar-row">
        <h6><?php 
            echo $_smarty_tpl->__("pages");
            ?>
</h6>
        <div class="nested-tree">
            <?php 
            echo $_smarty_tpl->getSubTemplate("views/pages/components/pages_links_tree.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('show_all' => false, 'pages_tree' => $_smarty_tpl->tpl_vars['pages_tree']->value), 0);
            ?>

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

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

<?php 
    }
Example #28
0
    Registry::get('view')->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
    Registry::get('view')->assign('states', fn_get_all_states());
    if (Registry::get('settings.General.user_multiple_profiles') == 'Y') {
        Registry::get('view')->assign('user_profiles', fn_get_user_profiles($auth['user_id']));
    }
    // Delete profile
} elseif ($mode == 'delete_profile') {
    fn_delete_user_profile($auth['user_id'], $_REQUEST['profile_id']);
    return array(CONTROLLER_STATUS_OK, 'profiles.update');
} elseif ($mode == 'usergroups') {
    if (empty($auth['user_id']) || empty($_REQUEST['type']) || empty($_REQUEST['usergroup_id'])) {
        return array(CONTROLLER_STATUS_DENIED);
    }
    if (fn_request_usergroup($auth['user_id'], $_REQUEST['usergroup_id'], $_REQUEST['type'])) {
        $user_data = fn_get_user_info($auth['user_id']);
        $usergroups = fn_get_usergroups(array('type' => 'C', 'status' => 'A'), Registry::get('settings.Appearance.backend_default_language'));
        Mailer::sendMail(array('to' => 'default_company_users_department', 'from' => 'default_company_users_department', 'reply_to' => $user_data['email'], 'data' => array('user_data' => $user_data, 'usergroup' => !empty($usergroups[$_REQUEST['usergroup_id']]['usergroup']) ? $usergroups[$_REQUEST['usergroup_id']]['usergroup'] : null, 'usergroup_id' => $_REQUEST['usergroup_id']), 'tpl' => 'profiles/usergroup_request.tpl', 'company_id' => $user_data['company_id']), 'A', Registry::get('settings.Appearance.backend_default_language'));
    }
    return array(CONTROLLER_STATUS_OK, 'profiles.update');
} elseif ($mode == 'success_add') {
    if (empty($auth['user_id'])) {
        return array(CONTROLLER_STATUS_REDIRECT, 'profiles.add');
    }
    fn_add_breadcrumb(__('registration'));
}
/**
 * Requests usergroup for customer
 *
 * @param int $user_id User identifier
 * @param int $usergroup_id Usergroup identifier
 * @param string $type Type of request (join|cancel)