Location: PHPKode > projects > Enigma > Enigma2/Enigma2_Install/Themes/classic_e1/portal/blocks/Blocks.template.php
<?php
// This file contains ALL template functions for the blocks TABLE DISPLAYS
// which CONTAIN the Block Contents.  If you want to edit the display of
// Block Contents, you will need to edit the template file in the blocks template
// directory if it exists.  If a template file doesn't exist, you can either, add
// one via step 4 in the blocks.txt file.
// There are 5 default functions for Left, Right, Top, Center and Bottom blocks.
// Setup the 5 default templates however you like.
// ****if you plan on using the New Submissions block type, be sure to edit
// template_Blocks_NewSubmissions below to match your other templates.

// if you would like to use a separate template for ANY individual (or multiple) blocks,
// create a new  function at the bottom of this file, using the guidelines below

// function name has to have "template_Blocks_" in it AND put $block between the parenthesis
// make sure to include global statement when needed (see the defaults for examples)
// when you want to display the block contents, use blockContents($block) with quotes and commas (see defaults for examples)

// PLEASE NOTE:  As mentioned above, the templates below are for the block TABLE display ONLY.
// If you want to edit a template for the block contents display of a builtin block, you will
// need to edit the corresponding template file in the Portal/Blocks template directory.


function template_Blocks_Left($block)
{
	global $settings;

	echo '
			<div class="tborder">
				<div class="blockhead" style="padding: 1px 1px 1px 1px;"><b>', $block['name'], '</b></div>
				<div class="leftbody" style="padding: 2px 2px 2px 2px;">
				', blockContents($block), '
				</div>
			</div><br />';
}

function template_Blocks_Right($block)
{
	global $settings;
	
	echo '
			<div class="tborder">
				<div class="blockhead" style="padding: 1px 1px 1px 1px;"><b>', $block['name'], '</b></div>
				<div class="rightbody" style="padding: 2px 2px 2px 2px;">
				', blockContents($block), '
				</div>
			</div><br />';

}

function template_Blocks_Top($block)
{
	echo '
			<div class="tborder">
				<div class="blockhead" style="padding: 1px 1px 1px 1px;"><b>', $block['name'], '</b></div>
				<div class="windowbg" style="padding: 2px 2px 2px 2px;">
				', blockContents($block), '
				</div>
			</div>
		<br />';
}

function template_Blocks_Center($block)
{
	echo '
			<div class="tborder">
				<div class="blockhead" style="padding: 1px 1px 1px 1px;"><b>', $block['name'], '</b></div>
				<div class="windowbg" style="padding: 2px 2px 2px 2px;">
				', blockContents($block), '
				</div>
			</div>
		<br />';
}

function template_Blocks_Bottom($block)
{
	echo '
			<div class="tborder">
				<div class="blockhead" style="padding: 1px 1px 1px 1px;"><b>', $block['name'], '</b></div>
				<div class="windowbg" style="padding: 2px 2px 2px 2px;">
				', blockContents($block), '
				</div>
			</div>
		<br />';
}

// ##########################################################
// start individual custom templates

function template_Blocks_EnigmaMenu($block)
{
	echo '
			<div class="tborder" style="padding: 2px 2px 2px 2px;">
				', blockContents($block), '
			</div>
		<br />';

}

// **** Note: the below block template IS REQUIRED, feel free to modify it, but it is needed
//			if you enable the New Submissions block.
// We are using a custom block template for the submissions block to make sure users that
// don't have reviewing rights don't see the block and if the option in Portal Settings
// is not selected,  reviewers won't see the either unless there are new submissions
// Note:  the if statement may seem complicated, but is necessary for nothing to be displayed under
// the right conditions
function template_Blocks_newSubmissions($block)
{	// make sure we have all the globals needed
	global $context, $modSettings, $settings;
	// the submissions block creates 1 of 2 $context array variables, so we just need to call the contents function first
	// $context['newSubs'] will ONLY have a listing of submissions IF they exist
	// $context[noNewSubs'] will ONLY have a message telling you IF there AREN'T any new submissions
	// so in the echo statement below, we enter both variables since ONLY 1 will actually display something at a time
	blockContents($block);
	// if (there are new submissions OR always show submissions block) AND (the user is allowed to review news OR links OR articles)
	if ((isset($context['newSubs']) || $modSettings['showsubmissions']) && (allowedTo('review_news') || allowedTo('review_link')  || allowedTo('review_articles')))
	{ // then we actually need to display something
			echo '
			<div class="tborder">
				<div class="rightbody" style="padding: 2px 2px 2px 2px;">
				', $context['newSubs'], $context['noNewSubs'],'
				</div>
			</div>
		<img src="', $settings['images_url'], '/leftshadow.gif" alt="" />';
	}
}
?>
Return current item: Enigma