- Timestamp:
- 2007/07/20 15:58:59 (17 years ago)
- 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
-
Property
svn:ignore
set to
-
branches/feature-module-update/html/mobile/products/category_list.php
r12157 r15078 7 7 * 8 8 * 9 * ¥â¥Ð¥¤¥ë¥µ¥¤¥È/¥«¥Æ¥´¥ê¡¼°ìÍ÷9 * モバイルサイト/カテゴリー一覧 10 10 */ 11 11 … … 14 14 class LC_Page { 15 15 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 = 'カテゴリ一覧ページ'; 19 19 } 20 20 } … … 23 23 $objView = new SC_MobileView(); 24 24 25 // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ25 // レイアウトデザインを取得 26 26 $objPage = sfGetPageLayout($objPage, false, DEF_LAYOUT); 27 27 28 // ¥«¥Æ¥´¥ê¡¼¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£28 // カテゴリー情報を取得する。 29 29 lfGetCategories(@$_GET['category_id'], true, $objPage); 30 30 … … 35 35 36 36 /** 37 * ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼¤È¤½¤Î»Ò¥«¥Æ¥´¥ê¡¼¤Î¾ðÊó¤ò¼èÆÀ¤·¡¢38 * ¥Ú¡¼¥¸¥ª¥Ö¥¸¥§¥¯¥È¤Ë³ÊǼ¤¹¤ë¡£37 * 選択されたカテゴリーとその子カテゴリーの情報を取得し、 38 * ページオブジェクトに格納する。 39 39 * 40 * @param string $category_id ¥«¥Æ¥´¥ê¡¼ID41 * @param boolean $count_check ͸ú¤Ê¾¦Éʤ¬¤Ê¤¤¥«¥Æ¥´¥ê¡¼¤ò½ü¤¯¤«¤É¤¦¤«42 * @param object &$objPage ¥Ú¡¼¥¸¥ª¥Ö¥¸¥§¥¯¥È40 * @param string $category_id カテゴリーID 41 * @param boolean $count_check 有効な商品がないカテゴリーを除くかどうか 42 * @param object &$objPage ページオブジェクト 43 43 * @return void 44 44 */ 45 45 function lfGetCategories($category_id, $count_check = false, &$objPage) { 46 // ¥«¥Æ¥´¥ê¡¼¤ÎÀµ¤·¤¤ID¤ò¼èÆÀ¤¹¤ë¡£46 // カテゴリーの正しいIDを取得する。 47 47 $category_id = sfGetCategoryId('', $category_id); 48 48 if ($category_id == 0) { … … 50 50 } 51 51 52 $arrCategory = null; // ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼53 $arrChildren = array(); // »Ò¥«¥Æ¥´¥ê¡¼52 $arrCategory = null; // 選択されたカテゴリー 53 $arrChildren = array(); // 子カテゴリー 54 54 55 55 $arrAll = sfGetCatTree($category_id, $count_check); 56 56 foreach ($arrAll as $category) { 57 // ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼¤Î¾ì¹ç57 // 選択されたカテゴリーの場合 58 58 if ($category['category_id'] == $category_id) { 59 59 $arrCategory = $category; … … 61 61 } 62 62 63 // ´Ø·¸¤Î¤Ê¤¤¥«¥Æ¥´¥ê¡¼¤Ï¥¹¥¥Ã¥×¤¹¤ë¡£63 // 関係のないカテゴリーはスキップする。 64 64 if ($category['parent_category_id'] != $category_id) { 65 65 continue; 66 66 } 67 67 68 // »Ò¥«¥Æ¥´¥ê¡¼¤Î¾ì¹ç¤Ï¡¢Â¹¥«¥Æ¥´¥ê¡¼¤¬Â¸ºß¤¹¤ë¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£68 // 子カテゴリーの場合は、孫カテゴリーが存在するかどうかを調べる。 69 69 $arrGrandchildrenID = sfGetUnderChildrenArray($arrAll, 'parent_category_id', 'category_id', $category['category_id']); 70 70 $category['has_children'] = count($arrGrandchildrenID) > 0; … … 76 76 } 77 77 78 // »Ò¥«¥Æ¥´¥ê¡¼¤Î¾¦ÉÊ¿ô¤ò¹ç·×¤¹¤ë¡£78 // 子カテゴリーの商品数を合計する。 79 79 $children_product_count = 0; 80 80 foreach ($arrChildren as $category) { … … 82 82 } 83 83 84 // ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼¤Ëľ°¤Î¾¦Éʤ¬¤¢¤ë¾ì¹ç¤Ï¡¢»Ò¥«¥Æ¥´¥ê¡¼¤ÎÀèƬ¤ËÄɲ乤롣84 // 選択されたカテゴリーに直属の商品がある場合は、子カテゴリーの先頭に追加する。 85 85 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; // 商品一覧ページに遷移させるため。 88 88 array_unshift($arrChildren, $arrCategory); 89 89 } 90 90 91 // ·ë²Ì¤ò³ÊǼ¤¹¤ë¡£91 // 結果を格納する。 92 92 $objPage->arrCategory = $arrCategory; 93 93 $objPage->arrChildren = $arrChildren;
Note: See TracChangeset
for help on using the changeset viewer.