[ Index ]
 

Code source de phpMyVisites 2.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/libs/artichow/php4/inc/ -> Tools.class.php (source)

   1  <?php
   2  /*
   3   * This work is hereby released into the Public Domain.
   4   * To view a copy of the public domain dedication,
   5   * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
   6   * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
   7   *
   8   */
   9  
  10  /**
  11   * Objects capable of being positioned
  12   *
  13   * @package Artichow
  14   */
  15  
  16  
  17  registerInterface('Positionable');
  18  
  19  /**
  20   * Manage left, right, top and bottom sides
  21   *
  22   * @package Artichow
  23   */
  24  class awSide {
  25  
  26      /**
  27       * Left side
  28       *
  29       * @var int
  30       */
  31      var $left = 0;
  32  
  33      /**
  34       * Right side
  35       *
  36       * @var int
  37       */
  38      var $right = 0;
  39  
  40      /**
  41       * Top side
  42       *
  43       * @var int
  44       */
  45      var $top = 0;
  46  
  47      /**
  48       * Bottom side
  49       *
  50       * @var int
  51       */
  52      var $bottom = 0;
  53      
  54      /**
  55       * Build the side
  56       *
  57       * @param mixed $left
  58       * @param mixed $right
  59       * @param mixed $top
  60       * @param mixed $bottom
  61       */
  62  	 function awSide($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) {
  63          $this->set($left, $right, $top, $bottom);
  64      }
  65      
  66      
  67      /**
  68       * Change side values
  69       *
  70       * @param mixed $left
  71       * @param mixed $right
  72       * @param mixed $top
  73       * @param mixed $bottom
  74       */
  75  	 function set($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) {
  76      
  77          if($left !== NULL) {
  78              $this->left = (float)$left;
  79          }
  80          if($right !== NULL) {
  81              $this->right = (float)$right;
  82          }
  83          if($top !== NULL) {
  84              $this->top = (float)$top;
  85          }
  86          if($bottom !== NULL) {
  87              $this->bottom = (float)$bottom;
  88          }
  89          
  90      }
  91      
  92      
  93      /**
  94       * Add values to each side
  95       *
  96       * @param mixed $left
  97       * @param mixed $right
  98       * @param mixed $top
  99       * @param mixed $bottom
 100       */
 101  	 function add($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) {
 102      
 103          if($left !== NULL) {
 104              $this->left += (float)$left;
 105          }
 106          if($right !== NULL) {
 107              $this->right += (float)$right;
 108          }
 109          if($top !== NULL) {
 110              $this->top += (float)$top;
 111          }
 112          if($bottom !== NULL) {
 113              $this->bottom += (float)$bottom;
 114          }
 115          
 116      }
 117  
 118  }
 119  
 120  registerClass('Side');
 121  ?>


Généré le : Mon Nov 26 14:10:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics