-
Notifications
You must be signed in to change notification settings - Fork 0
/
e_menu.php
92 lines (58 loc) · 1.66 KB
/
e_menu.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2016 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*
*/
if (!defined('e107_INIT')) { exit; }
//v2.x Standard for extending menu configuration within Menu Manager. (replacement for v1.x config.php)
class files_menu
{
function __construct()
{
}
/**
* Configuration Fields.
* @return array
*/
public function config($menu='')
{
$fields = array();
switch($menu)
{
case "files":
$fields['caption'] = array('title'=> LAN_CAPTION, 'type'=>'text', 'multilan'=>true, 'writeParms'=>array('size'=>'xxlarge'));
$fields['limit'] = array('title'=> LAN_LIMIT, 'type'=>'text', 'writeParms'=>array('pattern'=>'[0-9]*', 'size'=>'mini'));
$fields['category'] = array('title'=> LAN_CATEGORY, 'type'=>'dropdown', 'writeParms'=>array('optArray'=>$this->getCategories()));
break;
case "files_category":
$fields['caption'] = array('title'=> LAN_CAPTION, 'type'=>'text', 'multilan'=>true, 'writeParms'=>array('size'=>'xxlarge'));
// $fields['limit'] = array('title'=> LAN_LIMIT, 'type'=>'text', 'writeParms'=>array('pattern'=>'[0-9]*', 'size'=>'mini'));
break;
}
return $fields;
}
private function getCategories()
{
$data = e107::getDb()->retrieve('core_media_cat','*',"media_cat_owner='files'",true);
$cats = array();
foreach($data as $row)
{
$id = $row['media_cat_category'];
$cats[$id] = $row['media_cat_title'];
}
return $cats;
}
}
/*
// optional
class files_form extends e_form
{
public function xxx($curVal)
{
}
}*/