<!DOCTYPE GenieGate [                                                                                          
        <!ENTITY dir "GenieGate/views/admin">                                                                               
]>

<GenieGate>
<!--
$Id: admin.xml,v 1.4 2008/10/30 10:56:51 joe Exp $

This sets the initial views for the administration app. 

Changing a view here will not change it in the application until the setup 
utility is run. If you are trying to change the view, you will need to
run setup for the changes to take effect. 

This is now used exclusively by the setup procedure, as scanning an XML document
was a little too slow. Those familiar with Apache Struts will recognize the format
of this document immediately, it is much the same except we have Param elements
and some attributes specific to PHP.

Basically, we have action elements, these correspond to the method names within
the controller class. (method=do_method_name)

In each action, we have one or more forward elements. The forward contains
a name and optionally a class and require attribute. (class and require are for
custom view implementations)

Within each action element, one or more Param elements are present, these are the
parameters passed into the views constructor at instantiation time. The view
implementation would make these available with param() (though, not always)

A Param element contains a name and a value. To avoid name-space collision problems,
we use param.name.conventions (with dots) this is because, the controller must ALSO
set parameters and two classifications of parameters would be overkill.

The default implementing view is based on PHP, it uses an inc.file parameter to determine
what PHP document to display.

The point of all this madness is... with this system, we can re-use the same file over
and over while still providing the option of customization at a later time, for example,
if you wanted a custom error page that was ONLY shown in one of the actions, you might
configure it here. 

Also, it enables us to use one common message.php for all the different messages by simply
changing the parameters for the text to be displayed.

DATABASE TABLES:

The database tables: cfg_vwpath and cfg_vwparam are responsible for actually storing
the view settings. Here is how they are set up:

cfg_vwpath: vid,ap,vn,classname,classfile

Where ap is the application ID, vn is the view name, vid is a number, keyed into cfg_vwparam
for parameter lookup and classname,classfile are the PHP class and file to be used. (if
null, a default will be used)

The vn in the database is stored as action/name or (in the case of global) just /name,
if action/name does not exist, then /name will be attempted.

cfg_vwparam: pid,vid,pname,pvalue

pid - The parameter ID (numeric)
vid - The view ID, (from cfg_vwpath)
pname - The parameter name
pvalue - The parameter value.


-->
<global-forwards>
	<forward name="login">
		<Param name="inc.file" value="&dir;/login.php" />
	</forward>
	<forward name="error">
		<Param name="inc.file" value="&dir;/error-general.php" />
	</forward>
	<forward name="message">
		<Param name="inc.file" value="&dir;/message.php" />
	</forward>
</global-forwards>

<action method="default_index">
	<forward name="ok">
		<Param name="inc.file" value="&dir;/main.php" />
	</forward>
</action>
<action method="do_logout">
	<forward name="ok">
		<Param name="opt.nopassthru" value="1" />
		<Param name="inc.file" value="&dir;/login.php" />
	</forward>
</action>

<action method="do_general_search">
	<forward name="ok">
		<Param name="inc.file" value="&dir;/search_result.php" />
	</forward>
	<!-- Next/Previous page -->
	<forward name="page">
		<Param name="inc.file" value="&dir;/ajax/list-query.php" />
	</forward>
</action>

<action method="do_lookup_uid">
	<forward name="ok">
		<Param name="inc.file" value="&dir;/user-edit.php" />
	</forward>
	<forward name="error-no-user">
		<Param name="inc.file" value="&dir;/error-general.php" />
		<Param name="txt.message" value="No such user" />
	</forward>
</action>

<action method="do_update_user">
	<forward name="ok">
		<Param name="inc.file" value="&dir;/message.php" />
	</forward>
</action>

<action method="do_update_group">
	<forward name="map">
		<Param name="inc.file" value="&dir;/ajax/map.php" />
	</forward>
</action>

<action method="do_delete_group">
	<forward name="error-special-group">
		<Param name="txt.message" value="Cannot remove this group" />
	</forward>
	<forward name="error-no-gid">
		<Param name="txt.message" value="Missing GID parameter" />
	</forward>
	<forward name="ok">
		<Param name="inc.file" value="&dir;/ajax/map.php" />
	</forward>
</action>



<action method="do_create_user">
	<forward name="ok">
		<Param name="inc.file" value="&dir;/message.php" />
	</forward>
	<!--
		If you want a custom error screen.. 
		<forward name="error"></forward>
	-->
</action>

<action method="do_vcard">
	<forward name="ok" class="GenieGate_View_VCard" require="GenieGate/View/VCard.php" />
</action>
<action method="do_expunge">
	<forward name="ok">
		<Param name="inc.file" value="&dir;/ajax/message.php" />
		<Param name="txt.message" value="Expire / Expunge procedure completed" />
	</forward>
</action>


<action method="do_show_create_screen">
	<forward name="ok">
		<Param name="inc.file" value="&dir;/user-edit.php" />
	</forward>
</action>

<action method="do_group_main">
	<forward name="ok">
		<Param name="inc.file" value="&dir;/group-main.php" />
	</forward>
</action>

<action method="do_import_xml">
	<forward name="import-complete">
			<Param name="inc.file"  value="&dir;/import-complete.php" />
	</forward>
</action>

<action method="do_get_gid_members">
	<forward name="error-no-gid">
		<Param name="inc.file" value="&dir;/general-error.php" />
		<Param name="txt.message" value="Invalid GID" />
	</forward>
	<!-- Next/Previous page -->
	<forward name="page">
		<Param name="inc.file" value="&dir;/ajax/list-query.php" />
	</forward>
</action>

<action method="do_setup_menu">
	<forward name="ok">
			<Param name="inc.file"  value="&dir;/config.php" />
	</forward>
</action>
<action method="do_property_main">
	<forward name="ok">
		<Param name="inc.file" value="&dir;/prop-main.php" />
	</forward>
</action>
<action method="do_alter_properties">
	<forward name="ok-modify">
		<Param name="inc.file" value="&dir;/message.php" />
		<Param name="txt.message" value="Properties altered" />
		<Param name="txt.subtitle" value="Properties" />
	</forward>
	<forward name="ok-create">
		<Param name="inc.file" value="&dir;/message.php" />
		<Param name="txt.message" value="Property Created" />
		<Param name="txt.subtitle" value="Properties" />
	</forward>
	<forward name="error-create">
		<Param name="inc.file" value="&dir;/error-general.php" />
	</forward>
	<forward name="get-remove">
		<Param name="inc.file" value="&dir;/prop-del-warning.php" />
	</forward>
	<forward name="post-remove">
		<Param name="inc.file" value="&dir;/message.php" />
		<Param name="txt.subtitle" value="Properties" />
		<Param name="txt.message" value="Property removed (from ALL users)" />
	</forward>
</action>

<action method="do_import_export">
	<forward name="main">
		<Param name="inc.file" value="&dir;/export-menu.php" />
	</forward>

	<!-- 
		With export, the view does the heavy lifting because we need to send a potentially
		large amount of data to the browser, however, it still follows the view model. 
	-->		
	<forward name="export-tab" class="GenieGate_View_FlatFile" require="GenieGate/View/FlatFile.php">
		<Param name="output.format" value="TAB" />
	</forward>
	<forward name="export-group" class="GenieGate_View_FlatFile" require="GenieGate/View/FlatFile.php">
		<Param name="output.format" value="GROUP" />
	</forward>
	<forward name="export-passwd" class="GenieGate_View_FlatFile" require="GenieGate/View/FlatFile.php">
		<Param name="output.format" value="PASSWD" />
	</forward>
	<forward name="export-expires" class="GenieGate_View_FlatFile" require="GenieGate/View/FlatFile.php">
		<Param name="output.format" value="EXPIRE_SOON" />
	</forward>
	<forward name="export-vcard" class="GenieGate_View_VCard" require="GenieGate/View/VCard.php">
		<Param name="output.format" value="VCARD" />
	</forward>
	<!-- For XML exporting -->
	<forward name="export-xml" class="GenieGate_View_XMLExport" require="GenieGate/View/XMLExport.php" />

	<!-- This is called when POST -->
	<forward name="ok-import">
		<Param name="inc.file" value="&dir;/import-complete.php" />
	</forward>
	<forward name="error-import-xml">
		<Param name="inc.file" value="&dir;/error-import.php" />	
	</forward>

</action>
<action method="do_help">
	<forward name="ok">
		<Param name="inc.file" value="&dir;/show_about.php" />
	</forward>
</action>
<action method="do_paypal_main">
	<forward name="ok-main">
		<Param name="inc.file" value="&dir;/paypal_main.php" />
	</forward>
	<forward name="ok-settings">
		<Param name="inc.file" value="&dir;/message.php" />
		<Param name="txt.subtitle" value="Paypal Status" />
		<Param name="txt.message" value="Updated settings" />
	</forward>
	<forward name="ok-update">
		<Param name="inc.file" value="&dir;/message.php" />
		<Param name="txt.subtitle" value="Paypal Status" />
		<Param name="txt.message" value="Updated item" />
	</forward>
	<forward name="ok-remove">
		<Param name="inc.file" value="&dir;/message.php" />
		<Param name="txt.subtitle" value="Paypal Status" />
		<Param name="txt.message" value="Paypal item removed." />
	</forward>
	<forward name="error-get">
		<Param name="txt.message" 	value="This function requires an access group to be defined." />
		<Param name="inc.file" 		value="&dir;/error-general.php" />
	</forward>
	<forward name="error-update">
		<Param name="inc.file" value="&dir;/error-general.php" />
	</forward>
	
</action>

<action method="do_plugin">
	<forward name="logger">
		<Param name="inc.file" value="&dir;/plugin-logger.php" />
	</forward>
	<forward name="ok-logger">
		<Param name="inc.file" value="&dir;/message.php" />
		<Param name="txt.message" value="Logger settings saved" />
		<Param name="txt.subtitle" value="Plugins" />
	</forward>
	<forward name="apache">
		<Param name="inc.file" value="&dir;/plugin-apache.php" />
	</forward>
	<forward name="ok-apache">
		<Param name="inc.file" value="&dir;/message.php" />
		<Param name="txt.message" value="Apache plugin settings saved" />
		<Param name="txt.subtitle" value="Plugins" />
	</forward>
	<forward name="apachedbm">
		<Param name="inc.file" value="&dir;/plugin-apachedbm.php" />
	</forward>
	<forward name="ok-apachedbm">
		<Param name="inc.file" value="&dir;/message.php" />
		<Param name="txt.message" value="ApacheDBM plugin settings saved" />
		<Param name="txt.subtitle" value="Plugins" />
	</forward>
</action>

<action method="do_email_txt">
	<forward name="pass_remind">
		<Param name="txt.name" value="Remind Password" />
		<Param name="inc.file" value="&dir;/edit-mail-view.php" />
	</forward>
	<forward name="confirm">
		<Param name="txt.name" value="Confirmation" />
		<Param name="inc.file" value="&dir;/edit-mail-view.php" />
	</forward>
	<forward name="confirm_remind">
		<Param name="txt.name" value="Resend Confirmation Code" />
		<Param name="inc.file" value="&dir;/edit-mail-view.php" />
	</forward>
	<forward name="error-id">
		<Param name="inc.file" value="&dir;/error-general.php" />
		<Param name="txt.message" value="Invalid ID" />
	</forward>
	<forward name="ok">
		<Param name="inc.file" value="&dir;/message.php" />
		<Param name="txt.message" value="Settings have been applied" />
		<Param name="txt.subtitle" value="Email Message" />
	</forward>
</action>

<action method="do_config_param">
	<forward name="error-id">
		<Param name="inc.file" value="&dir;/error-general.php" />
		<Param name="txt.message" value="Invalid ID" />
	</forward>
	<forward name="edit-Url">
		<Param name="inc.file" value="&dir;/edit-url-conf.php" />
	</forward>
	<forward name="edit-Login">
		<Param name="inc.file" value="&dir;/edit-login-conf.php" />
	</forward>
	<forward name="ok">
		<Param name="inc.file" value="&dir;/message.php" />
		<Param name="txt.message" value="Changes have been applied" />
		<Param name="txt.subtitle" value="Configuration" />
	</forward>
</action>

<action method="do_generate_ex">
	<forward name="error-bad-id">
		<Param name="inc.file" value="&dir;/error-general.php" />
		<Param name="txt.message" value="Invalid ID type." />
	</forward>
	<forward name="htaccess">
		<Param name="inc.file" value="&dir;/htaccess-gen.php" />
	</forward>
	<forward name="error-no-apache-plugin">
		<Param name="inc.file" value="&dir;/error-general.php" />
		<Param name="txt.message" value="You need to enable Apache Plugins to use this feature." />
	</forward>
	<forward name="php-login">
		<Param name="inc.file" value="&dir;/php-gen.php" />
	</forward>
</action>
<action method="do_sync_userinfo">
	<forward name="ok">
		<Param name="txt.message">
		Synchronized plugins. (Group/User files)
		</Param>
		<Param name="inc.file" value="&dir;/message.php" />
	</forward>
</action>
</GenieGate>
