Ignore:
Timestamp:
Jul 1, 2012, 2:29:15 AM (12 years ago)
Author:
mistic100
Message:

choose between selectbox or thumbnails grid with a local config option, thumbnail grid use 2.4 drop-downs menus, only an icon appears on toolbar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/theme_switch/trunk/main.inc.php

    r7173 r16241  
    44// | Theme switch plugin                                                   |
    55// +-----------------------------------------------------------------------+
     6// | Copyright(C) 2012      Piwigo Team                  http://piwigo.org |
    67// | Copyright(C) 2010      Pavel Budka               http://budkovi.ic.cz |
    78// +-----------------------------------------------------------------------+
     
    2324/*
    2425Plugin Name: Theme Switch
    25 Version: 2.1.a
    26 Description: Lets logged or unlogged user change appearance of gallery (via switching to different theme) on gallery home page. Based on Language switch. The switch can show theme names or theme icons, depends on configuration. See details in a file main.inc.php.
     26Version: auto
     27Description: Lets users change the theme of the gallery via menu on home page. The switch can show theme names or theme icons, depends on configuration.
    2728Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=257
    28 Author: Pavel Budka
     29Author: Pavel Budka & Mistic
    2930Author URI: http://budkovi.ic.cz
    3031*/
    3132
    32 include_once(PHPWG_PLUGINS_PATH.'theme_switch/theme_switch.inc.php');
    33 $theme_controler = new theme_controler();
    34 add_event_handler('loading_lang', array(&$theme_controler, '_switch'), 5 );
     33// in order to use select box instead of thumbnail view, add
     34// $conf['theme_switch_mode'] = 'select';
     35// in your local configuration
    3536
    36 // If you want user to choose from icons then use following handler.
    37 // Only themes which have screenshot.png icon provided will be provided to users.
     37if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    3838
    39 add_event_handler('loc_end_index', array(&$theme_controler, '_flags'), 85 );
     39define('THEME_SWITCH_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
    4040
    41 // If you want user to choose using select control then use following handler.
    42 // All available themes will be provided to users.
     41include_once(THEME_SWITCH_PATH.'theme_switch.inc.php');
    4342
    44 add_event_handler('loc_end_index', array(&$theme_controler, '_select'), 15 );
    45 
    46 // this is preparation for future version with configuration
    47 // add_event_handler('get_admin_plugin_menu_links', array(&$theme_controler,'_theme_admin'));
     43add_event_handler('user_init', 'theme_controler_switch');
     44add_event_handler('loc_end_index', 'theme_controler_init');
    4845
    4946?>
Note: See TracChangeset for help on using the changeset viewer.