Assuming its MachForms 2, to integrate into the manager, you need to do the following:
1) Install normally.
I suggest in /manager/MachForm
Thats what I will be using in the code below. If you decide to place it elsewhere, you need to change all occurences below to your choice of path.
Make sure its working fine first.
2) Make a new Module in Modx
In Manager - Modules-> Manage Modules -> New Module
Call it Form Editor or similar
Content of form editor is
include_once $modx->config[’base_path’] . "manager/MachForms/index.php";
Save it.
3) As we will be using Modx for the form manager, we will be using Modx for login.
So, backup the existing /manager/MachForm/index.php to index.php.original
Make a new index.php in /manager/MachForm with the following:
<?php
//AppNitro Modx Integration for Login
//
//Changes 20 Sep 08.
//(Modified index.php slightly because Manager check didn't work properly 100% of the time. Now use $_SESSION[mgrValidated] instead...)
//Changes 19 Dec 09.
// (Re-added check if user is in manager or not)
session_start();
require('config.php');
require('includes/db-core.php');
require('includes/db-functions.php');
require('includes/helper-functions.php');
$path_to_folder='/manager/MachForms';
$ssl_suffix = get_ssl_suffix();
if(file_exists("installer.php")){
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].$path_to_folder."/installer.php");
exit;
}
//Are we running this from the MODx Manager?
if (!empty($_SESSION['mgrValidated']) && $_SESSION['mgrValidated'] == false) {
echo "Sorry, this file can only be run from the MODx Manager";
exit;
}
if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the MODx Content Manager instead of accessing this file directly.");
//We're in the manager, so force login
$_SESSION['logged_in'] = true;
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].$path_to_folder."/manage_form.php");
exit; //Just in case(tm)
?>
Now you can use the Form Editor as a Module.
Optional things to do:
On a MacBook the default height is a little tight, so edit index.css
Change #header[id] to 36
eg:
#header[id] {
height: 36px; }
In includes/header.php, remove the line including the AppNitro logo
eg
Line 26 comment out as follows:
<!-- <img src="images/appnitro_logo.png" class="fix_png" id="appnitro_logo" width="179" height="55"/> -->
To use a form in Modx natively, you open an existing form
Click Embed, Advanced.
Select and Copy the php code.
Then In the manager, click Resources -> Manage Resources
Click Snippet
New Snippet
Name the snippet in a suitable manner
Paste in the php code.
Save.
Call your form from a document in the usual manner.
eg
[[SnippetName]]
Easy as pie.
Lawrence.