]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/htmloutputter.php
Fix help text for getvaliddaemons.php
[quix0rs-gnu-social.git] / lib / htmloutputter.php
index f9245414f29348a90628363a21e7aeee879e6d38..06603ac05485660b206726ad217a769756f9713b 100644 (file)
@@ -101,29 +101,32 @@ class HTMLOutputter extends XMLOutputter
             $type = common_negotiate_type($cp, $sp);
 
             if (!$type) {
-                common_user_error(_('This page is not available in a '.
-                                    'media type you accept'), 406);
-                exit(0);
+                throw new ClientException(_('This page is not available in a '.
+                                            'media type you accept'), 406);
             }
         }
 
         header('Content-Type: '.$type);
-        
+
         $this->extraHeaders();
 
         $this->startXML('html',
                         '-//W3C//DTD XHTML 1.0 Strict//EN',
                         'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
 
-        // FIXME: correct language for interface
-
-        $language = common_language();
+        $language = $this->getLanguage();
 
         $this->elementStart('html', array('xmlns' => 'http://www.w3.org/1999/xhtml',
                                           'xml:lang' => $language,
                                           'lang' => $language));
     }
 
+    function getLanguage()
+    {
+        // FIXME: correct language for interface
+        return common_language();
+    }
+
     /**
     *  Ends an HTML document
     *
@@ -134,7 +137,7 @@ class HTMLOutputter extends XMLOutputter
         $this->elementEnd('html');
         $this->endXML();
     }
-    
+
     /**
     *  To specify additional HTTP headers for the action
     *
@@ -172,7 +175,7 @@ class HTMLOutputter extends XMLOutputter
                        'type' => 'text',
                        'id' => $id);
         if ($value) {
-            $attrs['value'] = htmlspecialchars($value);
+            $attrs['value'] = $value;
         }
         $this->element('input', $attrs);
         if ($instructions) {
@@ -206,7 +209,7 @@ class HTMLOutputter extends XMLOutputter
                        'class' => 'checkbox',
                        'id' => $id);
         if ($value) {
-            $attrs['value'] = htmlspecialchars($value);
+            $attrs['value'] = $value;
         }
         if ($checked) {
             $attrs['checked'] = 'checked';
@@ -255,7 +258,7 @@ class HTMLOutputter extends XMLOutputter
         foreach ($content as $value => $option) {
             if ($value == $selected) {
                 $this->element('option', array('value' => $value,
-                                               'selected' => $value),
+                                               'selected' => 'selected'),
                                $option);
             } else {
                 $this->element('option', array('value' => $value), $option);