1 | <?php |
||
21 | class wizard |
||
22 | { |
||
23 | /** @var string The default BBvideo site */ |
||
24 | const BBVIDEO_DEFAULT = 'youtube.com'; |
||
25 | |||
26 | /** @var helper */ |
||
27 | protected $helper; |
||
28 | |||
29 | /** @var request */ |
||
30 | protected $request; |
||
31 | |||
32 | /** @var template */ |
||
33 | protected $template; |
||
34 | |||
35 | /** @var string */ |
||
36 | protected $ext_root_path; |
||
37 | |||
38 | /** |
||
39 | * Constructor |
||
40 | * |
||
41 | * @param helper $helper Controller helper object |
||
42 | * @param request $request Request object |
||
43 | * @param template $template Template object |
||
44 | * @param string $ext_root_path Path to abbc3 extension root |
||
45 | * @access public |
||
46 | */ |
||
47 | 13 | public function __construct(helper $helper, request $request, template $template, $ext_root_path) |
|
54 | |||
55 | /** |
||
56 | * BBCode wizard controller accessed with the URL /wizard/bbcode/{mode} |
||
57 | * (where {mode} is a placeholder for a string of the bbcode tag name) |
||
58 | * intended to be accessed via AJAX only |
||
59 | * |
||
60 | * @param string $mode Mode taken from the URL |
||
61 | * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
||
62 | * @throws \phpbb\exception\http_exception An http exception |
||
63 | * @throws \phpbb\exception\runtime_exception Runtime exception if JSON fails |
||
64 | * @access public |
||
65 | */ |
||
66 | 10 | public function bbcode_wizard($mode) |
|
81 | |||
82 | /** |
||
83 | * Set template variables for the BBvideo wizard |
||
84 | * |
||
85 | * @throws \phpbb\exception\runtime_exception |
||
86 | * @access protected |
||
87 | */ |
||
88 | 1 | protected function generate_bbvideo_wizard() |
|
110 | |||
111 | /** |
||
112 | * Return decoded JSON data from a JSON file (stored in assets/) |
||
113 | * |
||
114 | * @param string $json_file The name of the JSON file to get |
||
115 | * @return array JSON data |
||
116 | * @throws \phpbb\exception\runtime_exception |
||
117 | * @access protected |
||
118 | */ |
||
119 | 4 | protected function load_json_data($json_file) |
|
140 | } |
||
141 |