Project

General

Profile

« Previous | Next » 

Revision 587

Added by doc almost 17 years ago

Added multi-lingual Admin tool description. Moved Admin tool language text from global language file to module language files. Added function get_variable_content to allow extraction of variable without including files.

View differences:

index.php
46 46
	while($tool = $results->fetchRow()) {
47 47
		$template->set_var('TOOL_NAME', $tool['name']);
48 48
		$template->set_var('TOOL_DIR', $tool['directory']);
49
		$template->set_var('TOOL_DESCRIPTION', $tool['description']);
49
		// check if a module description exists for the displayed backend language
50
		$tool_description = false;
51
		if(function_exists('file_get_contents') && file_exists(WB_PATH.'/modules/'.$tool['directory'].'/languages/'.LANGUAGE .'.php')) {
52
			// read contents of the module language file into string
53
			$data = @file_get_contents(WB_PATH .'/modules/' .$tool['directory'] .'/languages/' .LANGUAGE .'.php');
54
			$tool_description = get_variable_content('module_description', $data, true, false);
55
		}		
56
		$template->set_var('TOOL_DESCRIPTION', ($tool_description === False)? $tool['description'] :$tool_description);
50 57
		$template->parse('tool_list', 'tool_list_block', true);
51 58
	}
52 59
} else {

Also available in: Unified diff