MBS FileMaker Plugin Example Databases

Simple_php

All examples are included with download of MBS FileMaker Plugin.

Simple_php.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts4
Value Lists0
Custom Functions2
Custom Menus31
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenScript: startup
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
Simple_php
4 fields defined, 24 records
Simple_php

Fields

Table Name: Simple_php - 4 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
scriptNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: Minimal
  • Automatically create indexes as needed
  • Index Language: English
      resultNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: English
          notesNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: English
                Path to DLLNormal, TextAuto-Enter:
                • Allow editing
                Validation:
                • Only during data entry
                Storage:
                • Global
                • Repetitions: 1
                • Index Language: English

                    Layout Objects: Simple_php

                    Regular Fields

                    Field Name: Simple_php::script
                    Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                    • Top: 89 pt
                    • Left: 0 pt
                    • Bottom: 444 pt
                    • Right: 421 pt
                    • Anchoring: Left, Top and Bottom
                    Field Format:
                    • Edit Box
                    Field Behavior:
                    • Allow field to be entered: In Find mode, In Browse mode
                    • Touch keyboard type: System Default
                    • Go to next field using: Tab key
                    Yes

                    Field Name: Simple_php::notes
                    Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                    • Top: 89 pt
                    • Left: 426 pt
                    • Bottom: 256 pt
                    • Right: 679 pt
                    • Anchoring: Left and Right, Top
                    Field Format:
                    • Edit Box
                    • Include vertical scrollbar
                    Field Behavior:
                    • Allow field to be entered: In Find mode, In Browse mode
                    • Touch keyboard type: System Default
                    • Go to next field using: Tab key
                    Yes

                    Field Name: Simple_php::Path to DLL
                    Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                    • Top: 12 pt
                    • Left: 325 pt
                    • Bottom: 50 pt
                    • Right: 662 pt
                    • Anchoring: Left, Top
                    Field Format:
                    • Edit Box
                    Field Behavior:
                    • Allow field to be entered: In Find mode, In Browse mode
                    • Touch keyboard type: System Default
                    • Go to next field using: Tab key
                    No

                    Field Name: Simple_php::result
                    Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                    • Top: 282 pt
                    • Left: 426 pt
                    • Bottom: 445 pt
                    • Right: 679 pt
                    • Anchoring: Left and Right, Top and Bottom
                    Field Format:
                    • Edit Box
                    • Include vertical scrollbar
                    Field Behavior:
                    • Allow field to be entered: In Find mode, In Browse mode
                    • Touch keyboard type: System Default
                    • Go to next field using: Tab key
                    Yes

                    Group Buttons

                    Button PropertiesCoordinatesScript/Script Step
                      Type:
                    • Text: Execute
                      Additional Properties:
                    • Change to hand cursor over button
                    • Rectangular
                    • Top: 61 pt
                    • Left: 324 pt
                    • Bottom: 86 pt
                    • Right: 421 pt
                    • Anchoring: Left, Top
                    Perform Script [ “Run PHP” ]

                    Scripts:


                    Button PropertiesCoordinatesScript/Script Step
                      Type:
                    • Text: Start Up PHP
                      Additional Properties:
                    • Change to hand cursor over button
                    • Rectangular
                    • Top: 16 pt
                    • Left: 138 pt
                    • Bottom: 41 pt
                    • Right: 235 pt
                    • Anchoring: Left, Top
                    Perform Script [ “Startup PHP” ]

                    Scripts:


                    Button PropertiesCoordinatesScript/Script Step
                      Type:
                    • Text: Open php Manual
                      Additional Properties:
                    • Rounded
                    • Top: 450 pt
                    • Left: 511 pt
                    • Bottom: 481 pt
                    • Right: 674 pt
                    • Anchoring: Right, Bottom
                    Open URL [ "http://www.php.net/docs.php" ] [ No dialog ]

                    Tab Controls

                    Tab Control PropertiesCoordinates
                      Justification:
                    • Right
                      Tab Width:
                    • Label Width
                      Default Front Tab:
                    • Tab 0
                    • Top: 262 pt
                    • Left: 426 pt
                    • Bottom: 445 pt
                    • Right: 679 pt
                    • Anchoring: Left and Right, Top and Bottom
                    Tabs
                    Tab PropertiesTab ControlsSlide ControlsFieldsButtonsPortalsWeb Viewer ControlsCharts
                      Tab 0:
                    • "As Text"
                      Object Name:
                    • text
                        Field Objects
                          Tab 1:
                        • "As WebPage"
                          Object Name:
                        • html
                            1 Web Viewer Controls

                            Web Viewer Controls

                            Web Viewer Control PropertiesCoordinatesWeb Address
                              Additional Properties:
                            • Allow interaction with web viewer content
                            • Display progress bar
                            • Display status messages
                            • Automatically encode URL
                            • Top: 282 pt
                            • Left: 426 pt
                            • Bottom: 445 pt
                            • Right: 679 pt
                            • Anchoring: Left and Right, Top and Bottom
                            "data:text/html, " &Simple_php::result

                            Web Viewer Control PropertiesCoordinatesWeb Address
                              Additional Properties:
                            • Automatically encode URL
                            • Top: 444 pt
                            • Left: 0 pt
                            • Bottom: 487 pt
                            • Right: 157 pt
                            • Anchoring: Left, Bottom
                            "data:text/html, " & "<html> <head> <style type='text/css'> body { font-family: verdana; text-align: left; font-size: 8pt; margin: no; } </style> MBS Plugin Version: <br><b>"& MBS("Version") &"</b> </head> </html> "

                            Script Hierarchy

                            Run PHP
                            Kill
                            Startup PHP
                            startup

                            Next Script: [Kill]
                            Script NameRun PHP
                            Run script with full access privilegesOff
                            Include In MenuNo
                            Layouts that use this script
                            Scripts that use this script
                              Script Definition
                              Script Steps
                              • #execute the code and run the script
                              • Set Variable [ $result; Value:MBS("PHP.Run";(Simple_php::script)) ]
                              • // Show Custom Dialog [ Title: "test"; Message: $result; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                              • Set Field [ Simple_php::result; MBS("PHP.GetResultString") ]
                              • #this section just determines if the results should be diplayed as text or as a web page
                              • If [ Let( [ result = Simple_php::result; startTag = PatternCount(result; "<html>"); endtag = PatternCount(result; "</html>") ]; startTag = 1 //and endtag = 1 ) ]
                              • Go to Object [ Object Name: "html" ]
                              • Else
                              • Go to Object [ Object Name: "text" ]
                              • End If
                              Fields used in this script
                              Scripts used in this script
                                Layouts used in this script
                                  Tables used in this script
                                  Table occurrences used by this script
                                  Custom Functions used by this script
                                    Custom menu set used by this script

                                      Previous Script: [Run PHP]Next Script: [Startup PHP]
                                      Script NameKill
                                      Run script with full access privilegesOff
                                      Include In MenuYes
                                      Layouts that use this script
                                        Scripts that use this script
                                          Script Definition
                                          Script Steps
                                          Fields used in this script
                                            Scripts used in this script
                                              Layouts used in this script
                                                Tables used in this script
                                                  Table occurrences used by this script
                                                    Custom Functions used by this script
                                                      Custom menu set used by this script

                                                        Previous Script: [Kill]Next Script: [startup]
                                                        Script NameStartup PHP
                                                        Run script with full access privilegesOff
                                                        Include In MenuYes
                                                        Layouts that use this script
                                                        Scripts that use this script
                                                          Script Definition
                                                          Script Steps
                                                          • Set Variable [ $result; Value:MBS("PHP.Load";Simple_php::Path to DLL) ]
                                                          • If [ $result <> "OK" ]
                                                          • Show Custom Dialog [ Title: "php DLL was not found!"; Message: "Please enter the path the php DLL in the field provided and try again."; Default Button: “OK”, Commit: “Yes” ]
                                                          • Exit Script [ ]
                                                          • End If
                                                          • Set Variable [ $result; Value:MBS("PHP.Init") ]
                                                          • If [ $result = "OK" ]
                                                          • Show Custom Dialog [ Title: "Success!"; Message: "php is ready to go."; Default Button: “OK”, Commit: “Yes” ]
                                                          • Else
                                                          • Show Custom Dialog [ Title: "Error!"; Message: "php couldn't be started"; Default Button: “OK”, Commit: “Yes” ]
                                                          • End If
                                                          Fields used in this script
                                                          Scripts used in this script
                                                            Layouts used in this script
                                                              Tables used in this script
                                                              Table occurrences used by this script
                                                              Custom Functions used by this script
                                                                Custom menu set used by this script

                                                                  Previous Script: [Startup PHP]
                                                                  Script Namestartup
                                                                  Run script with full access privilegesOff
                                                                  Include In MenuNo
                                                                  Layouts that use this script
                                                                    Scripts that use this script
                                                                      Script Definition
                                                                      Script Steps
                                                                      • #Find Library
                                                                      • Set Variable [ $databasePath; Value:Get(FilePath) ]
                                                                      • Set Variable [ $databasePath; Value:MBS("Path.FilemakerPathToNativePath"; $databasePath) ]
                                                                      • Set Variable [ $databasePath; Value:Substitute ( $databasePath ; ".fp7" ; ".fmp12") ]
                                                                      • Set Variable [ $databaseName; Value:Get(FileName) & ".fmp12" ]
                                                                      • If [ Get(SystemPlatform) = 1 ]
                                                                      • Set Variable [ $path; Value:Substitute ( $databasePath ; $databaseName ; "libphp5.mac.dylib" ) ]
                                                                      • Else
                                                                      • Set Variable [ $path; Value:Substitute ( $databasePath ; $databaseName ; "php5ts.dll" ) ]
                                                                      • End If
                                                                      • Set Field [ Simple_php::Path to DLL; $path ]
                                                                      Fields used in this script
                                                                      Scripts used in this script
                                                                        Layouts used in this script
                                                                          Tables used in this script
                                                                          Table occurrences used by this script
                                                                          Custom Functions used by this script
                                                                            Custom menu set used by this script

                                                                              Custom Functions

                                                                              Function NameParametersAvailabilityDefinitionIn Field DefinitionsIn Scripts
                                                                              PHPstringAll accountsLet( [ execute = Case( MBS("PHP.Init") <> "OK"; "Error"; MBS("PHP.Run"; string) ); result = Case( execute = "Error"; "Error"; MBS("PHP.GetResultString") ); kill= MBS("PHP.ShutDown") ]; result )
                                                                                phphtmlmodetextAll accountsEvaluate( "\"" & Substitute( text; ["<?php"; "\" & MBS(\"PHP.Run\";\""]; ["?>"; "\")&\""] ) & "\"" )

                                                                                  Custom Menu Sets

                                                                                  Menu SetsMenusIn ScriptsIn LayoutsComments
                                                                                  [Standard FileMaker Menus]
                                                                                  • All Standard Menus
                                                                                  Custom Menu Set 1

                                                                                  Download example: Simple_php

                                                                                  Used functions:




                                                                                  Links
                                                                                  MBS Xojo PDF Plugins