source: extensions/Icons_Set/main.inc.php

Last change on this file was 17175, checked in by flop25, 12 years ago

update for pwg 2.4.2

File size: 1.4 KB
Line 
1<?php
2/*
3Plugin Name: Icons Set
4Version: auto
5Description: Allow you to use other icons for any themes
6Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=527
7Author: Flop25
8Author URI: http://www.planete-flop.fr/
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12define('ICONSET_DIR' , basename(dirname(__FILE__)));
13define('ICONSET_PATH' , PHPWG_PLUGINS_PATH . ICONSET_DIR . '/');
14define('ICONS_PATH' , PHPWG_PLUGINS_PATH . ICONSET_DIR . '/icons/');
15
16add_event_handler('get_admin_plugin_menu_links', 'iconset_admin_menu');
17function 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}
28add_event_handler('loc_after_page_header', 'load_set');
29function load_set()
30{
31        if (!defined('IN_ADMIN') or !IN_ADMIN)
32        {
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,
43                                )
44                        );
45                }
46        }
47
48
49}
50?>
Note: See TracBrowser for help on using the repository browser.