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 $blockdirs = array();
// 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($blockdirs[$modname])) {
$blockdirs[$modname] = array ();
$blockdirs[$modname][] = 'system/' . $moddir . '/pnblocks';
$blockdirs[$modname][] = 'modules/' . $moddir . '/pnblocks';
foreach ($blockdirs[$modname] as $dir) {
if (file_exists($dir) && is_dir($dir) && is_readable($dir)) {
$dh = opendir($dir);
while (($f = readdir($dh)) !== false) {
if (substr($f, -4) == '.php') {
$block = substr($f,0,-4);
pnBlockLoad($modname, $block);
}
}
closedir($dh);
}
}
}
}
$dir = 'config/blocks';
if (file_exists($dir) && is_dir($dir) && is_readable($dir)) {
$dh = opendir($dir);
while (($f = readdir($dh)) !== false) {
if (substr($f, -4) == '.php') {
$block = substr($f,0,-4);
pnBlockLoad('Legacy', $block);
}
}
closedir($dh);
}
// Return information gathered
return $GLOBALS['blocks_modules'];
}
{
static $blockdirs = array();
// 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($blockdirs[$modname])) {
$blockdirs[$modname] = array ();
$blockdirs[$modname][] = 'system/' . $moddir . '/pnblocks';
$blockdirs[$modname][] = 'modules/' . $moddir . '/pnblocks';
foreach ($blockdirs[$modname] as $dir) {
if (file_exists($dir) && is_dir($dir) && is_readable($dir)) {
$dh = opendir($dir);
while (($f = readdir($dh)) !== false) {
if (substr($f, -4) == '.php') {
$block = substr($f,0,-4);
pnBlockLoad($modname, $block);
}
}
closedir($dh);
}
}
}
}
$dir = 'config/blocks';
if (file_exists($dir) && is_dir($dir) && is_readable($dir)) {
$dh = opendir($dir);
while (($f = readdir($dh)) !== false) {
if (substr($f, -4) == '.php') {
$block = substr($f,0,-4);
pnBlockLoad('Legacy', $block);
}
}
closedir($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
