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