Class SimpleFrameset

Description

A composite page. Wraps a frameset page and adds subframes. The original page will be mostly ignored. Implements the SimplePage interface so as to be interchangeable.

Located in /libraries/pear/simpletest/frames.php (line 24)


	
			
Variable Summary
 mixed $_focus
 mixed $_frames
 mixed $_frameset
 mixed $_names
Method Summary
 SimpleFrameset SimpleFrameset (SimplePage &$page)
 void addFrame (SimplePage &$page, [string $name = false])
 void clearFrameFocus ()
 array getAbsoluteUrls ()
 string getAuthentication ()
 string/boolean getField (string $name)
 string/boolean getFieldById (string/integer $id)
 SimpleForm &getFormById (string $id)
 SimpleForm &getFormByImageLabel (string $label)
 array getFrameFocus ()
 array/string getFrames ()
 string getHeaders ()
 string getMethod ()
 string getMimeType ()
 string getRaw ()
 string getRealm ()
 array getRelativeUrls ()
 string getRequest ()
 mixed getRequestData ()
 integer getResponseCode ()
 string getTitle ()
 string getTransportError ()
 string getUrlById (string $id)
 array getUrlsByLabel (string $label)
 boolean hasFrames ()
 boolean setField (string $name, string $value)
 boolean setFieldById (string/integer $id, string $value)
 void setFrame (array $path, SimplePage &$page)
 boolean setFrameFocus (string $name)
 boolean setFrameFocusByIndex (integer $choice)
 SimpleForm &_findForm (string $method, string $attribute)
 SimpleForm &_findFormInFrame (SimplePage &$page, integer $index, string $method, string $attribute)
 integer/string _getPublicNameFromIndex (integer $subject)
 array _tagUrlsWithFrame (array $urls, string $frame)
Variables
mixed $_focus (line 27)
mixed $_frames (line 26)
mixed $_frameset (line 25)
mixed $_names (line 28)
Methods
Constructor SimpleFrameset (line 35)

Stashes the frameset page. Will make use of the browser to fetch the sub frames recursively.

SimpleFrameset SimpleFrameset (SimplePage &$page)
addFrame (line 48)

Adds a parsed page to the frameset.

  • access: public
void addFrame (SimplePage &$page, [string $name = false])
  • SimplePage $page: Frame page.
  • string $name: Name of frame in frameset.
clearFrameFocus (line 156)

Clears the frame focus.

  • access: public
void clearFrameFocus ()
getAbsoluteUrls (line 353)

Accessor for a list of all fixed links.

  • return: List of urls with scheme of http or https and hostname.
  • access: public
array getAbsoluteUrls ()
getAuthentication (line 294)

Accessor for last Authentication type. Only valid straight after a challenge (401).

  • return: Description of challenge type.
  • access: public
string getAuthentication ()
getField (line 627)

Accessor for a form element value within a frameset.

Finds the first match amongst the frames.

  • return: A string if the field is present, false if unchecked and null if missing.
  • access: public
string/boolean getField (string $name)
  • string $name: Field name.
getFieldById (line 646)

Accessor for a form element value within a page.

Finds the first match.

  • return: A string if the field is present, false if unchecked and null if missing.
  • access: public
string/boolean getFieldById (string/integer $id)
  • string/integer $id: Field ID attribute.
getFormById (line 531)

Finds a held form by the form ID. A way of

identifying a specific form when we have control of the HTML code. The first form found either within the focused frame, or across frames, will be the one returned.

  • return: Form object containing the matching ID.
  • access: public
SimpleForm &getFormById (string $id)
  • string $id: Form label.
getFormByImageId (line 517)

Finds a held form by image button id. Will only search correctly built forms. The first form found either within the focused frame, or across frames, will be the one returned.

  • return: Form object containing the image.
  • access: public
SimpleForm &getFormByImageId (string $id)
  • string $id: Image ID attribute.
getFormByImageLabel (line 491)

Finds a held form by image label. Will only search correctly built forms. The first form found either within the focused frame, or across frames, will be the one returned.

  • return: Form object containing the image.
  • access: public
SimpleForm &getFormByImageLabel (string $label)
  • string $label: Usually the alt attribute.
getFormByImageName (line 504)

Finds a held form by image button id. Will only search correctly built forms. The first form found either within the focused frame, or across frames, will be the one returned.

  • return: Form object containing the image.
  • access: public
SimpleForm &getFormByImageName (string $name)
  • string $name: Image name.
getFormBySubmitId (line 478)

Finds a held form by button id. Will only search correctly built forms. The first form found either within the focused frame, or across frames, will be the one returned.

  • return: Form object containing the button.
  • access: public
SimpleForm &getFormBySubmitId (string $id)
  • string $id: Button ID attribute.
getFormBySubmitLabel (line 452)

Finds a held form by button label. Will only search correctly built forms. The first form found either within the focused frame, or across frames, will be the one returned.

  • return: Form object containing the button.
  • access: public
SimpleForm &getFormBySubmitLabel (string $label)
  • string $label: Button label, default 'Submit'.
getFormBySubmitName (line 465)

Finds a held form by button label. Will only search correctly built forms. The first form found either within the focused frame, or across frames, will be the one returned.

  • return: Form object containing the button.
  • access: public
SimpleForm &getFormBySubmitName (string $name)
  • string $name: Button name attribute.
getFrameFocus (line 84)

Accessor for current frame focus. Will be false if no frame has focus. Will have the nested frame focus if any.

  • return: Labels or indexes of nested frames.
  • access: public
array getFrameFocus ()
getFrames (line 187)

Accessor for frames information.

  • return: Recursive hash of frame URL strings. The key is either a numerical index or the name attribute.
  • access: public
array/string getFrames ()
getHeaders (line 331)

Accessor for raw header information.

  • return: Header block.
  • access: public
string getHeaders ()
getMethod (line 230)

Request method used to fetch this frame.

  • return: GET, POST or HEAD.
  • access: public
string getMethod ()
getMimeType (line 269)

Accessor for current MIME type.

  • return: MIME type as string; e.g. 'text/html'
  • access: public
string getMimeType ()
getRaw (line 202)

Accessor for raw text of either all the pages or the frame in focus.

  • return: Raw unparsed content.
  • access: public
string getRaw ()
getRealm (line 307)

Accessor for last Authentication realm. Only valid straight after a challenge (401).

  • return: Name of security realm.
  • access: public
string getRealm ()
getRelativeUrls (line 369)

Accessor for a list of all relative links.

  • return: List of urls without hostname.
  • access: public
array getRelativeUrls ()
getRequest (line 319)

Accessor for outgoing header information.

  • return: Header block.
  • access: public
string getRequest ()
getRequestData (line 257)

Original request data.

  • return: Sent content.
  • access: public
mixed getRequestData ()
getResponseCode (line 281)

Accessor for last response code.

  • return: Last HTTP response code received.
  • access: public
integer getResponseCode ()
getTitle (line 343)

Accessor for parsed title.

  • return: Title or false if no title is present.
  • access: public
string getTitle ()
getTransportError (line 218)

Accessor for last error.

  • return: Error from last response.
  • access: public
string getTransportError ()
getUrl (line 242)

Original resource name.

  • return: Current url.
  • access: public
SimpleUrl getUrl ()
getUrlById (line 413)

Accessor for a URL by the id attribute. If in a frameset then the first link found with that ID attribute is returned only. Focus on a frame if you want one from a specific part of the frameset.

  • return: URL with that id.
  • access: public
string getUrlById (string $id)
  • string $id: Id attribute of link.
getUrlsByLabel (line 387)

Accessor for URLs by the link label. Label will match regardess of whitespace issues and case.

  • return: List of links with that label.
  • access: public
array getUrlsByLabel (string $label)
  • string $label: Text of link.
hasFrames (line 176)

Test for the presence of a frameset.

  • return: Always true.
  • access: public
boolean hasFrames ()
setField (line 590)

Sets a field on each form in which the field is available.

  • return: True if value is valid.
  • access: public
boolean setField (string $name, string $value)
  • string $name: Field name.
  • string $value: Value to set field to.
setFieldById (line 608)

Sets a field on the form in which the unique field is available.

  • return: True if value is valid.
  • access: public
boolean setFieldById (string/integer $id, string $value)
  • string/integer $id: Field ID attribute.
  • string $value: Value to set field to.
setFrame (line 63)

Replaces existing frame with another. If the frame is nested, then the call is passed down one level.

  • access: public
void setFrame (array $path, SimplePage &$page)
  • array $path: Path of frame in frameset.
  • SimplePage $page: Frame source.
setFrameFocus (line 139)

Sets the focus by name. If already focused and the target frame also has frames, then the nested frame will be focused.

  • return: True if frame exists.
  • access: public
boolean setFrameFocus (string $name)
  • string $name: Chosen frame.
setFrameFocusByIndex (line 118)

Sets the focus by index. The integer index starts from 1.

If already focused and the target frame also has frames, then the nested frame will be focused.

  • return: True if frame exists.
  • access: public
boolean setFrameFocusByIndex (integer $choice)
  • integer $choice: Chosen frame.
_clearNestedFramesFocus (line 165)

Clears the frame focus for any nested frames.

  • access: private
void _clearNestedFramesFocus ()
_findForm (line 543)

General form finder. Will search all the frames or just the one in focus.

  • return: Form object containing the matching ID.
  • access: private
SimpleForm &_findForm (string $method, string $attribute)
  • string $method: Method to use to find in a page.
  • string $attribute: Label, name or ID.
_findFormInFrame (line 574)

Finds a form in a page using a form finding method. Will also tag the form with the frame name it belongs in.

  • return: Form object containing the matching ID.
  • access: private
SimpleForm &_findFormInFrame (SimplePage &$page, integer $index, string $method, string $attribute)
  • SimplePage $page: Page content of frame.
  • integer $index: Internal frame representation.
  • string $method: Method to use to find in a page.
  • string $attribute: Label, name or ID.
_getPublicNameFromIndex (line 101)

Turns an internal array index into the frames list into a public name, or if none, then a one offset index.

  • return: Public name.
  • access: private
integer/string _getPublicNameFromIndex (integer $subject)
  • integer $subject: Internal index.
_tagUrlsWithFrame (line 432)

Attaches the intended frame index to a list of URLs.

  • return: List of tagged URLs.
  • access: private
array _tagUrlsWithFrame (array $urls, string $frame)
  • array $urls: List of SimpleUrls.
  • string $frame: Name of frame or index.

Documentation generated on Fri, 11 Feb 2005 18:13:15 +0000 by phpDocumentor 1.3.0RC3