Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

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.51 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 column type for the database
138      *
139      * @return string    Returns the database column type
140      */
141      public function get_database_column_type();
142   
143      /**
144      * Get the options we need to display for the language input fields in the ACP
145      *
146      * @param array    $field_data        Array with data for this field
147      * @return array        Returns the language options we need to generate
148      */
149      public function get_language_options($field_data);
150   
151      /**
152      * Get the input for the supplied language options
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_input($field_data);
158   
159      /**
160      * Allows exclusion of options in single steps of the creation process
161      *
162      * @param array    $exclude_options        Array with options that should be excluded in the steps
163      * @param array    $visibility_options        Array with options responsible for the fields visibility
164      * @return mixed        Returns the provided language options
165      */
166      public function prepare_options_form(&$exclude_options, &$visibility_options);
167   
168      /**
169      * Allows exclusion of options in single steps of the creation process
170      *
171      * @param array    $error                    Array with error messages
172      * @param array    $field_data        Array with data for this field
173      * @return array        Array with error messages
174      */
175      public function validate_options_on_submit($error, $field_data);
176   
177      /**
178      * Allows manipulating the intended variables if needed
179      *
180      * @param string    $key            Name of the option
181      * @param string    $action            Currently performed action (create|edit)
182      * @param mixed    $current_value    Currently value of the option
183      * @param array    $field_data        Array with data for this field
184      * @param int    $step            Step on which the option is excluded
185      * @return mixed        Final value of the option
186      */
187      public function get_excluded_options($key, $action, $current_value, &$field_data, $step);
188   
189      /**
190      * Allows manipulating the intended variables if needed
191      *
192      * @param int    $step            Step on which the option is hidden
193      * @param string    $key            Name of the option
194      * @param string    $action            Currently performed action (create|edit)
195      * @param array    $field_data        Array with data for this field
196      * @return mixed        Final value of the option
197      */
198      public function prepare_hidden_fields($step, $key, $action, &$field_data);
199   
200      /**
201      * Allows assigning of additional template variables
202      *
203      * @param array    $template_vars    Template variables we are going to assign
204      * @param array    $field_data        Array with data for this field
205      * @return null
206      */
207      public function display_options(&$template_vars, &$field_data);
208   
209      /**
210      * Return templated value/field. Possible values for $mode are:
211      * change == user is able to set/enter profile values; preview == just show the value
212      *
213      * @param string    $mode            Mode for displaying the field (preview|change)
214      * @param array    $profile_row    Array with data for this field
215      * @return null
216      */
217      public function process_field_row($mode, $profile_row);
218  }
219