//$IC->getRelatedItems($related_topic_pattern); ?> <div class="scene stop i:scene"> <? if($item): ?> <div class="i:topic topic id:<?php echo $item["item_id"]; ?> " itemscope itemtype="http://schema.org/Article"> <ul class="tags"> <? if($item["tags"]): ?> <? if(arrayKeyValue($item["tags"], "context", "editing")): ?> <li class="editing" title="Denne artikel redigeres stadig"><?php echo $item["tags"][arrayKeyValue($item["tags"], "context", "editing")]["value"]; ?> </li> <? endif; ?> <? endif; ?> </ul> <h1 itemprop="name"><?php echo $item["name"]; ?> </h1> <div class="articlebody" itemprop="articleBody"> <div class="problem"> <h2 class="problem"><?php
function articleTags($item, $_options = false) { $context = false; $default = false; $url = false; $editing = true; $schema = "articleSection"; if ($_options !== false) { foreach ($_options as $_option => $_value) { switch ($_option) { case "context": $context = $_value; break; case "default": $default = $_value; break; case "url": $url = $_value; break; case "editing": $editing = $_value; break; case "schema": $schema = $_value; break; } } } $_ = ''; // editing tag if ($item["tags"] && $editing) { $editing_tag = arrayKeyValue($item["tags"], "context", "editing"); if ($editing_tag !== false) { $_ .= ' <li class="editing" title="Denne artikel redigeres stadig">' . ($item["tags"][$editing_tag]["value"] == "true" ? "Redigeres" : $item["tags"][$editing_tag]["value"]) . '</li>'; } } // default tag if (is_array($default)) { $_ .= ' <li><a href="' . $default[0] . '">' . $default[1] . '</a></li>'; } // item tag list if ($item["tags"] && $context) { foreach ($item["tags"] as $item_tag) { if (array_search($item_tag["context"], $context) !== false) { $_ .= ' <li' . ($schema ? ' itemprop="' . $schema . '"' : '') . '>'; if ($url) { $_ .= '<a href="' . $url . "/" . urlencode($item_tag["value"]) . '">'; } $_ .= $item_tag["value"]; if ($url) { $_ .= '</a>'; } $_ .= '</li>'; } } } // only print tags ul if it has content if ($_) { $_ = '<ul class="tags">' . $_ . '</ul>'; } return $_; }