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: class InstallMacroblock extends FileDownload
16: {
17:
18: protected $xmlTagName = 'install_macroblock';
19: protected $file;
20:
21: function __construct($name='', $file='', $url='')
22: {
23: parent::__construct($name, $url);
24: $this->setFile($file);
25: }
26:
27: /**
28: * This method sets the path to install the skin
29: *
30: * @param string $file The path to the skin
31: * @return void
32: *
33: */
34: public function setFile($file)
35: {
36: $this->file = $file;
37: }
38:
39: /**
40: * This method gets the path to install the skin
41: *
42: * @return string The path to the skin
43: *
44: */
45: public function getFile()
46: {
47: return $this->file;
48: }
49:
50: protected function postFilter()
51: {
52: parent::postFilter();
53: if(isset($this->file))
54: {
55: $elem = \ManiaLib\Gui\Maniacode\Maniacode::$domDocument->createElement('file');
56: $value = \ManiaLib\Gui\Maniacode\Maniacode::$domDocument->createTextNode($this->file);
57: $elem->appendChild($value);
58: $this->xml->appendChild($elem);
59: }
60: }
61:
62: }
63:
64: ?>