<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
	<id>fustrate:whiteboard</id>
	<version>1.0</version>

	<file name="$boarddir/index.php">
		<operation>
			<search position="before"><![CDATA[
		'viewsmfile' => array('Admin.php', 'DisplayAdminFile'),]]></search>
			<add><![CDATA[
		'whiteboard' => array('Whiteboard.php', 'Whiteboard'),]]></add>
		</operation>
	</file>

	<file name="$sourcedir/ManagePermissions.php">
		<operation>
			<search position="before"><![CDATA[
		'karma_edit',]]></search>
			<add><![CDATA[
		'use_whiteboard',]]></add>
		</operation>

		<operation>
			<search position="before"><![CDATA[
			'manage_bans' => array(false, 'member_admin', 'administrate'),]]></search>
			<add><![CDATA[
			'use_whiteboard' => array(false, 'general', 'view_basic_info'),]]></add>
		</operation>

		<operation>
			<search position="before"><![CDATA[
		'manage_smileys',]]></search>
			<add><![CDATA[
		'use_whiteboard',]]></add>
		</operation>
	</file>

	<file name="$sourcedir/Subs.php">
		<operation>
			<search position="before"><![CDATA[
	$context['allow_pm'] = allowedTo('pm_read');]]></search>
			<add><![CDATA[
	$context['allow_use_whiteboard'] = allowedTo('use_whiteboard');]]></add>
		</operation>

		<operation>
			<search position="after"><![CDATA[
			'mlist' => array(]]></search>
			<add><![CDATA[
			'whiteboard' => array(
				'title' => $txt['whiteboard'],
				'href' => $scripturl . '?action=whiteboard',
				'show' => $context['allow_pm'],
				'sub_buttons' => array(
					'main' => array(
						'title' => $txt['wb_main'],
						'href' => $scripturl . '?action=whiteboard',
						'show' => true,
					),
					'archive' => array(
						'title' => $txt['wb_archive'],
						'href' => $scripturl . '?action=whiteboard;sa=archive',
						'show' => true,
					),
					'write' => array(
						'title' => $txt['wb_write'],
						'href' => $scripturl . '?action=whiteboard;sa=write',
						'show' => true,
					),
				),
			),]]></add>
		</operation>
	</file>

	<file name="$sourcedir/Who.php">
		<operation>
			<search position="before"><![CDATA[
		'viewmembers' => array('moderate_forum'),]]></search>
			<add><![CDATA[
		'whiteboard' => array('use_whiteboard'),]]></add>
		</operation>
	</file>

	<file name="$languagedir/Modifications.english.php">
		<operation>
			<search position="end" />
			<add><![CDATA[
// Whiteboard
$txt['wb_main'] = 'Main';
$txt['wb_archive'] = 'Archive';
$txt['wb_write'] = 'Write';
$txt['whiteboard'] = 'Whiteboard';
$txt['permissionname_use_whiteboard'] = 'Use Whiteboard';
$txt['permissionhelp_use_whiteboard'] = 'This will allow users add entries to the whiteboard.';
$txt['wb_learn_to_count'] = 'The note ID needs to be a number!';
$txt['wb_doesnt_exist'] = 'No note with that ID exists.';
$txt['wb_not_allowed'] = 'Either you don\'t own this note, or you\'re not an administrator.';
$txt['wb_empty_titlenote'] = 'You have to enter a title and a note!';
$txt['cannot_use_whiteboard'] = 'You aren\'t allowed to manage awards.';]]></add>
		</operation>
	</file>

	<file name="$languagedir/Modifications.english-utf8.php" error="skip">
		<operation>
			<search position="end" />
			<add><![CDATA[
// Whiteboard
$txt['wb_main'] = 'Main';
$txt['wb_archive'] = 'Archive';
$txt['wb_write'] = 'Write';
$txt['whiteboard'] = 'Whiteboard';
$txt['permissionname_use_whiteboard'] = 'Use Whiteboard';
$txt['permissionhelp_use_whiteboard'] = 'This will allow users add entries to the whiteboard.';
$txt['wb_learn_to_count'] = 'The note ID needs to be a number!';
$txt['wb_doesnt_exist'] = 'No note with that ID exists.';
$txt['wb_not_allowed'] = 'Either you don\'t own this note, or you\'re not an administrator.';
$txt['wb_empty_titlenote'] = 'You have to enter a title and a note!';
$txt['cannot_use_whiteboard'] = 'You aren\'t allowed to manage awards.';]]></add>
		</operation>
	</file>

</modification>
