From: Cake Date: Wed, 10 Feb 2010 15:39:30 +0000 (+0900) Subject: 保存画像サイズの設定変更画面作成 X-Git-Tag: version-alpha~185 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=bd01488f1e1f9b7e1628194c6b786b4acef8efa8;p=trpgtools-onweb%2Fcake-frame.git 保存画像サイズの設定変更画面作成 --- diff --git a/app/controllers/site_configs_controller.php b/app/controllers/site_configs_controller.php index 7f50c54..e2a57a0 100644 --- a/app/controllers/site_configs_controller.php +++ b/app/controllers/site_configs_controller.php @@ -34,6 +34,18 @@ class SiteConfigsController extends AppController { $this->SiteConfig->create(); $fields = $this->SiteConfig->fields['add']; } + + if ( + $k == 'Upload.imagefile.FileSizeMax' || + $k == 'Upload.imagefile.WidthMax' || + $k == 'Upload.imagefile.HeightMax' + ) { + $v['value'] = intval($v['value']); + if ($v['value'] < 0) { + $v['value'] = NULL; + } + } + $data['SiteConfig'] = $v; if (!$this->SiteConfig->save($data, true, $fields)) { diff --git a/app/models/site_config.php b/app/models/site_config.php index 1cf378a..83ca3f6 100644 --- a/app/models/site_config.php +++ b/app/models/site_config.php @@ -8,6 +8,19 @@ class SiteConfig extends AppModel { 'id' => null, 'value' => 'Chara-Shee!' ), + + 'Upload.imagefile.FileSizeMax' => array( + 'id' => null, + 'value' => '500' + ), + 'Upload.imagefile.WidthMax' => array( + 'id' => null, + 'value' => '780' + ), + 'Upload.imagefile.HeightMax' => array( + 'id' => null, + 'value' => '600' + ), ); diff --git a/app/views/site_configs/admin_edit.ctp b/app/views/site_configs/admin_edit.ctp index 69265ec..fb9503f 100644 --- a/app/views/site_configs/admin_edit.ctp +++ b/app/views/site_configs/admin_edit.ctp @@ -8,8 +8,7 @@
- - +
@@ -25,5 +24,55 @@ echo $form->end('Submit'); ?>

+ + + +
+

+create('SiteConfig', array('url' => array( + 'controller' => 'site_configs', + 'action' => 'admin_edit', +)));?> +

+ + + + + + + + + + + + + + + + +
+ +
+div('caption', __('Zero or NULL means NO LIMIT.', true)); ?> +
+ +
+div('caption', __('Zero or NULL means NO LIMIT.', true)); ?> +
+ +
+div('caption', __('Zero or NULL means NO LIMIT.', true)); ?> +
+
+create(); + echo $form->end('Submit'); +?> +

+
+ + + + diff --git a/app/webroot/css/base.css b/app/webroot/css/base.css index 4b1f6c5..94da4d2 100644 --- a/app/webroot/css/base.css +++ b/app/webroot/css/base.css @@ -628,5 +628,10 @@ div.siteConfigs table th } div.siteConfigs table td input[type=text] { - width:98%; + width: 98%; } +div.siteConfigs table td.sizeInput input[type=text] +{ + width: 48px; +} +