slako
Karma: 1
|
Re:plugin for Joomap - 2007/03/14 09:22
I've done a simple remo plugin for Joomap. It will show only list of published remo categories (remo category window title is used as category name in map).
| Code: | <?php
/************************************
** Remository plugin for Joomap **
**
Author: slako **
** Homepage: www.eighth-sky.net **
**
version: 1.0.0 **
************************************/
defined( '_VALID_MOS' ) or die( 'Restricted access.' );
$tmp = new Joomap_Remository;
JoomapPlugins::addPlugin( $tmp );
class Joomap_Remository {
function isOfType( &$joomla, &$parent ) {
if( strpos($parent->link, 'option=com_remository') ) {
return true;
}
return false;
}
function &getTree( &$joomap, &$parent ) {
global $database;
$list = array();
$database->setQuery("select id, windowtitle from #__downloads_containers where published = '1' and groupid = '0' order
by windowtitle"«»);
$cats = $database->loadObjectList();
foreach($cats as $cat) {
$node = new stdclass;
$node->id = $parent->id;
$node->name = $cat->windowtitle;
$node->link = $parent->link.'&Itemid='.$parent->id.'&func=select&id='.$cat->id;
$node->tree = array();
$list[$cat->id] = $node;
}
return $list;
}
}
?>
|
save this code as remository.plugin.php and put to joomla_dir/administrator/components/com_joomap/plugins/
I think it is better then nothing. 
Post edited by: slako, at: 2007/03/14 09:24
|