<?php /*

 ocPortal
 Copyright (c) ocProducts, 2004-2012

 See text/EN/licence.txt for full licencing information.


 NOTE TO PROGRAMMERS:
   Do not edit this file. If you need to make changes, save your changed file to the appropriate *_custom folder
   **** If you ignore this advice, then your website upgrades (e.g. for bug fixes) will likely kill your changes ****

*/

/**
 * @license		http://opensource.org/licenses/cpal_1.0 Common Public Attribution License
 * @copyright	ocProducts Ltd
 * @package		ocf_forum
 */

class Block_main_pt_notifications
{

	/**
	 * Standard modular info function.
	 *
	 * @return ?array	Map of module info (NULL: module is disabled).
	 */
	function info()
	{
		$info=array();
		$info['author']='Chris Graham';
		$info['organisation']='ocProducts';
		$info['hacked_by']=NULL;
		$info['hack_version']=NULL;
		$info['version']=2;
		$info['locked']=false;
		$info['parameters']=array();
		return $info;
	}

	/**
	 * Standard modular run function.
	 *
	 * @param  array		A map of parameters.
	 * @return tempcode	The result of execution.
	 */
	function run($map)
	{
		if (get_forum_type()!='ocf') return new ocp_tempcode();

		require_code('ocf_general');
		require_css('ocf');
		require_lang('ocf');

		if (!is_guest())
		{
			require_code('ocf_notifications');
			list($notifications,$num_unread_pps)=generate_notifications(get_member());
			if (!$notifications->is_empty())
			{
				require_javascript('javascript_ajax');
			}
		} else
		{
			$notifications=new ocp_tempcode();
			$num_unread_pps=0;
		}

		return do_template('BLOCK_MAIN_PT_NOTIFICATIONS',array('_GUID'=>'7606c3bf73f059ec5b194bc33d881763','NOTIFICATIONS'=>$notifications));
	}

}


