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

Source for file htf_tlb_sample_ibm_contentmenu.phl

Documentation is available at htf_tlb_sample_ibm_contentmenu.phl

  1. <?php
  2. /**
  3.  * htf_tlb_sample_ibm_contentmenuクラス
  4.  *
  5.  * IBMコンテンツメニュー生成クラス(サンプル用)
  6.  *
  7.  * @package HtmlTemplateFramework
  8.  * @subpackage htmltaglib
  9.  * @access  public
  10.  * @author    Yamauchi Shogo <htf@as-prj.com>
  11.  * @version $Id: htf_tlb_sample_ibm_contentmenu.phl ,v 1.0 $
  12.  ***/
  13. require_once ("htf_com_initialize.inc");     //共通初期処理
  14. require_once ("htf_dat_menu.phl");         //メニュークラス
  15. require_once ("htf_tag_element.phl");         //エレメントクラス
  16. require_once ("htf_tag_table.phl");         //tableクラス
  17. require_once ("htf_tag_tr.phl");            //trクラス
  18. require_once ("htf_tag_th.phl");            //thクラス
  19. require_once ("htf_tag_td.phl");            //tdクラス
  20.  
  21. /**
  22.  * IBMコンテンツメニュー生成クラス(サンプル用)
  23.  * 
  24.  * IBMサンプルのコンテンツメニュータグ生成用のクラス。
  25.  *
  26.  * @access  public
  27.  * @author    Yamauchi Shogo <htf@as-prj.com>
  28.  ***/
  29.     /**
  30.      * 表示するメニューデータ
  31.      * 
  32.      * @access public
  33.      * @var htf_dat_menu 
  34.      ***/
  35.     var $menu;
  36.  
  37.     /**
  38.      * コンストラクタ
  39.      *
  40.      * 引数の設定値からIBMコンテンツメニューを生成します。
  41.      *
  42.      * @param     menu    $menu  コンテンツメニュー用メニューオブジェクト
  43.      * @return    void 
  44.      ***/
  45.     function htf_tlb_sample_ibm_contentmenu($menu null{
  46.  
  47.         $this->menu = $menu;
  48.  
  49.         if (is_null($this->menu)) {
  50.             $this->menu = new htf_dat_menu();
  51.         }
  52.         return;
  53.     }
  54.  
  55.     /**
  56.      * IBMコンテンツメニューHTMLタグを出力します。
  57.      *
  58.      * @access  public
  59.      * @return string 
  60.      ***/
  61.     function get_htmltag({
  62.  
  63.         //テーブルタグ    
  64.         //thタグ(タイトル)
  65.         $th new htf_tag_th(HTF_ITEMCASE_ELEMENT);
  66.         $th->add_content('<b>' $this->menu->label '</b>');
  67.         $th->add_attribute("height""25");
  68.         //trタグ(タイトル行)
  69.         $tr new htf_tag_tr(HTF_ITEMCASE_ELEMENT);
  70.         $tr->add_column($th);
  71.         $tr->add_attribute("valign""top");
  72.         //テーブルタグに行・属性追加
  73.         $tbl->add_row_thead($tr);
  74.         $tbl->add_attribute("width""185");
  75.         $tbl->add_attribute("cellspacing""0");
  76.         $tbl->add_attribute("cellpadding""0");
  77.         $tbl->add_attribute("border""0");
  78.  
  79.         for ($i 0$i count($this->menu->arr_menuitem)$i++{
  80.             if ($i == 0{
  81.                 $strret $this->delimstr;
  82.             }
  83.             if (htf_is_existsval($this->menu->arr_menuitem[$i]->label)) {
  84.                 //タグ生成(tr/tdを作成して、$tblに追加する)
  85.                 $trdat new htf_tag_tr(HTF_ITEMCASE_ELEMENT);
  86.                 $tdmenu new htf_tag_td(HTF_ITEMCASE_ELEMENT);
  87.                 $strret '&nbsp;' "・";
  88.                 $strret .= $this->menu->arr_menuitem[$i]->get_textlinktag();
  89.                 $strret .= '&nbsp;' "\n";
  90.                 $tdmenu->add_content($strret);
  91.                 $trdat->add_column($tdmenu);
  92.                 $tbl->add_row_tbody($trdat);
  93.             }
  94.         }
  95.         return $tbl->get_htmltag();
  96.     }
  97. }
  98. ?>

Documentation generated on Tue, 19 Sep 2006 06:21:34 +0900 by phpDocumentor 1.3.0