Skip to content

Commit

Permalink
- Improved Document Container module to always display folders withou…
Browse files Browse the repository at this point in the history
…t privacy warnings.

- Added side notes to Content Summary List and Banner modules to clarify handling of retina images.
- Added a checkbox to Newsletter module to exclude recipients without consent from newsletters.
- Fixed an XSS vulnerability in User Forms module.
  • Loading branch information
marcin-szczerba committed May 24, 2018
1 parent 6256a83 commit 91a705c
Show file tree
Hide file tree
Showing 31 changed files with 597 additions and 365 deletions.
6 changes: 3 additions & 3 deletions zenario/admin/db_updates/latest_revision_no.inc.php
Expand Up @@ -27,8 +27,8 @@
*/
if (!defined('NOT_ACCESSED_DIRECTLY')) exit('This file may not be directly accessed');

define('LATEST_REVISION_NO', 45403); //N.b. 8.2 starts at revision #45600
define('LATEST_BIG_CHANGE_REVISION_NO', 45400);
define('LATEST_REVISION_NO', 45404); //N.b. 8.3 starts at revision #45600
define('LATEST_BIG_CHANGE_REVISION_NO', 45404);
define('INSTALLER_REVISION_NO', 41600);
define('INSTALLER_DEFAULT_THEME', 'duke_street');

Expand All @@ -37,6 +37,6 @@
define('ZENARIO_MAJOR_VERSION', '8');
define('ZENARIO_MINOR_VERSION', '2');
define('ZENARIO_IS_BUILD', true);
define('ZENARIO_REVISION', '46436');
define('ZENARIO_REVISION', '46614');

define('TINYMCE_DIR', 'zenario/libs/manually_maintained/lgpl/tinymce_4_7_3/');
1 change: 1 addition & 0 deletions zenario/autoload/datasetAdm.php
Expand Up @@ -261,6 +261,7 @@ public static function listCustomFields($dataset, $flat = true, $filter = false,
[
'group',
'checkbox',
'consent',
'checkboxes',
'date',
'editor',
Expand Down
1 change: 1 addition & 0 deletions zenario/autoload/document.php
Expand Up @@ -128,6 +128,7 @@ public static function createFolder($name, $parentId = false, $makeNameUnqiue =
'type' => 'folder',
'folder_name' => $name,
'folder_id' => $parentId,
'privacy' => 'public',
'ordinal' => 0
]
);
Expand Down
4 changes: 2 additions & 2 deletions zenario/js/panel_type_form_builder.js
Expand Up @@ -475,7 +475,7 @@ methods.loadFieldDetailsPage = function(page, fieldId, errors) {
});
}
} else if (page == 'translations') {
var transFieldNamesList = _.toArray(thus.tuix.field_details.tabs[page].translapagele_fields);
var transFieldNamesList = _.toArray(thus.tuix.field_details.tabs[page].translatable_fields);
var transFieldNames = {};
for (var i = 0; i < transFieldNamesList.length; i++) {
transFieldNames[transFieldNamesList[i]] = true;
Expand Down Expand Up @@ -1619,7 +1619,7 @@ methods.addNewField = function(type, ord, datasetFieldId, datasetPageId, dataset

if (datasetField.db_column == 'terms_and_conditions_accepted') {
newField.field_label = 'By submitting your details you are agreeing that we can store your data for legitimate business purposes and contact you to inform you about our products and services.';
newField.note_to_user = 'Full details can be found in our <a href="#">privacy policy.</a>';
newField.note_to_user = 'Full details can be found in our <a href="privacy" target="_blank">privacy policy</a>.';
}

if (datasetField.dataset_repeat_grouping) {
Expand Down
4 changes: 2 additions & 2 deletions zenario/js/panel_type_form_builder.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions zenario/modules/zenario_banner/fun/formatAdminBox.php
Expand Up @@ -33,6 +33,13 @@
if (!ze\module::inc('zenario_ctype_picture')) {
unset($fields['first_tab/image_source']['values']['_PICTURE']);
}

$retinaSideNote = "If the source image is large enough,
the resized image will be output at twice its displayed width &amp; height
to appear crisp on retina screens.
This will increase the download size.
<br/>
If the source image is not large enough this will have no effect.";


$fields['first_tab/use_rollover']['hidden'] =
Expand Down Expand Up @@ -94,6 +101,11 @@
!$imagePicked;

$this->showHideImageOptions($fields, $values, 'first_tab', $hidden);
if ($values['first_tab/canvas'] != "unlimited") {
$fields['first_tab/canvas']['side_note'] = $retinaSideNote;
} else {
$fields['first_tab/canvas']['side_note'] = "";
}

$fields['first_tab/floating_box_title']['hidden'] =
!$imagePicked
Expand Down Expand Up @@ -164,6 +176,11 @@

$hidden = $values['first_tab/link_type'] != '_ENLARGE_IMAGE';
$this->showHideImageOptions($fields, $values, 'first_tab', $hidden, 'enlarge_');
if ($values['first_tab/enlarge_canvas'] != "unlimited") {
$fields['first_tab/enlarge_canvas']['side_note'] = $retinaSideNote;
} else {
$fields['first_tab/enlarge_canvas']['side_note'] = "";
}

$cID = $cType = false;
if ($values['first_tab/link_type'] == '_CONTENT_ITEM'
Expand Down Expand Up @@ -216,6 +233,11 @@
$fields['mobile_tab/mobile_image']['hidden'] = $hideMobileOptions;

$this->showHideImageOptions($fields, $values, 'mobile_tab', $hideMobileOptions, 'mobile_');
if ($values['mobile_tab/mobile_canvas'] != "unlimited") {
$fields['mobile_tab/mobile_canvas']['side_note'] = $retinaSideNote;
} else {
$fields['mobile_tab/mobile_canvas']['side_note'] = "";
}

//Privacy warning:
//Get selected document...
Expand Down
17 changes: 17 additions & 0 deletions zenario/modules/zenario_content_list/fun/formatAdminBox.php
Expand Up @@ -33,8 +33,20 @@
$fields['each_item/author_retina']['hidden'] =
!$values['each_item/show_author_image'];

$retinaSideNote = "If the source image is large enough,
the resized image will be output at twice its displayed width &amp; height
to appear crisp on retina screens.
This will increase the download size.
<br/>
If the source image is not large enough this will have no effect.";

$hidden = !$values['each_item/show_author_image'];
$this->showHideImageOptions($fields, $values, 'each_item', $hidden, 'author_');
if ($values['each_item/author_canvas'] != "unlimited") {
$fields['each_item/author_canvas']['side_note'] = $retinaSideNote;
} else {
$fields['each_item/author_canvas']['side_note'] = "";
}

$fields['overall_list/heading_if_items']['hidden'] =
$fields['overall_list/heading_tags']['hidden'] =
Expand All @@ -55,6 +67,11 @@

$hidden = !$values['each_item/show_sticky_images'];
$this->showHideImageOptions($fields, $values, 'each_item', $hidden);
if ($values['each_item/canvas'] != "unlimited") {
$fields['each_item/canvas']['side_note'] = $retinaSideNote;
} else {
$fields['each_item/canvas']['side_note'] = "";
}

$fields['each_item/date_format']['hidden'] =
$fields['each_item/show_times']['hidden'] =
Expand Down
Expand Up @@ -447,26 +447,6 @@ plugin_settings:
indent: 2
validation:
required_if_not_hidden: Please choose a default image.
retina:
indent: 1
plugin_setting:
name: retina
label: 'Output a retina image'
type: checkbox
value: ""
side_note: |
<% if (zenarioAB.value('canvas') == 'unlimited') { %>
Halve the width &amp; height at which the image is displayed,
so it appears crisp on retina screens.
<% } else { %>
If the source image is large enough
output the resized image at twice its displayed width &amp; height,
so it appear crisp on retina screens.
This will increase the download size.
<br/>
If the source image is not large enough this will have no effect.
<% } %>
enable_microtemplates_in_properties: true
canvas:
plugin_setting:
name: canvas
Expand Down Expand Up @@ -512,6 +492,16 @@ plugin_settings:
style: 'width: 5em;'
post_field_html: '&nbsp;pixels'
indent: 2
retina:
indent: 2
plugin_setting:
name: retina
label: 'This is a retina image'
type: checkbox
value: ""
side_note: |
Display image at double density.
enable_microtemplates_in_properties: true

show_dates:
plugin_setting:
Expand Down Expand Up @@ -613,21 +603,11 @@ plugin_settings:
indent: 1
plugin_setting:
name: author_retina
label: 'Output a retina image'
label: 'This is a retina image'
type: checkbox
value: ""
side_note: |
<% if (zenarioAB.value('author_canvas') == 'unlimited') { %>
Halve the width &amp; height at which the image is displayed,
so it appears crisp on retina screens.
<% } else { %>
If the source image is large enough
output the resized image at twice its displayed width &amp; height,
so it appear crisp on retina screens.
This will increase the download size.
<br/>
If the source image is not large enough this will have no effect.
<% } %>
Display image at double density.
enable_microtemplates_in_properties: true
show_times:
plugin_setting:
Expand Down
@@ -1,3 +1,4 @@
<div class="hide_in_edit_mode document_container_wrap">
{% if error == false %}

{% if Documents or Download_Archive %}
Expand Down Expand Up @@ -67,4 +68,5 @@
{% if error == 'no_user' %}
<div id="no_user" class="error">You must be an extranet user to see this plugin</div>
{% endif %}
{% endif %}
{% endif %}
</div>
3 changes: 3 additions & 0 deletions zenario/modules/zenario_document_container/module_code.php
Expand Up @@ -131,6 +131,9 @@ private function addToDocuments($document, $isUserDocument = false, $level = 1)
$this->getArchiveDownloadLink($document, array_keys($documents));
}

//Folders should always be public.
$document['privacy'] = "public";

} elseif ($document['type'] == 'file') {
$file = ze\row::get('files', ['filename', 'created_datetime', 'size', 'mime_type', 'privacy'], $document['file_id']);
$document['Document_Created'] = $file['created_datetime'];
Expand Down

0 comments on commit 91a705c

Please sign in to comment.