BlueShoes Application Framework made with PHP http://www.blueshoes.org/


Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: C:/usr/local/lib/php/blueshoes-4.2/core/html/form/Bs_FormContainer.class.php
BlueShoes Application Framework - Form

Bs_FormContainer

Bs_Object
   |
  +-- Bs_FormElement
     |
    +-- Bs_FormContainer

Form Container Class

 

public class Bs_FormContainer extends Bs_FormElement

Form Container Class
dependencies: Bs_FormElement, Bs_Array, Bs_FormTemplateParser

Authorsandrej arn <andrej@arn.li>
Version4.0.$id$
Copyrightblueshoes.org

 

Methods inherited from Bs_FormElement

bs_formelement, hasformobject, setformobject, getcaption, getelement, _doelementstringformat, _getparamvalue, getlanguagedependentvalue

Methods inherited from Bs_Object

isex, isexception, tostring, tohtml, unpersist, bs_object, bbsetoutput, bbawake, bbisawake, bbxmsg, bbxfunctionstart, bbxfunctionend, bbxecho, bbxvar, bbxvardump, bbforcetrace, bbbufferstart, bbbufferget, bbbufferendflush, bbbufferendclean

Public Method Summary

void

Bs_FormContainer()

Constructor.
string

&getElement([ string $level ])

Return some html code to display the element on a website in a form.
bool

addElement(object [unknown] &$element)

add an instance of a form element object to this container.
void

orderElements()

orders the elements based on the orderId var.
bool

hasFileFieldElement()

tells if this container holds a file field element.
int

getLevel()

returns the level this container belongs to.Warning: documentation is missing.
array

getSaveToDbArray([ array $hash ])

called by Bs_Form->getSaveToDbArray(), look there for further information.

Private Method Summary

bool

persist()

persist the element settings.Warning: documentation is missing.
void

getStartTag()

Warning: documentation is missing.
void

getEndTag()

Warning: documentation is missing.
void

seedClearingHousefuck(array $ret, string $firstCall)

Warning: documentation is missing.
void

seedClearingHouse(array $ret, string $root, string $firstCall)

Warning: documentation is missing.

Fields inherited from Bs_FormElement

$persister, $persisterid, $_form, $name, $elementtype, $formid, $container, $orderid, $elementstringformat, $persistervarsettings, $this

Public Field Summary

int

$level

a container can be assigned to another level. this is used for the
bool

$mayToggle

tells if the container content may be toggled (display/hide).
bool

$defaultOff

tells if the container content is hidden when the form loads.
bool

$useTemplate

if we should use a template when an appropriate one is available. false unless
string

$templatePath

the absolute path to the template(s). if not given then

Private Field Summary

object [unknown]

$_Bs_Array

reference to the global pseudostatic Bs_Array.
array

$formElements

holding references to instances of Bs_FormElement.
mixed

$caption

the title for this group.
string

$useCheckboxAsCaption

if set and *this container* has such a checkbox field, the var $caption is ignored,
string

$pseudoContainer

should it be displayed as real container with caption and borders?

Private Constant Summary

BS_FORMCONTAINER_VERSION >>4.0.$x$<< Warning: documentation is missing.

Public Method Details

Bs_FormContainer

public void Bs_FormContainer( )

  Constructor.

Returns void


&getElement

public string &getElement( [ string $level ] )

  Return some html code to display the element on a website in a form.
calls itself recursively.

Parameter
string $level = >>null<<
(if set then only container of that level (or undefined level) will be used.)
Returns string

(some html code.)


addElement

public bool addElement( object [unknown] &$element )

  add an instance of a form element object to this container.
it cannot be added to the clearing house here cause the container may notbe attached to the form yet.

Parameter
object [unknown] &$element
an instance of a form element.
Returns bool

true on success, false on failure.


orderElements

public void orderElements( )

  orders the elements based on the orderId var.

Returns void

See Also $formElements

hasFileFieldElement

public bool hasFileFieldElement( )

  tells if this container holds a file field element.
called recursively.

Returns bool


getLevel

public int getLevel( )

  returns the level this container belongs to.
throws null for unknown or not set.overwrites and uses parent method.

Warning: documentation is missing.

Returns int

Throws null

getSaveToDbArray

public array getSaveToDbArray( [ array $hash ] )

  called by Bs_Form->getSaveToDbArray(), look there for further information.
calls itself recursively.

Parameter
array $hash = >>array()<<
default is array(). used internally for the recursive loop.
Returns array


Private Method Details

persist

private bool persist( )

  persist the element settings.

Warning: documentation is missing.

Returns bool

true on success
@throw bs_exception on error (db exception)

See Also unpersist()

getStartTag

private void getStartTag( )

 

Warning: documentation is missing.

Returns void


getEndTag

private void getEndTag( )

 

Warning: documentation is missing.

Returns void


seedClearingHousefuck

private void seedClearingHousefuck( array $ret, string $firstCall )

 

Warning: documentation is missing.

Parameter
array $ret
Warning: documentation is missing.
string $firstCall
Warning: documentation is missing.
Returns void


seedClearingHouse

private void seedClearingHouse( array $ret, string $root, string $firstCall )

 

Warning: documentation is missing.

Parameter
array $ret
Warning: documentation is missing.
string $root
Warning: documentation is missing.
string $firstCall
Warning: documentation is missing.
Returns void


Public Field Details

$level

public int $level

>><<

a container can be assigned to another level. this is used for the
multi-level form feature.all elements (including form fields and sub-containers) of thiscontainer automatically inherit the level information of thiscontainer. they cannot be in a different level.note I: if not set then it will be used in all levels.note II: the first level is level 1, not 0.note III: if you want to be able to assign a container to more than onelevel, code that feature, please. :)


$mayToggle

public bool $mayToggle

>><<

tells if the container content may be toggled (display/hide).
default and not set = false.

See Also $defaultOff

$defaultOff

public bool $defaultOff

>><<

tells if the container content is hidden when the form loads.
default and not set = false.

See Also $mayToggle

$useTemplate

public bool $useTemplate

>><<

if we should use a template when an appropriate one is available. false unless
set to TRUE.to see how templates are named see the phpdoc of Bs_FormTemplateParser->loadTemplate().note: you can code endless loops if your template uses the container element itself.it crashed my apache 1.3x on windows 2k workstation.

See Also $templatePath

$templatePath

public string $templatePath

>><<

the absolute path to the template(s). if not given then
getAbsolutePath() . '../templates/'will be used which kinda sucks. so you better set that...

See Also $useTemplate

Private Field Details

$_Bs_Array

private object [unknown] $_Bs_Array

>><<

reference to the global pseudostatic Bs_Array.


$formElements

private array $formElements

>><<

holding references to instances of Bs_FormElement.


$caption

private mixed $caption

>><<

the title for this group.
usually a string, can be a hash because it's language dependant.


$useCheckboxAsCaption

private string $useCheckboxAsCaption

>><<

if set and *this container* has such a checkbox field, the var $caption is ignored,
the checkbox plus it's caption is used instead, and the $text of the checkbox isprintes as text in the first paragraph of this container. nice feature. should bedocumented in a howto.


$pseudoContainer

private string $pseudoContainer

>>FALSE<<

should it be displayed as real container with caption and borders?


Private Constant Details

BS_FORMCONTAINER_VERSION

define( BS_FORMCONTAINER_VERSION, >>4.0.$x$<< )
Case: default: case sensitive




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta