mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/11201] Rename profilefields class to manager
PHPBB3-11201
This commit is contained in:
parent
514a59ffa7
commit
7bcbdfc1b1
13 changed files with 33 additions and 33 deletions
|
@ -1,6 +1,6 @@
|
|||
services:
|
||||
profilefields:
|
||||
class: \phpbb\profilefields\profilefields
|
||||
profilefields.manager:
|
||||
class: \phpbb\profilefields\manager
|
||||
arguments:
|
||||
- @auth
|
||||
- @dbal.conn
|
||||
|
@ -30,7 +30,7 @@ services:
|
|||
class: \phpbb\profilefields\type\type_bool
|
||||
arguments:
|
||||
- @profilefields.lang_helper
|
||||
- @profilefields
|
||||
- @profilefields.manager
|
||||
- @request
|
||||
- @template
|
||||
- @user
|
||||
|
@ -40,7 +40,7 @@ services:
|
|||
profilefields.type.date:
|
||||
class: \phpbb\profilefields\type\type_date
|
||||
arguments:
|
||||
- @profilefields
|
||||
- @profilefields.manager
|
||||
- @request
|
||||
- @template
|
||||
- @user
|
||||
|
@ -51,7 +51,7 @@ services:
|
|||
class: \phpbb\profilefields\type\type_dropdown
|
||||
arguments:
|
||||
- @profilefields.lang_helper
|
||||
- @profilefields
|
||||
- @profilefields.manager
|
||||
- @request
|
||||
- @template
|
||||
- @user
|
||||
|
|
|
@ -50,7 +50,7 @@ class acp_profile
|
|||
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$cp = $phpbb_container->get('profilefields');
|
||||
$cp = $phpbb_container->get('profilefields.manager');
|
||||
$this->type_collection = $phpbb_container->get('profilefields.type_collection');
|
||||
|
||||
// Build Language array
|
||||
|
|
|
@ -1344,7 +1344,7 @@ class acp_users
|
|||
|
||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
|
||||
$cp = $phpbb_container->get('profilefields');
|
||||
$cp = $phpbb_container->get('profilefields.manager');
|
||||
|
||||
$cp_data = $cp_error = array();
|
||||
|
||||
|
|
|
@ -276,7 +276,7 @@ function user_add($user_row, $cp_data = false)
|
|||
{
|
||||
$cp_data['user_id'] = (int) $user_id;
|
||||
|
||||
$cp = $phpbb_container->get('profilefields');
|
||||
$cp = $phpbb_container->get('profilefields.manager');
|
||||
$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' .
|
||||
$db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data));
|
||||
$db->sql_query($sql);
|
||||
|
|
|
@ -61,7 +61,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
|||
// Load the custom profile fields
|
||||
if ($config['load_cpf_pm'])
|
||||
{
|
||||
$cp = $phpbb_container->get('profilefields');
|
||||
$cp = $phpbb_container->get('profilefields.manager');
|
||||
|
||||
$profile_fields = $cp->generate_profile_fields_template('grab', $author_id);
|
||||
}
|
||||
|
|
|
@ -256,7 +256,7 @@ class ucp_profile
|
|||
trigger_error('NO_AUTH_PROFILEINFO');
|
||||
}
|
||||
|
||||
$cp = $phpbb_container->get('profilefields');
|
||||
$cp = $phpbb_container->get('profilefields.manager');
|
||||
|
||||
$cp_data = $cp_error = array();
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ class ucp_register
|
|||
}
|
||||
}
|
||||
|
||||
$cp = $phpbb_container->get('profilefields');
|
||||
$cp = $phpbb_container->get('profilefields.manager');
|
||||
|
||||
$error = $cp_data = $cp_error = array();
|
||||
$s_hidden_fields = array();
|
||||
|
|
|
@ -617,7 +617,7 @@ switch ($mode)
|
|||
$profile_fields = array();
|
||||
if ($config['load_cpf_viewprofile'])
|
||||
{
|
||||
$cp = $phpbb_container->get('profilefields');
|
||||
$cp = $phpbb_container->get('profilefields.manager');
|
||||
$profile_fields = $cp->generate_profile_fields_template('grab', $user_id);
|
||||
$profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields[$user_id]) : array();
|
||||
}
|
||||
|
@ -1554,7 +1554,7 @@ switch ($mode)
|
|||
// Load custom profile fields
|
||||
if ($config['load_cpf_memberlist'])
|
||||
{
|
||||
$cp = $phpbb_container->get('profilefields');
|
||||
$cp = $phpbb_container->get('profilefields.manager');
|
||||
|
||||
// Grab all profile fields from users in id cache for later use - similar to the poster cache
|
||||
$profile_fields_cache = $cp->generate_profile_fields_template('grab', $user_list);
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace phpbb\profilefields;
|
|||
* Custom Profile Fields
|
||||
* @package phpBB3
|
||||
*/
|
||||
class profilefields
|
||||
class manager
|
||||
{
|
||||
/**
|
||||
* Auth object
|
|
@ -19,7 +19,7 @@ class type_bool extends type_base
|
|||
|
||||
/**
|
||||
* Profile fields object
|
||||
* @var \phpbb\profilefields\profilefields
|
||||
* @var \phpbb\profilefields\manager
|
||||
*/
|
||||
protected $profilefields;
|
||||
|
||||
|
@ -45,16 +45,16 @@ class type_bool extends type_base
|
|||
* Construct
|
||||
*
|
||||
* @param \phpbb\profilefields\lang_helper $lang_helper Profile fields language helper
|
||||
* @param \phpbb\profilefields\profilefields $profilefields Profile fields object
|
||||
* @param \phpbb\profilefields\manager $manager Profile fields object
|
||||
* @param \phpbb\request\request $request Request object
|
||||
* @param \phpbb\template\template $template Template object
|
||||
* @param \phpbb\user $user User object
|
||||
* @param string $language_table Table where the language strings are stored
|
||||
*/
|
||||
public function __construct(\phpbb\profilefields\lang_helper $lang_helper, \phpbb\profilefields\profilefields $profilefields, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
|
||||
public function __construct(\phpbb\profilefields\lang_helper $lang_helper, \phpbb\profilefields\manager $manager, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
|
||||
{
|
||||
$this->lang_helper = $lang_helper;
|
||||
$this->profilefields = $profilefields;
|
||||
$this->manager = $manager;
|
||||
$this->request = $request;
|
||||
$this->template = $template;
|
||||
$this->user = $user;
|
||||
|
@ -88,7 +88,7 @@ class type_bool extends type_base
|
|||
|
||||
$options = array(
|
||||
0 => array('TITLE' => $this->user->lang['FIELD_TYPE'], 'EXPLAIN' => $this->user->lang['BOOL_TYPE_EXPLAIN'], 'FIELD' => '<label><input type="radio" class="radio" name="field_length" value="1"' . (($field_data['field_length'] == 1) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $this->user->lang['RADIO_BUTTONS'] . '</label><label><input type="radio" class="radio" name="field_length" value="2"' . (($field_data['field_length'] == 2) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $this->user->lang['CHECKBOX'] . '</label>'),
|
||||
1 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => $this->profilefields->process_field_row('preview', $profile_row)),
|
||||
1 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => $this->manager->process_field_row('preview', $profile_row)),
|
||||
);
|
||||
|
||||
return $options;
|
||||
|
|
|
@ -13,9 +13,9 @@ class type_date extends type_base
|
|||
{
|
||||
/**
|
||||
* Profile fields object
|
||||
* @var \phpbb\profilefields\profilefields
|
||||
* @var \phpbb\profilefields\manager
|
||||
*/
|
||||
protected $profilefields;
|
||||
protected $manager;
|
||||
|
||||
/**
|
||||
* Request object
|
||||
|
@ -38,15 +38,15 @@ class type_date extends type_base
|
|||
/**
|
||||
* Construct
|
||||
*
|
||||
* @param \phpbb\profilefields\profilefields $profilefields Profile fields object
|
||||
* @param \phpbb\profilefields\manager $manager Profile fields object
|
||||
* @param \phpbb\request\request $request Request object
|
||||
* @param \phpbb\template\template $template Template object
|
||||
* @param \phpbb\user $user User object
|
||||
* @param string $language_table Table where the language strings are stored
|
||||
*/
|
||||
public function __construct(\phpbb\profilefields\profilefields $profilefields, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
|
||||
public function __construct(\phpbb\profilefields\manager $manager, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
|
||||
{
|
||||
$this->profilefields = $profilefields;
|
||||
$this->manager = $manager;
|
||||
$this->request = $request;
|
||||
$this->template = $template;
|
||||
$this->user = $user;
|
||||
|
@ -87,7 +87,7 @@ class type_date extends type_base
|
|||
}
|
||||
|
||||
$options = array(
|
||||
0 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => $this->profilefields->process_field_row('preview', $profile_row)),
|
||||
0 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => $this->manager->process_field_row('preview', $profile_row)),
|
||||
1 => array('TITLE' => $this->user->lang['ALWAYS_TODAY'], 'FIELD' => '<label><input type="radio" class="radio" name="always_now" value="1"' . (($s_checked) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $this->user->lang['YES'] . '</label><label><input type="radio" class="radio" name="always_now" value="0"' . ((!$s_checked) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $this->user->lang['NO'] . '</label>'),
|
||||
);
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ class type_dropdown extends type_base
|
|||
|
||||
/**
|
||||
* Profile fields object
|
||||
* @var \phpbb\profilefields\profilefields
|
||||
* @var \phpbb\profilefields\manager
|
||||
*/
|
||||
protected $profilefields;
|
||||
protected $manager;
|
||||
|
||||
/**
|
||||
* Request object
|
||||
|
@ -45,16 +45,16 @@ class type_dropdown extends type_base
|
|||
* Construct
|
||||
*
|
||||
* @param \phpbb\profilefields\lang_helper $lang_helper Profile fields language helper
|
||||
* @param \phpbb\profilefields\profilefields $profilefields Profile fields object
|
||||
* @param \phpbb\profilefields\manager $manager Profile fields object
|
||||
* @param \phpbb\request\request $request Request object
|
||||
* @param \phpbb\template\template $template Template object
|
||||
* @param \phpbb\user $user User object
|
||||
* @param string $language_table Table where the language strings are stored
|
||||
*/
|
||||
public function __construct(\phpbb\profilefields\lang_helper $lang_helper, \phpbb\profilefields\profilefields $profilefields, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
|
||||
public function __construct(\phpbb\profilefields\lang_helper $lang_helper, \phpbb\profilefields\manager $manager, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
|
||||
{
|
||||
$this->lang_helper = $lang_helper;
|
||||
$this->profilefields = $profilefields;
|
||||
$this->manager = $manager;
|
||||
$this->request = $request;
|
||||
$this->template = $template;
|
||||
$this->user = $user;
|
||||
|
@ -91,8 +91,8 @@ class type_dropdown extends type_base
|
|||
$profile_row[1]['field_default_value'] = $field_data['field_novalue'];
|
||||
|
||||
$options = array(
|
||||
0 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => $this->profilefields->process_field_row('preview', $profile_row[0])),
|
||||
1 => array('TITLE' => $this->user->lang['NO_VALUE_OPTION'], 'EXPLAIN' => $this->user->lang['NO_VALUE_OPTION_EXPLAIN'], 'FIELD' => $this->profilefields->process_field_row('preview', $profile_row[1])),
|
||||
0 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => $this->manager->process_field_row('preview', $profile_row[0])),
|
||||
1 => array('TITLE' => $this->user->lang['NO_VALUE_OPTION'], 'EXPLAIN' => $this->user->lang['NO_VALUE_OPTION_EXPLAIN'], 'FIELD' => $this->manager->process_field_row('preview', $profile_row[1])),
|
||||
);
|
||||
|
||||
return $options;
|
||||
|
|
|
@ -1265,7 +1265,7 @@ $db->sql_freeresult($result);
|
|||
// Load custom profile fields
|
||||
if ($config['load_cpf_viewtopic'])
|
||||
{
|
||||
$cp = $phpbb_container->get('profilefields');
|
||||
$cp = $phpbb_container->get('profilefields.manager');
|
||||
|
||||
// Grab all profile fields from users in id cache for later use - similar to the poster cache
|
||||
$profile_fields_tmp = $cp->generate_profile_fields_template('grab', $id_cache);
|
||||
|
|
Loading…
Add table
Reference in a new issue