/** 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; }
function getOptions() { $advlink =& AdvLink::getInstance(); $list = ''; if ($advlink->checkAccess('advlink_weblinks', '1')) { $list = '<li id="index.php?option=com_weblinks&view=categories"><div class="tree-row"><div class="tree-image"></div><span class="folder weblink nolink"><a href="javascript:;">' . JText::_('WEBLINKS') . '</a></span></div></li>'; } return $list; }
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; }
function getOptions() { //Reference to JConentEditor (JCE) instance $advlink =& AdvLink::getInstance(); $list = ''; if ($advlink->checkAccess('contacts', '1')) { $list .= '<li id="index.php?option=com_contact"><div class="tree-row"><div class="tree-image"></div><span class="folder contact nolink"><a href="javascript:;">' . JText::_('CONTACTS') . '</a></span></div></li>'; } return $list; }
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(); }
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(); }
/** * $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();