-
Notifications
You must be signed in to change notification settings - Fork 4
/
e_menu.php
83 lines (67 loc) · 1.41 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
<?php
/*
* AnteUp - A Donation Tracking Plugin for e107
*
* Copyright (C) 2012-2017 Patrick Weaver (http://trickmod.com/)
* For additional information refer to the README.mkd file.
*
*/
if (!defined('e107_INIT')) { exit; }
class anteup_menu
{
function __construct()
{
// e107::lan('banner','admin', 'true');
}
/**
* Configuration Fields.
* @return array
*/
public function config($menu='')
{
$fields = array();
//print_a($menu);
$layouts = e107::getLayouts('anteup','anteup_menu');
$fields['caption'] = array(
'title' => LAN_CAPTION,
'type' => 'text',
'multilan' => true,
'writeParms' => array('size' => 'xxlarge')
);
$fields['campaign'] = array(
'title' => "Campaign", // TODO LAN
'type' => 'method',
'data' => 'array',
);
$fields['layout'] = array(
'title'=> LAN_TEMPLATE,
'type'=>'dropdown',
'writeParms' => array('optArray' => $layouts[0]),
);
return $fields;
}
}
class anteup_menu_form extends e_form
{
public function campaign($curVal)
{
$sql = e107::getDb();
$frm = e107::getForm();
$text = '';
if(empty($curVal))
{
$curVal = 0;
}
$campaigns = array();
// Get existing campaigns from database
if($sql->select('anteup_campaign'))
{
while($row = $sql->fetch())
{
$campaigns[$row['id']] = $row['name'];
}
}
$text = $frm->select('campaign', $campaigns, $curVal);
return $text;
}
}