Skip to content
Permalink
Browse files

Merge pull request #557 from bramley/Mantis_19974

Mantis 19974 - Linking from Manage Plugins page to Settings page
  • Loading branch information...
samtuke committed Jun 10, 2019
2 parents 1ee0e60 + 141d860 commit 16d41ccea13fe416e6ca1271bb98d0ac33dfdd6c
Showing with 17 additions and 2 deletions.
  1. +1 −1 public_html/lists/admin/configure.php
  2. +15 −0 public_html/lists/admin/lib.php
  3. +1 −1 public_html/lists/admin/plugins.php
@@ -131,7 +131,7 @@
foreach ($configCategories as $configCategory => $configItems) {
$some = 0;
$categoryHTML = '<fieldset id="' . $configCategory . '">';
$categoryHTML = '<fieldset id="' . sanitiseId($configCategory) . '">';
$categoryHTML .= '<legend>' . s('%s settings',$configCategory) . '</legend>';
foreach ($configItems as $configItem) {
@@ -2310,3 +2310,18 @@ function asyncLoadContentDiv($url,$divname)
asyncLoadUrl[asyncLoadUrl.length] = "'.$url.'";
</script>';
}
/**
* Transform a value to be valid for an html id by removing invalid characters.
* This is for HTML 4. HTML 5 is more lenient.
*
* @see https://www.w3.org/TR/html4/types.html#type-id
*
* @param string $value
*
* @return string
*/
function sanitiseId($value)
{
return preg_replace('/[^0-9A-Za-z\-_:.]/', '', $value);
}
@@ -294,7 +294,7 @@
if ($plugin->enabled && !empty($plugin->settings)) {
$firstSetting = reset($plugin->settings);
$category = $firstSetting['category'];
$settingsUrl = PageURL2('configure').'#'.strtolower($category);
$settingsUrl = PageURL2('configure').'#'.sanitiseId(strtolower($category));
$detailEntry .= '<span class="label">'.s('Configure').'</span>';
$detailEntry .= '<span class="value"><a href="'.$settingsUrl.'">'.s($category).' '.s('settings').'</a></span>';
}

0 comments on commit 16d41cc

Please sign in to comment.
You can’t perform that action at this time.