With a large number of templates to display in the admin sidebar, the following method could be very useful in making things more manageable -
viewtopic.php?f=4&t=11511&p=30740#p30740
viewtopic.php?f=4&t=11511&p=30740#p30740
function my_alter_admin_menuitems( &$items ){
global $FUNCS;
if( array_key_exists('_templates_', $items) ){
unset( $items['_templates_'] ); // removed this so now all templates by default go in '_root_'.
}
$items['_modules_']['weight']=100; // move administration group further down
// remove all hidden templates unless debug is on..
if( !$_GET['debug'] ){
$tpls = array( 'users.php', 'gallery.php', 'search.php' ); // set hidden templates
foreach( $tpls as $tpl ){
if( array_key_exists($tpl, $items) ){
unset( $items[$tpl] );
}
}
}
}
$tpls = array( 'users.php', 'gallery.php', 'search.php' ); // set hidden templates
http://localhost/couch/?o=test.php&q=list
http://localhost/couch/?o=test.php&q=list&debug=1
// hide everything from sidebar except allowed items
if( defined('K_ADMIN') ){
$FUNCS->add_event_listener( 'alter_admin_menuitems', 'my_alter_admin_menuitems' );
function my_alter_admin_menuitems( &$items ){
// set visible templates and sections
$tpls = array(
'_templates_'
, '_modules_'
, 'users'
, 'index.php'
);
$items = array_intersect_key( $items, array_flip($tpls) );
}
}