/
AmCommandPlusPlugin.php
62 lines (57 loc) · 1.89 KB
/
AmCommandPlusPlugin.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
<?php
/**
* Additional commands for a&m command that shouldn't be in the core.
*
* @package Am Command Plus
* @author Hubert Prein
*/
namespace Craft;
class AmCommandPlusPlugin extends BasePlugin
{
public function getName()
{
return 'a&m command plus';
}
public function getVersion()
{
return '1.1.0';
}
public function getDeveloper()
{
return 'a&m impact';
}
public function getDeveloperUrl()
{
return 'http://www.am-impact.nl';
}
/**
* Add commands to a&m command through this hook function.
*
* @return array
*/
public function addCommands() {
if (craft()->userSession->isAdmin()) {
$commands = array(
array(
'name' => Craft::t('Globals') . ': ' . Craft::t('Create field in "{globalSetName}"', array('globalSetName' => Craft::t('Number of views'))),
'info' => Craft::t('Quickly create a field in the global set and add it to the field layout.'),
'call' => 'createFieldAction',
'service' => 'amCommandPlus_globals',
'vars' => array(
'globalSetName' => Craft::t('Number of views')
)
),
array(
'name' => Craft::t('Globals') . ': ' . Craft::t('Create field in "{globalSetName}"', array('globalSetName' => Craft::t('Entry IDs'))),
'info' => Craft::t('Quickly create a field in the global set and add it to the field layout.'),
'call' => 'createFieldAction',
'service' => 'amCommandPlus_globals',
'vars' => array(
'globalSetName' => Craft::t('Entry IDs')
)
)
);
return $commands;
}
}
}