pearweb
[ class tree: pearweb ] [ index: pearweb ] [ all elements ]

File: pear-format-html.php

Source Location: /pearweb-1.0.0RC1/include/pear-format-html.php

Classes:

BorderBox

Page Details:

Includes:

require_once('pear-manual.php') [line 47]
require_once('pear-cache.php') [line 33]

delim [line 947]

void delim( [ $color = false], [ $delimiter = ' | '])

Print a pipe delimiter


Parameters

   $color  
   $delimiter  
[ Top ]



display_user_notes [line 754]

void display_user_notes( $user, [ $width = '50%'])



Parameters

   $user  
   $width  
[ Top ]



draw_navigation [line 336]

void draw_navigation( $type, [ $menu_title = ''])



Parameters

   $type  
   $menu_title  
[ Top ]



error_handler [line 497]

void error_handler( $errobj, [string $title = 'Error'], string|array|PEAR_Error $in)

Generates a complete PEAR web page with an error message in it then calls exit

For use with PEAR_ERROR_CALLBACK error handling mode to print fatal errors and die.



Parameters

string|array|PEAR_Error   $in   see report_error() for more info
string   $title   string to be put above the message
   $errobj  
[ Top ]



extra_styles [line 23]

void extra_styles( [ $new = null])



Parameters

   $new  
[ Top ]



generate_captcha [line 1065]

string generate_captcha( )

Sets $_SESSION['captcha'] and $_SESSION['captcha_time'] then prints the XHTML that displays a CAPTCHA image and a form input element

Only generate a new $_SESSION['captcha'] if it doesn't exist yet. This avoids the problem of the CAPTCHA value being changed but the old image remaining in the browser's cache. This is necessary because caching can not be reliably disabled.

Use upper case letters to reduce confusion with some of these fonts. Input is passed through strtoupper() before comparison.

Don't use "I" or "O" to avoid confusion with numbers. Don't use digits because some of the fonts don't handle them.



[ Top ]



getURL [line 677]

string getURL( string $url)

Returns an absolute URL using Net_URL
  • Return: Full url


Parameters

string   $url   All/part of a url
[ Top ]



get_license_link [line 710]

string get_license_link( [string $license = ""])

Get URL to license text
  • Return: Link to license URL
  • Todo: Add more licenses here


Parameters

string   $license   Name of the license
[ Top ]



hdelim [line 958]

void hdelim( )

Prints a horizontal delimiter


[ Top ]



html_category_urhere [line 643]

void html_category_urhere( $id, [bool $link_lastest = false])

prints "urhere" menu bar

Top Level :: XML :: XML_RPC



Parameters

bool   $link_lastest   If the last category should or not be a link
   $id  
[ Top ]



localRedirect [line 693]

void localRedirect( string $url, [bool $keepProtocol = true])

Redirects to the given full or partial URL.

will turn the given url into an absolute url using the above getURL() function. This function does not return.



Parameters

string   $url   Full/partial url to redirect to
bool   $keepProtocol   Whether to keep the current protocol or to force HTTP
[ Top ]



make_bug_link [line 833]

void make_bug_link( $package, [ $type = 'list'], [ $linktext = ''])

Creates a link to the bug system


Parameters

   $package  
   $type  
   $linktext  
[ Top ]



make_image [line 904]

void make_image( $file, [ $alt = ''], [ $align = ''], [ $extras = ''], [ $dir = ''], [ $border = 0], [ $styles = ''])

Returns an IMG tag for a given file (relative to the images dir)


Parameters

   $file  
   $alt  
   $align  
   $extras  
   $dir  
   $border  
   $styles  
[ Top ]



make_link [line 812]

void make_link( $url, [ $linktext = ''], [ $target = ''], [ $extras = ''])

Returns a hyperlink to something


Parameters

   $url  
   $linktext  
   $target  
   $extras  
[ Top ]



make_mailto_link [line 862]

string make_mailto_link( string $email, [string $linktext = ''], [string $extras = ''])

Turns the provided email address into a "mailto:" hyperlink.

The link and link text are obfuscated by alternating Ord and Hex entities.

  • Return: the HTML hyperlink of an email address


Parameters

string   $email   the email address to make the link for
string   $linktext   a string for the visible part of the link. If not provided, the email address is used.
string   $extras   a string of extra attributes for the <a> element
[ Top ]



make_ticket_links [line 1145]

string make_ticket_links( string $text)

Turns bug/feature request numbers into hyperlinks

If the bug number is prefixed by the word "PHP," the link will go to bugs.php.net. Otherwise, the bug is considered a PEAR bug.

  • Return: the string with bug numbers hyperlinked


Parameters

string   $text   the text to check for bug numbers
[ Top ]



menu_link [line 411]

void menu_link( $text, $url)



Parameters

   $text  
   $url  
[ Top ]



print_image [line 938]

void print_image( $file, [ $alt = ''], [ $align = ''], [ $extras = ''], [ $dir = ''], [ $border = 0])

Prints an IMG tag for a given file


Parameters

   $file  
   $alt  
   $align  
   $extras  
   $dir  
   $border  
[ Top ]



print_link [line 825]

void print_link( $url, [ $linktext = ''], [ $target = ''], [ $extras = ''])

Echos a hyperlink to something


Parameters

   $url  
   $linktext  
   $target  
   $extras  
[ Top ]



print_package_navigation [line 997]

void print_package_navigation( int $pacid, string $name, string $action)

Prints a tabbed navigation bar for the various package pages.


Parameters

int   $pacid   the id number of the package being viewed
string   $name   the name of the package being viewed
string   $action   the indicator of the current page view
[ Top ]



print_tabbed_navigation [line 966]

void print_tabbed_navigation( $items)

Prints a tabbed navigation bar based on the parameter $items


Parameters

   $items  
[ Top ]



report_error [line 437]

bool report_error( string|array|PEAR_Error $in, [string $class = 'errors'], [string $head = 'ERROR:'])

Display errors or warnings as a

Here's what happens depending on $in:

  • string: value is printed
  • array: looped through and each value is printed. If array is empty, nothing is displayed. If a value contains a PEAR_Error object,
  • PEAR_Error: prints the value of getMessage() and getUserInfo() if DEVBOX is true, otherwise prints data from getMessage().

  • Return: true if errors were submitted, false if not


Parameters

string|array|PEAR_Error   $in   see long description
string   $class   name of the HTML class for the <div> tag. ("errors", "warnings")
string   $head   string to be put above the message
[ Top ]



report_success [line 512]

void report_success( string $in)

Displays success messages inside a <div>


Parameters

string   $in   the message to be displayed
[ Top ]



report_warning [line 478]

bool report_warning( string|array|PEAR_Error $in)

Forwards warnings to report_error()

For use with PEAR_ERROR_CALLBACK to get messages to be formatted as warnings rather than errors.

  • Return: true if errors were submitted, false if not
  • See: report_error()


Parameters

string|array|PEAR_Error   $in   see report_error() for more info
[ Top ]



resize_image [line 893]

void resize_image( $img, [ $width = 1], [ $height = 1])

Tags the output of make_image() and resize it manually


Parameters

   $img  
   $width  
   $height  
[ Top ]



response_footer [line 248]

void response_footer( [ $style = false])



Parameters

   $style  
[ Top ]



response_header [line 62]

void response_header( [string $title = 'The PHP Extension and Application Repository'], [string $style = false], [ $extraHeaders = ''])

Prints out the XHTML headers and top of the page.


Parameters

string   $title   a string to go into the header's <title>
string   $style  
   $extraHeaders  
[ Top ]



spacer [line 880]

void spacer( [ $width = 1], [ $height = 1], [ $align = ''], [ $extras = ''])

Prints an IMG tag for a sized spacer GIF


Parameters

   $width  
   $height  
   $align  
   $extras  
[ Top ]



user_link [line 789]

mixed user_link( string $handle, [bool $compact = false])

Create link to the account information page and to the user's wishlist
  • Return: False on error, otherwise string


Parameters

string   $handle   User's handle
bool   $compact   Should the wishlist link be skipped?
[ Top ]



validate_captcha [line 1114]

bool validate_captcha( [int $max_age = 300])

Check if the CAPTCHA value submitted by the user in

$_POST['captcha'] matches $_SESSION['captcha'] and that the submission was made within the allowed time frame of the CAPTCHA being generated

If the two values aen't the same or the length of time between CAPTCHA generation and form submission is too long, this function will unset() $_SESSION['captcha']. Unsetting it will cause generate_captcha() to come up with a new CAPTCHA value and image. This prevents brute force attacks.

Similarly, if the submission is correct $_SESSION['captcha'] is unset() in order to keep robots from making multiple requests with a correctly guessed CAPTCHA value.



Parameters

int   $max_age   the length of time in seconds since the CAPTCHA was generated during which a submission should be considered valid. Default is 300 seconds (aka 5 minutes).
[ Top ]



Documentation generated on Tue, 24 Oct 2006 21:32:25 -0400 by phpDocumentor 1.3.0. PEAR Logo Copyright © PHP Group 2004.