[ Index ] |
PHP Cross Reference of phpBB-3.1.12-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 assign_block_vars($blockname, array $vararray) 111 { 112 $this->context->assign_block_vars($blockname, $vararray); 113 114 return $this; 115 } 116 117 /** 118 * {@inheritdoc} 119 */ 120 public function assign_block_vars_array($blockname, array $block_vars_array) 121 { 122 $this->context->assign_block_vars_array($blockname, $block_vars_array); 123 124 return $this; 125 } 126 127 /** 128 * {@inheritdoc} 129 */ 130 public function alter_block_array($blockname, array $vararray, $key = false, $mode = 'insert') 131 { 132 return $this->context->alter_block_array($blockname, $vararray, $key, $mode); 133 } 134 135 /** 136 * {@inheritdoc} 137 */ 138 public function find_key_index($blockname, $key) 139 { 140 return $this->context->find_key_index($blockname, $key); 141 } 142 143 /** 144 * Calls hook if any is defined. 145 * 146 * @param string $handle Template handle being displayed. 147 * @param string $method Method name of the caller. 148 */ 149 protected function call_hook($handle, $method) 150 { 151 global $phpbb_hook; 152 153 if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array('template', $method), $handle, $this)) 154 { 155 if ($phpbb_hook->hook_return(array('template', $method))) 156 { 157 $result = $phpbb_hook->hook_return_result(array('template', $method)); 158 return array($result); 159 } 160 } 161 162 return false; 163 } 164 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Jan 11 00:25:41 2018 | Cross-referenced by PHPXref 0.7.1 |