Skip to content

Commit ec28d0a

Browse files
committed
Merge branch 'master' of github.com:Fabrik/fabrik
2 parents 3cb9db6 + 024ab64 commit ec28d0a

File tree

74 files changed

+6173
-235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+6173
-235
lines changed

administrator/components/com_fabrik/classes/39/FormField.php

Lines changed: 1092 additions & 0 deletions
Large diffs are not rendered by default.

administrator/components/com_fabrik/config.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@
349349
<option value="2">COM_FABRIK_LABELS_UCWORDS</option>
350350
<option value="3">COM_FABRIK_LABELS_CAPFIRST</option>
351351
<option value="4">COM_FABRIK_LABELS_CAPS</option>
352+
<option value="5">COM_FABRIK_LABELS_LANGUAGESTRING</option>
353+
<option value="6">COM_FABRIK_LABELS_UNCHANGED</option>
352354
</field>
353355
</fieldset>
354356

administrator/components/com_fabrik/controllers/form.php

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function view()
9090
$cache->get($view, 'display', $cacheId);
9191
$contents = ob_get_contents();
9292
ob_end_clean();
93-
Html::addToSessionCacheIds($this->cacheId);
93+
Html::addToSessionCacheIds($cacheId);
9494
$token = JSession::getFormToken();
9595
$search = '#<input type="hidden" name="[0-9a-f]{32}" value="1" />#';
9696
$replacement = '<input type="hidden" name="' . $token . '" value="1" />';
@@ -120,6 +120,7 @@ public function process()
120120
$view->setModel($model, true);
121121
}
122122

123+
$listModel = $model->getListModel();
123124
$model->setId($input->getInt('formid', 0));
124125

125126
$this->isMambot = $input->get('_isMambot', 0);
@@ -132,6 +133,50 @@ public function process()
132133
JSession::checkToken() or die('Invalid Token');
133134
}
134135

136+
/**
137+
* Do some ACL sanity checks. Without this check, if spoof checking is disabled, a form can be submitted
138+
* with no ACL checks being performed. With spoof checking, we do the ACL checks on form load, so can't get the
139+
* token without having access.
140+
*
141+
* Don't bother checking if not recording to database, as no list or list ACLs.
142+
*/
143+
if ($model->recordInDatabase())
144+
{
145+
$aclOK = false;
146+
147+
if ($model->isNewRecord() && $listModel->canAdd())
148+
{
149+
$aclOK = true;
150+
}
151+
else
152+
{
153+
/*
154+
* Need to set up form data here so we can pass it to canEdit(), remembering to
155+
* add encrypted vars, so things like user elements which have ACLs on them get
156+
* included in data for canUserDo() checks. Nay also need to do copyToFromRaw(),
157+
* but leave that until we find a need for it.
158+
*
159+
* Note that canEdit() expects form data as an object, and $formData is an array,
160+
* but the actual canUserDo() helper func it calls with the data will accept either.
161+
*/
162+
$formData = $model->setFormData();
163+
$model->addEncrytedVarsToArray($formData);
164+
165+
if (!$model->isNewRecord() && $listModel->canEdit($formData))
166+
{
167+
$aclOK = true;
168+
}
169+
}
170+
171+
if (!$aclOK)
172+
{
173+
$msg = $model->aclMessage(true);
174+
$this->app->enqueueMessage($msg);
175+
176+
return;
177+
}
178+
}
179+
135180
$validated = $model->validate();
136181

137182
if (!$validated)

administrator/components/com_fabrik/language/de-DE/de-DE.com_fabrik.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ COM_FABRIK_ACCESS_EDITABLE_ELEMENT="Formular (hinzufügen)"
3333
COM_FABRIK_ACCESS_EDITABLE_ELEMENT_DESC="Zugriffsebene, die der Benutzer haben muss, um die <strong>editierbare Version</strong> dieses Elements zu sehen, wenn ein <strong>neuer</strong> Satz hinzugefügt wird."
3434
COM_FABRIK_ACCESS_EDIT_DESC="Zugriffsebene, die der Benutzer haben muss, um Einträge in dieser Liste <strong>editieren</strong> zu dürfen."
3535
COM_FABRIK_ACCESS_VIEW="Ansicht"
36-
COM_FABRIK_ACCESS_VIEWABLE_ELEMENT="Template für Detail-Ansicht"
37-
COM_FABRIK_ACCESS_VIEWABLE_ELEMENT_DESC="Zugriffsebene, die der Benutzer haben muss, um die <strong>readonly</strong> dieses Elements zu sehen. Gilt immer für die Detail-Ansicht</li><li>Gilt auch für die Form-Ansicht, FALLS die Zugriffsebenen 'Form (hinzufügen/editieren)' beschränkt ist </li></ul>"
36+
COM_FABRIK_ACCESS_VIEWABLE_ELEMENT="Detail-Ansicht"
37+
COM_FABRIK_ACCESS_VIEWABLE_ELEMENT_DESC="Zugriffsebene, die der Benutzer haben muss, um die <strong>readonly-Ansicht</strong> dieses Elements zu sehen. Gilt immer für die Detail-Ansicht</li><li>Gilt auch für die Form-Ansicht, FALLS die Zugriffsebenen 'Form (hinzufügen/editieren)' beschränkt ist </li></ul>"
3838
COM_FABRIK_ACCESS_LISTVIEW_LABEL="Listenansicht"
3939
COM_FABRIK_ACCESS_LISTVIEW_DESC="Zugriffsebene, die der Benutzer haben muss, um dieses Element in der <strong>Listenansicht</strong> zu sehen. Listenansicht Einstellungen -> in Liste anzeigen auf JA gesetzt sein."
4040
COM_FABRIK_ACCESS_VIEW_DESC="Zugriffsebene, die der Benutzer haben muss, um die <strong>Liste zu sehen</strong>."

administrator/components/com_fabrik/language/en-GB/en-GB.com_fabrik.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,8 @@ COM_FABRIK_LABELS_LOWERCASE="Lowercase (e.g. user_Name becomes 'user name')"
14711471
COM_FABRIK_LABELS_UCWORDS="Proper name (e.g. user_Name becomes 'User Name')"
14721472
COM_FABRIK_LABELS_CAPFIRST="Capitalize first letter (e.g. user_Name becomes 'User name')"
14731473
COM_FABRIK_LABELS_CAPS="All Caps (e.g. user_name becomes 'USER NAME')"
1474-
1474+
COM_FABRIK_LABELS_LANGUAGESTRING="All Caps and underscores (e.g. 'user name' becomes 'USER_NAME'), usable as language string"
1475+
COM_FABRIK_LABELS_UNCHANGED="Leave mySQL column name (e.g. user_Name remains 'user_Name')"
14751476
COM_FABRIK_SHOW_IN_DASHBOARD_DESC="If turned on, then this will add a link to the list into the Fabrik Admin Quick Icon module"
14761477
COM_FABRIK_SHOW_IN_DASHBOARD_LABEL="Show in module"
14771478
COM_FABRIK_DASHBOARD_ICON_DESC="Link icon,glyphicon or fontawesome class e.g. 'icon-joomla'"

administrator/components/com_fabrik/models/list.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,6 +1493,12 @@ protected function makeElementsFromFields($groupId, $tableName)
14931493
case '4':
14941494
$element->label = strtoupper($element->label);
14951495
break;
1496+
case '5':
1497+
$element->label = strtoupper(str_replace(" ", "_", $element->label));
1498+
break;
1499+
case '6':
1500+
$element->label = FArrayHelper::getValue($elementLabels, $ordering, $label);
1501+
break;
14961502
default:
14971503
break;
14981504
}

components/com_fabrik/layouts/fabrik-bootstrap-grid.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
$d = $displayData;
1212

13-
$span = floor(12 / $d->columns);
13+
// avoid potential divide by 0 if something went wrong and $d->columns is 0 or empty
14+
$span = empty($d->columns) ? 12 : floor(12 / $d->columns);
1415
$i = 0;
1516
$id = is_null($d->spanId) ? '' : ' id="' . $d->spanId . '"';
1617
$grid = array();
4.08 KB
Loading
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
css_dir = "."
2+
sass_dir = "."
3+
images_dir = "."
4+
fonts_dir = "fonts"
5+
relative_assets = true
6+
7+
output_style = :compact
8+
line_comments = false
9+
10+
preferred_syntax = :scss
2 KB
Binary file not shown.

0 commit comments

Comments
 (0)