-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[com_fields] Fix text-value being reverse for fields: list, radio, ch…
…eckbox. Fix fields: radio, checkboxes not showing (#12739) * Fix value-text being reverse for fields list, radio, checkbox, change 'name','key' label to be 'text' for these fields * Fixed calling method from parent class * Added missing layout file for radio field * Fixed character '0' unusuable as field value * Revert fix for zero character as value * Proper variable names for view layouts of options-using fields * They are options not just values * JText the Text of options in the view layouts, since respective form fields do it already
- Loading branch information
Showing
9 changed files
with
61 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage com_fields | ||
* | ||
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
defined('_JEXEC') or die; | ||
|
||
if (!key_exists('field', $displayData)) | ||
{ | ||
return; | ||
} | ||
|
||
$field = $displayData['field']; | ||
$value = $field->value; | ||
|
||
if (!$value) | ||
{ | ||
return; | ||
} | ||
|
||
$value = (array) $value; | ||
$texts = array(); | ||
$options = JFormAbstractlist::getOptionsFromField($field); | ||
|
||
foreach ($options as $optionValue => $optionText) | ||
{ | ||
if (in_array($optionValue, $value)) | ||
{ | ||
$texts[] = JText::_($optionText); | ||
} | ||
} | ||
|
||
|
||
echo htmlentities(implode(', ', $texts)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters