- Timestamp:
- 2007/10/18 10:35:10 (16 years ago)
- Location:
- branches/feature-module-update
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/data/Smarty/templates/default/admin/contents/campaign_create_tag.tpl
r16044 r16488 14 14 <meta http-equiv="content-script-type" content="text/javascript" /> 15 15 <meta http-equiv="content-style-type" content="text/css" /> 16 <script type="text/javascript" src="<!--{$ smarty.const.URL_DIR}-->js/css.js"></script>17 <script type="text/javascript" src="<!--{$ smarty.const.URL_DIR}-->js/navi.js"></script>18 <script type="text/javascript" src="<!--{$ smarty.const.URL_DIR}-->js/win_op.js"></script>19 <script type="text/javascript" src="<!--{$ smarty.const.URL_DIR}-->js/site.js"></script>20 <script type="text/javascript" src="<!--{$ smarty.const.URL_DIR}-->js/admin.js"></script>21 <script type="text/javascript" src="<!--{$ smarty.const.URL_DIR}-->js/css.js"></script>16 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/css.js"></script> 17 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/navi.js"></script> 18 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/win_op.js"></script> 19 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/site.js"></script> 20 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/admin.js"></script> 21 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/css.js"></script> 22 22 <script type="text/javascript"> 23 23 </script> -
branches/feature-module-update/data/class/pages/admin/contents/LC_Page_Admin_Contents_Campaign.php
r16326 r16488 9 9 require_once(CLASS_PATH . "pages/LC_Page.php"); 10 10 require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_CSV_Ex.php"); 11 require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_FileManager_Ex.php"); 11 12 12 13 /** … … 332 333 function lfCreateTemplate($dir, $file, &$objFormParam) { 333 334 335 $objFileManager = new SC_Helper_FileManager_Ex(); 334 336 $arrRet = $objFormParam->getHashArray(); 335 337 … … 344 346 $default_end_dir = $default_dir . "/" . CAMPAIGN_TEMPLATE_END; 345 347 346 $ret = SC_Utils_Ex::sfCreateFile($create_dir, 0755);347 $ret = SC_Utils_Ex::sfCreateFile($create_active_dir, 0755);348 $ret = SC_Utils_Ex::sfCreateFile($create_end_dir, 0755);348 $ret = $objFileManager->sfCreateFile($create_dir, 0755); 349 $ret = $objFileManager->sfCreateFile($create_active_dir, 0755); 350 $ret = $objFileManager->sfCreateFile($create_end_dir, 0755); 349 351 350 352 // キャンペーン実行PHPをコピー 351 $ret = SC_Utils_Ex::sfCreateFile(CAMPAIGN_PATH . $file);353 $ret = $objFileManager->sfCreateFile(CAMPAIGN_PATH . $file); 352 354 copy($default_dir . "/src/index.php", CAMPAIGN_PATH . $file . "/index.php"); 353 355 copy($default_dir . "/src/application.php", CAMPAIGN_PATH . $file . "/application.php"); … … 365 367 $contents .= $this->lfGetFileContents(CAMPAIGN_BLOC_PATH . "entry.tpl"); 366 368 } 367 SC_Utils_Ex:: nsfWriteFile($contents, $create_active_dir."contents.tpl", "w");369 SC_Utils_Ex::sfWriteFile($contents, $create_active_dir."contents.tpl", "w"); 368 370 $footer = $this->lfGetFileContents($default_active_dir."footer.tpl"); 369 371 SC_Utils_Ex::sfWriteFile($footer, $create_active_dir."footer.tpl", "w"); -
branches/feature-module-update/html/admin/contents/campaign_create_tag.php
r15532 r16488 6 6 */ 7 7 8 // {{{ requires 8 9 require_once("../require.php"); 9 require_once( DATA_PATH . "include/file_manager.inc");10 require_once(CLASS_EX_PATH . "page_extends/admin/contents/LC_Page_Admin_Contents_CampaignCreateTag_Ex.php"); 10 11 11 class LC_Page { 12 13 function LC_Page() { 14 $this->tpl_mainpage = 'contents/campaign_create_tag.tpl'; 15 $this->tpl_mainno = 'create'; 16 $this->tpl_subtitle = '商品設定'; 17 /* 18 session_start時のno-cacheヘッダーを抑制することで 19 「戻る」ボタン使用時の有効期限切れ表示を抑制する。 20 private-no-expire:クライアントのキャッシュを許可する。 21 */ 22 session_cache_limiter('private-no-expire'); 23 } 24 } 12 // }}} 13 // {{{ generate page 25 14 26 $objPage = new LC_Page(); 27 $objView = new SC_AdminView(); 28 $objSess = new SC_Session(); 29 $objQuery = new SC_Query(); 30 31 // 認証可否の判定 32 sfIsSuccess($objSess); 33 34 switch($_POST['mode']) { 35 36 // 商品検索 37 case 'search': 38 // POST値の引き継ぎ 39 $objPage->arrForm = $_POST; 40 // 入力文字の強制変換 41 lfConvertParam(); 42 43 $where = "del_flg = 0"; 44 45 // where句生成 46 foreach ($objPage->arrForm as $key => $val) { 47 if($val == "") { 48 continue; 49 } 50 51 switch ($key) { 52 case 'search_name': 53 $where .= " AND name ILIKE ?"; 54 $arrval[] = "%$val%"; 55 break; 56 case 'search_category_id': 57 // 子カテゴリIDの取得 58 $arrRet = sfGetChildsID("dtb_category", "parent_category_id", "category_id", $val); 59 $tmp_where = ""; 60 foreach ($arrRet as $val) { 61 if($tmp_where == "") { 62 $tmp_where.= " AND ( category_id = ?"; 63 } else { 64 $tmp_where.= " OR category_id = ?"; 65 } 66 $arrval[] = $val; 67 } 68 $where.= $tmp_where . " )"; 69 break; 70 case 'search_product_id': 71 if($val != "") { 72 $where .= " AND product_id = ?"; 73 if(!sfIsInt($val)) $val = 0; 74 $arrval[] = $val; 75 } 76 break; 77 default: 78 break; 79 } 80 } 81 82 $order = "update_date DESC, product_id DESC "; 83 84 // 読み込む列とテーブルの指定 85 $col = "product_id, name, category_id, main_list_image, status, product_code, price01, stock, stock_unlimited"; 86 $from = "vw_products_nonclass AS noncls "; 87 88 // 行数の取得 89 $linemax = $objQuery->count("dtb_products", $where, $arrval); 90 $objPage->tpl_linemax = $linemax; // 何件が該当しました。表示用 91 92 // ページ送りの処理 93 if(is_numeric($_POST['search_page_max'])) { 94 $page_max = $_POST['search_page_max']; 95 } else { 96 $page_max = SEARCH_PMAX; 97 } 98 99 // ページ送りの取得 100 $objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchOnlyPage", NAVI_PMAX); 101 $objPage->tpl_strnavi = $objNavi->strnavi; // 表示文字列 102 $startno = $objNavi->start_row; 103 104 // 取得範囲の指定(開始行番号、行数のセット) 105 if(DB_TYPE != "mysql") $objQuery->setlimitoffset($page_max, $startno); 106 // 表示順序 107 $objQuery->setorder($order); 108 109 // viewも絞込みをかける(mysql用) 110 sfViewWhere("&&noncls_where&&", $where, $arrval, $objQuery->order . " " . $objQuery->setlimitoffset($page_max, $startno, true)); 111 112 // 検索結果の取得 113 $objPage->arrProducts = $objQuery->select($col, $from, $where, $arrval); 114 break; 115 116 // タグ表示 117 case 'view': 118 119 // タグを生成 120 $create_tag = lfGetCreateTag($_POST['product_id']); 121 $objPage->tpl_create_tag = $create_tag; 122 break; 123 } 124 125 // カテゴリ取得 126 $objPage->arrCatList = sfGetCategoryList(); 127 128 //---- ページ表示 129 $objView->assignobj($objPage); 130 $objView->display($objPage->tpl_mainpage); 131 132 //--------------------------------------------------------------------------------------------------------------------------------------------------------- 133 134 /* 取得文字列の変換 */ 135 function lfConvertParam() { 136 global $objPage; 137 /* 138 * 文字列の変換 139 * K : 「半角(ハンカク)片仮名」を「全角片仮名」に変換 140 * C : 「全角ひら仮名」を「全角かた仮名」に変換 141 * V : 濁点付きの文字を一文字に変換。"K","H"と共に使用します 142 * n : 「全角」数字を「半角(ハンカク)」に変換 143 */ 144 $arrConvList['search_name'] = "KVa"; 145 $arrConvList['search_product_code'] = "KVa"; 146 147 // 文字変換 148 foreach ($arrConvList as $key => $val) { 149 // POSTされてきた値のみ変換する。 150 if(isset($objPage->arrForm[$key])) { 151 $objPage->arrForm[$key] = mb_convert_kana($objPage->arrForm[$key] ,$val); 152 } 153 } 154 } 155 156 /* タグを生成 */ 157 function lfGetCreateTag($product_id) { 158 159 global $objQuery; 160 161 // 書き込みタグ 162 $read_file = file_get_contents(CAMPAIGN_BLOC_PATH . "cart_tag.tpl"); 163 $read_file = ereg_replace("<{assign_product_id}>", $product_id, $read_file); 164 // カートタグ保存用ファイル作成 165 $create_tag .= "<!--{* ▼商品ID$product_id *}-->\n"; 166 $create_tag .= $read_file; 167 168 return $create_tag; 169 } 15 $objPage = new LC_Page_Admin_Contents_CampaignCreateTag_Ex(); 16 register_shutdown_function(array($objPage, "destroy")); 17 $objPage->init(); 18 $objPage->process(); 170 19 ?> -
branches/feature-module-update/html/admin/contents/campaign_design.php
r15532 r16488 5 5 * http://www.lockon.co.jp/ 6 6 */ 7 8 // {{{ requires 7 9 require_once("../../require.php"); 8 require_once( DATA_PATH . "include/file_manager.inc");10 require_once(CLASS_EX_PATH . "page_extends/admin/contents/LC_Page_Admin_Contents_CampaignDesign_Ex.php"); 9 11 10 class LC_Page { 12 // }}} 13 // {{{ generate page 11 14 12 function LC_Page() { 13 $this->tpl_mainpage = 'contents/campaign_design.tpl'; 14 $this->tpl_subnavi = 'contents/subnavi.tpl'; 15 $this->tpl_subno = "campaign"; 16 $this->tpl_mainno = 'contents'; 17 $this->header_row = 13; 18 $this->contents_row = 13; 19 $this->footer_row = 13; 20 $this->tpl_subtitle = 'キャンペーンデザイン編集'; 21 } 22 } 23 24 $objPage = new LC_Page(); 25 $objView = new SC_AdminView(); 26 $objQuery = new SC_Query(); 27 28 // 認証可否の判定 29 $objSess = new SC_Session(); 30 sfIsSuccess($objSess); 31 32 // キャンペーンデータを引き継ぎ 33 if($_POST['mode'] != "") { 34 $arrForm = $_POST; 35 } else { 36 $arrForm = $_GET; 37 } 38 39 // 正しく値が取得できない場合はキャンペーンTOPへ 40 if($arrForm['campaign_id'] == "" || $arrForm['status'] == "") { 41 header("location: ".URL_CAMPAIGN_TOP); 42 } 43 44 switch($arrForm['status']) { 45 case 'active': 46 $status = CAMPAIGN_TEMPLATE_ACTIVE; 47 $objPage->tpl_campaign_title = "キャンペーン中デザイン編集"; 48 break; 49 case 'end': 50 $status = CAMPAIGN_TEMPLATE_END; 51 $objPage->tpl_campaign_title = "キャンペーン終了デザイン編集"; 52 break; 53 default: 54 break; 55 } 56 57 // ディレクトリ名を取得名 58 $directory_name = $objQuery->get("dtb_campaign", "directory_name", "campaign_id = ?", array($arrForm['campaign_id'])); 59 // キャンペーンテンプレート格納ディレクトリ 60 $campaign_dir = CAMPAIGN_TEMPLATE_PATH . $directory_name . "/" .$status; 61 62 switch($_POST['mode']) { 63 case 'regist': 64 // ファイルを更新 65 sfWriteFile($arrForm['header'], $campaign_dir."header.tpl", "w"); 66 sfWriteFile($arrForm['contents'], $campaign_dir."contents.tpl", "w"); 67 sfWriteFile($arrForm['footer'], $campaign_dir."footer.tpl", "w"); 68 // サイトフレーム作成 69 $site_frame = $arrForm['header']."\n"; 70 $site_frame .= '<script type="text/javascript" src="<!--{$smarty.const.URL_DIR}-->js/site.js"></script>'."\n"; 71 $site_frame .= '<script type="text/javascript" src="<!--{$smarty.const.URL_DIR}-->js/navi.js"></script>'."\n"; 72 $site_frame .= '<!--{include file=$tpl_mainpage}-->'."\n"; 73 $site_frame .= $arrForm['footer']."\n"; 74 sfWriteFile($site_frame, $campaign_dir."site_frame.tpl", "w"); 75 76 // 完了メッセージ(プレビュー時は表示しない) 77 $objPage->tpl_onload="alert('登録が完了しました。');"; 78 break; 79 case 'preview': 80 // プレビューを書き出し別窓で開く 81 sfWriteFile($arrForm['header'] . $arrForm['contents'] . $arrForm['footer'], $campaign_dir."preview.tpl", "w"); 82 $objPage->tpl_onload = "win02('./campaign_preview.php?status=". $arrForm['status'] ."&campaign_id=". $arrForm['campaign_id'] ."', 'preview', '600', '400');"; 83 $objPage->header_data = $arrForm['header']; 84 $objPage->contents_data = $arrForm['contents']; 85 $objPage->footer_data = $arrForm['footer']; 86 break; 87 case 'return': 88 // 登録ページへ戻る 89 header("location: ".URL_CAMPAIGN_TOP); 90 break; 91 default: 92 break; 93 } 94 95 if ($arrForm['header_row'] != ''){ 96 $objPage->header_row = $arrForm['header_row']; 97 } 98 if ($arrForm['contents_row'] != ''){ 99 $objPage->contents_row = $arrForm['contents_row']; 100 } 101 if ($arrForm['footer_row'] != ''){ 102 $objPage->footer_row = $arrForm['footer_row']; 103 } 104 105 if($_POST['mode'] != 'preview') { 106 // ヘッダーファイルの読み込み 107 $objPage->header_data = file_get_contents($campaign_dir . "header.tpl"); 108 // コンテンツファイルの読み込み 109 $objPage->contents_data = file_get_contents($campaign_dir . "contents.tpl"); 110 // フッターファイルの読み込み 111 $objPage->footer_data = file_get_contents($campaign_dir . "footer.tpl"); 112 } 113 114 // フォームの値を格納 115 $objPage->arrForm = $arrForm; 116 117 // 画面の表示 118 $objView->assignobj($objPage); 119 $objView->display(MAIN_FRAME); 120 121 //--------------------------------------------------------------------------------------------------------------------------------------------------------- 15 $objPage = new LC_Page_Admin_Contents_CampaignDesign_Ex(); 16 register_shutdown_function(array($objPage, "destroy")); 17 $objPage->init(); 18 $objPage->process(); 19 ?> -
branches/feature-module-update/html/admin/contents/campaign_preview.php
r15532 r16488 5 5 * http://www.lockon.co.jp/ 6 6 */ 7 require_once("../require.php");8 7 9 //---- ページ表示クラス 10 class LC_Page { 11 12 function LC_Page() { 13 } 14 } 8 // {{{ requires 9 require_once("../../require.php"); 10 require_once(CLASS_EX_PATH . "page_extends/admin/contents/LC_Page_Admin_Contents_CampaignPreview_Ex.php"); 15 11 16 $objPage = new LC_Page(); 17 $objView = new SC_SiteView(false); 18 $objQuery = new SC_Query(); 12 // }}} 13 // {{{ generate page 19 14 20 // 正しく値が取得できない場合はキャンペーンTOPへ 21 if($_GET['campaign_id'] == "" || $_GET['status'] == "") { 22 header("location: ".URL_CAMPAIGN_TOP); 23 } 24 25 // statusの判別 26 switch($_GET['status']) { 27 case 'active': 28 $status = CAMPAIGN_TEMPLATE_ACTIVE; 29 break; 30 case 'end': 31 $status = CAMPAIGN_TEMPLATE_END; 32 break; 33 default: 34 $status = CAMPAIGN_TEMPLATE_ACTIVE; 35 break; 36 } 37 38 // ディレクトリ名を取得名 39 $directory_name = $objQuery->get("dtb_campaign", "directory_name", "campaign_id = ?", array($_GET['campaign_id'])); 40 41 $template_dir = CAMPAIGN_TEMPLATE_PATH . $directory_name . "/" . $status . "preview.tpl"; 42 43 //---- ページ表示 44 $objView->assignobj($objPage); 45 $objView->display($template_dir); 15 $objPage = new LC_Page_Admin_Contents_CampaignPreview_Ex(); 16 register_shutdown_function(array($objPage, "destroy")); 17 $objPage->init(); 18 $objPage->process(); 19 ?>
Note: See TracChangeset
for help on using the changeset viewer.