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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
driver.php
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\avatar\driver;
015
016 /**
017 * Base class for avatar drivers
018 */
019 abstract class driver implements \phpbb\avatar\driver\driver_interface
020 {
021 /**
022 * Avatar driver name
023 * @var string
024 */
025 protected $name;
026
027 /**
028 * Current board configuration
029 * @var \phpbb\config\config
030 */
031 protected $config;
032
033 /** @var \FastImageSize\FastImageSize */
034 protected $imagesize;
035
036 /**
037 * Current $phpbb_root_path
038 * @var string
039 */
040 protected $phpbb_root_path;
041
042 /**
043 * Current $php_ext
044 * @var string
045 */
046 protected $php_ext;
047
048 /**
049 * Path Helper
050 * @var \phpbb\path_helper
051 */
052 protected $path_helper;
053
054 /**
055 * Cache driver
056 * @var \phpbb\cache\driver\driver_interface
057 */
058 protected $cache;
059
060 /**
061 * Array of allowed avatar image extensions
062 * Array is used for setting the allowed extensions in the fileupload class
063 * and as a base for a regex of allowed extensions, which will be formed by
064 * imploding the array with a "|".
065 *
066 * @var array
067 */
068 protected $allowed_extensions = array(
069 'gif',
070 'jpg',
071 'jpeg',
072 'png',
073 );
074
075 /**
076 * Construct a driver object
077 *
078 * @param \phpbb\config\config $config phpBB configuration
079 * @param \FastImageSize\FastImageSize $imagesize FastImageSize class
080 * @param string $phpbb_root_path Path to the phpBB root
081 * @param string $php_ext PHP file extension
082 * @param \phpbb\path_helper $path_helper phpBB path helper
083 * @param \phpbb\cache\driver\driver_interface $cache Cache driver
084 */
085 public function __construct(\phpbb\config\config $config, \FastImageSize\FastImageSize $imagesize, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\cache\driver\driver_interface $cache = null)
086 {
087 $this->config = $config;
088 $this->imagesize = $imagesize;
089 $this->phpbb_root_path = $phpbb_root_path;
090 $this->php_ext = $php_ext;
091 $this->path_helper = $path_helper;
092 $this->cache = $cache;
093 }
094
095 /**
096 * {@inheritdoc}
097 */
098 public function get_custom_html($user, $row, $alt = '')
099 {
100 return '';
101 }
102
103 /**
104 * {@inheritdoc}
105 */
106 public function prepare_form_acp($user)
107 {
108 return array();
109 }
110
111 /**
112 * {@inheritdoc}
113 */
114 public function delete($row)
115 {
116 return true;
117 }
118
119 /**
120 * {@inheritdoc}
121 */
122 public function get_name()
123 {
124 return $this->name;
125 }
126
127 /**
128 * {@inheritdoc}
129 */
130 public function get_config_name()
131 {
132 return preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($this));
133 }
134
135 /**
136 * {@inheritdoc}
137 */
138 public function get_acp_template_name()
139 {
140 return 'acp_avatar_options_' . $this->get_config_name() . '.html';
141 }
142
143 /**
144 * Sets the name of the driver.
145 *
146 * @param string $name Driver name
147 */
148 public function set_name($name)
149 {
150 $this->name = $name;
151 }
152 }
153