Skip to content

Commit

Permalink
Code format
Browse files Browse the repository at this point in the history
  • Loading branch information
Hubert Prein committed Jul 15, 2015
1 parent af7c177 commit 008e8ed
Show file tree
Hide file tree
Showing 43 changed files with 61 additions and 53 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"require": {
"composer/installers": "~1.0"
}
}
}
2 changes: 1 addition & 1 deletion controllers/AmForms_ExportsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ public function actionDownloadExport()
readfile($export->file);
die();
}
}
}
20 changes: 10 additions & 10 deletions controllers/AmForms_FieldsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,21 @@ public function actionSaveField()
}

/**
* Delete a field.
*/
public function actionDeleteField()
{
$this->requirePostRequest();
$this->requireAjaxRequest();
* Delete a field.
*/
public function actionDeleteField()
{
$this->requirePostRequest();
$this->requireAjaxRequest();

// Override Craft's default context and content
craft()->content->fieldContext = AmFormsModel::FieldContext;
craft()->content->contentTable = AmFormsModel::FieldContent;

// Delete field
$fieldId = craft()->request->getRequiredPost('id');
$success = craft()->fields->deleteFieldById($fieldId);
$fieldId = craft()->request->getRequiredPost('id');
$success = craft()->fields->deleteFieldById($fieldId);

$this->returnJson(array('success' => $success));
}
$this->returnJson(array('success' => $success));
}
}
2 changes: 1 addition & 1 deletion controllers/AmForms_FormsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ public function actionDeleteForm()

$this->redirectToPostedUrl($form);
}
}
}
2 changes: 1 addition & 1 deletion controllers/AmForms_SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ private function _saveSettings($type)
craft()->userSession->setError(Craft::t('Couldn’t save settings.'));
}
}
}
}
2 changes: 1 addition & 1 deletion elementtypes/AmForms_FormElementType.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,4 @@ public function populateElementModel($row)
{
return AmForms_FormModel::populateModel($row);
}
}
}
2 changes: 1 addition & 1 deletion fieldtypes/AmForms_FormFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ protected function getAddButtonLabel()
{
return Craft::t('Add a form');
}
}
}
2 changes: 1 addition & 1 deletion models/AmForms_FormModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ public function displayForm()
{
return craft()->amForms_forms->displayForm($this);
}
}
}
2 changes: 1 addition & 1 deletion models/AmForms_SettingModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ protected function defineAttributes()
'value' => AttributeType::Mixed
);
}
}
}
2 changes: 1 addition & 1 deletion records/AmForms_FormRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ public function defineRelations()
'submissions' => array(static::HAS_MANY, 'AmForms_SubmissionRecord', 'submissionId')
);
}
}
}
2 changes: 1 addition & 1 deletion records/AmForms_SettingRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public function scopes()
'ordered' => array('order' => 'handle')
);
}
}
}
2 changes: 1 addition & 1 deletion services/AmFormsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ public function renderDisplayTemplate($defaultTemplate, $overrideTemplate, $vari
// Return rendered template!
return $html;
}
}
}
2 changes: 1 addition & 1 deletion services/AmForms_AntispamService.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,4 @@ private function _getHash($str)
{
return md5(sha1($str));
}
}
}
2 changes: 1 addition & 1 deletion services/AmForms_FieldsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ public function getUnsupportedFieldTypes()
'Matrix'
);
}
}
}
2 changes: 1 addition & 1 deletion services/AmForms_FormsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,4 @@ public function displayForm(AmForms_FormModel $form)
// Parse form
return new \Twig_Markup($formHtml, craft()->templates->getTwig()->getCharset());
}
}
}
2 changes: 1 addition & 1 deletion services/AmForms_RecaptchaService.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ public function verify()

return false;
}
}
}
2 changes: 1 addition & 1 deletion services/AmForms_SubmissionsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,4 +342,4 @@ public function onEmailSubmission(Event $event)
{
$this->raiseEvent('onEmailSubmission', $event);
}
}
}
2 changes: 1 addition & 1 deletion tasks/AmForms_ExportTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ public function runStep($step)

return $result;
}
}
}
2 changes: 1 addition & 1 deletion templates/_display/templates/_antispam/honeypot.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<label>{{ 'Leave this field blank'|t }}</label>
<input type="text" id="{{ fieldName }}" name="{{ fieldName }}" value="">
</div>
<style>#{{ fieldName }}__wrapper{ display: none; }</style>
<style>#{{ fieldName }}__wrapper{ display: none; }</style>
2 changes: 1 addition & 1 deletion templates/_display/templates/_antispam/origin.twig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<input type="hidden" id="__UAHOME" name="__UAHOME" value="{{ domain }}" />
<input type="hidden" id="__UAHASH" name="__UAHASH" value="{{ userAgent }}"/>
<input type="hidden" id="__UAHASH" name="__UAHASH" value="{{ userAgent }}"/>
2 changes: 1 addition & 1 deletion templates/_display/templates/_antispam/time.twig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<input type="hidden" id="__UATIME" name="__UATIME" value="{{ time }}" />
<input type="hidden" id="__UATIME" name="__UATIME" value="{{ time }}" />
12 changes: 10 additions & 2 deletions templates/_display/templates/email.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@
<td width="25%">{{ field.name }}:</td>
<td>
{% if value is not iterable and value is not empty -%}
{{ value }}
{% if field.type == 'Lightswitch' %}
{% if value == '1' %}
{{ 'Yes'|t }}
{% else %}
{{ 'No'|t }}
{% endif %}
{% else %}
{{ value }}
{% endif %}
{% else -%}
<ul style="margin-left:0;">
{% for item in value %}
Expand All @@ -43,4 +51,4 @@
{% endfor %}
</table>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion templates/_display/templates/errorList.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
<li>{{ error }}</li>
{% endfor %}
</ul>
{%- endif %}
{%- endif %}
2 changes: 1 addition & 1 deletion templates/_display/templates/field.twig
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
</ul>
{%- endif %}
</div>
{% endnamespace %}
{% endnamespace %}
2 changes: 1 addition & 1 deletion templates/_display/templates/form.twig
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
<div class="submit">
<input type="submit" value="{{ submitValue }}">
</div>
</form>
</form>
2 changes: 1 addition & 1 deletion templates/_display/templates/recaptcha.twig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div class="g-recaptcha" data-sitekey="{{ siteKey }}"></div>
<div class="g-recaptcha" data-sitekey="{{ siteKey }}"></div>
2 changes: 1 addition & 1 deletion templates/_display/templates/tab.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<div class="tab">
{{ tab.fields|join|raw }}
</div>
{% endfor %}
{% endfor %}
2 changes: 1 addition & 1 deletion templates/_layouts/overview.twig
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
{% set extraPageHeaderHtml %}
<a class="btn settings icon" href="{{ url('amforms/settings') }}" title="{{ 'Settings'|t }}"></a>
{% endset %}
{% endif %}
{% endif %}
2 changes: 1 addition & 1 deletion templates/_layouts/settings.twig
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
<input type="submit" class="btn submit" value="{{ 'Save'|t }}">
</div>
</form>
{% endset %}
{% endset %}
2 changes: 1 addition & 1 deletion templates/exports/_edit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@
</div>
</form>
{% endif %}
{% endset %}
{% endset %}
2 changes: 1 addition & 1 deletion templates/exports/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
deleteAction: 'amForms/exports/deleteExport'
});
{% endset %}
{% includeJs js %}
{% includeJs js %}
2 changes: 1 addition & 1 deletion templates/fields/_edit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@

{% if fieldId is not defined %}
{% includeJs "new Craft.HandleGenerator('#name', '#handle');" %}
{% endif %}
{% endif %}
2 changes: 1 addition & 1 deletion templates/forms/_edit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@
</div>
</div>
</form>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion templates/forms/_fields/form.twig
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@
{% set js %}
{% if not form.handle %}new Craft.HandleGenerator('#name', '#handle');{% endif %}
{% endset %}
{% includeJs js %}
{% includeJs js %}
2 changes: 1 addition & 1 deletion templates/forms/_fields/notifications.twig
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@
value: form.notificationReplyToEmail,
errors: form.getErrors('notificationReplyToEmail'),
instructions: 'The reply to email address of your notification email.'|t
}) }}
}) }}
2 changes: 1 addition & 1 deletion templates/forms/_fields/templates.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
errors: form.getErrors('notificationTemplate'),
placeholder: '_amforms/email',
instructions: 'Override default template with your own template. Enter the folder (with template), e.g.: {template}'|t({'template': '_amforms'})
}) }}
}) }}
2 changes: 1 addition & 1 deletion templates/forms/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
</div>

{{ parent() }}
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion templates/index.twig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% redirect 'amforms/submissions' %}
{% redirect 'amforms/submissions' %}
2 changes: 1 addition & 1 deletion templates/settings/antispam.twig
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@
on: antispam.originCheckEnabled.value,
instructions: 'Check the domain and user agent.'|t
}) }}
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion templates/settings/recaptcha.twig
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
value: recaptcha.secretKey.value,
instructions: 'Go to Google reCAPTCHA and register the site. Use the secret key that is given.'|t
}) }}
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion templates/submissions/_edit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@
</div>
</div>
</form>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion templates/submissions/index.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% extends 'amforms/_layouts/overview' %}

{% set selectedTab = 'submissions' %}
{% set selectedTab = 'submissions' %}
2 changes: 1 addition & 1 deletion variables/AmFormsVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ public function displayRecaptcha()
{
return craft()->amForms_recaptcha->render();
}
}
}

0 comments on commit 008e8ed

Please sign in to comment.