1 | <?php |
||
12 | class Stencil_Config { |
||
13 | /** |
||
14 | * Implementations provided by us. |
||
15 | * |
||
16 | * @var array |
||
17 | */ |
||
18 | private $known_implementations = array( |
||
19 | 'stencil-dwoo' => 'Dwoo', |
||
20 | 'stencil-dwoo2' => 'Dwoo 2', |
||
21 | 'stencil-mustache' => 'Mustache', |
||
22 | 'stencil-savant3' => 'Savant 3', |
||
23 | 'stencil-smarty2' => 'Smarty 2.x', |
||
24 | 'stencil-smarty3' => 'Smarty 3.x', |
||
25 | 'stencil-twig' => 'Twig', |
||
26 | ); |
||
27 | |||
28 | /** |
||
29 | * Implementations that require a specific minimal PHP version |
||
30 | * |
||
31 | * @var array |
||
32 | */ |
||
33 | private $implementation_php_requirements = array( |
||
34 | 'stencil-dwoo' => '5.3.0', |
||
35 | 'stencil-dwoo2' => '5.3.0', |
||
36 | ); |
||
37 | |||
38 | /** |
||
39 | * Option page |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | private $option_page = 'stencil-options'; |
||
44 | |||
45 | /** |
||
46 | * Option group |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | private $option_group = 'stencil-implementations'; |
||
51 | |||
52 | /** |
||
53 | * The name of the option |
||
54 | * |
||
55 | * @var string |
||
56 | */ |
||
57 | private $option_name = 'install'; |
||
58 | |||
59 | /** |
||
60 | * Stencil_Config constructor. |
||
61 | */ |
||
62 | public function __construct() { |
||
67 | |||
68 | /** |
||
69 | * Create the menu item |
||
70 | */ |
||
71 | public function create_admin_menu() { |
||
81 | |||
82 | /** |
||
83 | * Register settings |
||
84 | */ |
||
85 | public function register_options() { |
||
104 | |||
105 | /** |
||
106 | * Show plugins that are not installed yet (but tracked) |
||
107 | * Check to install; installed plugins are grayed out and checked |
||
108 | * but are ignored on save. |
||
109 | */ |
||
110 | public function option_implementations() { |
||
148 | |||
149 | /** |
||
150 | * Show the settings |
||
151 | */ |
||
152 | public function settings_page() { |
||
177 | |||
178 | /** |
||
179 | * Install selected plugins |
||
180 | */ |
||
181 | public function maybe_install_plugins() { |
||
224 | |||
225 | /** |
||
226 | * Install plugin by slug |
||
227 | * |
||
228 | * @param string $slug Plugin slug. |
||
229 | * |
||
230 | * @return bool |
||
231 | */ |
||
232 | public function install_plugin( $slug ) { |
||
244 | |||
245 | /** |
||
246 | * Get the download link for the plugin |
||
247 | * |
||
248 | * @param string $slug Plugin slug. |
||
249 | * |
||
250 | * @return string |
||
251 | */ |
||
252 | private function get_download_link( $slug ) { |
||
255 | } |
||
256 |