1: <?php
2: /**
3: * ManiaLib - Lightweight PHP framework for Manialinks
4: *
5: * @see http://code.google.com/p/manialib/
6: * @copyright Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
7: * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
8: * @version $Revision: 652 $:
9: * @author $Author: melot.philippe $:
10: * @date $Date: 2012-01-27 16:51:57 +0100 (ven., 27 janv. 2012) $:
11: */
12:
13: namespace ManiaLib\Gui\Maniacode\Elements;
14:
15: abstract class FileDownload extends \ManiaLib\Gui\Maniacode\Component
16: {
17:
18: protected $url;
19:
20: function __construct($name = '', $url = '')
21: {
22: $this->name = $name;
23: $this->url = $url;
24: }
25:
26: /**
27: * This method sets the url to download the file
28: *
29: * @param string $url The url to download the file
30: * @return void
31: *
32: */
33: function setUrl($url)
34: {
35: $this->url = $url;
36: }
37:
38: /**
39: * This method gets the Url of the element
40: *
41: * @return void
42: *
43: */
44: function getUrl()
45: {
46: return $this->url;
47: }
48:
49: protected function postFilter()
50: {
51: if(isset($this->url))
52: {
53: $elem = \ManiaLib\Gui\Maniacode\Maniacode::$domDocument->createElement('url');
54: $value = \ManiaLib\Gui\Maniacode\Maniacode::$domDocument->createTextNode($this->url);
55: $elem->appendChild($value);
56: $this->xml->appendChild($elem);
57: }
58: }
59:
60: }
61:
62: ?>