| 49 |
global $page_; |
global $page_; |
| 50 |
$this->updateFiles(); |
$this->updateFiles(); |
| 51 |
$xml = $this->toXML(); |
$xml = $this->toXML(); |
| 52 |
if($page_ == "addpage"){ |
if( ($page_ == "addpage") && ($task="save") ) { |
| 53 |
if (strtolower($this->charset) != 'utf-8') { |
if (strtolower($this->charset) != 'utf-8') { |
| 54 |
if (function_exists('iconv')) { |
if (function_exists('iconv')) { |
| 55 |
$xml = iconv("utf-8", $this->charset, $xml); |
$xml = iconv("utf-8", $this->charset, $xml); |
| 176 |
} |
} |
| 177 |
} |
} |
| 178 |
$this->codesets = array_unique($this->codesets); |
$this->codesets = array_unique($this->codesets); |
| 179 |
$this->attrEncoding($encoding); |
$attrs = get_object_vars($this); |
| 180 |
|
$this->arrayEncoding($attrs,$encoding); |
| 181 |
|
$this->bindAttributes($attrs); |
| 182 |
return true; |
return true; |
| 183 |
} |
} |
| 184 |
return false; |
return false; |
| 185 |
} |
} |
| 186 |
function attrEncoding($encoding) |
function bindAttributes($attrs) |
| 187 |
{ |
{ |
| 188 |
$attrs = get_object_vars($this); |
if(!is_array($attrs)) |
| 189 |
foreach($attrs as $key=>$var) |
return false; |
| 190 |
|
foreach($attrs as $key=>$v) |
| 191 |
{ |
{ |
| 192 |
if(is_array($var)) |
$this->$key = $v; |
| 193 |
|
} |
| 194 |
|
} |
| 195 |
|
function arrayEncoding(&$attrs,$encoding) |
| 196 |
{ |
{ |
| 197 |
$arrs = &$this->$key; |
if(is_array($attrs)) |
|
foreach($arrs as $k=>$v) |
|
| 198 |
{ |
{ |
| 199 |
$arrs[$k] = iconv("utf-8",$encoding,$v); |
foreach($attrs as $key=>$val) |
| 200 |
} |
{ |
| 201 |
|
if(is_array($val)) |
| 202 |
|
{ |
| 203 |
|
$this->arrayEncoding($attrs[$key],$encoding); |
| 204 |
}else |
}else |
| 205 |
$this->$key = iconv("utf-8",$encoding,$var); |
$attrs[$key] = iconv("utf-8",$encoding,$val); |
| 206 |
|
} |
| 207 |
} |
} |
| 208 |
} |
} |
| 209 |
|
|