* Provide structure for the administrative interface to Views.
*/
-use Drupal\Component\Utility\Unicode;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
use Drupal\views\ViewExecutable;
// Render title for the admin preview.
if (!empty($view->live_preview)) {
$variables['title'] = [
- '#markup' => $view->getTitle()
+ '#markup' => $view->getTitle(),
];
}
}
}
+/**
+ * Implements hook_theme_suggestions_HOOK().
+ */
+function views_ui_theme_suggestions_views_ui_view_preview_section(array $variables) {
+ return ['views_ui_view_preview_section__' . $variables['section']];
+}
+
/**
* Returns contextual links for each handler of a certain section.
*
* This is often used in the UI to ensure long strings fit.
*/
function views_ui_truncate($string, $length) {
- if (Unicode::strlen($string) > $length) {
- $string = Unicode::substr($string, 0, $length);
+ if (mb_strlen($string) > $length) {
+ $string = mb_substr($string, 0, $length);
$string .= '...';
}