OSDN Git Service

checkboxと公開範囲設定の間が改行するのを修正
authorCake <cake_67@users.sourceforge.jp>
Wed, 5 Jan 2011 07:22:52 +0000 (16:22 +0900)
committerCake <cake_67@users.sourceforge.jp>
Wed, 5 Jan 2011 07:22:52 +0000 (16:22 +0900)
app/views/helpers/profiledisp.php
app/webroot/css/base.css
app/webroot/css/character-sheet.css

index 01d1846..2f2b0db 100644 (file)
@@ -124,10 +124,12 @@ class ProfiledispHelper extends Helper {
                }
 
                foreach ($profile['CharactersHasProfile'] as $v) {
-                       $this->_get_profile_tag($profile['id'], $v['value'], false, $options);
+                       $profile = $this->_get_profile_tag($profile['id'], $v['value'], false, $options);
 
                        if ($disp_public) {
-                               echo $this->dispPublicFlag4Profile($this->character_has_profile_num, $v, false)."<br>\n";
+                               echo $this->dispPublicFlag4Profile($profile, $this->character_has_profile_num, $v, false)."<br>\n";
+                       } else {
+                               echo $profile;
                        }
 
                        $this->character_has_profile_num++;
@@ -135,10 +137,12 @@ class ProfiledispHelper extends Helper {
 
                if ($this->profile_type['is_multi']) {
                        for ($i=0;$i<$form_num;$i++) {
-                               $this->_get_profile_tag($profile['id'], null, false, $options);
+                               $profile =  $this->_get_profile_tag($profile['id'], null, false, $options);
 
                                if ($disp_public) {
-                                       echo $this->dispPublicFlag4Profile($this->character_has_profile_num, $profile, $isMulti)."<br>\n";
+                                       echo $this->dispPublicFlag4Profile($profile, $this->character_has_profile_num, $profile, $isMulti)."<br>\n";
+                               } else {
+                                       echo $profile;
                                }
 
                                $this->character_has_profile_num++;
@@ -161,7 +165,7 @@ class ProfiledispHelper extends Helper {
        function _get_profile_tag($profile_id, $value = null, $label = false, $options = array())
        {
                if (empty($profile_id)) {
-                       echo null;
+                       return null;
                }
 
                $name1 = sprintf('CharactersHasProfile.%s.value', $this->character_has_profile_num);
@@ -186,21 +190,19 @@ class ProfiledispHelper extends Helper {
                        ));
                }
 
-               echo $profile_tag;
-
-               return ;
+               return $profile_tag;
        }
 
-       function dispPublicFlag4Profile($profile_num, $profile = null, $isMulti = false)
+       function dispPublicFlag4Profile($profile, $profile_num, $public_flag = null, $isMulti = false)
        {
                $profilePublicName = sprintf('CharactersHasProfile.%d.public_flag', $profile_num);
 
                if (is_array($profile) && isset($profile['CharactersHasProfile'][0]['public_flag'])) {
                        $selected_public_flag = $profile['CharactersHasProfile'][0]['public_flag'];
-               } elseif(is_array($profile) && isset($profile['public_flag'])) {
-                       $selected_public_flag = $profile['public_flag'];
-               } elseif (is_string($profile)) {
-                       $selected_public_flag = $profile;
+               } elseif(is_array($public_flag) && isset($public_flag['public_flag'])) {
+                       $selected_public_flag = $public_flag['public_flag'];
+               } elseif (is_string($public_flag)) {
+                       $selected_public_flag = $public_flag;
                } else {
                        $selected_public_flag = null;
                }
@@ -214,7 +216,16 @@ class ProfiledispHelper extends Helper {
                        $publicSelect['div'] = 'profilePublic profilePublicMulti';
                }
 
-               return $this->Select->create_publicflag_select($this->public_flags, $profilePublicName, $publicSelect);
+               if (!empty($profile)) {
+                       $publicSelect['before'] = $profile;
+               }
+
+               $public_select = $this->Select->create_publicflag_select($this->public_flags, $profilePublicName, $publicSelect);
+               if (!empty($profile)) {
+                       $public_select .= '<WBR>';
+               }
+
+               return $public_select;
        }
 
        /* profile_selectsの設定を出力 */
@@ -241,10 +252,12 @@ class ProfiledispHelper extends Helper {
                                'type' => 'hidden',
                                'value' => $profile_selects[0]['id'],
                        ));
-               echo $profile_select_tag;
+               $profile = $profile_select_tag;
 
                if ($disp_public) {
-                       echo $this->dispPublicFlag4Profile($this->character_has_profile_num, $options['public_flag']);
+                       echo $this->dispPublicFlag4Profile($profile, $this->character_has_profile_num, $options['public_flag']);
+               } else {
+                       echo $profile;
                }
 
                $this->character_has_profile_num++;
@@ -591,7 +604,7 @@ class ProfiledispHelper extends Helper {
                }
 
                if ($publicOnly === false) {
-                       $forms[] = $this->dispPublicFlag4Profile($first_num, $first, false);
+                       $forms[] = $this->dispPublicFlag4Profile(null, $first_num, $first, false);
                }
 
                $this->character_has_profile_cols++;
index 6ad80da..b88cdcd 100644 (file)
@@ -431,7 +431,15 @@ input {
 }
 select {
        font-size: 100%;
-       margin: 0 3px;
+       margin: 0 2px;
+       vertical-align: bottom;
+}
+option {
+       padding: 0 1px;
+}
+div.radio {
+       font-size: 120%;
+       font-weight: bold;
 }
 /* Notices and Errors */
 
index dd2562e..c12817c 100644 (file)
@@ -196,8 +196,14 @@ div.view div.attachments {
 /* プロフィール公開選択 */
 .profilePublic {
        display: inline;
+       margin-bottom: 3px;
        vertical-align: top;
-       padding-left: 5px;
+       padding-left: 0;
+       margin-right: 8px;
+       white-space: nowrap;
+}
+.profilePublic div.inline label {
+       padding-right: 0;
 }
 td div.profilePublic {
        padding: 0;