Skip to content

Commit

Permalink
refs #1703 : enhanced - checkbox information is now saved.
Browse files Browse the repository at this point in the history
 -
  • Loading branch information
inureyes committed Nov 17, 2014
1 parent d613322 commit 7afb91f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 8 deletions.
26 changes: 22 additions & 4 deletions interface/owner/communication/comment/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
'perPage' => array('int', 1, 'mandatory' => false),
'search' => array('string', 'default' => ''),
'withSearch' => array(array('on'), 'mandatory' => false),
'status' => array('string', 'mandatory' => false)
'status' => array('string', 'mandatory' => false),
'deleteItemsFromSameIP' => array('int','mandatory' => false)
)
);
require ROOT . '/library/preprocessor.php';
Expand All @@ -42,7 +43,7 @@
$perPage = Setting::getBlogSettingGlobal('rowsPerPage', 10);
if (isset($_POST['perPage']) && is_numeric($_POST['perPage'])) {
$perPage = $_POST['perPage'];
setBlogSetting('rowsPerPage', $_POST['perPage']);
Setting::setBlogSettingGlobal('rowsPerPage', $_POST['perPage']);
}

$tabsClass = array();
Expand All @@ -57,14 +58,30 @@
if($_POST['status']=='comment') {
$tabsClass['comment'] = true;
$visibilityText = _t('댓글');
$midfix = 'Comment';
} else if($_POST['status']=='guestbook') {
$tabsClass['guestbook'] = true;
$visibilityText = _t('방명록');
$midfix = 'Guestbook';
}
} else {
$tabsClass['comment'] = true;
$visibilityText = _t('댓글');
$midfix = 'Comment';
}

$deleteCommentsFromSameIP = intval(Setting::getBlogSettingGlobal('delete'.$midfix.'sFromSameIP', 0));

if (isset($_POST['deleteItemsFromSameIP'])) {
if ($_POST['deleteItemsFromSameIP'] == '1') {
Setting::setBlogSettingGlobal('delete'.$midfix.'sFromSameIP',1);
$deleteCommentsFromSameIP = 1;
} else {
Setting::setBlogSettingGlobal('delete'.$midfix.'sFromSameIP',0);
$deleteCommentsFromSameIP = 0;
}
}

if(isset($tabsClass['comment']) && $tabsClass['comment'] == true) {
list($comments, $paging) = getCommentsWithPagingForOwner($blogid, $categoryId, $name, $ip, $search, $suri['page'], $perPage);
} else {
Expand Down Expand Up @@ -292,7 +309,8 @@ function toggleThisTr(tr, isActive) {
<span class="label"><?php echo _t('선택한 댓글을');?></span>
<input type="button" class="delete-button input-button" value="<?php echo _t('삭제');?>" onclick="deleteComments();" />
<span class="label"><?php echo (isset($tabsClass['guestbook']) ? _t('선택한 방명록을 삭제할 때 해당 방명록과 동일한 IP에서 발송된 댓글들도 함께 삭제합니다') : _t('선택한 댓글을 삭제할 때 해당 댓글과 동일한 IP에서 발송된 댓글들도 함께 삭제합니다'));?></span>
<input type="checkbox" id="deleteCommentsFromSameIP" class="checkbox" />
<input type="checkbox" id="deleteCommentsFromSameIP" class="checkbox" onchange="document.getElementById('list-form').deleteItemsFromSameIP.value=<?php echo ($deleteCommentsFromSameIP ? "0" : "1");?>;document.getElementById('list-form').submit();" <?php echo ($deleteCommentsFromSameIP ? "checked " : "");?>/>

</div>

<table class="data-inbox" cellspacing="0" cellpadding="0">
Expand Down Expand Up @@ -422,7 +440,7 @@ function toggleThisTr(tr, isActive) {
<input type="hidden" name="page" value="<?php echo $suri['page'];?>" />
<input type="hidden" name="name" value="" />
<input type="hidden" name="ip" value="" />

<input type="hidden" name="deleteItemsFromSameIP" value="<?php echo ($deleteCommentsFromSameIP ? "1" : "0");?>" />
<div id="delete-section" class="section">
<span class="label"><?php echo _t('선택한 댓글을');?></span>
<input type="button" class="delete-button input-button" value="<?php echo _t('삭제');?>" onclick="deleteComments();" />
Expand Down
20 changes: 16 additions & 4 deletions interface/owner/communication/trackback/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
'withSearch' => array(array('on'), 'mandatory' => false),
'search' => array('string', 'default' => ''),
'perPage' => array('int', 1, 'mandatory' => false),
'status' => array('string', 'mandatory' => false)
'status' => array('string', 'mandatory' => false),
'deleteItemsFromSameIP' => array('int','mandatory' => false)
)
);
require ROOT . '/library/preprocessor.php';
Expand All @@ -42,7 +43,17 @@
$perPage = Setting::getBlogSettingGlobal('rowsPerPage', 10);
if (isset($_POST['perPage']) && is_numeric($_POST['perPage'])) {
$perPage = $_POST['perPage'];
setBlogSetting('rowsPerPage', $_POST['perPage']);
Setting::setBlogSettingGlobal('rowsPerPage', $_POST['perPage']);
}
$deleteTrackbacksFromSameIP = intval(Setting::getBlogSettingGlobal('deleteTrackbacksFromSameIP', 0));
if (isset($_POST['deleteItemsFromSameIP'])) {
if ($_POST['deleteItemsFromSameIP'] == '1') {
Setting::setBlogSettingGlobal('deleteTrackbacksFromSameIP',1);
$deleteTrackbacksFromSameIP = 1;
} else {
Setting::setBlogSettingGlobal('deleteTrackbacksFromSameIP',0);
$deleteTrackbacksFromSameIP = 0;
}
}

$tabsClass = array();
Expand Down Expand Up @@ -323,7 +334,8 @@ function toggleThisTr(tr, isActive) {
if(isset($tabsClass['received'])) {
?>
<span class="label"><?php echo _t('선택한 걸린글을 삭제할 때 해당 걸린글과 동일한 IP에서 발송된 걸린글들도 함께 삭제합니다');?></span>
<input type="checkbox" id="deleteTrackbacksFromSameIP" class="checkbox" />

<input type="checkbox" id="deleteTrackbacksFromSameIP" class="checkbox" onchange="document.getElementById('list-form').deleteItemsFromSameIP.value=<?php echo ($deleteTrackbacksFromSameIP ? "0" : "1");?>;document.getElementById('list-form').submit();" <?php echo ($deleteTrackbacksFromSameIP ? "checked " : "");?>/>
<?php
}
?>
Expand Down Expand Up @@ -472,7 +484,7 @@ function toggleThisTr(tr, isActive) {
<input type="hidden" name="page" value="<?php echo $suri['page'];?>" />
<input type="hidden" name="site" value="" />
<input type="hidden" name="ip" value="" />

<input type="hidden" name="deleteItemsFromSameIP" value="<?php echo ($deleteTrackbacksFromSameIP ? "1" : "0");?>" />
<div id="delete-section" class="section">
<span class="label"><?php echo _t('선택한 걸린글을');?></span>
<input type="button" class="delete-button input-button" value="<?php echo _t('삭제');?>" onclick="trashTrackbacks();" />
Expand Down

0 comments on commit 7afb91f

Please sign in to comment.