@@ 10-40 (lines=31) @@ | ||
7 | use Godbout\Alfred\Time\Menus\Menu; |
|
8 | use Godbout\Alfred\Workflow\ScriptFilter; |
|
9 | ||
10 | class SetupAccountId extends Menu |
|
11 | { |
|
12 | public static function scriptFilter() |
|
13 | { |
|
14 | ScriptFilter::add( |
|
15 | self::accountId(), |
|
16 | self::back() |
|
17 | ); |
|
18 | } |
|
19 | ||
20 | private static function accountId() |
|
21 | { |
|
22 | global $argv; |
|
23 | ||
24 | return Item::create() |
|
25 | ->title('Enter your Account ID above') |
|
26 | ->subtitle('Save ' . self::userInput()) |
|
27 | ->arg('harvest_setup_account_id_save') |
|
28 | ->variable('harvest_account_id', self::userInput()) |
|
29 | ->icon(Icon::create('resources/icons/harvest.png')); |
|
30 | } |
|
31 | ||
32 | private static function back() |
|
33 | { |
|
34 | return Item::create() |
|
35 | ->title('Back') |
|
36 | ->subtitle('Go back to Harvest credentials options') |
|
37 | ->arg('harvest_setup_credentials') |
|
38 | ->icon(Icon::create('resources/icons/harvest.png')); |
|
39 | } |
|
40 | } |
|
41 |
@@ 10-40 (lines=31) @@ | ||
7 | use Godbout\Alfred\Time\Menus\Menu; |
|
8 | use Godbout\Alfred\Workflow\ScriptFilter; |
|
9 | ||
10 | class SetupApitoken extends Menu |
|
11 | { |
|
12 | public static function scriptFilter() |
|
13 | { |
|
14 | ScriptFilter::add( |
|
15 | self::apitoken(), |
|
16 | self::back() |
|
17 | ); |
|
18 | } |
|
19 | ||
20 | private static function apitoken() |
|
21 | { |
|
22 | global $argv; |
|
23 | ||
24 | return Item::create() |
|
25 | ->title('Enter your API token above') |
|
26 | ->subtitle('Save ' . self::userInput()) |
|
27 | ->arg('harvest_setup_apitoken_save') |
|
28 | ->variable('harvest_apitoken', self::userInput()) |
|
29 | ->icon(Icon::create('resources/icons/harvest.png')); |
|
30 | } |
|
31 | ||
32 | private static function back() |
|
33 | { |
|
34 | return Item::create() |
|
35 | ->title('Back') |
|
36 | ->subtitle('Go back to Harvest credentials options') |
|
37 | ->arg('harvest_setup_credentials') |
|
38 | ->icon(Icon::create('resources/icons/harvest.png')); |
|
39 | } |
|
40 | } |
|
41 |
@@ 9-38 (lines=30) @@ | ||
6 | use Godbout\Alfred\Workflow\Item; |
|
7 | use Godbout\Alfred\Workflow\ScriptFilter; |
|
8 | ||
9 | class Setup extends Menu |
|
10 | { |
|
11 | public static function scriptFilter() |
|
12 | { |
|
13 | ScriptFilter::add( |
|
14 | self::toggl(), |
|
15 | self::harvest() |
|
16 | ); |
|
17 | ||
18 | ScriptFilter::sortItems(); |
|
19 | } |
|
20 | ||
21 | private static function toggl() |
|
22 | { |
|
23 | return Item::create() |
|
24 | ->title('Setup Toggl') |
|
25 | ->subtitle('') |
|
26 | ->icon(Icon::create('resources/icons/toggl.png')) |
|
27 | ->arg('toggl_setup'); |
|
28 | } |
|
29 | ||
30 | private static function harvest() |
|
31 | { |
|
32 | return Item::create() |
|
33 | ->title('Setup Harvest') |
|
34 | ->subtitle('') |
|
35 | ->icon(Icon::create('resources/icons/harvest.png')) |
|
36 | ->arg('harvest_setup'); |
|
37 | } |
|
38 | } |
|
39 |
@@ 10-40 (lines=31) @@ | ||
7 | use Godbout\Alfred\Time\Menus\Menu; |
|
8 | use Godbout\Alfred\Workflow\ScriptFilter; |
|
9 | ||
10 | class SetupApikey extends Menu |
|
11 | { |
|
12 | public static function scriptFilter() |
|
13 | { |
|
14 | ScriptFilter::add( |
|
15 | self::apikey(), |
|
16 | self::back() |
|
17 | ); |
|
18 | } |
|
19 | ||
20 | private static function apikey() |
|
21 | { |
|
22 | global $argv; |
|
23 | ||
24 | return Item::create() |
|
25 | ->title('Enter your API token above') |
|
26 | ->subtitle('Save ' . self::userInput()) |
|
27 | ->arg('toggl_setup_apikey_save') |
|
28 | ->variable('toggl_apikey', self::userInput()) |
|
29 | ->icon(Icon::create('resources/icons/toggl.png')); |
|
30 | } |
|
31 | ||
32 | private static function back() |
|
33 | { |
|
34 | return Item::create() |
|
35 | ->title('Back') |
|
36 | ->subtitle('Go back to Toggl options') |
|
37 | ->arg('toggl_setup') |
|
38 | ->icon(Icon::create('resources/icons/toggl.png')); |
|
39 | } |
|
40 | } |
|
41 |