7 * LICENSE: This source file is licensed under the terms of the GNU General Public License.
9 * @package Magic3 Framework
10 * @author 平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
11 * @copyright Copyright 2006-2007 Magic3 Project.
12 * @license http://www.gnu.org/copyleft/gpl.html GPL License
13 * @version SVN: $Id: htmlEdit.php 2 2007-11-03 04:59:01Z fishbone $
14 * @link http://www.magic3.org
21 function __construct()
27 * @param SelectMenuItem $itemArray メニューに表示する項目(SelectMenuItemクラスの配列)
28 * @param array $tagName タグ名
29 * @param array $tagAttribs selectタグの属性
30 * @return メニューのHTMLテキスト
32 public static function createSelectMenu($itemArray, $tagName, $tagAttribs)
34 $html = "\n<select name=\"$tagName\" $tagAttribs>";
35 $n = count($itemArray);
36 for ($i = 0; $i < $n; $i++){
37 $t = $itemArray[$i]->name;
38 $k = $itemArray[$i]->value;
41 if ($itemArray[$i]->selected){
42 $selected = " selected";
44 $html .= "\n\t<option value=\"".$k."\"$selected>" . $t . "</option>";
46 $html .= "\n</select>\n";
52 * @param string $src 変換するデータ
53 * @return string 変換後データ
55 public static function convLineBreakToBr($src)
57 return preg_replace("/(\015\012)|(\015)|(\012)/","<br />", $src);
65 public $name = ''; // 画面上に表示されるタイトル
66 public $value = ''; // 実際の値
67 public $selected = false; // 選択状態