Такая штука. Есть модуль mod_djc2categories, который выводит меню категорий каталога. Но дело в том, что для Xmap генерит ссылки из меню. Поэтому ссылом модуля не видит, что не есть гуд.
Пытаюсь создать плагин, - но так и не добился результата. Может кто подскажет, где собака зарыта?
XML плагина:
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" group="xmap" version="1.6" method="upgrade" client="site">
<name>Xmap - DJ-Catalog2 Categories</name>
<creationDate>2014</creationDate>
<author></author>
<copyright></copyright>
<license></license>
<authorEmail></authorEmail>
<authorUrl></authorUrl>
<version>1.0</version>
<description>Загружает ссылки модуля DJ-Catalog2 Categories</description>
<files>
<filename plugin="com_djcattgories">com_djcattgories.php</filename>
<filename>index.html</filename>
</files>
</extension>
Код плагина:
<?php
defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' );
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
require_once JPATH_SITE . DS . 'components' . DS . 'com_djcatalog2' . DS . 'helpers' . DS . 'route.php';
require_once JPATH_SITE . DS . 'administrator' . DS . 'components' . DS . 'com_djcatalog2' . DS . 'lib' . DS . 'categories.php';
class xmap_com_djcattgories {
static function prepareMenuItem($node, &$params) {
$node->expandible = false;
}
static function getTree($xmap, $parent, &$params) {
$params['cat_priority'] = 0.5;
$params['cat_changefreq'] = 'weekly';
$params['link_priority'] = 0.5;
$params['link_changefreq'] = 'weekly';
$categories = Djc2Categories::getInstance(array('state'=>'1'));
$root = $categories->get(0);
$children = $root->getChildren();
foreach ($children as $child) {
$node = new stdclass;
$node->id = $parent->id;
$node->uid = $child->id;
$node->name = $child->name;
$node->link = JURI::root(). JRoute::_(DJCatalogHelperRoute::getCategoryRoute($child->catslug), true);
$node->priority = $params['link_priority'];
$node->changefreq = $params['link_changefreq'];
$node->expandible = false;
$xmap->printNode($node);
}
}
}