phpMv -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
HtmlModal Class Reference

Twitter Bootstrap HTML Modal component. More...

+ Inheritance diagram for HtmlModal:

Public Member Functions

 __construct ($identifier, $title="", $content="", $buttonCaptions=array())
 
 addButton ($value="Okay", $style="btn-primary")
 Add a button.
 
 addCancelButton ($value="Annuler")
 Add a cancel button (dismiss)
 
 addOkayButton ($value="Okay", $jsCode="")
 Add an Okay button (close the box only if .valid===true)
 
 setValidCondition ($js)
 
 getValidCondition ()
 
 setValid ()
 
 setContent ($content)
 set the content of the modal
 
 setTitle ($title)
 set the title of the modal
 
 renderView (JsUtils $js, $initialController, $viewName, $params=array())
 render the content of an existing view : $controller/$action and set the response to the modal content
 
 forward (JsUtils $js, $initialControllerInstance, $controllerName, $actionName, $params=NULL)
 render the content of
 
 run (JsUtils $js)
 
 getButton ($index)
 
 showOnCreate ()
 
 jsShow ()
 
 jsHide ()
 
 jsGetContent (JsUtils $js, $url)
 
 jsSetTitle ($title)
 
 jsHideButton ($index)
 
 draggable ($value=true)
 Allow modal to be moved using the mouse, on the dialog title.
 
 setBackdrop ($value)
 Includes a modal-backdrop element.
 
- Public Member Functions inherited from BaseHtml
 getTagName ()
 
 setTagName ($tagName)
 
 fromArray ($array)
 
 fromDatabaseObjects ($objects, $function)
 
 fromDatabaseObject ($object, $function)
 
 wrap ($before, $after="")
 
 getElementById ($identifier, $elements)
 
 getBsComponent ()
 
 setBsComponent ($bsComponent)
 
 compile (JsUtils $js=NULL, &$view=NULL)
 
 setDraggable ($attr="id", $dropZone=null, $parameters=[])
 Sets the element draggable, and eventualy defines the dropzone (HTML5 drag and drop)
 
 asDropZone ($jsCallback="", $jqueryDone="append", $parameters=[])
 Declares the element as a drop zone (HTML5 drag and drop)
 
 asFileDropZone ($responseElement=null, $url=null, $progress=null, $jsCallback="", $parameters=[])
 Declares the element as a drop zone for file uploading (HTML5 drag and drop)
 
 __toString ()
 
 onPostCompile ($callback)
 
 onPreCompile ($callback)
 
- Public Member Functions inherited from BaseWidget
 __construct ($identifier)
 
 getIdentifier ()
 
 setIdentifier ($identifier)
 
 getLibraryId ()
 
 setLibraryId ($_libraryId)
 
- Public Member Functions inherited from BaseHtmlEventsTrait
 addEvent ($event, $jsCode, $stopPropagation=false, $preventDefault=false)
 
 trigger ($event, $params="[]")
 
 jsTrigger ($event, $params="[this]")
 
 _addEvent ($event, $jsCode)
 
 on ($event, $jsCode, $stopPropagation=false, $preventDefault=false)
 
 onClick ($jsCode, $stopPropagation=false, $preventDefault=true)
 
 setClick ($jsCode)
 
 onCreate ($jsCode)
 
 addEventsOnRun (JsUtils $js=NULL)
 
 _ajaxOn ($operation, $event, $url, $responseElement="", $parameters=array())
 
 getOn ($event, $url, $responseElement="", $parameters=array())
 Performs a get to $url on the event $event on $element and display it in $responseElement.
 
 getOnClick ($url, $responseElement="", $parameters=array())
 Performs a get to $url on the click event on $element and display it in $responseElement.
 
 postOn ($event, $url, $params="{}", $responseElement="", $parameters=array())
 Performs a post to $url on the event $event on $element and display it in $responseElement.
 
 postOnClick ($url, $params="{}", $responseElement="", $parameters=array())
 Performs a post to $url on the click event on $element and display it in $responseElement.
 
 postFormOn ($event, $url, $form, $responseElement="", $parameters=array())
 Performs a post form with ajax.
 
 postFormOnClick ($url, $form, $responseElement="", $parameters=array())
 Performs a post form with ajax on click.
 
 jsDoJquery ($jqueryCall, $param="")
 
 executeOnRun ($jsCode)
 
 jsHtml ($content="")
 
 jsToggle ($value)
 
 getEvents ()
 
- Public Member Functions inherited from BaseHtmlPropertiesTrait
 getProperties ()
 
 setProperties ($properties)
 
 setProperty ($name, $value)
 
 getProperty ($name)
 
 addToProperty ($name, $value, $separator=" ")
 
 addProperties ($properties)
 
 removePropertyValue ($name, $value)
 
 addToPropertyCtrl ($name, $value, $typeCtrl)
 
 addToPropertyCtrlCheck ($name, $value, $typeCtrl)
 
 removeProperty ($name)
 
 propertyContains ($propertyName, $value)
 

Protected Member Functions

 getDefaultValidCondition ()
 
- Protected Member Functions inherited from BaseHtml
 getTemplate (JsUtils $js=NULL, $view=null)
 
 ctrl ($name, $value, $typeCtrl)
 
 setMemberCtrl (&$name, $value, $typeCtrl)
 
 addToMemberUnique (&$name, $value, $typeCtrl, $separator=" ")
 
 addToMemberCtrl (&$name, $value, $typeCtrl, $separator=" ")
 
 addToMember (&$name, $value, $separator=' ')
 
 removeOldValues (&$oldValue, $allValues)
 
 _getElementBy ($callback, $elements)
 
 setWrapBefore ($wrapBefore)
 
 setWrapAfter ($wrapAfter)
 
 compile_once (JsUtils $js=NULL, &$view=NULL)
 
- Protected Member Functions inherited from BaseWidget
 cleanIdentifier ($id)
 
- Protected Member Functions inherited from BaseHtmlEventsTrait
 _eventsOnCreate (JsUtils $js=NULL)
 
- Protected Member Functions inherited from BaseHtmlPropertiesTrait
 removePropertyValues ($name, $values)
 
 addToPropertyUnique ($name, $value, $typeCtrl)
 
 setPropertyCtrl ($name, $value, $typeCtrl)
 
 getElementByPropertyValue ($propertyName, $value, $elements)
 

Protected Attributes

 $title ="HtmlModal Title"
 
 $content =""
 
 $buttons =array ()
 
 $showOnStartup =false
 
 $draggable =false
 
 $validCondition =NULL
 
 $backdrop =true
 
- Protected Attributes inherited from BaseHtml
 $_template
 
 $tagName
 
 $_wrapBefore = array()
 
 $_wrapAfter = array()
 
 $_bsComponent
 
 $_compiled = false
 
 $_runned = false
 
 $_postCompile
 
 $_preCompile
 
- Protected Attributes inherited from BaseWidget
 $identifier
 
 $_identifier
 
 $_libraryId
 
 $_self
 
- Protected Attributes inherited from BaseHtmlEventsTrait
 $_events =array ()
 
- Protected Attributes inherited from BaseHtmlPropertiesTrait
 $properties =array ()
 

Detailed Description

Twitter Bootstrap HTML Modal component.

Author
jc
Version
1.02

Definition at line 14 of file HtmlModal.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $identifier,
  $title = "",
  $content = "",
  $buttonCaptions = array() 
)
Parameters
string$identifierthe id

Definition at line 27 of file HtmlModal.php.

Member Function Documentation

◆ addButton()

addButton (   $value = "Okay",
  $style = "btn-primary" 
)

Add a button.

Parameters
string$valuethe button caption
string$styleone of "btn-default","btn-primary","btn-success","btn-info","btn-warning","btn-danger"
Returns
HtmlButton

Definition at line 44 of file HtmlModal.php.

◆ addCancelButton()

addCancelButton (   $value = "Annuler")

Add a cancel button (dismiss)

Parameters
string$value
Returns
HtmlButton

Definition at line 57 of file HtmlModal.php.

◆ addOkayButton()

addOkayButton (   $value = "Okay",
  $jsCode = "" 
)

Add an Okay button (close the box only if .valid===true)

Parameters
string$value
Returns
HtmlButton

Definition at line 68 of file HtmlModal.php.

◆ draggable()

draggable (   $value = true)

Allow modal to be moved using the mouse, on the dialog title.

needs JQuery UI

Parameters
boolean$value

Definition at line 190 of file HtmlModal.php.

◆ forward()

forward ( JsUtils  $js,
  $initialControllerInstance,
  $controllerName,
  $actionName,
  $params = NULL 
)

render the content of

$controller::$action and set the response to the modal content

Parameters
JsUtils$js
object$initialControllerInstance
string$controllerNamethe controller name
string$actionNamethe action name
array$params

Definition at line 129 of file HtmlModal.php.

◆ getButton()

getButton (   $index)

Definition at line 151 of file HtmlModal.php.

◆ getDefaultValidCondition()

getDefaultValidCondition ( )
protected

Definition at line 74 of file HtmlModal.php.

◆ getValidCondition()

getValidCondition ( )

Definition at line 82 of file HtmlModal.php.

◆ jsGetContent()

jsGetContent ( JsUtils  $js,
  $url 
)

Definition at line 171 of file HtmlModal.php.

◆ jsHide()

jsHide ( )

Reimplemented from BaseHtmlEventsTrait.

Definition at line 167 of file HtmlModal.php.

◆ jsHideButton()

jsHideButton (   $index)

Definition at line 179 of file HtmlModal.php.

◆ jsSetTitle()

jsSetTitle (   $title)

Definition at line 175 of file HtmlModal.php.

◆ jsShow()

jsShow ( )

Reimplemented from BaseHtmlEventsTrait.

Definition at line 163 of file HtmlModal.php.

◆ renderView()

renderView ( JsUtils  $js,
  $initialController,
  $viewName,
  $params = array() 
)

render the content of an existing view : $controller/$action and set the response to the modal content

Parameters
JsUtils$js
object$initialController
string$viewName
array$paramsThe parameters to pass to the view

Definition at line 117 of file HtmlModal.php.

◆ run()

run ( JsUtils  $js)
Parameters
JsUtils$js
Returns
SimpleExtComponent

Reimplemented from BaseHtml.

Definition at line 137 of file HtmlModal.php.

◆ setBackdrop()

setBackdrop (   $value)

Includes a modal-backdrop element.

Alternatively, specify static for a backdrop which doesn't close the modal on click.

Parameters
Boolean$valuedefault : true
Returns
HtmlModal

Definition at line 203 of file HtmlModal.php.

◆ setContent()

setContent (   $content)

set the content of the modal

Parameters
string$content

Definition at line 98 of file HtmlModal.php.

◆ setTitle()

setTitle (   $title)

set the title of the modal

Parameters
string$title

Definition at line 106 of file HtmlModal.php.

◆ setValid()

setValid ( )

Definition at line 90 of file HtmlModal.php.

◆ setValidCondition()

setValidCondition (   $js)

Definition at line 78 of file HtmlModal.php.

◆ showOnCreate()

showOnCreate ( )

Definition at line 158 of file HtmlModal.php.

Field Documentation

◆ $backdrop

$backdrop =true
protected

Definition at line 21 of file HtmlModal.php.

◆ $buttons

$buttons =array ()
protected

Definition at line 17 of file HtmlModal.php.

◆ $content

$content =""
protected

Definition at line 16 of file HtmlModal.php.

◆ $draggable

$draggable =false
protected

Definition at line 19 of file HtmlModal.php.

◆ $showOnStartup

$showOnStartup =false
protected

Definition at line 18 of file HtmlModal.php.

◆ $title

$title ="HtmlModal Title"
protected

Definition at line 15 of file HtmlModal.php.

◆ $validCondition

$validCondition =NULL
protected

Definition at line 20 of file HtmlModal.php.


The documentation for this class was generated from the following file: