Lines Matching full:tag
37 // Get the tag and page ID from the AJAX request
38 $tag = $INPUT->str('tag');
41 if($tag && $id) {
44 // Check if {{tag>}} already exists
45 if (preg_match('/\{\{tag>(.*?)\}\}/', $pageContent, $matches)) {
48 // If tag already exists and the configuration is set to hide the button, return
49 if (in_array($tag, $existingTags) && $this->getConf('hide_if_exists')) {
54 // Add the tag if it doesn't already exist
55 if (!in_array($tag, $existingTags)) {
56 $existingTags[] = $tag;
57 $newTagBlock = '{{tag>' . implode(' ', $existingTags) . '}}';
61 // If no {{tag>}} block exists, add one
62 $newTagBlock = '{{tag>' . $tag . '}}';
67 saveWikiText($id, $pageContent, 'Added tag: ' . $tag);