AAAAhome/academiac/www/administrator/components/com_admin/models/help.php000064400000006416151372411750022143 0ustar00help_search)) { $this->help_search = JRequest::getString('helpsearch'); } return $this->help_search; } /** * Method to get the page * @return string page */ function &getPage() { if (is_null($this->page)) { $page = JRequest::getCmd('page', 'JHELP_START_HERE'); $this->page = JHelp::createUrl($page); } return $this->page; } /** * Method to get the lang tag * @return string lang iso tag */ function &getLangTag() { if (is_null($this->lang_tag)) { $lang = JFactory::getLanguage(); $this->lang_tag = $lang->getTag(); jimport('joomla.filesystem.folder'); if (!JFolder::exists(JPATH_BASE . '/help/' . $this->lang_tag)) { $this->lang_tag = 'en-GB'; // use english as fallback } } return $this->lang_tag; } /** * Method to get the toc * @return array Table of contents */ function &getToc() { if (is_null($this->toc)) { // Get vars $lang_tag = $this->getLangTag(); $help_search = $this->getHelpSearch(); // Get Help files $files = JFolder::files(JPATH_BASE . '/help/' . $lang_tag, '\.xml$|\.html$'); $this->toc = array(); foreach($files as $file) { $buffer = file_get_contents(JPATH_BASE . '/help/' . $lang_tag . '/' . $file); if (preg_match('#(.*?)#', $buffer, $m)) { $title = trim($m[1]); if ($title) { // Translate the page title $title = JText::_($title); // strip the extension $file = preg_replace('#\.xml$|\.html$#', '', $file); if ($help_search) { if (JString::strpos(JString::strtolower(strip_tags($buffer)), JString::strtolower($help_search)) !== false) { // Add an item in the Table of Contents $this->toc[$file] = $title; } } else { // Add an item in the Table of Contents $this->toc[$file] = $title; } } } } // Sort the Table of Contents asort($this->toc); } return $this->toc; } /** * Method to get the latest version check; * @return string Latest Version Check URL */ 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; } } home/academiac/www/libraries/joomla/html/toolbar/button/help.php000064400000004620151372611430021033 0ustar00fetchIconClass('help'); $doTask = $this->_getCommand($ref, $com, $override, $component); $html = "\n"; $html .= "\n"; $html .= "\n"; $html .= "$text\n"; $html .= "\n"; return $html; } /** * Get the button id * * Redefined from JButton class * * @return string Button CSS Id * * @since 11.1 */ public function fetchId() { return $this->_parent->getName() . '-' . "help"; } /** * 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 11.1 */ protected function _getCommand($ref, $com, $override, $component) { // Get Help URL jimport('joomla.language.help'); $url = JHelp::createURL($ref, $com, $override, $component); $url = htmlspecialchars($url, ENT_QUOTES); $cmd = "Joomla.popupWindow('$url', '" . JText::_('JHELP', true) . "', 700, 500, 1)"; return $cmd; } } home/academiac/www/libraries/joomla/language/help.php000064400000010641151375622250016702 0ustar00getParam('helpsite'); // If user hasn't specified a help URL, then get the global one. if ($url == '') { $url = $app->getCfg('helpurl'); } // Component help URL overrides user and global. if ($useComponent) { // Look for help URL in component parameters. $params = JComponentHelper::getParams($component); $url = $params->get('helpURL'); if ($url == '') { $local = true; $url = 'components/{component}/help/{language}/{keyref}'; } } // Set up a local help URL. if (!$url) { $local = true; $url = 'help/{language}/{keyref}'; } } // If the URL is local then make sure we have a valid file extension on the URL. if ($local) { if (!preg_match('#\.html$|\.xml$#i', $ref)) { $url .= '.html'; } } /* * Replace substitution codes in the URL. */ $lang = JFactory::getLanguage(); $version = new JVersion; $jver = explode('.', $version->getShortVersion()); $jlang = explode('-', $lang->getTag()); $debug = $lang->setDebug(false); $keyref = JText::_($ref); $lang->setDebug($debug); // Replace substitution codes in help URL. $search = array('{app}', // Application name (eg. 'Administrator') '{component}', // Component name (eg. 'com_content') '{keyref}', // Help screen key reference '{language}', // Full language code (eg. 'en-GB') '{langcode}', // Short language code (eg. 'en') '{langregion}', // Region code (eg. 'GB') '{major}', // Joomla major version number '{minor}', // Joomla minor version number '{maintenance}'// Joomla maintenance version number ); $replace = array($app->getName(), // {app} $component, // {component} $keyref, // {keyref} $lang->getTag(), // {language} $jlang[0], // {langcode} $jlang[1], // {langregion} $jver[0], // {major} $jver[1], // {minor} $jver[2]// {maintenance} ); // If the help file is local then check it exists. // If it doesn't then fallback to English. if ($local) { $try = str_replace($search, $replace, $url); jimport('joomla.filesystem.file'); if (!JFile::exists(JPATH_BASE . '/' . $try)) { $replace[3] = 'en-GB'; $replace[4] = 'en'; $replace[5] = 'GB'; } } $url = str_replace($search, $replace, $url); return $url; } /** * Builds a list of the help sites which can be used in a select option. * * @param string $pathToXml Path to an XML file. * @param string $selected Language tag to select (if exists). * * @return array An array of arrays (text, value, selected). * * @since 11.1 */ public static function createSiteList($pathToXml, $selected = null) { $list = array(); $xml = false; if (!empty($pathToXml)) { $xml = JFactory::getXML($pathToXml); } if (!$xml) { $option['text'] = 'English (GB) help.joomla.org'; $option['value'] = 'http://help.joomla.org'; $list[] = $option; } else { $option = array(); foreach ($xml->sites->site as $site) { $option['text'] = (string) $site; $option['value'] = (string) $site->attributes()->url; $list[] = $option; } } return $list; } }