[10297] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: Icons Set |
---|
| 4 | Version: auto |
---|
| 5 | Description: Allow you to use other icons for any themes |
---|
[11626] | 6 | Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=527 |
---|
[10297] | 7 | Author: Flop25 |
---|
| 8 | Author URI: http://www.planete-flop.fr/ |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 12 | define('ICONSET_DIR' , basename(dirname(__FILE__))); |
---|
| 13 | define('ICONSET_PATH' , PHPWG_PLUGINS_PATH . ICONSET_DIR . '/'); |
---|
| 14 | define('ICONS_PATH' , PHPWG_PLUGINS_PATH . ICONSET_DIR . '/icons/'); |
---|
| 15 | |
---|
| 16 | add_event_handler('get_admin_plugin_menu_links', 'iconset_admin_menu'); |
---|
| 17 | function iconset_admin_menu($menu) |
---|
| 18 | { |
---|
| 19 | global $conf; |
---|
| 20 | |
---|
| 21 | array_push($menu, array( |
---|
| 22 | 'NAME' => 'Icons Set', |
---|
| 23 | 'URL' => get_root_url().'admin.php?page=plugin-'.ICONSET_DIR |
---|
| 24 | ) |
---|
| 25 | ); |
---|
| 26 | return $menu; |
---|
| 27 | } |
---|
[10330] | 28 | add_event_handler('loc_after_page_header', 'load_set'); |
---|
| 29 | function load_set() |
---|
| 30 | { |
---|
[10357] | 31 | if (!defined('IN_ADMIN') or !IN_ADMIN) |
---|
[10330] | 32 | { |
---|
[10357] | 33 | global $template, $user, $conf; |
---|
| 34 | $conf_iconset = @unserialize($conf['iconset']);//pwg_db_real_escape_string(serialize($conf_iconset)) |
---|
| 35 | $conf_themes=$conf_iconset['themes']; |
---|
| 36 | $conf_icons=$conf_iconset['icons']; |
---|
| 37 | if (isset($user['theme']) and is_array($conf_themes) and array_key_exists($user['theme'], $conf_themes) and !empty($conf_themes[$user['theme']]) and file_exists(ICONS_PATH.$conf_themes[$user['theme']]) ) |
---|
| 38 | { |
---|
| 39 | include ICONS_PATH.$conf_themes[$user['theme']]; |
---|
| 40 | $template->func_combine_css(array( |
---|
| 41 | 'path' => $iconsetconf['css_file'], |
---|
| 42 | 'order' => 100, |
---|
[17175] | 43 | ) |
---|
[10357] | 44 | ); |
---|
| 45 | } |
---|
[10330] | 46 | } |
---|
[10297] | 47 | |
---|
[10330] | 48 | |
---|
| 49 | } |
---|
[10297] | 50 | ?> |
---|