mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-26 07:46:31 +01:00
use base64_encode filter rather than function
This commit is contained in:
@@ -37,18 +37,18 @@
|
||||
{% set blueprint_name = type ~ '/' ~ blueprint_name %}
|
||||
{% set real_path = (value.thumb ?? global.context.media[path].relativePath ?? global.form.getPagePathFromToken(path) ?? global.admin.getPagePathFromToken(path))|ltrim('/') %}
|
||||
{% endif %}
|
||||
{% set blueprint = base64_encode(blueprint_name) %}
|
||||
{% set blueprint = blueprint_name|base64_encode %}
|
||||
|
||||
|
||||
{% set remove = global.file_task_remove ? global.file_url_remove : uri.addNonce(
|
||||
global.file_url_remove ~
|
||||
'/media.json' ~
|
||||
'/task' ~ config.system.param_sep ~ 'removeFileFromBlueprint' ~
|
||||
'/proute' ~ config.system.param_sep ~ base64_encode(route) ~
|
||||
'/proute' ~ config.system.param_sep ~ (route|base64_encode) ~
|
||||
'/blueprint' ~ config.system.param_sep ~ blueprint ~
|
||||
'/type' ~ config.system.param_sep ~ type ~
|
||||
'/field' ~ config.system.param_sep ~ files.name ~
|
||||
'/path' ~ config.system.param_sep ~ base64_encode(value.path), 'admin-form', 'admin-nonce') %}
|
||||
'/path' ~ config.system.param_sep ~ (value.path|base64_encode), 'admin-form', 'admin-nonce') %}
|
||||
|
||||
{% set file = value|merge({remove: remove, path: value.thumb_url ?? (uri.rootUrl == '/' ? '/' : uri.rootUrl ~ '/' ~ real_path) }) %}
|
||||
<div class="hidden" data-file="{{ file|json_encode|e('html_attr') }}"></div>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
{% if the_file.exists and the_file.display() is not empty %}
|
||||
<div class="card-item">
|
||||
<div class="admin-media-details">
|
||||
<a href="{% if is_modal %}#{% else %}{{ admin_route('/media-manager/' ~ base64_encode(the_file.filepath)) }}{% endif %}" class="js__media-element" data-file-url="{{ file.page_route ~ '/' ~ file.title }}">
|
||||
<a href="{% if is_modal %}#{% else %}{{ admin_route('/media-manager/' ~ the_file.filepath|base64_encode) }}{% endif %}" class="js__media-element" data-file-url="{{ file.page_route ~ '/' ~ file.title }}">
|
||||
{% set thumbnail = the_file.display(the_file.extension == 'svg' ? 'source' : 'thumbnail') %}
|
||||
{% if thumbnail %}
|
||||
<img src="{{thumbnail.cropZoom(250, 250).url}}" />
|
||||
|
||||
Reference in New Issue
Block a user