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

Source for file Summary.php

Documentation is available at Summary.php

  1. <?php
  2. /*
  3.   +----------------------------------------------------------------------+
  4.   | PHP Version 4                                                        |
  5.   +----------------------------------------------------------------------+
  6.   | Copyright (c) 1997-2003 The PHP Group                                |
  7.   +----------------------------------------------------------------------+
  8.   | This source file is subject to version 2.02 of the PHP license,      |
  9.   | that is bundled with this package in the file LICENSE, and is        |
  10.   | available at through the world-wide-web at                           |
  11.   | http://www.php.net/license/2_02.txt.                                 |
  12.   | If you did not receive a copy of the PHP license and are unable to   |
  13.   | obtain it through the world-wide-web, please send a note to          |
  14.   | license@php.net so we can mail you a copy immediately.               |
  15.   +----------------------------------------------------------------------+
  16.   | Author: Alan Knowles <alan@akbkhome.com>                             |
  17.   +----------------------------------------------------------------------+
  18.  
  19.   $Id: Summary.php,v 1.9 2003/01/04 11:55:55 mj Exp $
  20. */
  21.  
  22. /**
  23.  * Gtk Frontend - Section that deals displaying summary details about a class
  24.  * 
  25.  * #TODO : make the textbox display more information in a 'friendlier way'
  26.  *
  27.  *
  28.  * @author Alan Knowles <alan@akbkhome.com>
  29.  */
  30.  
  31.  
  32. class PEAR_Frontend_Gtk_Summary {
  33.  
  34.     var $ui// main interface
  35.     var $widget// the list widget
  36.     var $config// reference to config;
  37.     var $active_package=""// currently selected package
  38.     var $_detailsVisableFlag  = FALSE; // is the dialog visable
  39.     
  40.     function PEAR_Frontend_Gtk_Summary(&$ui{
  41.         $this->ui &$ui;
  42.     }
  43.     /*
  44.     
  45.     package info looks like this!
  46.     
  47.      [packageid] => 22
  48.     [categoryid] => 22
  49.     [category] => XML
  50.     [license] => PHP License
  51.     [summary] => RSS parser
  52.     [description] => Parser for Resource Description Framework (RDF) Site Summary (RSS)
  53. documents.
  54.     [lead] => mj
  55.     [stable] => 0.9.1
  56.  
  57.     
  58.     */
  59.     /*
  60.     * is the details tab visable
  61.     */
  62.     
  63.     var $_VisablePackageName '';
  64.     /*
  65.     * show the details tab
  66.     */
  67.     function show(&$package{
  68.         $this->ui->_widget_details_area->show();
  69.         $this->active_package &$package;
  70.         //$this->ui->_widget_install->set_sensitive(1);
  71.         foreach(get_object_vars($packageas $k=>$v)  {
  72.             if (@is_object($v)) continue;
  73.             if (@is_array($v)) continue;
  74.             $v str_replace("\r"'',$v);
  75.             $var "_widget_".strtolower($k);
  76.             if (!is_object(@$this->ui->$var)) continue;
  77.             $w &$this->ui->$var;
  78.             switch (get_class($w)) {
  79.                 case  'GtkLabel':
  80.                 case  'GtkEntry':
  81.                     $w->set_text(str_replace('\n',' ',$v));
  82.                     break;
  83.                 case 'GtkText':
  84.                     $w->delete_text(0,-1);
  85.                     $w->insert_text($v,0);
  86.                     break;
  87.  
  88.             }
  89.         }
  90.         $vadj $this->ui->_widget_description_sw->get_vadjustment();
  91.         $vadj->set_value(0);
  92.         $this->_detailsVisableFlag $package->name;
  93.      
  94.     }
  95.     
  96.     function toggle(&$package{
  97.         if ($this->_detailsVisableFlag != $package->name{
  98.             $this->show($package);
  99.             return;
  100.         }
  101.         $this->hide();
  102.     }
  103.             
  104.         
  105.     
  106.     
  107.     function hide({
  108.         
  109.         $this->ui->_widget_details_area->hide();
  110.         $this->_detailsVisableFlag '';
  111.     
  112.     }
  113.     
  114.     /*
  115.     * Install callback
  116.     */
  117.     function _callbackInstall({
  118.         $ui 'Gtk';
  119.         $this->installer &new PEAR_Installer($ui);
  120.         $options = array();
  121.         $info $this->installer->install($this->active_package['package']$options $this->ui->config);
  122.         // refresh list?
  123.         $this->ui->_packages->loadList();
  124.         $this->ui->_packages->selectPackage($this->active_package['package']);
  125.     }
  126.     
  127.     
  128.     
  129.     
  130.      
  131.      
  132. }
  133. ?>

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