mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-15 21:41:03 +08:00
ban/unban torrent send notification
This commit is contained in:
@@ -147,9 +147,45 @@ else {
|
||||
|
||||
tr($lang_edit['row_content'],$team_select,1);
|
||||
}
|
||||
// tr($lang_functions['text_tags'], torrentTags($row['tags'], 'checkbox'), 1);
|
||||
tr($lang_functions['text_tags'], (new \App\Repositories\TagRepository())->renderCheckbox($tagIdArr), 1);
|
||||
tr($lang_edit['row_check'], "<input type=\"checkbox\" name=\"visible\"" . ($row["visible"] == "yes" ? " checked=\"checked\"" : "" ) . " value=\"1\" /> ".$lang_edit['checkbox_visible']." ".(get_user_class() >= $beanonymous_class || get_user_class() >= $torrentmanage_class ? "<input type=\"checkbox\" name=\"anonymous\"" . ($row["anonymous"] == "yes" ? " checked=\"checked\"" : "" ) . " value=\"1\" />".$lang_edit['checkbox_anonymous_note']." " : "").(get_user_class() >= $torrentmanage_class ? "<input type=\"checkbox\" name=\"banned\"" . (($row["banned"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"yes\" /> ".$lang_edit['checkbox_banned'] : ""), 1);
|
||||
|
||||
$rowChecks = [];
|
||||
if (get_user_class() >= $beanonymous_class || get_user_class() >= $torrentmanage_class) {
|
||||
$rowChecks[] = "<label><input type=\"checkbox\" name=\"anonymous\"" . ($row["anonymous"] == "yes" ? " checked=\"checked\"" : "" ) . " value=\"1\" />".$lang_edit['checkbox_anonymous_note']."</label>";
|
||||
}
|
||||
if (get_user_class() >= $torrentmanage_class) {
|
||||
array_unshift($rowChecks, "<label><input type=\"checkbox\" name=\"visible\"" . ($row["visible"] == "yes" ? " checked=\"checked\"" : "" ) . " value=\"1\" />".$lang_edit['checkbox_visible']."</label>");
|
||||
$rowChecks[] = "<label><input type=\"checkbox\" name=\"banned\"" . (($row["banned"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"yes\" />".$lang_edit['checkbox_banned']."</label>";
|
||||
$banLog = \App\Models\TorrentOperationLog::query()->where('torrent_id', $row['id'])->where('action_type', \App\Models\TorrentOperationLog::ACTION_TYPE_BAN)->orderBy('id', 'desc')->first();
|
||||
$banReasonDisplay = "none";
|
||||
$banReasonReadonly = "";
|
||||
if ($row['banned'] == 'yes') {
|
||||
$banReasonDisplay = 'inline-block';
|
||||
$banReasonReadonly = " readonly disabled";
|
||||
}
|
||||
$rowChecks[] = sprintf(
|
||||
'<span id="ban-reason-box" style="display: %s">%s:<input type="text" name="ban_reason" value="%s" style="width: 300px"%s/></span>',
|
||||
$banReasonDisplay, $lang_edit['ban_reason_label'], $row['banned'] == 'yes' && $banLog ? $banLog->comment : '', $banReasonReadonly
|
||||
);
|
||||
$js = <<<JS
|
||||
let banReasonBox = jQuery('#ban-reason-box')
|
||||
jQuery('input[name=banned]').on("change", function () {
|
||||
let _this = jQuery(this)
|
||||
let checked = _this.prop('checked')
|
||||
if (checked) {
|
||||
banReasonBox.show()
|
||||
} else {
|
||||
banReasonBox.hide()
|
||||
}
|
||||
})
|
||||
JS;
|
||||
\Nexus\Nexus::js($js, 'footer', false);
|
||||
|
||||
}
|
||||
if (!empty($rowChecks)) {
|
||||
tr($lang_edit['row_check'], implode(' ', $rowChecks), 1);
|
||||
}
|
||||
|
||||
if (get_user_class()>= $torrentsticky_class || (get_user_class() >= $torrentmanage_class && $CURUSER["picker"] == 'yes')){
|
||||
$pickcontent = $pickcontentPrefix = "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user