<?php defined('BLUDIT') or die('Bludit CMS.');

// ============================================================================
// Check role
// ============================================================================

checkRole(array('admin'));

// ============================================================================
// Main after POST
// ============================================================================

// ============================================================================
// POST Method
// ============================================================================
if ($_SERVER['REQUEST_METHOD'] == 'POST') {

	foreach ($_POST['key'] as $key=>$value) {
		$blocks->add(array(
			'title'=>$_POST['title'][$key],
			'value'=>$_POST['value'][$key],
			'key'=>$_POST['key'][$key]
		));
	}

	// Add to syslog
	$syslog->add(array(
		'dictionaryKey'=>'blocks-configured',
		'notes'=>''
	));
}

// ============================================================================
// Main after POST
// ============================================================================

// Title of the page
$layout['title'] .= ' - '.$L->g('Blocks');