| // +--------------------------------------------------------------------+ // // $Id$ // // +X2C includes require_once 'BIFE/Generic.php'; // ~X2C // +X2C Class 110 :Link /** * Link to another page. * * @access public */ class BIFE_Link extends BIFE_Generic { // ~X2C // +X2C Operation 111 /** * Constructor. * * @param array $attrs Attributes. * * @return void * @access public */ function BIFE_Link($attrs) // ~X2C { $this->__construct($attrs); } // -X2C // +X2C Operation 112 /** * Constructor. * * @param array $attrs Attributes. * * @return void * @access public */ function __construct($attrs) // ~X2C { $link_attrs['URL'] = @$attrs['URL']; unset($attrs['URL']); $link_attrs['DESC'] = @$attrs['DESC']; unset($attrs['DESC']); if (isset($attrs['BIFE'])) { $link_attrs['BIFE'] = $attrs['BIFE']; $attrs['DATA-BIFE'] = $attrs['BIFE']; unset($attrs['BIFE']); } $query = array(); foreach($attrs as $name => $value) { if (substr($name, 0, 5) === 'DATA-') { if ($name = substr($name, 5)) { $query[] = urlencode($name) . '=' . urlencode($value); } } } if ($query) { $link_attrs['URL'] .= '?' . join('&', $query); } parent::__construct($link_attrs); } // -X2C // +X2C Operation 142 /** * Gets a URL string based on Link attributes. * * @param array $attrs Link attributes. * * @return string * @access public */ function getURL($attrs) // ~X2C { $url = @$attrs['URL']; unset($attrs['URL']); if (isset($attrs['BIFE'])) { $attrs['DATA-BIFE'] = $attrs['BIFE']; unset($attrs['BIFE']); } $query = array(); foreach($attrs as $name => $value) { if (substr($name, 0, 5) === 'DATA-') { if ($name = substr($name, 5)) { $query[] = urlencode($name) . '=' . urlencode($value); } } } if ($query) { $url .= '?' . join('&', $query); } return $url; } // -X2C } // -X2C Class :Link ?>