'. $html.''; } /** * Render a small element. */ function small($html) { return ''.$html.''; } /** * Render an image tag. */ function image($src, $class='', $alt='') { return ''.$alt.''; } /** * A ThriftPage is a UI element that wraps up the rendering of the standard * boring stuff on the page. */ class ThriftPage { public function __construct($tab='home') { $this->tab = $tab; } public function open($title='') { return ' Apache Thrift'.($title ? ' | '.$title : '').'
'. $this->_header(). '
'. $this->_leftnav(). '
'; } protected function _header() { return '
'. alink(image('/thrift/static/apache-incubator-small.png', 'Apache'), 'http://incubator.apache.org/', 'apache'). '

'. alink(image('/thrift/static/thrift_mask.png', 'Thrift'), // 'Thrift', '/thrift/', 'logo'). small('Software minus logo.'). '

'. '
'; } protected function _leftnav() { $html = '
    '; $tabs = array('home' => 'Home', 'about' => 'About', 'mailing' => 'Mailing Lists', 'developers' => 'Developers', 'download' => 'Download', 'tutorial' => 'Tutorial'); foreach ($tabs as $key => $name) { $active = ($key == $this->tab); $url = ($key == 'home') ? '' : $key.'/'; $html .= '
  • '. alink($name.($active ? ' »' : ''), '/thrift/'.$url). '
  • '; } $html .= '
'; $ext = array('Thrift Wiki' => 'http://wiki.apache.org/thrift'); $html .= '
    '; foreach ($ext as $text => $url) { $html .= '
  • '.alink($text, $url).'
  • '; } $html .= '
'; $html .= '
'; return $html; } public function welcome($ps, $addl_html='') { $first = true; $html = '
'; foreach ($ps as $p) { $html .= ''.$p.'

'; $first = false; } $html .= $addl_html; $html .= '
'; return $html; } public function actionlink($html, $href) { return ''. '»'. alink($html, $href). ''; } public function close() { return '
'. // main '
'. // wrapper ''. '
'. // frame '
'. // iframe '
'. '
'. // oframe "\n\n".$this->analytics()."\n\n". ''; } protected function analytics() { return ' '; } }