<?php
if (isset($tpl['status']))
{
	$status = __('status', true);
	switch ($tpl['status'])
	{
		case 2:
			pjUtil::printNotice(NULL, $status[2]);
			break;
	}
} else {
	if (isset($_GET['err']))
	{
		$titles = __('error_titles', true);
		$bodies = __('error_bodies', true);
		pjUtil::printNotice(@$titles[$_GET['err']], @$bodies[$_GET['err']]);
	}
	
	$notification_types = __('notification_types', true);
		
	?>
	<?php 
	include_once PJ_VIEWS_PATH . 'pjLayouts/elements/optmenu.php';
	pjUtil::printNotice(__('infoNotificationsTitle', true, false), __('infoNotificationsDesc', true, false)); 
	?>
	<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
		<input type="hidden" name="controller" value="pjAdminNotifications" />
		<input type="hidden" name="action" value="pjActionCreate" />
		<input type="submit" class="pj-button" value="<?php __('btnAddNotification'); ?>" />
		<p>&nbsp;</p>
	</form>
	
	<div id="grid"></div>
	<script type="text/javascript">
	var myLabel = myLabel || {};
	myLabel.subject = "<?php __('lblSubject'); ?>";
	myLabel.type = "<?php __('lblType'); ?>";
	myLabel.NewClient = "<?php echo $notification_types['NewClient']; ?>";
	myLabel.NewTicket = "<?php echo $notification_types['NewTicket']; ?>";
	myLabel.NewClientReply = "<?php echo $notification_types['NewClientReply']; ?>";
	myLabel.NewSupportReply = "<?php echo $notification_types['NewSupportReply']; ?>";
	myLabel.AccountActivation = "<?php echo $notification_types['AccountActivation']; ?>";
	myLabel.delete_confirmation = "<?php echo pjSanitize::clean(__('lblDeleteConfirmation', true)); ?>";
	myLabel.delete_selected = "<?php echo pjSanitize::clean(__('lblDeleteSelected', true)); ?>";
	</script>
	<?php
}
?>