-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from itmundi/global-settings-additions
Global settings additions
- Loading branch information
Showing
9 changed files
with
224 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
migrations/m151009_122433_amforms_addGlobalTemplateSettings.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
namespace Craft; | ||
|
||
/** | ||
* The class name is the UTC timestamp in the format of mYYMMDD_HHMMSS_pluginHandle_migrationName | ||
*/ | ||
class m151009_122433_amforms_addGlobalTemplateSettings extends BaseMigration | ||
{ | ||
/** | ||
* Any migration code in here is wrapped inside of a transaction. | ||
* | ||
* @return bool | ||
*/ | ||
public function safeUp() | ||
{ | ||
$settings = array( | ||
array( | ||
'name' => 'Form template', | ||
'value' => '' | ||
), | ||
array( | ||
'name' => 'Tab template', | ||
'value' => '' | ||
), | ||
array( | ||
'name' => 'Field template', | ||
'value' => '' | ||
), | ||
array( | ||
'name' => 'Notification template', | ||
'value' => '' | ||
), | ||
); | ||
return craft()->amForms_install->installSettings($settings, AmFormsModel::SettingsTemplatePaths); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{% extends 'amforms/_layouts/settings' %} | ||
|
||
{% set title = 'Templates'|t %} | ||
{% set selectedTab = 'templates' %} | ||
|
||
{% block fields %} | ||
{{ forms.textField({ | ||
label: templates.formTemplate.name|t, | ||
id: templates.formTemplate.handle, | ||
name: templates.formTemplate.handle, | ||
value: templates.formTemplate.value, | ||
placeholder: '_amforms/form', | ||
instructions: 'Override default template with your own template. Enter the folder (with template), e.g.: {template}'|t({'template': '_amforms'}) | ||
}) }} | ||
|
||
{{ forms.textField({ | ||
label: templates.tabTemplate.name|t, | ||
id: templates.tabTemplate.handle, | ||
name: templates.tabTemplate.handle, | ||
value: templates.tabTemplate.value, | ||
placeholder: '_amforms/tab', | ||
instructions: 'Override default template with your own template. Enter the folder (with template), e.g.: {template}'|t({'template': '_amforms'}) | ||
}) }} | ||
|
||
{{ forms.textField({ | ||
label: templates.fieldTemplate.name|t, | ||
id: templates.fieldTemplate.handle, | ||
name: templates.fieldTemplate.handle, | ||
value: templates.fieldTemplate.value, | ||
placeholder: '_amforms/field', | ||
instructions: 'Override default template with your own template. Enter the folder (with template), e.g.: {template}'|t({'template': '_amforms'}) | ||
}) }} | ||
|
||
{{ forms.textField({ | ||
label: templates.notificationTemplate.name|t, | ||
id: templates.notificationTemplate.handle, | ||
name: templates.notificationTemplate.handle, | ||
value: templates.notificationTemplate.value, | ||
placeholder: '_amforms/email', | ||
instructions: 'Override default template with your own template. Enter the folder (with template), e.g.: {template}'|t({'template': '_amforms'}) | ||
}) }} | ||
{% endblock %} |