$cw_allowed_tunnels[] = 'cw\\addon_skeleton\\get_available_entries_list';
// Include functions
cw_include('addons/' . addon_name . '/include/func.php');
// Sometimes some part of initialization must be after all addons init - in post_init.php
cw_set_controller('init/post_init.php', 'addons/' . addon_name . '/post_init.php', EVENT_POST);
// You can define different hooks depending on area or $target or use common init sequence.
if (APP_AREA == 'admin') {
    // Define own controller which does not exists yet using EVENT_REPLACE
    /* Place comment here with description of functionality provided by this additional controller */
    cw_set_controller(APP_AREA . '/' . addon_target . '.php', 'addons/' . addon_name . '/admin/' . addon_target . '.php', EVENT_REPLACE);
}
if (APP_AREA == 'customer') {
    // Add own controller to existing one using EVENT_POST or EVENT_PRE
    /* Place comment here with description of functionality provided by this additional controller */
    cw_set_controller(APP_AREA . '/index.php', 'addons/' . addon_name . '/customer/index.php', EVENT_POST);
}
// Event handlers
/* Place comment here with description of functionality provided by this event handler */
cw_event_listen('on_login', 'cw\\' . addon_name . '\\on_login');
// specify full function name for event handlers including namespace
// Cron handlers. See docs/core.cron.txt and core/cron/cron.php
cw_event_listen('on_cron_daily', 'cw\\' . addon_name . '\\on_cron_daily');
// Function hooks. Note you can use same function name under scope of addon's namespace
/* Place comment here with description of functionality provided by this hook or how it alters default function */
cw_set_hook('cw_products_in_cart', 'cw\\' . addon_name . '\\cw_products_in_cart', EVENT_POST);
// Hook templates
cw_addons_set_template(array('replace', 'admin/main/' . addon_target . '.tpl', 'addons/' . addon_name . '/admin/' . addon_target . '.tpl'), array('post', 'elements/bottom.tpl', 'addons/' . addon_name . '/customer/my_bottom.tpl'), array('pre', 'elements/bottom_admin.tpl@label', 'addons/' . addon_name . '/admin/my_bottom_admin.tpl'));
// Add addon CSS style
cw_addons_add_css('addons/' . addon_name . '/my_addon.css');
// Add addon JS
cw_addons_add_js('addons/' . addon_name . '/my_addon.js');
<?php

cw_include('addons/ppd/include/func.hooks.php');
cw_addons_set_controllers(array('replace', 'admin/filetypes.php', 'addons/ppd/admin/filetypes.php'), array('replace', 'customer/getfile.php', 'addons/ppd/customer/getfile.php'), array('pre', 'include/products/modify.php', 'addons/ppd/admin/main.php'), array('pre', 'customer/product.php', 'addons/ppd/customer/main.php'));
cw_addons_set_template(array('replace', 'admin/main/filetypes.tpl', 'addons/ppd/admin/filetypes.tpl'));
cw_addons_set_hooks(array('post', 'cw_doc_change_status_C', 'cw_ppd_doc_change_status_C'), array('post', 'cw_doc_change_status_P', 'cw_ppd_doc_change_status_C'), array('post', 'cw_doc_change_status_D', 'cw_ppd_doc_change_status_D'), array('post', 'cw_doc_delete', 'cw_ppd_doc_delete'), array('pre', 'cw_user_delete', 'cw_ppd_user_delete'), array('post', 'cw_tabs_js_abstract', 'cw_ppd_tabs_js_abstract'));
cw_set_hook('cw_delete_product', 'cw_ppd_delete_product', EVENT_POST);
cw_set_hook('cw_product_clone', 'cw_ppd_product_clone', EVENT_POST);
if (APP_AREA == 'admin') {
    cw_addons_add_css('addons/ppd/admin/main.css');
}
if (APP_AREA == 'customer') {
    cw_addons_add_css('addons/ppd/customer/main.css');
}
$_addon_tables = array('ppd_files', 'ppd_types', 'ppd_downloads', 'ppd_stats');
foreach ($_addon_tables as $_table) {
    $tables[$_table] = 'cw_' . $_table;
}
<?php

$tables['flexible_import_profiles'] = 'cw_flexible_import_profiles';
$tables['flexible_import_files'] = 'cw_flexible_import_files';
$var_dirs['flex_import_test'] = $app_dir . '/files/flex_import_test';
define("fi_files_path", "./files/flexible_import/");
global $csvxc_field_types;
$csvxc_field_types = array('PRICE' => "decimal(12,2) NOT NULL DEFAULT '0.00'", 'PRICE_MODIFIER' => "decimal(12,2) NOT NULL DEFAULT '0.00'", 'DESCR' => "text NOT NULL DEFAULT ''", 'FULLDESCR' => "text NOT NULL DEFAULT ''", 'PRODUCTID' => "int(11) NOT NULL DEFAULT '0'", 'PRODUCTID_TO' => "int(11) NOT NULL DEFAULT '0'", 'OPTIONID' => "int(11) NOT NULL DEFAULT '0'", 'CLASSID' => "int(11) NOT NULL DEFAULT '0'", 'ADD_DATE' => "int(11) NOT NULL DEFAULT '0'", 'WEIGHT' => "decimal(12,2) NOT NULL DEFAULT '0.00'", 'LIST_PRICE' => "decimal(12,2) NOT NULL DEFAULT '0.00'", 'AVAIL' => "int(11) NOT NULL DEFAULT '0'", 'MIN_AMOUNT' => "int(11) NOT NULL DEFAULT '0'", 'LOW_AVAIL_LIMIT' => "int(11) NOT NULL DEFAULT '0'", 'default' => "varchar(255) NOT NULL DEFAULT ''");
global $tmp_load_tables;
$tmp_load_tables = array('CATEGORIES' => array('CATEGORYID' => array('type' => 'int', 'key' => true), 'CATEGORY' => array('type' => 'text', 'key' => true), 'DESCR' => array('type' => 'longtext'), 'META_DESCR' => array('type' => 'longtext'), 'AVAIL' => array('type' => 'bool'), 'ORDERBY' => array('type' => 'int'), 'META_KEYWORDS' => array('type' => 'text'), 'ICON' => array('type' => 'text', 'file_path' => true)), 'PRODUCTS' => array('PRODUCTID' => array('type' => 'int', 'key' => true), 'PRODUCTCODE' => array('type' => 'text', 'key' => true), 'PRODUCT' => array('type' => 'text', 'key' => true), 'WEIGHT' => array('type' => 'text'), 'LIST_PRICE' => array('type' => 'text'), 'DESCR' => array('type' => 'longtext'), 'FULLDESCR' => array('type' => 'longtext'), 'KEYWORDS' => array('type' => 'text'), 'AVAIL' => array('type' => 'text'), 'RATING' => array('type' => 'text'), 'FORSALE' => array('type' => 'text'), 'SHIPPING_FREIGHT' => array('type' => 'text'), 'FREE_SHIPPING' => array('type' => 'text'), 'DISCOUNT_AVAIL' => array('type' => 'text'), 'MIN_AMOUNT' => array('type' => 'text'), 'DIM_X' => array('type' => 'text'), 'DIM_Y' => array('type' => 'text'), 'DIM_Z' => array('type' => 'text'), 'LOW_AVAIL_LIMIT' => array('type' => 'text'), 'FREE_TAX' => array('type' => 'text'), 'CATEGORYID' => array('type' => 'int', 'grouped_key' => array('CATEGORY')), 'CATEGORY' => array('type' => 'text', 'grouped_key' => array('CATEGORYID')), 'MEMBERSHIP' => array('type' => 'text', 'grouped_key' => array('MEMBERSHIPID')), 'PRICE' => array('type' => 'text'), 'THUMBNAIL' => array('type' => 'text'), 'IMAGE' => array('type' => 'text'), 'TAXES' => array('type' => 'text'), 'ADD_DATE' => array('type' => 'text'), 'MANUFACTURERID' => array('type' => 'int', 'grouped_key' => array('MANUFACTURER')), 'MANUFACTURER' => array('type' => 'text', 'grouped_key' => array('MANUFACTURERID')), 'MEMBERSHIPID' => array('type' => 'int', 'grouped_key' => array('MEMBERSHIP')), 'SUPPLIERID' => array('type' => 'text'), 'COST' => array('type' => 'text')), 'PRODUCTS_EXTRA_FIELD_VALUES' => array('PRODUCTID' => array('type' => 'int', 'key' => true), 'PRODUCTCODE' => array('type' => 'text', 'key' => true), 'PRODUCT' => array('type' => 'text', 'key' => true), 'dynamic_field_set' => array('query' => "select field from {$tables['attributes']} where item_type='P' and addon in ('', 'custom_saratogawine_magazines','custom_saratogawine_backorder','clean_urls')")));
if (APP_AREA == 'admin') {
    cw_include('addons/flexible_import/include/func.flexible_import.php');
    cw_include('addons/flexible_import/include/func.import.csvxcart.php');
    cw_include('addons/flexible_import/include/csv_def_arrays.php');
    cw_set_controller('admin/import.php', 'addons/flexible_import/admin/flexible_import.php', EVENT_POST);
    cw_set_controller('admin/import.php', 'addons/flexible_import/admin/flexible_import_profile.php', EVENT_POST);
    cw_addons_set_template(array('replace', 'admin/import_export/flexible_import.tpl', 'addons/flexible_import/flexible_import.tpl'), array('replace', 'admin/import_export/flexible_import_profile.tpl', 'addons/flexible_import/add_modify_import_profile.tpl'));
    cw_addons_add_js('addons/flexible_import/flexible_import.js');
    cw_addons_add_css('addons/flexible_import/flexible_import.css');
    cw_set_hook('cw_error_check', 'cw_flexible_import_validate_import_file', EVENT_POST);
}
<?php

cw_include('addons/product_tabs/include/func.hooks.php');
cw_addons_set_controllers(array('pre', 'include/products/modify.php', 'addons/product_tabs/admin/tabs.php'), array('pre', 'customer/product.php', 'addons/product_tabs/customer/tabs.php'));
cw_addons_set_hooks(array('post', 'cw_tabs_js_abstract', 'cw_pt_tabs_js_abstract'));
cw_set_hook('cw_delete_product', 'cw_pt_delete_product', EVENT_POST);
cw_set_hook('cw_product_clone', 'cw_pt_product_clone', EVENT_POST);
if (APP_AREA == 'admin') {
    cw_set_controller('admin/product_tabs.php', 'addons/product_tabs/admin/tabs.php', EVENT_REPLACE);
    cw_addons_set_template(array('replace', 'admin/products/product_tabs.tpl', 'addons/product_tabs/admin/main.tpl'));
    cw_addons_add_css('addons/product_tabs/admin/main.css');
}
global $_pt_addon_tables;
$_pt_addon_tables = array('product' => 'product_tabs', 'global' => 'tabs');
foreach ($_pt_addon_tables as $_table) {
    $tables[$_table] = 'cw_' . $_table;
}
$current_domain =& cw_session_register('current_domain', -1);
if (in_array(APP_AREA, array('admin'))) {
    # kornev, admin top filter
    if ($action == 'set-domains-filter') {
        $current_domain = $domain_selection;
        cw_header_location($l_redirect);
    }
}
$smarty->assign('current_domain', $current_domain);
if (is_array($smarty->template_dir) && count($smarty->template_dir) > 1 && $current_domain) {
    $altskin = str_replace($app_dir, '', $smarty->template_dir[0]);
    $smarty->assign('AltImagesDir', $app_web_dir . $altskin . '/images');
    $smarty->assign('AltSkinDir', $app_web_dir . $altskin);
    if (@file_exists($app_dir . $altskin . '/altskin.css')) {
        cw_addons_add_css('altskin.css');
    }
}
if (!$data && $current_domain) {
    $data = cw_func_call('cw_md_domain_get', array('domain_id' => $current_domain));
}
$host_value = cw_md_get_host();
$domain_full_host = $HTTPS ? $data['https_host'] : $data['http_host'];
// if use alias
if ($host_value != $domain_full_host) {
    global $http_location, $https_location, $current_location, $current_host_location;
    global $smarty, $app_config_file, $var_dirs_web, $app_dirs, $HTTPS;
    $http_location = 'http://' . $host_value . $app_config_file['web']['web_dir'];
    $https_location = 'https://' . $host_value . $app_config_file['web']['web_dir'];
    $current_location = $HTTPS ? $https_location : $http_location;
    $current_host_location = ($HTTPS ? 'https://' : 'http://') . $host_value;
<?php

cw_include('addons/detailed_product_images/func.hooks.php');
cw_addons_set_controllers(array('pre', 'include/products/modify.php', 'addons/detailed_product_images/product_images_modify.php'), array('pre', 'include/products/modify.php', 'addons/detailed_product_images/product_images.php'), array('post', 'customer/product.php', 'addons/detailed_product_images/product_images.php'));
cw_addons_set_template(array('replace', 'customer/products/thumbnail.tpl', 'addons/detailed_product_images/popup_image.tpl', 'images'));
cw_addons_set_hooks(array('post', 'cw_tabs_js_abstract', 'cw_dpi_tabs_js_abstract'));
cw_set_hook('cw_delete_product', 'cw_dpi_delete_product', EVENT_POST);
if (APP_AREA == 'customer') {
    cw_addons_add_css('addons/detailed_product_images/css/dpi.css');
}
<?php

$smarty->assign('current_main_dir', 'addons');
$smarty->assign('current_section_dir', 'dashboard/admin');
$smarty->assign('main', 'dashboard');
//  this calls addons/dashboard/admin/dashboard.tpl
cw_addons_add_css('addons/dashboard/admin/dashboard.css');
$addon_actions = array('setting' => 'dashboard_action_setting', 'update' => 'dashboard_action_update');
if (empty($action) || !isset($addon_actions[$action]) || !function_exists($addon_actions[$action])) {
    $action = 'setting';
}
$smarty->assign('action', $action);
cw_call($addon_actions[$action]);
return;
function dashboard_action_setting()
{
    global $smarty, $tables;
    $params = array('mode' => 'setting', 'sections' => null);
    $dashboard = cw_func_call('dashboard_build_sections', $params);
    foreach ($dashboard as $name => $dash) {
        $dashboard[$name] = array_merge($dashboard[$name], cw_query_first('SELECT * FROM ' . $tables['dashboard'] . ' WHERE name="' . mysql_real_escape_string($name) . '"'));
    }
    uasort($dashboard, 'cw_uasort_by_order');
    $smarty->assign('dashboard', $dashboard);
}
function dashboard_action_update()
{
    if ($_SERVER['REQUEST_METHOD'] != 'POST') {
        dashboard_redirect();
    }
    $dashboard = $_POST['dashboard'];
<?php

$tables['products_reviews_reminder'] = 'cw_products_reviews_reminder';
$tables['products_reviews_ratings'] = 'cw_products_reviews_ratings';
$tables['products_reviews_rating_types'] = 'cw_products_reviews_rating_types';
$cw_allowed_tunnels[] = 'cw_review_get_quick_global_info';
cw_include('addons/estore_products_review/include/func.review.php');
# kornev, TOFIX - move all of the css from general
cw_addons_add_css('addons/estore_products_review/general.css');
cw_addons_add_js('addons/estore_products_review/js/jquery.raty.min.js');
cw_addons_set_controllers(array('post', 'customer/product.php', 'addons/estore_products_review/customer/product.php'), array('replace', 'customer/top_rated.php', 'addons/estore_products_review/customer/top_rated.php'), array('replace', 'customer/estore_testimonials.php', 'addons/estore_products_review/customer/testimonials.php'), array('replace', 'admin/estore_stop_list.php', 'addons/estore_products_review/admin/estore_stop_list.php'), array('replace', APP_AREA . '/estore_reviews_management.php', 'addons/estore_products_review/' . APP_AREA . '/reviews_management.php'), array('replace', APP_AREA . '/estore_review_management.php', 'addons/estore_products_review/' . APP_AREA . '/review_management.php'), array('replace', 'admin/estore_execute_doc_action.php', 'addons/estore_products_review/admin/doc_action.php'), array('replace', 'customer/global_reviews.php', 'addons/estore_products_review/customer/global_reviews.php'));
cw_set_controller('customer/review_vote.php', 'addons/estore_products_review/customer/review_vote.php', EVENT_REPLACE);
if (APP_AREA == 'admin') {
    cw_addons_set_controllers(array('post', 'include/orders/order.php', 'addons/estore_products_review/admin/order.php'));
}
cw_set_hook('cw_delete_product', 'cw_review_delete_product', EVENT_POST);
# kornev, select rating to show it on the category page
cw_addons_set_hooks(array('post', 'cw_product_search', 'cw_review_product_search'), array('post', 'cw_product_get', 'cw_review_product_get'), array('post', 'cw_product_filter_get_slider_value', 'cw_review_product_filter_get_slider_value'), array('pre', 'cw_cron_get_targets', 'cw_review_prepare_and_send_reminder'), array('post', 'cw_attributes_delete', 'cw_review_delete_product_votes'), array('post', 'cw_attributes_get_types', 'cw_review_attributes_get_types'));
cw_addons_set_template(array('replace', 'main/attributes/show.tpl', 'addons/estore_products_review/main/attributes/show.tpl', 'cw_review_is_rating_attribute'), array('post', 'help/menu-list.tpl', 'addons/estore_products_review/menu-list.tpl'), array('replace', 'customer/help/estore_testimonials.tpl', 'addons/estore_products_review/testimonials.tpl'), array('replace', 'admin/main/estore_stop_list.tpl', 'addons/estore_products_review/admin_stop_list.tpl'), array('replace', 'admin/main/estore_reviews_management.tpl', 'addons/estore_products_review/admin_reviews_management.tpl'), array('replace', APP_AREA . '/main/estore_review_management.tpl', 'addons/estore_products_review/' . APP_AREA . '_review_management.tpl'), array('post', 'main/docs/additional_actions.tpl', 'addons/estore_products_review/additional_doc_action.tpl'), array('post', 'main/docs/additional_search_field.tpl', 'addons/estore_products_review/additional_doc_search_field.tpl'), array('replace', 'customer/main/global_reviews.tpl', 'addons/estore_products_review/global_reviews.tpl'));
cw_event_listen('on_prepare_search_orders', 'cw_review_prepare_search_orders');
cw_set_hook('cw_web_get_product_layout_elements', 'cw_review_get_product_layout_elements');
cw_set_hook('cw_doc_get', 'cw_review_doc_get');
<?php

// @TODO: remove second condition after ajax product_filter rework
if (APP_AREA == 'customer' && (!defined('IS_AJAX') && $target != 'image' || isset($ajax_filter) && $ajax_filter && defined('IS_AJAX') && $target != 'image')) {
    cw_include('addons/top_menu/func.php');
    cw_set_controller('customer/auth.php', 'addons/top_menu/cust.php', EVENT_POST);
    cw_addons_set_template(array('replace', 'customer/top_categories.tpl', 'addons/top_menu/menu.tpl'));
    cw_addons_add_js('jquery/jquery.ui.potato.menu.js');
    cw_addons_add_css('jquery/jquery.ui.potato.menu.css');
    cw_addons_add_css('menu.css');
    cw_addons_add_css('addons/top_menu/menu.css');
}
if (APP_AREA == 'admin' && $target == 'top_menu') {
    cw_include('addons/top_menu/func.php');
    cw_set_controller('admin/top_menu.php', 'addons/top_menu/admin/top_menu.php', EVENT_REPLACE);
    cw_addons_set_template(array('replace', 'admin/products/top_menu.tpl', 'addons/top_menu/admin_main.tpl'));
}
$tables['top_menu_user_categories'] = 'cw_top_menu_user_categories';
// TODO: register on_category_delete handler, otherwise cw_top_menu_user_categories will have orphaned links
Esempio n. 10
0
<?php

cw_addons_add_css('addons/cookies_warning/customer/cookie_warn.css');
cw_addons_set_template(array('pre', 'customer/head.tpl', 'addons/cookies_warning/customer/top_panel.tpl'));
cw_addons_set_controllers(array('post', 'customer/auth.php', 'addons/cookies_warning/customer/auth.php'));
Esempio n. 11
0
<?php

namespace CW\Ajax_Add2Cart;

const addon_name = 'ajax_add2cart';
const addon_version = '0.2';
if (APP_AREA == 'customer' && !empty($addons[addon_name])) {
    cw_include('addons/ajax_add2cart/func.php');
    if ($target == 'cart') {
        cw_addons_set_controllers(array('post', 'customer/cart.php', 'addons/ajax_add2cart/minicart.php'));
        cw_event_listen('on_add_cart', 'CW\\Ajax_Add2Cart\\on_add_cart');
    }
    // Skin requirements:
    // add_to_cart.tpl is used for button
    // cw_form_submit is used for form submittion, no GET links supported
    if ($target != 'gifts') {
        cw_addons_set_template(array('replace', 'customer/menu/minicart.tpl', 'addons/ajax_add2cart/minicart.tpl'), array('pre', 'buttons/add_to_cart.tpl', 'addons/' . addon_name . '/add_to_cart.tpl', 'CW\\Ajax_Add2Cart\\cw_smarty_replace_href'), array('pre', 'buttons/buy_now.tpl', 'addons/' . addon_name . '/buy_now.tpl', 'CW\\Ajax_Add2Cart\\cw_smarty_replace_href'));
    }
    cw_addons_set_template(array('pre', 'customer/menu/microcart.tpl', 'addons/ajax_add2cart/microcart.tpl'));
    cw_addons_add_css('addons/ajax_add2cart/minicart.css');
    cw_addons_add_js('addons/ajax_add2cart/minicart.js');
    cw_set_controller('addons/mobile/init/mobile.php', 'addons/' . addon_name . '/addons/mobile.php', EVENT_POST);
}
Esempio n. 12
0
<?php

$tables['domains'] = 'cw_domains';
$tables['domains_config'] = 'cw_domains_config';
cw_include('addons/multi_domains/include/func.md.php');
cw_addons_set_controllers(array('replace', 'admin/domains.php', 'addons/multi_domains/admin/domains.php'), array('post', 'init/abstract.php', 'addons/multi_domains/init/domains.php'), array('post', 'include/auth.php', 'addons/multi_domains/include/auth.php'));
if ($target != 'image') {
    cw_set_controller('init/post_init.php', 'addons/multi_domains/init/get_host_data.php', EVENT_POST);
    cw_set_controller('init/post_init.php', 'addons/multi_domains/post_init.php', EVENT_POST);
}
cw_set_hook('cw_core_get_config', 'cw_md_core_get_config', EVENT_POST);
cw_set_hook('cw_attributes_save', 'cw_md_attributes_save', EVENT_POST);
// additional function for the category attributes
cw_addons_set_hooks(array('pre', 'cw_product_search', 'cw_md_product_search'), array('pre', 'cw_category_search', 'cw_md_category_search'), array('pre', 'cw_manufacturer_search', 'cw_md_manufacturer_search'), array('pre', 'cw_pages_search', 'cw_md_pages_search'), array('pre', 'cw_speed_bar_search', 'cw_md_speed_bar_search'), array('pre', 'cw_shipping_search', 'cw_md_shipping_search'), array('pre', 'cw_payment_search', 'cw_md_payment_search'), array('pre', 'cw_product_get', 'cw_md_product_search'), array('pre', 'cw_category_get', 'cw_md_category_search'), array('pre', 'cw_manufacturer_get', 'cw_md_manufacturer_search'), array('pre', 'cw_pages_get', 'cw_md_pages_search'), array('pre', 'cw_doc_place_order', 'cw_md_doc_place_order'), array('post', 'cw_code_get_template_dir', 'cw_md_code_get_template_dir'));
if (APP_AREA == 'admin') {
    cw_event_listen('on_prepare_search_orders', 'cw_md_prepare_search_orders');
    cw_set_hook('cw_send_mail', 'cw_md_send_mail', EVENT_PRE);
    // This hook adds altskin as source of email templates
    cw_set_hook('cw_spam', 'cw_md_send_mail', EVENT_PRE);
    cw_addons_set_template(array('pre', 'main/docs/additional_search_field.tpl', 'addons/multi_domains/admin/additional_domain_selector.tpl'), array('post', 'common/navigation_counter.tpl', 'addons/multi_domains/common/current_domain_warning.tpl'));
}
if (APP_AREA == 'customer') {
    # kornev, languages per domain
    cw_addons_set_controllers(array('pre', 'init/lng.php', 'addons/multi_domains/init/lng.php'), array('pre', 'customer/referer.php', 'addons/multi_domains/customer/referer.php'));
    cw_addons_set_hooks(array('replace', 'cw_core_get_available_languages', 'cw_md_get_available_languages'));
}
cw_addons_set_template(array('post', 'main/attributes/default_types.tpl', 'addons/multi_domains/types/domain-selector.tpl'), array('post', 'common/top-filters.tpl', 'addons/multi_domains/common/top-filters.tpl'));
cw_addons_add_css('addons/multi_domains/general.css', 'A');
Esempio n. 13
0
<?php

# faq
$tables['faq_comments'] = 'cw_faq_comments';
$tables['faq_questions'] = 'cw_faq_questions';
$tables['faq_questions_lng'] = 'cw_faq_questions_lng';
$tables['faq_rubrik'] = 'cw_faq_rubrik';
$tables['faq_rubrik_parents'] = 'cw_faq_rubrik_parents';
$tables['faq_rubrik_count'] = 'cw_faq_rubrik_count';
$tables['faq_visits'] = 'cw_faq_visits';
$tables['faq_voting'] = 'cw_faq_voting';
$tables['faq_files'] = 'cw_faq_files';
$var_dirs['faq'] = $app_dir . '/files/faq';
$var_dirs_web['faq'] = '/files/faq';
cw_set_controller('customer/faq.php', 'addons/faq/customer/faq.php', EVENT_REPLACE);
cw_set_controller('customer/faq_membership.php', 'addons/faq/customer/faq_membership.php', EVENT_REPLACE);
cw_set_controller('customer/faq_printing.php', 'addons/faq/customer/faq_printing.php', EVENT_REPLACE);
cw_set_controller('customer/faq_popup.php', 'addons/faq/customer/faq_popup.php', EVENT_REPLACE);
cw_set_controller('salesman/faq.php', 'addons/faq/salesman/faq.php', EVENT_REPLACE);
cw_set_controller('salesman/faq_printing.php', 'addons/faq/salesman/faq_printing.php', EVENT_REPLACE);
cw_set_controller('salesman/faq_popup.php', 'addons/faq/salesman/faq_popup.php', EVENT_REPLACE);
cw_set_controller('admin/faq.php', 'addons/faq/admin/faq.php', EVENT_REPLACE);
$tpls_repl = array('admin/faq/categories.tpl', 'admin/faq/category.tpl', 'admin/faq/question.tpl', 'admin/faq/questions.tpl', 'customer/faq.tpl', 'main/faq/add_comment.tpl', 'main/faq/article.tpl', 'main/faq/ask.tpl', 'main/faq/printing.tpl', 'main/faq/product_article.tpl', 'main/faq/product.tpl', 'main/faq/send2friend.tpl');
foreach ($tpls_repl as $tpl_repl) {
    cw_addons_set_template(array('replace', $tpl_repl, 'addons/faq/' . $tpl_repl));
}
cw_addons_add_css('addons/faq/faq.css');
Esempio n. 14
0
<?php

/*
 * Vendor: CW
 * addon: bookmarks
 */
namespace CW\bookmarks;

const addon_name = 'bookmarks';
const addon_target = 'bookmarks';
$tables['bookmarks'] = 'cw_bookmarks';
if (APP_AREA != 'admin') {
    return true;
}
cw_include('addons/' . addon_name . '/func.php');
if ($target == addon_target) {
    cw_set_controller(APP_AREA . '/' . addon_target . '.php', 'addons/' . addon_name . '/' . addon_target . '.php', EVENT_REPLACE);
}
cw_addons_set_template(array('post', 'elements/bottom.tpl', 'addons/' . addon_name . '/bookmarks.tpl'), array('post', 'elements/bottom_admin.tpl', 'addons/' . addon_name . '/bookmarks.tpl'));
cw_event_listen('on_login', 'CW\\bookmarks\\on_login');
cw_event_listen('on_customer_delete', 'CW\\bookmarks\\on_customer_delete');
cw_event_listen('on_sessions_delete', 'CW\\bookmarks\\on_sessions_delete');
cw_addons_add_css('addons/' . addon_name . '/bookmarks.css');
cw_addons_add_js('addons/' . addon_name . '/bookmarks.js');
cw_set_controller('addons/mobile/init/mobile.php', 'addons/' . addon_name . '/addons/mobile.php', EVENT_POST);
Esempio n. 15
0
cw_event_listen('on_collect_discounts', 'cw_ps_on_collect_discounts');
// Function adds offer discounts applied to a product in cart
cw_event_listen('on_product_from_scratch', 'cw_apply_special_offer_discount');
/* Hooks for coupon bonus */
cw_event_listen('on_place_order_extra', 'cw_ps_on_place_order_extra');
// CMS
cw_event_listen('on_cms_check_restrictions', 'cw_ps_on_cms_check_restrictions_PS');
// cw_delete_from_cart
// $product_id = cw_delete_from_cart($cart, $productindex);
if (APP_AREA == 'admin') {
    cw_addons_set_controllers(array('replace', 'admin/promosuite.php', 'addons/promotion_suite/admin/promosuite.php'), array('replace', 'admin/discount_bundles.php', 'addons/promotion_suite/admin/discount_bundles.php'), array('post', 'include/auth.php', 'addons/promotion_suite/include/auth.php'));
    cw_set_controller('include/products/modify.php', 'addons/promotion_suite/admin/product_modify.php', EVENT_PRE);
    cw_addons_set_hooks(array('post', 'cw_tabs_js_abstract', 'cw_ps_tabs_js_abstract'));
    cw_addons_set_template(array('replace', 'admin/main/promosuite.tpl', 'addons/promotion_suite/admin/main.tpl'), array('replace', 'admin/main/discount_bundles.tpl', 'addons/promotion_suite/admin/discount_bundles.tpl'));
    if ($target == 'cms') {
        cw_addons_set_template(array('pre', 'main/attributes/object_modify.tpl', 'addons/promotion_suite/addons/cms/cms_details.tpl'));
        cw_event_listen('on_cms_update', 'cw_ps_on_cms_update');
        cw_set_controller('addons/cms/cs_banner.php', 'addons/promotion_suite/addons/cms/cs_banner.php', EVENT_POST);
        cw_set_controller('addons/cms/cs_banners.php', 'addons/promotion_suite/addons/cms/cs_banner.php', EVENT_POST);
    }
    cw_addons_add_css('addons/promotion_suite/admin/promosuite.css');
}
if (APP_AREA == 'customer') {
    cw_addons_add_css('addons/promotion_suite/customer/promosuite.css');
    cw_addons_set_hooks(array('post', 'cw_tabs_js_abstract', 'cw_ps_tabs_js_abstract'));
}
/* PS tables */
$_addon_tables = array('ps_offers', 'ps_conditions', 'ps_bonuses', 'ps_offer_images', 'ps_bonus_details', 'ps_cond_details');
foreach ($_addon_tables as $_table) {
    $tables[$_table] = 'cw_' . $_table;
}
Esempio n. 16
0
    return;
}
if (!in_array($target, array('', 'index', 'dashboard', 'quick_data', 'dashboard_system_messages'), true)) {
    return;
}
define('SEARCH_LIMIT_FOR_AUTOCOMPLETE', 10);
define('NEWS_RSS_URL', 'http://www.cartworks-platform.com/adminfeed.xml');
$tables['dashboard'] = 'cw_dashboard';
// Define abstract dashboard builder
cw_include('addons/dashboard/include/func.dashboard.php');
cw_addons_set_controllers(array('post', 'admin/index.php', 'addons/dashboard/admin/index.php'), array('replace', 'admin/dashboard.php', 'addons/dashboard/admin/configuration.php'), array('replace', 'admin/quick_data.php', 'addons/dashboard/admin/quick_data.php'), array('replace', 'admin/dashboard_system_messages.php', 'addons/dashboard/admin/dashboard_system_messages.php'));
// Define all specific dashboard section builders
//cw_include('addons/dashboard/sections/dashboard_section_example.php');
cw_include('addons/dashboard/sections/dashboard_section_default.php');
// Register hooks
cw_addons_set_hooks(array('post', 'dashboard_build_sections', 'dashboard_section_search'), array('post', 'dashboard_build_sections', 'dashboard_section_graph'), array('post', 'dashboard_build_sections', 'dashboard_last_orders'), array('post', 'dashboard_build_sections', 'dashboard_section_system_messages'), array('post', 'dashboard_build_sections', 'dashboard_section_pending_reviews'), array('post', 'dashboard_build_sections', 'dashboard_section_awaiting'), array('post', 'dashboard_build_sections', 'dashboard_section_system_info'), array('post', 'dashboard_build_sections', 'dashboard_section_news'));
cw_addons_add_css('addons/dashboard/admin/main.css');
cw_addons_set_template(array('post', 'admin/main/main.tpl', 'addons/dashboard/admin/index.tpl'));
/*
 * jqPlot http://www.jqplot.com/
 */
// Excanvas is required only for IE versions below 9
preg_match("/(MSIE|Version)(?:\\/| )([0-9.]+)/", $_SERVER['HTTP_USER_AGENT'], $matches);
if (count($matches) && $matches[1] == 'MSIE' && $matches[2] < 9.0) {
    cw_addons_add_js('addons/dashboard/js/excanvas.min.js');
}
cw_addons_add_js('addons/dashboard/js/jquery.jqplot.min.js');
cw_addons_add_js('addons/dashboard/js/plugins/jqplot.dateaxisrenderer.min.js');
cw_addons_add_js('addons/dashboard/js/plugins/jqplot.highlighter.min.js');
cw_addons_add_css('addons/dashboard/js/jquery.jqplot.min.css');
Esempio n. 17
0
<?php

define('DOD_OBJ_TYPE_PRODS', 1);
define('DOD_OBJ_TYPE_CATS', 2);
define('DOD_OBJ_TYPE_MANS', 3);
define('DOD_OBJ_TYPE_ATTR', 9);
define('DOD_OBJ_TYPE_SHIPPING', 10);
define('DOD_APPLY_PRODS', 3);
define('DOD_DISCOUNT', 'D');
define('DOD_FREE_PRODS', 'F');
define('DOD_FREE_SHIP', 'S');
define('DOD_COUPON', 'C');
define('DOD_ATTR_ITEM_TYPE', 'DD');
$bonus_names = array(DOD_COUPON => 'lbl_dod_bonus_coupon', DOD_DISCOUNT => 'lbl_dod_bonus_discount', DOD_FREE_PRODS => 'lbl_dod_bonus_forfree', DOD_FREE_SHIP => 'lbl_dod_bonus_freeship');
/* dod tables */
$_addon_tables = array('dod_generators', 'dod_bonuses', 'dod_bonus_details');
foreach ($_addon_tables as $_table) {
    $tables[$_table] = 'cw_' . $_table;
}
cw_include('addons/deal_of_day/include/func.php');
if (APP_AREA == 'admin') {
    cw_addons_set_controllers(array('replace', 'admin/deal_of_day.php', 'addons/deal_of_day/admin/deal_of_day.php'), array('post', 'include/auth.php', 'addons/deal_of_day/include/auth.php'));
    cw_addons_set_template(array('replace', 'admin/main/deal_of_day.tpl', 'addons/deal_of_day/admin/main.tpl'));
    cw_addons_add_css('addons/deal_of_day/admin/deal_of_day.css');
}
if (APP_AREA == 'customer') {
    cw_addons_set_controllers(array('replace', 'customer/deal_of_day_generate.php', 'addons/deal_of_day/customer/deal_of_day_generate.php'), array('post', 'customer/index.php', 'addons/deal_of_day/customer/index.php'));
    cw_addons_set_template(array('post', 'customer/main/welcome.tpl@home_offers', 'addons/deal_of_day/customer/home.tpl'));
}
Esempio n. 18
0
<?php

/*
 * Vendor: CW
 * addon: Feedback report
 */
const feedback_addon_name = 'feedback_report';
const feedback_our_email_to_send = '*****@*****.**';
const feedback_files_folder_name = 'feedback';
const feedback_image_type = 'jpeg';
// png/jpeg (also need change type in feedback.min.js and html2canvas.min.js)
cw_include('addons/' . feedback_addon_name . '/include/func.feedback.php');
cw_event_listen('on_build_var_dirs', 'cw_fbr_build_var_dirs');
cw_event_listen('on_log_add', 'cw_fbr_log_add');
cw_set_controller(APP_AREA . '/save_feedback_data.php', 'addons/' . feedback_addon_name . '/common/save_feedback_data.php', EVENT_REPLACE);
cw_set_controller('init/numbers.php', 'addons/' . feedback_addon_name . '/common/error_handler.php', EVENT_POST);
cw_set_controller('customer/feedback.php', 'addons/' . feedback_addon_name . '/common/feedback.php', EVENT_REPLACE);
cw_event_listen('on_cron_hourly', 'cw_fbr_prepare_and_send_feedbacks');
cw_addons_set_template(array('post', APP_AREA . '/elements/bottom_links.tpl', 'addons/' . feedback_addon_name . '/bottom_links.tpl'), array('post', 'customer/main/feedback_image.tpl', 'addons/' . feedback_addon_name . '/feedback_image.tpl'));
cw_addons_add_css('addons/' . feedback_addon_name . '/css/feedback.css');
cw_addons_add_js('addons/' . feedback_addon_name . '/js/feedback.min.js');
cw_addons_add_js('addons/' . feedback_addon_name . '/js/html2canvas.min.js');
Esempio n. 19
0
    if ($config['General']['maximum_order_amount'] > 0 && $cart['info']['display_subtotal'] > $config['General']['maximum_order_amount']) {
        cw_header_location("index.php?target=error_message&max_order");
    }
    if ($config['General']['maximum_order_items'] > 0 && cw_cart_count_items($cart) > $config['General']['maximum_order_items']) {
        cw_header_location("index.php?target=error_message&error=max_items");
    }
    $fields_area = cw_profile_fields_get_area($customer_id, $salesman_membership, 1);
    list($profile_sections, $profile_fields, $additional_fields) = cw_profile_fields_get_sections('U', true, $fields_area);
    # kornev, the web information is not required here.
    if ($customer_id) {
        unset($profile_sections['web']);
    }
    $smarty->assign('userinfo', $userinfo);
    $smarty->assign('profile_fields', $profile_fields);
    $smarty->assign('profile_sections', $profile_sections);
    cw_addons_add_css('customer/checkout/opc.css');
    cw_func_call('cw_checkout_prepare');
}
$giftcerts = !empty($cart['giftcerts']) ? $cart['giftcerts'] : array();
$wcart = cw_func_call('cw_cart_get_warehouses_cart', array('cart' => $cart, 'products' => $products, 'userinfo' => $userinfo));
$smarty->assign('warehouses_cart', $wcart);
if (!cw_is_cart_empty($cart)) {
    $smarty->assign('products', $products);
    $smarty->assign('cart_products', cw_warehouse_group_products($products));
    $smarty->assign('giftcerts', $giftcerts);
}
$smarty->assign('from_quote', !empty($cart['info']['quote_doc_id']) ? 1 : 0);
cw_save_customer_cart($customer_id, $cart);
if ($addons['recommended_products']) {
    $config['recommended_products']['number_of_recommends'] = 4;
    cw_include('addons/recommended_products/recommends.php');
Esempio n. 20
0
<?php

/*
 * Vendor: CW
 * addon: ebay
 */
namespace CW\ebay;

const addon_name = 'ebay';
const addon_target = 'ebay_export';
const addon_version = '0.1';
const addon_files_location_path = 'files/ebay/';
const addon_conditions_data_file_name = 'ConditionIDs_by_Category.csv';
if (APP_AREA == 'admin' && $target == addon_target && !empty($addons[addon_name])) {
    $ebay_config = array('ebay_action' => 'Add', 'ebay_category' => 1, 'ebay_condition_id' => 1000, 'ebay_duration' => 1, 'ebay_format' => 'Auction (default)', 'ebay_immediate_pay_required' => 0, 'ebay_location' => '', 'ebay_paypal_accepted' => 0, 'ebay_paypal_email_address' => '', 'ebay_dispatch_time_max' => 1, 'ebay_returns_accepted_option' => 'ReturnsAccepted');
    cw_addons_set_controllers(array('replace', 'admin/' . addon_target . '.php', 'addons/' . addon_name . '/' . addon_target . '.php'));
    cw_include('addons/' . addon_name . '/func.php');
    cw_addons_set_template(array('replace', 'admin/main/ebay_export.tpl', 'addons/ebay/ebay_export.tpl'), array('replace', 'admin/import_export/ebay_export.tpl', 'addons/ebay/ebay_export.tpl'));
}
if (APP_AREA == 'admin') {
    cw_set_controller('admin/ajax_ebay_category_select.php', 'addons/ebay/ebay_attributes_modify.php', EVENT_REPLACE);
    cw_addons_set_template(array('post', 'main/attributes/default_types.tpl', 'addons/ebay/types/ebay_category_selector.tpl'));
    cw_addons_add_js('jquery/dynatree-1.2.4/jquery.dynatree.min.js');
    cw_addons_add_css('jquery/dynatree-1.2.4/ui.dynatree.css');
}
Esempio n. 21
0
<?php

$cw_allowed_tunnels[] = 'cw_shipping_search';
$cw_allowed_tunnels[] = 'cw_shipping_doc_trackable';
cw_include('addons/shipping_system/include/func.shipping.php');
cw_addons_add_css('addons/shipping_system/css/main.css');
cw_addons_set_controllers(array('replace', 'admin/shipping_carriers.php', 'addons/shipping_system/admin/shipping_carriers.php'), array('replace', 'admin/cod_types.php', 'addons/shipping_system/admin/cod_types.php'), array('replace', 'admin/shipping_zones.php', 'addons/shipping_system/admin/shipping_zones.php'), array('replace', 'admin/shipping.php', 'addons/shipping_system/admin/shipping.php'), array('replace', 'admin/shipping_rates.php', 'addons/shipping_system/admin/shipping_rates.php'), array('post', 'include/orders/order_edit.php', 'addons/shipping_system/include/orders/order_edit.php'), array('replace', 'customer/popup-shipping.php', 'addons/shipping_system/customer/popup-shipping.php'));
cw_addons_set_hooks(array('post', 'cw_checkout_login_prepare', 'cw_shipping_checkout_login_prepare'), array('pre', 'cw_cart_actions', 'cw_shipping_cart_actions'), array('post', 'cw_cart_get_warehouses_cart', 'cw_shipping_cart_get_warehouses_cart'), array('post', 'cw_cart_calc_single', 'cw_shipping_cart_calc_single'), array('pre', 'cw_cart_summarize', 'cw_shipping_cart_summarize'), array('post', 'cw_product_get', 'cw_shipping_product_get'));
cw_addons_set_template(array('pre', 'customer/cart/totals.tpl', 'addons/shipping_system/customer/cart/totals.tpl'), array('post', 'customer/checkout/shipping_methods.tpl', 'addons/shipping_system/customer/checkout/shipping_methods.tpl'), array('post', 'customer/products/product-fields.tpl', 'addons/shipping_system/customer/products/product-fields.tpl'), array('replace', 'customer/products/estimate-fields.tpl', 'addons/shipping_system/customer/products/product-fields.tpl'), array('post', 'customer/products/products-info.tpl', 'addons/shipping_system/customer/products/shipping_estimator.tpl'), array('post', 'customer/products/our_price.tpl', 'addons/shipping_system/customer/products/free-shipping.tpl'));
if (APP_AREA == 'customer') {
    cw_addons_add_js('addons/shipping_system/js/dialog.js');
    cw_set_controller('customer/shipping_estimator.php', 'addons/shipping_system/customer/shipping_estimator.php', EVENT_REPLACE);
    cw_set_controller('customer/order_tracking.php', 'addons/shipping_system/customer/order_tracking.php', EVENT_REPLACE);
    cw_addons_set_template(array('post', 'customer/products/product.tpl', 'addons/shipping_system/customer/products/estimate.tpl'), array('post', 'customer/products/subcategories.tpl', 'addons/shipping_system/customer/products/estimate.tpl'));
}
Esempio n. 22
0
<?php

if (APP_AREA == 'customer') {
    cw_set_controller('customer/ajax_product_search.php', 'addons/ajax_search/customer/ajax_search.php', EVENT_REPLACE);
    cw_addons_set_template(array('post', 'js/presets_js.tpl', 'addons/ajax_search/ajax_search.tpl'));
    cw_addons_add_js('addons/ajax_search/ajax_search.js');
    cw_addons_add_css('addons/ajax_search/ajax_search.css');
}
Esempio n. 23
0
$tables['cms_images'] = 'cw_cms_images';
$tables['cms_restrictions'] = 'cw_cms_restrictions';
$tables['cms_user_counters'] = 'cw_cms_user_counters';
cw_include('addons/cms/func.hooks.php', INCLUDE_NO_GLOBALS);
cw_include('addons/cms/func.php', INCLUDE_NO_GLOBALS);
cw_event_listen('on_product_delete', 'cms\\on_product_delete');
cw_event_listen('on_category_delete', 'cms\\on_category_delete');
cw_event_listen('on_manufacturer_delete', 'cms\\on_manufacturer_delete');
cw_event_listen('on_cms_check_restrictions', 'cms\\on_cms_check_restrictions_C');
cw_event_listen('on_cms_check_restrictions', 'cms\\on_cms_check_restrictions_P');
cw_set_hook('cw_delete_product', 'cms\\cw_delete_product', EVENT_POST);
if (APP_AREA == 'admin') {
    cw_addons_set_controllers(array('replace', 'admin/cms.php', 'addons/cms/cms.php'), array('pre', 'include/products/modify.php', 'addons/cms/product_modify.php'));
    cw_addons_set_hooks(array('post', 'cw_tabs_js_abstract', 'cms\\tabs_js_abstract'));
    cw_addons_set_template(array('replace', 'admin/main/section_title.tpl', 'addons/cms/admin/section_title.tpl'));
    if ($target == 'cms' && $mode == 'search') {
        cw_addons_set_template(array('replace', 'addons/clean_urls/history_link.tpl', 'addons/cms/history_link.tpl'));
    }
}
if (APP_AREA == 'customer') {
    cw_addons_add_css('addons/cms/cms.css');
    cw_addons_add_js('addons/cms/cms.js');
    cw_addons_set_controllers(array('replace', 'customer/ab_count_click.php', 'addons/cms/ab_count_click.php'), array('replace', 'customer/pages.php', 'addons/cms/staticpages.php'), array('post', 'customer/help.php', 'addons/cms/help_pages.php'));
    //   cw_set_controller('customer/auth.php', 'addons/cms/customer/cms.php', EVENT_POST);
    cw_addons_set_hooks(array('pre', 'cw_core_get_meta', 'cw_cms_get_meta'));
    // test content section
    if (AB_TEST_CONTENTSECTION) {
        cw_addons_set_template(array('post', CS_TEST_TEMPLATE, 'addons/cms/test.tpl'));
    }
    cw_addons_set_template(array('post', 'customer/service_js.tpl', 'addons/cms/highlight.js.tpl'), array('replace', 'customer/main/pages.tpl', 'addons/cms/customer/staticpages.tpl'), array('pre', 'common/menu.tpl', 'addons/cms/customer/menu_pre.tpl'), array('post', 'common/menu.tpl', 'addons/cms/customer/menu_post.tpl'), array('post', 'customer/help/help.tpl@help_main_section', 'addons/cms/customer/help_sections.tpl'));
}
Esempio n. 24
0
<?php

$tables['linked_products'] = 'cw_linked_products';
require $app_main_dir . '/addons/accessories/func.php';
require $app_main_dir . '/addons/accessories/func.hooks.php';
if (APP_AREA == 'admin') {
    cw_addons_set_controllers(array('pre', 'include/products/modify.php', 'addons/accessories/product_modify_accessories.php'));
    cw_addons_set_hooks(array('post', 'cw_tabs_js_abstract', 'cw_ac_tabs_js_abstract'));
    cw_set_hook('cw_product_clone', 'cw_ac_product_clone', EVENT_POST);
    cw_set_hook('cw_delete_product', 'cw_ac_delete_product', EVENT_POST);
}
if (APP_AREA == 'customer') {
    //cw_addons_add_js('addons/accessories/func.js');
    cw_addons_set_controllers(array('post', 'customer/product.php', 'addons/accessories/product_accessories.php'));
    cw_set_controller('customer/product.php', 'addons/accessories/rv_product.php', EVENT_POST);
    cw_set_controller('customer/cart.php', 'addons/accessories/rv_products_list.php', EVENT_POST);
    cw_set_controller('customer/cart.php', 'addons/accessories/cab_products_list.php', EVENT_POST);
    cw_addons_set_template(array('post', 'customer/cart/cart.tpl', 'addons/accessories/cart_recently_viewed_products.tpl'), array('post', 'customer/cart/cart.tpl', 'addons/accessories/cab_products_list.tpl'));
    cw_addons_set_hooks(array('post', 'cw_tabs_js_abstract', 'cw_ac_tabs_js_abstract'));
    // Integration with ajax_add2cart addon {
    if (defined('IS_AJAX') && constant('IS_AJAX')) {
        cw_event_listen('on_add_cart', 'cw_ac_on_add_to_cart');
        cw_addons_set_template(array('post', 'addons/ajax_add2cart/add2cart_popup.tpl', 'addons/accessories/add2cart_popup.tpl'));
    }
    // } Integration with ajax_add2cart addon
    cw_addons_add_css('addons/accessories/accessories.css');
}
Esempio n. 25
0
<?php

/*
 * Vendor: CW
 * addon: messaging system
 */
$tables['messages'] = 'cw_messages';
const messaging_addon_name = 'messaging_system';
cw_include('addons/' . messaging_addon_name . '/include/cw.messages.php');
if (APP_AREA == 'customer') {
    cw_addons_set_controllers(array('post', 'customer/auth.php', 'addons/' . messaging_addon_name . '/customer/init_messaging_counter.php'), array('replace', APP_AREA . '/message_box.php', 'addons/' . messaging_addon_name . '/' . APP_AREA . '/message_box.php'));
    cw_addons_set_template(array('post', 'customer/menu/addon_section.tpl', 'addons/' . messaging_addon_name . '/customer/section.tpl'), array('replace', APP_AREA . '/message_box/message_box.tpl', 'addons/' . messaging_addon_name . '/' . APP_AREA . '/message_box.tpl'));
    cw_addons_add_css('addons/' . messaging_addon_name . '/' . APP_AREA . '/style.css');
} else {
    cw_addons_set_controllers(array('replace', APP_AREA . '/message_box.php', 'addons/' . messaging_addon_name . '/admin/message_box.php'));
    cw_addons_set_template(array('post', 'admin/users/service_data.tpl', 'addons/' . messaging_addon_name . '/admin/contact_link.tpl'), array('replace', APP_AREA . '/message_box/message_box.tpl', 'addons/' . messaging_addon_name . '/admin/message_box.tpl'));
    cw_addons_add_css('addons/' . messaging_addon_name . '/admin/style.css');
}