<?php /*************************************************************************** * * * Copyright (c) 2004 Simbirsk Technologies Ltd. All rights reserved. * * * * This is commercial software, only users who have purchased a valid * * 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. * ****************************************************************************/ // // $Id: store_locator.php 10229 2010-07-27 14:21:39Z 2tl $ // use Tygh\Registry; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($mode == 'search') { fn_add_breadcrumb(__('restricted_locator')); list($restricted_locations, $search) = fn_get_restricted_locations($_REQUEST); Tygh::$app['view']->assign('sl_settings', fn_get_restricted_locator_settings()); Tygh::$app['view']->assign('restricted_locations', $restricted_locations); Tygh::$app['view']->assign('restricted_locator_search', $search); }
if (!empty($data['name'])) { $data['localization'] = empty($data['localization']) ? '' : fn_implode_localizations($data['localization']); $id = db_query('INSERT INTO ?:restricted_locations ?e', $data); if ($id) { $data['restricted_location_id'] = $id; foreach ((array) Registry::get('languages') as $data['lang_code'] => $v) { db_query("INSERT INTO ?:restricted_location_descriptions ?e", $data); } } } } $suffix .= '.manage'; } return array(CONTROLLER_STATUS_OK, 'restricted_locator' . $suffix); } if ($mode == 'delete') { if (!empty($_REQUEST['restricted_location_id'])) { db_query('DELETE FROM ?:restricted_locations WHERE restricted_location_id = ?i', $_REQUEST['restricted_location_id']); db_query('DELETE FROM ?:restricted_location_descriptions WHERE restricted_location_id = ?i', $_REQUEST['restricted_location_id']); } return array(CONTROLLER_STATUS_REDIRECT, "restricted_locator.manage"); } elseif ($mode == 'manage') { header('X-UA-Compatible: IE=EmulateIE7'); list($restricted_locations, $search, $total) = fn_get_restricted_locations($_REQUEST, Registry::get('settings.Appearance.admin_elements_per_page'), DESCR_SL); Registry::get('view')->assign('restricted_locations', $restricted_locations); Registry::get('view')->assign('search', $search); if (empty($restricted_locations) && defined('AJAX_REQUEST')) { $ajax->assign('force_redirection', "restricted_locator.manage"); } return array(CONTROLLER_STATUS_OK); }