Ignore:
Timestamp:
2007/07/20 15:58:59 (17 years ago)
Author:
nanasess
Message:

r15064 から svn cp
とりあえず暫定コミット.

  • UTF-8 に変更
  • slib.php, glib.php のクラス化
  • LC_Page の抽象化(一部)
Location:
branches/feature-module-update
Files:
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update

    • Property svn:ignore set to
      .cache

      .settings

      .projectOptions
  • branches/feature-module-update/html/mobile/products/category_list.php

    r12157 r15078  
    77 *  
    88 * 
    9  * ¥â¥Ð¥¤¥ë¥µ¥¤¥È/¥«¥Æ¥´¥ê¡¼°ìÍ÷ 
     9 * モバイルサイト/カテゴリー一覧 
    1010 */ 
    1111 
     
    1414class LC_Page { 
    1515    function LC_Page() { 
    16         /** ɬ¤º»ØÄꤹ¤ë **/ 
    17         $this->tpl_mainpage = 'products/category_list.tpl';         // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È 
    18         $this->tpl_title = '¥«¥Æ¥´¥ê°ìÍ÷¥Ú¡¼¥¸'; 
     16        /** 必ず指定する **/ 
     17        $this->tpl_mainpage = 'products/category_list.tpl';         // メインテンプレート 
     18        $this->tpl_title = 'カテゴリ一覧ページ'; 
    1919    } 
    2020} 
     
    2323$objView = new SC_MobileView(); 
    2424 
    25 // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ 
     25// レイアウトデザインを取得 
    2626$objPage = sfGetPageLayout($objPage, false, DEF_LAYOUT); 
    2727 
    28 // ¥«¥Æ¥´¥ê¡¼¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£ 
     28// カテゴリー情報を取得する。 
    2929lfGetCategories(@$_GET['category_id'], true, $objPage); 
    3030 
     
    3535 
    3636/** 
    37  * ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼¤È¤½¤Î»Ò¥«¥Æ¥´¥ê¡¼¤Î¾ðÊó¤ò¼èÆÀ¤·¡¢ 
    38  * ¥Ú¡¼¥¸¥ª¥Ö¥¸¥§¥¯¥È¤Ë³ÊǼ¤¹¤ë¡£ 
     37 * 選択されたカテゴリーとその子カテゴリーの情報を取得し、 
     38 * ページオブジェクトに格納する。 
    3939 * 
    40  * @param string $category_id ¥«¥Æ¥´¥ê¡¼ID 
    41  * @param boolean $count_check Í­¸ú¤Ê¾¦Éʤ¬¤Ê¤¤¥«¥Æ¥´¥ê¡¼¤ò½ü¤¯¤«¤É¤¦¤« 
    42  * @param object &$objPage ¥Ú¡¼¥¸¥ª¥Ö¥¸¥§¥¯¥È 
     40 * @param string $category_id カテゴリーID 
     41 * @param boolean $count_check 有効な商品がないカテゴリーを除くかどうか 
     42 * @param object &$objPage ページオブジェクト 
    4343 * @return void 
    4444 */ 
    4545function lfGetCategories($category_id, $count_check = false, &$objPage) { 
    46     // ¥«¥Æ¥´¥ê¡¼¤ÎÀµ¤·¤¤ID¤ò¼èÆÀ¤¹¤ë¡£ 
     46    // カテゴリーの正しいIDを取得する。 
    4747    $category_id = sfGetCategoryId('', $category_id); 
    4848    if ($category_id == 0) { 
     
    5050    } 
    5151 
    52     $arrCategory = null;    // ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼ 
    53     $arrChildren = array(); // »Ò¥«¥Æ¥´¥ê¡¼ 
     52    $arrCategory = null;    // 選択されたカテゴリー 
     53    $arrChildren = array(); // 子カテゴリー 
    5454 
    5555    $arrAll = sfGetCatTree($category_id, $count_check); 
    5656    foreach ($arrAll as $category) { 
    57         // ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼¤Î¾ì¹ç 
     57        // 選択されたカテゴリーの場合 
    5858        if ($category['category_id'] == $category_id) { 
    5959            $arrCategory = $category; 
     
    6161        } 
    6262 
    63         // ´Ø·¸¤Î¤Ê¤¤¥«¥Æ¥´¥ê¡¼¤Ï¥¹¥­¥Ã¥×¤¹¤ë¡£ 
     63        // 関係のないカテゴリーはスキップする。 
    6464        if ($category['parent_category_id'] != $category_id) { 
    6565            continue; 
    6666        } 
    6767 
    68         // »Ò¥«¥Æ¥´¥ê¡¼¤Î¾ì¹ç¤Ï¡¢Â¹¥«¥Æ¥´¥ê¡¼¤¬Â¸ºß¤¹¤ë¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ 
     68        // 子カテゴリーの場合は、孫カテゴリーが存在するかどうかを調べる。 
    6969        $arrGrandchildrenID = sfGetUnderChildrenArray($arrAll, 'parent_category_id', 'category_id', $category['category_id']); 
    7070        $category['has_children'] = count($arrGrandchildrenID) > 0; 
     
    7676    } 
    7777 
    78     // »Ò¥«¥Æ¥´¥ê¡¼¤Î¾¦ÉÊ¿ô¤ò¹ç·×¤¹¤ë¡£ 
     78    // 子カテゴリーの商品数を合計する。 
    7979    $children_product_count = 0; 
    8080    foreach ($arrChildren as $category) { 
     
    8282    } 
    8383 
    84     // ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼¤Ëľ°¤Î¾¦Éʤ¬¤¢¤ë¾ì¹ç¤Ï¡¢»Ò¥«¥Æ¥´¥ê¡¼¤ÎÀèƬ¤ËÄɲ乤롣 
     84    // 選択されたカテゴリーに直属の商品がある場合は、子カテゴリーの先頭に追加する。 
    8585    if ($arrCategory['product_count'] > $children_product_count) { 
    86         $arrCategory['product_count'] -= $children_product_count;   // »Ò¥«¥Æ¥´¥ê¡¼¤Î¾¦ÉÊ¿ô¤ò½ü¤¯¡£ 
    87         $arrCategory['has_children'] = false;   // ¾¦ÉÊ°ìÍ÷¥Ú¡¼¥¸¤ËÁ«°Ü¤µ¤»¤ë¤¿¤á¡£ 
     86        $arrCategory['product_count'] -= $children_product_count;   // 子カテゴリーの商品数を除く。 
     87        $arrCategory['has_children'] = false;   // 商品一覧ページに遷移させるため。 
    8888        array_unshift($arrChildren, $arrCategory); 
    8989    } 
    9090 
    91     // ·ë²Ì¤ò³ÊǼ¤¹¤ë¡£ 
     91    // 結果を格納する。 
    9292    $objPage->arrCategory = $arrCategory; 
    9393    $objPage->arrChildren = $arrChildren; 
Note: See TracChangeset for help on using the changeset viewer.