-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.php
53 lines (39 loc) · 1.21 KB
/
controller.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
<?php
namespace Concrete\Package\AttributeGmapAddress;
use Concrete\Core\Backup\ContentImporter;
use Package;
use Concrete\Core\View\View;
class Controller extends Package
{
protected $pkgHandle = 'attribute_gmap_address';
protected $appVersionRequired = '5.7.5';
protected $pkgVersion = '0.9.1';
public function getPackageName()
{
return t('Google Maps Attribute');
}
public function getPackageDescription()
{
return t('Installs an attribute that uses google maps to geocode an address.');
}
public function on_start(){
$view = View::getInstance();
//$view->addFooterItem('<script src="https://maps.googleapis.com/maps/api/js?key=' . \Config::get('app.api_keys.google.maps') . '&libraries=places"></script>');
}
protected function installXmlContent()
{
$pkg = Package::getByHandle($this->pkgHandle);
$ci = new ContentImporter();
$ci->importContentFile($pkg->getPackagePath() . '/install.xml');
}
public function install()
{
parent::install();
$this->installXmlContent();
}
public function upgrade()
{
parent::upgrade();
$this->installXmlContent();
}
}