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