Skip to content

Commit

Permalink
Tweaked yesno element layout to use non-Bootstrap images in PDF display
Browse files Browse the repository at this point in the history
mode.
  • Loading branch information
cheesegrits committed Feb 5, 2015
1 parent b3eec08 commit 9f8e7b0
Showing 1 changed file with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,29 @@
$tmpl = $displayData['tmpl'];
$j3 = FabrikWorker::j3();

$app = JFactory::getApplication();
$format = $app->input->get('format', '');

$opts = array();
$properties = array();

if ($format == 'pdf')
{
$opts['forceImage'] = true;
FabrikHelperHTML::addPath(COM_FABRIK_BASE . 'plugins/fabrik_element/yesno/images/', 'image', 'list', false);
}

if ($data == '1')
{
$icon = $j3 ? 'checkmark.png' : '1.png';
$opts = array('alt' => FText::_('JYES'));
$icon = $j3 && $format != 'pdf' ? 'checkmark.png' : '1.png';
$properties['alt'] = FText::_('JYES');

echo FabrikHelperHTML::image($icon, 'list', $tmpl, $opts);
echo FabrikHelperHTML::image($icon, 'list', $tmpl, $properties, false, $opts);
}
else
{
$icon = $j3 ? 'remove.png' : '0.png';

echo FabrikHelperHTML::image($icon, 'list', $tmpl, array('alt' => FText::_('JNO')));
$icon = $j3 && $format != 'pdf' ? 'remove.png' : '0.png';
$properties['alt'] = FText::_('JNO');

echo FabrikHelperHTML::image($icon, 'list', $tmpl, $properties, false, $opts);
}

0 comments on commit 9f8e7b0

Please sign in to comment.