Update of /cvsroot/phpweather/phpweather/output
In directory usw-pr-cvs1:/tmp/cvs-serv26783
Modified Files:
pw_text.php
Log Message:
The global $charset variable is now updated wheneven a pw_text object
is created. The demo-pages will have to be redone, so that the output
object can be created before header.php is included.
I don't know if this is overkill - I cannot see any difference in my
browser when I look at the Hungarian translation using ISO-8859-1 and
ISO-8859-2. Perhaps we could just send a header that tells people that
all pages are written in Unicode? I think Unicode covers both
encodings.
Index: pw_text.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/output/pw_text.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- pw_text.php 24 Mar 2002 17:25:48 -0000 1.4
+++ pw_text.php 26 Mar 2002 23:10:49 -0000 1.5
@@ -38,11 +38,24 @@
/**
* Constructor.
*
+ * This class shouldn't be instanced directly, instead you should
+ * use one of it's subclasses such as pw_text_en, pw_text_da, or
+ * another language.
+ *
+ * The constructor in the subclass will finish off by calling this
+ * constructor. At that time, there should be a 'charset' entry in
+ * the $strings array. This entry will be placed in the global
+ * namespace so that things outside of PHP Weather can send the
+ * right header to the browser.
+ *
* @param phpweather The object with the weather.
* @access public
*/
function pw_text($w, $input) {
+ /* The charset should be part of the $strings array. We set it
+ * globally so that the outside world can react on it. */
+ $GLOBALS['charset'] = $this->strings['charset'];
$this->weather = $w;
/* We call the parent constructor. */
|