-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe_admin.php
More file actions
89 lines (56 loc) · 1.61 KB
/
e_admin.php
File metadata and controls
89 lines (56 loc) · 1.61 KB
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
<?php
//v2.x Standard for extending admin areas.
class _mib_admin
{
/**
* Extend Admin-ui Parameters
* @param $ui admin-ui object
* @return array
*/
public function config($ui)
{
$action = $ui->getAction(); // current mode: create, edit, list
$type = $ui->getEventName(); // 'wmessage', 'news' etc. (core or plugin)
$id = $ui->getId();
$config = array();
$defaultValue = 'http://';
switch($type)
{
case "news": // hook into the news admin form.
$config['fields']['url'] = array ( 'title' =>"Custom Field", 'type' => 'url', 'tab'=>1, 'writeParms'=> array('size'=>'xxlarge', 'placeholder'=>'', 'default'=>$defaultValue), 'width' => 'auto', 'help' => '', 'readParms' => '', 'class' => 'left', 'thclass' => 'left', );
$config['batchOptions'] = array('custom' => 'Custom Batch Command');
break;
}
//Note: 'urls' will be returned as $_POST['x_MIB_url']. ie. x_{PLUGIN_FOLDER}_{YOURFIELDKEY}
return $config;
}
/**
* Process Posted Data.
* @param object $ui admin-ui
* @param int|array $id - Primary ID of the record being created/edited/deleted or array data of a batch process.
*/
public function process($ui, $id=0)
{
$data = $ui->getPosted();
$type = $ui->getEventName();
$action = $ui->getAction(); // current mode: create, edit, list, batch
if($action == 'delete')
{
return;
}
if($action == 'batch')
{
$arrayOfRecordIds = $id['ids'];
$command = $id['cmd'];
return;
}
if(!empty($id) )
{
if(!empty($data['x_MIB_url']))
{
// Save the data in 'blank' plugin table. .
}
}
}
}
?>