<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
    <description>Describe your package here</description>
    <requirements>Describe your package requirements here</requirements>
    <faq>Currently there are no FAQ items provided.</faq>

	<name>squidguardrewrite</name>
	<version>none</version>
	<title>Proxy filter SquidGuard: Rewrites</title>
	<include_file>/usr/local/pkg/squidguard.inc</include_file>

	<tabs>
		<tab>
			<text>General settings</text>
			<url>/pkg_edit.php?xml=squidguard.xml&amp;id=0</url>
		</tab>
		<tab>
			<text>Default</text>
			<url>/pkg_edit.php?xml=squidguard_default.xml&amp;id=0</url>
		</tab>
		<tab>
			<text>ACL</text>
			<url>/pkg.php?xml=squidguard_acl.xml</url>
		</tab>
		<tab>
			<text>Destinations</text>
			<url>/pkg.php?xml=squidguard_dest.xml</url>
		</tab>
		<tab>
			<text>Times</text>
			<url>/pkg.php?xml=squidguard_time.xml</url>
		</tab>
		<tab>
			<text>Rewrites</text>
			<url>/pkg.php?xml=squidguard_rewr.xml</url>
			<active/>
		</tab>
		<tab>
			<text>Log</text>
			<url>/pkg_edit.php?xml=squidguard_log.xml</url>
		</tab>
	</tabs>

	<adddeleteeditpagefields>
		<columnitem>
			<fielddescr>Name</fielddescr>
			<fieldname>name</fieldname>
		</columnitem>
		<columnitem>
			<fielddescr>Description</fielddescr>
			<fieldname>description</fieldname>
		</columnitem>
	</adddeleteeditpagefields>

	<fields>
		<field>
			<fielddescr>Name</fielddescr>
			<fieldname>name</fieldname>
			<description>
                   Enter the unique name here.
                   Name must consist of minimum 2 symbols, first from which letter. &lt;br&gt;
                   All other symbols must be [a-Z_0-9].
			</description>
			<type>input</type>
			<required/>
			<size>100</size>
		</field>
		<field>
			<fielddescr>
				&lt;b&gt;Rewrite rule.&lt;/b&gt;&lt;br&gt;
				Define how url will be replaced.</fielddescr>
			<type>rowhelper</type>
			<rowhelper>
				<rowhelperfield>
					<fielddescr>Target URL or regular expression</fielddescr>
					<fieldname>targeturl</fieldname>
					<type>input</type>
					<size>45</size>
				</rowhelperfield>
				<rowhelperfield>
					<fielddescr>Replace to URL</fielddescr>
					<fieldname>replaceto</fieldname>
					<type>input</type>
					<size>45</size>
				</rowhelperfield>
				<rowhelperfield>
					<fielddescr>Opt.</fielddescr>
					<fieldname>mode</fieldname>
					<type>select</type>
                                  <value>no</value>
                                  <options>
                                      <option> <name>---------</name> <value>no</value> </option>
                                      <option> <name>no case  </name> <value>nocase</value> </option>
                                      <option> <name>redirect </name> <value>redirect</value> </option>
                                      <option> <name>no case + redirect</name> <value>nocase_redirect</value> </option>
                                  </options>
				</rowhelperfield>
<!--				<rowhelperfield>
					<fielddescr>Http 301</fielddescr>
					<fieldname>http301</fieldname>
					<type>checkbox</type>
				</rowhelperfield>
				<rowhelperfield>
					<fielddescr>Http 302</fielddescr>
					<fieldname>http302</fieldname>
					<type>checkbox</type>
				</rowhelperfield>
-->
			</rowhelper>
		</field>
		<field>
			<fielddescr>Enable log</fielddescr>
			<fieldname>enablelog</fieldname>
			<description>Check this for enable log.</description>
			<type>checkbox</type>
		</field>
		<field>
			<fielddescr>Description</fielddescr>
			<fieldname>description</fieldname>
			<description>You may enter a description here for your reference (not parsed).&lt;br&gt;
				&lt;b&gt; Note: &lt;/b&gt; &lt;br&gt;
				&lt;b&gt;Rewrite rule&lt;/b&gt; - define how url will are replaced.&lt;br&gt;
				&lt;b&gt;Target URL or regular expression&lt;/b&gt; - contains destination url or regular expression. Regular expression example: */cc32e46.exe &lt;br&gt;
				&lt;b&gt;Replace to&lt;/b&gt; - contains replacing url.
			</description>
			<type>input</type>
			<size>100</size>
		</field>
	</fields>

	<custom_php_after_form_command>
		squidGuard_print_javascript();
	</custom_php_after_form_command>
	<custom_php_validation_command>
		squidguard_validate_rewrite($_POST, &amp;$input_errors);
	</custom_php_validation_command>
	<custom_php_resync_config_command>
//		squidguard_resync_rewrite();
	</custom_php_resync_config_command>
</packagegui>