Class AdminSkin

Description

change the looks of the user interface

This class provides 'skinned' navigation elements (icons) and styling. It is used within the AdminOutput class.

Note: We simply trust the caller to provide us with a valid filename in $icon and $knob (but without the .gif extension), see get_icon() and . This makes it a lot easier to generate the graphical icons and knobs: we simply prepend the appropriate path and append the extension .gif and there we go. The penalty for checking the actual file existence every time we generate an icon or knob is too expensive imho.

Located in /program/main_admin.php (line 1749)


	
			
Variable Summary
Method Summary
 void AdminSkin ([string $name = 'base'])
 string get_icon (string $icon, [string $title = ''], [string $alt = ''], [string $text = ''])
 string get_knob ( $knob, [string $title = ''], [string $alt = ''], string $icon, string $text)
 array get_stylesheets ()
 bool is_text_only ()
Variables
int $icon_height = 16 (line 1769)
  • var: $icon_width the vertical size of icons in this skin
string $icon_path (line 1763)
  • var: $icon_path holds the path to the graphical images used when creating icons and knobs
int $icon_width = 16 (line 1766)
  • var: $icon_width the horizontal size of icons in this skin
int $knob_height = 32 (line 1775)
  • var: $icon_width the vertical size of knobs in this skin
int $knob_width = 32 (line 1772)
  • var: $icon_width the horizontal size of knobs in this skin
string $name (line 1751)
  • var: $name holds the name of the selected skin
array $stylesheets = array() (line 1760)
  • var: $stylesheets contains 1 or more static stylesheets that define the skin's styling
bool $text_icons = FALSE (line 1757)
  • var: $text_icons if TRUE uses 'text' rather than 'alt' parameter for text-based icons
bool $text_only = FALSE (line 1754)
  • var: $text_only if TRUE limits generated icons and knobs to textual representation
Methods
Constructor AdminSkin (line 1782)

construct an AdminSkin object (called from AdminOutput)

void AdminSkin ([string $name = 'base'])
  • string $name: identifies the skin to setup
get_icon (line 1860)

return ready-to-use HTML-code for an anchor (to be used with an A-tag)

this routine can create three variations of an anchor for an icon:

  • graphical: this includes the file {$icon}.gif and the $title and $alt attributes
  • text with $text: this yields a text-based icon using the $text-parameter
  • text with $alt: this yields a text-based icon using the $alt-parameter
The distinction between the latter two is made via $this->text_icons.

  • return: ready to use HTML-code
string get_icon (string $icon, [string $title = ''], [string $alt = ''], [string $text = ''])
  • string $icon: identifies the image file (without the .gif extension)
  • string $title: attribute to add to graphical icon
  • string $alt: attribute to add to graphical icon OR text of icon
  • string $text: text of the icon if not graphical and not using alt text
get_knob (line 1900)

return ready-to-use HTML-code for an anchor to be used in the navigation bar

this routine can create two variations of an anchor for a knob in the navigation bar:

  • graphical: this includes the file {$icon}.gif and the $title and $alt attributes
  • text with $alt: this yields a text-based icon using the $alt-parameter
The difference with the routine get_icon() is that we do not have a variation with a separate $text parameter. Another difference is that the 'knobs' in the navigation bar have different dimensions than the icons used elsewhere. (Knobs usually are 32x32 and icons are usually 16x16).

  • return: ready to use HTML-code
string get_knob ( $knob, [string $title = ''], [string $alt = ''], string $icon, string $text)
  • string $icon: identifies the image file (without the .gif extension)
  • string $title: attribute to add to graphical icon
  • string $alt: attribute to add to graphical icon OR text of icon
  • string $text: text of the icon if not graphical and not using alt text
  • $knob
get_stylesheets (line 1840)

return the list of stylesheets associated with this skin

  • return: a list of stylesheets to include in the output for this skin
array get_stylesheets ()
is_text_only (line 1831)

is this skin a text-only skin?

  • return: TRUE if this skin is text-only (no graphical icons/knobs)
bool is_text_only ()

Documentation generated on Tue, 28 Jun 2016 19:10:26 +0200 by phpDocumentor 1.4.0