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

Source for file Column.php

Documentation is available at Column.php

  1. <?php
  2. /**
  3.  * CNZ Framework
  4.  *
  5.  * A Framework for Creating and Using Complex Web Elements
  6.  *
  7.  * The purpose of this framework is to provide a library of high-level objects
  8.  * to facilitate common HTML coding tasks, such as menus, tables, and forms.
  9.  * The intent is to reduce repetitive HTML coding as much as possible, replacing
  10.  * it with a combination of configuration files and style sheets with
  11.  * standardized naming conventions.
  12.  *
  13.  * This framework is built on and requires the
  14.  * {@link http://framework.zend.com/ Zend Framework}.
  15.  *
  16.  * @category Cnz
  17.  * @package Cnz_Html
  18.  * @subpackage Table
  19.  *
  20.  * @author    Lyle Frost <lfrost@cnz.com>
  21.  * @copyright Copyright (c) 2006-2007 Citadel Network <{@link http://www.citadelnetwork.com/}>
  22.  * @filesource
  23.  * @license   http://www.citadelnetwork.com/license/cnzframework New BSD License
  24.  * @version   $Id: Column.php 27 2007-07-19 18:47:54Z lfrost $
  25.  */
  26.  
  27. /**
  28.  * HTML Table Column class
  29.  *
  30.  * This class is probably not useful directly.  It could be an inner class
  31.  * of Html_Table, if PHP supported inner classes.
  32.  *
  33.  * This class does represent displayable objects.
  34.  *
  35.  * @category Cnz
  36.  * @package Cnz_Html
  37.  * @subpackage Table
  38.  */
  39. {
  40.     /**#@+ @var boolean */
  41.     private $noWrap            false;
  42.     /**#@-*/
  43.  
  44.     /**#@+ @var string */
  45.     private $align            NULL;
  46.     private $expression        NULL;
  47.     private $heading        NULL;
  48.     /** Scheme for a href */
  49.     private $link            NULL;
  50.     private $name            NULL;
  51.     private $order            NULL;
  52.     /** data type */
  53.     private $type            NULL;
  54.     /**#@-*/
  55.  
  56.     /* Getters/Setters ===================================================*/
  57.  
  58.     /** @return string Align */
  59.     public function getAlign()
  60.     {
  61.         return $this->align;
  62.     }
  63.  
  64.     /** @return string Expression */
  65.     public function getExpression()
  66.     {
  67.         return $this->expression;
  68.     }
  69.  
  70.     /** @return string Heading */
  71.     public function getHeading()
  72.     {
  73.         return $this->heading;
  74.     }
  75.  
  76.     /** @return string Link */
  77.     public function getLink()
  78.     {
  79.         return $this->link;
  80.     }
  81.  
  82.     /** @return string Name */
  83.     public function getName()
  84.     {
  85.         return $this->name;
  86.     }
  87.  
  88.     /** @return string noWrap */
  89.     public function getNoWrap()
  90.     {
  91.         return $this->noWrap;
  92.     }
  93.  
  94.     /** @return string Order */
  95.     public function getOrder()
  96.     {
  97.         return $this->order;
  98.     }
  99.  
  100.     /** @return string Type */
  101.     public function getType()
  102.     {
  103.         return $this->type;
  104.     }
  105.  
  106.     /* Methods ===========================================================*/
  107.  
  108.     /**
  109.      * Option fields:
  110.      *   name
  111.      *
  112.      * Configuration fields:
  113.      *   align       Alignment
  114.      *   expression  SQL expression
  115.      *   heading     Column heading
  116.      *   link        Link type
  117.      *   noWrap      HTML nowrap
  118.      *   order       Sort order
  119.      *   type        Data type
  120.      *
  121.      * @param  array       $options Options
  122.      * @param  Zend_Config $config  Configuration
  123.      */
  124.     public function __construct(array $options array()Zend_Config $config NULL)
  125.     {
  126.         // Process options.
  127.         if (isset($options['name'])) $this->name strtolower($options['name']);
  128.  
  129.         // Process configuration.
  130.         if (isset($config->align)) $this->align strtolower($config->align);
  131.         // HACK:  Zend_Config_Ini does not allow " in values.
  132.         if (isset($config->expression)) $this->expression str_replace('`''"'$config->expression);
  133.         if (isset($config->heading)) $this->heading $config->heading;
  134.         if (isset($config->link)) $this->link $config->link;
  135.         if (isset($config->noWrap)) $this->noWrap Cnz_Html::configFlag($config->noWrap);
  136.         if (isset($config->order)) $this->order strtolower($config->order);
  137.         if (isset($config->type)) $this->type strtolower($config->type);
  138.     }
  139. }

Documentation generated on Thu, 19 Jul 2007 15:01:58 -0400 by phpDocumentor 1.4.0RC2