|
@@ -39,8 +39,7 @@ class SiteAlbumController extends AdminController
|
|
|
->header(admin_trans( 'admin.album'))
|
|
|
->body($this->indexForm());
|
|
|
$html = $html->render();
|
|
|
-
|
|
|
- $html = preg_replace('/<form(.*?)method="post"(.*?)>/s', '<form$1method="get"$2>', $html, 1);
|
|
|
+
|
|
|
|
|
|
preg_match('/<form[^>]*id="([^"]*)"[^>]*>/', $html, $matches);
|
|
|
if (isset($matches[1])) {
|
|
@@ -51,7 +50,8 @@ class SiteAlbumController extends AdminController
|
|
|
$html = preg_replace($pattern, '', $html);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+ $html = preg_replace('/<form([^>]*)>(.*?)<\/form>/s', '<div$1>$2</div>', $html, 1);
|
|
|
|
|
|
return $html;
|
|
|
}
|
|
@@ -103,6 +103,12 @@ const firstCheckbox = document.querySelector('.vs-checkbox-primary');
|
|
|
if (firstCheckbox) {
|
|
|
firstCheckbox.style.display = 'none';
|
|
|
}
|
|
|
+
|
|
|
+const input = document.querySelector('input[name="_previous_"]');
|
|
|
+if (input) {
|
|
|
+
|
|
|
+ input.value = '';
|
|
|
+}
|
|
|
JS
|
|
|
);
|
|
|
});
|
|
@@ -187,7 +193,15 @@ JS
|
|
|
$folderId = getTempValue('folderId');
|
|
|
$form->select('folder_id')->options(SiteAlbumFolder::selectOptions())->default($folderId)->required();
|
|
|
$form->text('model')->required();
|
|
|
+ $form->table('parameters',admin_trans_label('attribute_name'), function (Form\NestedForm $table) {
|
|
|
+ $table->text('key')->required();
|
|
|
+ $table->text('value')->required();
|
|
|
+ })->setView('admin.form_custom.hasmanytable')
|
|
|
+ ->saving(function ($input) {
|
|
|
+ return json_encode($input);
|
|
|
+ });
|
|
|
$form->switch('enabled')->default(1);
|
|
|
+
|
|
|
})->tab(admin_trans_label('cover'), function (Form $form) {
|
|
|
$form->multipleImage('cover')
|
|
|
->retainable()
|
|
@@ -252,7 +266,8 @@ JS
|
|
|
->retainable()
|
|
|
->removable()
|
|
|
->autoUpload()
|
|
|
- ->uniqueName()
|
|
|
+ ->uniqueName()
|
|
|
+ ->downloadable()
|
|
|
->accept(config('admin.upload.oss_video.accept'))
|
|
|
->maxSize(config('admin.upload.oss_video.max_size'))
|
|
|
->dir(config("admin.upload.directory.video").'/uploads/'.date("Ymd"))
|
|
@@ -306,6 +321,7 @@ JS
|
|
|
->removable()
|
|
|
->autoUpload()
|
|
|
->uniqueName()
|
|
|
+ ->downloadable()
|
|
|
->accept(config('admin.upload.oss_pdf.accept'))
|
|
|
->maxSize(config('admin.upload.oss_pdf.max_size'))
|
|
|
->dir(config("admin.upload.directory.pdf").'/uploads/'.date("Ymd"))
|