function getLinks($args) { $items = array(); $view = isset($args->view) ? $args->view : ''; switch ($view) { default: $categories = WFLinkBrowser::getCategory('com_contact'); foreach ($categories as $category) { $itemid = WFLinkBrowser::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': $categories = WFLinkBrowser::getCategory('com_contact', $args->catid); foreach ($categories as $category) { $children = WFLinkBrowser::getCategory('com_contact', $category->id); if ($children) { $id = 'index.php?option=com_contact&view=category&catid=' . $category->id; } else { $itemid = WFLinkBrowser::getItemId('com_contact', array('categories' => null, 'category' => $category->slug)); $id = 'index.php?option=com_contact&view=category&catid=' . $category->slug . $itemid; } $items[] = array('id' => $id, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder content'); } $contacts = self::_contacts($args->catid); foreach ($contacts as $contact) { $catid = $args->catid ? '&catid=' . $args->catid : ''; $itemid = WFLinkBrowser::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; }
function getLinks($args) { $items = array(); $view = isset($args->view) ? $args->view : ''; switch ($view) { default: if (defined('JPATH_PLATFORM')) { $categories = WFLinkBrowser::getCategory('com_contact'); } else { $categories = WFLinkBrowser::getCategory('com_contact_details'); } foreach ($categories as $category) { $itemid = WFLinkBrowser::getItemId('com_contact', array('category' => $category->id)); if (defined('JPATH_PLATFORM')) { $url = 'index.php?option=com_contact&view=category&id='; } else { $url = 'index.php?option=com_contact&view=category&catid='; } $items[] = array('id' => 'index.php?option=com_contact&view=category&id=' . $category->id, 'url' => $url . $category->slug . $itemid, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder contact'); } break; case 'category': if (defined('JPATH_PLATFORM')) { $categories = WFLinkBrowser::getCategory('com_contact', $args->id); foreach ($categories as $category) { $children = WFLinkBrowser::getCategory('com_contact', $category->id); if ($children) { $id = 'index.php?option=com_contact&view=category&id=' . $category->id; } else { $itemid = WFLinkBrowser::getItemId('com_contact', array('category' => $category->id)); if (!$itemid && isset($args->Itemid)) { // fall back to the parent item's Itemid $itemid = '&Itemid=' . $args->Itemid; } $id = 'index.php?option=com_contact&view=category&id=' . $category->slug . $itemid; } $items[] = array('id' => $id, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder content'); } } $contacts = self::_contacts($args->id); foreach ($contacts as $contact) { $catid = $args->id ? '&catid=' . $args->id : ''; $itemid = WFLinkBrowser::getItemId('com_contact', array('contact' => $contact->id)); if (!$itemid && isset($args->Itemid)) { // fall back to the parent item's Itemid $itemid = '&Itemid=' . $args->Itemid; } $items[] = array('id' => 'index.php?option=com_contact&view=contact' . $catid . '&id=' . $contact->id . '-' . $contact->alias . $itemid, 'name' => $contact->name . ' / ' . $contact->alias, 'class' => 'file'); } break; } return $items; }
public function getLinks($args) { $wf = WFEditorPlugin::getInstance(); $items = array(); switch ($args->view) { // Get all WebLink categories default: case 'categories': $categories = WFLinkBrowser::getCategory('com_weblinks'); foreach ($categories as $category) { if (method_exists('WeblinksHelperRoute', 'getCategoryRoute')) { $id = WeblinksHelperRoute::getCategoryRoute($category->id); } else { $itemid = WFLinkBrowser::getItemId('com_weblinks', array('categories' => null, 'category' => $category->id)); $id = 'index.php?option=com_weblinks&view=category&id=' . $category->id . $itemid; } $items[] = array('id' => $id, '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'; if (!WF_JOOMLA15) { $categories = WFLinkBrowser::getCategory('com_weblinks', $args->id); if (count($categories)) { foreach ($categories as $category) { $children = WFLinkBrowser::getCategory('com_weblinks', $category->id); if ($children) { $id = 'index.php?option=com_weblinks&view=category&id=' . $category->id; } else { if (method_exists('WeblinksHelperRoute', 'getCategoryRoute')) { $id = WeblinksHelperRoute::getCategoryRoute($category->id); } else { $itemid = WFLinkBrowser::getItemId('com_weblinks', array('categories' => null, 'category' => $category->id)); $id = 'index.php?option=com_weblinks&view=category&id=' . $category->id . $itemid; } } $items[] = array('id' => $id, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder weblink'); } } } $weblinks = self::_weblinks($args->id); foreach ($weblinks as $weblink) { $items[] = array('id' => WeblinksHelperRoute::getWeblinkRoute($weblink->slug, $weblink->catslug), 'name' => $weblink->title . ' / ' . $weblink->alias, 'class' => 'file'); } break; } return $items; }
private function _getSection() { $db = JFactory::getDBO(); $user = JFactory::getUser(); if (method_exists('JUser', 'getAuthorisedViewLevels')) { return WFLinkBrowser::getCategory('com_content'); } else { $query = 'SELECT id, title, alias, access' . ' FROM #__sections' . ' WHERE published = 1' . ' AND access <= ' . (int) $user->get('aid') //. ' GROUP BY id' . ' ORDER BY title' ; $db->setQuery($query); return $db->loadObjectList(); } }
public function getLinks($args) { $items = array(); $view = isset($args->view) ? $args->view : ''; $language = ''; if (defined('JPATH_PLATFORM')) { require_once JPATH_SITE . '/components/com_contact/helpers/route.php'; } switch ($view) { default: if (defined('JPATH_PLATFORM')) { $categories = WFLinkBrowser::getCategory('com_contact'); } else { $categories = WFLinkBrowser::getCategory('com_contact_details'); } foreach ($categories as $category) { if (defined('JPATH_PLATFORM')) { // language if (isset($category->language)) { $language = $category->language; } $url = ContactHelperRoute::getCategoryRoute($category->id, $language); } else { $itemid = WFLinkBrowser::getItemId('com_contact', array('category' => $category->id)); $url = 'index.php?option=com_contact&view=category&catid=' . $category->slug . $itemid; } // convert to SEF $url = self::route($url); $items[] = array('id' => 'index.php?option=com_contact&view=category&id=' . $category->id, 'url' => $url, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder contact'); } break; case 'category': if (defined('JPATH_PLATFORM')) { $categories = WFLinkBrowser::getCategory('com_contact', $args->id); foreach ($categories as $category) { $children = WFLinkBrowser::getCategory('com_contact', $category->id); // language if (isset($category->language)) { $language = $category->language; } if ($children) { $id = ContactHelperRoute::getCategoryRoute($category->id, $language); } else { $id = ContactHelperRoute::getCategoryRoute($category->slug, $language); } // convert to SEF $url = self::route($id); $items[] = array('url' => $url, 'id' => $id, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder content'); } } $contacts = self::_contacts($args->id); foreach ($contacts as $contact) { // language if (isset($contact->language)) { $language = $contact->language; } if (defined('JPATH_PLATFORM')) { $id = ContactHelperRoute::getContactRoute($contact->id, $args->id, $language); } else { $catid = $args->id ? '&catid=' . $args->id : ''; $itemid = WFLinkBrowser::getItemId('com_contact', array('contact' => $contact->id)); if (!$itemid && isset($args->Itemid)) { // fall back to the parent item's Itemid $itemid = '&Itemid=' . $args->Itemid; } $id = 'index.php?option=com_contact&view=contact' . $catid . '&id=' . $contact->id . '-' . $contact->alias . $itemid; } $id = self::route($id); $items[] = array('id' => $id, 'name' => $contact->name . ' / ' . $contact->alias, 'class' => 'file'); } break; } return $items; }
public function getLinks($args) { $wf = WFEditorPlugin::getInstance(); $items = array(); require_once JPATH_SITE . '/includes/application.php'; require_once JPATH_SITE . '/components/com_weblinks/helpers/route.php'; switch ($args->view) { // Get all WebLink categories default: case 'categories': $categories = WFLinkBrowser::getCategory('com_weblinks'); foreach ($categories as $category) { $url = ''; $itemid = WFLinkBrowser::getItemId('com_weblinks', array('categories' => null, 'category' => $category->id)); if (method_exists('WeblinksHelperRoute', 'getCategoryRoute')) { $id = WeblinksHelperRoute::getCategoryRoute($category->id); if (strpos($id, 'index.php?Itemid=') !== false) { $url = $id; $id = 'index.php?option=com_weblinks&view=category&id=' . $category->id; } } else { $id = 'index.php?option=com_weblinks&view=category&id=' . $category->id . $itemid; } $items[] = array('url' => $url, 'id' => $id, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder weblink'); } break; // Get all links in the category // Get all links in the category case 'category': if (defined('JPATH_PLATFORM')) { $categories = WFLinkBrowser::getCategory('com_weblinks', $args->id); if (count($categories)) { foreach ($categories as $category) { $children = WFLinkBrowser::getCategory('com_weblinks', $category->id); $url = ''; if ($children) { $id = 'index.php?option=com_weblinks&view=category&id=' . $category->id; } else { $itemid = WFLinkBrowser::getItemId('com_weblinks', array('categories' => null, 'category' => $category->id)); if (method_exists('WeblinksHelperRoute', 'getCategoryRoute')) { $id = WeblinksHelperRoute::getCategoryRoute($category->id); if (strpos($id, 'index.php?Itemid=') !== false) { $url = $id; $id = 'index.php?option=com_weblinks&view=category&id=' . $category->id; } } else { $id = 'index.php?option=com_weblinks&view=category&id=' . $category->id . $itemid; } } $items[] = array('url' => $url, 'id' => $id, 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder weblink'); } } } $weblinks = self::_weblinks($args->id); foreach ($weblinks as $weblink) { $id = WeblinksHelperRoute::getWeblinkRoute($weblink->slug, $weblink->catslug); if (defined('JPATH_PLATFORM')) { $id .= '&task=weblink.go'; } $items[] = array('id' => $id, 'name' => $weblink->title . ' / ' . $weblink->alias, 'class' => 'file'); } break; } return $items; }
private function _getSection() { $db = JFactory::getDBO(); $user = JFactory::getUser(); if (isset($user->gid)) { $query = 'SELECT id, title, alias' . ' FROM #__sections' . ' WHERE published = 1' . ' AND access <= ' . (int) $user->get('aid') . ' ORDER BY title'; $db->setQuery($query); return $db->loadObjectList(); } else { return WFLinkBrowser::getCategory('com_content'); } }