diff --git a/wire/core/AdminThemeFramework.php b/wire/core/AdminThemeFramework.php index d4049d60..45d0a4e9 100644 --- a/wire/core/AdminThemeFramework.php +++ b/wire/core/AdminThemeFramework.php @@ -301,8 +301,10 @@ abstract class AdminThemeFramework extends AdminTheme { if($this->isSuperuser) return true; - $allow = false; $pageViewable = $p->viewable(); + if(!$pageViewable) return false; + + $allow = false; $numChildren = count($children); if($p->process == 'ProcessPageAdd') { @@ -580,7 +582,7 @@ abstract class AdminThemeFramework extends AdminTheme { */ public function renderNotices($notices, array $options = array()) { - if(!count($notices)) return ''; + // if(!count($notices)) return ''; if($this->isLoggedIn && $this->wire('modules')->isInstalled('SystemNotifications')) { $systemNotifications = $this->wire('modules')->get('SystemNotifications'); @@ -720,7 +722,7 @@ abstract class AdminThemeFramework extends AdminTheme { $f->collapsed = Inputfield::collapsedBlank; if($this->get('useAsLogin')) $f->attr('checked', 'checked'); $inputfields->add($f); - + if($f->attr('checked') && $this->input->requestMethod('GET')) { $class = $this->className(); foreach($this->modules->findByPrefix('AdminTheme') as $name) { diff --git a/wire/core/ProcessWire.php b/wire/core/ProcessWire.php index 79c40f37..2db741a0 100644 --- a/wire/core/ProcessWire.php +++ b/wire/core/ProcessWire.php @@ -45,7 +45,7 @@ class ProcessWire extends Wire { * Reversion revision number * */ - const versionRevision = 76; + const versionRevision = 77; /** * Version suffix string (when applicable) diff --git a/wire/core/WireHooks.php b/wire/core/WireHooks.php index 27c1079e..9e1b0fd9 100644 --- a/wire/core/WireHooks.php +++ b/wire/core/WireHooks.php @@ -769,12 +769,22 @@ class WireHooks { } if(is_null($toObject)) { - if(!is_callable($toMethod) && strpos($toMethod, "\\") === false && __NAMESPACE__) { - $_toMethod = "\\" . __NAMESPACE__ . "\\$toMethod"; - // if(!is_callable($_toMethod)) $_toMethod = "\\$toMethod"; - $toMethod = $_toMethod; + $toMethodCallable = is_callable($toMethod); + if(!$toMethodCallable && strpos($toMethod, "\\") === false && __NAMESPACE__) { + $_toMethod = $toMethod; + $toMethod = "\\" . __NAMESPACE__ . "\\$toMethod"; + $toMethodCallable = is_callable($toMethod); + if(!$toMethodCallable) { + $toMethod = "\\$_toMethod"; + $toMethodCallable = is_callable($toMethod); + } + } + if($toMethodCallable) { + $returnValue = $toMethod($event); + } else { + // hook fail, not callable + $returnValue = null; } - $toMethod($event); } else { /** @var Wire $toObject */ if($hook['toPublic']) { @@ -784,11 +794,17 @@ class WireHooks { // protected or private $returnValue = $toObject->_callMethod($toMethod, array($event)); } - // @todo allow for use of $returnValue as alternative to $event->return - if($returnValue) {} + $toMethodCallable = true; + } + + if($returnValue !== null) { + // hook method/func had an explicit return statement with a value + // allow for use of $returnValue as alternative to $event->return? } if($profilerEvent) $profiler->stop($profilerEvent); + + if(!$toMethodCallable) continue; $result['numHooksRun']++; diff --git a/wire/modules/Jquery/JqueryUI/panel.js b/wire/modules/Jquery/JqueryUI/panel.js index da391b52..6a2733f3 100644 --- a/wire/modules/Jquery/JqueryUI/panel.js +++ b/wire/modules/Jquery/JqueryUI/panel.js @@ -222,7 +222,9 @@ var pwPanels = { } if(typeof text != "undefined" && text.length) { - $btn.children('.ui-button-text').text(text); + var $btnText = $btn.children('.ui-button-text'); + var $text = $("").text(text); + $btnText.html('' + $text.text() + ''); $btn.addClass('pw-panel-button-text'); btnExtraPx = 7; //$btn.css(btnPos, (-1 * ($btn.height() + 7)) + 'px'); diff --git a/wire/modules/Jquery/JqueryUI/panel.min.js b/wire/modules/Jquery/JqueryUI/panel.min.js index 76ecf3c2..b435bd22 100644 --- a/wire/modules/Jquery/JqueryUI/panel.min.js +++ b/wire/modules/Jquery/JqueryUI/panel.min.js @@ -1 +1 @@ -var pwPanels={qty:0,init:function(){var a=window.location.href;if(a.indexOf("pw_panel=1")>-1){$(document).on("mouseover","a",function(){var b=$(this);var c=b.attr("target");if(typeof c=="undefined"||c.length==0){b.attr("target","_parent")}})}else{if(a.indexOf("pw_panel=2")>-1){}else{$(".pw-panel").each(function(){var b=$(this);pwPanels.addPanel(b)})}}},addPanel:function(a){var i=a.attr("data-href");var f=a.attr("data-panel-id");var b="pw-panel-container-"+(++pwPanels.qty);if(typeof i=="undefined"||!i.length){i=a.attr("href")}if(typeof i!="undefined"&&i.length){var d="";if(i.indexOf("#")>-1){var c=i.split("#");i=c[0];d="#"+c[1]}i+=(i.indexOf("?")>-1?"&":"?")+"modal=panel&pw_panel=";if(a!==null&&a.hasClass("pw-panel-links")){i+="2"}else{i+="1"}i+=d}var e=$("").attr("class","pw-panel-icon fa fa-angle-double-left");var g=$("").attr("class","ui-button-text").append(e);var h=$("").attr("class","pw-panel-button pw-panel-button-closed ui-button ui-state-default").attr("href",i).on("click",pwPanels.buttonClickEvent).on("mouseover",pwPanels.buttonMouseoverEvent).on("mouseut",pwPanels.buttonMouseoutEvent).append(g);var j=$("
").attr("id",b).attr("class","pw-panel-container pw-panel-container-closed").append(h);$("body").append(j);if(typeof f!="undefined"&&f.length){$("#"+f).hide().addClass("pw-panel-element");j.addClass("pw-panel-container-element").attr("data-panel-id",f)}if(a!==null){pwPanels.initToggler(a,h,j)}else{j.addClass("pw-panel-left")}},initToggler:function(b,j,l){var e=b.hasClass("pw-panel-right")?"right":"left";var k=b.attr("data-tab-text");var h=b.attr("data-tab-icon");var f=b.attr("data-tab-offset");var a=b.attr("data-panel-width");var d=e=="right"?"left":"right";var c=1;l.addClass("pw-panel-tab pw-panel-"+e);l.attr("data-href",j.attr("href"));if(b.hasClass("pw-panel-reload")){l.addClass("pw-panel-reload")}if(typeof f!="undefined"){f=parseInt(f);if(f>-1){j.css("top",f+"px")}else{j.css("top","auto");j.css("bottom",Math.abs(f)+"px")}}if(typeof k!="undefined"&&k.length){j.children(".ui-button-text").text(k);j.addClass("pw-panel-button-text");c=7}if(typeof h!="undefined"&&h.length){var g=$("").addClass("fa fa-fw fa-"+h);var i=j.children(".ui-button-text");if(j.hasClass("pw-panel-button-text")){i.prepend(g)}else{i.empty().append(g);j.css(d,(-1*(j.outerWidth()))+"px")}}if(typeof a!="undefined"&&a.length){l.css("width",a);l.css(e,"-"+a)}if(e=="right"){}else{j.css("right",(-1*(c+j.height()))+"px")}if(!b.hasClass("pw-panel-tab")){j.addClass("pw-panel-button-hidden")}b.click(function(){j.click();return false}).on("mouseover",function(){j.mouseover()}).on("mouseout",function(){j.mouseout()})},initPanelContent:function(d){var b=d.find(".pw-panel-content");var a=d.attr("data-panel-id");if(b.length){return b}else{if(typeof a!="undefined"){var c=$("#"+a);if(c.length){b=$("").addClass("pw-panel-content").css("overflow","auto");d.append(b);b.append(c);c.show();c.trigger("pw-panel-init")}}else{b=$("").addClass("pw-panel-content").attr("src",d.attr("data-href"));d.append(b)}}return b},windowResizeEvent:function(){$(".pw-panel-container-init").each(function(){var c=$(this);if(c.hasClass("pw-panel-container-open")){return}var b=c.width();var a=(-1*b)+"px";if(c.hasClass("pw-panel-right")){c.css("right",a)}else{c.css("left",a)}})},buttonClickEvent:function(){var i=$(this);var k=i.closest(".pw-panel-container");var f=k.find(".pw-panel-content");var b=k.hasClass("pw-panel-container-open");var c=k.hasClass("pw-panel-container-loaded");var a=k.width();var e=k.hasClass("pw-panel-right")?"right":"left";var h=typeof jQuery.ui!="undefined";function d(){k.toggleClass("pw-panel-container-open pw-panel-container-closed");i.toggleClass("pw-panel-button-open pw-panel-button-closed")}if($(".pw-panel-container-init").length==0){$(window).resize(pwPanels.windowResizeEvent)}if(b){var j=(-1*a)+"px";if(h){if(e=="left"){k.animate({left:j},150,d)}else{k.animate({right:j},150,d)}}else{k.css(e,j);d()}$("body").css("overflow","");$("#pw-panel-shade").fadeOut("fast",function(){$(this).remove()});i.fadeOut("fast",function(){i.removeClass("ui-state-active");i.fadeIn("fast")});if(h&&e=="left"){k.resizable("destroy")}if(k.hasClass("pw-panel-reload")){k.find("iframe.pw-panel-content").remove()}}else{if(k.hasClass("pw-panel-reload")||!c){pwPanels.initPanelContent(k)}if(h){if(e=="left"){k.animate({left:0},150,d)}else{k.animate({right:0},150,d)}}else{k.css(e,0);d()}var g=$("