-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathReadability-Admin.php
More file actions
61 lines (50 loc) · 1.6 KB
/
Readability-Admin.php
File metadata and controls
61 lines (50 loc) · 1.6 KB
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
<?php
if (!defined('WEDGE'))
die('Hacking attempt...');
function readability_admin()
{
global $admin_areas, $context;
// The name in use here is the plugin's name. It doesn't need to be translatable. Plus the file we need will already be loaded.
$admin_areas['plugins']['areas']['readability'] = array(
'label' => 'Readability',
'function' => 'ModifyReadabilitySettings',
'icon' => 'posts.gif',
'bigicon' => $context['plugins_url']['Arantor:Readability'] . '/readability.png',
);
}
function ModifyReadabilitySettings($return_config = false)
{
global $txt, $context, $settings;
loadSource('ManageServer');
loadPluginLanguage('Arantor:Readability', 'Readability-Admin');
if (empty($settings['allow_guestAccess']))
$config_vars = array(
array('desc', 'readability_not_available'),
);
else
$config_vars = array(
array('desc', 'readability_desc'),
array('check', 'rdb_nowlater'),
array('check', 'rdb_print'),
array('check', 'rdb_email'),
array('check', 'rdb_kindle'),
'',
array('text', 'rdb_text_fg'),
array('text', 'rdb_text_bg'),
array('select', 'rdb_position', array('abovetopic' => $txt['rdb_position_abovetopic'], 'sidebar' => $txt['rdb_position_sidebar'])),
);
if ($return_config)
return $config_vars;
// Saving?
if (isset($_GET['save']))
{
checkSession();
saveDBSettings($config_vars);
redirectexit('action=admin;area=readability');
}
$context['post_url'] = '<URL>?action=admin;area=readability;save';
$context['settings_title'] = $context['page_title'] = $txt['readability'];
wetem::load('show_settings');
prepareDBSettingContext($config_vars);
}
?>