mirror of
https://github.com/friendica/friendica
synced 2025-04-23 18:30:11 +00:00
OStatus class is now moved into the right place
This commit is contained in:
parent
b93e1d73a1
commit
2c5b5c1cd4
4 changed files with 1688 additions and 1623 deletions
|
@ -92,5 +92,40 @@ class xml {
|
|||
self::copy($childentry, $child, $childfield);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Create an XML element
|
||||
*
|
||||
* @param object $doc XML root
|
||||
* @param string $element XML element name
|
||||
* @param string $value XML value
|
||||
* @param array $attributes array containing the attributes
|
||||
*
|
||||
* @return object XML element object
|
||||
*/
|
||||
public static function create_element($doc, $element, $value = "", $attributes = array()) {
|
||||
$element = $doc->createElement($element, xmlify($value));
|
||||
|
||||
foreach ($attributes AS $key => $value) {
|
||||
$attribute = $doc->createAttribute($key);
|
||||
$attribute->value = xmlify($value);
|
||||
$element->appendChild($attribute);
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Create an XML and append it to the parent object
|
||||
*
|
||||
* @param object $doc XML root
|
||||
* @param object $parent parent object
|
||||
* @param string $element XML element name
|
||||
* @param string $value XML value
|
||||
* @param array $attributes array containing the attributes
|
||||
*/
|
||||
public static function add_element($doc, $parent, $element, $value = "", $attributes = array()) {
|
||||
$element = self::create_element($doc, $element, $value, $attributes);
|
||||
$parent->appendChild($element);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue