function index() { $Session = RegisterClass::getInstance('MvcSession'); $module_id = Sanitize::getInt($this->params, 'module_id', Sanitize::getInt($this->data, 'module_id')); if (!isset($this->params['module'])) { $this->params['module'] = array(); } // For direct calls to the controller if ($this->ajaxRequest) { $this->params = $Session->get('module_params' . $module_id, null, S2Paths::get('jreviews', 'S2_CMSCOMP')); } else { srand((double) microtime() * 1000000); $this->params['rand'] = rand(); $Session->set('module_rand' . $module_id, $this->params['rand'], S2Paths::get('jreviews', 'S2_CMSCOMP')); $Session->set('module_params' . $module_id, $this->params, S2Paths::get('jreviews', 'S2_CMSCOMP')); } $this->viewSuffix = Sanitize::getString($this->params['module'], 'tmpl_suffix'); // Read the module parameters $img_width = Sanitize::getInt($this->params['module'], 'img_width', 50); $random_mode = Sanitize::getString($this->params['module'], 'random_mode', 'Random Users'); $favorites_mode = Sanitize::getString($this->params['module'], 'favorites_mode', 'Other users interested in {title}'); // Pagination $this->Community->limit = $this->module_limit; $this->Community->offset = $this->module_offset; # Get url params for current controller/action $url = Sanitize::getString($_REQUEST, 'url'); $route['url']['url'] = $url; $route['data'] = array(); $route = S2Router::parse($route, true, 'jreviews'); # Check if page is listing detail $detail = Sanitize::getString($route['url'], 'extension', 'com_content') == 'com_content' && isset($route['data']) && Sanitize::getString($route['data'], 'controller') == 'listings' && Sanitize::getString($route['data'], 'action') == 'detail' ? true : false; # Initialize variables $listing_id = $detail ? Sanitize::getInt($route, 'id') : Sanitize::getInt($this->params, 'id'); $option = Sanitize::getString($this->params, 'option'); $view = Sanitize::getString($this->params, 'view'); $task = Sanitize::getString($this->params, 'task'); $listing_title = ''; # Article auto-detect - only for com_content if ($detail || 'com_content' == $option && ('article' == $view || 'view' == $task)) { $query = "SELECT Listing.id, Listing.title FROM #__content AS Listing WHERE Listing.id = " . $listing_id; $this->_db->setQuery($query); $listing = current($this->_db->loadObjectList()); $listing_title = $listing->title; } else { $listing_id = null; } $profiles = $this->Community->getListingFavorites($listing_id, $this->_user->id, $this->params); $total = $this->Community->count; unset($this->Community->count); $this->set(array('profiles' => $profiles, 'listing_title' => $listing_title, 'total' => $total)); $page = $this->render('modules', 'favorite_cbusers'); if ($this->ajaxRequest) { return $this->ajaxResponse($page, false); } else { return $page; } }
* or contact sales@reviewsforjoomla.com **/ defined('_VALID_MOS') || defined('_JEXEC') or die('Direct Access to this location is not allowed.'); # MVC initalization script if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); } require dirname(__FILE__) . DS . 'framework.php'; global $Itemid; $url = Sanitize::getString($_REQUEST, 'url'); $menu_id = Sanitize::getInt($_REQUEST, 'Itemid', $Itemid); $menu_id = $menu_id == 99999999 ? null : $menu_id; $menu_params = array(); # Check if this is a custom route $route['url']['url'] = $url; $route = S2Router::parse($route, false, 'jreviews'); /******************************************************************* * ADMIN ROUTING ******************************************************************/ if (defined('MVC_FRAMEWORK_ADMIN')) { // Ensure user has access to this function switch (getCmsVersion()) { case 'CMS_JOOMLA15': $User =& cmsFramework::getUser(); $Acl =& cmsFramework::getACL(); if ($Acl->acl_check('administration', 'manage', 'users', $User->usertype, 'components', S2Paths::get('jreviews', 'S2_CMSCOMP'))) { cmsFramework::redirect('index.php', JText::_('ALERTNOTAUTH')); } break; case 'CMS_JOOMLA16': if (!JFactory::getUser()->authorise('core.manage', S2Paths::get('jreviews', 'S2_CMSCOMP'))) {
/** * Category auto-detect */ function _discoverIDs(&$controller) { // Initialize variables $id = Sanitize::getInt($controller->params, 'id'); $cat_id = Sanitize::getInt($controller->params, 'catid'); $option = Sanitize::getString($controller->params, 'option'); $view = Sanitize::getString($controller->params, 'view'); $task = Sanitize::getString($controller->params, 'task'); switch ($option) { case 'com_jreviews': # Get url params for current controller/action $url = Sanitize::getString($controller->passedArgs, 'url'); $route['url']['url'] = $url; $route = S2Router::parse($route, true, 'jreviews'); isset($route['data']['action']) and $route['data']['action'] == 'search' and $route = $route['url']; $dir_id = Sanitize::getString($route, 'dir'); $section_id = Sanitize::getString($route, 'section'); $cat_id = Sanitize::getString($route, 'cat'); $criteria_id = Sanitize::getString($route, 'criteria'); if ($cat_id != '') { if ($cat_id[0] == 's') { $section_id = CommonController::makeModParamsUsable(str_replace('s', '', $cat_id)); $cat_id = ''; break; } $cat_id = CommonController::makeModParamsUsable($cat_id); } elseif ($section_id != '') { $section_id = CommonController::makeModParamsUsable($section_id); } elseif ($criteria_id != '') { $criteria_id = CommonController::makeModParamsUsable($criteria_id); } elseif ($dir_id != '') { $dir_id = CommonController::makeModParamsUsable($dir_id); } else { //Discover the params from the menu_id $menu_id = Sanitize::getString($controller->params, 'Itemid'); $params = $controller->Menu->getMenuParams($menu_id); $dir_id = cleanIntegerCommaList(Sanitize::getString($params, 'dirid')); $cat_id = cleanIntegerCommaList(Sanitize::getString($params, 'catid')); $section_id = cleanIntegerCommaList(Sanitize::getString($params, 'sectionid')); } break; case 'com_content': if ('article' == $view || 'view' == $task) { // If cat id was not available in url then we need to query it, otherwise it was already read above if (!$cat_id) { $query = "\r\n SELECT \r\n catid \r\n FROM \r\n #__content\r\n WHERE \r\n id = " . $id; $this->_db->setQuery($query); $cat_id = $this->_db->loadResult(); } } elseif ($view == "section") { $section_id = $id; } elseif ($view == "category") { $cat_id = $id; } break; default: $cat_id = null; // Catid not detected because the page is neither content nor jreviews break; } $ids = array(); isset($dir_id) and !empty($dir_id) and $ids['dir_id'] = $dir_id; isset($section_id) and !empty($section_id) and $ids['section_id'] = $section_id; isset($cat_id) and !empty($cat_id) and $ids['cat_id'] = $cat_id; isset($criteria_id) and !empty($criteria_id) and $ids['criteria_id'] = $criteria_id; return $ids; }
function index() { $module_id = Sanitize::getInt($this->params, 'module_id', Sanitize::getInt($this->data, 'module_id')); if (!isset($this->params['module'])) { $this->params['module'] = array(); } // For direct calls to the controller $listing_type_id = Sanitize::getInt($this->params, 'listingtype', false); # Find the correct set of params to use if ($this->ajaxRequest && $listing_type_id) { $listingType = $this->Criteria->getCriteria(array('criteria_id' => $listing_type_id)); if (isset($listingType['ListingType']['config']['userfavorites'])) { $userfavoritesParams = $listingType['ListingType']['config']['userfavorites']; $userfavoritesParams['criteria'] = implode(',', Sanitize::getVar($userfavoritesParams, 'criteria', array())); $this->params['module'] = array_merge($this->params['module'], $userfavoritesParams); } } elseif ($this->ajaxRequest && empty($this->params['module']) && $module_id) { $query = "SELECT params FROM #__modules WHERE id = " . $module_id; $this->_db->setQuery($query); $this->params['module'] = stringToArray($this->_db->loadResult()); } # Get cached vesion /* if($this->_user->id === 0) { $page = $this->cached($this->here); if($page) { return $this->ajaxRequest ? $this->ajaxResponse($page,false) : $page; } } */ srand((double) microtime() * 1000000); $this->params['rand'] = rand(); isset($this->params['module']) and $this->viewSuffix = Sanitize::getString($this->params['module'], 'tmpl_suffix'); // Read the module parameters $img_width = Sanitize::getInt($this->params['module'], 'img_width', 50); $random_mode = Sanitize::getString($this->params['module'], 'random_mode', 'Random Users'); $favorites_mode = Sanitize::getString($this->params['module'], 'favorites_mode', 'Other users interested in {title}'); $limit = Sanitize::getInt($this->params['module'], 'module_limit', 5); $total = min(50, Sanitize::getInt($this->params['module'], 'module_total', 10)); # Get url params for current controller/action if (!$this->ajaxRequest) { $url = Sanitize::getString($_REQUEST, 'url'); $route['url']['url'] = $url; $route['data'] = array(); $route = S2Router::parse($route, true, 'jreviews'); # Check if page is listing detail $detail = Sanitize::getString($route['url'], 'extension', 'com_content') == 'com_content' && isset($route['data']) && Sanitize::getString($route['data'], 'controller') == 'listings' && Sanitize::getString($route['data'], 'action') == 'detail' ? true : false; # Initialize variables $listing_id = $detail ? Sanitize::getInt($route, 'id') : Sanitize::getInt($this->params, 'id'); $option = Sanitize::getString($this->params, 'option'); $view = Sanitize::getString($this->params, 'view'); $task = Sanitize::getString($this->params, 'task'); $listing_title = ''; } else { $detail = true; $listing_id = Sanitize::getInt($this->params, 'id'); } # Article auto-detect - only for com_content if ($detail || 'com_content' == $option && ('article' == $view || 'view' == $task)) { $query = "SELECT Listing.id, Listing.title FROM #__content AS Listing WHERE Listing.id = " . $listing_id; $this->_db->setQuery($query); $listing = current($this->_db->loadObjectList()); $listing_title = $listing->title; } else { $listing_id = null; } $profiles = $this->Community->getListingFavorites($listing_id, $this->_user->id, $this->params); $total = count($profiles); $this->set(array('profiles' => $profiles, 'listing_title' => $listing_title, 'limit' => $limit, 'total' => $total)); $this->_completeModuleParamsArray(); $page = $this->ajaxRequest && empty($profiles) ? '' : $this->render('modules', 'favorite_users'); # Save cached version /* if($this->_user->id ===0) { $this->cacheView('modules','userfavorites',$this->here, $page); } */ return $this->ajaxRequest ? $this->ajaxResponse($page, false) : $page; }
function listings() { // Initialize variables $id = Sanitize::getInt($this->params, 'id'); $option = Sanitize::getString($this->params, 'option'); $view = Sanitize::getString($this->params, 'view'); $task = Sanitize::getString($this->params, 'task'); $menu_id = Sanitize::getString($this->params, 'Itemid'); // Read params $cat_id = ''; $criteria_ids = ''; $detail_view = 1; $dir_id = Sanitize::getString($this->params, 'dir'); $section_id = Sanitize::getString($this->params, 'section'); $cat_id = Sanitize::getString($this->params, 'cat'); $extension = 'com_content'; $custom_where = null; $custom_fields = array(); $click2search_auto = false; $cache = 0; $radius = 0; $mode = 0; $fishingmap = 0; $this->set('listing_id', $id); $extracoords = array(); if (isset($this->params['module'])) { // Read module parameters $click2search_auto = Sanitize::getBool($this->params['module'], 'click2search_auto', false); $custom_where = Sanitize::getString($this->params['module'], 'custom_where'); $filter = Sanitize::getString($this->params['module'], 'filter'); $detail_view = Sanitize::getString($this->params['module'], 'detail_view', 1); $dir_id = Sanitize::getString($this->params['module'], 'dir'); $section_id = Sanitize::getString($this->params['module'], 'section'); $cat_id = Sanitize::getString($this->params['module'], 'category'); $listing_id = Sanitize::getString($this->params['module'], 'listing'); $criteria_ids = Sanitize::getString($this->params['module'], 'criteria'); $custom_fields = Sanitize::getString($this->params['module'], 'custom_fields', ''); $custom_fields = $custom_fields != '' ? explode(',', str_replace(' ', '', $custom_fields)) : array(); $limit_results = Sanitize::getInt($this->params['module'], 'limit_results'); $mode = Sanitize::getInt($this->params['module'], 'mode', 0); /** * 0 - Normal * 1 - GeoTargeting * 2 - Custom center and zoom */ $radius = Sanitize::getInt($this->params['module'], 'radius'); $cache = $mode == 1 ? 0 : Sanitize::getInt($this->params['module'], 'cache_map'); $custom_lat = Sanitize::getFloat($this->params['module'], 'custom_lat'); $custom_lon = Sanitize::getFloat($this->params['module'], 'custom_lon'); if ($mode == 2 && ($custom_lat == 0 || $custom_lon == 0)) { echo __t("You selected the Custom Center mode, but did not specify the coordinates."); return; } // Added for Hooked $extracoords = $this->params['module']['extracoords']; //$extracoords = ""; $fishingmap = Sanitize::getInt($this->params['module'], 'fishingmap', 0); } $in_detail_view = $id > 0 && ('article' == $view || 'view' == $task) && 'com_content' == $option; $detail_view = $this->params['module']['detail_view'] = $detail_view && $in_detail_view; # Custom WHERE if ($custom_where) { $conditions[] = $custom_where; } if ($click2search_auto && isset($this->params['tag'])) { $field = 'jr_' . Sanitize::getString($this->params['tag'], 'field'); $value = Sanitize::getString($this->params['tag'], 'value'); $query = "SELECT Field.type FROM #__jreviews_fields AS Field WHERE Field.name = " . $this->quote($field); $this->_db->setQuery($query); $type = $this->_db->loadResult(); if (in_array($type, array('select', 'selectmultiple', 'checkboxes', 'radiobuttons'))) { $conditions[] = "Field.{$field} LIKE " . $this->quoteLike('*' . $value . '*'); } else { $conditions[] = "Field.{$field} = " . $this->quote($value); } } # Category auto detect if (isset($this->params['module']) && Sanitize::getInt($this->params['module'], 'cat_auto') && $extension == 'com_content') { // Only works for core articles switch ($option) { case 'com_jreviews': # Get url params for current controller/action $url = Sanitize::getString($this->passedArgs, 'url'); $route['url']['url'] = $url; $route = S2Router::parse($route); // $route = $route['url']; $dir_id = Sanitize::getString($route, 'dir'); $section_id = Sanitize::getString($route, 'section'); $cat_id = Sanitize::getString($route, 'cat'); $criteria_ids = Sanitize::getString($route, 'criteria'); if ($cat_id != '') { $category_ids = $this->makeParamsUsable($cat_id); $category_ids = explode(",", $category_ids); $this->cleanArray($category_ids); $cat_id = implode(",", $category_ids); } elseif ($section_id != '') { $cat_id = $this->sectionToCat($section_id); } elseif ($criteria_ids != '') { // check criteriaids { $criteriaids_url = $this->makeParamsUsable($criteria_ids); $cat_id = $this->criteriaToCat($criteria_ids); } else { //Discover the params from the menu_id $params = $this->Menu->getMenuParams($menu_id); $dir_id = Sanitize::getString($params, 'dirid'); $cat_id = Sanitize::getString($params, 'catid'); $section_id = Sanitize::getString($params, 'sectionid'); } break; case 'com_content': if ('article' == $view || 'view' == $task) { $sql = "SELECT catid FROM #__content WHERE id = " . $id; $this->_db->setQuery($sql); $cat_id = $this->_db->loadResult(); } elseif ($view == "section") { $cat_id = $this->sectionToCat($id); } elseif ($view == "category") { $cat_id = $id; } break; default: // $cat_id = null; // Catid not detected because the page is neither content nor jreviews break; } } $autodetect = compact('dir_id', 'section_id', 'cat_id'); // Check for cached version if cache enabled if ($cache) { $params = array(); foreach ($this->params as $key => $value) { if ((!is_array($value) || $key == 'module') && !in_array($key, array('page', 'limit', 'order', 'Itemid'))) { $params[$key] = $value; } } $cache_key = array_merge($params, $autodetect, Sanitize::getVar($this->params, 'tag', array())); $json_filename = 'geomaps_' . md5(serialize($cache_key)) . '.json'; $json_data = S2Cache::read($json_filename); if ($json_data && $json_data != '') { $this->set('json_data', $json_data); S2Cache::write($json_filename, $json_data); return $this->render('modules', 'geomaps'); } } $this->Listing->fields = array('Listing.id AS `Listing.listing_id`', 'Listing.title AS `Listing.title`', 'Listing.images AS `Listing.images`', 'CASE WHEN CHAR_LENGTH(Listing.alias) THEN Listing.alias ELSE "" END AS `Listing.slug`', 'Category.id AS `Listing.cat_id`', 'CASE WHEN CHAR_LENGTH(Category.alias) THEN Category.alias ELSE Category.title END AS `Category.slug`', 'Listing.sectionid AS `Listing.section_id`', 'JreviewsCategory.criteriaid AS `Criteria.criteria_id`', 'JreviewsCategory.dirid AS `Directory.dir_id`', 'Field.featured AS `Listing.featured`', 'Totals.user_rating AS `Review.user_rating`', 'Totals.user_rating_count AS `Review.user_rating_count`', 'Totals.editor_rating AS `Review.editor_rating`', 'Totals.editor_rating_count AS `Review.editor_rating_count`', "Field.{$this->jr_lat} `Geomaps.lat`", "Field.{$this->jr_lon} `Geomaps.lon`", 'JreviewsCategory.marker_icon AS `Geomaps.icon`'); if ($fishingmap) { $this->Listing->fields[] = 'GROUP_CONCAT(Related.id2) AS `Listing.relations`'; } // Geo Targeting OR Custom Center modes if ($mode == 1 || $mode == 2) { if ($mode == 1) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www.geoplugin.net/php.gp?ip=' . s2GetIpAddress()); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); $geoData = unserialize(curl_exec($ch)); curl_close($ch); if (!empty($geoData) && $geoData['geoplugin_latitude'] != '' && $geoData['geoplugin_longitude'] != '') { $center = array('lon' => $geoData['geoplugin_longitude'], 'lat' => $geoData['geoplugin_latitude']); } $this->set('geoLocation', $geoData); } if ($mode == 2) { $center = array('lon' => $custom_lon, 'lat' => $custom_lat); } if (!empty($center) && $radius > 0) { $distanceIn = Sanitize::getString($this->Config, 'geomaps.radius_metric', 'mi'); $degreeDistance = $distanceIn == 'mi' ? 69.172 : 40076 / 360; // Send center coordinates to theme $this->set('GeomapsCenter', $center); $lat_range = $radius / $degreeDistance; $lon_range = $radius / abs(cos($center['lat'] * pi() / 180) * $degreeDistance); $min_lat = $center['lat'] - $lat_range; $max_lat = $center['lat'] + $lat_range; $min_lon = $center['lon'] - $lon_range; $max_lon = $center['lon'] + $lon_range; $squareArea = "`Field`.{$this->jr_lat} BETWEEN {$min_lat} AND {$max_lat} AND `Field`.{$this->jr_lon} BETWEEN {$min_lon} AND {$max_lon}"; // Added for Hooked if ($extracoords) { $squareArea = "((" . $squareArea . ")"; foreach ($extracoords as $extra) { $e_lat = $extra->y; $e_lon = $extra->x; $lon_range = $radius / abs(cos($e_lat * pi() / 180) * $degreeDistance); $min_lat = $e_lat - $lat_range; $max_lat = $e_lat + $lat_range; $min_lon = $e_lon - $lon_range; $max_lon = $e_lon + $lon_range; $squareArea .= " OR (`Field`.{$this->jr_lat} BETWEEN {$min_lat} AND {$max_lat} AND `Field`.{$this->jr_lon} BETWEEN {$min_lon} AND {$max_lon})"; } $squareArea .= ")"; } $conditions[] = $squareArea; } } // Create marker_icons array $marker_icons = array(); $icon_fields = array(); $field_images = array(); $query = "SELECT DISTINCT marker_icon FROM #__jreviews_categories WHERE marker_icon != ''"; $this->_db->setQuery($query); $icon_rows = $this->_db->loadAssocList(); foreach ($icon_rows as $icons) { $icon = (array) json_decode($icons['marker_icon']); if ($icon['field'] != '') { $icon_fields[$icon['field']] = "'" . $icon['field'] . "'"; } } if (!empty($icon_fields)) { foreach ($icon_fields as $field_key => $field) { $this->Listing->fields[] = "Field.{$field_key} AS `Field.{$field_key}`"; } } if (!empty($custom_fields)) { foreach ($custom_fields as $field) { $this->Listing->fields[] = "Field.{$field} AS `Field.{$field}`"; } } $this->Listing->joins = array("LEFT JOIN #__categories AS Category ON Listing.catid = Category.id", "LEFT JOIN #__jreviews_listing_totals AS Totals ON Totals.listing_id = Listing.id AND Totals.extension = 'com_content'", "LEFT JOIN #__jreviews_content AS `Field` ON Field.contentid = Listing.id", "INNER JOIN #__jreviews_categories AS JreviewsCategory ON Listing.catid = JreviewsCategory.id AND JreviewsCategory.`option` = 'com_content'", "LEFT JOIN #__jreviews_directories AS Directory ON JreviewsCategory.dirid = Directory.id"); if ($fishingmap) { $this->Listing->joins[] = "LEFT JOIN #__relate_listings AS Related ON Related.id1 = Listing.id"; } // Don't regroup the results by model name keys to save time $this->Listing->primaryKey = false; # Set conditionals based on configuration parameters if ($detail_view) { $conditions[] = 'Listing.id = ' . $id; } if ($dir_id) { $conditions[] = 'JreviewsCategory.dirid IN (' . $dir_id . ')'; } if ($section_id) { $conditions[] = 'Listing.sectionid IN (' . $section_id . ')'; } if ($cat_id) { $conditions[] = 'Listing.catid IN (' . $cat_id . ')'; } if ($listing_id) { $conditions[] = 'Listing.id IN (' . $listing_id . ')'; } if ($filter == 'featured' && !$detail_view) { $conditions[] = 'Field.featured = 1'; } $conditions[] = "Field.{$this->jr_lat} <> ''"; $conditions[] = "Field.{$this->jr_lon} <> ''"; $conditions[] = 'Listing.state = 1'; if ($fishingmap) { $this->Listing->group = array('Listing.id'); } // Paid Listings - add plan cat id isset($this->PaidListings) and $this->PaidListings->applyBeforeFindListingChanges($this->Listing); $listings = $this->Listing->findAll(array('conditions' => $conditions, 'limit' => $limit_results), array()); $custom_fields = array_filter(array_merge($custom_fields, array_keys($icon_fields))); $fields = $this->Field->getFields($custom_fields); $json_data = $this->Geomaps->makeJsonObject($listings, $fields, $this->params['module']); $this->set('json_data', $json_data); if ($cache) { S2Cache::write($json_filename, $json_data); } return $this->render('modules', 'geomaps'); }
/** * Returns array of GET and POST parameters. GET parameters are taken from given URL. * * @param string $fromUrl URL to mine for parameter information. * @return array Parameters found in POST and GET. * @access public */ function parseParams($fromUrl = '') { $params = array(); $params['data'] = array(); isset($_COOKIE) and ini_get('magic_quotes_gpc') == 1 and $_COOKIE = s2_stripslashes_deep($_COOKIE); if (isset($_POST)) { if (ini_get('magic_quotes_gpc') == 1) { if (function_exists('s2_stripslashes_deep')) { $params['form'] = s2_stripslashes_deep($_POST); } else { $params['form'] = stripslashes_deep($_POST); } } else { $params['form'] = $_POST; } if (isset($params['form']['_method'])) { if (isset($_SERVER) && !empty($_SERVER)) { $_SERVER['REQUEST_METHOD'] = $params['form']['_method']; } else { $_ENV['REQUEST_METHOD'] = $params['form']['_method']; } unset($params['form']['_method']); } } if (isset($params['form']['data'])) { $params['data'] = Sanitize::stripEscape($params['form']['data']); unset($params['form']['data']); } if (isset($_GET)) { if (ini_get('magic_quotes_gpc') == 1) { $url = s2_stripslashes_deep($_GET); } else { $url = $_GET; } if (isset($params['url'])) { $params['url'] = array_merge($params['url'], $url); } else { $params['url'] = $url; } } foreach ($_FILES as $name => $data) { if ($name != 'data') { $params['form'][$name] = $data; } } if (isset($_FILES['data'])) { foreach ($_FILES['data'] as $key => $data) { foreach ($data as $model => $fields) { foreach ($fields as $field => $value) { $params['data'][$model][$field][$key] = $value; } } } } if (isset($params['data']['controller'])) { $params['controller'] = Sanitize::getString($params['data'], 'controller'); $params['action'] = Sanitize::getString($params['data'], 'action'); } $Router =& S2Router::getInstance(); $Router->app = $this->app; $params = S2Router::parse($params); foreach ($params['url'] as $key => $value) { if ($key != 'url') { $params[$key] = $value; } } return $params; }