Source for file anchortablelist.php
Documentation is available at anchortablelist.php
* Anchor list similar to AnchorList, but this time in a table not dot points
* @author Stuart Prescott
* @copyright Copyright Stuart Prescott
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @subpackage FormsLibrary
* path (bumblebee root)/inc/formslib/anchortablelist.php
/** Load ancillary functions */
require_once 'inc/typeinfo.php';
/** anchorlist parent object */
require_once 'anchorlist.php';
require_once 'bbstring.php';
* Anchor list similar to AnchorList, but this time in a table not dot points
* @subpackage FormsLibrary
/** @var integer number of columns in the table*/
/** @var string html/css class for the header row of the table */
/** @var string html/css class for each row in the table */
/** @var string html/css class for left-side table cell */
/** @var string html/css class for right-side table cell */
/** @var string html/css class for anchors */
/** @var string html/css class for entire table */
/** @var array list of table headings to be put at the top of the table */
/** @var boolean make all columns in the table link to the target URL not just the first */
/** @var boolean controls the generation of header links to sort the table by */
/** @var string tells which header to sort by. null for default. This value will be
* superseeded by the sortby paramater in connectDB */
/** @var array data source from which the column to sort by will be read */
/** @var string key in $data in which the column name should be stored */
* Create a new AnchorTableList
* @param string $name the name of the field (db name, and html field name
* @param string $description used in the html title of the list
* @param integer $numcols (optional) number of columns in the table
} //end function AnchorTableList
* Accessor method to set the table column headings
* @param array new headings to use for the table
$this->tableHeadings =
$headings;
} //end function setTableHeadings
* Sets which heading to sort by
* @param boolean turn the sort by links on and off
* @param array data source to find which heading to sort by
* @param string (optional) the default heading to sort by
} //end function sortByHeadings
$aclass =
(isset
($this->aclass) ?
" class='$this->aclass'" :
'');
for ($i=
2; $i<=
$this->numcols; $i++
) {
$t =
"<table title='$this->description' $tableclass>\n";
if (isset
($this->tableHeadings)) {
foreach ($this->tableHeadings as $heading) {
if(type_is_a($heading, 'bbString')) {
$t .='<th>'.$heading->getExternalRep().
'</th>';
$t .= "<th>$heading</th>";
$aclass = (isset($this->aclass) ?
" class='{
$this->aclass}'
" : '');
foreach($this->tableHeadings as $heading) {
$text = type_is_a($heading, 'bbString')
? $heading->getExternalRep() :
$heading;
$sortby =
type_is_a($heading, 'bbString')
?
$heading->getInternalRep() :
$heading;
$href =
str_replace('__sortby__', $sortby, $this->sortByHref);
$t .=
"<th><a href='".
$href.
"' $aclass title='".T_('Sort by this column')."'>".$text.'</a></th>';
if (is_array($this->list->choicelist)) {
foreach ($this->list->choicelist as $v) {
} //end function display()
* overloading of ChoiceList's connectDB to allow for remembering the
function connectDB($table, $fields = '', $restriction = '', $order = 'name',
$idfield = 'id', $limit = '', $join = '', $distinct = false) {
parent::connectDB($table, $fields, $restriction, $order, $idfield, $limit,
} //end function connectDB
Documentation generated on Tue, 06 Mar 2007 10:00:32 +0000 by phpDocumentor 1.3.0