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

template.php

Zuletzt modifiziert: 09.10.2024, 12:52 - Dateigröße: 5.74 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\template;
015   
016  interface template
017  {
018   
019      /**
020      * Clear the cache
021      *
022      * @return \phpbb\template\template
023      */
024      public function clear_cache();
025   
026      /**
027      * Sets the template filenames for handles.
028      *
029      * @param array $filename_array Should be a hash of handle => filename pairs.
030      * @return \phpbb\template\template $this
031      */
032      public function set_filenames(array $filename_array);
033   
034      /**
035      * Get the style tree of the style preferred by the current user
036      *
037      * @return array Style tree, most specific first
038      */
039      public function get_user_style();
040   
041      /**
042      * Set style location based on (current) user's chosen style.
043      *
044      * @param array $style_directories The directories to add style paths for
045      *     E.g. array('ext/foo/bar/styles', 'styles')
046      *     Default: array('styles') (phpBB's style directory)
047      * @return \phpbb\template\template $this
048      */
049      public function set_style($style_directories = array('styles'));
050   
051      /**
052      * Set custom style location (able to use directory outside of phpBB).
053      *
054      * Note: Templates are still compiled to phpBB's cache directory.
055      *
056      * @param string|array $names Array of names or string of name of template(s) in inheritance tree order, used by extensions.
057      * @param string|array or string $paths Array of style paths, relative to current root directory
058      * @return \phpbb\template\template $this
059      */
060      public function set_custom_style($names, $paths);
061   
062      /**
063      * Clears all variables and blocks assigned to this template.
064      *
065      * @return \phpbb\template\template $this
066      */
067      public function destroy();
068   
069      /**
070      * Reset/empty complete block
071      *
072      * @param string $blockname Name of block to destroy
073      * @return \phpbb\template\template $this
074      */
075      public function destroy_block_vars($blockname);
076   
077      /**
078      * Display a template for provided handle.
079      *
080      * The template will be loaded and compiled, if necessary, first.
081      *
082      * This function calls hooks.
083      *
084      * @param string $handle Handle to display
085      * @return \phpbb\template\template $this
086      */
087      public function display($handle);
088   
089      /**
090      * Display the handle and assign the output to a template variable
091      * or return the compiled result.
092      *
093      * @param string $handle Handle to operate on
094      * @param string $template_var Template variable to assign compiled handle to
095      * @param bool $return_content If true return compiled handle, otherwise assign to $template_var
096      * @return \phpbb\template\template|string if $return_content is true return string of the compiled handle, otherwise return $this
097      */
098      public function assign_display($handle, $template_var = '', $return_content = true);
099   
100      /**
101      * Assign key variable pairs from an array
102      *
103      * @param array $vararray A hash of variable name => value pairs
104      * @return \phpbb\template\template $this
105      */
106      public function assign_vars(array $vararray);
107   
108      /**
109      * Assign a single scalar value to a single key.
110      *
111      * Value can be a string, an integer or a boolean.
112      *
113      * @param string $varname Variable name
114      * @param string $varval Value to assign to variable
115      * @return \phpbb\template\template $this
116      */
117      public function assign_var($varname, $varval);
118   
119      /**
120      * Append text to the string value stored in a key.
121      *
122      * Text is appended using the string concatenation operator (.).
123      *
124      * @param string $varname Variable name
125      * @param string $varval Value to append to variable
126      * @return \phpbb\template\template $this
127      */
128      public function append_var($varname, $varval);
129   
130      /**
131      * Assign key variable pairs from an array to a specified block
132      * @param string $blockname Name of block to assign $vararray to
133      * @param array $vararray A hash of variable name => value pairs
134      * @return \phpbb\template\template $this
135      */
136      public function assign_block_vars($blockname, array $vararray);
137   
138      /**
139      * Assign key variable pairs from an array to a whole specified block loop
140      * @param string $blockname Name of block to assign $block_vars_array to
141      * @param array $block_vars_array An array of hashes of variable name => value pairs
142      * @return \phpbb\template\template $this
143      */
144      public function assign_block_vars_array($blockname, array $block_vars_array);
145   
146      /**
147      * Change already assigned key variable pair (one-dimensional - single loop entry)
148      *
149      * An example of how to use this function:
150      * {@example alter_block_array.php}
151      *
152      * @param    string    $blockname    the blockname, for example 'loop'
153      * @param    array    $vararray    the var array to insert/add or merge
154      * @param    mixed    $key        Key to search for
155      *
156      * array: KEY => VALUE [the key/value pair to search for within the loop to determine the correct position]
157      *
158      * int: Position [the position to change or insert at directly given]
159      *
160      * If key is false the position is set to 0
161      * If key is true the position is set to the last entry
162      *
163      * @param    string    $mode        Mode to execute (valid modes are 'insert' and 'change')
164      *
165      *    If insert, the vararray is inserted at the given position (position counting from zero).
166      *    If change, the current block gets merged with the vararray (resulting in new \key/value pairs be added and existing keys be replaced by the new \value).
167      *
168      * Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array)
169      * and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars)
170      *
171      * @return bool false on error, true on success
172      */
173      public function alter_block_array($blockname, array $vararray, $key = false, $mode = 'insert');
174   
175      /**
176      * Get path to template for handle (required for BBCode parser)
177      *
178      * @param string $handle Handle to retrieve the source file
179      * @return string
180      */
181      public function get_source_file_for_handle($handle);
182  }
183