source: extensions/plugin_lang_analysis/main.inc.php @ 23884

Last change on this file since 23884 was 23488, checked in by mistic100, 11 years ago

display unused strings as useless

File size: 1021 bytes
Line 
1<?php 
2/*
3Plugin Name: Plugin Language Analysis
4Version: auto
5Description: Add a tool to analyse translation strings of plugins
6Plugin URI: auto
7Author: Mistic
8Author URI: http://www.strangeplanet.fr
9*/
10
11defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
12
13if (!defined('IN_ADMIN'))
14{
15  return;
16}
17
18global $conf;
19
20defined('PLA_ID') or define('PLA_ID', basename(dirname(__FILE__)));
21define('PLA_PATH' , PHPWG_PLUGINS_PATH . PLA_ID . '/');
22define('PLA_ADMIN', get_root_url() . 'admin.php?page=plugin-' . PLA_ID);
23define('PLA_DATA',  $conf['data_location'] . PLA_ID . '/');
24
25add_event_handler('loc_begin_admin', 'pla_begin_admin');
26
27function pla_begin_admin()
28{
29  global $template;
30  $template->set_prefilter('admin', 'pla_add_menu_item');
31}
32
33function pla_add_menu_item($content, &$smarty)
34{
35  $search = 'href="{$U_UPDATES}">{\'Updates\'|@translate}</a></li>';
36  $add = '<li><a class="icon-language" href="'.PLA_ADMIN.'">Plugin Language Analysis</a></li>';
37  return str_replace($search, $search."\n".$add, $content);
38}
39
40?>
Note: See TracBrowser for help on using the repository browser.