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: 662 $:
9: * @author $Author: melot.philippe $:
10: * @date $Date: 2012-02-08 14:22:57 +0100 (mer., 08 févr. 2012) $:
11: */
12:
13: namespace ManiaLib\Gui\Maniacode\Elements;
14:
15: class InstallMapPack extends \ManiaLib\Gui\Maniacode\Component
16: {
17:
18: protected $xmlTagName = 'install_map_pack';
19: protected $maps = array();
20:
21: function __construct($name='')
22: {
23: $this->name = $name;
24: }
25:
26: function addMap($name = '', $url = '')
27: {
28: $this->maps[] = new \ManiaLib\Gui\Maniacode\Elements\PackageMap($name, $url);
29: }
30:
31: function getLastInsert()
32: {
33: return end($this->maps);
34: }
35:
36: protected function postFilter()
37: {
38: if(isset($this->maps) && is_array($this->maps) && count($this->maps))
39: {
40: foreach($this->maps as $map)
41: {
42: $map->save();
43: }
44: }
45: }
46:
47: }
48:
49: ?>