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
Binary file not shown.
Lines changed: 14 additions & 0 deletions
Loading
1.85 KB
Binary file not shown.
Binary file not shown.
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
@charset 'UTF-8';
2+
/* Slider */
3+
.slick-loading .slick-list
4+
{
5+
background: #fff url('./ajax-loader.gif') center center no-repeat;
6+
}
7+
8+
/* Icons */
9+
@font-face
10+
{
11+
font-family: 'slick';
12+
font-weight: normal;
13+
font-style: normal;
14+
15+
src: url('./fonts/slick.eot');
16+
src: url('./fonts/slick.eot?#iefix') format('embedded-opentype'), url('./fonts/slick.woff') format('woff'), url('./fonts/slick.ttf') format('truetype'), url('./fonts/slick.svg#slick') format('svg');
17+
}
18+
/* Arrows */
19+
.slick-prev,
20+
.slick-next
21+
{
22+
font-size: 0;
23+
line-height: 0;
24+
25+
position: absolute;
26+
top: 50%;
27+
28+
display: block;
29+
30+
width: 20px;
31+
height: 20px;
32+
padding: 0;
33+
-webkit-transform: translate(0, -50%);
34+
-ms-transform: translate(0, -50%);
35+
transform: translate(0, -50%);
36+
37+
cursor: pointer;
38+
39+
color: transparent;
40+
border: none;
41+
outline: none;
42+
background: transparent;
43+
}
44+
.slick-prev:hover,
45+
.slick-prev:focus,
46+
.slick-next:hover,
47+
.slick-next:focus
48+
{
49+
color: transparent;
50+
outline: none;
51+
background: transparent;
52+
}
53+
.slick-prev:hover:before,
54+
.slick-prev:focus:before,
55+
.slick-next:hover:before,
56+
.slick-next:focus:before
57+
{
58+
opacity: 1;
59+
}
60+
.slick-prev.slick-disabled:before,
61+
.slick-next.slick-disabled:before
62+
{
63+
opacity: .25;
64+
}
65+
66+
.slick-prev:before,
67+
.slick-next:before
68+
{
69+
font-family: 'slick';
70+
font-size: 20px;
71+
line-height: 1;
72+
73+
opacity: .75;
74+
color: white;
75+
76+
-webkit-font-smoothing: antialiased;
77+
-moz-osx-font-smoothing: grayscale;
78+
}
79+
80+
.slick-prev
81+
{
82+
left: -25px;
83+
}
84+
[dir='rtl'] .slick-prev
85+
{
86+
right: -25px;
87+
left: auto;
88+
}
89+
.slick-prev:before
90+
{
91+
content: '←';
92+
}
93+
[dir='rtl'] .slick-prev:before
94+
{
95+
content: '→';
96+
}
97+
98+
.slick-next
99+
{
100+
right: -25px;
101+
}
102+
[dir='rtl'] .slick-next
103+
{
104+
right: auto;
105+
left: -25px;
106+
}
107+
.slick-next:before
108+
{
109+
content: '→';
110+
}
111+
[dir='rtl'] .slick-next:before
112+
{
113+
content: '←';
114+
}
115+
116+
/* Dots */
117+
.slick-dotted.slick-slider
118+
{
119+
margin-bottom: 30px;
120+
}
121+
122+
.slick-dots
123+
{
124+
position: absolute;
125+
bottom: -25px;
126+
127+
display: block;
128+
129+
width: 100%;
130+
padding: 0;
131+
margin: 0;
132+
133+
list-style: none;
134+
135+
text-align: center;
136+
}
137+
.slick-dots li
138+
{
139+
position: relative;
140+
141+
display: inline-block;
142+
143+
width: 20px;
144+
height: 20px;
145+
margin: 0 5px;
146+
padding: 0;
147+
148+
cursor: pointer;
149+
}
150+
.slick-dots li button
151+
{
152+
font-size: 0;
153+
line-height: 0;
154+
155+
display: block;
156+
157+
width: 20px;
158+
height: 20px;
159+
padding: 5px;
160+
161+
cursor: pointer;
162+
163+
color: transparent;
164+
border: 0;
165+
outline: none;
166+
background: transparent;
167+
}
168+
.slick-dots li button:hover,
169+
.slick-dots li button:focus
170+
{
171+
outline: none;
172+
}
173+
.slick-dots li button:hover:before,
174+
.slick-dots li button:focus:before
175+
{
176+
opacity: 1;
177+
}
178+
.slick-dots li button:before
179+
{
180+
font-family: 'slick';
181+
font-size: 6px;
182+
line-height: 20px;
183+
184+
position: absolute;
185+
top: 0;
186+
left: 0;
187+
188+
width: 20px;
189+
height: 20px;
190+
191+
content: '•';
192+
text-align: center;
193+
194+
opacity: .25;
195+
color: black;
196+
197+
-webkit-font-smoothing: antialiased;
198+
-moz-osx-font-smoothing: grayscale;
199+
}
200+
.slick-dots li.slick-active button:before
201+
{
202+
opacity: .75;
203+
color: black;
204+
}

0 commit comments

Comments
 (0)