diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 235704e..07091c0 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -1515,21 +1515,33 @@ function t($string, array $args = array(), array $options = array()) {
}
/**
- * Replaces placeholders with sanitized values in a string.
+ * Formats a string for HTML display by replacing variable placeholders.
+ *
+ * This function replaces variable placeholders in a string with the requested
+ * values and escapes the values so they can be safely displayed as HTML. It
+ * should be used on any unknown text that is intended to be printed to an HTML
+ * page (especially text that may have come from untrusted users, since in that
+ * case it prevents cross-site scripting and other security problems).
+ *
+ * In most cases, you should use t() rather than this function, since it will
+ * translate the text (on non-English-only sites) in addition to formatting it.
*
* @param $string
* A string containing placeholders.
* @param $args
* An associative array of replacements to make. Occurrences in $string of
- * any key in $args are replaced with the corresponding value, after
- * sanitization. The sanitization function depends on the first character of
- * the key:
- * - !variable: Inserted as is. Use this for text that has already been
- * sanitized.
- * - @variable: Escaped to HTML using check_plain(). Use this for anything
- * displayed on a page on the site.
- * - %variable: Escaped as a placeholder for user-submitted content using
- * drupal_placeholder(), which shows up as emphasized text.
+ * any key in $args are replaced with the corresponding value, after optional
+ * sanitization and formatting. The type of sanitization and formatting
+ * depends on the first character of the key:
+ * - @variable: Escaped to HTML using check_plain(). Use this as the default
+ * choice for anything displayed on a page on the site.
+ * - %variable: Escaped to HTML and formatted using drupal_placeholder(),
+ * which makes it display as emphasized text.
+ * - !variable: Inserted as is, with no sanitization or formatting. Only use
+ * this for text that has already been prepared for HTML display (for
+ * example, user-supplied text that has already been run through
+ * check_plain() previously, or is expected to contain some limited HTML
+ * tags and has already been run through filter_xss() previously).
*
* @see t()
* @ingroup sanitization
diff --git a/core/includes/config.inc b/core/includes/config.inc
index 0011533..d2070fc 100644
--- a/core/includes/config.inc
+++ b/core/includes/config.inc
@@ -2,6 +2,8 @@
use Drupal\Core\Config\Config;
use Drupal\Core\Config\FileStorage;
+use Drupal\Core\Config\Context\AdminContext;
+use Drupal\Core\Config\ContextInterface;
use Drupal\Core\Config\NullStorage;
use Drupal\Core\Config\StorageInterface;
@@ -93,7 +95,7 @@ function config_get_storage_names_with_prefix($prefix = '') {
* @code config('book.admin') @endcode will return a configuration object in
* which the book module can store its administrative settings.
*
- * @param $name
+ * @param string $name
* The name of the configuration object to retrieve. The name corresponds to
* a configuration file. For @code config('book.admin') @endcode, the config
* object returned will contain the contents of book.admin configuration file.
@@ -106,6 +108,21 @@ function config($name) {
}
/**
+ * Sets the context on the configuration object factory.
+ *
+ * @param Drupal\Core\Config\ContextInterface $context
+ * The configuration context to set on the factory.
+ *
+ * @return Drupal\Core\Config\ContextInterface $context
+ * The configuration context that was previously set in the config factory.
+ */
+function config_factory_set_context(ContextInterface $context) {
+ $current_context = drupal_container()->get('config.factory')->getContext();
+ drupal_container()->get('config.factory')->setContext($context);
+ return $current_context;
+}
+
+/**
* Returns a list of differences between configuration storages.
*
* @param Drupal\Core\Config\StorageInterface $source_storage
@@ -247,6 +264,8 @@ function config_import() {
* @todo Add support for other extension types; e.g., themes etc.
*/
function config_import_invoke_owner(array $config_changes, StorageInterface $source_storage, StorageInterface $target_storage) {
+ $target_context = new AdminContext('config.target', $target_storage);
+ $source_context = new AdminContext('config.target', $source_storage);
// Allow modules to take over configuration change operations for
// higher-level configuration data.
// First pass deleted, then new, and lastly changed configuration, in order to
@@ -259,11 +278,11 @@ function config_import_invoke_owner(array $config_changes, StorageInterface $sou
// handle the configuration change.
$handled_by_module = FALSE;
if (module_exists($module) && module_hook($module, 'config_import_' . $op)) {
- $old_config = new Config($name, $target_storage);
+ $old_config = new Config($name, $target_context);
$old_config->load();
$data = $source_storage->read($name);
- $new_config = new Config($name, $target_storage);
+ $new_config = new Config($name, $source_context);
if ($data !== FALSE) {
$new_config->setData($data);
}
diff --git a/core/includes/file.inc b/core/includes/file.inc
index 26dfb64..a991877 100644
--- a/core/includes/file.inc
+++ b/core/includes/file.inc
@@ -157,7 +157,7 @@
* wrappers that are appropriate for particular usage. For example, this returns
* only stream wrappers that use local file storage:
* @code
- * $local_stream_wrappers = file_get_stream_wrappers(STEAM_WRAPPERS_LOCAL);
+ * $local_stream_wrappers = file_get_stream_wrappers(STREAM_WRAPPERS_LOCAL);
* @endcode
*
* The $filter parameter can only filter to types containing a particular flag.
@@ -167,7 +167,7 @@
* array_diff_key() function can be used to help with this. For example, this
* returns only stream wrappers that do not use local file storage:
* @code
- * $remote_stream_wrappers = array_diff_key(file_get_stream_wrappers(STREAM_WRAPPERS_ALL), file_get_stream_wrappers(STEAM_WRAPPERS_LOCAL));
+ * $remote_stream_wrappers = array_diff_key(file_get_stream_wrappers(STREAM_WRAPPERS_ALL), file_get_stream_wrappers(STREAM_WRAPPERS_LOCAL));
* @endcode
*
* @param $filter
@@ -817,6 +817,9 @@ function file_munge_filename($filename, $extensions, $alerts = TRUE) {
// Allow potentially insecure uploads for very savvy users and admin
if (!variable_get('allow_insecure_uploads', 0)) {
+ // Remove any null bytes. See http://php.net/manual/en/security.filesystem.nullbytes.php
+ $filename = str_replace(chr(0), '', $filename);
+
$whitelist = array_unique(explode(' ', trim($extensions)));
// Split the filename up by periods. The first part becomes the basename
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 755c2c1..cafe393 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -327,9 +327,11 @@ function install_begin_request(&$install_state) {
$container->register('event_dispatcher', 'Symfony\Component\EventDispatcher\EventDispatcher');
$container->register('config.storage', 'Drupal\Core\Config\InstallStorage');
- $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory')
+ $container->register('config.context', 'Drupal\Core\Config\Context\ConfigContext')
->addArgument(new Reference('config.storage'))
->addArgument(new Reference('event_dispatcher'));
+ $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory')
+ ->addArgument(new Reference('config.context'));
drupal_container($container);
}
diff --git a/core/lib/Drupal/Core/Config/Config.php b/core/lib/Drupal/Core/Config/Config.php
index 783c6b8..bc33c09 100644
--- a/core/lib/Drupal/Core/Config/Config.php
+++ b/core/lib/Drupal/Core/Config/Config.php
@@ -8,7 +8,6 @@
namespace Drupal\Core\Config;
use Drupal\Component\Utility\NestedArray;
-use Symfony\Component\EventDispatcher\EventDispatcher;
/**
* Defines the default configuration object.
@@ -58,11 +57,11 @@ class Config {
protected $storage;
/**
- * The event dispatcher used to notify subscribers.
+ * The configuration context used for this configuration object.
*
- * @var Symfony\Component\EventDispatcher\EventDispatcher
+ * @var Drupal\Core\Config\ContextInterface
*/
- protected $eventDispatcher;
+ protected $context;
/**
* Whether the config object has already been loaded.
@@ -76,16 +75,13 @@ class Config {
*
* @param string $name
* The name of the configuration object being constructed.
- * @param Drupal\Core\Config\StorageInterface $storage
- * A storage controller object to use for reading and writing the
- * configuration data.
- * @param Symfony\Component\EventDispatcher\EventDispatcher $event_dispatcher
- * The event dispatcher used to notify subscribers.
+ * @param Drupal\Core\Config\ContextInterface $context
+ * The configuration context used for this configuration object.
*/
- public function __construct($name, StorageInterface $storage, EventDispatcher $event_dispatcher = NULL) {
+ public function __construct($name, ContextInterface $context) {
$this->name = $name;
- $this->storage = $storage;
- $this->eventDispatcher = $event_dispatcher ? $event_dispatcher : drupal_container()->get('event_dispatcher');
+ $this->context = $context;
+ $this->storage = $context->getStorage();
}
/**
@@ -432,20 +428,10 @@ public function delete() {
}
/**
- * Retrieve the storage used to load and save this configuration object.
- *
- * @return \Drupal\Core\Config\StorageInterface
- * The configuration storage object.
- */
- public function getStorage() {
- return $this->storage;
- }
-
- /**
* Dispatch a config event.
*/
protected function notify($config_event_name) {
- $this->eventDispatcher->dispatch('config.' . $config_event_name, new ConfigEvent($this));
+ $this->context->notify($config_event_name, $this);
}
/*
diff --git a/core/lib/Drupal/Core/Config/ConfigEvent.php b/core/lib/Drupal/Core/Config/ConfigEvent.php
index aabd1d8..efe6953 100644
--- a/core/lib/Drupal/Core/Config/ConfigEvent.php
+++ b/core/lib/Drupal/Core/Config/ConfigEvent.php
@@ -3,9 +3,9 @@
namespace Drupal\Core\Config;
use Symfony\Component\EventDispatcher\Event;
-use Drupal\Core\Config\Config;
class ConfigEvent extends Event {
+
/**
* Configuration object.
*
@@ -14,10 +14,23 @@ class ConfigEvent extends Event {
protected $config;
/**
- * Constructor.
+ * Configuration context object.
+ *
+ * @var Drupal\Core\Config\ContextInterface
+ */
+ protected $context;
+
+ /**
+ * Constructs a configuration event object.
+ *
+ * @param Drupal\Core\Config\ContextInterface
+ * Configuration context object.
+ * @param Drupal\Core\Config\Config
+ * (optional) Configuration object.
*/
- public function __construct(Config $config) {
+ public function __construct(ContextInterface $context, Config $config = NULL) {
$this->config = $config;
+ $this->context = $context;
}
/**
@@ -26,4 +39,14 @@ public function __construct(Config $config) {
public function getConfig() {
return $this->config;
}
+
+ /**
+ * Get configuration context object.
+ *
+ * @return Drupal\Core\Config\ContextInterface
+ * Configuration context.
+ */
+ public function getContext() {
+ return $this->context;
+ }
}
diff --git a/core/lib/Drupal/Core/Config/ConfigFactory.php b/core/lib/Drupal/Core/Config/ConfigFactory.php
index 00d9773..16fee43 100644
--- a/core/lib/Drupal/Core/Config/ConfigFactory.php
+++ b/core/lib/Drupal/Core/Config/ConfigFactory.php
@@ -7,7 +7,7 @@
namespace Drupal\Core\Config;
-use Symfony\Component\EventDispatcher\EventDispatcher;
+use Drupal\Core\Config\ContextInterface;
/**
* Defines the configuration object factory.
@@ -17,26 +17,20 @@
*
* @see Drupal\Core\Config\Config
*
- * Each configuration object gets a storage controller object injected, which
- * is used for reading and writing the configuration data.
+ * A configuration context is an object containing parameters that will be
+ * available to the configuration plug-ins for them to customize the
+ * configuration data in different ways.
*
* @see Drupal\Core\Config\StorageInterface
*/
class ConfigFactory {
/**
- * A storage controller instance for reading and writing configuration data.
+ * The default configuration context associated with this factory.
*
- * @var Drupal\Core\Config\StorageInterface
+ * @var Drupal\Core\Config\ContextInterface
*/
- protected $storage;
-
- /**
- * An event dispatcher instance to use for configuration events.
- *
- * @var Symfony\Component\EventDispatcher\EventDispatcher
- */
- protected $eventDispatcher;
+ protected $context;
/**
* Cached configuration objects.
@@ -48,33 +42,27 @@ class ConfigFactory {
/**
* Constructs the Config factory.
*
- * @param Drupal\Core\Config\StorageInterface $storage
- * The storage controller object to use for reading and writing
- * configuration data.
- * @param Symfony\Component\EventDispatcher\EventDispatcher
- * An event dispatcher instance to use for configuration events.
+ * @param Drupal\Core\Config\ContextInterface
+ * Configuration context object.
*/
- public function __construct(StorageInterface $storage, EventDispatcher $event_dispatcher) {
- $this->storage = $storage;
- $this->eventDispatcher = $event_dispatcher;
+ public function __construct(ContextInterface $context) {
+ $this->setContext($context);
}
/**
- * Returns a configuration object for a given name.
+ * Returns a configuration object for a given name and context.
*
* @param string $name
* The name of the configuration object to construct.
- *
- * @return Drupal\Core\Config\Config
- * A configuration object with the given $name.
*/
public function get($name) {
- if (isset($this->cache[$name])) {
- return $this->cache[$name];
+ $cache_key = get_class($this->getContext()) . ':' . $name;
+ if (isset($this->cache[$cache_key])) {
+ return $this->cache[$cache_key];
}
- $this->cache[$name] = new Config($name, $this->storage, $this->eventDispatcher);
- return $this->cache[$name]->init();
+ $this->cache[$cache_key] = new Config($name, $this->getContext());
+ return $this->cache[$cache_key]->init();
}
/**
@@ -86,8 +74,9 @@ public function get($name) {
*/
public function reset($name = NULL) {
if ($name) {
- if (isset($this->cache[$name])) {
- $this->cache[$name]->init();
+ $cache_key = get_class($this->getContext()) . ':' . $name;
+ if (isset($this->cache[$cache_key])) {
+ $this->cache[$cache_key]->init();
}
}
else {
@@ -108,14 +97,37 @@ public function reset($name = NULL) {
* @todo D8: Remove after http://drupal.org/node/1865206.
*/
public function rename($old_name, $new_name) {
- if (isset($this->cache[$old_name])) {
- $config = $this->cache[$old_name];
+ $old_cache_key = get_class($this->getContext()) . ':' . $old_name;
+ $new_cache_key = get_class($this->getContext()) . ':' . $new_name;
+ if (isset($this->cache[$old_cache_key])) {
+ $config = $this->cache[$old_cache_key];
// Clone the object into the existing slot.
- $this->cache[$old_name] = clone $config;
+ $this->cache[$old_cache_key] = clone $config;
// Change the object's name and re-initialize it.
$config->setName($new_name)->init();
- $this->cache[$new_name] = $config;
+ $this->cache[$new_cache_key] = $config;
}
}
+
+ /**
+ * Gets the default context for this factory.
+ *
+ * @return Drupal\Core\Config\ContextInterface
+ * A configuration context instance.
+ */
+ public function getContext() {
+ return $this->context;
+ }
+
+ /**
+ * Sets the default context for this factory.
+ *
+ * @param Drupal\Core\Config\ContextInterface $context
+ * Context to use to get the configuration.
+ */
+ public function setContext($context) {
+ $this->context = $context;
+ }
}
+
diff --git a/core/lib/Drupal/Core/Config/Context/AdminContext.php b/core/lib/Drupal/Core/Config/Context/AdminContext.php
new file mode 100644
index 0000000..523c9be
--- /dev/null
+++ b/core/lib/Drupal/Core/Config/Context/AdminContext.php
@@ -0,0 +1,40 @@
+set(self::ADMIN, $name);
+ $this->set($name, TRUE);
+ parent::__construct($storage ?: drupal_container()->get('config.storage'), drupal_container()->get('event_dispatcher'));
+ }
+
+}
\ No newline at end of file
diff --git a/core/lib/Drupal/Core/Config/Context/ConfigContext.php b/core/lib/Drupal/Core/Config/Context/ConfigContext.php
new file mode 100644
index 0000000..6d2dcbe
--- /dev/null
+++ b/core/lib/Drupal/Core/Config/Context/ConfigContext.php
@@ -0,0 +1,84 @@
+storage = $storage;
+ $this->eventDispatcher = $event_dispatcher;
+ // Notify event listeners that a configuration context has been created.
+ $this->notify('context', NULL);
+ }
+
+ /**
+ * Implements Drupal\Core\Config\ContextInterface::getStorage().
+ */
+ public function getStorage() {
+ return $this->storage;
+ }
+
+ /**
+ * Implements Drupal\Core\Config\ContextInterface::notify().
+ */
+ public function notify($config_event_name, Config $config = NULL) {
+ $this->eventDispatcher->dispatch('config.' . $config_event_name, new ConfigEvent($this, $config));
+ }
+
+}
diff --git a/core/lib/Drupal/Core/Config/Context/GlobalContext.php b/core/lib/Drupal/Core/Config/Context/GlobalContext.php
new file mode 100644
index 0000000..4f9dbfb
--- /dev/null
+++ b/core/lib/Drupal/Core/Config/Context/GlobalContext.php
@@ -0,0 +1,33 @@
+data[self::OVERRIDE] = &$conf;
+ parent::__construct($storage, $event_dispatcher);
+ }
+
+}
diff --git a/core/lib/Drupal/Core/Config/Context/ObjectContext.php b/core/lib/Drupal/Core/Config/Context/ObjectContext.php
new file mode 100644
index 0000000..9eaeac1
--- /dev/null
+++ b/core/lib/Drupal/Core/Config/Context/ObjectContext.php
@@ -0,0 +1,42 @@
+set(self::OBJECT, $name);
+ $this->set($name, $object);
+ parent::__construct(drupal_container()->get('config.storage'), drupal_container()->get('event_dispatcher'));
+ }
+}
diff --git a/core/lib/Drupal/Core/Config/ContextInterface.php b/core/lib/Drupal/Core/Config/ContextInterface.php
new file mode 100644
index 0000000..bec640d
--- /dev/null
+++ b/core/lib/Drupal/Core/Config/ContextInterface.php
@@ -0,0 +1,43 @@
+addArgument(new Reference('config.cachedstorage.storage'))
->addArgument(new Reference('cache.config'));
- $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory')
+ $container->register('config.context', 'Drupal\Core\Config\Context\GlobalContext')
->addArgument(new Reference('config.storage'))
- ->addArgument(new Reference('event_dispatcher'))
+ ->addArgument(new Reference('event_dispatcher'));
+ $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory')
+ ->addArgument(new Reference('config.context'))
->addTag('persist');
// Register staging configuration storage.
@@ -214,7 +216,7 @@ public function build(ContainerBuilder $container) {
->addTag('event_subscriber');
$container->register('request_close_subscriber', 'Drupal\Core\EventSubscriber\RequestCloseSubscriber')
->addTag('event_subscriber');
- $container->register('config_global_override_subscriber', 'Drupal\Core\EventSubscriber\ConfigGlobalOverrideSubscriber')
+ $container->register('config_global_override_subscriber', 'Drupal\Core\EventSubscriber\ConfigOverrideSubscriber')
->addTag('event_subscriber');
$container->register('exception_listener', 'Drupal\Core\EventSubscriber\ExceptionListener')
->addTag('event_subscriber')
diff --git a/core/lib/Drupal/Core/EventSubscriber/ConfigGlobalOverrideSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ConfigGlobalOverrideSubscriber.php
deleted file mode 100644
index 6ee6a3d..0000000
--- a/core/lib/Drupal/Core/EventSubscriber/ConfigGlobalOverrideSubscriber.php
+++ /dev/null
@@ -1,39 +0,0 @@
-getConfig();
- if (isset($conf[$config->getName()])) {
- $config->setOverride($conf[$config->getName()]);
- }
- }
-
- /**
- * Implements EventSubscriberInterface::getSubscribedEvents().
- */
- static function getSubscribedEvents() {
- $events['config.init'][] = array('configInit', 30);
- return $events;
- }
-}
diff --git a/core/lib/Drupal/Core/EventSubscriber/ConfigOverrideSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ConfigOverrideSubscriber.php
new file mode 100644
index 0000000..41ca797
--- /dev/null
+++ b/core/lib/Drupal/Core/EventSubscriber/ConfigOverrideSubscriber.php
@@ -0,0 +1,42 @@
+getContext()->get(ConfigContext::OVERRIDE)) {
+ $config = $event->getConfig();
+ if (isset($override[$config->getName()])) {
+ $config->setOverride($override[$config->getName()]);
+ }
+ }
+ }
+
+ /**
+ * Implements EventSubscriberInterface::getSubscribedEvents().
+ */
+ public static function getSubscribedEvents() {
+ $events['config.init'][] = array('configInit', 30);
+ return $events;
+ }
+}
diff --git a/core/modules/config/config.api.php b/core/modules/config/config.api.php
index d845667..28cb90f 100644
--- a/core/modules/config/config.api.php
+++ b/core/modules/config/config.api.php
@@ -124,3 +124,25 @@ function hook_config_import_delete($name, $new_config, $old_config) {
return TRUE;
}
+/**
+ * Deletes configuration upon synchronizing configuration changes.
+ *
+ * This callback is invoked when a new configuration factory is created and
+ * allows a module to take over the synchronization of configuration data.
+ *
+ * Modules should implement this callback if they manage configuration data
+ * (such as image styles, node types, or fields) which needs to be prepared and
+ * passed through module API functions to properly handle a configuration
+ * change.
+ *
+ * @param Drupal\Core\Config\ConfigFactory $factory
+ * A configuration object containing the new configuration data.
+ */
+function hook_config_factory($factory) {
+ if (!$factory->getContext('locale.language')) {
+ // Add user's language when in user's context.
+ if ($account = $factory->getContext('user.account')) {
+ $factory->setContext('locale.language', user_preferred_language($account));
+ }
+ }
+}
diff --git a/core/modules/locale/lib/Drupal/locale/LocaleConfigSubscriber.php b/core/modules/locale/lib/Drupal/locale/LocaleConfigSubscriber.php
index 3d2fd4a..44df486 100644
--- a/core/modules/locale/lib/Drupal/locale/LocaleConfigSubscriber.php
+++ b/core/modules/locale/lib/Drupal/locale/LocaleConfigSubscriber.php
@@ -18,6 +18,23 @@
* $config is always a DrupalConfig object.
*/
class LocaleConfigSubscriber implements EventSubscriberInterface {
+
+ /**
+ * Initialize configuration context with language.
+ *
+ * @param Drupal\Core\Config\ConfigEvent $event
+ * The Event to process.
+ */
+ public function configContext(ConfigEvent $event) {
+ $context = $event->getContext();
+ if (!$context->get('locale.language')) {
+ // Add user's language for user context.
+ if ($account = $context->get('user.account')) {
+ $context->set('locale.language', language_load(user_preferred_langcode($account)));
+ }
+ }
+ }
+
/**
* Override configuration values with localized data.
*
@@ -25,11 +42,13 @@ class LocaleConfigSubscriber implements EventSubscriberInterface {
* The Event to process.
*/
public function configLoad(ConfigEvent $event) {
- $config = $event->getConfig();
- $language = language(LANGUAGE_TYPE_INTERFACE);
- $locale_name = $this->getLocaleConfigName($config->getName(), $language);
- if ($override = $config->getStorage()->read($locale_name)) {
- $config->setOverride($override);
+ $context = $event->getContext();
+ if ($language = $context->get('locale.language')) {
+ $config = $event->getConfig();
+ $locale_name = $this->getLocaleConfigName($config->getName(), $language);
+ if ($override = $context->getStorage()->read($locale_name)) {
+ $config->setOverride($override);
+ }
}
}
@@ -47,6 +66,7 @@ public function getLocaleConfigName($name, $language) {
* Implements EventSubscriberInterface::getSubscribedEvents().
*/
static function getSubscribedEvents() {
+ $events['config.context'][] = array('configContext', 20);
$events['config.load'][] = array('configLoad', 20);
return $events;
}
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index c8ccc37..8cacd80 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -16,6 +16,7 @@
use Drupal\locale\StringDatabaseStorage;
use Drupal\locale\TranslationsStream;
use Drupal\Core\Database\Database;
+use Drupal\Core\Config\ConfigFactory;
/**
* Regular expression pattern used to localize JavaScript strings.
@@ -1306,6 +1307,8 @@ function _locale_rebuild_js($langcode = NULL) {
* Implements hook_language_init().
*/
function locale_language_init() {
+ // Add current language to default configuration context.
+ drupal_container()->get('config.context')->set('locale.language', language(LANGUAGE_TYPE_INTERFACE));
// Add locale helper to configuration subscribers.
drupal_container()->get('event_dispatcher')->addSubscriber(new LocaleConfigSubscriber());
}
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index a5194f7..5aa88bb 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -1378,7 +1378,7 @@ function system_modules_uninstall_submit($form, &$form_state) {
* @see system_settings_form()
*/
function system_site_information_settings($form, &$form_state) {
- $site_config = config('system.site');
+ $site_config = system_config('system.site');
$site_mail = $site_config->get('mail');
if (empty($site_mail)) {
$site_mail = ini_get('sendmail_from');
@@ -1484,7 +1484,7 @@ function system_site_information_settings_validate($form, &$form_state) {
* Form submission handler for system_site_information_settings().
*/
function system_site_information_settings_submit($form, &$form_state) {
- config('system.site')
+ system_config('system.site')
->set('name', $form_state['values']['site_name'])
->set('mail', $form_state['values']['site_mail'])
->set('slogan', $form_state['values']['site_slogan'])
@@ -1524,7 +1524,7 @@ function system_cron_settings($form, &$form_state) {
$form['cron']['cron_safe_threshold'] = array(
'#type' => 'select',
'#title' => t('Run cron every'),
- '#default_value' => config('system.cron')->get('threshold.autorun'),
+ '#default_value' => system_config('system.cron')->get('threshold.autorun'),
'#options' => array(0 => t('Never')) + drupal_map_assoc(array(3600, 10800, 21600, 43200, 86400, 604800), 'format_interval'),
);
@@ -1537,7 +1537,7 @@ function system_cron_settings($form, &$form_state) {
* @ingroup forms
*/
function system_cron_settings_submit($form, &$form_state) {
- config('system.cron')
+ system_config('system.cron')
->set('threshold.autorun', $form_state['values']['cron_safe_threshold'])
->save();
}
@@ -1569,7 +1569,7 @@ function system_logging_settings($form, &$form_state) {
$form['error_level'] = array(
'#type' => 'radios',
'#title' => t('Error messages to display'),
- '#default_value' => config('system.logging')->get('error_level'),
+ '#default_value' => system_config('system.logging')->get('error_level'),
'#options' => array(
ERROR_REPORTING_HIDE => t('None'),
ERROR_REPORTING_DISPLAY_SOME => t('Errors and warnings'),
@@ -1588,7 +1588,7 @@ function system_logging_settings($form, &$form_state) {
* @ingroup forms
*/
function system_logging_settings_submit($form, &$form_state) {
- config('system.logging')
+ system_config('system.logging')
->set('error_level', $form_state['values']['error_level'])
->save();
}
@@ -1601,7 +1601,7 @@ function system_logging_settings_submit($form, &$form_state) {
*/
function system_performance_settings($form, &$form_state) {
drupal_add_library('system', 'drupal.system');
- $config = config('system.performance');
+ $config = system_config('system.performance');
$form['clear_cache'] = array(
'#type' => 'details',
@@ -1690,7 +1690,7 @@ function system_performance_settings($form, &$form_state) {
* @ingroup forms
*/
function system_performance_settings_submit($form, &$form_state) {
- $config = config('system.performance');
+ $config = system_config('system.performance');
$config->set('cache.page.enabled', $form_state['values']['cache']);
$config->set('cache.page.max_age', $form_state['values']['page_cache_maximum_age']);
$config->set('response.gzip', $form_state['values']['page_compression']);
@@ -1815,7 +1815,7 @@ function system_image_toolkit_settings() {
* @ingroup forms
*/
function system_rss_feeds_settings($form, &$form_state) {
- $rss_config = config('system.rss');
+ $rss_config = system_config('system.rss');
$form['feed_description'] = array(
'#type' => 'textarea',
'#title' => t('Feed description'),
@@ -1850,7 +1850,7 @@ function system_rss_feeds_settings($form, &$form_state) {
* @ingroup forms
*/
function system_rss_feeds_settings_submit($form, &$form_state) {
- config('system.rss')
+ system_config('system.rss')
->set('channel.description', $form_state['values']['feed_description'])
->set('items.limit', $form_state['values']['feed_default_items'])
->set('items.view_mode', $form_state['values']['feed_item_length'])
@@ -1970,7 +1970,7 @@ function system_regional_settings_submit($form, &$form_state) {
* @see system_site_maintenance_mode_submit()
*/
function system_site_maintenance_mode($form, &$form_state) {
- $config = config('system.maintenance');
+ $config = system_config('system.maintenance');
$form['maintenance_mode'] = array(
'#type' => 'checkbox',
'#title' => t('Put site into maintenance mode'),
@@ -1992,7 +1992,7 @@ function system_site_maintenance_mode($form, &$form_state) {
* @ingroup forms
*/
function system_site_maintenance_mode_submit($form, &$form_state) {
- config('system.maintenance')
+ system_config('system.maintenance')
->set('enabled', $form_state['values']['maintenance_mode'])
->set('message', $form_state['values']['maintenance_mode_message'])
->save();
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index f4e3cad..8c7d72a 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -1765,6 +1765,7 @@ function system_update_8012() {
'site_frontpage' => 'page.front',
'site_403' => 'page.403',
'site_404' => 'page.404',
+ 'drupal_weight_select_max' => 'weight_select_max',
));
}
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 709fd1f..fb686fe 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -7,6 +7,7 @@
use Drupal\Core\Utility\ModuleInfo;
use Drupal\Core\TypedData\Primitive;
+use Drupal\Core\Config\Context\AdminContext;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
@@ -3393,6 +3394,37 @@ function system_admin_compact_page($mode = 'off') {
}
/**
+ * Retrieves a configuration object for administration.
+ *
+ * This configuration object will be created using a special configuration
+ * context (config.admin = TRUE) and configuration plug-ins should mostly keep
+ * hands off it and don't override it.
+ *
+ * This is intended for administration forms or any other case when we need to
+ * get / set the configuration data without any overrides, as oppossed to
+ * regular configuration used for runtime operations that may be altered by
+ * plug-ins depending on other page request parameters:
+ *
+ * To get regular configuration objects for the page request use config()
+ * instead of this function.
+ *
+ * @param $name
+ * The name of the configuration object to retrieve.
+ *
+ * @return Drupal\Core\Config\Config
+ * A configuration object.
+ *
+ * @see config()
+ */
+function system_config($name) {
+ static $context;
+ if (!isset($context)) {
+ $context = new AdminContext('system.config', drupal_container()->get('config.storage'));
+ }
+ return config($name, $context);
+}
+
+/**
* Generate a list of tasks offered by a specified module.
*
* @param $module
diff --git a/core/modules/taxonomy/taxonomy.api.php b/core/modules/taxonomy/taxonomy.api.php
index 99ee4ec..d4d2675 100644
--- a/core/modules/taxonomy/taxonomy.api.php
+++ b/core/modules/taxonomy/taxonomy.api.php
@@ -227,9 +227,9 @@ function hook_taxonomy_term_delete(Drupal\taxonomy\Term $term) {
/**
* Act on a taxonomy term that is being assembled before rendering.
*
- * The module may add elements to $term->content prior to rendering. This hook
- * will be called after hook_view(). The structure of $term->content is a
- * renderable array as expected by drupal_render().
+ * The module may add elements to $term->content prior to rendering. The
+ * structure of $term->content is a renderable array as expected by
+ * drupal_render().
*
* @param $term
* The term that is being assembled for rendering.
diff --git a/core/modules/taxonomy/taxonomy.pages.inc b/core/modules/taxonomy/taxonomy.pages.inc
index 4481e60..fbd29f1 100644
--- a/core/modules/taxonomy/taxonomy.pages.inc
+++ b/core/modules/taxonomy/taxonomy.pages.inc
@@ -35,9 +35,6 @@ function taxonomy_term_page(Term $term) {
drupal_set_breadcrumb($breadcrumb);
drupal_add_feed('taxonomy/term/' . $term->tid . '/feed', 'RSS - ' . $term->label());
- // If there is a menu link to this term, the link becomes the last part
- // of the active trail, and the link name becomes the page title.
- // Thus, we must explicitly set the page title to be the node title.
$uri = $term->uri();
// Set the term path as the canonical URL to prevent duplicate content.
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserSearchTest.php b/core/modules/user/lib/Drupal/user/Tests/UserSearchTest.php
index 74eb5fa..c5239a4 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserSearchTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserSearchTest.php
@@ -24,7 +24,7 @@ class UserSearchTest extends WebTestBase {
public static function getInfo() {
return array(
'name' => 'User search',
- 'description' => 'Testing that only user with the right permission can see the email address in the user search.',
+ 'description' => 'Tests the user search page and verifies that sensitive information is hidden from unauthorized users.',
'group' => 'User',
);
}
@@ -44,6 +44,25 @@ function testUserSearch() {
$edit = array('keys' => $keys);
$this->drupalPost('search/user/', $edit, t('Search'));
$this->assertText($keys);
+
+ // Create a blocked user.
+ $blocked_user = $this->drupalCreateUser();
+ $blocked_user->status = 0;
+ $blocked_user->save();
+
+ // Verify that users with "administer users" permissions can see blocked
+ // accounts in search results.
+ $edit = array('keys' => $blocked_user->name);
+ $this->drupalPost('search/user/', $edit, t('Search'));
+ $this->assertText($blocked_user->name, 'Blocked users are listed on the user search results for users with the "administer users" permission.');
+
+ // Verify that users without "administer users" permissions do not see
+ // blocked accounts in search results.
+ $this->drupalLogin($user1);
+ $edit = array('keys' => $blocked_user->name);
+ $this->drupalPost('search/user/', $edit, t('Search'));
+ $this->assertNoText($blocked_user->name, 'Blocked users are hidden from the user search results.');
+
$this->drupalLogout();
}
}
diff --git a/core/modules/user/lib/Drupal/user/UserConfigContext.php b/core/modules/user/lib/Drupal/user/UserConfigContext.php
new file mode 100644
index 0000000..ec2a89d
--- /dev/null
+++ b/core/modules/user/lib/Drupal/user/UserConfigContext.php
@@ -0,0 +1,28 @@
+extend('Drupal\Core\Database\Query\PagerSelectExtender');
$query->fields('users', array('uid'));
if (user_access('administer users')) {
- // Administrators can also search in the otherwise private email field.
+ // Administrators can also search in the otherwise private email field, and
+ // they don't need to be restricted to only active users.
$query->fields('users', array('mail'));
$query->condition(db_or()->
condition('name', '%' . db_like($keys) . '%', 'LIKE')->
condition('mail', '%' . db_like($keys) . '%', 'LIKE'));
}
else {
- $query->condition('name', '%' . db_like($keys) . '%', 'LIKE');
+ // Regular users can only search via usernames, and we do not show them
+ // blocked accounts.
+ $query->condition('name', '%' . db_like($keys) . '%', 'LIKE')
+ ->condition('status', 1);
}
$uids = $query
->limit(15)
@@ -833,6 +838,18 @@ function user_format_name($account) {
}
/**
+ * Implements hook_config_context_info().
+ */
+function user_config_context_info() {
+ return array(
+ 'user.account' => array(
+ 'title' => t('User account'),
+ 'class' => '\Drupal\user\UserConfigContext',
+ ),
+ );
+}
+
+/**
* Implements hook_template_preprocess_default_variables_alter().
*
* @see user_user_login()
@@ -1911,35 +1928,27 @@ function user_view_multiple($accounts, $view_mode = 'full', $langcode = NULL) {
function user_mail($key, &$message, $params) {
$langcode = $message['langcode'];
$variables = array('user' => $params['account']);
- $message['subject'] .= _user_mail_text($key . '.subject', $langcode, $variables);
- $message['body'][] = _user_mail_text($key . '.body', $langcode, $variables);
-}
-/**
- * Returns a mail string for a variable name.
- *
- * @param string $key
- * The config key that provides the mail text.
- * @param string $langcode
- * (optional) A language code to use to generate the e-mail text.
- * @param array $variables
- * (optional) An array of token keys and values.
- *
- * @return
- * A string value containing the text for the user.mail config key.
- */
-function _user_mail_text($key, $langcode = NULL, $variables = array()) {
+ // Get configuration objects customized for this user, that may be localized
+ // for the user's language if the locale module is enabled.
+ $config_context = config_factory_set_context(new UserConfigContext($params['account']));
+ $mail_config = config('user.mail');
+
// We do not sanitize the token replacement, since the output of this
// replacement is intended for an e-mail message, not a web browser.
- return token_replace(config('user.mail')->get($key), $variables, array('langcode' => $langcode, 'callback' => 'user_mail_tokens', 'sanitize' => FALSE, 'clear' => TRUE));
+ $token_options = array('langcode' => $langcode, 'callback' => 'user_mail_tokens', 'sanitize' => FALSE, 'clear' => TRUE);
+ $message['subject'] .= token_replace($mail_config->get($key . '.subject'), $variables, $token_options);
+ $message['body'][] = token_replace($mail_config->get($key . '.body'), $variables, $token_options);
+
+ // Set the configuration context back to the original.
+ config_factory_set_context($config_context);
}
/**
* Token callback to add unsafe tokens for user mails.
*
- * This function is used by the token_replace() call at the end of
- * _user_mail_text() to set up some additional tokens that can be
- * used in email messages generated by user_mail().
+ * This function is used by the token_replace() to set up some additional
+ * tokens that can be used in email messages generated by user_mail().
*
* @param $replacements
* An associative array variable containing mappings from token names to
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/Feed.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/Feed.php
index 30a413c..9599209 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/display/Feed.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/Feed.php
@@ -2,7 +2,7 @@
/**
* @file
- * Contains Drupal\views\Plugin\views\display\Feed.
+ * Contains \Drupal\views\Plugin\views\display\Feed.
*/
namespace Drupal\views\Plugin\views\display;
@@ -130,7 +130,7 @@ protected function defineOptions() {
$options['displays'] = array('default' => array());
- // Overrides for standard stuff:
+ // Overrides for standard stuff.
$options['style']['contains']['type']['default'] = 'rss';
$options['style']['contains']['options']['default'] = array('description' => '');
$options['sitename_title']['default'] = FALSE;
@@ -261,7 +261,7 @@ public function attachTo(ViewExecutable $clone, $display_id) {
$clone->buildTitle();
$plugin->attach_to($display_id, $this->getPath(), $clone->getTitle());
- // Clean up
+ // Clean up.
$clone->destroy();
unset($clone);
}
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/Page.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/Page.php
index 889a14f..401846f 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/display/Page.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/Page.php
@@ -2,7 +2,7 @@
/**
* @file
- * Contains Drupal\views\Plugin\views\display\Page.
+ * Contains \Drupal\views\Plugin\views\display\Page.
*/
namespace Drupal\views\Plugin\views\display;
@@ -125,7 +125,8 @@ public function optionsSummary(&$categories, &$options) {
'value' => views_ui_truncate($menu_str, 24),
);
- // This adds a 'Settings' link to the style_options setting if the style has options.
+ // This adds a 'Settings' link to the style_options setting if the style
+ // has options.
if ($menu['type'] == 'default tab') {
$options['menu']['setting'] = t('Parent menu item');
$options['menu']['links']['tab_options'] = t('Change settings for the parent menu');
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php
index 5692b7e..8136f38 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php
@@ -2,7 +2,7 @@
/**
* @file
- * Contains Drupal\views\Plugin\views\display\PathPluginBase.
+ * Contains \Drupal\views\Plugin\views\display\PathPluginBase.
*/
namespace Drupal\views\Plugin\views\display;
@@ -11,7 +11,7 @@
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
- * The base display plugin for path/callbacks. This is used for pages, feeds.
+ * The base display plugin for path/callbacks. This is used for pages and feeds.
*/
abstract class PathPluginBase extends DisplayPluginBase {
@@ -38,7 +38,7 @@ protected function defineOptions() {
public function executeHookMenu($callbacks) {
$items = array();
// Replace % with the link to our standard views argument loader
- // views_arg_load -- which lives in views.module
+ // views_arg_load -- which lives in views.module.
$bits = explode('/', $this->getOption('path'));
$page_arguments = array($this->view->storage->name, $this->display['id']);
@@ -64,7 +64,8 @@ public function executeHookMenu($callbacks) {
$access_plugin = drupal_container()->get("plugin.manager.views.access")->createInstance('none');
}
- // Get access callback might return an array of the callback + the dynamic arguments.
+ // Get access callback might return an array of the callback + the dynamic
+ // arguments.
$access_plugin_callback = $access_plugin->get_access_callback();
if (is_array($access_plugin_callback)) {
@@ -95,13 +96,13 @@ public function executeHookMenu($callbacks) {
if ($path) {
$items[$path] = array(
- // default views page entry
+ // Default views page entry.
'page callback' => 'views_page',
'page arguments' => $page_arguments,
- // Default access check (per display)
+ // Default access check (per display).
'access callback' => 'views_access',
'access arguments' => $access_arguments,
- // Identify URL embedded arguments and correlate them to a handler
+ // Identify URL embedded arguments and correlate them to a handler.
'load arguments' => array($this->view->storage->name, $this->display['id'], '%index'),
);
$menu = $this->getOption('menu');
@@ -125,7 +126,7 @@ public function executeHookMenu($callbacks) {
break;
case 'normal':
$items[$path]['type'] = MENU_NORMAL_ITEM;
- // Insert item into the proper menu
+ // Insert item into the proper menu.
$items[$path]['menu_name'] = $menu['name'];
break;
case 'tab':
@@ -142,7 +143,7 @@ public function executeHookMenu($callbacks) {
$items[$path]['context'] = MENU_CONTEXT_INLINE;
}
- // If this is a 'default' tab, check to see if we have to create teh
+ // If this is a 'default' tab, check to see if we have to create the
// parent menu item.
if ($menu['type'] == 'default tab') {
$tab_options = $this->getOption('tab_options');
@@ -156,13 +157,14 @@ public function executeHookMenu($callbacks) {
if ($bit != '%views_arg' && !empty($bits)) {
$default_path = implode('/', $bits);
$items[$default_path] = array(
- // default views page entry
+ // Default views page entry.
'page callback' => 'views_page',
'page arguments' => $page_arguments,
- // Default access check (per display)
+ // Default access check (per display).
'access callback' => 'views_access',
'access arguments' => $access_arguments,
- // Identify URL embedded arguments and correlate them to a handler
+ // Identify URL embedded arguments and correlate them to a
+ // handler.
'load arguments' => array($this->view->storage->name, $this->display['id'], '%index'),
'title' => $tab_options['title'],
'description' => $tab_options['description'],
@@ -236,7 +238,7 @@ public function optionsSummary(&$categories, &$options) {
}
/**
- * Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::buildOptionsForm()..
+ * Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::buildOptionsForm().
*/
public function buildOptionsForm(&$form, &$form_state) {
parent::buildOptionsForm($form, $form_state);
diff --git a/core/modules/views/lib/Drupal/views/Tests/UI/HandlerTest.php b/core/modules/views/lib/Drupal/views/Tests/UI/HandlerTest.php
index 7793608..5fcb017 100644
--- a/core/modules/views/lib/Drupal/views/Tests/UI/HandlerTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/UI/HandlerTest.php
@@ -2,7 +2,7 @@
/**
* @file
- * Contains Drupal\views\Tests\UI\HandlerTest.
+ * Contains \Drupal\views\Tests\UI\HandlerTest.
*/
namespace Drupal\views\Tests\UI;
diff --git a/core/modules/views/views_ui/css/views-admin.contextual.css b/core/modules/views/views_ui/css/views-admin.contextual.css
index 0497a56..fe9b546 100644
--- a/core/modules/views/views_ui/css/views-admin.contextual.css
+++ b/core/modules/views/views_ui/css/views-admin.contextual.css
@@ -49,7 +49,7 @@ ul.contextual-links li span {
}
ul.contextual-links li a {
- color: #666666 !important;
+ color: #666 !important;
margin: 0.25em 0;
padding-left: 1em;
}
diff --git a/core/modules/views/views_ui/css/views-admin.theme.css b/core/modules/views/views_ui/css/views-admin.theme.css
index fd74623..8bf02e5 100644
--- a/core/modules/views/views_ui/css/views-admin.theme.css
+++ b/core/modules/views/views_ui/css/views-admin.theme.css
@@ -49,7 +49,7 @@
url("../images/sprites.png"),
-moz-linear-gradient(
-90deg,
- #ffffff 0,
+ #fff 0,
#e8e8e8 100%);
background-image:
url("../images/sprites.png"),
@@ -64,10 +64,10 @@
url("../images/sprites.png"),
-webkit-linear-gradient(
-90deg,
- #ffffff 0,
+ #fff 0,
#e8e8e8 100%);
background-repeat: no-repeat, repeat-y;
- border: 1px solid #dddddd;
+ border: 1px solid #ddd;
border-radius: 4px;
-moz-box-shadow: 0 0 0 rgba(0,0,0,0.3333) inset;
-webkit-box-shadow: 0 0 0 rgba(0,0,0,0.3333) inset;
@@ -404,13 +404,13 @@ td.group-title {
/* @group Attachments */
.views-displays {
- border: 1px solid #CCC;
+ border: 1px solid #ccc;
padding-bottom: 36px;
}
.views-display-top {
background-color: #e1e2dc;
- border-bottom: 1px solid #CCCCCC;
+ border-bottom: 1px solid #ccc;
padding: 8px 8px 8px; /* LTR */
position: relative;
}
@@ -464,7 +464,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{
*/
.views-displays ul.secondary li.active a.active.error,
.views-displays .secondary a.error {
- border: 2px solid #ED541D;
+ border: 2px solid #ed541d;
padding: 1px 6px;
}
@@ -473,14 +473,14 @@ ul#views-display-menu-tabs li.add ul.action-list li{
}
.views-displays ul.secondary li a {
- background-color: #ffffff;
+ background-color: #fff;
}
.views-displays ul.secondary li a:hover,
.views-displays ul.secondary li.active a,
.views-displays ul.secondary li.active a.active {
- background-color: #555555;
- color: #ffffff;
+ background-color: #555;
+ color: #fff;
}
.views-displays .secondary .open > a {
@@ -521,7 +521,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{
}
.views-displays .secondary .action-list li:hover {
- background-color: #dddddd;
+ background-color: #ddd;
}
/* @end */
@@ -539,9 +539,9 @@ ul#views-display-menu-tabs li.add ul.action-list li{
}
#edit-display-settings-top {
- border: 1px solid #F3F3F3;
+ border: 1px solid #f3f3f3;
line-height: 20px;
- margin: 0;
+ margin: 0 0 15px 0;
padding-top: 4px;
padding-bottom: 4px;
position: relative;
@@ -551,10 +551,6 @@ ul#views-display-menu-tabs li.add ul.action-list li{
margin-top: 12px;
}
-#edit-display-settings-main {
- margin-top: 15px;
-}
-
/* @end */
/* @group Attachment columns
@@ -563,7 +559,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{
*/
.views-display-column {
- border: 1px solid #F3F3F3;
+ border: 1px solid #f3f3f3;
}
.views-display-column + .views-display-column {
@@ -577,11 +573,6 @@ ul#views-display-menu-tabs li.add ul.action-list li{
* The auto-preview checkbox line.
*/
-#views-ui-preview-form > div > div,
-#views-ui-preview-form > div > input {
- float: left;
-}
-
#views-ui-preview-form .form-type-checkbox {
margin-top: 2px;
margin-left: 2px;
@@ -608,6 +599,17 @@ ul#views-display-menu-tabs li.add ul.action-list li{
margin-right: 0.75em;
}
+.form-item-live-preview,
+.form-item-view-args,
+#preview-submit-wrapper {
+ display: inline-block;
+}
+
+.form-item-live-preview,
+#preview-submit-wrapper {
+ vertical-align: top;
+}
+
@media screen and (min-width:45em) { /* 720px */
#views-ui-preview-form .form-type-textfield .description {
white-space: nowrap;
@@ -700,7 +702,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{
*/
.views-ui-display-tab-bucket .views-display-setting {
- color: #666666;
+ color: #666;
font-size: 12px;
padding-bottom: 2px;
}
@@ -720,6 +722,10 @@ ul#views-display-menu-tabs li.add ul.action-list li{
/* @end */
+.views-edit-view {
+ margin-bottom: 15px;
+}
+
/* @group Preview
*
* The preview controls and the preview pane
@@ -770,8 +776,8 @@ ul#views-display-menu-tabs li.add ul.action-list li{
}
.views-ui-dialog .ui-dialog-titlebar-close {
- background: url("../images/close.png") no-repeat scroll 6px 3px #F3F4EE;
- border-color: #aaaaaa;
+ background: url("../images/close.png") no-repeat scroll 6px 3px #f3f4ee;
+ border-color: #aaa;
border-radius: 0 10px 12px 0;
border-style: solid;
border-width: 1px 1px 1px 0;
@@ -789,17 +795,17 @@ ul#views-display-menu-tabs li.add ul.action-list li{
}
.views-filterable-options .form-type-checkbox {
- border: 1px solid #CCC;
+ border: 1px solid #ccc;
padding: 5px 8px;
border-top: none;
}
.views-filterable-options {
- border-top: 1px solid #CCC;
+ border-top: 1px solid #ccc;
}
.views-filterable-options .even .form-type-checkbox {
- background-color: #F3F4EE;
+ background-color: #f3f4ee;
}
.filterable-option .form-item {
@@ -845,7 +851,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{
.views-ui-dialog #views-ajax-title,
.views-ui-dialog .views-override {
- background-color: #F3F4EE;
+ background-color: #f3f4ee;
}
.views-ui-dialog .views-override {
@@ -877,7 +883,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{
}
.views-ui-dialog .scroll {
- border: 1px solid #CCC;
+ border: 1px solid #ccc;
border-width: 1px 0;
padding: 8px 13px;
}
@@ -887,7 +893,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{
}
.views-ui-dialog .form-buttons {
- background-color: #F3F4EE;
+ background-color: #f3f4ee;
padding: 8px 13px;
}
.views-ui-dialog .form-buttons input {
@@ -903,7 +909,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{
/* @todo Make this a class to be used anywhere there's node types? */
.form-type-checkboxes #edit-options-value,
.form-type-checkboxes #edit-options-validate-options-node-types {
- border-color: #CCCCCC;
+ border-color: #ccc;
border-style: solid;
border-width: 1px;
max-height: 210px;
@@ -922,25 +928,25 @@ ul#views-display-menu-tabs li.add ul.action-list li{
}
#views-ui-rearrange-filter-form tr td[rowspan] {
- border-color: #CDCDCD;
+ border-color: #cdcdcd;
border-style: solid;
border-width: 0 1px 1px 1px;
}
#views-ui-rearrange-filter-form tr[id^="views-row"] {
- border-right: 1px solid #CDCDCD;
+ border-right: 1px solid #cdcdcd;
}
#views-ui-rearrange-filter-form tr[id^="views-row"].even td {
- background-color: #F3F4ED;
+ background-color: #f3f4ed;
}
#views-ui-rearrange-filter-form .views-group-title {
- border-top: 1px solid #CDCDCD;
+ border-top: 1px solid #cdcdcd;
}
#views-ui-rearrange-filter-form .group-empty {
- border-bottom: 1px solid #CDCDCD;
+ border-bottom: 1px solid #cdcdcd;
}
/* @end */
@@ -960,8 +966,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{
/* @group Live preview elements */
#views-preview-wrapper {
- border: 1px solid #CCC;
- border-top: 2px solid #CCC;
+ border: 1px solid #ccc;
padding-bottom: 12px;
padding-top: 12px;
}
@@ -994,7 +999,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{
}
#views-live-preview .preview-section {
- border: 1px dashed #DEDEDE;
+ border: 1px dashed #dedede;
margin: 0 -5px;
padding: 3px 5px;
}
@@ -1012,7 +1017,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{
.views-query-info table {
border-collapse: separate;
- border-color: #dddddd;
+ border-color: #ddd;
border-spacing: 0;
margin: 10px 0;
}
@@ -1023,7 +1028,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{
.views-query-info table th,
.views-query-info table td {
- color: #666666;
+ color: #666;
padding: 4px 10px;
}
diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css
index 4f6691b..1b593ca 100644
--- a/core/themes/seven/style.css
+++ b/core/themes/seven/style.css
@@ -1130,10 +1130,6 @@ details.fieldset-no-legend {
font-size: 1em;
}
-#views-ui-preview-form .form-submit {
- margin-top: 3px;
-}
-
.views-admin input.form-submit,
.views-ui-dialog input.form-submit,
.views-admin a.button,