1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-20 07:21:30 +02:00

[ticket/16955] Fix another batch of docblocks

PHPBB3-16955
This commit is contained in:
Marc Alexander
2022-12-26 14:50:57 +01:00
parent 96911b7403
commit 5b23dcd606
25 changed files with 93 additions and 75 deletions

View File

@@ -126,7 +126,7 @@ class lang_helper
* @param int $field_id Database ID of the field
* @param int $lang_id ID of the language
* @param int $field_value Selected value of the field
* @return string
* @return string|array
*/
public function get($field_id, $lang_id, $field_value = null)
{

View File

@@ -183,8 +183,7 @@ abstract class type_base implements type_interface
}
/**
* Return templated value/field. Possible values for $mode are:
* change == user is able to set/enter profile values; preview == just show the value
* {@inheritDoc}
*/
public function process_field_row($mode, $profile_row)
{
@@ -201,6 +200,7 @@ abstract class type_base implements type_interface
// Assign template variables
$this->generate_field($profile_row, $preview_options);
return $this->template->assign_display('cp_body');
$compiled_template = $this->template->assign_display('cp_body');
return is_string($compiled_template) ? $compiled_template : '';
}
}

View File

@@ -232,13 +232,16 @@ class type_bool extends type_base
}
$options = $this->lang_helper->get($profile_row['field_id'], $profile_row['lang_id']);
foreach ($options as $option_id => $option_value)
if (is_array($options))
{
$this->template->assign_block_vars('bool.options', array(
'OPTION_ID' => $option_id,
'CHECKED' => ($value == $option_id) ? ' checked="checked"' : '',
'VALUE' => $option_value,
));
foreach ($options as $option_id => $option_value)
{
$this->template->assign_block_vars('bool.options', array(
'OPTION_ID' => $option_id,
'CHECKED' => ($value == $option_id) ? ' checked="checked"' : '',
'VALUE' => $option_value,
));
}
}
}
}

View File

@@ -233,13 +233,16 @@ class type_dropdown extends type_base
$this->template->assign_block_vars('dropdown', array_change_key_case($profile_row, CASE_UPPER));
$options = $this->lang_helper->get($profile_row['field_id'], $profile_row['lang_id']);
foreach ($options as $option_id => $option_value)
if (is_array($options))
{
$this->template->assign_block_vars('dropdown.options', array(
'OPTION_ID' => $option_id,
'SELECTED' => ($value == $option_id) ? ' selected="selected"' : '',
'VALUE' => $option_value,
));
foreach ($options as $option_id => $option_value)
{
$this->template->assign_block_vars('dropdown.options', array(
'OPTION_ID' => $option_id,
'SELECTED' => ($value == $option_id) ? ' selected="selected"' : '',
'VALUE' => $option_value,
));
}
}
}

View File

@@ -220,7 +220,7 @@ interface type_interface
*
* @param string $mode Mode for displaying the field (preview|change)
* @param array $profile_row Array with data for this field
* @return null
* @return string
*/
public function process_field_row($mode, $profile_row);
}