i would like to know if it's possible to load a block from the theme folder ?
i ve look at pnBlock.php and have seen this
Code
function pnBlockLoadAll()
{
static [17] $blockdirs = array [18]();
// Load new-style blocks from system and modules tree
$mods = pnModGetAllMods();
foreach ($mods as $mod) {
$modname = $mod['name'];
$moddir = DataUtil::formatForOS($mod['directory']);
if (!isset [19]($blockdirs[$modname])) {
$blockdirs[$modname] = array [20] ();
$blockdirs[$modname][] = 'system/' . $moddir . '/pnblocks';
$blockdirs[$modname][] = 'modules/' . $moddir . '/pnblocks';
foreach ($blockdirs[$modname] as $dir) {
if (file_exists [21]($dir) && is_dir [22]($dir) && is_readable [23]($dir)) {
$dh = opendir [24]($dir);
while (($f = readdir [25]($dh)) !== false) {
if (substr [26]($f, -4) == '.php') {
$block = substr [27]($f,0,-4);
pnBlockLoad($modname, $block);
}
}
closedir [28]($dh);
}
}
}
}
$dir = 'config/blocks';
if (file_exists [29]($dir) && is_dir [30]($dir) && is_readable [31]($dir)) {
$dh = opendir [32]($dir);
while (($f = readdir [33]($dh)) !== false) {
if (substr [34]($f, -4) == '.php') {
$block = substr [35]($f,0,-4);
pnBlockLoad('Legacy', $block);
}
}
closedir [36]($dh);
}
// Return information gathered
return $GLOBALS['blocks_modules'];
}
{
static [17] $blockdirs = array [18]();
// Load new-style blocks from system and modules tree
$mods = pnModGetAllMods();
foreach ($mods as $mod) {
$modname = $mod['name'];
$moddir = DataUtil::formatForOS($mod['directory']);
if (!isset [19]($blockdirs[$modname])) {
$blockdirs[$modname] = array [20] ();
$blockdirs[$modname][] = 'system/' . $moddir . '/pnblocks';
$blockdirs[$modname][] = 'modules/' . $moddir . '/pnblocks';
foreach ($blockdirs[$modname] as $dir) {
if (file_exists [21]($dir) && is_dir [22]($dir) && is_readable [23]($dir)) {
$dh = opendir [24]($dir);
while (($f = readdir [25]($dh)) !== false) {
if (substr [26]($f, -4) == '.php') {
$block = substr [27]($f,0,-4);
pnBlockLoad($modname, $block);
}
}
closedir [28]($dh);
}
}
}
}
$dir = 'config/blocks';
if (file_exists [29]($dir) && is_dir [30]($dir) && is_readable [31]($dir)) {
$dh = opendir [32]($dir);
while (($f = readdir [33]($dh)) !== false) {
if (substr [34]($f, -4) == '.php') {
$block = substr [35]($f,0,-4);
pnBlockLoad('Legacy', $block);
}
}
closedir [36]($dh);
}
// Return information gathered
return $GLOBALS['blocks_modules'];
}
the theme folder doesn't seems to be parsed (perhaps it's done in an other process), so i would like to know if it possible to load a block from a theme folder
edited by: mumuri, Apr 27, 2008 - 12:42 PM
