Skip to content

Commit

Permalink
merged master and also fixed markup for multi column forms
Browse files Browse the repository at this point in the history
  • Loading branch information
pollen8 committed Jan 17, 2013
2 parents 33667f7 + cc153b2 commit c69b5ed
Show file tree
Hide file tree
Showing 37 changed files with 737 additions and 201 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ fabrik_build/output/
/language
libraries/dompdf/lib/fonts/log.htm
<<<<<<< HEAD
<<<<<<< HEAD
=======
libraries/dompdf/lib/fonts/dompdf_font_family_cache.dist.php
>>>>>>> 8c6fc13a540e1b2e461aa6bf46412397c759e72c
=======
/docs
/uploads
libraries/dompdf/lib/fonts/dompdf_font_family_cache.dist.php

>>>>>>> cc153b2f688858cf3f8f880895055ee7f314cc5a
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,17 @@ protected function getInput()
$id = $input->getInt('id');
break;
}
$feModel = JModelLegacy::getInstance($view, 'FabrikFEModel');
$feModel->setId($id);
if ($view === 'element')
{
$pluginManager = FabrikWorker::getPluginManager();
$feModel = $pluginManager->getPluginFromId($id);
}
else
{
$feModel = JModelLegacy::getInstance($view, 'FabrikFEModel');
$feModel->setId($id);
}

$subForm->model = $feModel;

// Hack for order by elements which we now want to store as ids
Expand Down
88 changes: 88 additions & 0 deletions components/com_fabrik/helpers/googlemap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?php
/**
* Google Map helper class
*
* @package Joomla
* @subpackage Fabrik.helpers
* @copyright Copyright (C) 2005 Fabrik. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();

/**
* Google Map class
*
* @package Joomla
* @subpackage Fabrik.helpers
* @since 3.0
*/

class FabGoogleMapHelper
{
/**
* Set the google map style
*
* @param object $params Element/vis parameters (contains gmap_styles property as json string)
*
* @since 3.0.7
*
* @return array Styles
*/

public static function styleJs($params)
{
$optStyles = array();
$styles = json_decode($params->get('gmap_styles'));
if (!$styles)
{
return array();
}

// Map Feature type to style
$features = $styles->style_feature;

// What exactly to style in the feature type (road, fill, border etc)
$elements = $styles->style_element;

$styleKeys = $styles->style_styler_key;
$styleValues = $styles->style_styler_value;

// First merge any identical feature styles
$stylers = array();
for ($i = 0; $i < count($features); $i ++)
{
$feature = JArrayHelper::getValue($features, $i);
$element = JArrayHelper::getValue($elements, $i);
$key = $feature . '|' . $element;
if (!array_key_exists($key, $stylers))
{

$stylers[$key] = array();
}
$aStyle = new stdClass();
$styleKey = JArrayHelper::getValue($styleKeys, $i);
$styleValue = JArrayHelper::getValue($styleValues, $i);
if ($styleKey && $styleValue)
{
$aStyle->$styleKey = $styleValue;
$stylers[$key][] = $aStyle;
}
}
$return = array();
foreach ($stylers as $styleKey => $styler)
{
$o = new stdClass;
$bits = explode('|', $styleKey);
if ( $bits[0] !== 'all')
{
$o->featureType = $bits[0];
$o->elementType = $bits[1];
}
$o->stylers = $styler;
$return[] = $o;
}
return $return;
}
}
2 changes: 1 addition & 1 deletion components/com_fabrik/user_ajax_example.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function userExists()
$app = JFactory::getApplication();
$input = $app->input;
$myUsername = $input->get('username', '');
$query->select('name')->from('#__users')->where('username = ' . $db->quote($myUsername))
$query->select('name')->from('#__users')->where('username = ' . $db->quote($myUsername));
$db->setQuery($query, 1, 0);
$result = $db->loadResult();
if ($thisName = $result)
Expand Down
64 changes: 8 additions & 56 deletions components/com_fabrik/views/form/tmpl/bootstrap/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,8 @@
<?php echo $form->error?>
</div>

<?php if ($this->showEmail): ?>
<a class="btn" href="<?php echo $this->emailURL?>">
<i class="icon-envelope"></i>
<?php echo JText::_('JGLOBAL_EMAIL'); ?>
</a>
<?php endif;

if ($this->showPDF):?>
<a class="btn" href="<?php echo $this->pdfURL?>">
<i class="icon-file"></i>
<?php echo JText::_('COM_FABRIK_PDF')?>
</a>
<?php endif;

if ($this->showPrint):?>
<a class="btn" href="<?php echo $this->printURL?>">
<i class="icon-print"></i>
<?php echo JText::_('JGLOBAL_PRINT')?>
</a>
<?php
endif;

echo $this->loadTemplate('buttons');
echo $this->loadTemplate('relateddata');
foreach ($this->groups as $group) :
$this->group = $group;
Expand All @@ -65,9 +45,11 @@

<?php if (trim($group->title) !== '') :
?>
<div class="page-header">
<<?php echo $form->legendTag ?> class="legend"><span><?php echo $group->title;?></span></<?php echo $form->legendTag ?>>
</div>

<<?php echo $form->legendTag ?> class="legend">
<span><?php echo $group->title;?></span>
</<?php echo $form->legendTag ?>>

<?php endif;

if ($group->intro !== '') : ?>
Expand Down Expand Up @@ -123,39 +105,9 @@
echo $this->hiddenFields;
endif;
?>
<?php echo $this->pluginbottom;

if ($this->hasActions) : ?>
<div class="fabrikActions form-actions">
<div class="row-fluid">
<div class="span4">
<div class="btn-group">
<?php
echo $form->submitButton;
echo $form->applyButton;
echo $form->copyButton;
?>
</div>
</div>
<div class="span4">
<div class="btn-group">
<?php echo $form->nextButton . ' ' . $form->prevButton; ?>
</div>
</div>

<div class="span4">
<div class="btn-group">
<?php
echo $form->gobackButton . ' ' . $this->message;
echo $form->resetButton . ' ';
echo $form->deleteButton;
?>
</div>
</div>
</div>
</div>
<?php
endif;
echo $this->pluginbottom;
echo $this->loadTemplate('actions');
echo $form->endTag;
echo $this->pluginend;
echo FabrikHelperHTML::keepalive();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
$form = $this->form;
if ($this->hasActions) : ?>
<div class="fabrikActions form-actions">
<div class="row-fluid">
<div class="span4">
<div class="btn-group">
<?php
echo $form->submitButton;
echo $form->applyButton;
echo $form->copyButton;
?>
</div>
</div>
<div class="span4">
<div class="btn-group">
<?php echo $form->nextButton . ' ' . $form->prevButton; ?>
</div>
</div>

<div class="span4">
<div class="btn-group">
<?php
echo $form->gobackButton . ' ' . $this->message;
echo $form->resetButton . ' ';
echo $form->deleteButton;
?>
</div>
</div>
</div>
</div>
<?php
endif;
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php if ($this->showEmail): ?>
<a class="btn" href="<?php echo $this->emailURL?>">
<i class="icon-envelope"></i>
<?php echo JText::_('JGLOBAL_EMAIL'); ?>
</a>
<?php endif;

if ($this->showPDF):?>
<a class="btn" href="<?php echo $this->pdfURL?>">
<i class="icon-file"></i>
<?php echo JText::_('COM_FABRIK_PDF')?>
</a>
<?php endif;

if ($this->showPrint):?>
<a class="btn" href="<?php echo $this->printURL?>">
<i class="icon-print"></i>
<?php echo JText::_('JGLOBAL_PRINT')?>
</a>
<?php
endif;
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@
if ($element->span == 'span12') :
echo $this->loadTemplate('group_labels_side');
else :

// Multi columns - best to use simplified layout with labels above field
echo $this->loadTemplate('group_labels_above');
endif;
if ($element->endRow) :?>
</div>
</div><!-- end row-fluid -->
<?php endif;
endforeach;

// If the last element was not closing the row add an additional div
if (!$element->endRow) :?>
</div><!-- end row-fluid for open row -->
<?php endif;?>

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php $element = $this->element;?>
<div class="<?php echo $element->containerClass . $element->span; ?>">
<?php echo $element->label;?>

<?php if ($this->tipLocation == 'above') : ?>
<span class="help-block"><?php echo $element->tipAbove ?></span>
<?php endif ?>

<div class="fabrikElement">
<?php echo $element->element;?>
</div>

<div class="<?php echo $this->class?>">
<?php echo $element->error ?>
</div>

<?php if ($this->tipLocation == 'side') : ?>
<span class="help-block"><?php echo $element->tipAbove ?></span>
<?php endif ?>

<?php if ($this->tipLocation == 'below') :?>
<span class="help-block"><?php echo $element->tipAbove ?></span>
<?php endif ?>
</div>


Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

<?php $element = $this->element; ?>
<div class="control-group <?php echo $element->containerClass . $element->span; ?>">
<?php echo $element->label;?>
<div class="controls">

<?php if ($this->tipLocation == 'above') : ?>
<p class="help-block"><?php echo $element->tipAbove ?></p>
<?php endif ?>

<div class="fabrikElement">
<?php echo $element->element;?>
</div>

<div class="<?php echo $this->class?>">
<?php echo $element->error ?>
</div>

<?php if ($this->tipLocation == 'side') : ?>
<p class="help-block"><?php echo $element->tipAbove ?></p>
<?php endif ?>

</div>

<?php if ($this->tipLocation == 'below') :?>
<p class="help-block"><?php echo $element->tipAbove ?></p>
<?php endif ?>

</div>
1 change: 1 addition & 0 deletions components/com_fabrik/views/list/view.base.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ protected function getManagementJS($data = array())

}
$opts->formels = $formEls;
$opts->fabrik_show_in_list = $input->get('fabrik_show_in_list', array(), 'array');
$opts->csvChoose = (bool) $params->get('csv_frontend_selection');
$popUpWidth = $params->get('popup_width', '');
if ($popUpWidth !== '')
Expand Down
2 changes: 1 addition & 1 deletion media/com_fabrik/js/list-min.js

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion media/com_fabrik/js/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ var FbList = new Class({
'popup_offset_x': null,
'popup_offset_y': null,
'groupByOpts': {},
'listRef': '' // e.g. '1_com_fabrik_1'
'listRef': '', // e.g. '1_com_fabrik_1'
'fabrik_show_in_list': []
},

initialize: function (id, options) {
Expand Down Expand Up @@ -507,6 +508,9 @@ var FbList = new Class({

doFilter: function () {
var res = Fabrik.fireEvent('list.filter', [this]).eventResults;
if (typeOf(res) === 'null') {
this.submit('list.filter');
}
if (res.length === 0 || !res.contains(false)) {
this.submit('list.filter');
}
Expand Down Expand Up @@ -597,6 +601,10 @@ var FbList = new Class({
data += '&replacefilters=1';
}
}
// Pass the elements that are shown in the list - to ensure they are formatted
for (var i = 0; i < this.options.fabrik_show_in_list.length; i ++) {
data += '&fabrik_show_in_list[]=' + this.options.fabrik_show_in_list[i];
}
if (!this.request) {
this.request = new Request({
'url': this.form.get('action'),
Expand Down
Loading

0 comments on commit c69b5ed

Please sign in to comment.