mirror of
https://github.com/processwire/processwire.git
synced 2025-08-11 17:24:46 +02:00
A couple of other minor updates to Session and FieldtypeModule
This commit is contained in:
@@ -906,8 +906,9 @@ class Session extends Wire implements \IteratorAggregate {
|
||||
if(!$user || !$user instanceof User) {
|
||||
$name = $this->wire('sanitizer')->pageNameUTF8($name);
|
||||
$user = $this->wire('users')->get("name=" . $this->wire('sanitizer')->selectorValue($name));
|
||||
if(!$user || !$user->id) return false;
|
||||
}
|
||||
if(!$user || !$user->id || !$user instanceof User) return false;
|
||||
if($user->isGuest()) return false;
|
||||
$xroles = $this->wire('config')->loginDisabledRoles;
|
||||
if(!is_array($xroles) && !empty($xroles)) $xroles = array($xroles);
|
||||
if($name) {}
|
||||
|
@@ -87,8 +87,12 @@ class FieldtypeModule extends Fieldtype {
|
||||
}
|
||||
if(!$found) continue;
|
||||
if($field->labelField == 'title') {
|
||||
$info = $this->wire('modules')->getModuleInfo($module);
|
||||
$info = $this->wire('modules')->getModuleInfo($module);
|
||||
$label = !empty($info['title']) ? $info['title'] : (string) $module;
|
||||
} else if($field->labelField == 'title-summary') {
|
||||
$info = $this->wire('modules')->getModuleInfoVerbose($module);
|
||||
$label = !empty($info['title']) ? $info['title'] : (string) $module;
|
||||
if(!empty($info['summary'])) $label .= " [span.detail] • " . $info['summary'] . ' [/span]';
|
||||
} else {
|
||||
$label = (string) $module;
|
||||
}
|
||||
@@ -151,8 +155,9 @@ class FieldtypeModule extends Fieldtype {
|
||||
$f = $this->modules->get('InputfieldRadios');
|
||||
$f->label = $this->_('Options Label');
|
||||
$f->attr('name', 'labelField');
|
||||
$f->addOption('', $this->_('Module Class Name'));
|
||||
$f->addOption('title', $this->_('Module Title'));
|
||||
$f->addOption('', $this->_('Name'));
|
||||
$f->addOption('title', $this->_('Title'));
|
||||
$f->addOption('title-summary', $this->_('Title and summary'));
|
||||
$f->attr('value', $field->labelField);
|
||||
$f->columnWidth = 50;
|
||||
$inputfields->add($f);
|
||||
|
Reference in New Issue
Block a user