/** * Tests the createURL method for com_content's Article Manager view * * @return void * * @covers JHelp::createURL * @since 3.0 */ public function testCreateUrl() { $this->assertEquals('help/en-GB/Content_Article_Manager.html', JHelp::createUrl('JHELP_CONTENT_ARTICLE_MANAGER'), 'Creates a local help URL for com_content Article Manager.'); $this->assertEquals('components/com_content/help/en-GB/Content_Article_Manager.html', JHelp::createUrl('JHELP_CONTENT_ARTICLE_MANAGER', true, null, 'com_content'), 'Creates a local help URL for com_content Article Manager in the component.'); $this->assertEquals('http://domain.tld/help', JHelp::createUrl('JHELP_CONTENT_ARTICLE_MANAGER', true, 'http://domain.tld/help', 'com_content'), 'Creates a remote help URL via an override for com_content Article Manager.'); $this->assertEquals('help/en-GB/Content_Article_Manager.html', JHelp::createUrl('JHELP_CONTENT_ARTICLE_MANAGER', false, null, 'com_content'), 'Creates a local help URL for com_content Article Manager.'); }
/** * Get the JavaScript command for the button * * @param string $ref The name of the help screen (its key reference). * @param boolean $com Use the help file in the component directory. * @param string $override Use this URL instead of any other. * @param string $component Name of component to get Help (null for current component) * * @return string JavaScript command string * * @since 3.0 */ protected function _getCommand($ref, $com, $override, $component) { // Get Help URL $url = JHelp::createUrl($ref, $com, $override, $component); $url = htmlspecialchars($url, ENT_QUOTES); $cmd = "Joomla.popupWindow('{$url}', '" . JText::_('JHELP', true) . "', 700, 500, 1)"; return $cmd; }
/** * Method to get the page */ public function &getPage() { if (is_null($this->page)) { $page = JFactory::getApplication()->input->get('page', 'JHELP_START_HERE'); $this->page = JHelp::createUrl($page); } return $this->page; }
/** * Method to get the latest version check * * @return string Latest Version Check URL */ public function &getLatestVersionCheck() { if (!$this->latest_version_check) { $override = 'http://help.joomla.org/proxy/index.php?option=com_help&keyref=Help{major}{minor}:Joomla_Version_{major}_{minor}_{maintenance}'; $this->latest_version_check = JHelp::createUrl('JVERSION', false, $override); } return $this->latest_version_check; }
</li> <li><?php echo JHtml::_('link', JHelp::createUrl('JHELP_GLOSSARY'), JText::_('COM_ADMIN_GLOSSARY'), array('target' => 'helpFrame')); ?> </li> <hr class="hr-condensed" /> <li class="nav-header"><?php echo JText::_('COM_ADMIN_ALPHABETICAL_INDEX'); ?> </li> <?php foreach ($this->toc as $k => $v) { ?> <li> <?php $url = JHelp::createUrl('JHELP_' . strtoupper($k)); ?> <?php echo JHtml::_('link', $url, $v, array('target' => 'helpFrame')); ?> </li> <?php } ?> </ul> </div> </div> <div class="span9"> <iframe name="helpFrame" height="70%" src="<?php echo $this->page; ?>
/** * Display Help Page * * For this method the important two scenarios are local or remote help files. * In the case of local help files the language tag will be added in order to * allow different languages of help.<br /> * In case of the remote server it is assumed that this server provide one specific * help set of files in one particular language. */ function help() { global $mainframe; jimport('joomla.filesystem.folder'); jimport('joomla.language.help'); // Get Help URL - an empty helpurl is interpreted as local help files! $helpurl = $mainframe->getCfg('helpurl'); if ($helpurl == 'http://help.mamboserver.com') { $helpurl = 'http://help.joomla.org'; } $fullhelpurl = $helpurl . '/index2.php?option=com_content&task=findkey&pop=1&keyref='; $helpsearch = JRequest::getString('helpsearch'); $page = JRequest::getCmd('page', 'joomla.whatsnew15.html'); $toc = getHelpToc($helpsearch); $lang =& JFactory::getLanguage(); $langTag = $lang->getTag(); if (!JFolder::exists(JPATH_BASE . DS . 'help' . DS . $langTag)) { $langTag = 'en-GB'; // use english as fallback } if (!eregi('\\.html$', $page)) { $page .= '.xml'; } ?> <form action="index.php?option=com_admin&task=help" method="post" name="adminForm"> <table class="adminform" border="1"> <tr> <td colspan="2"> <table width="100%"> <tr> <td> <strong><?php echo JText::_('Search'); ?> :</strong> <input class="text_area" type="hidden" name="option" value="com_admin" /> <input type="text" name="helpsearch" value="<?php echo $helpsearch; ?> " class="inputbox" /> <input type="submit" value="<?php echo JText::_('Go'); ?> " class="button" /> <input type="button" value="<?php echo JText::_('Clear Results'); ?> " class="button" onclick="f=document.adminForm;f.helpsearch.value='';f.submit()" /> </td> <td class="helpMenu"> <?php if ($helpurl) { ?> <?php echo JHTML::_('link', JHelp::createUrl('joomla.glossary'), JText::_('Glossary'), array('target' => 'helpFrame')); ?> | <?php echo JHTML::_('link', JHelp::createUrl('joomla.credits'), JText::_('Credits'), array('target' => 'helpFrame')); ?> | <?php echo JHTML::_('link', JHelp::createUrl('joomla.support'), JText::_('Support'), array('target' => 'helpFrame')); ?> <?php } else { ?> <?php echo JHTML::_('link', JURI::base() . 'help/' . $langTag . '/joomla.glossary.html', JText::_('Glossary'), array('target' => 'helpFrame')); ?> | <?php echo JHTML::_('link', JURI::base() . 'help/' . $langTag . '/joomla.credits.html', JText::_('Credits'), array('target' => 'helpFrame')); ?> | <?php echo JHTML::_('link', JURI::base() . 'help/' . $langTag . '/joomla.support.html', JText::_('Support'), array('target' => 'helpFrame')); ?> <?php } ?> | <?php echo JHTML::_('link', 'http://www.gnu.org/licenses/gpl-2.0.html', JText::_('License'), array('target' => 'helpFrame')); ?> | <?php echo JHTML::_('link', 'http://help.joomla.org', 'help.joomla.org', array('target' => 'helpFrame')); ?> | <?php echo JHTML::_('link', 'index.php?option=com_admin&task=changelog&tmpl=component', JText::_('Changelog'), array('target' => 'helpFrame')); ?> | <?php echo JHTML::_('link', 'http://www.joomla.org/content/blogcategory/57/111/', JText::_('Latest Version Check'), array('target' => 'helpFrame')); ?> </td> </tr> </table> </td> </tr> </table> <div id="treecellhelp"> <fieldset title="<?php echo JText::_('Alphabetical Index'); ?> "> <legend> <?php echo JText::_('Alphabetical Index'); ?> </legend> <div class="helpIndex"> <ul class="subext"> <?php foreach ($toc as $k => $v) { if ($helpurl) { echo '<li>'; echo JHTML::_('link', JHelp::createUrl($k), $v, array('target' => 'helpFrame')); echo '</li>'; } else { echo '<li>'; echo JHTML::_('link', JURI::base() . 'help/' . $langTag . '/' . $k, $v, array('target' => 'helpFrame')); echo '</li>'; } } ?> </ul> </div> </fieldset> </div> <div id="datacellhelp"> <fieldset title="<?php echo JText::_('View'); ?> "> <legend> <?php echo JText::_('View'); ?> </legend> <?php if ($helpurl && $page != 'joomla.whatsnew15.html') { ?> <iframe name="helpFrame" src="<?php echo $fullhelpurl . preg_replace('#\\.xml$|\\.html$#', '', $page); ?> " class="helpFrame" frameborder="0"></iframe> <?php } else { ?> <iframe name="helpFrame" src="<?php echo JURI::base() . 'help/' . $langTag . '/' . $page; ?> " class="helpFrame" frameborder="0"></iframe> <?php } ?> </fieldset> </div> <input type="hidden" name="task" value="help" /> </form> <?php }
<legend><?php echo JText::_('Admin_Alphabetical_Index'); ?> </legend> <div class="helpIndex"> <ul class="subext"> <?php foreach ($this->toc as $k => $v) { ?> <li> <?php if ($this->help_url) { ?> <?php echo JHtml::_('link', JHelp::createUrl($k), $v, array('target' => 'helpFrame')); ?> <?php } else { ?> <?php echo JHtml::_('link', JURI::base() . 'help/' . $this->lang_tag . '/' . $k, $v, array('target' => 'helpFrame')); ?> <?php } ?> </li> <?php } ?> </ul>