blob: 6746ccada5db2667f62747400a5bf6c77c5693c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\textformatter;
abstract class parser
{
/**
* Parse given text
*
* @param string $text
* @return string
*/
abstract public function parse($text);
/**
* Disable a specific BBCode
*
* @param string $name BBCode name
* @return null
*/
abstract public function disable_bbcode($name);
/**
* Disable BBCodes in general
*/
abstract public function disable_bbcodes();
/**
* Disable the censor
*/
abstract public function disable_censor();
/**
* Disable magic URLs
*/
abstract public function disable_magic_url();
/**
* Disable smilies
*/
abstract public function disable_smilies();
/**
* Enable a specific BBCode
*
* @param string $name BBCode name
* @return null
*/
abstract public function enable_bbcode($name);
/**
* Enable BBCodes in general
*/
abstract public function enable_bbcodes();
/**
* Enable the censor
*/
abstract public function enable_censor();
/**
* Enable magic URLs
*/
abstract public function enable_magic_url();
/**
* Enable smilies
*/
abstract public function enable_smilies();
/**
* Get the list of errors that were generated during last parsing
*
* @return array
*/
abstract public function get_errors();
/**
* Set a variable to be used by the parser
*
* - max_font_size
* - max_img_height
* - max_img_width
* - max_smilies
* - max_urls
*
* @param string $name
* @param mixed $value
* @return null
*/
abstract public function set_var($name, $value);
/**
* Set multiple variables to be used by the parser
*
* @param array Associative array of [name => value]
* @return null
*/
public function set_vars(array $vars)
{
foreach ($vars as $name => $value)
{
$this->set_var($name, $value);
}
}
}
|