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

Class: common

Source Location: /common_class.php

Class Overview


Common class.


Methods



Class Details

[line 31]
Common class.

A common class containing functions used in various files.




[ Top ]


Class Methods


method calendar_to_uars_day [line 167]

integer calendar_to_uars_day( string $calendar)

Converts a calendar date string to UARS day.

This function takes a calendar date string and converts it to the UARS day. The date string has to be compatible with the PHP http://www.php.net/strtotime function.




Tags:

return:  The UARS day


Parameters:

string   $calendar   The calendar date string

[ Top ]

method coverage [line 65]

void coverage( &$day, string $str, day $day)

Prints out table cell for specific coverage.

The function prints out a table cell for a specific coverage type. It is used to quickly create the composition table based on the standardized naming convention.




Parameters:

day   $day   The reference to a uars_day object
string   $str   A part of the field name: cov_{$str}_{$suffix}
   &$day  

[ Top ]

method deflink [line 82]

void deflink( string $string, string $key)

Prints a definition link.

The function prints out a link which calls the JavaScript pop() routine. It is used to pop a definition for a data label, which is stored in a static JavaScript associative array.




Parameters:

string   $string   The link string
string   $key   The key into the JavaScript array of definitions

[ Top ]

method doy_to_timestamp [line 133]

void doy_to_timestamp( $doy)



Parameters:

   $doy  

[ Top ]

method doy_to_uars_day [line 115]

integer doy_to_uars_day( string $doy)

Converts Day of Year to UARS day.

This function takes the year and day of year in the format 'YYYY-DDD' and converts them to the UARS day.




Tags:

return:  The UARS day


Parameters:

string   $doy   The year and day of year in the 'YYYY-DDD' format

[ Top ]

method get_value [line 47]

string get_value( string $key, array $array1, [array $array2 = NULL])

Returns value for key in first or second array.

This function returns the value for a key from the first or from the second array. The first array will be looked at first, the second array will be looked at second. If the key exists for the array, its value will be returned. The value will be stripped of slashes, trimmed and any HTML special characters will be encoded. The second array is optional. If neither array contains the key, an empty string will be returned. This function works really well for getting the default value of an input field from either the $_POST array or the stored data.




Tags:

return:  The value for the key or an empty string


Parameters:

string   $key   The key to look up
array   $array1   The first array
array   $array2   The optional second array

[ Top ]

method human_size [line 96]

string human_size( integer $size, [integer $decimals = 1])

Returns the "human readable" form of a file size.

This function returns the "human readable" form of the size of a file. It is based on a function posted in the comments of the http://www.php.net/filesize function.




Tags:

return:  Size in "human readable" form


Parameters:

integer   $size   File size in bytes
integer   $decimals   Number of decimal places to use for rounding

[ Top ]

method offline [line 206]

TRUE|FALSE offline( )

Returns the run mode of the script.

This function detects and returns the run mode of the script. If the the script is being executed at the command line (offline), it returns TRUE. If the script is being accessed via HTTP (online), it returns FALSE.




Tags:

return:  TRUE if offline, FALSE if online.


[ Top ]

method print_select_options [line 188]

void print_select_options( mixed &$values, mixed $selected)

Print select dropdown options.

This is a helper function to print out HTML option tags for a select dropdown.




[ Top ]

method redirect [line 217]

void redirect( string $page)

Performs an HTTP header redirect.

This function performs an HTTP header redirect, taking the user to the specified page. The exit() is needed in order to make sure that the code below the redirect isn't executed, see http://www.php.net/header.




Parameters:

string   $page   The page to redirect to

[ Top ]

method timestamp_to_datetime [line 148]

void timestamp_to_datetime( $timestamp)



Parameters:

   $timestamp  

[ Top ]

method uars_day_to_timestamp [line 152]

void uars_day_to_timestamp( $uars_day)



Parameters:

   $uars_day  

[ Top ]


Documentation generated on Tue, 23 Jan 2007 22:57:43 -0500 by phpDocumentor 1.3.0RC6