Skip to content

Commit

Permalink
Merge pull request #72 from hr-it-solutions/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
HRIT-Florian authored Nov 4, 2017
2 parents 88ea0b0 + e75b629 commit e66b5f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions site/views/profile/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,12 @@
<div class="row-fluid">
<div class="span12 well">
<?php // Custom fields ?>
<?php if(count($this->item->jcfields)): ?>
<?php if(isset($this->item->jcfields) && count($this->item->jcfields)): ?>
<div class="row-fluid">
<hr>
<h2><?php echo JText::_('COM_DD_GMAPS_LOCATIONS_CUSTOMFIELDS'); ?></h2>
<hr>
</div>
<?php endif; ?>
<?php foreach ($this->item->jcfields as $jcfield): ?>
<div class="row-fluid">
<div class="span6">
Expand All @@ -125,6 +124,7 @@
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>

<?php // Description ?>
<div class="row-fluid">
Expand Down
10 changes: 8 additions & 2 deletions site/views/profile/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,15 @@ function display($tpl = null)
$fields = FieldsHelper::getFields('com_dd_gmaps_locations.location', $this->item, true);

// Assigne custom fields to $this->item->jcfields
foreach ($fields as $key => $field)
if($fields)
{
$this->item->jcfields[$field->id] = $field;
foreach ($fields as $key => $field)
{
if($field->value != '')
{
$this->item->jcfields[$field->id] = $field;
}
}
}

if (empty($this->item))
Expand Down

0 comments on commit e66b5f0

Please sign in to comment.