Docs For Class PageWidget

## Class PageWidget

Description

This class is used to build content for an entire page. It uses the HTMLPageClass widget from phphtmllib to render the final output.

- author: Walter A. Boring IV <waboring@newsblob.com>

Located in /widgets/PageWidget.inc (line 34)

    HTMLPageClass
       |
       --PageWidget

Direct descendents

Class | Description
--- | ---
| This class is used to build content for an entire page. It uses the HTMLPageClass widget from phphtmllib to render the final output.
PermissionsCheckTestPage | This class is used to build content for an entire page. It uses the HTMLPageClass widget from phphtmllib to render the final output.
WidgetListPage | This class is used to build content for an entire page. It uses the HTMLPageClass widget from phphtmllib to render the final output.

Variable Summary
mixed $_allow_permissions_checks
mixed $_enable_debug
mixed $_permissions_error_width
mixed $_permission_box
mixed $_perm_options
mixed $_title_text
Method Summary
PageWidget PageWidget (mixed $title, [string $render_type = HTML], [int $indent_style = INDENT_NICE])
void allow_permissions_checks ([boolean $flag = true])
mixed. body_content ()
void enable_debug ([boolean $flag = TRUE])
void frameset ()
string get_title ()
mixed. head_content ()
string head_javascript ()
boolean permission ()
string render ()
void set_permissions_message ([string $message = NULL], [string $url = NULL])
none _build_permission_box ()
void _check_permissions ()
boolean _has_permission ()
void _set_perms (boolean $flag)
Variables
mixed $_allow_permissions_checks = FALSE (line 73)

This is to enable/disable the permissions checking.

By default it is off.

mixed $_enable_debug = FALSE (line 44)

This enables the ability to view the source of a page bu setting debug=1 in the query string.

mixed $_permissions_error_width = "50%" (line 80)

The width of the permissions dialog table.

mixed $_permission_box = NULL (line 66)

the message box for displaying

permissions errors

mixed $_perm_options = array("allowed" => TRUE,
"message" => "You are not allowed to view this page.",
"url" => NULL) (line 58)

Does the user have permission

to build and view the content?

mixed $_title_text = NULL (line 52)

holds the page title text for

a page

#### Inherited Variables

Inherited from HTMLPageClass

> HTMLPageClass::$_favicon
> HTMLPageClass::$_html_attributes
> HTMLPageClass::$_html_render_type
> HTMLPageClass::$_indent_style
> HTMLPageClass::$_widget_css_auto
> HTMLPageClass::$_widget_js_auto
> HTMLPageClass::$_xml_encoding

Methods
Constructor PageWidget (line 107)

Constructor:

PageWidget PageWidget (mixed $title, [string $render_type = HTML], [int $indent_style = INDENT_NICE])

- mixed $title: - $title Title string or TITLEtag object for the page.
- string $render_type: - one of 3 types of html to render. Setting this will make the object declare the gobal define which tells all of the tag objects what type of html tags to render. some tags support special features. such as the <IMG> tag. If xhtml is selected, the the IMGtag object and all utility functions will not render "border=0" as a default attribute, since this is not proper xhtml. "html" - HTML 4.0 (default) "xhtml_transitional" - render xhtml instead of html
  - doctype is XHTML transitional.
  "xhtml_strict" - render xhtml instead of html 4.0.
  - doctype is XHTML strict.
- int $indent_style: - one of 2 types. INDENT_NICE or INDENT_LEFT_JUSTIFY This tells the page how to render the indenting of the output. By default it is set to INDENT_NICE, which nicely indents each nested tag. You can have all tags rendered left justified (smaller size in output) by using INDENT_LEFT_JUSTIFY

allow_permissions_checks (line 283)

This method is used to enable or disable the built in permissions checking mechanism.

void allow_permissions_checks ([boolean $flag = true])

- boolean $flag: TRUE = enable permissions checks

body_content (line 179)

This function is meant to be overridden by the child class.

This provides all of the content for the page. NOTE: You add the content to the body in 1 of 2 ways. 1) return the content from this call. 2) inside the call, you can just call $this->add(); and then return NULL;

mixed. body_content ()

Redefined in descendants as:

- MyLayoutPage::body_content() : This builds the main content for the page.
- PermissionsCheckTestPage::body_content() : This will only get called if we have permissions to build and render the content for this page object.
- WidgetListPage::body_content() : This will only get called if we have permissions to build and render the content for this page object.

enable_debug (line 213)

This sets the debug option for the HTMLPageClass

void enable_debug ([boolean $flag = TRUE])

- boolean $flag: TRUE for on, FALSE for off

frameset (line 190)

This function is used to save

a frameset to the page. This will automatically output a properly formatted

void frameset ()
get_title (line 138)

gets the current title of the page.

string get_title ()
head_content (line 159)

This function is used to build addition head content that isn't built by the HTMLPageClass parent class by default.

NOTE: you can add addition content to the head in 1 of 2 ways. 1) inside the call return the addition content in the return $foo; 2) or use the HTMLPageClass' $this->add_head_content() from within the head_content() call.

mixed. head_content ()
head_javascript (line 202)

This function is called to build any JavaScript that is needed in the <HEAD> portion of a document.

- return: - the raw JS code to be put inside the <head>

string head_javascript ()
permission (line 315)

This is meant to be extended by the child class to do any generic permissions checking for access to the content that the child builds

- return: - TRUE = has permissions to build and view content.

boolean permission ()

Redefined in descendants as:

- PermissionsCheckTestPage::permission() : This method is called during constructor time to check to make sure the page is allowed to build and render any content.

render (line 224)

This is the function that renders the HTML for this widget.

- return: - the HTML

string render ()

Redefinition of:

HTMLPageClass::render()
  render the page.

set_permissions_message (line 355)

This is used to set the various options for displaying the failed permissions box. This should be called prior to returning false in the permissions() method

void set_permissions_message ([string $message = NULL], [string $url = NULL])

- string $message: - the permissions message NOTE: NULL message means use the default.
- string $url: - the url where to go to. NOTE: if NULL, then there will be no button shown

_build_permission_box (line 372)

This is the method used to build the object to display the permissions error.

By default it uses either the MessageBoxWidget or the MessageBoxOK widget which both rely on having the InfoTable object's css included in the page.

none _build_permission_box ()
_check_permissions (line 296)

This method allows all PageWidget children to do any kind of permissions checking before any content methods are called.

This allows for a very secure method of building and rendering the page content.

void _check_permissions ()
_has_permission (line 334)

do we have permissions to build/view the content?

boolean _has_permission ()
_set_perms (line 325)

set the value of the permissions

void _set_perms (boolean $flag)

- boolean $flag: - TRUE = has permission

#### Inherited Methods

Inherited From HTMLPageClass

> HTMLPageClass::HTMLPageClass()
> HTMLPageClass::add()
> HTMLPageClass::add_css_link()
> HTMLPageClass::add_head_content()
> HTMLPageClass::add_head_css()
> HTMLPageClass::add_head_js()
> HTMLPageClass::add_js_link()
> HTMLPageClass::add_reference()
> HTMLPageClass::build_doctype()
> HTMLPageClass::get_html_attributes()
> HTMLPageClass::push()
> HTMLPageClass::push_css_link()
> HTMLPageClass::push_head_content()
> HTMLPageClass::push_head_js()
> HTMLPageClass::push_js_link()
> HTMLPageClass::push_reference()
> HTMLPageClass::render()
> HTMLPageClass::set_body_attributes()
> HTMLPageClass::set_charset()
> HTMLPageClass::set_encoding()
> HTMLPageClass::set_favicon()
> HTMLPageClass::set_favicon_flag()
> HTMLPageClass::set_frameset()
> HTMLPageClass::set_html_attributes()
> HTMLPageClass::set_language()
> HTMLPageClass::set_refresh()
> HTMLPageClass::set_text_debug()
> HTMLPageClass::set_title()
> HTMLPageClass::_build_content_type_tag()
> HTMLPageClass::_build_head()
> HTMLPageClass::_create_body()
> HTMLPageClass::_frameset_wrap_body()

Documentation generated on Thu, 1 Sep 2005 17:06:08 -0700 by phpDocumentor 1.3.0RC3