[ 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\avatar\driver; 15 16 /** 17 * Base class for avatar drivers 18 */ 19 abstract class driver implements \phpbb\avatar\driver\driver_interface 20 { 21 /** 22 * Avatar driver name 23 * @var string 24 */ 25 protected $name; 26 27 /** 28 * Current board configuration 29 * @var \phpbb\config\config 30 */ 31 protected $config; 32 33 /** 34 * Current $phpbb_root_path 35 * @var string 36 */ 37 protected $phpbb_root_path; 38 39 /** 40 * Current $php_ext 41 * @var string 42 */ 43 protected $php_ext; 44 45 /** 46 * Path Helper 47 * @var \phpbb\path_helper 48 */ 49 protected $path_helper; 50 51 /** 52 * Cache driver 53 * @var \phpbb\cache\driver\driver_interface 54 */ 55 protected $cache; 56 57 /** 58 * Array of allowed avatar image extensions 59 * Array is used for setting the allowed extensions in the fileupload class 60 * and as a base for a regex of allowed extensions, which will be formed by 61 * imploding the array with a "|". 62 * 63 * @var array 64 */ 65 protected $allowed_extensions = array( 66 'gif', 67 'jpg', 68 'jpeg', 69 'png', 70 ); 71 72 /** 73 * Construct a driver object 74 * 75 * @param \phpbb\config\config $config phpBB configuration 76 * @param string $phpbb_root_path Path to the phpBB root 77 * @param string $php_ext PHP file extension 78 * @param \phpbb\path_helper $path_helper phpBB path helper 79 * @param \phpbb\cache\driver\driver_interface $cache Cache driver 80 */ 81 public function __construct(\phpbb\config\config $config, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\cache\driver\driver_interface $cache = null) 82 { 83 $this->config = $config; 84 $this->phpbb_root_path = $phpbb_root_path; 85 $this->php_ext = $php_ext; 86 $this->path_helper = $path_helper; 87 $this->cache = $cache; 88 } 89 90 /** 91 * {@inheritdoc} 92 */ 93 public function get_custom_html($user, $row, $alt = '') 94 { 95 return ''; 96 } 97 98 /** 99 * {@inheritdoc} 100 */ 101 public function prepare_form_acp($user) 102 { 103 return array(); 104 } 105 106 /** 107 * {@inheritdoc} 108 */ 109 public function delete($row) 110 { 111 return true; 112 } 113 114 /** 115 * {@inheritdoc} 116 */ 117 public function get_name() 118 { 119 return $this->name; 120 } 121 122 /** 123 * {@inheritdoc} 124 */ 125 public function get_config_name() 126 { 127 return preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($this)); 128 } 129 130 /** 131 * {@inheritdoc} 132 */ 133 public function get_acp_template_name() 134 { 135 return 'acp_avatar_options_' . $this->get_config_name() . '.html'; 136 } 137 138 /** 139 * Sets the name of the driver. 140 * 141 * @param string $name Driver name 142 */ 143 public function set_name($name) 144 { 145 $this->name = $name; 146 } 147 }
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 |