Пример #1
0
	function d3download_submenu( $mydirname, $submenu_option )
	{
		include_once dirname( dirname(__FILE__) ).'/class/user_access.php' ;

		$module_handler =& xoops_gethandler('module');
		$config_handler =& xoops_gethandler('config');
		$module =& $module_handler->getByDirname( $mydirname );
		$mod_config =& $config_handler->getConfigsByCat( 0, $module->getVar( 'mid' ) );

		$user_access = new user_access( $mydirname ) ;
		$whr = "cid IN (".implode(",", $user_access->can_read() ).")" ;
		$constpref = '_MI_' . strtoupper( $mydirname ) ;

		$submenu = array( 0 => array( 'name' => '' , 'url' => '' , 'sub' => array() ) ) ;

		if( d3download_submenu_option( $submenu_option, 'categories' ) ){
			$submenu = array_merge( $submenu, d3download_get_categories_for_submenu( $mydirname, $whr ) ) ;
		}

		if( ! empty( $mod_config['show_mypost'] ) ){
			$submitter = d3download_is_submitter( $mydirname, $whr ) ;
			if( ! empty( $submitter ) ) {
				$submenu['sub'][] = array(
					'name' => constant( $constpref.'_MYPOST_VIEW' ) ,
					'url' => 'index.php?submitter='.$submitter ,
				);
			}
		}

		if( d3download_submenu_option( $submenu_option, 'mylink' ) && d3download_total_mylink( $mydirname, 0, $whr ) ){
			$submenu['sub'][] = array(
				'name' => constant( $constpref.'_MYLINK' ) ,
				'url' => 'index.php?page=mylink' ,
			);
		}

		if( ! empty( $submenu['sub'] ) ) return $submenu['sub'];
		else return '';
	}
Пример #2
0
	}
}

if( d3download_submenu_option( $submenu_option, 'topten_hit' ) ){
	$modversion['sub'][$i]['name'] = constant($constpref.'_SMNAME1');
	$modversion['sub'][$i]['url']  = 'index.php?page=topten&hit=1';
	$i++;
}

if( d3download_submenu_option( $submenu_option, 'topten_rate' ) ){
	$modversion['sub'][$i]['name'] = constant($constpref.'_SMNAME2');
	$modversion['sub'][$i]['url']  = 'index.php?page=topten&rate=1';
	$i++;
}

if( d3download_submenu_option( $submenu_option, 'filelist' ) ){
	$modversion['sub'][$i]['name'] = constant($constpref.'_SMNAME3');
	$modversion['sub'][$i]['url']  = 'index.php?page=filelist';
}

// All Templates can't be touched by modulesadmin.
$modversion['templates'] = array() ;

// Blocks
$modversion['blocks'] = array() ;
$modversion['blocks'][1] = array(
	'file'			=> 'blocks.php' ,
	'name'			=> constant($constpref.'_BNAME_RECENT') ,
	'description'	=> '' ,
	'show_func'		=> 'b_d3downloads_recent_show' ,
	'edit_func'		=> 'b_d3downloads_recent_edit' ,