1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-30 18:09:56 +02:00

Various minor adjustments

This commit is contained in:
Ryan Cramer
2017-11-16 10:49:26 -05:00
parent 221a15a653
commit 58eb0c3159
5 changed files with 17 additions and 5 deletions

View File

@@ -205,7 +205,10 @@ DirectoryIndex index.php index.html index.htm
# Both of these lines are optional, but can help to reduce server load. However, they # Both of these lines are optional, but can help to reduce server load. However, they
# are not compatible with the $config->pagefileSecure option (if enabled) and they # are not compatible with the $config->pagefileSecure option (if enabled) and they
# may produce an Apache 404 rather than your regular 404. You may uncomment the two lines # may produce an Apache 404 rather than your regular 404. You may uncomment the two lines
# below if you don't need to use the $config->pagefileSecure option. # below if you don't need to use the $config->pagefileSecure option. After uncommenting, test
# a URL like domain.com/site/assets/files/test.jpg to make sure you are getting a 404 and not
# your homepage. If getting your homepage, then either: do not use this option, or comment out
# section #2 above that makes ProcessWire the 404 handler.
# ----------------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------------
# RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|ico)$ [NC] # RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|ico)$ [NC]

View File

@@ -277,7 +277,7 @@ abstract class AdminTheme extends WireData implements Module {
try { try {
$field->save(); $field->save();
} catch(\Exception $e) { } catch(\Exception $e) {
$this->error("Error creating 'admin_theme' field: " . $e->getMessage()); // $this->error("Error creating 'admin_theme' field: " . $e->getMessage());
} }
} }

View File

@@ -1450,7 +1450,9 @@ class Page extends WireData implements \Countable, WireMatchable {
if($field && count($parts) < 2) { if($field && count($parts) < 2) {
// this is a field that will provide its own formatted value // this is a field that will provide its own formatted value
$subname = count($parts) == 1 ? array_shift($parts) : ''; $subname = count($parts) == 1 ? array_shift($parts) : '';
if(!$this->wire($subname)) $value = $field->type->markupValue($this, $field, $value, $subname); if(!$subname || !$this->wire($subname)) {
$value = $field->type->markupValue($this, $field, $value, $subname);
}
} }
} while(is_object($value) && count($parts)); } while(is_object($value) && count($parts));

View File

@@ -201,7 +201,7 @@ class InputfieldPassword extends InputfieldText {
$failIcon = "<i class='fa fa-fw fa-frown-o'></i>"; $failIcon = "<i class='fa fa-fw fa-frown-o'></i>";
$okIcon = "<i class='fa fa-fw fa-meh-o'></i>"; $okIcon = "<i class='fa fa-fw fa-meh-o'></i>";
$goodIcon = "<i class='fa fa-fw fa-smile-o'></i>"; $goodIcon = "<i class='fa fa-fw fa-smile-o'></i>";
$oldPassLabel = $this->_('Old password'); $oldPassLabel = $this->_('Current password');
$newPassLabel = $this->_('New password'); $newPassLabel = $this->_('New password');
$confirmLabel = $this->_('Confirm'); $confirmLabel = $this->_('Confirm');
$name = $this->attr('name'); $name = $this->attr('name');

View File

@@ -296,10 +296,13 @@ class Languages extends PagesType {
if(is_null($language)) { if(is_null($language)) {
// save current user language setting and make current language default // save current user language setting and make current language default
if(!$this->defaultLanguage) return; if(!$this->defaultLanguage) return;
/** @var User $user */
$user = $this->wire('user'); $user = $this->wire('user');
if($user->language->id == $this->defaultLanguage->id) return; // already default if($user->language->id == $this->defaultLanguage->id) return; // already default
$this->savedLanguage = $user->language; $this->savedLanguage = $user->language;
$previouslyChanged = $user->isChanged('language');
$user->language = $this->defaultLanguage; $user->language = $this->defaultLanguage;
if(!$previouslyChanged) $user->untrackChange('language');
} else { } else {
// set what language is the default // set what language is the default
$this->defaultLanguage = $language; $this->defaultLanguage = $language;
@@ -315,7 +318,11 @@ class Languages extends PagesType {
*/ */
public function unsetDefault() { public function unsetDefault() {
if(!$this->savedLanguage || !$this->defaultLanguage) return; if(!$this->savedLanguage || !$this->defaultLanguage) return;
$this->wire('user')->language = $this->savedLanguage; /** @var User $user */
$user = $this->wire('user');
$previouslyChanged = $user->isChanged('language');
$user->language = $this->savedLanguage;
if(!$previouslyChanged) $user->untrackChange('language');
} }
/** /**