This repository has been archived by the owner on Aug 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMediaflowPlugin.php
65 lines (52 loc) · 1.61 KB
/
MediaflowPlugin.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
<?php
namespace Craft;
$autoloaderPath = __DIR__ . '/vendor/autoload.php';
file_exists($autoloaderPath) && require $autoloaderPath;
class MediaflowPlugin extends BasePlugin {
public function getName()
{
return Craft::t('Mediaflow');
}
public function getVersion()
{
return '0.1.2';
}
public function getDeveloper()
{
return 'KeyTeq Labs';
}
public function getDeveloperUrl()
{
return 'http://keyteq.no';
}
protected function defineSettings()
{
return array(
'url' => array(AttributeType::String, 'required' => true, 'label' => 'URL', 'default' => Craft::t('Mediaflow URL')),
'username' => array(AttributeType::String, 'required' => true, 'label' => 'Username', 'default' => Craft::t('Username')),
'apiKey' => array(AttributeType::String, 'required' => true, 'label' => 'API Key', 'default' => Craft::t('API key'))
);
}
public function getSettingsHtml()
{
return craft()->templates->render('mediaflow/settings', array(
'settings' => $this->getSettings()
));
}
public function prepSettings($settings)
{
return $settings;
}
public function hasCpSection()
{
return true;
}
public function registerCpRoutes()
{
return array(
'mediaflow/check' => array('action' => 'mediaflow/settings/testConnection'),
'mediaflow/media' => array('action' => 'mediaflow/settings/listMedia'),
'mediaflow/upload' => array('action' => 'mediaflow/settings/upload'),
);
}
}