/** * Helper function: Set the URL to the help section for a config option * * @param string $t Template * @param string $group 'Core' or plugin name * @param string $option name of the config option * */ function _set_ConfigHelp(&$t, $group, $option) { static $docUrl; if (!isset($docUrl)) { $docUrl = array(); } $retval = ''; $configtext = PLG_getConfigTooltip($group, $option); if (empty($configtext)) { if ($group == 'Core') { $configtext = NULL; if (!empty($GLOBALS['_CONF']['site_url']) && !empty($GLOBALS['_CONF']['path_html'])) { $baseUrl = $GLOBALS['_CONF']['site_url']; $doclang = COM_getLanguageName(); $cfg = 'docs/' . $doclang . '/config.html'; if (file_exists($GLOBALS['_CONF']['path_html'] . $cfg)) { $url = $baseUrl . '/' . $cfg; } else { $url = $baseUrl . '/docs/english/config.html'; } } else { $url = 'http://www.geeklog.net/docs/english/config.html'; } $docUrl['Core'] = $url; } else { // plugin $docUrl[$group] = PLG_getDocumentationUrl($group, 'config'); } $descUrl = $docUrl[$group]; if (!empty($descUrl)) { if (strpos($descUrl, '#') === false) { $descUrl .= '#desc_' . $option; } $t->set_var('doc_url', $descUrl); // Does hack need to be used? if (gettype($configtext) == "NULL") { $t->set_var('doc_link', '(<a href="' . $descUrl . '" target="help" class="tooltip">?</a>)'); } else { $t->set_var('doc_link', '(<a href="' . $descUrl . '" target="help">?</a>)'); } } } else { $t->set_var('doc_url', ''); $retval = "(" . COM_getTooltip("?", $configtext, '', $option, 'information') . ")"; $t->set_var('doc_link', $retval); } }
/** * Helper function: Set the URL to the help section for a config option * * @param Template $t Template object * @param string $group 'Core' or plugin name * @param string $option name of the config option */ private function _set_ConfigHelp(&$t, $group, $option) { global $_SCRIPTS; static $docUrl; if (!isset($docUrl)) { $docUrl = array(); } $configText = PLG_getConfigTooltip($group, $option); if (empty($configText)) { if ($group === 'Core') { $configText = null; } if (empty($docUrl[$group])) { if ($group === 'Core') { if (!empty($GLOBALS['_CONF']['site_url']) && !empty($GLOBALS['_CONF']['path_html'])) { $baseUrl = $GLOBALS['_CONF']['site_url']; $docLang = COM_getLanguageName(); $cfg = 'docs/' . $docLang . '/config.html'; if (file_exists($GLOBALS['_CONF']['path_html'] . $cfg)) { $url = $baseUrl . '/' . $cfg; } else { $url = $baseUrl . '/docs/english/config.html'; } } else { $url = 'https://www.geeklog.net/docs/english/config.html'; } $docUrl['Core'] = $url; } else { // plugin $docUrl[$group] = PLG_getDocumentationUrl($group, 'config'); } $_SCRIPTS->setJavaScript('var glConfigDocUrl = "' . $docUrl[$group] . '";', true); } $descUrl = $docUrl[$group]; if (!empty($descUrl)) { if (strpos($descUrl, '#') === false) { $descUrl .= '#desc_' . $option; } $t->set_var('doc_url', $descUrl); if ($this->flag_version_2 == true) { // Does hack need to be used? if (gettype($configText) == "NULL") { $t->set_var('doc_link', '(<a href="javascript:void(0);" id="desc_' . $option . '" class="tooltip">?</a>)'); } else { $t->set_var('doc_link', '(<a href="javascript:void(0);" id="desc_' . $option . '">?</a>)'); } } else { // Does hack need to be used? if (gettype($configText) == "NULL") { $t->set_var('doc_link', '(<a href="' . $descUrl . '" target="help" class="tooltip">?</a>)'); } else { $t->set_var('doc_link', '(<a href="' . $descUrl . '" target="help">?</a>)'); } } } } else { $t->set_var('doc_url', ''); $retval = "(" . COM_getTooltip("?", $configText, '', $option, 'information') . ")"; $t->set_var('doc_link', $retval); } }
/** * Helper function: Get the URL to the help section for a config option * * @param string $group 'Core' or plugin name * @param string $option name of the config option * @return string full URL to help or empty string * */ function _get_ConfigHelp($group, $option) { static $coreUrl; $retval = ''; $descUrl = ''; if ($group == 'Core') { if (isset($coreUrl)) { $descUrl = $coreUrl; } elseif (!empty($GLOBALS['_CONF']['site_url']) && !empty($GLOBALS['_CONF']['path_html'])) { $baseUrl = $GLOBALS['_CONF']['site_url']; $doclang = COM_getLanguageName(); $cfg = 'docs/' . $doclang . '/config.html'; if (file_exists($GLOBALS['_CONF']['path_html'] . $cfg)) { $descUrl = $baseUrl . '/' . $cfg; } else { $descUrl = $baseUrl . '/docs/english/config.html'; } $coreUrl = $descUrl; } else { $descUrl = 'http://www.geeklog.net/docs/english/config.html'; } } else { $descUrl = PLG_getDocumentationUrl($group, 'config'); } if (!empty($descUrl)) { $retval = $descUrl . '#desc_' . $option; } return $retval; }
/** * Helper function: Get the URL to the help section for a config option * * @param string $group 'Core' or plugin name * @param string $option name of the config option * @return string full URL to help or empty string * */ function _get_ConfigHelp($group, $option) { static $docUrl; if (!isset($docUrl)) { $docUrl = array(); } $retval = ''; if (!isset($docUrl[$group])) { if ($group == 'Core') { if (!empty($GLOBALS['_CONF']['site_url']) && !empty($GLOBALS['_CONF']['path_html'])) { $baseUrl = $GLOBALS['_CONF']['site_url']; $doclang = COM_getLanguageName(); $cfg = 'docs/' . $doclang . '/config.html'; if (file_exists($GLOBALS['_CONF']['path_html'] . $cfg)) { $url = $baseUrl . '/' . $cfg; } else { $url = $baseUrl . '/docs/english/config.html'; } } else { $url = 'http://www.geeklog.net/docs/english/config.html'; } $docUrl['Core'] = $url; } else { // plugin $docUrl[$group] = PLG_getDocumentationUrl($group, 'config'); } } $retval = $docUrl[$group]; if (!empty($retval)) { if (strpos($retval, '#') === false) { $retval .= '#desc_' . $option; } } return $retval; }