Overview

Packages

  • Actions
  • Codegen
  • Controls
    • Base
  • DatabaseAdapters
  • Events
  • None
  • Sessions
  • Tests

Classes

  • BasicForm
  • CalculatorWidget
  • DataRepeaterExample
  • ExampleCheckColumn1
  • ExampleCheckColumn2
  • ExampleSingleForm
  • NestedTabForm
  • PaginatorForm
  • ParamsForm
  • PersistentExampleForm
  • PersonEditPanel
  • PluginEditForm
  • PluginManagerForm
  • ProjectEditPanel
  • ProjectListForm
  • ProjectViewPanel
  • QAccordion
  • QActionControl
  • QAutocomplete
  • QBlockControl
  • QButton
  • QButtonBase
  • QCalendar
  • QCheckBox
  • QCheckBoxLegacyColumn
  • QCheckBoxList
  • QControl
  • QControlBase
  • QControlGrouping
  • QControlLabel
  • QCsvTextBox
  • QDataGrid
  • QDataGrid_CheckBoxColumn
  • QDataGrid_SortEvent
  • QDataGridBase
  • QDataGridLegacy
  • QDataGridLegacyBase
  • QDataGridLegacyColumn
  • QDataGridLegacyRow
  • QDataGridLegacyRowStyle
  • QDataRepeater
  • QDatepicker
  • QDatepickerBox
  • QDateTimePicker
  • QDateTimeTextBox
  • QDialog
  • QDialogBox
  • QDraggable
  • QDroppable
  • QDropZoneGrouping
  • QEmailTextBox
  • QFileAsset
  • QFileAssetBase
  • QFileAssetDialog
  • QFileControl
  • QFilterType
  • QFloatTextBox
  • QFontFamily
  • QForm
  • QFormBase
  • QHListItem
  • QHtmlAttributeManager
  • QHtmlAttributeManagerBase
  • QHtmlTable
  • QHtmlTableBase
  • QImageBase
  • QImageBrowser
  • QImageBrowserBase
  • QImageBrowserNav
  • QImageBrowserThumbnails
  • QImageButton
  • QImageControl
  • QImageControlBase
  • QImageFileAsset
  • QImageLabel
  • QImageLabelBase
  • QImageRollover
  • QIntegerTextBox
  • QJqButton
  • QJqCheckBox
  • QJqRadioButton
  • QJsTimer
  • QJsTimerBase
  • QLabel
  • QLinkButton
  • QListBox
  • QListBoxBase
  • QListControl
  • QListItem
  • QListItemBase
  • QListItemStyle
  • QNumericTextBox
  • QPaginatedControl
  • QPaginator
  • QPaginatorBase
  • QPanel
  • QProgressbar
  • QRadioButton
  • QRadioButtonList
  • QResizable
  • QSampleControl
  • QSelectable
  • QSlider
  • QSortable
  • QTabs
  • QTagStyler
  • QTestControl
  • QTextBox
  • QTimerExpiredEvent
  • QTreeNav
  • QTreeNavItem
  • QUrlTextBox
  • QWaitIcon
  • QWriteBox
  • RecordsSummary
  • RefreshForm
  • SampleForm
  • SelectableLabel
  • SpeedForm
  • TestImageBrowser
  • UrlForm

Traits

  • QListItemManager

Exceptions

  • QCrossScriptingException

Functions

  • __QForm_EvaluateTemplate_ObHandler
  • DataGridEvalHandleError
  • Overview
  • Package
  • Class

Class QHtmlAttributeManagerBase

A base class for objects that manage html attributes. Uses array functions and defines a couple of arrays to manage the attributes. Values will be html escaped when printed.

Includes: - helper functions to manage the class, style, and data-* attributes specially. - helper functions to manage 'name-*' classes that are found in css frameworks like Bootstrap and Foundation. - helpers for __get and __set functions, partially for backwards compatibility and also to make the setting of some attributes and styles easier (so you don't have to remember how to set them).

Usage: Use the helper functions to setup your styles, classes, data-* and other attributes, then call renderHtmlAttributes() to render the attributes to insert them into a tag.

QBaseClass
Extended by QHtmlAttributeManagerBase

Direct known subclasses

QHtmlAttributeManager

Indirect known subclasses

CalculatorWidget, MyControl, QActionControl, QProgressbarBase, QProgressbarGen, QRadioButton, QRadioButtonList, QResizable, QResizableBase, QResizableGen, QSampleControl, QSelectable, QSelectableBase, QAutocomplete, QSelectableGen, QSelectMenu, QSelectMenuBase, QSelectMenuGen, QSlider, QSliderBase, QSliderGen, QSortable, QSortableBase, QSortableGen, QAutocompleteBase, QSpinner, QSpinnerBase, QSpinnerGen, QTabs, QTabsBase, QTabsGen, QTag, QTagStyler, QTestControl, QTextBox, QAutocompleteGen, QTextBoxBase, QTreeNav, QUrlTextBox, QWaitIcon, QWriteBox, RecordsSummary, SampleComposite, SelectableLabel, QBlockControl, QButton, QButtonBase, QCalendar, QCheckBox, QCheckBoxList, NavPanel, QControl, QControlBase, QControlLabel, QControlProxy, QCsvTextBox, QDataGrid, QDataGridBase, QDataGridLegacy, QDataGridLegacyBase, QDataGridLegacyRow, PersonEditPanel, QDataGridLegacyRowStyle, QDataRepeater, QDatepicker, QDatepickerBase, QDatepickerBox, QDatepickerBoxBase, QDatepickerBoxGen, QDatepickerGen, QDateTimePicker, QDateTimeTextBox, ProjectEditPanel, QDialog, QDialogBase, QDialogBox, QDialogGen, QDraggable, QDraggableBase, QDraggableGen, QDroppable, QDroppableBase, QDroppableGen, ProjectPickerListBox, QEmailTextBox, QFieldset, QFileAsset, QFileAssetBase, QFileAssetDialog, QFileControl, QFloatTextBox, QHListControl, QHtmlTable, QHtmlTableBase, ProjectViewPanel, QImageBase, QImageBrowser, QImageBrowserBase, QImageBrowserNav, QImageBrowserThumbnails, QImageButton, QImageControl, QImageControlBase, QImageFileAsset, QImageLabel, QAccordion, QImageLabelBase, QImageRollover, QIntegerTextBox, QJqButton, QJqButtonBase, QJqButtonGen, QJqCheckBox, QJqCheckBoxBase, QJqCheckBoxGen, QJqRadioButton, QAccordionBase, QJqRadioButtonBase, QJqRadioButtonGen, QJsTimer, QJsTimerBase, QLabel, QLinkButton, QListBox, QListBoxBase, QListControl, QListItemStyle, QAccordionGen, QMenu, QMenuBase, QMenuGen, QModelConnectorEditDlg, QNumericTextBox, QPaginatedControl, QPaginator, QPaginatorBase, QPanel, QProgressbar
Package: Controls
Located at includes/base_controls/QHtmlAttributeManagerBase.class.php
Methods summary
public boolean
# SetHtmlAttribute( $strName, $strValue )

Sets the given html attribute to the given value.

Sets the given html attribute to the given value.

Parameters

$strName
$strValue

Returns

boolean
true if the attribute changed value
public
# RemoveHtmlAttribute( $strName )

Removes the given html attribute.

Removes the given html attribute.

Parameters

$strName
public null
# GetHtmlAttribute( $strName )

Gets the Html Attribute, or return null if it does not exist.

Gets the Html Attribute, or return null if it does not exist.

Parameters

$strName

Returns

null
public array
# GetHtmlAttributes( array|null $attributeOverrides = null, array|null $styleOverrides = null, array|null $selection = null )

Returns an attribute array, with styles rendered.

Returns an attribute array, with styles rendered.

Parameters

$attributeOverrides
$styleOverrides
$selection
an array of titles of attributes that you want the result to be limited to

Returns

array
public boolean
# HasHtmlAttribute( string $strName )

Returns true if the given attribute is set.

Returns true if the given attribute is set.

Parameters

$strName

Returns

boolean
public
# SetDataAttribute( $strName, $strValue )

Sets the given value as an html "data-*" attribute. The named value will be retrievable in jQuery by using '.data("$strName");'

Sets the given value as an html "data-*" attribute. The named value will be retrievable in jQuery by using '.data("$strName");'

Note: Data name cases are handled specially in jQuery. Names are supposed to only be lower case. jQuery converts dashed notation to camelCase.

For example, if your html looks like this:

You would get that value in jQuery by doing:

$j('#test1').data('testCase');

Conversion to special html data-* name formatting is handled here automatically. So if you SetDataAttribute('testCase') here, you can get it using .data('testCase') in jQuery

Parameters

$strName
$strValue
public null
# GetDataAttribute( $strName )

Gets the data-* attribute value that was set previously in PHP.

Gets the data-* attribute value that was set previously in PHP.

Does NOT call into javascript to return a value that was set on the browser side. You need to use another mechanism to retrieve that.

Parameters

$strName

Returns

null
public
# RemoveDataAttribute( $strName )

Removes the given data attribute.

Removes the given data attribute.

Parameters

$strName
public boolean
# SetCssStyle( string $strName, string $strValue, boolean $blnIsLength = false )

Sets the Css named value to the given property.

Sets the Css named value to the given property.

If blnIsLength is true, we assume the value is a unit length specifier, and so send it to the QHtml helper function, which has the ability to perform arithmetic operations on the old value.

Will set the value of the parent classes blnModified value if something changes.

Parameters

$strName
$strValue
$blnIsLength
true if this is a unit specifier e.g. 2px

Returns

boolean
true if the style was actually changed (vs. it was already set that way)
public boolean
# RemoveCssStyle( $strName )

Removes the given CSS style property.

Removes the given CSS style property.

Parameters

$strName

Returns

boolean
true if the style was removed, false if it wasn't there to begin with
public boolean
# HasCssStyle( $strName )

Return true if the CSS style has been set.

Return true if the CSS style has been set.

Parameters

$strName

Returns

boolean
public string|null
# GetCssStyle( $strName )

Retrieves the given CSS style property value.

Retrieves the given CSS style property value.

Parameters

$strName

Returns

string|null
public
# SetCssBoxValue( string $strPrefix, string|array $mixValue )

Sets a box style, like margin or padding. Can accept: - string, which will pass the string verbatim to the shortcut prefix (e.g. margin: 0px 1px) - array, which can accept two styles: - [top, right, bottom, left], or - ['top'=>top, 'bottom'=>bottom, etc.]

Sets a box style, like margin or padding. Can accept: - string, which will pass the string verbatim to the shortcut prefix (e.g. margin: 0px 1px) - array, which can accept two styles: - [top, right, bottom, left], or - ['top'=>top, 'bottom'=>bottom, etc.]

When passing an array, missing items or null items will be ignored. Also, you can use arithmetic operations to change the current value (provided you set a previous value).

For example: $obj->setCssBoxStyle ('padding', ['right'=>3]); $obj->setCssBoxStyle ('padding', ['right'=>'*4']); Will set the padding-right to 12.

Parameters

$strPrefix
$mixValue
public
# SetCssClass( $strNewClass )

Sets the CSS class to the given value(s). Multiple class names can be separated with a space. If you preceed the class names with a plus(+) they will be added to the current class. If a minus (-) they will be removed.

Sets the CSS class to the given value(s). Multiple class names can be separated with a space. If you preceed the class names with a plus(+) they will be added to the current class. If a minus (-) they will be removed.

Parameters

$strNewClass
public boolean
# AddCssClass( string $strNewClass )

Adds a css class name to the 'class' property. Prevents duplication.

Adds a css class name to the 'class' property. Prevents duplication.

Parameters

$strNewClass

Returns

boolean
true if the class was not already attached.
public
# RemoveCssClass( string $strCssClass )

This will remove a css class name from the 'class' property (if it exists).

This will remove a css class name from the 'class' property (if it exists).

Parameters

$strCssClass
public
# RemoveCssClassesByPrefix( string $strPrefix )

Many CSS frameworks use families of classes, which are built up from a base family name. For example, Bootstrap uses 'col-lg-6' to represent a column that is 6 units wide on large screens and Foundation uses 'large-6' to do the same thing. This utility removes classes that start with a particular prefix to remove whatever sizing class was specified.

Many CSS frameworks use families of classes, which are built up from a base family name. For example, Bootstrap uses 'col-lg-6' to represent a column that is 6 units wide on large screens and Foundation uses 'large-6' to do the same thing. This utility removes classes that start with a particular prefix to remove whatever sizing class was specified.

Parameters

$strPrefix
public boolean
# HasCssClass( $strClass )

Return true if the given class is in the attribute list.

Return true if the given class is in the attribute list.

Parameters

$strClass

Returns

boolean
protected
# Override( QHtmlAttributeManager $objNewStyles )

Permanently overrides the current styles with a new set of attributes and styles.

Permanently overrides the current styles with a new set of attributes and styles.

Parameters

$objNewStyles
public
# MarkAsModified( )

Mark the parent class as modified. The host class must implement this if this functionality is desired.

Mark the parent class as modified. The host class must implement this if this functionality is desired.

public string
# RenderHtmlAttributes( null|string $attributeOverrides = null, null|string $styleOverrides = null )

Returns the html for the attributes. Allows the given arrays to override the attributes and styles before rendering.

Returns the html for the attributes. Allows the given arrays to override the attributes and styles before rendering.

Parameters

$attributeOverrides
$styleOverrides

Returns

string
public string
# RenderCssStyles( null|string $styleOverrides = null )

Returns the styles rendered as a css style string.

Returns the styles rendered as a css style string.

Parameters

$styleOverrides

Returns

string
protected string
# RenderTag( $strTag, null|array $attributeOverrides = null, null|array $styleOverrides = null, null|string $strInnerHtml = null, boolean $blnIsVoidElement = false, $blnNoSpace = false )

Helper function to render the current attributes and styles in a tag. Overrides will be merged in with current values before creating the output, but they will not affect the current values.

Helper function to render the current attributes and styles in a tag. Overrides will be merged in with current values before creating the output, but they will not affect the current values.

Parameters

$strTag
$attributeOverrides
key/value pairs of values for attribute overrides
$styleOverrides
key/value pairs of values for style overrides
$strInnerHtml
inner html to render. Will NOT be escaped.
$blnIsVoidElement
true if it should not have innerHtml or a closing tag.
$blnNoSpace

Returns

string
HTML out. Attributes will be escaped as needed, but innerHtml will be raw, so be careful.
public mixed
# __get( string $strName )

PHP magic method.

PHP magic method.

The attributes include general attributes that span across most kinds of QControls. Attributes that are specific to a particular kind of tag might appear just in that control's definition.

Parameters

$strName

Returns

mixed

Throws

Exception|QCallerException

Overrides

QBaseClass::__get()
public mixed
# __set( string $strName, string $mixValue )

PHP magic method

PHP magic method

Parameters

$strName
$mixValue

Returns

mixed

Throws

Exception|QCallerException|QInvalidCastException

Overrides

QBaseClass::__set()
Methods inherited from QBaseClass
OverrideAttributes(), __call()
Properties summary
protected array $attributes

attributes stored in PHP native format so they can be retrieved. Escaping happens when they are drawn.

attributes stored in PHP native format so they can be retrieved. Escaping happens when they are drawn.

# array()
protected array $styles
# array()
Magic properties summary
public string $AccessKey

allows you to specify what Alt-Letter combination will automatically focus that control on the form

public string $BackColor

sets the CSS background-color of the control

public string $BorderColor

sets the CSS border-color of the control

public string $BorderWidth

sets the CSS border-width of the control

public string $BorderStyle

is used to set CSS border-style by QBorderStyle

public string $BorderCollapse

defines the BorderCollapse css style for a table

public string $CssClass

sets or returns the CSS class for this control. When setting, if you precede the class name with a plus sign (+), it will add the class(es) to the currently existing classes, rather than replace them. Can add or set more than one class at once by separating names with a space.

public string $Cursor

is used to set CSS cursor property by QCursor

public boolean $Display

shows or hides the control using the CSS display property. In either case, the control is still rendered on the page. See the Visible property if you wish to not render a control.

public string $DisplayStyle

is used to set CSS display property by QDisplayStyle

public boolean $Enabled

specifies whether or not this is enabled (it will grey out the control and make it inoperable if set to true)

public boolean $FontBold

sets the font bold or normal

public boolean $FontItalic

sets the Font italic or normal

public string $FontNames

sets the name of used fonts

public boolean $FontOverline
public string $FontSize

sets the font-size of the control

public boolean $FontStrikeout
public boolean $FontUnderline

sets the font underlined

public string $ForeColor

sets the CSS color property, which controls text color

public string $Height
public string $Left

CSS left property

public integer $Opacity

sets the opacity of the control (0-100)

public string $Overflow

is used to set CSS overflow property by QOverflow

public string $Position

is used to set CSS position property by QPosition

public integer $TabIndex

specifies the index/tab order on a form

public string $ToolTip

specifies the text to be displayed when the mouse is hovering over the control

public string $Top
public string $Width
public string $HorizontalAlign

sets the CSS text-align property

public string $VerticalAlign

sets the CSS vertical-align property

public boolean $NoWrap

sets the CSS white-space property to nowrap

public boolean $ReadOnly

is the "readonly" html attribute (making a textbox "ReadOnly" is similar to setting the textbox to Enabled Readonly textboxes are selectedable, and their values get posted. Disabled textboxes are not selectable and values do not post.

public string $AltText

text used for 'alt' attribute in images

public string $OrderedListType

type for ordered lists. Expects a QOrderedListType.

public string $UnorderedListStyle

style for unordered lists. Expects a QUnorderedListType.

public write-only mixed $Padding

sets the CSS padding property. Will accepts a string, which is passed verbatim, or an array, either numerically indexed, in which case it is in top, right, bottom, left order, or keyed with the names 'top', 'right', 'bottom', 'left'.

public write-only mixed $Margin

sets the CSS margin property. Will accepts a string, which is passed verbatim, or an array, either numerically indexed, in which case it is in top, right, bottom, left order, or keyed with the names 'top', 'right', 'bottom', 'left'

public write-only array $Data

a key/value array of data-* items to set. Keys can be in camelCase notation, in which case they will be converted to dashed notation. Use GetDataAttribute() to retrieve the value of a data attribute.

API documentation generated by ApiGen