Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added &tag parameter to be able to specify the tag manually.

  • Loading branch information...
commit 6ac11ff1b046ce65e878f58f04e8023950931a2a 1 parent 6c9db59
mikrobi authored
View
12 core/components/taglister/elements/snippets/getresourcestag.snippet.php
@@ -33,17 +33,17 @@
$tagKey = (!empty($tagKeyVar) && !empty($_GET[$tagKeyVar]))? $_GET[$tagKeyVar] : $modx->getOption('tagKey',$scriptProperties,'tags');
$tagRequestParam = $modx->getOption('tagRequestParam',$scriptProperties,'tag');
$grSnippet = $modx->getOption('grSnippet',$scriptProperties,'getPage');
-
-if (!empty($_GET[$tagRequestParam])) {
+$tag = $modx->getOption('tag',$scriptProperties,urldecode($_GET[$tagRequestParam]));
+if (!empty($tag)) {
$tagSearchType = $modx->getOption('tagSearchType',$scriptProperties,'exact');
if ($tagSearchType == 'contains') {
- $scriptProperties['tvFilters'] = $tagKey.'==%'.$modx->stripTags(urldecode($_GET[$tagRequestParam])).'%';
+ $scriptProperties['tvFilters'] = $tagKey.'==%'.$modx->stripTags($tag).'%';
} else if ($tagSearchType == 'beginswith') {
- $scriptProperties['tvFilters'] = $tagKey.'==%'.$modx->stripTags(urldecode($_GET[$tagRequestParam])).'';
+ $scriptProperties['tvFilters'] = $tagKey.'==%'.$modx->stripTags($tag).'';
} else if ($tagSearchType == 'endswith') {
- $scriptProperties['tvFilters'] = $tagKey.'=='.$modx->stripTags(urldecode($_GET[$tagRequestParam])).'%';
+ $scriptProperties['tvFilters'] = $tagKey.'=='.$modx->stripTags($tag).'%';
} else {
- $scriptProperties['tvFilters'] = $tagKey.'=='.$modx->stripTags(urldecode($_GET[$tagRequestParam])).'';
+ $scriptProperties['tvFilters'] = $tagKey.'=='.$modx->stripTags($tag).'';
}
}
$elementObj = $modx->getObject('modSnippet', array('name' => $grSnippet));
Please sign in to comment.
Something went wrong with that request. Please try again.