mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
fix searchbox check
This commit is contained in:
@@ -79,6 +79,7 @@ class SectionResource extends Resource
|
|||||||
Forms\Components\CheckboxList::make('custom_fields')
|
Forms\Components\CheckboxList::make('custom_fields')
|
||||||
->options(TorrentCustomField::getCheckboxOptions())
|
->options(TorrentCustomField::getCheckboxOptions())
|
||||||
->label(__('label.search_box.custom_fields'))
|
->label(__('label.search_box.custom_fields'))
|
||||||
|
->columns(4)
|
||||||
,
|
,
|
||||||
Forms\Components\TextInput::make('custom_fields_display_name')
|
Forms\Components\TextInput::make('custom_fields_display_name')
|
||||||
->label(__('label.search_box.custom_fields_display_name'))
|
->label(__('label.search_box.custom_fields_display_name'))
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class SearchBox extends NexusModel
|
|||||||
$other = $data['other'] ?? [];
|
$other = $data['other'] ?? [];
|
||||||
$data["extra->" . self::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST] = in_array(self::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST, $other) ? 1 : 0;
|
$data["extra->" . self::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST] = in_array(self::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST, $other) ? 1 : 0;
|
||||||
$data["extra->" . self::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST] = in_array(self::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST, $other) ? 1 : 0;
|
$data["extra->" . self::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST] = in_array(self::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST, $other) ? 1 : 0;
|
||||||
|
$data['custom_fields'] = array_filter($data['custom_fields']);
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ class TorrentCustomField extends NexusModel
|
|||||||
{
|
{
|
||||||
protected $table = 'torrents_custom_fields';
|
protected $table = 'torrents_custom_fields';
|
||||||
|
|
||||||
|
public $timestamps = true;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'name', 'label', 'type', 'required', 'is_single_row', 'options', 'help', 'display', 'priority'
|
'name', 'label', 'type', 'required', 'is_single_row', 'options', 'help', 'display', 'priority'
|
||||||
];
|
];
|
||||||
@@ -21,7 +23,5 @@ class TorrentCustomField extends NexusModel
|
|||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
public $timestamps = true;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-4
@@ -6063,8 +6063,19 @@ function build_search_box_category_table($mode, $checkboxValue, $categoryHrefPre
|
|||||||
foreach ($chunk as $item) {
|
foreach ($chunk as $item) {
|
||||||
if ($item->mode != -1) {
|
if ($item->mode != -1) {
|
||||||
$checked = '';
|
$checked = '';
|
||||||
if (str_contains($checkedValues, "[cat{$item->id}]") || str_contains($checkedValues, "cat{$item->id}=1")) {
|
if ($checkedValues) {
|
||||||
$checked = " checked";
|
if (
|
||||||
|
str_contains($checkedValues, "[cat{$item->id}]")
|
||||||
|
|| str_contains($checkedValues, "cat{$item->id}=1")
|
||||||
|
|| str_contains($checkedValues, "cat={$item->id}")
|
||||||
|
) {
|
||||||
|
$checked = " checked";
|
||||||
|
}
|
||||||
|
} elseif (!empty($options['user_notifs'])) {
|
||||||
|
$userNotifsKey = sprintf('[%s%s]', 'cat', $item->id);
|
||||||
|
if (str_contains($options['user_notifs'], $userNotifsKey)) {
|
||||||
|
$checked = ' checked';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$icon = $item->icon;
|
$icon = $item->icon;
|
||||||
$iconFolder = trim($icon->folder, '/');
|
$iconFolder = trim($icon->folder, '/');
|
||||||
@@ -6126,8 +6137,14 @@ TD;
|
|||||||
$afterInput = $item->name;
|
$afterInput = $item->name;
|
||||||
}
|
}
|
||||||
$checked = '';
|
$checked = '';
|
||||||
if (str_contains($checkedValues, "[{$namePrefix}{$item->id}]") || str_contains($checkedValues, "{$namePrefix}{$item->id}=1")) {
|
if ($checkedValues) {
|
||||||
$checked = ' checked';
|
if (
|
||||||
|
str_contains($checkedValues, "[{$namePrefix}{$item->id}]")
|
||||||
|
|| str_contains($checkedValues, "{$namePrefix}{$item->id}=1")
|
||||||
|
|| str_contains($checkedValues, "{$namePrefix}={$item->id}")
|
||||||
|
) {
|
||||||
|
$checked = ' checked';
|
||||||
|
}
|
||||||
} elseif (!empty($options['user_notifs'])) {
|
} elseif (!empty($options['user_notifs'])) {
|
||||||
$userNotifsKey = sprintf('[%s%s]', substr($torrentField, 0, 3), $item->id);
|
$userNotifsKey = sprintf('[%s%s]', substr($torrentField, 0, 3), $item->id);
|
||||||
if (str_contains($options['user_notifs'], $userNotifsKey)) {
|
if (str_contains($options['user_notifs'], $userNotifsKey)) {
|
||||||
|
|||||||
@@ -110,9 +110,11 @@ if($_SERVER['REQUEST_METHOD'] === 'POST'){
|
|||||||
begin_frame($lang_complains['text_new_body']);
|
begin_frame($lang_complains['text_new_body']);
|
||||||
printf('%s:%s<br />%s %s', $lang_complains['text_added'], gettime($complain['added']), $lang_complains['text_new_email'], htmlspecialchars($complain['email']));
|
printf('%s:%s<br />%s %s', $lang_complains['text_added'], gettime($complain['added']), $lang_complains['text_new_email'], htmlspecialchars($complain['email']));
|
||||||
if($isAdmin) {
|
if($isAdmin) {
|
||||||
printf(' [<a href="usersearch.php?em=%s" class="faqlink" target="_blank">%s</a>]', urlencode($complain['email']), $lang_complains['text_search_account']);
|
|
||||||
if ($user) {
|
if ($user) {
|
||||||
|
printf(' [<a href="userdetails.php?id=%s" class="faqlink" target="_blank">%s</a>]', $user->id, $user->username);
|
||||||
printf(' [<a href="user-ban-log.php?q=%s" class="faqlink" target="_blank">%s</a>]', urlencode($user->username), $lang_complains['text_view_band_log']);
|
printf(' [<a href="user-ban-log.php?q=%s" class="faqlink" target="_blank">%s</a>]', urlencode($user->username), $lang_complains['text_view_band_log']);
|
||||||
|
} else {
|
||||||
|
printf(' [<a href="usersearch.php?em=%s" class="faqlink" target="_blank">%s</a>]', urlencode($complain['email']), $lang_complains['text_search_account']);
|
||||||
}
|
}
|
||||||
printf('<br />IP: ' . htmlspecialchars($complain['ip']));
|
printf('<br />IP: ' . htmlspecialchars($complain['ip']));
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -308,7 +308,7 @@ function SetChecked(chkName,ctrlName,checkall_name,uncheckall_name,start,count)
|
|||||||
|
|
||||||
}
|
}
|
||||||
for( i=begin ; i<end ; i++) {
|
for( i=begin ; i<end ; i++) {
|
||||||
if (dml.elements[i].name.indexOf(chkName) != -1) {
|
if (dml.elements[i].name.indexOf(chkName) == 0) {
|
||||||
dml.elements[i].checked=check_state;
|
dml.elements[i].checked=check_state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user