Exemplo n.º 1
0
 public static function formatValue($label, $value, $query = '')
 {
     global $wgUser;
     if (!$value) {
         return ' ';
     } else {
         if (strpos($label, 'place') !== false) {
             return StructuredData::getPlaceLink($value);
         } else {
             if (strpos($label, 'Title') !== false) {
                 if (GedcomUtil::isGedcomTitle($value)) {
                     $title = htmlspecialchars($value);
                 } else {
                     $skin =& $wgUser->getSkin();
                     $t = Title::newFromText($value, StructuredData::endsWith($label, 'familyTitle', true) ? NS_FAMILY : NS_PERSON);
                     $title = $skin->makeLinkObj($t, htmlspecialchars($value), $query);
                 }
                 return StructuredData::endsWith($label, 'FamilyTitle') ? $title : "<b>{$title}</b>";
             } else {
                 return htmlspecialchars($value);
             }
         }
     }
 }
Exemplo n.º 2
0
 private function printElement(&$elm)
 {
     $output = '';
     foreach ($elm as $label => $value) {
         if ($value && strpos($label, 'std') !== 0 && !in_array($label, self::$UNPRINTED_ATTRS)) {
             if ($label == 'place') {
                 $value = StructuredData::getPlaceLink($value);
             } else {
                 $value = htmlspecialchars($value);
             }
             $label = wfMsg($label);
             $output .= "<i>{$label}</i>: {$value}<br>";
         }
     }
     return $output;
 }