Copied!
Cloneable Instantiable
Constants
public PHPFUI\Base ::DEBUG_SOURCE = 1
Methods
public PHPFUI\Base :: __clone ()
public __construct ( PHPFUI\Interfaces\Page $page , string $name , array $inGroup , array $notInGroup , string $callbackIndex , callable $callback )
 

The ToFromList implements a two side by side panes that uses can drag and drop from one side to
the other. It does not support ordering within panes. It assumes you are picking data from a
master list and putting each item in to one group or the other.

The data:

The ToFromList assumes you have one master array with numeric indexes from 0 to what ever. Each
item in the master array must be an array and have an index specified by $callbackIndex. It will
be the record number of itself in the master array. This is needed because we can not use the
array index from the $inGroup or $notInGroup, as those are subsets of the master array. So each
element in the master array must keep track of it's own index in the master array. You can
include any other data in this array you want, but it is recommend you have a human readable
name, or a way to get this, as you will need to return that in the callback function.

The callback:

The callback should have the following signature:

function (string $fieldName, string $index, mixed $userData, string $type) : string
  • param PHPFUI\Page $page needed for JavaScript
  • param string $name identifying this ToFromList from others on the same page. Needs to be
    unique per page
  • param array $inGroup data for the selected group. See below for array requirements.
  • param array $notInGroup data for the unselected group. See below for array requirements.
  • param string $callbackIndex is used to identify records by index in your master set of data.
  • param callable $callback used to format the text used to drag and drop.
public PHPFUI\Base :: __toString () : string
public PHPFUI\Base :: add ( $item )
 

Base add function. Adds to the end of the current objects

  • param mixed $item should be convertable to string
  • return PHPFUI\Base
public PHPFUI\Base :: addAsFirst ( $item )
 

Base addAsFirst function. Adds to the front of the current
object

  • param mixed $item should be convertable to string
  • return PHPFUI\Base
public PHPFUI\Base :: count () : int
 

Number of object in this object. Does not count sub objects.

public PHPFUI\Base :: done ( bool $done = true ) : PHPFUI\Base
 

Form is done rendering

public static PHPFUI\Base :: getDebug ( int $flags = 0 ) : int
 

Gets the current debug setting

public getPage () : PHPFUI\Interfaces\Page
public PHPFUI\Base :: getResponse () : string
 

Get the current response

public PHPFUI\Base :: isDone () : bool
 

Returns true if the page needs no more processing

public PHPFUI\Base :: prepend ( $item ) : PHPFUI\Base
 

Add an object in front of existing object

public static PHPFUI\Base :: setDebug ( int $level = 0 ) : void
 

Set the debug level, 1 or higher is on

public setInIcon ( $inIcon ) : PHPFUI\ToFromList
 

You can customize the "in" icon (or remove it) by passing in html

  • param mixed $inIcon should convert to valid html string
public setInName ( string $inName ) : PHPFUI\ToFromList
 

Sets the header name for the "in" group

public setOutIcon ( $outIcon ) : PHPFUI\ToFromList
 

You can customize the "out" icon (or remove it) by passing in html

  • param mixed $outIcon should convert to valid html string
public setOutName ( string $outName ) : PHPFUI\ToFromList
 

Sets the header name for the "out" group

public PHPFUI\Base :: setRawResponse ( string $response , bool $asJSON = true ) : PHPFUI\Base
 

Sets the page response directly

public PHPFUI\Base :: setResponse ( string $response , string $color = 'lime' ) : PHPFUI\Base
 

Set a response in the standard format ('reponse' and 'color' array)

  • param string $response to return
  • param string $color used for the save button
public PHPFUI\Base :: walk ( string $method , $argument = NULL )
 

Recursively walks all objects and calls the passed method on each object where it exists

  • param string $method to call on the object in the collection
  • param mixed $argument to pass to the method
  • return $this
Properties
protected $callback
protected string $callbackIndex
protected array $inGroup
protected PHPFUI\Container $inIcon
protected string $inName
protected string $name
protected array $notInGroup
protected PHPFUI\Container $outIcon
protected string $outName
protected PHPFUI\Interfaces\Page $page
Methods
protected createWindow ( array $group , string $type ) : string
protected getBody () : string
protected getEnd () : string
protected PHPFUI\Base :: getItems () : array
protected getStart () : string
protected makeDiv ( string $id , string $type , string $html ) : string
Properties
private static bool $outputJs
Methods
private processRequest () : void
Properties
private static bool $outputJs
Methods
public static PHPFUI\Base :: getDebug ( int $flags = 0 ) : int
 

Gets the current debug setting

public static PHPFUI\Base :: setDebug ( int $level = 0 ) : void
 

Set the debug level, 1 or higher is on

© 2022 Bruce Wells
Search Namespaces \ Classes
Configuration