Changeset 22796 for branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php
- Timestamp:
- 2013/05/02 18:11:36 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php
r22597 r22796 32 32 * @version $Id$ 33 33 */ 34 class LC_Page_Admin_Products_Category extends LC_Page_Admin_Ex 35 { 34 class LC_Page_Admin_Products_Category extends LC_Page_Admin_Ex { 36 35 37 36 // {{{ properties … … 45 44 * @return void 46 45 */ 47 function init() 48 { 46 function init() { 49 47 parent::init(); 50 48 $this->tpl_maintitle = '商品管理'; … … 61 59 * @return void 62 60 */ 63 function process() 64 { 61 function process() { 65 62 $this->action(); 66 63 $this->sendResponse(); … … 72 69 * @return void 73 70 */ 74 function action() 75 { 71 function action() { 76 72 77 73 $objDb = new SC_Helper_DB_Ex(); 78 74 $objFormParam = new SC_FormParam_Ex(); 79 $objCategory = new SC_Helper_Category_Ex();80 75 81 76 // 入力パラメーター初期化 … … 184 179 $this->arrList = $this->findCategoiesByParentCategoryId($parent_category_id); 185 180 // カテゴリツリーを取得 186 $this->arrTree = $objCategory->getTree(); 187 $this->arrParentID = $objCategory->getTreeTrail($parent_category_id); 181 $this->arrTree = $objDb->sfGetCatTree($parent_category_id); 188 182 // ぱんくずの生成 189 $arrBread = $objCategory->getTreeTrail($this->arrForm['parent_category_id'], FALSE); 190 $this->tpl_bread_crumbs = SC_Utils_Ex::jsonEncode(array_reverse($arrBread)); 183 $arrBread = array(); 184 $objDb->findTree($this->arrTree, $parent_category_id, $arrBread); 185 $this->tpl_bread_crumbs = SC_Utils_Ex::jsonEncode($arrBread); 191 186 192 187 } … … 206 201 * @return void 207 202 */ 208 function doDelete(&$objFormParam, &$objDb) 209 { 203 function doDelete(&$objFormParam, &$objDb) { 210 204 $category_id = $objFormParam->getValue('category_id'); 211 205 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 237 231 * @return void 238 232 */ 239 function doPreEdit(&$objFormParam) 240 { 233 function doPreEdit(&$objFormParam) { 241 234 $category_id = $objFormParam->getValue('category_id'); 242 235 243 $objCategory = new SC_Helper_Category_Ex(); 244 $arrRes = $objCategory->get($category_id); 236 $objQuery =& SC_Query_Ex::getSingletonInstance(); 237 238 // 編集対象のカテゴリ名をDBより取得する 239 $where = 'category_id = ?'; 240 $arrRes = $objQuery->getRow('*', 'dtb_category', $where, array($category_id)); 245 241 246 242 $objFormParam->setParam($arrRes); … … 261 257 * @return void 262 258 */ 263 function doEdit(&$objFormParam) 264 { 259 function doEdit(&$objFormParam) { 265 260 $category_id = $objFormParam->getValue('category_id'); 266 261 … … 298 293 * @return void 299 294 */ 300 function checkError(&$objFormParam, $add) 301 { 295 function checkError(&$objFormParam, $add) { 302 296 $objQuery =& SC_Query_Ex::getSingletonInstance(); 303 297 … … 354 348 * @return void 355 349 */ 356 function doUp(&$objFormParam) 357 { 350 function doUp(&$objFormParam) { 358 351 $category_id = $objFormParam->getValue('category_id'); 359 352 … … 382 375 * @return void 383 376 */ 384 function doDown(&$objFormParam) 385 { 377 function doDown(&$objFormParam) { 386 378 $category_id = $objFormParam->getValue('category_id'); 387 379 … … 410 402 * @return void 411 403 */ 412 function initParam(&$objFormParam) 413 { 404 function initParam(&$objFormParam) { 414 405 $objFormParam->addParam('親カテゴリID', 'parent_category_id', null, null, array()); 415 406 $objFormParam->addParam('カテゴリID', 'category_id', null, null, array()); … … 427 418 * @return array カテゴリの配列 428 419 */ 429 function findCategoiesByParentCategoryId($parent_category_id) 430 { 420 function findCategoiesByParentCategoryId($parent_category_id) { 431 421 if (!$parent_category_id) { 432 422 $parent_category_id = 0; … … 445 435 * @return void 446 436 */ 447 function updateCategory($category_id, $arrCategory) 448 { 437 function updateCategory($category_id, $arrCategory) { 449 438 $objQuery =& SC_Query_Ex::getSingletonInstance(); 450 439 … … 463 452 * @return void 464 453 */ 465 function registerCategory($arrCategory) 466 { 454 function registerCategory($arrCategory) { 467 455 $objQuery =& SC_Query_Ex::getSingletonInstance(); 468 456 … … 510 498 * @param 超えている場合 true 511 499 */ 512 function isOverLevel($parent_category_id) 513 { 500 function isOverLevel($parent_category_id) { 514 501 $objQuery =& SC_Query_Ex::getSingletonInstance(); 515 502 $level = $objQuery->get('level', 'dtb_category', 'category_id = ?', array($parent_category_id)); … … 522 509 * @return void 523 510 */ 524 function destroy() 525 { 511 function destroy() { 526 512 parent::destroy(); 527 513 } 528 514 529 515 // 並びが1つ下のIDを取得する。 530 function lfGetDownRankID($objQuery, $table, $pid_name, $id_name, $id) 531 { 516 function lfGetDownRankID($objQuery, $table, $pid_name, $id_name, $id) { 532 517 // 親IDを取得する。 533 518 $col = "$pid_name"; … … 550 535 551 536 // 並びが1つ上のIDを取得する。 552 function lfGetUpRankID($objQuery, $table, $pid_name, $id_name, $id) 553 { 537 function lfGetUpRankID($objQuery, $table, $pid_name, $id_name, $id) { 554 538 // 親IDを取得する。 555 539 $col = "$pid_name"; … … 571 555 } 572 556 573 function lfCountChilds($objQuery, $table, $pid_name, $id_name, $id) 574 { 557 function lfCountChilds($objQuery, $table, $pid_name, $id_name, $id) { 575 558 $objDb = new SC_Helper_DB_Ex(); 576 559 // 子ID一覧を取得 … … 579 562 } 580 563 581 function lfUpRankChilds($objQuery, $table, $pid_name, $id_name, $id, $count) 582 { 564 function lfUpRankChilds($objQuery, $table, $pid_name, $id_name, $id, $count) { 583 565 $objDb = new SC_Helper_DB_Ex(); 584 566 // 子ID一覧を取得 … … 592 574 } 593 575 594 function lfDownRankChilds($objQuery, $table, $pid_name, $id_name, $id, $count) 595 { 576 function lfDownRankChilds($objQuery, $table, $pid_name, $id_name, $id, $count) { 596 577 $objDb = new SC_Helper_DB_Ex(); 597 578 // 子ID一覧を取得
Note: See TracChangeset
for help on using the changeset viewer.