[ Index ] |
PHP Cross Reference of phpBB-3.3.14-deutsch |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * 4 * This file is part of the phpBB Forum Software package. 5 * 6 * @copyright (c) phpBB Limited <https://www.phpbb.com> 7 * @license GNU General Public License, version 2 (GPL-2.0) 8 * 9 * For full copyright and license information, please see 10 * the docs/CREDITS.txt file. 11 * 12 */ 13 14 namespace phpbb\template; 15 16 abstract class base implements template 17 { 18 /** 19 * Template context. 20 * Stores template data used during template rendering. 21 * 22 * @var \phpbb\template\context 23 */ 24 protected $context; 25 26 /** 27 * Array of filenames assigned to set_filenames 28 * 29 * @var array 30 */ 31 protected $filenames = array(); 32 33 /** 34 * {@inheritdoc} 35 */ 36 public function set_filenames(array $filename_array) 37 { 38 $this->filenames = array_merge($this->filenames, $filename_array); 39 40 return $this; 41 } 42 43 /** 44 * Get a filename from the handle 45 * 46 * @param string $handle 47 * @return string 48 */ 49 protected function get_filename_from_handle($handle) 50 { 51 return (isset($this->filenames[$handle])) ? $this->filenames[$handle] : $handle; 52 } 53 54 /** 55 * {@inheritdoc} 56 */ 57 public function destroy() 58 { 59 $this->context->clear(); 60 61 return $this; 62 } 63 64 /** 65 * {@inheritdoc} 66 */ 67 public function destroy_block_vars($blockname) 68 { 69 $this->context->destroy_block_vars($blockname); 70 71 return $this; 72 } 73 74 /** 75 * {@inheritdoc} 76 */ 77 public function assign_vars(array $vararray) 78 { 79 foreach ($vararray as $key => $val) 80 { 81 $this->assign_var($key, $val); 82 } 83 84 return $this; 85 } 86 87 /** 88 * {@inheritdoc} 89 */ 90 public function assign_var($varname, $varval) 91 { 92 $this->context->assign_var($varname, $varval); 93 94 return $this; 95 } 96 97 /** 98 * {@inheritdoc} 99 */ 100 public function append_var($varname, $varval) 101 { 102 $this->context->append_var($varname, $varval); 103 104 return $this; 105 } 106 107 /** 108 * {@inheritdoc} 109 */ 110 public function retrieve_vars(array $vararray) 111 { 112 $result = array(); 113 foreach ($vararray as $varname) 114 { 115 $result[$varname] = $this->retrieve_var($varname); 116 } 117 return $result; 118 } 119 120 /** 121 * {@inheritdoc} 122 */ 123 public function retrieve_var($varname) 124 { 125 return $this->context->retrieve_var($varname); 126 } 127 128 /** 129 * {@inheritdoc} 130 */ 131 public function assign_block_vars($blockname, array $vararray) 132 { 133 $this->context->assign_block_vars($blockname, $vararray); 134 135 return $this; 136 } 137 138 /** 139 * {@inheritdoc} 140 */ 141 public function assign_block_vars_array($blockname, array $block_vars_array) 142 { 143 $this->context->assign_block_vars_array($blockname, $block_vars_array); 144 145 return $this; 146 } 147 148 /** 149 * {@inheritdoc} 150 */ 151 public function retrieve_block_vars($blockname, array $vararray) 152 { 153 return $this->context->retrieve_block_vars($blockname, $vararray); 154 } 155 156 /** 157 * {@inheritdoc} 158 */ 159 public function alter_block_array($blockname, array $vararray, $key = false, $mode = 'insert') 160 { 161 return $this->context->alter_block_array($blockname, $vararray, $key, $mode); 162 } 163 164 /** 165 * {@inheritdoc} 166 */ 167 public function find_key_index($blockname, $key) 168 { 169 return $this->context->find_key_index($blockname, $key); 170 } 171 172 /** 173 * Calls hook if any is defined. 174 * 175 * @param string $handle Template handle being displayed. 176 * @param string $method Method name of the caller. 177 */ 178 protected function call_hook($handle, $method) 179 { 180 global $phpbb_hook; 181 182 if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array('template', $method), $handle, $this)) 183 { 184 if ($phpbb_hook->hook_return(array('template', $method))) 185 { 186 $result = $phpbb_hook->hook_return_result(array('template', $method)); 187 return array($result); 188 } 189 } 190 191 return false; 192 } 193 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Mon Nov 25 19:05:08 2024 | Cross-referenced by PHPXref 0.7.1 |