From 0c3e087f094b60fc7e2d9cd0cc17c37d64324736 Mon Sep 17 00:00:00 2001 From: PPPSCN <35696959@qq.com> Date: Wed, 14 Mar 2018 10:53:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E9=94=AE=E7=94=9F?= =?UTF-8?q?=E6=88=90CRUD=E6=97=B6admin=5Fids=E5=AD=97=E6=AE=B5=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E6=8E=A7=E5=88=B6=E5=99=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + application/admin/command/Crud.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1962050f..e04395f5 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ composer.lock *.css.map !.gitkeep .env +/.svn diff --git a/application/admin/command/Crud.php b/application/admin/command/Crud.php index 94e3c266..3ba5c204 100644 --- a/application/admin/command/Crud.php +++ b/application/admin/command/Crud.php @@ -580,8 +580,8 @@ class Crud extends Command } $formAddElement = $formEditElement = Form::hidden($fieldName, $no, array_merge(['checked' => ''], $attrArr)); $attrArr['id'] = $fieldName . "-switch"; - $formAddElement .= sprintf(Form::label("{$attrArr['id']}", "%s {:__('Yes')}", ['class'=>'control-label']), Form::checkbox($fieldName, $yes, $defaultValue === $yes, $attrArr)); - $formEditElement .= sprintf(Form::label("{$attrArr['id']}", "%s {:__('Yes')}", ['class'=>'control-label']), Form::checkbox($fieldName, $yes, 0, $attrArr)); + $formAddElement .= sprintf(Form::label("{$attrArr['id']}", "%s {:__('Yes')}", ['class' => 'control-label']), Form::checkbox($fieldName, $yes, $defaultValue === $yes, $attrArr)); + $formEditElement .= sprintf(Form::label("{$attrArr['id']}", "%s {:__('Yes')}", ['class' => 'control-label']), Form::checkbox($fieldName, $yes, 0, $attrArr)); $formEditElement = str_replace('type="checkbox"', 'type="checkbox" {in name="' . "\$row.{$field}" . '" value="' . $yes . '"}checked{/in}', $formEditElement); } else if ($inputType == 'citypicker') @@ -611,6 +611,10 @@ class Crud extends Command $search = '"##replacetext##"'; $replace = '\'{"custom[type]":"' . $table . '"}\''; } + elseif ($selectpageController == 'admin') + { + $attrArr['data-source'] = 'auth/admin'; + } if ($this->isMatchSuffix($field, $this->selectpagesSuffix)) { $attrArr['data-multiple'] = 'true';