We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6444
    • 6 Posts
    MachForm..... rolleyes

    Guys, i was thinking....yeah i know..... lipsrsealed

    Check out the application at http://www.appnitro.com its a formgenerator and i think its nice to put in modx.

    Now its like this, i sure as hell dont know how to intergate it in modx, the application will generate a iframe in html.
    I can put the iframe code in the html of mij content, but that i dont want.... >:(
    I want it to be a module in modx or a snippet...so i can call it wit a snippet, chunk, or plugin code.

    For the ones who can help me i will send up a copy of the script so u can check out the files and stuff... wink

    Is there anybody who wants to help me out with this project? i am kinda new in modx and desperat to learn it.

    For those who will respond thanks in advance!!!

    Greetings,

    Dani
    The Netherlands


      • 6444
      • 6 Posts
      No worries, i got it implanted in de module from modx, so now u can edit the form from your manager modules smiley:)
      It will write the chunks en place them were u want it smiley

      If u want to know how, give me a pm

      Dani
      The Netherlands laugh
        • 4749
        • 623 Posts
        Why don’t you just post how you did it? That would be great! grin
          The MODx has you...
          Utah Web Design
          • 5948
          • 32 Posts
          If you have been able to put this into MODx could you please post the code. I want to see a GUI for a form builder put into the next major release of MODx and this looks good.
            • 5699
            • 46 Posts
            computersolutions.cn Reply #5, 15 years, 7 months ago
            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.
              • 7231
              • 4,205 Posts
              That is a great tutorial (deserves a place in the wiki). That looks like it could be a very cool module for forms. wink
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don&#39;t know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 5699
                • 46 Posts
                computersolutions.cn Reply #7, 15 years, 7 months ago
                Hmm, the IN_MANAGER stuff check doesn’t seem to work.
                Would prefer that it worked so random people don’t access via other methods!

                $_SESSION[’mgrValidated’] doesn’t work either.


                Idea’s?

                Have tried calling before any other code calls, and before session_start.
                  • 6726
                  • 7,075 Posts
                  Interresting topic... been looking at MachForm and if it can integrate well this could be a powerful tool to build complex forms easy, and even allow clients to do so...
                    .: COO - Commerce Guys - Community Driven Innovation :.


                    MODx est l&#39;outil id
                    • 32142
                    • 19 Posts
                    Quote from: dev_cw at Sep 19, 2008, 10:54 AM

                    That is a great tutorial (deserves a place in the wiki). That looks like it could be a very cool module for forms. wink

                    Has anyone by any chance gotten this script to work. I have made several attempts and followed the instructions line by line.
                    Alas and unfortunately i get only the 404 error code. Document can not be found.

                    Any ideas or pointers will be very helpful..:)
                    • Worked perfectly for me. I used a different path forms/ in the same level as assets and manager but other than that I followed the instructions exactly.

                      It would be great if we had a method of generating the snippet automatically as mentioned above but this is much nicer and user friendly, nonetheless, then using eForm.
                      Now if it supported multiple pages it would be a godsend.