Skip to content

Commit

Permalink
Merge branch 'joomla3' of github.com:Fabrik/fabrik into joomla3
Browse files Browse the repository at this point in the history
  • Loading branch information
pollen8 committed Sep 11, 2014
2 parents 7907d50 + 24ea4ac commit 27b2a54
Show file tree
Hide file tree
Showing 163 changed files with 202 additions and 30 deletions.
Empty file modified administrator/components/com_fabrik/classes/renderer/xml.php
100755 → 100644
Empty file.
7 changes: 4 additions & 3 deletions administrator/components/com_fabrik/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,13 @@
<fieldset label="COM_FABRIK_JAVASCRIPT" name="javascript">

<field name="use_mediabox"
type="radio"
type="list"
default="0" description="COM_FABRIK_MEDIA_BOX_DESC"
label="COM_FABRIK_MEDIA_BOX_LABEL"
class="radio btn-group">
<option value="0">JNO</option>
<option value="1">JYES</option>
<option value="0">COM_FABRIK_LIGHTBOX_SLIMBOX</option>
<option value="1">COM_FABRIK_LIGHTBOX_MEDIABOX</option>
<option value="2">COM_FABRIK_LIGHTBOX_ROKBOX</option>
</field>

<field name="mediabox_style"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ COM_FABRIK_FIELD_ICON_FILE_DESC="Einen Dateinamen einfügen der in der Tabellen
COM_FABRIK_FIELD_ICON_FILE_LABEL="Statische Icon Datei (kein .ext!)"
COM_FABRIK_FIELD_ICON_HOVER_TEXT_DESC="Sollen die Daten als Tipp angezeigt werden wenn ein Icon gefunden wurde."
COM_FABRIK_FIELD_ICON_HOVER_TEXT_LABEL="Icon Hover Text"
COM_FABRIK_FIELD_ICON_SUBDIR_DESC="Falls ein Unterordner angegeben ist(zB myfolder/) sucht Fabrik zuerst Icons in [standard template locations]/myfolder/ (zB JOOMLAROOT/images/myfolder)."
COM_FABRIK_FIELD_ICON_SUBDIR_LABEL="Icon Unterordner"
COM_FABRIK_FIELD_ID="Feld ID"
COM_FABRIK_FIELD_INCLUDE_IN_ADVANCED_SEARCH_DESC="Wenn die erweiterte Suche der Liste genutzt wird, wird hier ausgewählt, ob dieses Feld in die Suche integriert werden soll"
COM_FABRIK_FIELD_INCLUDE_IN_ADVANCED_SEARCH_LABEL="In erweiterte Suche einschließen"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ COM_FABRIK_FIELD_ICON_FILE_DESC="Insert a file name which you want to show in ta
COM_FABRIK_FIELD_ICON_FILE_LABEL="Static icon file (no .ext!)"
COM_FABRIK_FIELD_ICON_HOVER_TEXT_DESC="If an icon is found should the data be shown inside a tip when the mouse enters the icon"
COM_FABRIK_FIELD_ICON_HOVER_TEXT_LABEL="Icon hover text"
COM_FABRIK_FIELD_ICON_SUBDIR_DESC="If a subdir is set (e.g. myfolder/) then Fabrik will first look for icons in [standard template locations]/myfolder/ (e.g. JOOMLAROOT/images/myfolder)."
COM_FABRIK_FIELD_ICON_SUBDIR_LABEL="Icon subdirectory"
COM_FABRIK_FIELD_ID="Field id"
COM_FABRIK_FIELD_INCLUDE_IN_ADVANCED_SEARCH_DESC="If the views advanced search is on, determines if the element appears in the list of elements to filter upon"
COM_FABRIK_FIELD_INCLUDE_IN_ADVANCED_SEARCH_LABEL="Include in advanced search"
Expand Down Expand Up @@ -827,6 +829,9 @@ COM_FABRIK_LAYOUT="Layout"
COM_FABRIK_LEAVE_CR_LF="Leave as CR/LF"
COM_FABRIK_LIGHTBOX_JS_LABEL="Include lightbox js"
COM_FABRIK_LIGHTBOX_JS_DESC="No for never include the JS, allows you to use other lightbox scripts that use rel='lightbox'. Auto means Fabrik will include the JS is there is an element present that requires it. Yes means always include it regardless of element types on the page."
COM_FABRIK_LIGHTBOX_SLIMBOX="Slimbox"
COM_FABRIK_LIGHTBOX_MEDIABOX="Mediabox"
COM_FABRIK_LIGHTBOX_ROKBOX="Rokbox (work in progress)"
COM_FABRIK_LINKS="Links"
COM_FABRIK_LINK_TO_FORM="Link to form"
COM_FABRIK_LINK_TO_LIST="Link to list"
Expand Down Expand Up @@ -899,8 +904,8 @@ COM_FABRIK_MANAGER_PACKAGE_NEW="Fabrik: new package"
COM_FABRIK_MANAGER_VISUALIZATIONS="Fabrik: visualizations"
COM_FABRIK_MANAGER_VISUALIZATION_EDIT="Fabrik: edit visualization"
COM_FABRIK_MANAGER_VISUALIZATION_NEW="Fabrik: new visualization"
COM_FABRIK_MEDIA_BOX_DESC="supports Flash"
COM_FABRIK_MEDIA_BOX_LABEL="Use mediabox"
COM_FABRIK_MEDIA_BOX_DESC="Which lightbox to use. Slimbox is a basic, very light weight script. Mediabox is heavier weight, but with more styling options and funcitonality. Rokbox is specific to Rocket Themes templates (also select No for Include Lightbox JS if you use this)"
COM_FABRIK_MEDIA_BOX_LABEL="Lightbox script"
COM_FABRIK_MEDIA_BOX_STYLE_DESC="The window styling for mediabox modal windows"
COM_FABRIK_MEDIA_BOX_STYLE_LABEL="Display style for mediabox"
COM_FABRIK_MERGE_ROWS="Merge rows"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ COM_FABRIK_FIELD_ICON_FILE_DESC="Insérez un nom de fichier que vous souhaitez m
COM_FABRIK_FIELD_ICON_FILE_LABEL="Fichier icône (sans .ext!)"
COM_FABRIK_FIELD_ICON_HOVER_TEXT_DESC="Si une icône est trouvée la donnée doit-elle être montrée à l'intérieur d'une bulle d'aide quand la souris est au-dessus de l'icône"
COM_FABRIK_FIELD_ICON_HOVER_TEXT_LABEL="Texte de survol de l'icône"
COM_FABRIK_FIELD_ICON_SUBDIR_DESC="If a subdir is set (e.g. myfolder/) then Fabrik will first look for icons in [standard template locations]/myfolder/ (e.g. JOOMLAROOT/images/myfolder)."
COM_FABRIK_FIELD_ICON_SUBDIR_LABEL="Icon subdirectory"
COM_FABRIK_FIELD_ID="ID champ"
COM_FABRIK_FIELD_INCLUDE_IN_ADVANCED_SEARCH_DESC="Si la vue recherche avancée est activée, détermine si l'élément apparait dans la liste des éléments à filtrer"
COM_FABRIK_FIELD_INCLUDE_IN_ADVANCED_SEARCH_LABEL="Inclure dans recherche avancée"
Expand Down
7 changes: 7 additions & 0 deletions administrator/components/com_fabrik/models/forms/element.xml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,13 @@
description="COM_FABRIK_FIELD_ICON_FILE_DESC"
label="COM_FABRIK_FIELD_ICON_FILE_LABEL" />

<field name="icon_subdir"
type="text"
size="20"
default=""
description="COM_FABRIK_FIELD_ICON_SUBDIR_DESC"
label="COM_FABRIK_FIELD_ICON_SUBDIR_LABEL" />

</fieldset>

<fieldset name="rss">
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_fabrik/models/forms/list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@

<field name="distinct"
type="radio"
default="0"
default="1"
label="COM_FABRIK_LIST_DISTINCT_LABEL"
description="COM_FABRIK_LIST_DISTINCT_DESC"
class="btn-group">
Expand Down
8 changes: 7 additions & 1 deletion components/com_fabrik/controllers/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ public function display($cachable = false, $urlparams = array())

public function process()
{
$profiler = JProfiler::getInstance('Application');
JDEBUG ? $profiler->mark('controller process: start') : null;

$app = JFactory::getApplication();
$package = $app->getUserState('com_fabrik.package', 'fabrik');
$input = $app->input;
Expand Down Expand Up @@ -217,12 +220,15 @@ public function process()
JSession::checkToken() or die('Invalid Token');
}

JDEBUG ? $profiler->mark('controller process validate: start') : null;
if (!$model->validate())
{
$this->handleError($view, $model);

return;
}
JDEBUG ? $profiler->mark('controller process validate: end') : null;

// Reset errors as validate() now returns ok validations as empty arrays
$model->clearErrors();

Expand Down Expand Up @@ -256,7 +262,7 @@ public function process()
}

/**
* If debug submit is requested (&fabrikdebug=2, and J! debug on, and Fabrik degbu allowed),
* If debug submit is requested (&fabrikdebug=2, and J! debug on, and Fabrik debug allowed),
* bypass any and all redirects, so we can see the profile for the submit
*/

Expand Down
37 changes: 37 additions & 0 deletions components/com_fabrik/helpers/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -2460,6 +2460,43 @@ public static function tagify($data, $baseUrl = '', $name = '', $icon = '')
return $tags;
}

/**
* Return a set of attributes for an <a> tag
*
* @param string $title title to use for popup image
* @param string $group grouping tag for next/prev, if applicable
*
*/

public static function getLightboxAttributes($title = "", $group = "")
{
$fbConfig = JComponentHelper::getParams('com_fabrik');
$lightboxScript = $fbConfig->get('use_mediabox', '0');

$attrs = array();

switch ($lightboxScript)
{
case 0:
case 1:
default:
$attrs[] = "rel=lightbox{" . $group . "]";
break;
case 2:
$attrs[] = "data-rokbox";
if (!empty($title))
{
$attrs[] = 'data-rockbox-caption="' . addslashes($title) . '"';
}
if (!empty($group))
{
$attrs[] = 'data-rokbox-album="' . addslashes($group) . '"';
}
break;
}
return implode(' ', $attrs);
}

/**
* Make an <a> tag
*
Expand Down
18 changes: 18 additions & 0 deletions components/com_fabrik/helpers/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,23 @@ public static function cacheRemote($src, $path, $file, $lifeTime = 29)
* ... we should probably clean $file, replace non alphanumeric chars with
* underscores, as filenames with things like commas, = signs etc. could be problematic, both in
* the file system, and on the IMG URL.
*
* EDIT - hopefully just md5()'ing the file should fix the above, needed to do it as we finally had
* someone report a problem with invalid file name, see ...
*
* https://github.com/Fabrik/fabrik/pull/1307
*
* So ... just preserve original extension (if any) and append it to md5() of file name.
*/

$ext = pathinfo($file, PATHINFO_EXTENSION);
$file = md5($file);

if (!empty($ext))
{
$file .= '.' . $ext;
}

$folder = JPATH_SITE . '/' . ltrim($path, '/');

// For SSL a user agent may need to be set.
Expand All @@ -272,6 +288,8 @@ public static function cacheRemote($src, $path, $file, $lifeTime = 29)
JFolder::create($folder);
}

// make sure we have one, and only one, / on the end of folder. Really should add a helper for this which looks for legacy \ as well!
$folder = rtrim($folder, '/') . '/';
$cacheFile = $folder . $file;

// Check for cached version
Expand Down
20 changes: 18 additions & 2 deletions components/com_fabrik/helpers/parent.php
Original file line number Diff line number Diff line change
Expand Up @@ -1416,11 +1416,27 @@ public static function getDbo($loadJoomlaDb = false, $cnnId = null)
* default connection as well, essentially enabling it for ALL queries we do.
*/
$fbConfig = JComponentHelper::getParams('com_fabrik');

if ($fbConfig->get('enable_big_selects', 0) == '1')
{
$fabrikDb = self::$database[$sig];
$fabrikDb->setQuery("SET OPTION SQL_BIG_SELECTS=1, GROUP_CONCAT_MAX_LEN=10240");

/**
* Use of OPTION in SET deprecated from MySQL 5.1. onward
* http://www.fabrikar.com/forums/index.php?threads/enable-big-selects-error.39463/#post-198293
* NOTE - technically, using verison_compare on MySQL version could fail, if it's a "gamma"
* release, which PHP desn't grok!
*/

if (version_compare($fabrikDb->getVersion(), '5.1.0', '>='))
{
$fabrikDb->setQuery("SET SQL_BIG_SELECTS=1, GROUP_CONCAT_MAX_LEN=10240");
}
else
{
$fabrikDb->setQuery("SET OPTION SQL_BIG_SELECTS=1, GROUP_CONCAT_MAX_LEN=10240");
}

$fabrikDb->execute();
}
}
Expand Down
Empty file modified components/com_fabrik/language/ru-RU/ru-RU.com_fabrik.ini
100755 → 100644
Empty file.
Empty file modified components/com_fabrik/libs/cycle2/jquery.cycle2.js
100755 → 100644
Empty file.
Empty file modified components/com_fabrik/libs/cycle2/jquery.cycle2.min.js
100755 → 100644
Empty file.
Empty file modified components/com_fabrik/libs/qrcode/qrcode.php
100755 → 100644
Empty file.
17 changes: 15 additions & 2 deletions components/com_fabrik/models/element.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,15 @@ protected function replaceWithIcons($data, $view = 'list', $tmpl = null)
$cleanDatas = array($this->getElement()->name . '_' . $cleanData, $cleanData);
$opts = array('forceImage' => true);

//If subdir is set prepend file name with subdirectory (so first search through [template folders]/subdir for icons, e.g. images/subdir)
$iconsubdir = $params->get('icon_subdir', '');
if ($iconsubdir != '')
{
$iconsubdir = rtrim($iconsubdir,'/') . '/';
$iconsubdir = ltrim($iconsubdir,'/');
array_unshift($cleanDatas, $iconsubdir.$cleanData); //search subdir first
}

foreach ($cleanDatas as $cleanData)
{
foreach ($this->imageExtensions as $ex)
Expand Down Expand Up @@ -3487,8 +3496,10 @@ protected function getSubOptionValues()
* Paul - According to tooltip, $phpOpts should be of form "array(JHTML: :_('select.option', '1', 'one'))"
* This is an array of objects with properties text and value.
* If user has mis-specified this we should tell them.
*
* @FIXME - $$$ hugh - seems like an empty array should be valid as well?
**/
if (!is_array($phpOpts) || !$phpOpts[0] || !is_object($phpOpts[0]) || !$phpOpts[0]->value || !$phpOpts[0]->text)
if (!is_array($phpOpts) || !$phpOpts[0] || !is_object($phpOpts[0]) || !isset($phpOpts[0]->value) || !isset($phpOpts[0]->text))
{
FabrikWorker::logError(sprintf(FText::_('COM_FABRIK_ELEMENT_SUBOPTION_ERROR'), $this->element->name, var_export($phpOpts, true)), 'error');

Expand Down Expand Up @@ -3528,8 +3539,10 @@ protected function getSubOptionLabels()
* Paul - According to tooltip, $phpOpts should be of form "array(JHTML::_('select.option', '1', 'one'))"
* This is an array of objects with properties text and value.
* If user has mis-specified this we should tell them.
*
* @FIXME - $$$ hugh - seems like an empty array should be valid as well?
**/
if (!is_array($phpOpts) || !$phpOpts[0] || !is_object($phpOpts[0]) || !$phpOpts[0]->value || !$phpOpts[0]->text)
if (!is_array($phpOpts) || !$phpOpts[0] || !is_object($phpOpts[0]) || !isset($phpOpts[0]->value) || !isset($phpOpts[0]->text))
{
FabrikWorker::logError(sprintf(FText::_('COM_FABRIK_ELEMENT_SUBOPTION_ERROR'), $this->element->name, var_export($phpOpts, true)), 'error');

Expand Down
24 changes: 23 additions & 1 deletion components/com_fabrik/models/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -1187,21 +1187,27 @@ public function process()
* now looks at origRowId
*/
$this->origRowId = $this->rowId;

JDEBUG ? $profiler->mark('process, getGroupsHiarachy: start') : null;
$this->getGroupsHiarachy();

if ($form->record_in_database == '1')
{
JDEBUG ? $profiler->mark('process, setOrigData: start') : null;
$this->setOrigData();
}

JDEBUG ? $profiler->mark('process, onBeforeProcess plugins: start') : null;
if (in_array(false, $pluginManager->runPlugins('onBeforeProcess', $this)))
{
return false;
}

$this->removeEmptyNoneJoinedGroupData($this->formData);
JDEBUG ? $profiler->mark('process, setFormData: start') : null;
$this->setFormData();

JDEBUG ? $profiler->mark('process, _doUpload: start') : null;
if (!$this->_doUpload())
{
return false;
Expand All @@ -1211,6 +1217,7 @@ public function process()
* this->setFormData();
*/

JDEBUG ? $profiler->mark('process, onBeforeStore plugins: start') : null;
if (in_array(false, $pluginManager->runPlugins('onBeforeStore', $this)))
{
return false;
Expand All @@ -1229,8 +1236,10 @@ public function process()

// $$$rob run this before as well as after onAfterProcess (ONLY for redirect plugin)
// so that any redirect urls are available for the plugin (e.g twitter)
JDEBUG ? $profiler->mark('process, onLastProcess plugins: start') : null;
$pluginManager->runPlugins('onLastProcess', $this);

JDEBUG ? $profiler->mark('processToDb, onAfterProcess plugins: start') : null;
if (in_array(false, $pluginManager->runPlugins('onAfterProcess', $this)))
{
// $$$ rob this no longer stops default redirect (not needed any more)
Expand All @@ -1241,6 +1250,7 @@ public function process()
$sessionModel->remove();

// $$$rob used ONLY for redirect plugins
JDEBUG ? $profiler->mark('process, onLastProcess plugins: start') : null;
if (in_array(false, $pluginManager->runPlugins('onLastProcess', $this)))
{
// $$$ rob this no longer stops default redirect (not needed any more)
Expand Down Expand Up @@ -1801,29 +1811,41 @@ protected function processElements()

public function processToDB()
{
$profiler = JProfiler::getInstance('Application');
JDEBUG ? $profiler->mark('processToDb: start') : null;

$pluginManager = FabrikWorker::getPluginManager();
$app = JFactory::getApplication();
$input = $app->input;
$listModel = $this->getListModel();
$item = $listModel->getTable();
$origid = $this->prepareForCopy();
$this->formData = $listModel->removeTableNameFromSaveData($this->formData, '___');

JDEBUG ? $profiler->mark('processToDb, submitToDatabase: start') : null;
$insertId = $this->storeMainRow ? $this->submitToDatabase($this->rowId) : $this->rowId;

$this->updateRefferrer($origid, $insertId);
$this->setInsertId($insertId);

// Store join data
JDEBUG ? $profiler->mark('processToDb, processGroups: start') : null;
$this->processGroups();

// Enable db join checkboxes in repeat groups to save data
JDEBUG ? $profiler->mark('processToDb, processElements: start') : null;
$this->processElements();

JDEBUG ? $profiler->mark('processToDb, onBeforeCalculations plugins: start') : null;
if (in_array(false, $pluginManager->runPlugins('onBeforeCalculations', $this)))
{
return $insertId;
}


JDEBUG ? $profiler->mark('processToDb, doCalculations: start') : null;
$this->listModel->doCalculations();

JDEBUG ? $profiler->mark('processToDb: end') : null;
return $insertId;
}

Expand Down
Loading

0 comments on commit 27b2a54

Please sign in to comment.