Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Fabrik/fabrik
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Nov 2, 2018
2 parents 3cb9db6 + 024ab64 commit ec28d0a
Show file tree
Hide file tree
Showing 74 changed files with 6,173 additions and 235 deletions.
1,092 changes: 1,092 additions & 0 deletions administrator/components/com_fabrik/classes/39/FormField.php

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions administrator/components/com_fabrik/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@
<option value="2">COM_FABRIK_LABELS_UCWORDS</option>
<option value="3">COM_FABRIK_LABELS_CAPFIRST</option>
<option value="4">COM_FABRIK_LABELS_CAPS</option>
<option value="5">COM_FABRIK_LABELS_LANGUAGESTRING</option>
<option value="6">COM_FABRIK_LABELS_UNCHANGED</option>
</field>
</fieldset>

Expand Down
47 changes: 46 additions & 1 deletion administrator/components/com_fabrik/controllers/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function view()
$cache->get($view, 'display', $cacheId);
$contents = ob_get_contents();
ob_end_clean();
Html::addToSessionCacheIds($this->cacheId);
Html::addToSessionCacheIds($cacheId);
$token = JSession::getFormToken();
$search = '#<input type="hidden" name="[0-9a-f]{32}" value="1" />#';
$replacement = '<input type="hidden" name="' . $token . '" value="1" />';
Expand Down Expand Up @@ -120,6 +120,7 @@ public function process()
$view->setModel($model, true);
}

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

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

/**
* Do some ACL sanity checks. Without this check, if spoof checking is disabled, a form can be submitted
* with no ACL checks being performed. With spoof checking, we do the ACL checks on form load, so can't get the
* token without having access.
*
* Don't bother checking if not recording to database, as no list or list ACLs.
*/
if ($model->recordInDatabase())
{
$aclOK = false;

if ($model->isNewRecord() && $listModel->canAdd())
{
$aclOK = true;
}
else
{
/*
* Need to set up form data here so we can pass it to canEdit(), remembering to
* add encrypted vars, so things like user elements which have ACLs on them get
* included in data for canUserDo() checks. Nay also need to do copyToFromRaw(),
* but leave that until we find a need for it.
*
* Note that canEdit() expects form data as an object, and $formData is an array,
* but the actual canUserDo() helper func it calls with the data will accept either.
*/
$formData = $model->setFormData();
$model->addEncrytedVarsToArray($formData);

if (!$model->isNewRecord() && $listModel->canEdit($formData))
{
$aclOK = true;
}
}

if (!$aclOK)
{
$msg = $model->aclMessage(true);
$this->app->enqueueMessage($msg);

return;
}
}

$validated = $model->validate();

if (!$validated)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ COM_FABRIK_ACCESS_EDITABLE_ELEMENT="Formular (hinzufügen)"
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."
COM_FABRIK_ACCESS_EDIT_DESC="Zugriffsebene, die der Benutzer haben muss, um Einträge in dieser Liste <strong>editieren</strong> zu dürfen."
COM_FABRIK_ACCESS_VIEW="Ansicht"
COM_FABRIK_ACCESS_VIEWABLE_ELEMENT="Template für Detail-Ansicht"
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>"
COM_FABRIK_ACCESS_VIEWABLE_ELEMENT="Detail-Ansicht"
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>"
COM_FABRIK_ACCESS_LISTVIEW_LABEL="Listenansicht"
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."
COM_FABRIK_ACCESS_VIEW_DESC="Zugriffsebene, die der Benutzer haben muss, um die <strong>Liste zu sehen</strong>."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,8 @@ COM_FABRIK_LABELS_LOWERCASE="Lowercase (e.g. user_Name becomes 'user name')"
COM_FABRIK_LABELS_UCWORDS="Proper name (e.g. user_Name becomes 'User Name')"
COM_FABRIK_LABELS_CAPFIRST="Capitalize first letter (e.g. user_Name becomes 'User name')"
COM_FABRIK_LABELS_CAPS="All Caps (e.g. user_name becomes 'USER NAME')"

COM_FABRIK_LABELS_LANGUAGESTRING="All Caps and underscores (e.g. 'user name' becomes 'USER_NAME'), usable as language string"
COM_FABRIK_LABELS_UNCHANGED="Leave mySQL column name (e.g. user_Name remains 'user_Name')"
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"
COM_FABRIK_SHOW_IN_DASHBOARD_LABEL="Show in module"
COM_FABRIK_DASHBOARD_ICON_DESC="Link icon,glyphicon or fontawesome class e.g. 'icon-joomla'"
Expand Down
6 changes: 6 additions & 0 deletions administrator/components/com_fabrik/models/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,12 @@ protected function makeElementsFromFields($groupId, $tableName)
case '4':
$element->label = strtoupper($element->label);
break;
case '5':
$element->label = strtoupper(str_replace(" ", "_", $element->label));
break;
case '6':
$element->label = FArrayHelper::getValue($elementLabels, $ordering, $label);
break;
default:
break;
}
Expand Down
3 changes: 2 additions & 1 deletion components/com_fabrik/layouts/fabrik-bootstrap-grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

$d = $displayData;

$span = floor(12 / $d->columns);
// avoid potential divide by 0 if something went wrong and $d->columns is 0 or empty
$span = empty($d->columns) ? 12 : floor(12 / $d->columns);
$i = 0;
$id = is_null($d->spanId) ? '' : ' id="' . $d->spanId . '"';
$grid = array();
Expand Down
Binary file added components/com_fabrik/libs/slick/ajax-loader.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions components/com_fabrik/libs/slick/config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
css_dir = "."
sass_dir = "."
images_dir = "."
fonts_dir = "fonts"
relative_assets = true

output_style = :compact
line_comments = false

preferred_syntax = :scss
Binary file not shown.
14 changes: 14 additions & 0 deletions components/com_fabrik/libs/slick/fonts/slick.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added components/com_fabrik/libs/slick/fonts/slick.ttf
Binary file not shown.
Binary file added components/com_fabrik/libs/slick/fonts/slick.woff
Binary file not shown.
204 changes: 204 additions & 0 deletions components/com_fabrik/libs/slick/slick-theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
@charset 'UTF-8';
/* Slider */
.slick-loading .slick-list
{
background: #fff url('./ajax-loader.gif') center center no-repeat;
}

/* Icons */
@font-face
{
font-family: 'slick';
font-weight: normal;
font-style: normal;

src: url('./fonts/slick.eot');
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');
}
/* Arrows */
.slick-prev,
.slick-next
{
font-size: 0;
line-height: 0;

position: absolute;
top: 50%;

display: block;

width: 20px;
height: 20px;
padding: 0;
-webkit-transform: translate(0, -50%);
-ms-transform: translate(0, -50%);
transform: translate(0, -50%);

cursor: pointer;

color: transparent;
border: none;
outline: none;
background: transparent;
}
.slick-prev:hover,
.slick-prev:focus,
.slick-next:hover,
.slick-next:focus
{
color: transparent;
outline: none;
background: transparent;
}
.slick-prev:hover:before,
.slick-prev:focus:before,
.slick-next:hover:before,
.slick-next:focus:before
{
opacity: 1;
}
.slick-prev.slick-disabled:before,
.slick-next.slick-disabled:before
{
opacity: .25;
}

.slick-prev:before,
.slick-next:before
{
font-family: 'slick';
font-size: 20px;
line-height: 1;

opacity: .75;
color: white;

-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.slick-prev
{
left: -25px;
}
[dir='rtl'] .slick-prev
{
right: -25px;
left: auto;
}
.slick-prev:before
{
content: '←';
}
[dir='rtl'] .slick-prev:before
{
content: '→';
}

.slick-next
{
right: -25px;
}
[dir='rtl'] .slick-next
{
right: auto;
left: -25px;
}
.slick-next:before
{
content: '→';
}
[dir='rtl'] .slick-next:before
{
content: '←';
}

/* Dots */
.slick-dotted.slick-slider
{
margin-bottom: 30px;
}

.slick-dots
{
position: absolute;
bottom: -25px;

display: block;

width: 100%;
padding: 0;
margin: 0;

list-style: none;

text-align: center;
}
.slick-dots li
{
position: relative;

display: inline-block;

width: 20px;
height: 20px;
margin: 0 5px;
padding: 0;

cursor: pointer;
}
.slick-dots li button
{
font-size: 0;
line-height: 0;

display: block;

width: 20px;
height: 20px;
padding: 5px;

cursor: pointer;

color: transparent;
border: 0;
outline: none;
background: transparent;
}
.slick-dots li button:hover,
.slick-dots li button:focus
{
outline: none;
}
.slick-dots li button:hover:before,
.slick-dots li button:focus:before
{
opacity: 1;
}
.slick-dots li button:before
{
font-family: 'slick';
font-size: 6px;
line-height: 20px;

position: absolute;
top: 0;
left: 0;

width: 20px;
height: 20px;

content: '•';
text-align: center;

opacity: .25;
color: black;

-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.slick-dots li.slick-active button:before
{
opacity: .75;
color: black;
}
Loading

0 comments on commit ec28d0a

Please sign in to comment.