diff --git a/CHANGELOG.md b/CHANGELOG.md
index 12255c889..ccb9700bd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+* **Build 101** (2014-06-06)
+ - Added a global traceLog() helper for help with debugging.
+ - New settings area added to manage Email templates and layouts.
+
* **Build 99** (2014-06-05)
- Plugins can now be removed, refreshed and disabled via the back-end.
diff --git a/modules/backend/ServiceProvider.php b/modules/backend/ServiceProvider.php
index f4339b364..bed3178ab 100644
--- a/modules/backend/ServiceProvider.php
+++ b/modules/backend/ServiceProvider.php
@@ -7,6 +7,7 @@ use BackendMenu;
use BackendAuth;
use Backend\Classes\WidgetManager;
use October\Rain\Support\ModuleServiceProvider;
+use System\Models\EmailTemplate;
class ServiceProvider extends ModuleServiceProvider
{
@@ -70,6 +71,16 @@ class ServiceProvider extends ModuleServiceProvider
'backend.manage_users' => ['label' => 'Manage other administrators', 'tab' => 'System'],
]);
});
+
+ /*
+ * Register email templates
+ */
+ EmailTemplate::registerCallback(function($template){
+ $template->registerEmailTemplates([
+ 'backend::emails.invite' => 'Invitation for newly created administrators.',
+ 'backend::emails.restore' => 'Password reset instructions for backend-end administrators.',
+ ]);
+ });
}
/**
diff --git a/modules/backend/assets/css/october.css b/modules/backend/assets/css/october.css
index fecc56e6f..00c53a02e 100644
--- a/modules/backend/assets/css/october.css
+++ b/modules/backend/assets/css/october.css
@@ -7279,6 +7279,18 @@ label {
.form-control.align-right {
text-align: right;
}
+.form-preview {
+ padding: 15px;
+ margin-bottom: 20px;
+ background: white;
+ border: 1px solid #eee;
+}
+.form-preview .form-group {
+ padding-bottom: 10px;
+}
+.form-preview > .form-group:last-child {
+ padding-bottom: 0;
+}
.form-elements:before,
.form-tabless-fields:before,
.form-elements:after,
@@ -7769,6 +7781,15 @@ label {
.select2-drop .select2-results > li > div {
padding: 5px 7px 5px;
}
+.list-preview {
+ padding: 20px 0 0;
+ margin-bottom: 20px;
+ background: white;
+ border: 1px solid #e2e2e2;
+}
+.list-preview .control-list:last-child > table {
+ margin-bottom: 0;
+}
.control-list p.no-data {
padding: 18px 20px;
margin: 0 20px;
@@ -8515,7 +8536,7 @@ table.table.data tr.list-tree-level-25 td.list-data-column-1 {
.modal-body {
padding-bottom: 0;
}
-.modal-body p:last-child {
+.modal-body > p:last-child {
margin-bottom: 20px;
}
.control-popup.fade .modal-dialog {
diff --git a/modules/backend/assets/js/october.inspector.js b/modules/backend/assets/js/october.inspector.js
index f1e014f39..c54e0deb9 100644
--- a/modules/backend/assets/js/october.inspector.js
+++ b/modules/backend/assets/js/october.inspector.js
@@ -194,7 +194,7 @@
var e = $.Event('showing.oc.inspector')
this.$el.trigger(e, [{callback: displayPopover}])
- if (e.isDefaultPrevented())
+ if (e.isDefaultPrevented())
return
if (!e.isPropagationStopped())
diff --git a/modules/backend/assets/js/october.tab.js b/modules/backend/assets/js/october.tab.js
index ae1e9c10b..37761cc27 100644
--- a/modules/backend/assets/js/october.tab.js
+++ b/modules/backend/assets/js/october.tab.js
@@ -15,14 +15,14 @@
* - data-closable - enables the Close Tab feature
* - data-pane-classes - a list of CSS classes to apply new pane elements
*
- * Example with data attributes (data-control="tab"):
+ * Example with data attributes (data-control="tab"):
*
*
*
diff --git a/modules/backend/assets/less/controls/forms.less b/modules/backend/assets/less/controls/forms.less
index 781d3f156..a00642820 100644
--- a/modules/backend/assets/less/controls/forms.less
+++ b/modules/backend/assets/less/controls/forms.less
@@ -22,6 +22,25 @@ label {
}
}
+//
+// Form containers
+//
+
+.form-preview {
+ padding: 15px;
+ margin-bottom: 20px;
+ background: white;
+ border: 1px solid #eee;
+
+ .form-group {
+ padding-bottom: 10px;
+ }
+
+ >.form-group:last-child {
+ padding-bottom: 0;
+ }
+}
+
//
// Nice forms
//
diff --git a/modules/backend/assets/less/controls/lists.less b/modules/backend/assets/less/controls/lists.less
index efb2fc5ef..dd1e59533 100644
--- a/modules/backend/assets/less/controls/lists.less
+++ b/modules/backend/assets/less/controls/lists.less
@@ -51,6 +51,26 @@
//
//
//
+
+//
+// List containers
+//
+
+.list-preview {
+ padding: 20px 0 0;
+ margin-bottom: 20px;
+ background: white;
+ border: 1px solid @color-list-border;
+
+ .control-list:last-child > table {
+ margin-bottom: 0;
+ }
+}
+
+//
+// List control
+//
+
.control-list {
p.no-data {
padding: 18px 20px;
diff --git a/modules/backend/assets/less/controls/popup.less b/modules/backend/assets/less/controls/popup.less
index 91e8c94aa..f9969e44c 100644
--- a/modules/backend/assets/less/controls/popup.less
+++ b/modules/backend/assets/less/controls/popup.less
@@ -31,7 +31,7 @@
.modal-body {
padding-bottom: 0;
- p:last-child {
+ > p:last-child {
margin-bottom: 20px;
}
}
diff --git a/modules/backend/behaviors/FormController.php b/modules/backend/behaviors/FormController.php
index 3a7b53927..d117cc54a 100644
--- a/modules/backend/behaviors/FormController.php
+++ b/modules/backend/behaviors/FormController.php
@@ -128,12 +128,13 @@ class FormController extends ControllerBehavior
$this->initForm($model);
$this->controller->formBeforeSave($model);
- $this->controller->formBeforeCreateSave($model);
+ $this->controller->formBeforeCreate($model);
$this->setModelAttributes($model, $this->formWidget->getSaveData());
$model->push($this->formWidget->getSessionKey());
$this->controller->formAfterSave($model);
+ $this->controller->formAfterCreate($model);
Flash::success($this->getLang('create[flash-save]', 'backend::lang.form.create_success'));
@@ -177,12 +178,13 @@ class FormController extends ControllerBehavior
$this->initForm($model, 'update');
$this->controller->formBeforeSave($model);
- $this->controller->formBeforeEditSave($model);
+ $this->controller->formBeforeUpdate($model);
$this->setModelAttributes($model, $this->formWidget->getSaveData());
$model->push($this->formWidget->getSessionKey());
$this->controller->formAfterSave($model);
+ $this->controller->formAfterUpdate($model);
Flash::success($this->getLang('update[flash-save]', 'backend::lang.form.update_success'));
@@ -409,16 +411,10 @@ class FormController extends ControllerBehavior
//
/**
- * Called before the creation form is saved.
+ * Called before the creation or updating form is saved.
* @param Model
*/
- public function formBeforeCreateSave($model) {}
-
- /**
- * Called after the creation form is saved.
- * @param Model
- */
- public function formAfterCreateSave($model) {}
+ public function formBeforeSave($model) {}
/**
* Called after the creation or updating form is saved.
@@ -426,23 +422,29 @@ class FormController extends ControllerBehavior
*/
public function formAfterSave($model) {}
+ /**
+ * Called before the creation form is saved.
+ * @param Model
+ */
+ public function formBeforeCreate($model) {}
+
+ /**
+ * Called after the creation form is saved.
+ * @param Model
+ */
+ public function formAfterCreate($model) {}
+
/**
* Called before the updating form is saved.
* @param Model
*/
- public function formBeforeEditSave($model) {}
-
- /**
- * Called before the creation or updating form is saved.
- * @param Model
- */
- public function formBeforeSave($model) {}
+ public function formBeforeUpdate($model) {}
/**
* Called after the updating form is saved.
* @param Model
*/
- public function formAfterEditSave($model) {}
+ public function formAfterUpdate($model) {}
/**
* Called after the form model is deleted.
diff --git a/modules/backend/classes/NavigationManager.php b/modules/backend/classes/NavigationManager.php
index 80238b98b..a9b731582 100644
--- a/modules/backend/classes/NavigationManager.php
+++ b/modules/backend/classes/NavigationManager.php
@@ -60,6 +60,10 @@ class NavigationManager
$this->pluginManager = PluginManager::instance();
}
+ /**
+ * Loads the menu items from modules and plugins
+ * @return void
+ */
protected function loadItems()
{
/*
diff --git a/modules/backend/controllers/Index.php b/modules/backend/controllers/Index.php
index 71b16b19e..db130946c 100644
--- a/modules/backend/controllers/Index.php
+++ b/modules/backend/controllers/Index.php
@@ -26,6 +26,11 @@ class Index extends Controller
BackendMenu::setContextOwner('October.Backend');
new ReportContainer($this);
+ /* @todo Remove line if year >= 2015 */ if (\Schema::hasColumn('backend_users', 'activated')) \Schema::table('backend_users', function($table) { $table->renameColumn('activated', 'is_activated'); });
+ /* @todo Remove line if year >= 2015 */ if (\Schema::hasColumn('backend_user_throttle', 'suspended')) \Schema::table('backend_user_throttle', function($table) { $table->renameColumn('suspended', 'is_suspended'); });
+ /* @todo Remove line if year >= 2015 */ if (\Schema::hasColumn('backend_user_throttle', 'banned')) \Schema::table('backend_user_throttle', function($table) { $table->renameColumn('banned', 'is_banned'); });
+ /* @todo Remove line if year >= 2015 */ if (\Schema::hasColumn('deferred_bindings', 'bind')) \Schema::table('deferred_bindings', function($table) { $table->renameColumn('bind', 'is_bind'); });
+ /* @todo Remove line if year >= 2015 */ if (\Schema::hasColumn('system_files', 'public')) \Schema::table('system_files', function($table) { $table->renameColumn('public', 'is_public'); });
}
public function index()
diff --git a/modules/backend/database/migrations/2013_10_01_000001_Db_Backend_Users.php b/modules/backend/database/migrations/2013_10_01_000001_Db_Backend_Users.php
index acc84da11..3d62ce4a6 100644
--- a/modules/backend/database/migrations/2013_10_01_000001_Db_Backend_Users.php
+++ b/modules/backend/database/migrations/2013_10_01_000001_Db_Backend_Users.php
@@ -21,7 +21,7 @@ class DbBackendUsers extends Migration
$table->string('persist_code')->nullable();
$table->string('reset_password_code')->nullable()->index();
$table->text('permissions')->nullable();
- $table->boolean('activated')->default(0);
+ $table->boolean('is_activated')->default(0);
$table->timestamp('activated_at')->nullable();
$table->timestamp('last_login')->nullable();
$table->timestamps();
diff --git a/modules/backend/database/migrations/2013_10_01_000004_Db_Backend_User_Throttle.php b/modules/backend/database/migrations/2013_10_01_000004_Db_Backend_User_Throttle.php
index 3eeb2957a..b7eafa86a 100644
--- a/modules/backend/database/migrations/2013_10_01_000004_Db_Backend_User_Throttle.php
+++ b/modules/backend/database/migrations/2013_10_01_000004_Db_Backend_User_Throttle.php
@@ -15,10 +15,10 @@ class DbBackendUserThrottle extends Migration
$table->integer('user_id')->unsigned();
$table->string('ip_address')->nullable();
$table->integer('attempts')->default(0);
- $table->boolean('suspended')->default(0);
- $table->boolean('banned')->default(0);
$table->timestamp('last_attempt_at')->nullable();
+ $table->boolean('is_suspended')->default(0);
$table->timestamp('suspended_at')->nullable();
+ $table->boolean('is_banned')->default(0);
$table->timestamp('banned_at')->nullable();
});
}
diff --git a/modules/backend/database/seeds/SeedSetupAdmin.php b/modules/backend/database/seeds/SeedSetupAdmin.php
index fca419e07..c571b7ca8 100644
--- a/modules/backend/database/seeds/SeedSetupAdmin.php
+++ b/modules/backend/database/seeds/SeedSetupAdmin.php
@@ -35,7 +35,7 @@ class SeedSetupAdmin extends Seeder
'first_name' => static::$firstName,
'last_name' => static::$lastName,
'permissions' => ['superuser' => 1],
- 'activated' => true
+ 'is_activated' => true
]);
$user->addGroup($group);
diff --git a/modules/backend/formwidgets/FileUpload.php b/modules/backend/formwidgets/FileUpload.php
index 7850f3671..22c127a17 100644
--- a/modules/backend/formwidgets/FileUpload.php
+++ b/modules/backend/formwidgets/FileUpload.php
@@ -191,7 +191,7 @@ class FileUpload extends FormWidgetBase
$file = new File();
$file->data = $uploadedFile;
- $file->public = $fileRelation->isPublic();
+ $file->is_public = $fileRelation->isPublic();
$file->save();
$fileRelation->add($file, $this->sessionKey);
diff --git a/modules/backend/formwidgets/RichEditor.php b/modules/backend/formwidgets/RichEditor.php
index 81dd321de..a590ab482 100644
--- a/modules/backend/formwidgets/RichEditor.php
+++ b/modules/backend/formwidgets/RichEditor.php
@@ -16,11 +16,18 @@ class RichEditor extends FormWidgetBase
*/
public $defaultAlias = 'richeditor';
+ /**
+ * @var boolean Determines whether content has HEAD and HTML tags.
+ */
+ public $fullPage = false;
+
/**
* {@inheritDoc}
*/
public function render()
{
+ $this->fullPage = $this->getConfig('fullPage', $this->fullPage);
+
$this->prepareVars();
return $this->makePartial('richeditor');
}
@@ -30,6 +37,7 @@ class RichEditor extends FormWidgetBase
*/
public function prepareVars()
{
+ $this->vars['fullPage'] = $this->fullPage;
$this->vars['stretch'] = $this->formField->stretch;
$this->vars['size'] = $this->formField->size;
$this->vars['name'] = $this->formField->getName();
diff --git a/modules/backend/views/emails/invite.htm b/modules/backend/views/emails/invite.htm
index 76aed9fbe..ed27dc373 100644
--- a/modules/backend/views/emails/invite.htm
+++ b/modules/backend/views/emails/invite.htm
@@ -1,4 +1,5 @@
subject = "Welcome to October CMS"
+layout = "system"
==
Hi {{ name }},
diff --git a/modules/backend/views/emails/restore.htm b/modules/backend/views/emails/restore.htm
index fa6cea090..3a55f45d3 100644
--- a/modules/backend/views/emails/restore.htm
+++ b/modules/backend/views/emails/restore.htm
@@ -1,4 +1,5 @@
subject = "Password Reset"
+layout = "system"
==
Hello {{ name }},
diff --git a/modules/cms/classes/CmsPropertyHelper.php b/modules/cms/classes/CmsPropertyHelper.php
index ca74252f2..d38154d74 100644
--- a/modules/cms/classes/CmsPropertyHelper.php
+++ b/modules/cms/classes/CmsPropertyHelper.php
@@ -3,7 +3,9 @@
/**
*
* DEPRECATED WARNING: This class is deprecated and should be deleted
- * if the current year is equal to or greater than 2015 @todo.
+ * if the current year is equal to or greater than 2015.
+ *
+ * @todo Delete this file if year >= 2015.
*
*/
diff --git a/modules/cms/controllers/index/_concurrency_resolve_form.htm b/modules/cms/controllers/index/_concurrency_resolve_form.htm
index aa0e00ca4..42873cc7e 100644
--- a/modules/cms/controllers/index/_concurrency_resolve_form.htm
+++ b/modules/cms/controllers/index/_concurrency_resolve_form.htm
@@ -4,9 +4,7 @@
File was changed
-
-
The file you're editing has been changed on disk by another user. You can either reload the file and lose your changes or override the file on the disk.
-
+
The file you're editing has been changed on disk by another user. You can either reload the file and lose your changes or override the file on the disk.