\

Namespaces

mf

Interfaces

formField Defines the base functions required from a form field.
mfIndexable List the methods an indexable subclass of dbRecord should implement to be indexed in the database.
module Defines the base functions required from a plugin module. A plugin module is a panel for editing plugin data in the backend, or for managing and displaying data in the frontend.
plugin Defines the base functions required for a plugin. A plugin is a container holding one or several modules and records required to accomplish a specific task or adding a specific set of features to MindFlow.

Classes

altLangField Defines an alternate language for the current record
backend Handles processing and display of the MindFlow backend. The backend is the administration user interface for an application or website.
checkboxField Defines a checkbox field
colorField Defines a color picker based on bootstrap 3 colorpicker
Colors
Colors
contact Base class for handling database records and their forms.
contacts
contactsPlugin
countriesFilter Manages the content of simple forms.
dateField Defines a date field based on bootstrap 3 datepicker version 4.17
dateTimeField Defines a datetime field based on bootstrap 3 datepicker version 4.17
dbForm Manages the content of simple forms.
dbManager Gives access to a database using MindFlow's configuration parameters
dbRecord Base class for handling database records and their forms.
event Base class for handling database records and their forms.
events
eventsPlugin
ExceptionThrower Utility for catching PHP errors and converting them to an exception that can be caught at runtime
fieldset Adds a fieldset tag to the form
filesField Defines a file upload field, allowing simultaneous upload of multiple files and allowing control of the file extensions allowed.
formsManager Handles record forms and simple forms display and processing
franceFilter Manages the content of simple forms.
frontend Handles processing and display of the MindFlow frontend. The frontend displays a website or an application's data.
hiddenField Defines a hidden field
htmlField Defines a free html field, allowing the developper to add any arbitrary HTML code to the form.
inputField Defines a typical input field
installToolLoginForm This form provides the identification fields to the install tool.
l10nManager Handles localization of Mindflow frontend and backend.
manageCountries
manageFrance
manageSearchIndex
mf
mfAuthentification
mfAuthentificationPlugin
mfColissimoFees Base class for handling database records and their forms.
mfCountry Base class for handling database records and their forms.
mfCountryDataPlugin
mfDepartement Base class for handling database records and their forms.
mfFrance Base class for handling database records and their forms.
mfSearchEnginePlugin
mfSearchIndex Base class for handling database records and their forms.
mfUser Base class for handling database records and their forms.
mfUserGroup Base class for handling database records and their forms.
mfUsersPlugin
microtemplateField Defines a microtemplate field, where the developper can specify a list of field and map them to a portion of HTML code, such as a news block for exemple
page Base class for handling database records and their forms.
pages
pagesPlugin
pluginManager Handles all plugin related tasks.
portfolio
portfolioCategory Base class for handling database records and their forms.
portfolioItem Base class for handling database records and their forms.
portfolioPlugin
radioField Defines a radio field
recordEditTableField Defines a recordEditTable field, allowing to display a list of records from another table inside a form field. recordEditTable and recordSelectField allow to create a one to may relationship.
recordSelectField Defines a recordSelect field, allowing to display a list of records from another table inside a form field. recordEditTable and recordSelectField allow to create a one to may relationship.
ressourceIdentifier
richTextField Defines a rich text field based on CKEditor + KCFinder plugin (for uploading files associated with links and pictures)
rid Ressource ID storage acts as a global memory for MindFlow and websites.
searchIndexer
searchIndexFilter Manages the content of simple forms.
selectField Creates a simple select field populated by the values supplied by the developper as an array into the 'possibleValues' attribute
simpleRecord Base class for database records, without form managment nor load/store functions
siteInfo Base class for handling database records and their forms.
siteInfosPlugin
templateDataField Displays the form out of a templateData field. Must be used in conjunction with a templateNameField. The templateData field will hold the template values, while the templateName will point to the name of the datastructure used as definition.
templateNameField Allows to select a template name among a list of templates.
textareaField Creates a simple textarea field. You can specify the number of columns and rows by adding their count in the dataType definition : 'dataType' => 'textarea 50 5' //for 50 columns and 5 rows
timeField Defines a time field based on bootstrap 3 datepicker version 4.17
urlInputField Field for typing URLs. Very basic stuff, requires to be improved.
urlRewriter
urlRewriterPlugin
userGroups
users
usersForm Manages the content of simple forms.
webSearch
welcome
welcomePlugin

Constants

HIGH_PRIORITY

HIGH_PRIORITY

LOOSE_PRIORITY

LOOSE_PRIORITY

LOW_PRIORITY

LOW_PRIORITY

MEDIUM_PRIORITY

MEDIUM_PRIORITY

TOP_PRIORITY

TOP_PRIORITY

Functions

addHttp()

addHttp(  $url) : string

Recognizes ftp://, ftps://, http:// and https:// in a case insensitive way and adds http:// prefix to the URL if missing

Parameters

$url

Returns

string

addHttpHost()

addHttpHost(  $url) : string

Recognizes ftp://, ftps://, http:// and https:// in a case insensitive way and adds 'http://'.$_SERVER['SERVER_NAME'] prefix to the URL if missing

Parameters

$url

Returns

string

addWrapper()

addWrapper(  $item1,   $key,   $wrapString) 

Parameters

$item1
$key
$wrapString

array2Html()

array2Html(  $array,   $table = true) 

Parameters

$array
$table

array_deep_copy()

array_deep_copy(  $array,   $copy,   $maxdepth = 50,   $depth) 

Parameters

$array
$copy
$maxdepth
$depth

array_delete()

array_delete(  $array,   $element) 

Parameters

$array
$element

array_merge_recursive_distinct()

array_merge_recursive_distinct(array  $array1, array  $array2) : array

array_merge_recursive does indeed merge arrays, but it converts values with duplicate keys to arrays rather than overwriting the value in the first array with the duplicate value in the second array, as array_merge does. I.e., with array_merge_recursive, this happens (documented behavior):

array_merge_recursive(array('key' => 'org value'), array('key' => 'new value'));

=> array('key' => array('org value', 'new value'));

array_merge_recursive_distinct does not change the datatypes of the values in the arrays. Matching keys' values in the second array overwrite those in the first array, as is the case with array_merge, i.e.:

array_merge_recursive_distinct(array('key' => 'org value'), array('key' => 'new value'));

=> array('key' => array('new value'));

Parameters are passed by reference, though only for performance reasons. They're not altered by this function.

Parameters

array $array1
array $array2

Returns

array

checkSec()

checkSec() : boolean

checks the sec and fields parameters from $_REQUEST have not been altered regarding secured fields.

If the value of one of the fields listed in $_REQUEST['fields'] has been altered, the hash will mismatch and the function will return a false status

Returns

boolean —

the check success. False if fields verification fails.

clear_dir()

clear_dir(  $dir, boolean  $delete = false) 

Empties a folder recursively from all the files and folders it contains

Parameters

$dir

absolute path to the folder to be emptied

boolean $delete

if true, delete the root folder as well

convert()

convert(  $size) 

Parameters

$size

copyr()

copyr(string  $source, string  $dest) : boolean

Copy a file, or recursively copy a folder and its contents

Parameters

string $source

Source path

string $dest

Destination path

Returns

boolean —

Returns TRUE on success, FALSE on failure

createDir()

createDir(  $dirPath) 

Creates a directory at dirPath if it does not already exists.

Parameters

$dirPath

String relative path of the target directory

createDir()

createDir(  $dirPath) 

Creates a directory at dirPath if it does not already exists.

Parameters

$dirPath

String relative path of the target directory

crop()

crop(  $image, integer|array  $x1, integer  $y1, integer  $x2, integer  $y2,   $originalWidth,   $originalHeight) : \ImageManipulator

Crop image

Parameters

$image
integer|array $x1

Top left x-coordinate of crop box or array of coordinates

integer $y1

Top left y-coordinate of crop box

integer $x2

Bottom right x-coordinate of crop box

integer $y2

Bottom right y-coordinate of crop box

$originalWidth
$originalHeight

Throws

\RuntimeException

Returns

\ImageManipulator —

for a fluent interface

dateFromSQL()

dateFromSQL(  $date,   $dataType,   $locale) 

Parameters

$date
$dataType
$locale

dateNow()

dateNow(  $locale) 

Parameters

$locale

dateTimeMsNow()

dateTimeMsNow(  $locale) 

Parameters

$locale

dateTimeNow()

dateTimeNow(  $locale) 

Parameters

$locale

dateToSQL()

dateToSQL(  $date,   $dataType,   $locale) 

Parameters

$date
$dataType
$locale

echoBackButton()

echoBackButton() 

echoTable()

echoTable(  $table) 

Parameters

$table

echoValue()

echoValue(  $name,   $value) 

Parameters

$name
$value

formatTel()

formatTel(  $tel) 

Parameters

$tel

generateCallTrace()

generateCallTrace() : string

Displays a backtrace of the calling function, without displaying the function call arguments, which often turns the standard PHP function debug_print_backtrace() unreadable.

Returns

string —

the backtrace text. Wrap it with nl2br() if you want to display it as HTML.

generateStrongPassword()

generateStrongPassword(  $length = 9,   $add_dashes = false,   $available_sets = 'luds') 

Parameters

$length
$add_dashes
$available_sets

GenerateUrl()

GenerateUrl(  $text) 

Parameters

$text

getHTTPHost()

getHTTPHost() 

Returns the hostname prepended with http:// or https://

getHTTPScheme()

getHTTPScheme() 

Returns http:// or https:// , matching the protocol used to load the current page

getImageResizedDimensions()

getImageResizedDimensions(  $orig_width,   $orig_height,   $max_width,   $max_height) : array

Computes the dimension of a resized image without actually processing the image

Parameters

$orig_width
$orig_height
$max_width

maximum width after resizing : if the image is wider than higher this limit will be used.

$max_height

maximum height after resizing : if the image is higher than wider this limit will be used.

Returns

array —

width computed width as 'width' and computed height as 'height' indices

getImgRessourceFromFilename()

getImgRessourceFromFilename(  $filename) : \image

loads filename and converts it into an image object in memory

Parameters

$filename

string the file to be loaded

Returns

\image

getMarkers()

getMarkers(  $subject) : array

Looks for all markers in $subject and returns an array populated with these

Parameters

$subject

string the template feature {markers} to be analyzed

Returns

array —

a list of all the markers found ordered as {marker} => marker

getSec()

getSec(  $securedURLParameters) : array

Generates the values required to secure a form. The user inputs an associative array of the values of the form which should never be altered during the request.

Parameters

$securedURLParameters

an associative array of the URL parameters and their values in input, such as array('action' => 'saveRecord', 'record_class' => 'myContact', 'record_uid' => '29');

Returns

array —

an associative array featuring the useful values to include in your request :

     'parameters' will return action=saveRecord&record_class=myContact&record_uid=29
     'hash' will return a sha256 salted hash of the supplied values
     'fields' will return the coma separated list of fields to check

j_parseUrl()

j_parseUrl(  $url) : array

Identical functionnality to parse_url(), but supports IPv6 hostnames as well

Parameters

$url

Returns

array

logMails()

logMails(  $from,   $to,   $subject,   $textToLog) 

Logs sent email information into the logfile configured into $config[$mf->getLocale()]['enableEmailLog']

Parameters

$from

email address of the sender

$to

email address of the recipient

$subject

subject of the email

$textToLog

text to be put in the log

makeHTMLActionLink()

makeHTMLActionLink(  $action, string  $recordClass = '',   $recordUid,   $includeCssAndJs = false,   $parentClass = '',   $parentUid) 

Creates a link to ajax-core-html.php with secured form parameters

@param string $action an action available from ajax-core-html.php, such as 'editRecord' or 'viewRecord'

Parameters

$action
string $recordClass

the class of the record to process @param int|string $recordUid the uid of the record to be edited. @param boolean $includeCssAndJs tell mindflow to include all required CSS and JS code. This is usefull if the given HTML is displayed in an open window instead of an AJAX Window @param string $parentClass when you create a record from another, you may want to indicate the class of the record it is created from @param int $parentUid when you create a record from another, you may want to indicate the uid of the record it is created from @return string the link to get the content action executed

$recordUid
$includeCssAndJs
$parentClass
$parentUid

makeJSONActionLink()

makeJSONActionLink(  $action, string  $recordClass,   $recordUid) 

Creates a link to ajax-core-json.php with secured form parameters

@param string $action an action available from ajax-core-html.php, such as 'editRecord' or 'viewRecord'

Parameters

$action
string $recordClass

the class of the record to process @param int|string $recordUid the uid of the record to be edited. @return string the link to get the content action executed

$recordUid

makeTheUpgrade()

makeTheUpgrade(  $instance,   $className) 

Parameters

$instance
$className

makeTheUpgrade()

makeTheUpgrade(  $instance,   $className) 

Parameters

$instance
$className

makeTheUpgrade()

makeTheUpgrade(  $instance,   $className) 

seeks for records featuring date and datetime fields and changes their specification to allow null dates for SQL strict conformance

Parameters

$instance
$className

makeTheUpgrade()

makeTheUpgrade(  $instance,   $className) 

Seeks for records featuring files fields and updates their filepath for MindFlow 1.9, removing the uploadsDir from the filePath

Parameters

$instance
$className

makeTheUpgrade()

makeTheUpgrade(  $instance,   $className) 

Parameters

$instance
$className

mfResizeImage()

mfResizeImage(  $imageArray,   $maxWidth,   $maxHeight,   $forceMatchDimensions = false,   $forceCreateImage = false) 

Parameters

$imageArray
$maxWidth
$maxHeight
$forceMatchDimensions
$forceCreateImage

print_r_level()

print_r_level(mixed  $data, integer  $level = 5) : string

Recrusive print variables and limit by level.

Parameters

mixed $data

The variable you want to dump.

integer $level

The level number to limit recrusive loop.

Returns

string —

Dumped data.

replace_between()

replace_between(  $str,   $needle_start,   $needle_end,   $replacement) : mixed

Seeks and replaces text between 2 markers ($needle_start, $needle_end) into a target string

Parameters

$str

String the target string

$needle_start

String marker for start

$needle_end

String marker for end

$replacement

String the new text to be inserted between the markers

Returns

mixed

replace_between()

replace_between(  $str,   $needle_start,   $needle_end,   $replacement) : mixed

Seeks and replaces text between 2 markers ($needle_start, $needle_end) into a target string

Parameters

$str

String the target string

$needle_start

String marker for start

$needle_end

String marker for end

$replacement

String the new text to be inserted between the markers

Returns

mixed

resize()

resize(  $cur_dir,   $cur_file,   $max_width,   $max_height,   $originalWidth,   $originalHeight,   $preserveAspect = true,   $timestamp = '') 

Parameters

$cur_dir
$cur_file
$max_width
$max_height
$originalWidth
$originalHeight
$preserveAspect
$timestamp

resizeImage()

resizeImage(  $filename,   $max_width,   $max_height) : \image

Resize an image and keep the proportions

Parameters

$filename

the file to be processed

$max_width

maximum width after resizing : if the image is wider than higher this limit will be used.

$max_height

maximum height after resizing : if the image is higher than wider this limit will be used.

Returns

\image

selfURL()

selfURL(  $includeQueryString = true) : String

Returns the complete URL of the current page

Parameters

$includeQueryString

boolean set to false if you do not want to get the parameters after the ? in the url returned

Returns

String

setSection()

setSection(  $targetName,   $tagName,   $sectionCode,   $targetCode,   $decay) : mixed

Inserts or replaces a section of code into existing code.

Here is how the code would look prior the insertion :

This is some previous code //{targetName} This is some following code

Now here is how it would look after the insertion :

This is some previous code //[tagName] the code that should be inserted (section code) //[/tagName] //{targetName} This is some following code

Any new insertion using the same tag name will replace the existing section. Any new insertion using a different tag name will append the section to the existing code.

Parameters

$targetName

String this is the name of the target marker where the section to be inserted should be positionned if the section tags are not already present. A target named "module_insert_form" looks like //{module_insert_form} in the code.

$tagName

String this is the tag name for a given section of code, which allows to locate it and replace it at a later time if the code of this section needs to be replaced. For example, if the tag name is "item_123", the function will attempt to replace the code between //[item_123] and //[/item_123]

$sectionCode
$targetCode
$decay

String The characters, tabs or spaces, to put in front of the inserted code so it is correctly indented

Returns

mixed

setSection()

setSection(  $targetName,   $tagName,   $sectionCode,   $targetCode,   $decay) : mixed

Inserts or replaces a section of code into existing code.

Here is how the code would look prior the insertion :

This is some previous code //{targetName} This is some following code

Now here is how it would look after the insertion :

This is some previous code //[tagName] the code that should be inserted (section code) //[/tagName] //{targetName} This is some following code

Any new insertion using the same tag name will replace the existing section. Any new insertion using a different tag name will append the section to the existing code.

Parameters

$targetName

String this is the name of the target marker where the section to be inserted should be positionned if the section tags are not already present. A target named "module_insert_form" looks like //{module_insert_form} in the code.

$tagName

String this is the tag name for a given section of code, which allows to locate it and replace it at a later time if the code of this section needs to be replaced. For example, if the tag name is "item_123", the function will attempt to replace the code between //[item_123] and //[/item_123]

$sectionCode
$targetCode
$decay

String The characters, tabs or spaces, to put in front of the inserted code so it is correctly indented

Returns

mixed

Slug()

Slug(  $string,   $slug = '-',   $extra = null) 

Parameters

$string
$slug
$extra

str_replace_limit()

str_replace_limit(  $search,   $replace,   $string,   $limit = 1) 

Parameters

$search
$replace
$string
$limit

tableExists()

tableExists(string  $tableName) : boolean

Check if a table exists in the current database.

Parameters

string $tableName

Table to search for.

Returns

boolean —

TRUE if table exists, FALSE if no table found.

truncateHtml()

truncateHtml(string  $text, integer  $length = 100, string  $ending = '...', boolean  $exact = false, boolean  $considerHtml = true) : string

truncateHtml can truncate a string up to a number of characters while preserving whole words and HTML tags

Parameters

string $text

String to truncate.

integer $length

Length of returned string, including ellipsis.

string $ending

Ending to be appended to the trimmed string.

boolean $exact

If false, $text will not be cut mid-word

boolean $considerHtml

If true, HTML tags would be handled correctly

Returns

string —

Trimmed string.

Unaccent()

Unaccent(  $string) 

Parameters

$string

unaccent_keywords()

unaccent_keywords(  $dataString) 

Parameters

$dataString

validateDate()

validateDate(  $date) : boolean

Validates a given date string formated as specified in $GLOBALS['site_locales'][$mf->getLocale()]['php_date_format'], returning true or false. Makes use of the standard PHP function checkdate()

Parameters

$date

a date formated according to the current display locale

Returns

boolean —

validation result

validateEmail()

validateEmail(  $email) : boolean

Validates the format of an email address. Makes use of the standard PHP function filter_var ( $email, FILTER_VALIDATE_EMAIL);

Parameters

$email

Returns

boolean —

validation result

writeFile()

writeFile(  $filePath,   $fileContent) 

Writes the fileContent into a file located at filePath. Queries the user for authorization to overwrite the file if it already exists.

This function is meant to be used in cli mode.

Parameters

$filePath

String relative path to the target file

$fileContent

String the content to be written into the file

writeFile()

writeFile(  $filePath,   $fileContent) 

Writes the fileContent into a file located at filePath. Queries the user for authorization to overwrite the file if it already exists.

This function is meant to be used in cli mode.

Parameters

$filePath

String relative path to the target file

$fileContent

String the content to be written into the file