source: extensions/ShareThis/admin.php @ 31051

Revision 31051, 2.0 KB checked in by SergeD, 4 years ago (diff)

version 1.0.0 - see change log for details

  • Property svn:eol-style set to native
Line 
1<?php
2/**
3 * This is the main administration page, if you have only one admin page you can put
4 * directly its code here or using the tabsheet system like bellow
5 */
6
7defined('SHARETHIS_PATH') or die('Hacking attempt!');
8
9global $template, $page, $conf;
10
11load_language('plugin.lang', SHARETHIS_PATH);
12$params = $conf['sharethis'];
13
14// Save configuration
15if (isset($_POST['submit'])) {
16
17  $params  = array(
18    'facebook'   => !empty($_POST['inc_facebook']),
19    'pinterest'  => !empty($_POST['inc_pinterest']),
20    'twitter'    => !empty($_POST['inc_twitter']),
21    'googleplus' => !empty($_POST['inc_googleplus'])
22  );
23
24  conf_update_param('sharethis', $params, true);
25
26  pwg_set_session_var( 'purge_template', 1 );
27
28  array_push($page['infos'], l10n('Plugin Settings are saved'));
29}
30
31// Try to find GreyDragon Theme and use Theme's styles for admin area
32$css_file = str_replace('/./', '/', dirname(dirname(dirname(__FILE__))) . '/' . GDTHEME_PATH . "admin/css/styles.css");
33if (@file_exists($css_file)):
34  $custom_css = "yes";
35else:
36  $custom_css = "no";
37endif;
38
39// template vars
40$template->assign(array(
41  'SHARETHIS_PATH'    => SHARETHIS_PATH, // used for images, scripts, ... access
42  'SHARETHIS_ABS_PATH'=> realpath(SHARETHIS_PATH), // used for template inclusion (Smarty needs a real path)
43  'SHARETHIS_ADMIN'   => SHARETHIS_ADMIN,
44  'SHARETHIS_VERSION' => SHARETHIS_VERSION,
45  'GDTHEME_PATH'      => GDTHEME_PATH,
46  'CUSTOM_CSS'        => $custom_css,
47  'PHPWG_ROOT_PATH'   => PHPWG_ROOT_PATH,
48
49  'INC_FACEBOOK'      => isset($params['facebook']) && $params['facebook'],
50  'INC_PINTEREST'     => isset($params['pinterest']) && $params['pinterest'],
51  'INC_TWITTER'       => isset($params['twitter']) && $params['twitter'],
52  'INC_GOOGLEPLUS'    => isset($params['googleplus']) && $params['googleplus']
53
54));
55
56// send page content
57$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/template/admin.tpl'));
58$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
Note: See TracBrowser for help on using the repository browser.