SproutCMS

This is the code documentation for the SproutCMS project

function conditionsList()

A conditions list, which is an interface for building rules for
use in dynamic IF-statement style systems.

Output POST data will be a JSON string of the condition rules,
as an array of objects with the keys 'field', 'op', 'val' for
each condition.

There are two parameters:
   fields   array    Available field types, name => label
   url      string   AJAX lookup method which returns the
                     operator and value lists

The lookup url is provided GET params 'field', 'op', 'val' and
should output JSON with two keys, 'op' and 'val', which are both
strings containing HTML for the fields; the op field should be
a SELECT and the val field should be an INPUT or a SELECT.

Usage

string Fb::conditionsList ( string $name , array $attrs , array $params );

Arguments

  1. string $name
    Field name
  2. array $attrs
    Unused
  3. array $params
    Array with two params, 'fields' and 'url'

Return value

  • string
    HTML