-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxls_serialization__1_3_version_with_drupal_8_support.patch
144 lines (141 loc) · 4.38 KB
/
xls_serialization__1_3_version_with_drupal_8_support.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
diff --git a/composer.json b/composer.json
index f223e0e..fec7996 100644
--- a/composer.json
+++ b/composer.json
@@ -2,8 +2,8 @@
"name": "drupal/xls_serialization",
"description": "Provides Excel as a serialization format.",
"type": "drupal-module",
- "license": "GPL-2.0+",
+ "license": "GPL-2.0-or-later",
"require": {
- "phpoffice/phpspreadsheet": "^1.0@stable"
+ "phpoffice/phpspreadsheet": "^1.26"
}
}
diff --git a/config/schema/xls_serialization.views.schema.yml b/config/schema/xls_serialization.views.schema.yml
new file mode 100644
index 0000000..deda527
--- /dev/null
+++ b/config/schema/xls_serialization.views.schema.yml
@@ -0,0 +1,64 @@
+# Schema for the views plugins of the Serialization (Excel) module.
+
+views.display.excel_export:
+ type: views.display.rest_export
+ label: 'Excel export display options'
+ mapping:
+ filename:
+ type: string
+ label: 'Filename'
+ header_bold:
+ type: boolean
+ label: 'Header Bold'
+ header_italic:
+ type: boolean
+ label: 'Header Italic'
+ header_background_color:
+ type: string
+ label: 'Header Background Color'
+ header_text_color:
+ type: string
+ label: 'Header Text Color'
+
+views.style.excel_export:
+ type: views.style.serializer
+ label: 'Excel export output format'
+ mapping:
+ xls_settings:
+ type: mapping
+ label: 'XLS(X) settings'
+ mapping:
+ xls_format:
+ type: string
+ label: 'Format'
+ metadata:
+ type: mapping
+ label: 'Document metadata'
+ mapping:
+ creator:
+ type: string
+ label: 'Author/creator name'
+ last_modified_by:
+ type: string
+ label: 'Last modified by'
+ title:
+ type: string
+ label: 'Title'
+ description:
+ type: string
+ label: 'Description'
+ subject:
+ type: string
+ label: 'Subject'
+ keywords:
+ type: string
+ label: 'Keywords'
+ category:
+ type: string
+ label: 'Category'
+ manager:
+ type: string
+ label: 'Manager'
+ company:
+ type: string
+ label: 'Company'
diff --git a/src/Encoder/Xls.php b/src/Encoder/Xls.php
index 6a2567d..8d6187e 100644
--- a/src/Encoder/Xls.php
+++ b/src/Encoder/Xls.php
@@ -50,7 +50,7 @@ class Xls implements EncoderInterface {
/**
* {@inheritdoc}
*/
- public function encode($data, $format, array $context = []) {
+ public function encode($data, $format, array $context = []):string {
switch (gettype($data)) {
case 'array':
// Nothing to do.
@@ -150,7 +150,7 @@ class Xls implements EncoderInterface {
/**
* {@inheritdoc}
*/
- public function supportsEncoding($format) {
+ public function supportsEncoding($format): bool {
return $format === static::$format;
}
diff --git a/src/Plugin/views/style/ExcelExport.php b/src/Plugin/views/style/ExcelExport.php
index fa10cb4..61cac7a 100644
--- a/src/Plugin/views/style/ExcelExport.php
+++ b/src/Plugin/views/style/ExcelExport.php
@@ -41,7 +41,8 @@ class ExcelExport extends Serializer {
parent::__construct($configuration, $plugin_id, $plugin_definition, $serializer, $serializer_formats, $serializer_format_providers);
$this->formats = ['xls', 'xlsx'];
- $this->formatProviders = ['xls' => 'xls_serialization', 'xlsx' => 'xls_serialization'];
+ $this->formatProviders =
+ ['xls' => 'xls_serialization', 'xlsx' => 'xls_serialization'];
}
/**
@@ -162,7 +163,6 @@ class ExcelExport extends Serializer {
*/
public function attachTo(array &$build, $display_id, Url $url, $title) {
// @todo This mostly hard-codes CSV handling. Figure out how to abstract.
-
$url_options = [];
$input = $this->view->getExposedInput();
if ($input) {
diff --git a/xls_serialization.info.yml b/xls_serialization.info.yml
index c86f6f9..1a6a986 100644
--- a/xls_serialization.info.yml
+++ b/xls_serialization.info.yml
@@ -1,8 +1,8 @@
name: 'Serialization (Excel)'
type: module
description: 'Provides Excel (xls) as a serialization format.'
-core: 8.x
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^8.8.0 || ^9.0
package: Web services
dependencies:
+ - drupal:rest
- drupal:serialization