mirror of
https://github.com/processwire/processwire.git
synced 2025-08-11 17:24:46 +02:00
Various minor tweaks/updates and bump version to 3.0.121
This commit is contained in:
@@ -289,7 +289,7 @@ abstract class Inputfield extends WireData implements Module {
|
||||
*/
|
||||
|
||||
/**
|
||||
* Attributes specified for the XHTML output, like class, rows, cols, etc.
|
||||
* Attributes specified for the HTML output, like class, rows, cols, etc.
|
||||
*
|
||||
*/
|
||||
protected $attributes = array();
|
||||
@@ -1218,7 +1218,7 @@ abstract class Inputfield extends WireData implements Module {
|
||||
* @param bool $renderValueMode
|
||||
*
|
||||
*/
|
||||
public function ___renderReadyHook(Inputfield $parent = null, $renderValueMode) { }
|
||||
public function ___renderReadyHook(Inputfield $parent = null, $renderValueMode = false) { }
|
||||
|
||||
/**
|
||||
* This hook was replaced by renderReady
|
||||
|
@@ -35,7 +35,7 @@
|
||||
* @method Page|NullPage add($template, $parent, $name = '', array $values = array()) #pw-group-manipulation
|
||||
* @method int sort(Page $page, $value = false) Set the “sort” value for given $page while adjusting siblings, or re-build sort for its children. #pw-group-manipulation
|
||||
* @method setupNew(Page $page) Setup new page that does not yet exist by populating some fields to it. #pw-internal
|
||||
* @method string setupPageName(Page $page, array $options = []) Determine and populate a name for the given page. #pw-internal
|
||||
* @method string setupPageName(Page $page, array $options = array()) Determine and populate a name for the given page. #pw-internal
|
||||
* @method void insertBefore(Page $page, Page $beforePage) Insert one page as a sibling before another. #pw-advanced
|
||||
* @method void insertAfter(Page $page, Page $afterPage) Insert one page as a sibling after another. #pw-advanced
|
||||
*
|
||||
|
@@ -44,7 +44,7 @@ class ProcessWire extends Wire {
|
||||
* Reversion revision number
|
||||
*
|
||||
*/
|
||||
const versionRevision = 120;
|
||||
const versionRevision = 121;
|
||||
|
||||
/**
|
||||
* Version suffix string (when applicable)
|
||||
|
@@ -77,6 +77,24 @@ class WireCache extends Wire {
|
||||
*
|
||||
*/
|
||||
const dateFormat = 'Y-m-d H:i:s';
|
||||
|
||||
/**
|
||||
* String names of expire constants
|
||||
*
|
||||
* @var array
|
||||
*
|
||||
*/
|
||||
protected $expireNames = array(
|
||||
'now' => self::expireNow,
|
||||
'hour' => self::expireHourly,
|
||||
'hourly' => self::expireHourly,
|
||||
'day' => self::expireDaily,
|
||||
'daily' => self::expireDaily,
|
||||
'week' => self::expireWeekly,
|
||||
'weekly' => self::expireWeekly,
|
||||
'month' => self::expireMonthly,
|
||||
'monthly' => self::expireMonthly,
|
||||
);
|
||||
|
||||
/**
|
||||
* Preloaded cache values, indexed by cache name
|
||||
@@ -508,16 +526,20 @@ class WireCache extends Wire {
|
||||
$expire = time() + self::expireDaily;
|
||||
}
|
||||
|
||||
} else if(is_array($expire)) {
|
||||
} else if(is_array($expire)) {
|
||||
// expire value already prepared by a previous call, just return it
|
||||
if(isset($expire['selector']) && isset($expire['expire'])) {
|
||||
return $expire;
|
||||
}
|
||||
|
||||
} else if(is_string($expire) && isset($this->expireNames[$expire])) {
|
||||
// named expiration constant like "hourly", "daily", etc.
|
||||
$expire = $this->expireNames[$expire];
|
||||
|
||||
} else if(in_array($expire, array(self::expireNever, self::expireSave))) {
|
||||
// good, we'll take it as-is
|
||||
return $expire;
|
||||
|
||||
|
||||
} else if(is_string($expire) && Selectors::stringHasSelector($expire)) {
|
||||
// expire when page matches selector
|
||||
return array(
|
||||
|
@@ -1419,7 +1419,10 @@ function InputfieldImage($) {
|
||||
if(!name.length || typeof value == "undefined") return;
|
||||
if(data[name][property] == value) return; // if already set with same value, exit now
|
||||
data[name][property] = value;
|
||||
$.cookie('InputfieldImage', data);
|
||||
// $.cookie('InputfieldImage', data);
|
||||
$.cookie('InputfieldImage', data, {
|
||||
secure: (window.location.protocol.indexOf("https:") === 0)
|
||||
});
|
||||
cookieData = data;
|
||||
//console.log('setCookieData(' + property + ', ' + value + ')');
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@@ -48,7 +48,7 @@ function initInputfieldPage($this) {
|
||||
s = s.replace(part, '=' + v);
|
||||
s = s.replace(/,\s*/g, '&');
|
||||
if(s.indexOf('_LPID')) s = s.replace(/_LPID[0-9]+/g, '');
|
||||
var url = ProcessWire.config.urls.admin + 'page/search/for?' + s + '&limit=999&get=' + labelFieldName;
|
||||
var url = ProcessWire.config.urls.admin + 'page/search/for?' + s + '&limit=9999&get=' + labelFieldName;
|
||||
if(formatName.length) url += '&format_name=' + formatName;
|
||||
$.getJSON(url, {}, function(data) {
|
||||
//$select.children().remove();
|
||||
|
@@ -1 +1 @@
|
||||
function initInputfieldPage(a){a.find("p.InputfieldPageAddButton a").click(function(){var b=$(this).parent("p").next(".InputfieldPageAddItems");if(b.is(":visible")){b.slideUp("fast").find(":input").val("")}else{b.slideDown("fast").parents(".ui-widget-content").slice(0,1).effect("highlight",{},500)}return false});a.find(".findPagesSelector").each(function(){var i=$(this);var f=i.val();if(f.indexOf("=page.")==-1){return}var j=i.attr("data-label");var k=i.attr("data-formatname");if(!j.length){$labelFieldName="name"}var l=i.parents(".InputfieldPage");var g=$("select#"+l.attr("id").replace(/^wrap_/,""));if(g.length<1){return}var h=f.match(/(=page.[_a-zA-Z0-9]+)/g);for(var e=0;e<h.length;e++){var d=h[e];var c=d.replace("=page.","");var b=$("#Inputfield_"+c);if(b.length<1){return}b.change(function(){var o=f;var m=b.val();if(m==null){g.children().remove();g.change();return}m=m.toString();m=m.replace(/,/g,"|");o=o.replace(d,"="+m);o=o.replace(/,\s*/g,"&");if(o.indexOf("_LPID")){o=o.replace(/_LPID[0-9]+/g,"")}var n=ProcessWire.config.urls.admin+"page/search/for?"+o+"&limit=999&get="+j;if(k.length){n+="&format_name="+k}$.getJSON(n,{},function(s){g.children().addClass("option-tbd");for(e=0;e<s.matches.length;e++){var r=s.matches[e];var t=g.children("[value="+r.id+"]");var q=false;if(t.size()>0){q=t.is(":checked")}t.remove();var p="";if(k.length){p=r[k]}if(!p.length){p=r[j]}if(!p.length){p=r.name}var t=$("<option value='"+r.id+"'>"+p+"</option>");if(q){t.attr("selected","selected")}g.append(t)}$blankOption=$("<option value=''></option>");g.prepend($blankOption);g.children(".option-tbd").remove();g.change()})})}})}$(document).ready(function(){$(".InputfieldPage").each(function(){initInputfieldPage($(this))});$(document).on("reloaded",".InputfieldPage",function(){initInputfieldPage($(this))})});
|
||||
function initInputfieldPage($this){$this.find("p.InputfieldPageAddButton a").click(function(){var $input=$(this).parent("p").next(".InputfieldPageAddItems");if($input.is(":visible"))$input.slideUp("fast").find(":input").val("");else $input.slideDown("fast").parents(".ui-widget-content").slice(0,1).effect("highlight",{},500);return false});$this.find(".findPagesSelector").each(function(){var $t=$(this);var selector=$t.val();if(selector.indexOf("=page.")==-1)return;var labelFieldName=$t.attr("data-label");var formatName=$t.attr("data-formatname");if(!labelFieldName.length)$labelFieldName="name";var $wrap=$t.parents(".InputfieldPage");var $select=$("select#"+$wrap.attr("id").replace(/^wrap_/,""));if($select.length<1)return;var parts=selector.match(/(=page.[_a-zA-Z0-9]+)/g);for(var n=0;n<parts.length;n++){var part=parts[n];var name=part.replace("=page.","");var $inputfield=$("#Inputfield_"+name);if($inputfield.length<1)return;$inputfield.change(function(){var s=selector;var v=$inputfield.val();if(v==null){$select.children().remove();$select.change();return}v=v.toString();v=v.replace(/,/g,"|");s=s.replace(part,"="+v);s=s.replace(/,\s*/g,"&");if(s.indexOf("_LPID"))s=s.replace(/_LPID[0-9]+/g,"");var url=ProcessWire.config.urls.admin+"page/search/for?"+s+"&limit=9999&get="+labelFieldName;if(formatName.length)url+="&format_name="+formatName;$.getJSON(url,{},function(data){$select.children().addClass("option-tbd");for(n=0;n<data.matches.length;n++){var page=data.matches[n];var $option=$select.children("[value="+page.id+"]");var selected=false;if($option.size()>0)selected=$option.is(":checked");$option.remove();var label="";if(formatName.length)label=page[formatName];if(!label.length)label=page[labelFieldName];if(!label.length)label=page.name;var $option=$("<option value='"+page.id+"'>"+label+"</option>");if(selected)$option.attr("selected","selected");$select.append($option)}$blankOption=$("<option value=''></option>");$select.prepend($blankOption);$select.children(".option-tbd").remove();$select.change()})})}})}$(document).ready(function(){$(".InputfieldPage").each(function(){initInputfieldPage($(this))});$(document).on("reloaded",".InputfieldPage",function(){initInputfieldPage($(this))})});
|
@@ -621,7 +621,8 @@ class PagePermissions extends WireData implements Module {
|
||||
$user = $this->wire('user');
|
||||
$listable = true;
|
||||
|
||||
if($user->isSuperuser()) $listable = true;
|
||||
if($page instanceof NullPage) $listable = false;
|
||||
else if($user->isSuperuser()) $listable = true;
|
||||
else if($page instanceof User && $user->hasPermission('user-admin')) $listable = true;
|
||||
else if($page->hasStatus(Page::statusUnpublished) && !$page->editable()) $listable = false;
|
||||
else if($page->process && !$this->processViewable($page)) $listable = false;
|
||||
|
Reference in New Issue
Block a user