HtmlTemplateFramework
[
class tree: HtmlTemplateFramework
] [
index: HtmlTemplateFramework
] [
all elements
]
Packages:
HtmlTemplateFramework
Source for file htf_css_property.phl
Documentation is available at
htf_css_property.phl
<?php
/**
* htf_css_propertyクラス
*
* CSS属性情報を保有・生成するクラス
*
*
@package
HtmlTemplateFramework
*
@subpackage
css
*
@access
public
*
@author
Yamauchi Shogo <htf@as-prj.com>
*
@version
$Id: htf_css_property.phl ,v 1.0 $;
***/
require_once
(
"htf_com_define.inc"
)
;
//共通定数群
require_once
(
"htf_com_func.inc"
)
;
//共通関数群
/**
* CSS属性情報を保有・生成するクラス
*
* CSS属性情報を保有し、CSS属性記述文字列を生成します。
*
*
@access
public
*
@author
Yamauchi Shogo <htf@as-prj.com>
***/
class
htf_css_property
{
/**
* CSSプロパティ名
*
*
@access
public
*
@var
string
*/
var
$propname
;
/**
* CSSプロパティ値
*
*
@access
public
*
@var
string
*/
var
$propvalue
;
/**
* CSS属性記述を出力する場合の大文字・小文字出力設定
*
*
@access
public
*
@var
string
*/
var
$property_case
;
/**
* コンストラクタ
*
* 引数の属性名・属性値から、指定されたのCSSプロパティを保有するクラスを生成します。
*
*
@access
public
*
@param
string
$strpropname
CSSのプロパティ名(デフォルトは空文字)
*
@param
string
$strpropvalue
CSSのプロパティ値(デフォルトは空文字)
*
@param
string
$strproperty_case
大文字・小文字出力(デフォルトは空文字・指定なし)
*
@return
void
***/
function
htf_css_property
(
$strpropname
=
""
,
$strpropvalue
=
""
,
$strproperty_case
=
""
)
{
//各プロパティ初期化
$this
->
propname
=
$strpropname
;
$this
->
propvalue
=
$strpropvalue
;
$this
->
property_case
=
$strproperty_case
;
return
;
}
/**
* CSSの属性記述を取得します。
*
*
@access
public
*
@return
string
css属性記述
***/
function
get_css_desc
(
)
{
//プロパティ名・プロパティ値両方なくてはならない
if
(
!
htf_is_existsval
(
$this
->
get_property_name
(
))
||
!
htf_is_existsval
(
$this
->
propvalue
))
{
return
""
;
}
$strret
=
$this
->
get_property_name
(
)
.
':'
.
' '
.
$this
->
propvalue
;
return
$strret
;
}
/**
* 大文字・小文字を判別し、プロパティ名を取得します。
*
*
@access
private
*
@return
String
プロパティ名
***/
function
get_property_name
(
)
{
$retstr
=
""
;
if
(
$this
->
property_case
==
HTF_CASE_LOWER
)
{
//小文字に変換して出力
$retstr
=
strtolower
(
$this
->
propname
)
;
}
else
if
(
$this
->
property_case
==
HTF_CASE_UPPER
)
{
//大文字に変換して出力
$retstr
=
strtoupper
(
$this
->
propname
)
;
}
else
{
//そのまま出力(デフォルト)
$retstr
=
$this
->
propname
;
}
return
$retstr
;
}
}
?>
Documentation generated on Tue, 19 Sep 2006 06:20:39 +0900 by
phpDocumentor 1.3.0