* @copyright 2004 by http://wombat.exit0.net * @package wombatSite * @subpackage contentFetcher */ /** * content fetcher: Link * * @version 1.0.0 * @package wombatSite * @subpackage contentFetcher */ class wbContentFetcher_Link { /** * fetch content * * Parameter: * -protocol * -url (/ are replaced with |) * -title * * @access public * @param string $param parameter * @return boolean $result true on success */ function fetchHtml( $param ) { list( $protocol, $url, $title ) = explode( '/', $param ); $url = str_replace( '|', '/', $url ); $format = '%s'; $target = ''; switch( $protocol ) { case 'page'; $sess =& wbFactory::singleton( 'patSession' ); $self = $_SERVER['PHP_SELF'] . '?' . $sess->getQueryString(); $url = $self . '&page=' . $url; break; case 'path'; $sess =& wbFactory::singleton( 'patSession' ); $self = $_SERVER['PHP_SELF'] . '?' . $sess->getQueryString(); $url = $self . '&path=' . $url; break; default: $url = $protocol . '://' . $url; $target = 'target="_blank"'; break; } $html = sprintf( $format, $url, $target, $title, $title ); return $html; } } ?>