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

Source for file htf_css_property.phl

Documentation is available at htf_css_property.phl

  1. <?php
  2. /**
  3.  * htf_css_propertyクラス
  4.  *
  5.  * CSS属性情報を保有・生成するクラス
  6.  *
  7.  * @package HtmlTemplateFramework
  8.  * @subpackage css
  9.  * @access  public
  10.  * @author    Yamauchi Shogo <htf@as-prj.com>
  11.  * @version $Id: htf_css_property.phl ,v 1.0 $;
  12.  ***/
  13. require_once("htf_com_define.inc");    //共通定数群
  14. require_once("htf_com_func.inc");        //共通関数群
  15.  
  16. /**
  17.  * CSS属性情報を保有・生成するクラス
  18.  * 
  19.  * CSS属性情報を保有し、CSS属性記述文字列を生成します。
  20.  *
  21.  * @access   public
  22.  * @author    Yamauchi Shogo <htf@as-prj.com>
  23.  ***/
  24.  class htf_css_property {
  25.  
  26.    /**
  27.     * CSSプロパティ名
  28.     * 
  29.     * @access public
  30.     * @var string 
  31.     */
  32.     var $propname;
  33.    /**
  34.     * CSSプロパティ値
  35.     * 
  36.     * @access public
  37.     * @var string 
  38.     */
  39.     var $propvalue;
  40.    /**
  41.     * CSS属性記述を出力する場合の大文字・小文字出力設定
  42.     * 
  43.     * @access public
  44.     * @var string 
  45.     */
  46.     var $property_case;
  47.  
  48.     /**
  49.      * コンストラクタ
  50.      *
  51.      * 引数の属性名・属性値から、指定されたのCSSプロパティを保有するクラスを生成します。
  52.      *
  53.      * @access     public
  54.      * @param     string    $strpropname          CSSのプロパティ名(デフォルトは空文字)
  55.      * @param     string    $strpropvalue         CSSのプロパティ値(デフォルトは空文字)
  56.      * @param     string    $strproperty_case     大文字・小文字出力(デフォルトは空文字・指定なし)
  57.      * @return    void 
  58.      ***/
  59.     function htf_css_property($strpropname="",
  60.                               $strpropvalue="",
  61.                               $strproperty_case=""{
  62.         //各プロパティ初期化
  63.         $this->propname = $strpropname;
  64.         $this->propvalue = $strpropvalue;
  65.         $this->property_case = $strproperty_case;
  66.         return;
  67.     }
  68.     
  69.     /**
  70.      * CSSの属性記述を取得します。
  71.      *
  72.      * @access     public
  73.      * @return    string  css属性記述
  74.      ***/
  75.     function get_css_desc({
  76.  
  77.         //プロパティ名・プロパティ値両方なくてはならない
  78.         if (!htf_is_existsval($this->get_property_name())||
  79.             !htf_is_existsval($this->propvalue)) {
  80.             return "";
  81.         }
  82.         
  83.         $strret $this->get_property_name().':'.' '.$this->propvalue;
  84.         return $strret;
  85.     }
  86.  
  87.     /**
  88.      * 大文字・小文字を判別し、プロパティ名を取得します。
  89.      *
  90.      * @access     private
  91.      * @return    String  プロパティ名
  92.      ***/
  93.     function get_property_name({
  94.         $retstr="";
  95.         if ($this->property_case == HTF_CASE_LOWER{
  96.             //小文字に変換して出力
  97.             $retstr=strtolower($this->propname);
  98.         else if($this->property_case == HTF_CASE_UPPER{
  99.             //大文字に変換して出力
  100.             $retstr=strtoupper($this->propname);
  101.         else {
  102.             //そのまま出力(デフォルト)
  103.             $retstr=$this->propname;
  104.         }
  105.         return $retstr;
  106.     }
  107. }
  108. ?>

Documentation generated on Tue, 19 Sep 2006 06:20:39 +0900 by phpDocumentor 1.3.0