<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="./xsl/modx.prosilver.en.xsl"?>
<!-- 
	NOTICE: Please open this file in your web browser. If presented with a security warning, you may safely tell it to allow the blocked content.
-->
<!--For security purposes, please check: http://www.phpbb.com/mods/ for the latest version of this MOD. Although MODs are checked before being allowed in the MODs Database there is no guarantee that there are no security problems within the MOD. No support will be given for MODs not found within the MODs Database which can be found at http://www.phpbb.com/mods/-->
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.2.xsd">
	<header>
		<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
		<title lang="en">Prime Notify Add-on: User's Choice</title>
		<description lang="en">Adds an option allowing users choose whether or not they want the post's content included in the notification e-mail.</description>
	    <author-notes lang="en">This file provides instructions for adding an optional feature to the MOD. See the main install file for any additional information about the MOD.</author-notes>
		<author-group>
			<author>
				<realname>Ken F. Innes IV</realname>
				<email>primehalo@gmail.com</email>
				<username>primehalo</username>
				<homepage><![CDATA[http://www.absoluteanime.com/admin/mods.htm#notify]]></homepage>
			</author>
		</author-group>
		<mod-version>1.0.0</mod-version>
		<installation>
			<level>easy</level>
			<time>180</time>
			<target-version>3.0.2</target-version>
		</installation>
		<link-group>
			<link type="parent" href="../install.xml" lang="en">Main Install File</link>
			<link type="template" href="install user choice (subsilver2).xml" lang="en">subsilver2</link>
		</link-group>
	</header>
	<action-group>
		<copy>
			<file from="root/language/en/mods/prime_notify.php" to="language/en/mods/prime_notify.php" />
			<file from="root/styles/prosilver/template/prime_notify.html" to="styles/prosilver/template/prime_notify.html" />
		</copy>

		<sql><![CDATA[ALTER TABLE phpbb_users ADD user_notify_content tinyint(1) UNSIGNED DEFAULT 1 NOT NULL]]></sql>

		<open src="includes/prime_notify.php">
			<edit>
				<find><![CDATA[define('PRIME_NOTIFY_USER_CHOICE', false);]]></find>
				<action type="replace-with"><![CDATA[define('PRIME_NOTIFY_USER_CHOICE', true);]]></action>
			</edit>
		</open>
			
		<open src="includes/ucp/ucp_prefs.php">
			<edit>
				<find><![CDATA[				add_form_key('ucp_prefs_post');]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Notify ------------------------------------------------------//
				include ($phpbb_root_path . 'includes/prime_notify.' . $phpEx);
				$prime_notify->setup_ucp_prefs($data, $submit);
//-- end: Prime Notify ------------------------------------------------------//
]]></action>
			</edit>
			<edit>
				<find><![CDATA[							'user_notify'	=> $data['notify'],
						);]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Notify ------------------------------------------------------//
						$prime_notify->alter_ucp_prefs_sql($data, $sql_ary);
//-- end: Prime Notify ------------------------------------------------------//]]></action>
			</edit>
		</open>

		<open src="styles/prosilver/template/ucp_prefs_post.html">
			<edit>
				<find><![CDATA[	<dl>
		<dt><label for="notify1">{L_DEFAULT_NOTIFY}:</label></dt>
		<dd>
			<label for="notify1"><input type="radio" name="notify" id="notify1" value="1"<!-- IF S_NOTIFY --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> 
			<label for="notify0"><input type="radio" name="notify" id="notify0" value="0"<!-- IF not S_NOTIFY --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
		</dd>
	</dl>]]></find>
				<action type="after-add"><![CDATA[	<!-- INCLUDE prime_notify.html -->]]></action>
			</edit>
		</open>
	</action-group>
</mod>