PATH:
home
/
centosnipponia
/
public_html
/
nipponiacom2
/
caribe
/
administrator
/
mediainstall_5783b23ee86ff
<?php /** * @version $Id: com_djcatalog2.php 392 2015-04-01 15:29:14Z michal $ * @package DJ-Catalog2 * @copyright Copyright (C) 2012 DJ-Extensions.com LTD, All rights reserved. * @license http://www.gnu.org/licenses GNU/GPL * @author url: http://dj-extensions.com * @author email contact@dj-extensions.com * @developer Michal Olczyk - michal.olczyk@design-joomla.eu * * DJ-Catalog2 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * DJ-Catalog2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with DJ-Catalog2. If not, see <http://www.gnu.org/licenses/>. * */ defined( '_JEXEC' ) or die( 'Restricted access' ); require_once(JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_djcatalog2' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'categories.php'); class SefExt_com_djcatalog2 extends SefExt { var $metatags = array(); function create(&$uri) { $this->params = SEFTools::GetExtParams('com_djcatalog2'); $query = $uri->getQuery(true); extract($query); if (!empty($task) && ($task == 'paymentProcess' || $task == 'paymentResponse')) { return $uri; } $categories = Djc2Categories::getInstance(array('state'=>1)); $app = JFactory::getApplication(); $db = JFactory::getDbo(); $menu = $app->getMenu('site'); $Itemid = (isset($query['Itemid'])) ? $query['Itemid'] : null; $menu_item = (isset($query['Itemid'])) ? $menu->getItem($query['Itemid']) : $menu->getDefault(); //$option = (empty($menu_item->component)) ? (empty($query['option']) ? null : $query['option']) : $menu_item->component; $option = null; if (empty($query['option'])) { if (!empty($menu_item->component) && $Itemid > 0) { $option = $menu_item->component; } } else { $option = $query['option']; } //echo 'query: '.@$query['option'].'<br />menu: '.$menu_item->component;die(); $mView = (empty($menu_item->query['view'])) ? null : $menu_item->query['view']; $mCatid = (empty($menu_item->query['cid'])) ? null : (int)$menu_item->query['cid']; $mProdid = (empty($menu_item->query['pid'])) ? null : (int)$menu_item->query['pid']; $mId = (empty($menu_item->query['id'])) ? null : (int)$menu_item->query['id']; $view = !empty($query['view']) ? $query['view'] : null; $cid = !empty($query['cid']) ? (int)$query['cid'] : null; $pid = !empty($query['pid']) ? (int)$query['pid'] : null; $id = !empty($query['id']) ? (int)$query['id'] : null; $nonSefVars = array(); $title = array(); //$lang = (empty($menu_item->language)) ? '' : $menu_item->language; $lang = isset($this->lang) ? $this->lang : null; $title[] = JoomSEF::_getMenuTitleLang($option, $lang, $Itemid); if ($view == 'item' || $view == 'items') { $cid = ($cid) ? (int)$cid : 0; $category = $categories->get($cid); if ($category) { if ($category->id > 0) { $this->metatags = array('metatitle' => $category->metatitle, 'metakey'=> $category->metakey, 'metadesc' => $category->metadesc); } $category_path = array_reverse($category->getPath()); if ($mView == 'items' && $mCatid >= 0) { $menu_category = $categories->get($mCatid); if ($menu_category) { $menu_category_path = array_reverse($menu_category->getPath()); foreach ($category_path as $k=>$v) { if (in_array($v, $menu_category_path)) { unset($category_path[$k]); } } } } else if ($mView != 'items' || $option != 'com_djcatalog2') { $root_name = JFilterOutput::stringURLSafe($this->params->get('orphaned_categories_root','items')); if ($this->params->get('handle_orphaned_categories','0') == '1' && $root_name != '') { $title = array($root_name); } else { // clean the array // start routing from / - start page $title = array(); } } $show_category = $this->params->get('show_category', '2'); if ($show_category != '0') { foreach ($category_path as $k=>$cat_slug) { if ($show_category == '2' || ($show_category == '1' && $category_path[$k] == end($category_path))) { $child = $categories->get((int)$cat_slug); if (!empty($child)) { $title[] = $child->alias; } } } } else if ($view == 'items' && !empty($category->alias)) { $title[] = $category->alias; } //$title = array_merge($title, $category_path); if ($view == 'item' && $id > 0) { $db->setQuery('select alias, metakey, metadesc, metatitle from #__djc2_items where id='.$id); $item = $db->loadObject(); $alias = $id; if ($item) { $item_symbol = JFilterOutput::stringURLSafe($this->params->get('product_symbol', 'details')); $alias = $item->alias; if ($this->params->get('product_alias', '0') == '1' && $item_symbol != '') { $alias = $item_symbol.'-'.$alias; } else if ($this->params->get('product_alias', '0') == '2' && $item_symbol != '') { $alias .= '-'.$item_symbol; } $this->metatags = array('metatitle' => $item->metatitle, 'metakey'=> $item->metakey, 'metadesc' => $item->metadesc); } // TODO: maybe there should be prefix before product $title[] = $alias; unset($query['id']); } if($view == 'items' && isset($query['pid'])) { if ($pid != null && $pid >= 0 && ($mProdid == 0 || $mProdid == '')) { $db->setQuery('select alias from #__djc2_producers where id='.(int)$pid); $producer_alias = $db->loadResult(); if ($producer_alias) { $title[] = $producer_alias; } else { $nonSefVars['pid'] = $query['pid']; } } unset($query['pid']); } } else { JoomSefLogger::Log("Category with ID {$cid} could not be found.", $this, 'com_djcatalog2'); //return array(); } } else if ($view == 'producer') { if ($pid > 0) { $db->setQuery('select alias, metakey, metadesc, metatitle from #__djc2_producers where id='.(int)$pid); $producer = $db->loadObject(); $producer_alias = $pid; if ($producer) { $producer_alias = $producer->alias; $this->metatags = array('metatitle' => $producer->metatitle, 'metakey'=> $producer->metakey, 'metadesc' => $producer->metadesc); } if ($pid != $mProdid || $mView != 'producer') { if (!($mView == 'items' && $option == 'com_djcatalog2' && $mCatid == 0)) { $root_name = JFilterOutput::stringURLSafe($this->params->get('orphaned_producers_root','producer')); if ($this->params->get('handle_orphaned_producers','0') == '1' && $root_name != '') { $title = array($root_name); } else { // clean the array // start routing from / - start page $title = array(); } } $producer_symbol = JFilterOutput::stringURLSafe($this->params->get('producer_symbol', 'page')); if ($this->params->get('producer_alias', '2') == '1' && $producer_symbol != '') { $producer_alias = $producer_symbol.'-'.$producer_alias; } else if ($this->params->get('producer_alias', '2') == '2' && $producer_symbol != '') { $producer_alias = $producer_alias.'-'.$producer_symbol; } $title[] = $producer_alias; } unset($query['pid']); } } else if ($view == 'myitems') { $root_name = JFilterOutput::stringURLSafe($this->params->get('orphaned_myitems_root','myitems')); if ($root_name == '') { $root_name = 'myitems'; } if (!($mView == 'myitems' && $option == 'com_djcatalog2')) { $title[] = $root_name; } } else if ($view == 'itemform') { $my_items_root_name = JFilterOutput::stringURLSafe($this->params->get('orphaned_myitems_root','myitems')); $itemform_root_name = JFilterOutput::stringURLSafe($this->params->get('orphaned_itemform_root','itemform')); if ($my_items_root_name == '') { $my_items_root_name = 'myitems'; } if ($itemform_root_name == '') { $itemform_root_name = 'itemform'; } if (!($mView == 'itemform' && $option == 'com_djcatalog2')) { if ($mView != 'myitems' || ($mView != 'items' && $cid > 0)) { $title[] = $my_items_root_name; } $title[] = $itemform_root_name; } if ($id > 0) { $title[] = $id; unset($query['id']); } } else if ($view == 'producers') { $root_name = JFilterOutput::stringURLSafe($this->params->get('orphaned_producers_list_root','producers')); if ($root_name == '') { $root_name = 'producers'; } if (!($mView == 'producers' && $option == 'com_djcatalog2')) { $title[] = $root_name; } } else if ($view == 'order') { $view_alias = $this->params->get('order_alias','order'); $title[] = $view_alias; if (isset($query['oid'])) { $title[] = $query['oid']; unset($query['oid']); } } else { if ($option != 'com_djcatalog2') { return $uri; } else if ($mView != $view) { $title[] = $view; } } if(isset($query[JSession::getFormToken()])) { $nonSefVars[JSession::getFormToken()] = 1; } if(isset($query['id'])) { $nonSefVars['id'] = $query['id']; } if(isset($query['pid'])) { $nonSefVars['pid'] = $query['pid']; } if(isset($query['cm'])) { $nonSefVars['cm'] = $query['cm']; } if(isset($query['ind'])) { $nonSefVars['ind'] = $query['ind']; } if(isset($query['search'])) { $nonSefVars['search'] = $query['search']; } if(isset($query['order'])) { $nonSefVars['order'] = $query['order']; } if(isset($query['oid'])) { $nonSefVars['oid'] = $query['oid']; } if(isset($query['dir'])) { $nonSefVars['dir'] = $query['dir']; } if(isset($query['tmpl'])) { $nonSefVars['tmpl'] = $query['tmpl']; } if(isset($query['format'])) { $nonSefVars['format'] = $query['format']; } if(isset($query['type'])) { $nonSefVars['type'] = $query['type']; } if(isset($query['l'])) { $nonSefVars['l'] = $query['l']; } if(isset($query['plg'])) { $nonSefVars['plg'] = $query['plg']; } if(isset($query['plgid'])) { $nonSefVars['plgid'] = $query['plgid']; } if(isset($query['item_id'])) { $nonSefVars['item_id'] = $query['item_id']; } if(isset($query['billing'])) { $nonSefVars['billing'] = $query['billing']; } if(isset($query['error'])) { $nonSefVars['error'] = $query['error']; } if(isset($query['success'])) { $nonSefVars['success'] = $query['success']; } /* * TODO: pagination handling */ if(isset($query['limitstart'])) { $nonSefVars['limitstart'] = $query['limitstart']; } if(isset($query['limit'])) { $nonSefVars['limit'] = $query['limit']; } $db->setQuery('select alias from #__djc2_items_extra_fields where type=\'checkbox\' or type=\'radio\' or type=\'select\''); $extra_fields = $db->loadColumn(); if (count($extra_fields) > 0) { foreach($extra_fields as $extra_field) { if(isset($query['f_'.$extra_field])) { $nonSefVars['f_'.$extra_field] = $query['f_'.$extra_field]; } } } $newUri = $uri; if (count($title)) { $newUri = JoomSEF::_sefGetLocation($uri, $title, @$task, @$limit, @$limitstart, $lang, $nonSefVars, null, $this->metatags); } return $newUri; } } ?>
[+]
..
[-] com_djcatalog2.php
[edit]
[-] com_djcatalog2.xml
[edit]
[-] .htaccess.disabled
[edit]