@ Irmtfan:
Quote:
good suggestions Mamba.
Im totally agree with using this:
$modversion['icons16'] = '../../Frameworks/moduleclasses/icons/16';
$modversion['icons32'] = '../../Frameworks/moduleclasses/icons/32'
;
Well, it looks like we need go the way you originally proposed, i.e. to have in xoops_version.php:
$modversion['dirmoduleadmin'] = 'Frameworks/moduleclasses';
$modversion['icons16'] = 'Frameworks/moduleclasses/icons/16';
$modversion['icons32'] = 'Frameworks/moduleclasses/icons/32';
And in menu.php something like this:
$module_handler = xoops_gethandler('module');
$module = $module_handler->getByDirname(basename(dirname(dirname(__FILE__))));
$pathIcon32 = '../../' . $module->getInfo('icons32');
xoops_loadLanguage('modinfo', $module->dirname());
$adminmenu = array();
$i=0;
$adminmenu[$i]["title"] = _MI_WFDOWNLOADS_MENU_HOME;
$adminmenu[$i]['link'] = "admin/index.php";
$adminmenu[$i]["icon"] = $pathIcon32 . '/home.png';
$i++;
...
And in /admin/admin_header.php we would have:
global $xoopsModule;
$pathIcon16 = XOOPS_URL . '/' . $xoopsModule->getInfo('icons16');
$pathIcon32 = XOOPS_URL . '/' . $xoopsModule->getInfo('icons32');
$pathModuleAdmin = XOOPS_ROOT_PATH . '/' . $xoopsModule->getInfo('dirmoduleadmin');
The here defined $pathIcon16 and $pathIcon32 would be then used throughout the whole module.
And in the same way we'll define $pathIcon16 and $pathIcon32 in blocks, i.e.
$pathIcon16 = XOOPS_URL . '/' . $xoopsModule->getInfo('icons16');
$pathIcon32 = XOOPS_URL . '/' . $xoopsModule->getInfo('icons32');
Last week I was working on the "Latest News Block" module and I wanted to use the icons defined in the module the way as I was using them so far, however I couldn't use the variable that way - XOOPS doesn't see a link in a block as an "absolute module link", i.e. that that regardless where the block is, on the front page, or in the module view, the link should stay the same because it is owned by the module. Instead, XOOPS takes the links as relative to the root, so therefore I needed to adjust my thinking and change the scheme
It's not an issue - with this approach we'll have the same consistent way applied in modules and in blocks, just instead of being "module-centric" as it was thus far, the links will be now "root-centric".
Of course, in XOOPS 2.6.0 this will become no issue, because we'll have a direct link to the "media" repository, and XOOPS will find its way there automatically.