1: <?php
 2: /**
 3:  * This file contains the nav main collection and item class.
 4:  *
 5:  * @package          Core
 6:  * @subpackage       GenericDB_Model
 7:  * @version          SVN Revision $Rev:$
 8:  *
 9:  * @author           Frederic Schneider
10:  * @copyright        four for business AG <www.4fb.de>
11:  * @license          http://www.contenido.org/license/LIZENZ.txt
12:  * @link             http://www.4fb.de
13:  * @link             http://www.contenido.org
14:  */
15: 
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17: 
18: /**
19:  * File collection
20:  *
21:  * @package Core
22:  * @subpackage GenericDB_Model
23:  */
24: class cApiNavMainCollection extends ItemCollection {
25: 
26:     /**
27:      * Constructor
28:      */
29:     public function __construct() {
30:         global $cfg;
31:         parent::__construct($cfg['tab']['nav_main'], 'idnavm');
32:         $this->_setItemClass('cApiNavMain');
33:     }
34: 
35:     public function create($location) {
36:         $item = parent::createNewItem();
37: 
38:         $location = cSecurity::escapeString($location);
39:         $item->set('location', $location);
40: 
41:         $item->store();
42: 
43:         return ($item);
44:     }
45: 
46: }
47: 
48: /**
49:  * NavMain item
50:  *
51:  * @package Core
52:  * @subpackage GenericDB_Model
53:  */
54: class cApiNavMain extends Item {
55: 
56:     /**
57:      * Constructor Function
58:      *
59:      * @param mixed $mId Specifies the ID of item to load
60:      */
61:     public function __construct($mId = false) {
62:         global $cfg;
63:         parent::__construct($cfg['tab']['nav_main'], 'idnavm');
64:         $this->setFilters(array(
65:             'addslashes'
66:         ), array(
67:             'stripslashes'
68:         ));
69:         if ($mId !== false) {
70:             $this->loadByPrimaryKey($mId);
71:         }
72:     }
73: 
74: }
75: