blog->settings->addNamespace('translater'); $core->addBehavior('pluginsToolsTabs',array('translaterAdminBehaviors','pluginsToolsTabs')); $core->addBehavior('adminCurrentThemeDetails',array('translaterAdminBehaviors','adminCurrentThemeDetails')); $core->addBehavior('addTranslaterProposalTool',array('translaterAdminBehaviors','addGoogleProposalTool')); $core->addBehavior('addTranslaterProposalTool',array('translaterAdminBehaviors','addYahooProposalTool')); $core->addBehavior('addTranslaterProposalTool',array('translaterAdminBehaviors','addMicrosoftProposalTool')); $core->rest->addFunction('getProposal',array('translaterRest','getProposal')); $_menu['Plugins']->addItem( __('Translater'), 'plugin.php?p=translater', 'index.php?pf=translater/icon.png', preg_match('/plugin.php\?p=translater(&.*)?$/',$_SERVER['REQUEST_URI']), $core->auth->isSuperAdmin() ); class translaterAdminBehaviors { # Plugins tab public static function pluginsToolsTabs($core) { if (!$core->blog->settings->translater->translater_plugin_menu || !$core->auth->isSuperAdmin()) { return; } echo '
'. ''. ''. ''. ''. ''. ''. ''; $modules = $core->plugins->getModules(); foreach ($modules as $name => $plugin) { echo ''. ''. ''. ''. ''. ''. ''; } echo '
 '.__('Name').''.__('Version').''.__('Details').''.__('Author').'
'. ''.__($plugin['name']).''.$name.''.$plugin['version'].''.$plugin['desc'].''.$plugin['author'].'
'; } # Themes menu public static function adminCurrentThemeDetails($core,$id,$infos) { if (!$core->blog->settings->translater->translater_theme_menu || !$core->auth->isSuperAdmin()) { return; } $root = path::real($infos['root']); if ($id != 'default' && is_dir($root.'/locales')) { return '

'.__('Translate this theme').'

'; } } # Google Translater tools public static function addGoogleProposalTool($proposal) { $proposal->addTool('googleProposalTool'); } # Yahoo Babelfish tools public static function addYahooProposalTool($proposal) { $proposal->addTool('yahooProposalTool'); } # Microsoft Bing tools public static function addMicrosoftProposalTool($proposal) { $proposal->addTool('microsoftProposalTool'); } } ?>