|
|
File: c:/www/apache/doc2//form/panemanager.inc
PHPLib Form Rewrite 2001/03/01 - Form
panemanager
form_commonobject | +-- panemanager
Base class of Assistant and TabbedPane. This class holds some functions to
|
Base class of Assistant and TabbedPane. This class holds some functions to
render buttons and to care on persistant data
Authors | Ulf Wendel <ulf.wendel@phpdoc.de> |
Version | $Id: panemanager.inc,v 1.6 2000/12/19 13:34:15 uw Exp $ |
|
|
Direct known subclasses: assistant, tabbedpane
|
|
|
Public Method Summary |
void |
Init()Use this method to provide the structure of the assistant |
string |
get()Returns the current page |
string |
show()print, generate and return the current page |
bool |
isFinishPressed()Is the Button "Finish" pressed? |
bool |
isExitPressed()Is the Button "Exit" pressed? |
bool |
isHelpPressed()Is the Button "Help" pressed? |
bool |
setHelp(array $data)Set the label, name and comment text that belongs to the help button |
void |
setExitButton(string $label, string $name)Set the laben and the name of the exit button |
void |
showTabs([ boolean $ok ])Generate tabs? |
bool |
setStart(string $html, [ string $method ])Sets the opening form tag. |
string |
getStart([ string $js_name, string $method, string $action, string $target, string $form_name ])Generates a <form>-Tag. |
boolean |
setFinish(string $html)Sets the closing HTML form tag. |
string |
getFinish([ string $additional_html ])Generate closing </form>-Tag |
string |
Finish([ string $additional_html ])Generate, print and return the closing HTML form tag |
bool |
setLabels(mixed $labels, [ string $value ])Set the label of a button. |
|
Private Method Summary |
void |
restoreAssistant()Restores the Assistant. Load the pages with values, sets validation flags etc. |
void |
addPage()Adds a page to the assistant / tabbed pane |
string |
getResetButton(string $label)Returns a HTML reset button |
string |
getButton(string $label, string $value, [ string $name ])Returns a submit button. |
array |
getTab(string $label, mixed $value, mixed $optional, mixed $error)Generates a tab. |
boolean |
issetHTTPXVAR(string $varname, [ boolean $regexp ])Checks the existance of a HTTP_POST|GET_VARS. |
boolean |
setFinishButton(string $label, string $name)Sets the label and name of a button that allows to exit the assistant as soon as all forms are valid. |
void |
setMethod([ string $method ])Sets the method used by all pages |
void |
Start([ string $js_name, string $method, string $action, string $target, string $form_name ])Generate, print and return the opening HTML form tag. |
array |
arrayRegexpKeySearch(array $array, string $reg)Scans the given array for a key that matches the given regexp. |
void |
getPageValues(string $page_name)Warning: documentation is missing. |
void |
getPageValuesWithTranslatedNames()Warning: documentation is missing. |
|
|
Public Field Summary |
string |
$classnamePHPLIB persistance helper, name of this class |
array |
$persistent_slotsPHPLIB persistance helper, list of persistant "slots" |
|
Private Field Summary |
array |
$page_valuesHash with form values of all pages |
array |
$pagesArray of pages. |
string |
$buttonnameNameprefix of all buttons generated by assistant. |
array |
$finish_buttonLabel and name of a button that exits the assistant. |
array |
$exitLabel and name of a exit button that always to abort the assistant |
array |
$helpLabel, name and comment text that belongs to the help button. |
string |
$methodMethod used in the forms. |
string |
$form_startOpening form tag. |
string |
$form_endClosing form tag. |
boolean |
$show_tabsShow tabs? |
array |
$labelsSome labels. |
boolean |
$show_prevnextShow prev- and next-button? |
|
Public Method Details |
Init |
public abstract void Init( )
|
|
Use this method to provide the structure of the assistant
The method gets called by the constructor.
|
Returns |
void |
|
get |
public abstract string get( )
|
|
Returns the current page
|
Returns |
string $html |
See Also |
show() |
|
show |
public string show( )
|
|
print, generate and return the current page
|
Returns |
string $html |
See Also |
get() |
|
isFinishPressed |
public bool isFinishPressed( )
|
|
Is the Button "Finish" pressed?
|
Returns |
bool $ok |
Throws |
form_error |
See Also |
isExitPressed(), isHelpPressed() |
|
isExitPressed |
public bool isExitPressed( )
|
|
Is the Button "Exit" pressed?
|
Returns |
bool $ok |
Throws |
form_error |
See Also |
isFinishPressed(), isHelpPressed() |
|
isHelpPressed |
public bool isHelpPressed( )
|
|
Is the Button "Help" pressed?
|
Returns |
bool $ok |
Throws |
form_error |
See Also |
isFinishPressed(), isExitPressed() |
|
setHelp |
public bool setHelp( array $data )
|
|
Set the label, name and comment text that belongs to the help button
|
Parameter |
|
|
Returns |
bool $ok |
Throws |
form_error |
See Also |
setExitButton() |
|
setExitButton |
public void setExitButton( string $label, string $name )
|
|
Set the laben and the name of the exit button
|
Parameter |
|
|
|
string |
$name |
|
|
name attribute |
|
Returns |
void |
Throws |
form_error |
See Also |
setHelp() |
|
showTabs |
public void showTabs( [ boolean $ok ] )
|
|
Generate tabs?
|
Parameter |
|
|
Returns |
void |
See Also |
$show_tabs |
|
setStart |
public bool setStart( string $html, [ string $method ] )
|
|
Sets the opening form tag.
|
Parameter |
|
|
|
string |
$method |
= >>"POST"<< |
|
|
|
Returns |
bool $ok |
Throws |
form_error |
See Also |
getStart(), Start(), $form_start |
|
getStart |
public string getStart( [ string $js_name, string $method, string $action, string $target, string $form_name ] )
|
|
Generates a <form>-Tag.
|
Parameter |
|
string |
$js_name |
= >>""<< |
|
Form name. |
|
|
string |
$method |
= >>"POST"<< |
|
method attribute: POST or GET. |
|
|
string |
$action |
= >>""<< |
|
action attribute |
|
|
string |
$target |
= >>""<< |
|
target attribute |
|
|
string |
$form_name |
= >>""<< |
|
|
|
Returns |
string HTML code |
See Also |
setStart(), getStart() |
|
setFinish |
public boolean setFinish( string $html )
|
|
Sets the closing HTML form tag.
|
Parameter |
|
|
Returns |
boolean |
See Also |
getFinish(), Finish(), $form_end |
|
getFinish |
public string getFinish( [ string $additional_html ] )
|
|
Generate closing </form>-Tag
|
Parameter |
|
string |
$additional_html |
= >>""<< |
|
= "" |
|
Returns |
string $html |
See Also |
setFinish(), Finish() |
|
Finish |
public string Finish( [ string $additional_html ] )
|
|
Generate, print and return the closing HTML form tag
|
Parameter |
|
string |
$additional_html |
= >>""<< |
|
= "" |
|
Returns |
string $html |
See Also |
setFinish(), getFinish() |
|
setLabels |
public bool setLabels( mixed $labels, [ string $value ] )
|
|
Set the label of a button.
|
Parameter |
|
|
|
|
Returns |
bool $ok |
Throws |
form_error |
See Also |
$labels |
|
|
Private Method Details |
restoreAssistant |
private abstract void restoreAssistant( )
|
|
Restores the Assistant. Load the pages with values, sets validation flags etc.
|
Returns |
void |
|
addPage |
private abstract void addPage( )
|
|
Adds a page to the assistant / tabbed pane
|
Returns |
void |
|
getResetButton |
private string getResetButton( string $label )
|
|
Returns a HTML reset button
|
Parameter |
|
|
Returns |
string $hmtl |
Throws |
form_error |
|
getButton |
private string getButton( string $label, string $value, [ string $name ] )
|
|
Returns a submit button.
|
Parameter |
|
|
|
|
|
|
Returns |
string $html |
|
getTab |
private array getTab( string $label, mixed $value, mixed $optional, mixed $error )
|
|
Generates a tab.
|
Parameter |
|
|
|
|
|
|
|
|
Returns |
array ( $tab, $bgcolor ) |
|
issetHTTPXVAR |
private boolean issetHTTPXVAR( string $varname, [ boolean $regexp ] )
|
|
Checks the existance of a HTTP_POST|GET_VARS.
|
Parameter |
|
string |
$varname |
|
|
name of the variable you're looking for.
The varibale must be scalar, arrays are not
supported |
|
|
boolean |
$regexp |
= >>false<< |
|
|
|
Returns |
boolean $ok |
Throws |
form_error |
See Also |
isHelpPressed(), isExitPressed(), isFinishPressed() |
|
setFinishButton |
private boolean setFinishButton( string $label, string $name )
|
|
Sets the label and name of a button that allows to exit the assistant as soon as all forms are valid.
|
Parameter |
|
|
|
string |
$name |
|
|
name attribute |
|
Returns |
boolean $ok |
Throws |
form_error |
See Also |
$finish_button |
|
setMethod |
private void setMethod( [ string $method ] )
|
|
Sets the method used by all pages
|
Parameter |
|
string |
$method |
= >>"POST"<< |
|
method: POST or GET. |
|
Returns |
void |
|
Start |
private void Start( [ string $js_name, string $method, string $action, string $target, string $form_name ] )
|
|
Generate, print and return the opening HTML form tag.
|
Parameter |
|
string |
$js_name |
= >>""<< |
|
Form name. |
|
|
string |
$method |
= >>"POST"<< |
|
method attribute: POST or GET. |
|
|
string |
$action |
= >>""<< |
|
action attribute |
|
|
string |
$target |
= >>""<< |
|
target attribute |
|
|
string |
$form_name |
= >>""<< |
|
|
|
Returns |
void |
See Also |
setStart(), getStart() |
|
arrayRegexpKeySearch |
private array arrayRegexpKeySearch( array $array, string $reg )
|
|
Scans the given array for a key that matches the given regexp.
|
Parameter |
|
|
|
|
Returns |
array $regs Matches |
|
getPageValues |
private void getPageValues( string $page_name )
|
|
Warning: documentation is missing.
|
Parameter |
|
string |
$page_name |
|
|
Warning: documentation is missing. |
|
Returns |
void |
|
getPageValuesWithTranslatedNames |
private void getPageValuesWithTranslatedNames( )
|
|
Warning: documentation is missing.
|
Returns |
void |
|
|
Public Field Details |
$classname |
public string $classname
>>"panemanager" <<
PHPLIB persistance helper, name of this class
|
|
$persistent_slots |
public array $persistent_slots
>>array("page_values") <<
PHPLIB persistance helper, list of persistant "slots"
|
|
|
Private Field Details |
$page_values |
private array $page_values
>>array() <<
Hash with form values of all pages
- must be restored by a session! -
|
|
$pages |
private array $pages
>>array() <<
Array of pages.
|
See Also |
addPage() |
|
$buttonname |
private string $buttonname
>>"panemanager" <<
Nameprefix of all buttons generated by assistant.
|
|
$finish_button |
private array $finish_button
>>array() <<
Label and name of a button that exits the assistant.
|
See Also |
setFinishButton(), isFinishPressed() |
|
$exit |
private array $exit
>>array() <<
Label and name of a exit button that always to abort the assistant
|
See Also |
setExitButton(), isExitPressed() |
|
$help |
private array $help
>>array() <<
Label, name and comment text that belongs to the help button.
|
See Also |
setHelp(), isHelpPressed() |
|
$method |
private string $method
>>"POST" <<
Method used in the forms.
|
See Also |
setMethod() |
|
$form_start |
private string $form_start
>>"" <<
Opening form tag.
|
See Also |
Start(), getStart(), setStart() |
|
$form_end |
private string $form_end
>>"" <<
Closing form tag.
|
See Also |
Finish(), getFinish(), setFinish() |
|
$show_tabs |
private boolean $show_tabs
>>true <<
Show tabs?
|
See Also |
showTabs() |
|
$labels |
private array $labels
>>array (
"next" => "",
"prev" => "",
"reset" => ""
) <<
Some labels.
|
See Also |
setLabels() |
|
$show_prevnext |
private boolean $show_prevnext
>>true <<
Show prev- and next-button?
|
|
|
|
|
PHPDoc 1.0beta |