Skip to content

Commit

Permalink
Add preferences UI (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
fhamon authored and nitriques committed Dec 10, 2018
1 parent 3214c77 commit 1a7f3de
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion extension.driver.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
<?php

Class extension_addresslocationfield extends Extension{
Class extension_addresslocationfield extends Extension {

public function getSubscribedDelegates()
{
return array(
array(
'page' => '/system/preferences/',
'delegate' => 'AddCustomPreferenceFieldsets',
'callback' => 'addCustomPreferenceFieldsets'
)
);
}

public function addCustomPreferenceFieldsets($context) {
$currentSettings = Symphony::Configuration()->get('addresslocationfield');
$settingsCtn = new XMLElement('fieldset');
$settingsCtn->addClass('settings');
$legend = new XMLElement('legend', 'Address Location Field');
$settingsCtn->appendChild($legend);
$label = new XMLElement('label', 'API Key');
$label->appendChild(Widget::Input('settings[addresslocationfield][api_key]', $currentSettings['api_key'], 'text'));
$settingsCtn->appendChild($label);
$context['wrapper']->appendChild($settingsCtn);
}

public function uninstall()
{
Expand Down

0 comments on commit 1a7f3de

Please sign in to comment.