-
Notifications
You must be signed in to change notification settings - Fork 0
/
descriptions.class.php
42 lines (34 loc) · 1.24 KB
/
descriptions.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* @author David Raison
* @ingroup plurio
*/
class Descriptions {
private $_entity; // reference to passed in entity
private $_sdescs;
private $_ldescs;
public function __construct( &$entity ){
$this->_entity = $entity;
}
/**
* Short descriptions are fetched from the wiki Has_subtitle property
*/
public function setShortDescription( $lang, $desc ){
$desc = str_replace('&', '&', $desc);
if(!isset( $this->_sdescs ))
$this->_sdescs = $this->_entity->addChild('shortDescriptions');
$tdesc = $this->_sdescs->addChild('shortDescription', $desc);
$tdesc->addAttribute('language', $lang );
}
/**
* Long descriptions are fetched from the wiki Has_description property
*/
public function setLongDescription( $lang, $desc ) {
$desc = str_replace('&', '&', $desc);
if(!isset( $this->_ldescs ))
$this->_ldescs = $this->_entity->addChild('longDescriptions');
$lde = $this->_ldescs->addChild('longDescription', $desc );
$lde->addAttribute('language', $lang );
return $lde; // maybe we want to add something later ;)
}
}