diff --git a/wire/core/AdminTheme.php b/wire/core/AdminTheme.php
index 5e82906d..951960e0 100644
--- a/wire/core/AdminTheme.php
+++ b/wire/core/AdminTheme.php
@@ -98,6 +98,8 @@ abstract class AdminTheme extends WireData implements Module {
* Initialize the admin theme systme and determine which admin theme should be used
*
* All admin themes must call this init() method to register themselves.
+ *
+ * Note: this should be called after API ready.
*
*/
public function init() {
@@ -116,6 +118,11 @@ abstract class AdminTheme extends WireData implements Module {
// if admin theme has already been set, then no need to continue
if($this->wire('adminTheme')) return;
+ /** @var Config $config */
+ $config = $this->wire('config');
+ /** @var Session $session */
+ $session = $this->wire('session');
+ /** @var string $adminTheme */
$adminTheme = $this->wire('user')->admin_theme;
if($adminTheme) {
@@ -129,19 +136,20 @@ abstract class AdminTheme extends WireData implements Module {
}
// adjust $config adminThumbOptions[scale] for auto detect when requested
- $o = $this->wire('config')->adminThumbOptions;
+ $o = $config->adminThumbOptions;
if($o && isset($o['scale']) && $o['scale'] === 1) {
- $o['scale'] = $this->wire('session')->hidpi ? 0.5 : 1.0;
- $this->wire('config')->adminThumbOptions = $o;
+ $o['scale'] = $session->hidpi ? 0.5 : 1.0;
+ $config->adminThumbOptions = $o;
}
- $this->config->js('modals', $this->config->modals);
+ $config->js('modals', $config->modals);
+
+ if($session->hidpi) $this->addBodyClass('hidpi-device');
+ if($session->touch) $this->addBodyClass('touch-device');
- if($this->wire('session')->hidpi) $this->addBodyClass('hidpi-device');
- if($this->wire('session')->touch) $this->addBodyClass('touch-device');
$this->addBodyClass($this->className());
}
-
+
public function get($key) {
if($key == 'version') return $this->version;
return parent::get($key);
diff --git a/wire/core/AdminThemeFramework.php b/wire/core/AdminThemeFramework.php
index 45d0a4e9..ca9dba3d 100644
--- a/wire/core/AdminThemeFramework.php
+++ b/wire/core/AdminThemeFramework.php
@@ -84,6 +84,8 @@ abstract class AdminThemeFramework extends AdminTheme {
/**
* Initialize and attach hooks
+ *
+ * Note: descending classes should call this after API ready
*
*/
public function init() {
@@ -98,13 +100,32 @@ abstract class AdminThemeFramework extends AdminTheme {
$this->isLoggedIn = $user->isLoggedin();
$this->isSuperuser = $this->isLoggedIn && $user->isSuperuser();
$this->isEditor = $this->isLoggedIn && ($this->isSuperuser || $user->hasPermission('page-edit'));
+ $this->includeInitFile();
$modal = $this->wire('input')->get('modal');
if($modal) $this->isModal = $modal == 'inline' ? 'inline' : true;
// test notices when requested
- if($this->wire('input')->get('test_notices')) $this->testNotices();
+ if($this->wire('input')->get('test_notices') && $this->isLoggedIn) $this->testNotices();
}
+
+ /**
+ * Include the admin theme init file
+ *
+ */
+ public function includeInitFile() {
+ $config = $this->wire('config');
+ $initFile = $config->paths->adminTemplates . 'init.php';
+ if(file_exists($initFile)) {
+ if(strpos($initFile, $config->paths->site) === 0) {
+ // admin themes in /site/modules/ may be compiled
+ $initFile = $this->wire('files')->compile($initFile);
+ }
+ /** @noinspection PhpIncludeInspection */
+ include_once($initFile);
+ }
+ }
+
/**
* Perform a translation, based on text from shared admin file: /wire/templates-admin/default.php
@@ -584,10 +605,12 @@ abstract class AdminThemeFramework extends AdminTheme {
// if(!count($notices)) return '';
+ /*
if($this->isLoggedIn && $this->wire('modules')->isInstalled('SystemNotifications')) {
$systemNotifications = $this->wire('modules')->get('SystemNotifications');
if(!$systemNotifications->placement) return '';
}
+ */
$defaults = array(
'messageClass' => 'NoticeMessage', // class for messages
diff --git a/wire/core/Modules.php b/wire/core/Modules.php
index 307afcaf..ce93ed00 100644
--- a/wire/core/Modules.php
+++ b/wire/core/Modules.php
@@ -742,8 +742,6 @@ class Modules extends WireArray {
/**
* Retrieve the installed module info as stored in the database
*
- * @return array Indexed by module class name => array of module info
- *
*/
protected function loadModulesTable() {
$database = $this->wire('database');
@@ -2648,8 +2646,11 @@ class Modules extends WireArray {
// if $info[requires] or $info[installs] isn't already an array, make it one
if(!is_array($info['requires'])) {
$info['requires'] = str_replace(' ', '', $info['requires']); // remove whitespace
- if(strpos($info['requires'], ',') !== false) $info['requires'] = explode(',', $info['requires']);
- else $info['requires'] = array($info['requires']);
+ if(strpos($info['requires'], ',') !== false) {
+ $info['requires'] = explode(',', $info['requires']);
+ } else {
+ $info['requires'] = array($info['requires']);
+ }
}
// populate requiresVersions
@@ -2669,8 +2670,11 @@ class Modules extends WireArray {
// what does it install?
if(!is_array($info['installs'])) {
$info['installs'] = str_replace(' ', '', $info['installs']); // remove whitespace
- if(strpos($info['installs'], ',') !== false) $info['installs'] = explode(',', $info['installs']);
- else $info['installs'] = array($info['installs']);
+ if(strpos($info['installs'], ',') !== false) {
+ $info['installs'] = explode(',', $info['installs']);
+ } else {
+ $info['installs'] = array($info['installs']);
+ }
}
// misc
diff --git a/wire/core/ProcessWire.php b/wire/core/ProcessWire.php
index 2db741a0..dc786642 100644
--- a/wire/core/ProcessWire.php
+++ b/wire/core/ProcessWire.php
@@ -45,7 +45,7 @@ class ProcessWire extends Wire {
* Reversion revision number
*
*/
- const versionRevision = 77;
+ const versionRevision = 78;
/**
* Version suffix string (when applicable)
diff --git a/wire/core/admin.php b/wire/core/admin.php
index 538a4cd9..e10d0ca0 100644
--- a/wire/core/admin.php
+++ b/wire/core/admin.php
@@ -107,7 +107,7 @@ if($page->process && $page->process != 'ProcessPageView') {
$initFile = $wire->files->compile($initFile);
}
/** @noinspection PhpIncludeInspection */
- include($initFile);
+ include_once($initFile);
}
if($input->get('modal')) $session->addHookBefore('redirect', null, '_hookSessionRedirectModal');
$content = $controller->execute();
diff --git a/wire/modules/Inputfield/InputfieldSelector/InputfieldSelector.module b/wire/modules/Inputfield/InputfieldSelector/InputfieldSelector.module
index 14a7c14e..adc662a4 100644
--- a/wire/modules/Inputfield/InputfieldSelector/InputfieldSelector.module
+++ b/wire/modules/Inputfield/InputfieldSelector/InputfieldSelector.module
@@ -49,6 +49,9 @@
* @property string $subfieldIdentifier ...
* @property string $groupIdentifier (1)
* @property int $maxUsers [20] Maximum number of users selectable. If more than regular text input used rather than select.
+ * @property string $selectClass
+ * @property string $inputClass
+ * @property string $checkboxClass
*
*
*/
@@ -131,6 +134,13 @@ class InputfieldSelector extends Inputfield implements ConfigurableModule {
*/
protected $initTemplate = null;
+ /**
+ * Has the ready method been called?
+ * @var bool
+ *
+ */
+ protected $isReady = false;
+
/**
* Variable names that should be picked up through the session each time
*
@@ -202,7 +212,7 @@ class InputfieldSelector extends Inputfield implements ConfigurableModule {
$this->setting('timeFormat', $this->_('H:i')); // time format
$this->setting('timePlaceholder', $this->_('hh:mm')); // time format placeholder (what users see)
$this->setting('maxUsers', 20); // text input rather than select used when useres qty is greater than this
-
+
parent::__construct();
}
@@ -247,6 +257,21 @@ class InputfieldSelector extends Inputfield implements ConfigurableModule {
*
*/
public function ready() {
+
+ if($this->isReady) return;
+ $this->isReady = true;
+
+ // settings specified in $config->InputfieldSelector
+ $configDefaults = array(
+ 'selectClass' => '',
+ 'inputClass' => '',
+ 'checkboxClass' => '',
+ );
+ $configSettings = $this->wire('config')->InputfieldSelector;
+ $configSettings = is_array($configSettings) ? array_merge($configDefaults, $configSettings) : $configDefaults;
+ foreach($configSettings as $key => $value) {
+ $this->setting($key, $value);
+ }
$input = $this->wire('input');
$name = $input->get('name');
@@ -902,7 +927,8 @@ class InputfieldSelector extends Inputfield implements ConfigurableModule {
$outSections['adjust'] = "";
$inputName = $this->attr('name') . "__" . $settings['name'] . "[]";
- $out = "
","coffee fa-spin");return false});$(document).on("pw-modal-opened",function(){if(Notifications.$bug.is(":visible")){Notifications.$bug.fadeOut().addClass("hidden-for-modal")}if(Notifications.$menu.is(":visible")){Notifications.$menu.hide().addClass("hidden-for-modal")}}).on("pw-modal-closed",function(){if(Notifications.$bug.hasClass("hidden-for-modal")){Notifications.$bug.fadeIn().removeClass("hidden-for-modal")}if(Notifications.$menu.hasClass("hidden-for-modal")){Notifications.$menu.slideDown().removeClass("hidden-for-modal")}});if(Notifications.useSession&&Notifications.options.processKey.length){if(typeof sessionStorage.pwWindowName=="undefined"||sessionStorage.pwWindowName.indexOf("PW")!==0){sessionStorage.pwWindowName="PW"+Math.floor(Math.random()*65536).toString()+Math.floor(Math.random()*65536).toString()}}}};
\ No newline at end of file
+var Notifications={options:{ajaxURL:"./",version:1,reverse:0,updateLast:0,updateDelay:5000,updateDelayFast:1550,iconMessage:"smile-o",iconWarning:"meh-o",iconError:"frown-o",iconRemove:"times-circle",classCommon:"NoticeItem",classMessage:"NoticeMessage",classWarning:"NoticeWarning",classError:"NoticeError",classDebug:"NoticeDebug",classContainer:"container",ghostDelay:2000,ghostDelayError:4000,ghostFadeSpeed:"fast",ghostOpacity:0.9,ghostLimit:20,processKey:"",i18n:{sec:"sec",secs:"secs",min:"min",mins:"mins",hour:"hour",hours:"hours",day:"day",days:"days",expires:"expires",now:"now",fromNow:"from now",ago:"ago"}},updateTimeout:null,renderTimeout:null,timerTimeout:null,updating:false,runtime:[],numRender:0,numEmptyRequests:0,ghostsActive:0,currentDelay:0,turbo:false,timeNow:0,useSession:false,$menu:null,$bug:null,$list:null,relativeTime:function(a){var d="";if(a==0){return d}var c=Notifications.options.i18n;var b=a>0;a=Math.abs(a);if(a>1&&a<60){d=a+" "+(a==1?c.sec:c.secs)}else{if(a>=60&&a<3600){d=Math.floor(a/60);d+=" "+(d==1?c.min:c.mins)}else{if(a>=3600&&a<86400){d=Math.floor(a/3600);d+=" "+(d==1?c.hour:c.hours)}else{if(a>=86400){d=Math.floor(a/86400);d+=" "+(d==1?c.day:c.days)}}}}d+=" ";if(b){if(a<3){d=c.now}}else{if(a<3){d=c.now}}return d},setTurboMode:function(a){if(a){if(Notifications.currentDelay!=Notifications.options.updateDelayFast){Notifications.currentDelay=Notifications.options.updateDelayFast;Notifications.update()}}else{Notifications.currentDelay=Notifications.options.updateDelay}},_updateItemTime:function(h,c){var f=h.find("small.created");var e="";if(f.length>0){var g=parseInt(f.attr("data-created"));var d=c-g;e=Notifications.relativeTime(d,true)}var a=h.attr("data-expires");if(a){a=parseInt(a);if(a>0&&a<=c){h.slideUp("fast",function(){Notifications._remove(h)})}else{if(e.length>0){e+=" / "}var b=Notifications.options.i18n.expires+" "+Notifications.relativeTime(c-a);if(Math.abs(c-a)<10){b=""+b+""}e+=b}}f.html(e)},_updateTime:function(){if(Notifications.timeNow==0){return}Notifications.$list.children("li").each(function(){Notifications._updateItemTime($(this),Notifications.timeNow)})},update:function(){if(Notifications.updating){clearTimeout(Notifications.updateTimeout);Notifications.updateTimeout=setTimeout("Notifications.update()",Notifications.currentDelay);return false}Notifications.updating=true;var c="";var b=Notifications.$list.find("li.removed");b.each(function(){c+=$(this).attr("id")+",";$(this).remove()});var a="./?Notifications=update&time="+Notifications.options.updateLast;if(c.length){a+="&rm="+c}if(Notifications.useSession&&Notifications.options.processKey.length){a+="&processKey="+Notifications.options.processKey+"."+sessionStorage.pwWindowName}$.getJSON(a,function(d){Notifications._update(d);clearTimeout(Notifications.updateTimeout);Notifications.updateTimeout=setTimeout("Notifications.update()",Notifications.currentDelay);Notifications.updating=false})},_update:function(c){var b=parseInt(c.time);var a=false;var g=c.notifications.length;var e=[];if(g>0){Notifications.numEmptyRequests=0}else{Notifications.numEmptyRequests++;if(Notifications.numEmptyRequests>2){Notifications.setTurboMode(false)}}if(b>0){Notifications.timeNow=b}Notifications.options.updateLast=Notifications.timeNow;for(var f=0;f-1){e[e.length]=d}else{Notifications._add(d,!c.runtime);if(d.flagNames.indexOf("annoy")>-1){a=true}}if(d.flagNames.indexOf("no-ghost")<0){Notifications._ghost(d,f)}}if(a&&!Notifications.$menu.hasClass("open")){Notifications.$bug.click()}if(a){window.scrollTo(0,0)}if(!Notifications.$menu.hasClass("open")){Notifications._updateTime()}Notifications._updateBug();if(e.length){for(var f=0;f0){d.addClass(Notifications.options.classError,"slow").removeClass(Notifications.options.classWarning,"slow")}else{if(b>0){d.addClass(Notifications.options.classWarning,"slow").removeClass(Notifications.options.classError,"slow")}else{d.removeClass(Notifications.options.classWarning+" "+Notifications.options.classError,"slow")}}},_updateBugQty:function(b){var c=Notifications.$bug;var d=c.children(".qty");var a=b>99?"99+":b;c.attr("class",c.attr("class").replace(/qty\d+\s*/g,""));c.addClass("qty"+b);d.text(a);if(b==0){c.fadeOut()}else{if(!c.is(":visible")){c.fadeIn()}}c.attr("data-qty",b)},add:function(a){var b=Notifications.runtime.length;a.addClass="runtime";a.runtime=true;Notifications.runtime[b]=a},render:function(){Notifications.renderTimeout=setTimeout(function(){var a=0;var b=0;var c=0;$(Notifications.runtime).each(function(f,e){if(e.flagNames.indexOf("error")!=-1){a++}else{if(e.flagNames.indexOf("warning")!=-1){b++}else{c++}}});var d={qty:Notifications.runtime.length,qtyNew:0,qtyMessage:c,qtyWarning:b,qtyError:a,notifications:Notifications.runtime,runtime:true};Notifications._update(d,true);if(Notifications.$list.find(".NotificationProgress").length>0){Notifications.setTurboMode(true)}},250);Notifications.numRender++},_add:function(a,b){var o=false;var d=false;var j=Notifications.$list.children("#"+a.id);var q=parseInt(a.progress);var m=0;var n=null;if(j.length>0){o=true;b=false;d=j.hasClass("open");var i=j.find(".NotificationProgress");if(i.length>0){m=parseInt(i.text())}n=j.find("small.created");j.empty()}else{j=$("")}j.attr("id",a.id).addClass(Notifications.options.classCommon);if(a.expires>0){j.attr("data-expires",a.expires)}var g=$("").addClass("fa fa-fw fa-"+a.icon);var k=$("").addClass("NotificationTitle").html(a.title);var f=$("").append(k).prepend(" ").prepend(g);var h=$("").addClass(Notifications.options.classContainer).append(f);var l=$("").addClass("NotificationText");var c=$("");var e="";if(q>0){j.prepend(Notifications._progress(k,q,m));if(q<100){j.addClass("NotificationHasProgress","normal")}}if("addClass" in a&&a.addClass.length>0){e=a.addClass;j.addClass(e)}if(n!==null&&n.length){k.append(" ").append(n)}else{if("when" in a&&a.created>0){k.append(" "+a.when+"")}}if(a.flagNames.indexOf("debug")!=-1){j.addClass(Notifications.options.classDebug)}if(a.flagNames.indexOf("error")!=-1){j.addClass(Notifications.options.classError)}else{if(a.flagNames.indexOf("warning")!=-1){j.addClass(Notifications.options.classWarning)}else{if(a.flagNames.indexOf("message")!=-1){j.addClass(Notifications.options.classMessage)}}}if(a.html.length>0){l.html(a.html);var p=$("");k.append(" ").append(p);k.click(function(){if(j.hasClass("open")){j.removeClass("open");l.slideUp("fast").removeClass("open");p.removeClass("fa-chevron-circle-down").addClass("fa-chevron-circle-right")}else{l.slideDown("fast").addClass("open");j.addClass("open");p.removeClass("fa-chevron-circle-right").addClass("fa-chevron-circle-down")}});h.append(l);if(d||a.flagNames.indexOf("open")!=-1){if(!d){k.click()}else{j.addClass("open");l.show().addClass("open")}}}c.on("click",function(){Notifications._remove(j)});f.prepend(c);j.append(h);if(b){j.hide();if(Notifications.options.reverse){Notifications.$list.append(j)}else{Notifications.$list.prepend(j)}j.slideDown().effect("highlight",500)}else{if(o){j.show()}else{Notifications.$list.append(j)}}},_remove:function(b){b.addClass("removed").hide();var a=b.siblings(":visible").length;Notifications._updateBugQty(a);clearTimeout(Notifications.updateTimeout);Notifications.updateTimeout=setTimeout("Notifications.update()",1000)},_progress:function(d,a,c){var b=$("").addClass("NotificationProgress").html(""+a+"%").css("width",c+"%").hide();if(a>c){var e=c==0?Notifications.currentDelay/1.4:1750;var f="linear";if(a==100){e=750;f="swing"}else{if(c==0){f="swing"}}if(a>0&&a<=100){b.show().animate({width:a+"%"},{duration:e,easing:f,complete:function(){if(a>=100){b.fadeOut("slow",function(){d.parents(".NotificationHasProgress").removeClass("NotificationHasProgress","slow")})}}})}else{if(a>=100){if(Notifications.$list.find(".NotificationHasProgress").length==0){Notifications.setTurboMode(false)}}else{b.css("width",a+"%").show()}}b.height("100%")}d.append(" "+a+"%");return b},_ghost:function(d,c){if(d.progress>0&&d.progress<100){return}if(Notifications.$menu.hasClass("open")){return}var g=$('');var i=$("").append(g).append(" "+$(""+d.title+"").text());var h=$("").append(i);var e=Notifications.options.ghostDelay;if(d.flagNames.indexOf("error")>-1){i.addClass(Notifications.options.classError);e=Notifications.options.ghostDelayError}else{if(d.flagNames.indexOf("warning")>-1){i.addClass(Notifications.options.classWarning);e=Notifications.options.ghostDelayError}else{i.addClass(Notifications.options.classMessage)}}Notifications.$ghosts.append(h.hide());Notifications.ghostsActive++;var j=Notifications.options.ghostFadeSpeed;var f=Notifications.options.ghostOpacity;var b=100*c;var a=$(window).height();if(j.length==0){b=200*c}setTimeout(function(){if(j.length>0){h.fadeTo(j,f)}else{h.show().css("opacity",f)}var l=h.offset().top;var k=h.height();if(l+k>(a/2)){Notifications.$ghosts.animate({top:"-="+(k+3)},"fast")}setTimeout(function(){var m=function(){h.addClass("removed");Notifications.ghostsActive--;if(Notifications.ghostsActive==0){Notifications.$ghosts.children("li").remove()}};if(j.length>0){h.fadeTo(j,0.01,m)}else{h.css("opacity",0.01);m()}},e)},b);d.ghostShown=true},clickBug:function(){var a=Notifications.$menu;if(a.hasClass("open")){a.slideUp("fast",function(){a.removeClass("open");Notifications.$bug.removeClass("open");clearTimeout(Notifications.timerTimeout)})}else{if(!a.hasClass("init")){a.prependTo($("body"));a.addClass("init")}a.slideDown("fast",function(){a.addClass("open");Notifications.$bug.addClass("open");Notifications._startTimeUpdater()});Notifications.$ghosts.find("li").hide()}return false},_startTimeUpdater:function(){if(Notifications.timeNow>0){Notifications.timeNow+=1}Notifications._updateTime();Notifications.timerTimeout=setTimeout("Notifications._startTimeUpdater()",1000)},_show:function(d,f,b,c,a){var e={id:0,title:f,from:"",created:0,modified:0,when:"now",href:a,icon:c,flags:0,flagNames:d+" notice",progress:0,html:b,qty:1};Notifications.add(e);if(Notifications.numRender>0){Notifications.render()}},message:function(d,b,c,a){if(typeof b=="undefined"){b=""}if(typeof c=="undefined"){c=Notifications.options.iconMessage}if(typeof a=="undefined"){a=""}Notifications._show("message",d,b,c,a)},warning:function(d,b,c,a){if(typeof b=="undefined"){b=""}if(typeof c=="undefined"){c=Notifications.options.iconWarning}if(typeof a=="undefined"){a=""}Notifications._show("warning",d,b,c,a)},error:function(d,b,c,a){if(typeof b=="undefined"){b=""}if(typeof c=="undefined"){c=Notifications.options.iconError}if(typeof a=="undefined"){a=""}Notifications._show("error",d,b,c,a)},init:function(a){$.extend(Notifications.options,a);Notifications.currentDelay=Notifications.options.updateDelay;Notifications.$menu=$("#NotificationMenu");Notifications.$bug=$("#NotificationBug");Notifications.$list=$("#NotificationList");Notifications.$ghosts=$("#NotificationGhosts");if(!Notifications.$bug.length){return}Notifications.$menu.hide();Notifications.$bug.click(Notifications.clickBug);Notifications.useSession=typeof sessionStorage!="undefined";Notifications.updateTimeout=setTimeout(Notifications.update,Notifications.currentDelay);$("#ProcessPageSearchForm input").dblclick(function(b){Notifications.message("ProcessWire Notifications v"+Notifications.options.version,"Grab a coffee and come and visit us at the ProcessWire support forums.","coffee fa-spin");return false});$(document).on("pw-modal-opened",function(){if(Notifications.$bug.is(":visible")){Notifications.$bug.fadeOut().addClass("hidden-for-modal")}if(Notifications.$menu.is(":visible")){Notifications.$menu.hide().addClass("hidden-for-modal")}}).on("pw-modal-closed",function(){if(Notifications.$bug.hasClass("hidden-for-modal")){Notifications.$bug.fadeIn().removeClass("hidden-for-modal")}if(Notifications.$menu.hasClass("hidden-for-modal")){Notifications.$menu.slideDown().removeClass("hidden-for-modal")}});if(Notifications.useSession&&Notifications.options.processKey.length){if(typeof sessionStorage.pwWindowName=="undefined"||sessionStorage.pwWindowName.indexOf("PW")!==0){sessionStorage.pwWindowName="PW"+Math.floor(Math.random()*65536).toString()+Math.floor(Math.random()*65536).toString()}}}};
\ No newline at end of file
diff --git a/wire/modules/System/SystemNotifications/SystemNotifications.module b/wire/modules/System/SystemNotifications/SystemNotifications.module
index 2e878525..cdc36b56 100644
--- a/wire/modules/System/SystemNotifications/SystemNotifications.module
+++ b/wire/modules/System/SystemNotifications/SystemNotifications.module
@@ -67,6 +67,7 @@ class SystemNotifications extends WireData implements Module {
// hook method to access notifications, in case field name ever needs to change for some reason
$this->addHook('User::notifications', $this, 'hookUserNotifications');
+ $this->set('disabled', false);
}
/**
@@ -291,6 +292,8 @@ class SystemNotifications extends WireData implements Module {
*
*/
public function hookAdminThemeGetExtraMarkup($event) {
+
+ if($this->disabled) return;
$config = $this->wire('config');
$url = $config->urls->SystemNotifications . 'Notifications';
@@ -326,6 +329,17 @@ class SystemNotifications extends WireData implements Module {
}
$options['reverse'] = (bool) ((int) $options['reverse']);
+ // options specified in $config->SystemNotifications
+ $configDefaults = array(
+ 'classMessage' => 'NoticeMessage',
+ 'classWarning' => 'NoticeWarning',
+ 'classError' => 'NoticeError',
+ 'classContainer' => 'container',
+ );
+ $configOptions = $this->wire('config')->SystemNotifications;
+ if(!is_array($configOptions)) $configOptions = array();
+ $options = array_merge($options, $configDefaults, $configOptions);
+
$textdomain = '/wire/core/Functions.php';
$options['i18n'] = array(
'sec' => __('sec', $textdomain),
@@ -436,7 +450,7 @@ class SystemNotifications extends WireData implements Module {
$extras = $event->return;
$extras['body'] .= $out;
- $extras['masthead'] .=
+ $extras['masthead'] .=
"" .
"$qty" .
"" .