Ignore:
Timestamp:
Jan 12, 2014, 7:13:40 PM (10 years ago)
Author:
mistic100
Message:

integrate in new tags manager + rename in Coloured Tags
(my apologies to translators :-) )

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/typetags/main.inc.php

    r21361 r26665  
    11<?php
    22/*
    3 Plugin Name: TypeT@gs
     3Plugin Name: Coloured Tags (TypeT@gs)
    44Version: auto
    55Description: Allow to manage color of tags, as you want...
    6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=166
    7 Author: Sakkhho & P@t & Mistic
     6Plugin URI: auto
     7Author: Mistic
    88*/
    99
    10 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     10defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
    1111
    1212global $prefixeTable, $conf;
    1313
    14 define('typetags_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
    15 define('typetags_TABLE' , $prefixeTable . 'typetags');
    16 define('typetags_ADMIN', get_root_url().'admin.php?page=plugin-' . basename(dirname(__FILE__)));
     14define('TYPETAGS_ID',      basename(dirname(__FILE__)));
     15define('TYPETAGS_PATH' ,   PHPWG_PLUGINS_PATH . TYPETAGS_ID . '/');
     16define('TYPETAGS_TABLE' ,  $prefixeTable . 'typetags');
     17define('TYPETAGS_ADMIN',   get_root_url().'admin.php?page=plugin-' . TYPETAGS_ID);
     18define('TYPETAGS_VERSION', 'auto');
    1719
    1820
    19 include_once(typetags_PATH . 'typetags.php');
    2021$conf['TypeTags'] = unserialize($conf['TypeTags']);
     22
     23
     24include_once(TYPETAGS_PATH . 'include/events_public.inc.php');
    2125
    2226// tags on picture page
     
    2731
    2832// tags everywhere
    29 if ( $conf['TypeTags']['show_all'] and script_basename() != 'tags' )
     33if ($conf['TypeTags']['show_all'] and script_basename() != 'tags')
    3034{
    31   add_event_handler('render_tag_name', 'typetags_render', 0);
    32 }
    33 // tags on tags page
    34 else if (script_basename() == 'tags')
    35 {
    36   add_event_handler('loc_begin_page_header', 'typetags_tags');
     35  add_event_handler('render_tag_name', 'typetags_render', 0, 2);
    3736}
    3837
     38// tags on tags page
     39add_event_handler('loc_end_tags', 'typetags_tags');
    3940
    40 add_event_handler('get_admin_plugin_menu_links', 'typetags_admin_menu');
    4141
    42 function typetags_admin_menu($menu)
     42if (defined('IN_ADMIN'))
    4343{
    44   array_push($menu, array(
    45     'NAME' => 'TypeT@gs',
    46     'URL' => typetags_ADMIN,
    47   ));
    48   return $menu;
     44  add_event_handler('get_admin_plugin_menu_links', 'typetags_admin_menu');
     45
     46  add_event_handler('loc_begin_admin_page', 'typetags_admin');
     47
     48  include_once(TYPETAGS_PATH . 'include/events_admin.inc.php');
    4949}
    50 
    51 ?>
Note: See TracChangeset for help on using the changeset viewer.