}
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++;
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++;
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);
));
}
- 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;
}
$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の設定を出力 */
'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++;
}
if ($publicOnly === false) {
- $forms[] = $this->dispPublicFlag4Profile($first_num, $first, false);
+ $forms[] = $this->dispPublicFlag4Profile(null, $first_num, $first, false);
}
$this->character_has_profile_cols++;