Changeset 5587 for trunk/interface/owner/entry/trackback/index.php
- Timestamp:
- 03/10/08 22:12:20 (9 months ago)
- Files:
-
- 1 modified
-
trunk/interface/owner/entry/trackback/index.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/interface/owner/entry/trackback/index.php
r5285 r5587 11 11 if (isset($_GET['withSearch'])) $_POST['withSearch'] = $_GET['withSearch']; 12 12 if (isset($_GET['search'])) $_POST['search'] = $_GET['search']; 13 if (isset($_GET['status'])) $_POST['status'] = $_GET['status']; 13 14 14 15 $IV = array( … … 24 25 'withSearch' => array(array('on'), 'mandatory' => false), 25 26 'search' => array('string', 'default' => ''), 26 'perPage' => array('int', 1, 'mandatory' => false) 27 'perPage' => array('int', 1, 'mandatory' => false), 28 'status' => array('string', 'mandatory' => false) 27 29 ) 28 30 ); … … 41 43 setBlogSetting('rowsPerPage', $_POST['perPage']); 42 44 } 43 list($trackbacks, $paging) = getTrackbacksWithPagingForOwner($blogid, $categoryId, $site, $ip, $search, $suri['page'], $perPage); 45 46 $tabsClass = array(); 47 if (isset($_POST['status'])) { 48 if($_POST['status']=='received') { 49 $tabsClass['received'] = true; 50 $visibilityText = _t('걸린 글'); 51 } else if($_POST['status']=='sent') { 52 $tabsClass['sent'] = true; 53 $visibilityText = _t('건 글'); 54 } 55 } else { 56 $tabsClass['received'] = true; 57 $visibilityText = _t('걸린 글'); 58 } 59 if($tabsClass['received'] == true) { 60 list($trackbacks, $paging) = getTrackbacksWithPagingForOwner($blogid, $categoryId, $site, $ip, $search, $suri['page'], $perPage); 61 } else { 62 list($trackbacks, $paging) = getTrackbackLogsWithPagingForOwner($blogid, $categoryId, $site, $ip, $search, $suri['page'], $perPage); 63 } 64 44 65 require ROOT . '/lib/piece/owner/header.php'; 45 66 require ROOT . '/lib/piece/owner/contentMenu.php'; 67 46 68 ?> 47 69 <script type="text/javascript"> 48 70 //<![CDATA[ 49 function changeState(caller, value, mode) { 71 <?php 72 if($tabsClass['received'] == true) { 73 ?> 74 function changeState(caller, value, mode) { 50 75 try { 51 76 if (caller.className == 'block-icon bullet') { … … 120 145 } 121 146 } 147 <?php 148 } else { 149 ?> 150 function removeTrackbackLog(id) { 151 if (confirm("선택된 글걸기 기록을 지웁니다. 계속 하시겠습니까?")) { 152 var request = new HTTPRequest("<?php echo $blogURL;?>/owner/entry/trackback/log/remove/" + id); 153 request.onSuccess = function () { 154 document.getElementById('list-form').submit(); 155 } 156 request.onError = function () { 157 alert("글걸기 기록을 지우지 못했습니다."); 158 } 159 request.send(); 160 } 161 } 162 163 function trashTrackbacks() { 164 try { 165 if (!confirm("<?php echo _t('선택된 걸린글 기록을 지웁니다. 계속 하시겠습니까?');?>")) 166 return false; 167 var oElement; 168 var targets = new Array(); 169 for (i = 0; document.getElementById('list-form').elements[i]; i ++) { 170 oElement = document.getElementById('list-form').elements[i]; 171 if ((oElement.name == "entry") && oElement.checked) 172 targets[targets.length] = oElement.value; 173 } 174 var request = new HTTPRequest("POST", "<?php echo $blogURL;?>/owner/entry/trackback/log/remove/"); 175 request.onSuccess = function() { 176 document.getElementById('list-form').submit(); 177 } 178 alert(targets.join(",")); 179 request.send("targets=" + targets.join(",")); 180 } catch(e) { 181 alert(e.message); 182 } 183 } 184 <?php 185 } 186 ?> 122 187 123 188 function checkAll(checked) { … … 169 234 ?> 170 235 </h2> 171 236 <ul id="entry-tabs-box" class="tabs-box"> 237 <!-- TODO : $tab['postfix'] 버그 --> 238 <li<?php echo isset($tabsClass['received']) ? ' class="selected"' : NULL;?>><a href="<?php echo $blogURL;?>/owner/entry/trackback?page=1<?php echo $tab['postfix'];?>&status=received"><?php echo _t('걸린 글');?></a></li> 239 <li<?php echo isset($tabsClass['sent']) ? ' class="selected"' : NULL;?>><a href="<?php echo $blogURL;?>/owner/entry/trackback?page=1<?php echo $tab['postfix'];?>&status=sent"><?php echo _t('건 글');?></a></li> 240 </ul> 241 172 242 <form id="category-form" class="category-box" method="post" action="<?php echo $blogURL;?>/owner/entry/trackback"> 173 243 <div class="section"> 174 244 <input type="hidden" name="page" value="<?php echo $suri['page'];?>" /> 175 245 <?php 246 if(!isset($tabsClass['received'])) { 247 ?> 248 <input type="hidden" name="status" value="sent" /> 249 <?php } ?> 176 250 <select id="category" name="category" onchange="document.getElementById('category-form').page.value=1; document.getElementById('category-form').submit()"> 177 251 <option value="0"><?php echo _t('전체');?></option> … … 192 266 </div> 193 267 </form> 194 268 195 269 <form id="list-form" method="post" action="<?php echo $blogURL;?>/owner/entry/trackback"> 270 <?php 271 if(!isset($tabsClass['received'])) { 272 ?> 273 <input type="hidden" name="status" value="sent" /> 274 <?php } ?> 196 275 <table class="data-inbox" cellspacing="0" cellpadding="0"> 197 276 <thead> … … 199 278 <th class="selection"><input type="checkbox" id="allChecked" class="checkbox" onclick="checkAll(this.checked);" disabled="disabled" /></th> 200 279 <th class="date"><span class="text"><?php echo _t('등록일자');?></span></th> 201 <th class="site"><span class="text"><?php echo _t('사이트명');?></span></th>280 <th class="site"><span class="text"><?php echo (isset($tabsClass['received']) ? _t('사이트 이름') : _t('보낸 주소'));?></span></th> 202 281 <th class="category"><span class="text"><?php echo _t('분류');?></span></th> 203 <th class="title"><span class="text"><?php echo _t('제목');?></span></th> 282 <th class="title"><span class="text"><?php echo (isset($tabsClass['received']) ? _t('받은 글 제목') : _t('보낸 글 제목'));?></span></th> 283 <?php if(isset($tabsClass['received'])) { 284 ?> 204 285 <th class="ip"><acronym title="Internet Protocol">ip</acronym></th> 286 <?php } ?> 205 287 <th class="delete"><span class="text"><?php echo _t('삭제');?></span></th> 206 288 </tr> … … 211 293 for ($i=0; $i<sizeof($trackbacks); $i++) { 212 294 $trackback = $trackbacks[$i]; 213 214 295 requireComponent('Textcube.Data.Filter'); 215 296 $isFilterURL = Filter::isFiltered('url', $trackback['url']); … … 238 319 <td class="site"> 239 320 <?php 240 if ($isFilterURL) { 321 if(isset($tabsClass['received'])) { 322 if ($isFilterURL) { 241 323 ?> 242 324 <a id="urlFilter<?php echo $currentSite;?>-<?php echo $i;?>" class="block-icon bullet" href="<?php echo $blogURL;?>/owner/setting/filter/change/?value=<?php echo urlencode($filteredURL);?>&mode=url&command=unblock" onclick="changeState(this,'<?php echo $filteredURL;?>','url'); return false;" title="<?php echo _t('이 사이트는 차단되었습니다. 클릭하시면 차단을 해제합니다.');?>"><span class="text"><?php echo _t('[차단됨]');?></span></a> 243 325 <?php 244 } else {326 } else { 245 327 ?> 246 328 <a id="urlFilter<?php echo $currentSite;?>-<?php echo $i;?>" class="unblock-icon bullet" href="<?php echo $blogURL;?>/owner/setting/filter/change/?value=<?php echo urlencode($filteredURL);?>&mode=url&command=block" onclick="changeState(this,'<?php echo $filteredURL;?>','url'); return false;" title="<?php echo _t('이 사이트는 차단되지 않았습니다. 클릭하시면 차단합니다.');?>"><span class="text"><?php echo _t('[허용됨]');?></span></a> 247 329 <?php 248 }330 } 249 331 ?> 250 332 <a href="?site=<?php echo urlencode(escapeJSInAttribute($trackback['site']));?>" title="<?php echo _t('이 사이트에서 건 글 목록을 보여줍니다.');?>"><?php echo htmlspecialchars($trackback['site']);?></a> 333 <?php 334 } else { 335 ?> 336 <a href="<?php echo htmlspecialchars($trackback['url']);?>"><?php echo link_cut(htmlspecialchars($trackback['url']),30);?></a> 337 <?php 338 } 339 ?> 251 340 </td> 252 341 <td class="category"> … … 266 355 <a href="<?php echo $trackback['url'];?>" onclick="window.open(this.href); return false;" title="<?php echo _t('글을 건 글을 보여줍니다.');?>"><?php echo htmlspecialchars($trackback['subject']);?></a> 267 356 </td> 357 <?php 358 if(isset($tabsClass['received'])) { 359 ?> 268 360 <td class="ip"> 269 361 <?php 270 if ($isIpFiltered) {362 if ($isIpFiltered) { 271 363 ?> 272 364 <a id="ipFilter<?php echo urlencode($trackback['ip']);?>-<?php echo $i;?>" class="block-icon bullet" href="<?php echo $blogURL;?>/owner/setting/filter/change/?value=<?php echo urlencode($trackback['ip']);?>&mode=ip&command=unblock" onclick="changeState(this,'<?php echo urlencode($trackback['ip']);?>', 'ip'); return false;" title="<?php echo _t('이 IP는 차단되었습니다. 클릭하시면 차단을 해제합니다.');?>"><span class="text"><?php echo _t('[차단됨]');?></span></a> 273 365 <?php 274 } else {366 } else { 275 367 ?> 276 368 <a id="ipFilter<?php echo urlencode($trackback['ip']);?>-<?php echo $i;?>" class="unblock-icon bullet" href="<?php echo $blogURL;?>/owner/setting/filter/change/?value=<?php echo urlencode($trackback['ip']);?>&mode=ip&command=block" onclick="changeState(this,'<?php echo urlencode($trackback['ip']);?>', 'ip'); return false;" title="<?php echo _t('이 IP는 차단되지 않았습니다. 클릭하시면 차단합니다.');?>"><span class="text"><?php echo _t('[허용됨]');?></span></a> 277 369 <?php 278 }370 } 279 371 ?> 280 372 281 373 <a href="?ip=<?php echo urlencode(escapeJSInAttribute($trackback['ip']));?>" title="<?php echo _t('이 IP로 등록된 걸린글 목록을 보여줍니다.');?>"><?php echo $trackback['ip'];?></a> 282 374 </td> 375 <?php 376 } 377 ?> 283 378 <td class="delete"> 379 <?php 380 if(isset($tabsClass['received'])) { 381 ?> 284 382 <a class="delete-button button" href="<?php echo $blogURL;?>/owner/entry/trackback/delete/<?php echo $trackback['id'];?>" onclick="trashTrackback(<?php echo $trackback['id'];?>); return false;" title="<?php echo _t('이 걸린글을 삭제합니다.');?>"><span class="text"><?php echo _t('삭제');?></span></a> 383 <?php 384 } else { 385 ?> 386 <a class="delete-button button" href="<?php echo $blogURL;?>/owner/entry/trackback/log/remove/<?php echo $trackback['id'];?>" onclick="removeTrackbackLog(<?php echo $trackback['id'];?>); return false;" title="<?php echo _t('이 글걸기 기록을 삭제합니다.');?>"><span class="text"><?php echo _t('삭제');?></span></a> 387 <?php 388 } 389 ?> 285 390 </td> 286 391 </tr> … … 350 455 <input type="text" id="search" class="input-text" name="search" value="<?php echo htmlspecialchars($search);?>" onkeydown="if (event.keyCode == '13') { document.getElementById('search-form').withSearch.value = 'on'; document.getElementById('search-form').submit(); }" /> 351 456 <input type="hidden" name="withSearch" value="" /> 457 <?php 458 if(!isset($tabsClass['received'])) { 459 ?> 460 <input type="hidden" name="status" value="sent" /> 461 <?php } ?> 352 462 <input type="submit" class="search-button input-button" value="<?php echo _t('검색');?>" onclick="document.getElementById('search-form').withSearch.value = 'on'; document.getElementById('search-form').submit();" /> 353 463 </div>
