00001 <?php
00002
00015
00016
00017
00018 import('help.HelpMappingFile');
00019
00020 class PluginHelpMappingFile extends HelpMappingFile {
00022 var $plugin;
00023
00027 function PluginHelpMappingFile(&$plugin) {
00028 parent::HelpMappingFile($plugin->getHelpMappingFilename());
00029 $this->plugin =& $plugin;
00030 }
00031
00035 function getTocFilename($tocId) {
00036 $help =& Help::getHelp();
00037 return $this->plugin->getPluginPath() . DIRECTORY_SEPARATOR . 'help' . DIRECTORY_SEPARATOR . $help->getLocale() . DIRECTORY_SEPARATOR . $tocId . '.xml';
00038 }
00039
00043 function getTopicFilename($topicId) {
00044 $help =& Help::getHelp();
00045 return $this->plugin->getPluginPath() . DIRECTORY_SEPARATOR . 'help' . DIRECTORY_SEPARATOR . $help->getLocale() . DIRECTORY_SEPARATOR . $topicId . '.xml';
00046 }
00047
00048 function getTopicIdForFilename($filename) {
00049 $parts = split('/', str_replace('\\', '/', $filename));
00050 array_shift($parts);
00051 array_shift($parts);
00052 array_shift($parts);
00053 array_shift($parts);
00054 array_shift($parts);
00055 return substr(join('/', $parts), 0, -4);
00056 }
00057
00058 function getSearchPath($locale = null) {
00059 if ($locale == '') {
00060 $help =& Help::getHelp();
00061 $locale = $help->getLocale();
00062 }
00063 return $this->plugin->getPluginPath() . DIRECTORY_SEPARATOR . 'help' . DIRECTORY_SEPARATOR . $locale;
00064 }
00065 }
00066
00067 ?>