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

Source for file Documentation.php

Documentation is available at Documentation.php

  1. <?php
  2.  
  3. /*
  4.   +----------------------------------------------------------------------+
  5.   | PHP Version 4                                                        |
  6.   +----------------------------------------------------------------------+
  7.   | Copyright (c) 1997-2003 The PHP Group                                |
  8.   +----------------------------------------------------------------------+
  9.   | This source file is subject to version 2.02 of the PHP license,      |
  10.   | that is bundled with this package in the file LICENSE, and is        |
  11.   | available at through the world-wide-web at                           |
  12.   | http://www.php.net/license/2_02.txt.                                 |
  13.   | If you did not receive a copy of the PHP license and are unable to   |
  14.   | obtain it through the world-wide-web, please send a note to          |
  15.   | license@php.net so we can mail you a copy immediately.               |
  16.   +----------------------------------------------------------------------+
  17.   | Author: Alan Knowles <alan@akbkhome.com>                             |
  18.   +----------------------------------------------------------------------+
  19.  
  20.   $Id: Documentation.php,v 1.3 2003/01/04 11:55:55 mj Exp $
  21. */
  22.  
  23. /**
  24.  * Gtk Frontend Documentation -This class deals with the browsing and downloading? the documentation.
  25.  * 
  26.  * #TODO : ..
  27.  *
  28.  * @author Alan Knowles <alan@akbkhome.com>
  29.  */
  30. require_once "PEAR/Frontend/Gtk/WidgetHTML.php";
  31.  
  32.  
  33. class PEAR_Frontend_Gtk_Documentation {
  34.     /**
  35.     * The Main User interface object
  36.     * @var object PEAR_Frontend_Gtk 
  37.     */
  38.     var $ui// main interface
  39.     
  40.     /*
  41.     * Gtk Installer Constructor
  42.     *
  43.     * #TODO: most of this can be moved to the glade file!?
  44.     * @param object PEAR_Frontend_Gtk
  45.     */
  46.     
  47.     function PEAR_Frontend_Gtk_Documentation(&$ui{
  48.         $this->ui &$ui;
  49.         
  50.     }
  51.     
  52.     /**
  53.     * The HTML Browser component
  54.     * @var object PEAR_Frontend_Gtk_WidgetHTML 
  55.     */
  56.     var $_html
  57.     
  58.     /**
  59.     * The Vbox holder for browser
  60.     * @var object GtkVbox 
  61.     */
  62.     var $holder
  63.     
  64.     function init({
  65.         $this->_html &new PEAR_Frontend_Gtk_WidgetHTML;
  66.         $this->_html->Interface()
  67.         $this->holder->add($this->_html->widget);
  68.         $this->_loadPackages();
  69.     }
  70.     /**
  71.     * The List of packages on the documentaiton page
  72.     * @var object GtkCombo 
  73.     */
  74.     var $package_combo
  75.     
  76.     /**
  77.     * The Currently Selected package (Text) to look at
  78.     * @var object GtkCombo 
  79.     */
  80.     var $package_comboentry
  81.     
  82.     function _loadPackages({
  83.         $packages array_keys($this->ui->_packages->packages);
  84.         $this->package_combo->set_popdown_strings($packages);
  85.         $list $this->package_combo->list;
  86.         $list->connect_after('button-release-event',array(&$this,'_PackageSelected'));
  87.     }
  88.     /**
  89.     * The Currently Selected package to look at
  90.     * @var string 
  91.     */
  92.     var $_selectedPackage "";
  93.     
  94.     function _PackageSelected({
  95.         $new $this->package_comboentry->get_text();
  96.         if ($new == $this->_selectedPackagereturn;
  97.         $this->_selectedPackage=$new;
  98.         $this->_loadViews();
  99.         $category str_replace(' ','_',strtolower($this->ui->_packages->packages[$new]->category));
  100.         $new strtolower($new);
  101.         $newurl = "http://pear.php.net/manual/en/html/packages.{$category}.{$new}.html";
  102.         if ($this->showURL($newurl)) return;
  103.         $parts explode('_'$new);
  104.         $newurl = "http://pear.php.net/manual/en/html/packages.{$parts[0]}.{$new}.html";
  105.         if ($this->showURL($newurl)) return;
  106.         $newurl = "http://pear.php.net/manual/en/html/core.{$new}.html";
  107.         if ($this->showURL($newurl)) return;
  108.         $newurl = "http://pear.php.net/manual/en/html/class.{$new}.html";
  109.         if ($this->showURL($newurl)) return;
  110.         
  111.         $this->_html->loadTEXT("<BODY><H1>Sorry</H1>{$newurl} was not found</BODY>");
  112.         $this->_html->tokenize();
  113.         $this->_html->build();
  114.         
  115.     }
  116.     
  117.     function show({
  118.         $this->ui->_widget_pages->set_page(3);
  119.         return $this->showURL('http://pear.php.net/manual/en/html/index.html');
  120.     }
  121.     
  122.     
  123.     function showURL($URL{
  124.         if (!$this->_html->loadURL($URL)) return;
  125.         $this->_html->tokenize();
  126.         $this->_html->build();
  127.         return TRUE;
  128.     }
  129.     
  130.     function _loadViews({
  131.         $views = array('PEAR Manual');
  132.         $this->view_combo->set_popdown_strings($views);
  133.     }
  134.     
  135.  
  136. }
  137.  
  138.  
  139. ?>

Documentation generated on Mon, 11 Mar 2019 14:28:56 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.