Permalink
Browse files

Various stuff. Added $container param for getFilter, needed by autoco…

…mplete (otherwise selector is wrong in viz filters), changed date format translation to use strtr() instead of str_replace() to avoid left to right dupe issues, added user contributed trabslation for comment plugin
  • Loading branch information...
1 parent a5ac130 commit 60e639e4e83b4077fdf126fcce7fcab3bd64f181 @cheesegrits cheesegrits committed Dec 2, 2016
View
@@ -29,7 +29,7 @@ module.exports = function (grunt) {
'./plugins/fabrik_*/*/*.js',
'!./plugins/fabrik_*/**/*-min.js',
'./plugins/fabrik_element/fileupload/lib/plupload/js/*.js',
- './plugins/fabrik_element/fileupload/lib/plupload/js/*-min.js',
+ '!./plugins/fabrik_element/fileupload/lib/plupload/js/*-min.js',
'./media/com_fabrik/js/*.js',
'!./media/com_fabrik/js/*-min.js',
'!/media/com_fabrik/js/**',
@@ -366,7 +366,7 @@ public static function specialStrToMySQL($date, $gmt = true)
$matches3 = array();
// E.g. now
- preg_match("/[now|ago|midnight|yesterday|today]/i", $date, $matches);
+ preg_match("/(now|ago|midnight|yesterday|today)/i", $date, $matches);
// E.g. +2 Week
preg_match("/[+|-][0-9]* (week\b|year\b|day\b|month\b)/i", $date, $matches2);
@@ -3185,7 +3185,7 @@ protected function filterName($counter = 0, $normal = true)
*
* @return string Filter html
*/
- public function getFilter($counter = 0, $normal = true)
+ public function getFilter($counter = 0, $normal = true, $container = '')
{
$listModel = $this->getListModel();
$formModel = $listModel->getFormModel();
@@ -3249,7 +3249,7 @@ public function getFilter($counter = 0, $normal = true)
break;
case 'auto-complete':
- $autoComplete = $this->autoCompleteFilter($default, $v, null, $normal);
+ $autoComplete = $this->autoCompleteFilter($default, $v, null, $normal, $container);
$return = array_merge($return, $autoComplete);
break;
}
@@ -3464,7 +3464,7 @@ protected function singleFilter($default, $v, $type = 'text')
*
* @return array HTML bits
*/
- protected function autoCompleteFilter($default, $v, $labelValue = null, $normal = true)
+ protected function autoCompleteFilter($default, $v, $labelValue = null, $normal = true, $container)
{
if (is_null($labelValue))
{
@@ -3491,7 +3491,13 @@ protected function autoCompleteFilter($default, $v, $labelValue = null, $normal
if ($normal)
{
$opts['menuclass'] = 'auto-complete-container';
- $selector = '#listform_' . $listModel->getRenderContext() . ' .' . $id;
+
+ if (empty($container))
+ {
+ $container = 'listform_' . $listModel->getRenderContext();
+ }
+
+ $selector = '#' . $container . ' .' . $id;
}
else
{
@@ -353,7 +353,7 @@ protected function filterName($counter = 0, $normal = true)
*
* @return string Filter HTML
*/
- public function getFilter($counter = 0, $normal = true)
+ public function getFilter($counter = 0, $normal = true, $container = '')
{
$element = $this->getElement();
$values = $this->getSubOptionValues();
@@ -412,7 +412,7 @@ public function getFilter($counter = 0, $normal = true)
case 'auto-complete':
$defaultLabel = $this->getLabelForValue($default);
- $autoComplete = $this->autoCompleteFilter($default, $v, $defaultLabel, $normal);
+ $autoComplete = $this->autoCompleteFilter($default, $v, $defaultLabel, $normal, $container);
$return = array_merge($return, $autoComplete);
break;
}
@@ -6423,7 +6423,7 @@ protected function &makeFilters($container = 'listform_1', $type = 'list', $id =
$o = new stdClass;
$o->name = $elementModel->getFullName(true, false);
$o->id = $elementModel->getHTMLId() . 'value';
- $o->filter = $elementModel->getFilter($counter, true);
+ $o->filter = $elementModel->getFilter($counter, true, $container);
$fScript[] = $elementModel->filterJS(true, $container);
$o->required = $elementModel->getParams()->get('filter_required');
$o->label = $elementModel->getListHeading();
@@ -705,7 +705,7 @@ public function filterValueList($normal, $tableName = '', $label = '', $id = '',
*
* @return string Filter html
*/
- public function getFilter($counter = 0, $normal = true)
+ public function getFilter($counter = 0, $normal = true, $container = '')
{
$params = $this->getParams();
$element = $this->getElement();
@@ -2163,7 +2163,7 @@ protected function getDefaultFilterVal($normal = true, $counter = 0)
*
* @return string filter html
*/
- public function getFilter($counter = 0, $normal = true)
+ public function getFilter($counter = 0, $normal = true, $container = '')
{
$params = $this->getParams();
$element = $this->getElement();
@@ -2219,7 +2219,7 @@ public function getFilter($counter = 0, $normal = true)
break;
case 'auto-complete':
$defaultLabel = $this->getLabelForValue($default);
- $autoComplete = $this->autoCompleteFilter($default, $v, $defaultLabel, $normal);
+ $autoComplete = $this->autoCompleteFilter($default, $v, $defaultLabel, $normal, $container);
$return = array_merge($return, $autoComplete);
break;
}
@@ -1392,7 +1392,7 @@ public function emptyFilterValue()
*
* @return string filter html
*/
- public function getFilter($counter = 0, $normal = true)
+ public function getFilter($counter = 0, $normal = true, $container = '')
{
$listModel = $this->getListModel();
$table = $listModel->getTable();
@@ -1525,7 +1525,7 @@ public function getFilterRO($data)
*
* @return string JLayout render
*/
- protected function autoCompleteFilter($default, $v, $labelValue = null, $normal = true)
+ protected function autoCompleteFilter($default, $v, $labelValue = null, $normal = true, $container)
{
if (get_magic_quotes_gpc())
{
@@ -2691,6 +2691,8 @@ static public function strftimeFormatToDateFormat(&$format)
*/
static public function dateFormatToStrftimeFormat(&$format)
{
+ // changed to use single array and strtr() to avoid left to right translation dupes, leaving this here for now
+ /*
$search = array('d', 'D', 'j', 'l', 'N', 'S', 'w', 'z', 'W', 'F', 'm', 'M', 'n', 't', 'L', 'o', 'Y',
'y', 'a', 'A', 'B', 'g', 'G', 'h', 'H', 'i', 's', 'u',
'I', 'O', 'P', 'T', 'Z', 'c', 'r', 'U');
@@ -2701,6 +2703,49 @@ static public function dateFormatToStrftimeFormat(&$format)
// Removed e => %z as that meant, j => %e => %%z (prob could re-implement with a regex if really needed)
$format = str_replace($search, $replace, $format);
+ */
+
+ $trs = array(
+ 'd' => '%d',
+ 'D' => '%a',
+ 'j' => '%e',
+ 'l' => '%A',
+ 'N' => '%u',
+ 'S' => '',
+ 'w' => '%w',
+ 'z' => '%j',
+ 'W' => '%V',
+ 'F' => '%B',
+ 'm' => '%m',
+ 'M' => '%b',
+ 'n' => '%m',
+ 't' => '',
+ 'L' => '',
+ 'o' => '%g',
+ 'Y' => '%Y',
+ 'y' => '%y',
+ 'a' => '%P',
+ 'A' => '%p',
+ 'B' => '',
+ 'g' => '%l',
+ 'G' => '%H',
+ 'h' => '%I',
+ 'H' => '%H',
+ 'i' => '%M',
+ 's' => '%S',
+ 'e' => '%z',
+ 'u' => '',
+ 'I' => '',
+ 'O' => '',
+ 'P' => '',
+ 'T' => '%z',
+ 'Z' => '',
+ 'c' => '%c',
+ 'r' => '%a, %d %b %Y %H:%M:%S %z',
+ 'U' => '%s'
+ );
+
+ $format = strtr($format, $trs);
}
/**
Oops, something went wrong.
@@ -51,7 +51,6 @@ define(['jquery', 'fab/element', 'lib/debounce/jquery.ba-throttle-debounce', 'fa
options: {
'lat' : 0,
'lat_dms' : 0,
- 'key' : '',
'lon' : 0,
'lon_dms' : 0,
'zoomlevel' : '13',
@@ -15,6 +15,7 @@
<filename>index.html</filename>
<filename>picklist.js</filename>
<filename>picklist-min.js</filename>
+ <filename>picklist.css</filename>
<folder>forms</folder>
<folder>language</folder>
<folder>layouts</folder>
@@ -707,7 +707,7 @@ public function getValue($data, $repeatCounter = 0, $opts = array())
*
* @return string filter html
*/
- public function getFilter($counter = 0, $normal = true)
+ public function getFilter($counter = 0, $normal = true, $container = '')
{
$listModel = $this->getlistModel();
$formModel = $listModel->getFormModel();
@@ -769,7 +769,7 @@ public function getFilter($counter = 0, $normal = true)
case 'auto-complete':
$defaultLabel = $this->getLabelForValue($default);
- $autoComplete = $this->autoCompleteFilter($default, $v, $defaultLabel, $normal);
+ $autoComplete = $this->autoCompleteFilter($default, $v, $defaultLabel, $normal, $container);
$return = array_merge($return, $autoComplete);
break;
}
@@ -287,7 +287,7 @@ public function elementJavascript($repeatCounter)
*
* @return string Filter html
*/
- public function getFilter($counter = 0, $normal = true)
+ public function getFilter($counter = 0, $normal = true, $container = '')
{
$listModel = $this->getlistModel();
$elName = $this->getFullName(true, false);
@@ -21,7 +21,7 @@
default="0"
description="PLG_FORM_UPSERT_INSERT_ONLY_DESC"
label="PLG_FORM_UPSERT_INSERT_ONLY_LABEL"
- repeat="true">"plugins/fabrik_form/upsert/language/en-GB/en-GB.plg_fabrik_form_upsert.ini"
+ repeat="true">
<option value="0">PLG_FORM_UPSERT_INSERT_ONLY_BOTH</option>
<option value="1">PLG_FORM_UPSERT_INSERT_ONLY_INSERT</option>
<option value="2">PLG_FORM_UPSERT_INSERT_ONLY_UPDATE</option>
@@ -64,6 +64,7 @@
<field name="upsert_key"
type="element"
connection="params_connection_id"
+ connection_in_repeat="false"
table="params_table"
valueformat="tableelement"
label="PLG_FORM_UPSERT_KEY_LABEL" />
@@ -389,6 +389,12 @@ public function getPDFs($key = 'ids')
$p .= '.pdf';
$url = COM_FABRIK_LIVESITE . 'index.php?option=com_fabrik&view=details&formid=' . $formId . '&rowid=' . $rowId . '&format=pdf';
+
+ if (FabrikHelperHTML::isDebug())
+ {
+ $url .= '&XDEBUG_SESSION_START=PHPSTORM';
+ }
+
$pdfContent = file_get_contents($url);
JFile::write($p, $pdfContent);

0 comments on commit 60e639e

Please sign in to comment.