Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

type_interface.php

Zuletzt modifiziert: 09.10.2024, 12:54 - Dateigröße: 6.71 KiB


001  <?php
002  /**
003  *
004  * This file is part of the phpBB Forum Software package.
005  *
006  * @copyright (c) phpBB Limited <https://www.phpbb.com>
007  * @license GNU General Public License, version 2 (GPL-2.0)
008  *
009  * For full copyright and license information, please see
010  * the docs/CREDITS.txt file.
011  *
012  */
013   
014  namespace phpbb\profilefields\type;
015   
016  interface type_interface
017  {
018      /**
019      * Get the translated name of the type
020      *
021      * @return string Translated name of the field type
022      */
023      public function get_name();
024   
025      /**
026      * Get the short name of the type, used for error messages and template loops
027      *
028      * @return string lowercase version of the fields type
029      */
030      public function get_name_short();
031   
032      /**
033      * Get the name of service representing the type
034      *
035      * @return string lowercase version of the fields type
036      */
037      public function get_service_name();
038   
039      /**
040      * Get the name of template file for this type
041      *
042      * @return string Returns the name of the template file
043      */
044      public function get_template_filename();
045   
046      /**
047      * Get dropdown options for second step in ACP
048      *
049      * @param string    $default_lang_id    ID of the default language
050      * @param array    $field_data            Array with data for this field
051      * @return array    with the acp options
052      */
053      public function get_options($default_lang_id, $field_data);
054   
055      /**
056      * Get default values for the options of this type
057      *
058      * @return array with values like default field size and more
059      */
060      public function get_default_option_values();
061   
062      /**
063      * Get default value for this type
064      *
065      * @param array    $field_data            Array with data for this field
066      * @return mixed default value for new users when no value is given
067      */
068      public function get_default_field_value($field_data);
069   
070      /**
071      * Get profile field value on submit
072      *
073      * @param array    $profile_row            Array with data for this field
074      * @return mixed        Submitted value of the profile field
075      */
076      public function get_profile_field($profile_row);
077   
078      /**
079      * Validate entered profile field data
080      *
081      * @param mixed    $field_value        Field value to validate
082      * @param array    $field_data            Array with requirements of the field
083      * @return mixed        String with the error message
084      */
085      public function validate_profile_field(&$field_value, $field_data);
086   
087      /**
088      * Get Profile Value for display
089      *
090      * @param mixed    $field_value        Field value as stored in the database
091      * @param array    $field_data            Array with requirements of the field
092      * @return mixed        Field value to display
093      */
094      public function get_profile_value($field_value, $field_data);
095   
096      /**
097      * Get Profile Value ID for display (the raw, unprocessed user data)
098      *
099      * @param mixed    $field_value        Field value as stored in the database
100      * @param array    $field_data            Array with requirements of the field
101      * @return mixed        Field value ID to display
102      */
103      public function get_profile_value_raw($field_value, $field_data);
104   
105      /**
106      * Get Profile Value for display
107      *
108      * When displaying a contact field, we don't want to have links already parsed and more
109      *
110      * @param mixed    $field_value        Field value as stored in the database
111      * @param array    $field_data            Array with requirements of the field
112      * @return mixed        Field value to display
113      */
114      public function get_profile_contact_value($field_value, $field_data);
115   
116      /**
117      * Generate the input field for display
118      *
119      * @param array    $profile_row        Array with data for this field
120      * @param mixed    $preview_options    When previewing we use different data
121      * @return null
122      */
123      public function generate_field($profile_row, $preview_options = false);
124   
125      /**
126      * Get the ident of the field
127      *
128      * Some types are multivalue, we can't give them a field_id
129      * as we would not know which to pick.
130      *
131      * @param array    $field_data        Array with data for this field
132      * @return string ident of the field
133      */
134      public function get_field_ident($field_data);
135   
136      /**
137      * Get the localized name of the field
138      *
139      * @param string $field_name        Unlocalized name of this field
140      * @return string     Localized name of the field
141      */
142      public function get_field_name($field_name);
143   
144      /**
145      * Get the column type for the database
146      *
147      * @return string    Returns the database column type
148      */
149      public function get_database_column_type();
150   
151      /**
152      * Get the options we need to display for the language input fields in the ACP
153      *
154      * @param array    $field_data        Array with data for this field
155      * @return array        Returns the language options we need to generate
156      */
157      public function get_language_options($field_data);
158   
159      /**
160      * Get the input for the supplied language options
161      *
162      * @param array    $field_data        Array with data for this field
163      * @return array        Returns the language options we need to generate
164      */
165      public function get_language_options_input($field_data);
166   
167      /**
168      * Allows exclusion of options in single steps of the creation process
169      *
170      * @param array    $exclude_options        Array with options that should be excluded in the steps
171      * @param array    $visibility_options        Array with options responsible for the fields visibility
172      * @return mixed        Returns the provided language options
173      */
174      public function prepare_options_form(&$exclude_options, &$visibility_options);
175   
176      /**
177      * Allows exclusion of options in single steps of the creation process
178      *
179      * @param array    $error                    Array with error messages
180      * @param array    $field_data        Array with data for this field
181      * @return array        Array with error messages
182      */
183      public function validate_options_on_submit($error, $field_data);
184   
185      /**
186      * Allows manipulating the intended variables if needed
187      *
188      * @param string    $key            Name of the option
189      * @param string    $action            Currently performed action (create|edit)
190      * @param mixed    $current_value    Currently value of the option
191      * @param array    $field_data        Array with data for this field
192      * @param int    $step            Step on which the option is excluded
193      * @return mixed        Final value of the option
194      */
195      public function get_excluded_options($key, $action, $current_value, &$field_data, $step);
196   
197      /**
198      * Allows manipulating the intended variables if needed
199      *
200      * @param int    $step            Step on which the option is hidden
201      * @param string    $key            Name of the option
202      * @param string    $action            Currently performed action (create|edit)
203      * @param array    $field_data        Array with data for this field
204      * @return mixed        Final value of the option
205      */
206      public function prepare_hidden_fields($step, $key, $action, &$field_data);
207   
208      /**
209      * Allows assigning of additional template variables
210      *
211      * @param array    $template_vars    Template variables we are going to assign
212      * @param array    $field_data        Array with data for this field
213      * @return null
214      */
215      public function display_options(&$template_vars, &$field_data);
216   
217      /**
218      * Return templated value/field. Possible values for $mode are:
219      * change == user is able to set/enter profile values; preview == just show the value
220      *
221      * @param string    $mode            Mode for displaying the field (preview|change)
222      * @param array    $profile_row    Array with data for this field
223      * @return null
224      */
225      public function process_field_row($mode, $profile_row);
226  }
227