Skip to content

Commit 6e94287

Browse files
committed
Merge branch 'release/1.0.5'
2 parents 1c27fc4 + 843b890 commit 6e94287

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# v1.0.5
2+
## 04/26/2016
3+
4+
1. [](#bugfix)
5+
* Default to use `.yaml` data files extension. Also check for `.txt`
6+
17
# v1.0.4
28
## 02/18/2016
39

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ form:
6363
- save:
6464
fileprefix: contact-
6565
dateformat: Ymd-His-u
66-
extension: txt
66+
extension: yaml
6767
body: "{% include 'forms/data.txt.twig' %}"
6868
- message: Thank you for your feedback!
6969
---
@@ -137,12 +137,12 @@ By default, the single item view lists all the fields found in the file.
137137
138138
## File extension customization
139139
140-
Usually data is saved in .txt files. You can change that per-type by setting:
140+
Usually data is saved in .yaml files. You can change that per-type by setting:
141141
142142
```yaml
143143
types:
144144
contactform:
145-
file_extension: '.yml'
145+
file_extension: '.txt'
146146
```
147147
148148
## Customize the type name

blueprints.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Data Manager
2-
version: 1.0.4
2+
version: 1.0.5
33
description: Adds an administration panel to visualize the data
44
icon: database
55
author:

data-manager.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,12 @@ public function onPluginsInitialized()
123123
*/
124124
private function getFileContentFromRoute($type, $fileRoute) {
125125

126-
//Single item details
127-
$fileInstance = File::instance(DATA_DIR . $type . '/' . $fileRoute . $this->config->get('plugins.data-manager.types.' . $type . '.file_extension', '.txt'));
126+
//get .yaml file
127+
$fileInstance = File::instance(DATA_DIR . $type . '/' . $fileRoute . $this->config->get('plugins.data-manager.types.' . $type . '.file_extension', '.yaml'));
128+
129+
if (!$fileInstance->content()) { //try using .txt if not found
130+
$fileInstance = File::instance(DATA_DIR . $type . '/' . $fileRoute . $this->config->get('plugins.data-manager.types.' . $type . '.file_extension', '.txt'));
131+
}
128132

129133
if (!$fileInstance->content()) {
130134
//Item not found

languages.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@ en:
55
ITEMS_LIST: Items List
66
ITEMS: Items
77
ITEM_DETAILS: Item Details
8+
9+
fr:
10+
PLUGIN_DATA_MANAGER:
11+
DATA_MANAGER: Gestion des données
12+
DATA_TYPES: Types de données
13+
ITEMS_LIST: Listes des éléments
14+
ITEMS: Éléments
15+
ITEM_DETAILS: Détails de l'élément

0 commit comments

Comments
 (0)