Project

General

Profile

« Previous | Next » 

Revision 2098

Added by darkviper over 10 years ago

! activate class Translate for all addons in admin/ (except pages/)
! class.admin >> add translation of the current theme to Translate

View differences:

tool.php
25 25
    include(WB_PATH.'/framework/class.admin.php');
26 26
    $admin = new admin('Admintools','admintools',false);
27 27
}
28
$oDb = WbDatabase::getInstance();
29
$oTrans = Translate::getInstance();
30
$oTrans->enableAddon('admin\\admintools');
28 31

  
29 32
require_once(WB_PATH.'/framework/functions.php');
30 33

  
......
35 38
// test for valid tool name
36 39
	if(preg_match('/^[a-z][a-z_\-0-9]{2,}$/i', $toolDir)) {
37 40
	// Check if tool is installed
38
		$sql = 'SELECT `name` FROM `'.TABLE_PREFIX.'addons` '.
41
		$sql = 'SELECT `name` FROM `'.$oDb->TablePrefix.'addons` '.
39 42
		       'WHERE `type`=\'module\' AND `function`=\'tool\' '.
40 43
		              'AND `directory`=\''.$toolDir.'\'';
41
		if(($toolName = $database->get_one($sql))) {
44
		if(($toolName = $oDb->getOne($sql))) {
42 45
		// create admin-object and print header if FTAN is NOT supported AND function 'save' is requested
43 46
			$admin_header = !(is_file(WB_PATH.'/modules/'.$toolDir.'/FTAN_SUPPORTED') && $doSave);
44 47
			$admin = new admin('admintools', 'admintools', $admin_header );
45 48
			if(!$doSave) {
46 49
			// show title if not function 'save' is requested
47 50
				print '<h4><a href="'.ADMIN_URL.'/admintools/index.php" '.
48
				      'title="'.$HEADING['ADMINISTRATION_TOOLS'].'">'.
49
				      $HEADING['ADMINISTRATION_TOOLS'].'</a>'.
51
				      'title="'.$oTrans->HEADING_ADMINISTRATION_TOOLS.'">'.
52
				      $oTrans->HEADING_ADMINISTRATION_TOOLS.'</a>'.
50 53
					  '&nbsp;&raquo;&nbsp;'.$toolName.'</h4>'."\n";
51 54
			}
52 55
			// include modules tool.php

Also available in: Unified diff