function getItems($args)
 {
     $items = array();
     switch ($args->view) {
         // Get all WebLink categories
         default:
         case 'categories':
             $categories = AdvLink::getCategory('com_weblinks');
             foreach ($categories as $category) {
                 $itemid = AdvLink::getItemId('com_weblinks', array('categories' => null, 'category' => $category->id));
                 $items[] = array('id' => 'index.php?option=com_weblinks&view=category&id=' . $category->id . $itemid, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder weblink');
             }
             break;
             // Get all links in the category
         // Get all links in the category
         case 'category':
             require_once JPATH_SITE . DS . 'includes' . DS . 'application.php';
             require_once JPATH_SITE . DS . 'components' . DS . 'com_weblinks' . DS . 'helpers' . DS . 'route.php';
             $weblinks = AdvlinkWeblinks::_weblinks($args->id);
             foreach ($weblinks as $weblink) {
                 $items[] = array('id' => WeblinksHelperRoute::getWeblinkRoute($weblink->id, $args->id), 'name' => $weblink->title . ' / ' . $weblink->alias, 'class' => 'file');
             }
             break;
     }
     return $items;
 }
Ejemplo n.º 2
0
 /** I HAVE NOT MODIFIED BELOW THIS LINE **/
 function getItems($args)
 {
     global $mainframe;
     $advlink =& AdvLink::getInstance();
     require_once JPATH_SITE . DS . 'components' . DS . 'com_k2' . DS . 'helpers' . DS . 'route.php';
     $items = array();
     $view = isset($args->view) ? $args->view : '';
     switch ($view) {
         default:
             $categories = AdvlinkK2::_getK2Categories();
             foreach ($categories as $category) {
                 $items[] = array('id' => K2HelperRoute::getCategoryRoute($category->id), 'name' => $category->name, 'class' => 'folder content');
             }
             break;
         case 'itemlist':
             $categories = AdvlinkK2::_getK2Categories($args->id);
             $itemlist = AdvlinkK2::_getK2Items($args->id);
             foreach ($categories as $category) {
                 $items[] = array('id' => K2HelperRoute::getCategoryRoute($category->id), 'name' => $category->name, 'class' => 'folder content');
             }
             foreach ($itemlist as $item) {
                 $items[] = array('id' => K2HelperRoute::getItemRoute($item->id, $args->id), 'name' => $item->title, 'class' => 'file');
             }
             break;
         case 'item':
             break;
     }
     return $items;
 }
Ejemplo n.º 3
0
 function getOptions()
 {
     $advlink =& AdvLink::getInstance();
     $list = '';
     if ($advlink->checkAccess('advlink_menu', '1')) {
         $list = '<li id="index.php?option=com_menu"><div class="tree-row"><div class="tree-image"></div><span class="folder menu nolink"><a href="javascript:;">' . JText::_('MENU') . '</a></span></div></li>';
     }
     return $list;
 }
Ejemplo n.º 4
0
 function _articles($id)
 {
     $db =& JFactory::getDBO();
     $user =& JFactory::getUser();
     $advlink =& AdvLink::getInstance();
     $query = 'SELECT a.id AS slug, b.id AS catslug, a.alias, a.title AS title, u.id AS sectionid';
     if ($advlink->getPluginParam('advlink_article_alias', '1') == '1') {
         $query .= ', CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug';
     }
     $query .= ' FROM #__content AS a' . ' INNER JOIN #__categories AS b ON b.id = ' . (int) $id . ' INNER JOIN #__sections AS u ON u.id = a.sectionid' . ' WHERE a.catid = ' . (int) $id . ' AND a.state = 1' . ' AND a.access <= ' . (int) $user->get('aid') . ' ORDER BY a.title';
     $db->setQuery($query, 0);
     return $db->loadObjectList();
 }
Ejemplo n.º 5
0
 function getItems($args)
 {
     $items = array();
     $view = isset($args->view) ? $args->view : '';
     switch ($view) {
         default:
             $categories = AdvLink::getCategory('com_contact_details');
             foreach ($categories as $category) {
                 $itemid = AdvLink::getItemId('com_contact', array('categories' => null, 'category' => $category->slug));
                 $items[] = array('id' => 'index.php?option=com_contact&view=category&catid=' . $category->slug . $itemid, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder contact');
             }
             break;
         case 'category':
             $contacts = AdvlinkContact::_contacts($args->catid);
             foreach ($contacts as $contact) {
                 $catid = $args->catid ? '&catid=' . $args->catid : '';
                 $itemid = AdvLink::getItemId('com_contact', array('categories' => null, 'category' => $catid));
                 $items[] = array('id' => 'index.php?option=com_contact&view=contact' . $catid . '&id=' . $contact->id . $itemid . '-' . $contact->alias, 'name' => $contact->name . ' / ' . $contact->alias, 'class' => 'file');
             }
             break;
     }
     return $items;
 }
Ejemplo n.º 6
0
 function getItems($args)
 {
     global $mainframe;
     $advlink =& AdvLink::getInstance();
     $links = array();
     $view = isset($args->view) ? $args->view : (isset($args->task) ? $args->task : '');
     switch ($view) {
         default:
             $apps = AdvlinkZoo::_application();
             foreach ($apps as $app) {
                 $links[] = array('id' => 'index.php?option=com_zoo&task=application&application_id=' . $app->id, 'name' => $app->name, 'class' => 'folder application nolink');
             }
             break;
         case 'application':
             $categories = AdvlinkZoo::_category(0, $args->application_id);
             foreach ($categories as $category) {
                 $itemid = AdvlinkZoo::getItemId(array('category' => $category->id, 'application' => $category->application_id));
                 $links[] = array('id' => 'index.php?option=com_zoo&task=category&category_id=' . $category->id . $itemid, 'name' => $category->name . ' / ' . $category->alias, 'class' => 'folder category');
             }
             break;
         case 'category':
             $categories = AdvlinkZoo::_category($args->category_id);
             foreach ($categories as $category) {
                 $itemid = AdvlinkZoo::getItemId(array('category' => $category->id, 'application' => $category->application_id));
                 $links[] = array('id' => 'index.php?option=com_zoo&task=category&category_id=' . $category->id . $itemid, 'name' => $category->name . ' / ' . $category->alias, 'class' => 'folder category');
             }
             $items = AdvlinkZoo::_item($args->category_id);
             if (!empty($items)) {
                 foreach ($items as $item) {
                     $itemid = AdvlinkZoo::getItemId(array('category' => $args->category_id, 'application' => $category->application_id));
                     $links[] = array('id' => 'index.php?option=com_zoo&task=item&item_id=' . $item->id . $itemid, 'name' => $item->name . ' / ' . $item->alias, 'class' => 'file');
                 }
             }
             break;
     }
     return $links;
 }
 /**
  * Category function used by many extensions
  *
  * @access	public
  * @return	Category list object.
  * @since	1.5
  */
 function getCategory($section)
 {
     $db =& JFactory::getDBO();
     $user =& JFactory::getUser();
     $advlink =& AdvLink::getInstance();
     $query = 'SELECT id AS slug, id AS id, title, alias';
     if ($advlink->getPluginParam('advlink_category_alias', '1') == '1') {
         $query .= ', CASE WHEN CHAR_LENGTH(alias) THEN CONCAT_WS(":", id, alias) ELSE id END as slug';
     }
     $query .= ' FROM #__categories' . ' WHERE section = ' . $db->Quote($section) . ' AND published = 1' . ' AND access <= ' . (int) $user->get('aid') . ' ORDER BY title';
     $db->setQuery($query);
     return $db->loadObjectList();
 }
Ejemplo n.º 8
0
/**
* $Id: advlink.php 26 2009-05-25 10:21:53Z happynoodleboy $
* @package      JCE
* @copyright    Copyright (C) 2005 - 2009 Ryan Demmer. All rights reserved.
* @author		Ryan Demmer
* @license      GNU/GPL
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/
defined('_JEXEC') or die('Restricted access');
$version = "1.5.7.4";
require_once dirname(__FILE__) . DS . 'classes' . DS . 'advlink.php';
$advlink =& AdvLink::getInstance();
// Process Requests
$advlink->processXHR(true);
// Load Plugin Parameters
$params = $advlink->getPluginParams();
$advlink->_debug = false;
$version .= $advlink->_debug ? ' - debug' : '';
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php 
echo $advlink->getLanguageTag();
?>
" lang="<?php 
echo $advlink->getLanguageTag();
?>
" dir="<?php 
echo $advlink->getLanguageDir();
Ejemplo n.º 9
0
<?php

include dirname(__FILE__) . '/../../debug.php';
include dirname(__FILE__) . '/../../config/config.inc.php';
include_once dirname(__FILE__) . '/classes/AdvLink.php';
include_once dirname(__FILE__) . '/classes/AdvSearch.php';
include_once dirname(__FILE__) . '/yasearch.php';
if (Tools::getValue('ajaxSearch') and $query = urldecode(Tools::getValue('q')) and !is_array($query)) {
    include dirname(__FILE__) . '/../../init.php';
    $link = new AdvLink();
    $search = AdvSearch::find(intval(Tools::getValue('id_lang')), $query, 1, 10, 'position', 'desc', true);
    foreach ($search as $product) {
        echo $product['id_product'] . '|' . $product['pname'] . '|' . $product['cname'] . '|' . $link->getProductLink($product['id_product'], $product['prewrite'], $product['crewrite']) . "\n";
    }
    die;
}
include dirname(__FILE__) . '/../../header.php';
include dirname(__FILE__) . '/../../product-sort.php';
if (Tools::getValue('advSearch') == 1) {
    if (Tools::getValue('search_queryy') == null and Tools::getValue('price_from') == null and Tools::getValue('price_to') == null and !Tools::getValue('atrybut_opcja') and !Tools::getValue('categories') and !Tools::getValue('supply') and !Tools::getValue('manufacturer') and !Tools::getValue('tags') or !Validate::isValidSearch(Tools::getValue('search_queryy')) or Tools::getValue('price_from') != null and !is_numeric(Tools::getValue('price_from')) or Tools::getValue('price_to') != null and !is_numeric(Tools::getValue('price_to'))) {
        $smarty->assign('errors', array(Tools::displayError('invalid search')));
    } else {
        $n = abs(intval(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE'))));
        $p = abs(intval(Tools::getValue('p', 1)));
        $search = AdvSearch::find_adv(intval($cookie->id_lang), Tools::getValue('search_queryy'), $p, $n, $orderBy, $orderWay);
        $nbProducts = $search['total'];
        include dirname(__FILE__) . '/../../pagination.php';
        /*$smarty->assign(array(
        			'products' => $search->find_adv(intval($cookie->id_lang),Tools::getValue('search_queryy'), $p, $n, $orderBy,$orderWay),
        			'nbProducts' => $nbProducts,
        			'advSearch' => 'Advanced Search'));