forked from techjoomla/com_tjucm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug techjoomla#311 fix: Frontend>>Editor field not working correctly.
- Loading branch information
Aishwarya
committed
Dec 19, 2019
1 parent
c68c3d6
commit ace10d5
Showing
3 changed files
with
118 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<?php | ||
/** | ||
* @package TJ-UCM | ||
* | ||
* @author TechJoomla <[email protected]> | ||
* @package TJ-UCM | ||
* | ||
* @author TechJoomla <[email protected]> | ||
* @copyright Copyright (c) 2009-2019 TechJoomla. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
// No direct access | ||
|
@@ -63,6 +63,7 @@ | |
$count++; | ||
$fieldCount = 0; | ||
?> | ||
<div class="tjucm-wrapper"> | ||
<div class="row"> | ||
<?php | ||
foreach ($formObject->getFieldset($fieldset->name) as $field) | ||
|
@@ -178,7 +179,21 @@ | |
|
||
$layout = new JLayoutFile($layoutToUse, JPATH_ROOT . '/components/com_tjfields/layouts/fields'); | ||
$output = $layout->render(array('fieldXml' => $xmlField, 'field' => $field)); | ||
echo $output; | ||
|
||
// To align text, textarea, textareacounter and editor fields properly | ||
|
||
if ($field->type == 'Textarea'|| $field->type == 'Textareacounter'|| $field->type == 'Text' || $field->type == 'Editor') | ||
{ | ||
?> | ||
<div class="tj-wordwrap"> | ||
<?php echo $output; ?> | ||
</div> | ||
<?php | ||
} | ||
else | ||
{ | ||
echo $output; | ||
} | ||
?> | ||
</div> | ||
</div> | ||
|
@@ -188,5 +203,6 @@ | |
} | ||
?> | ||
</div> | ||
</div> | ||
<?php | ||
} |
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<?php | ||
/** | ||
* @package TJ-UCM | ||
* @package TJ-UCM | ||
* | ||
* @author TechJoomla <[email protected]> | ||
* @author TechJoomla <[email protected]> | ||
* @copyright Copyright (c) 2009-2019 TechJoomla. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
// No direct access | ||
|
@@ -51,7 +51,7 @@ | |
$xmlFormObject = $displayData['xmlFormObject']; | ||
$formObject = $displayData['formObject']; | ||
$ucmTypeId = $displayData['ucmTypeId']; | ||
$allowDraftSave= $displayData['ucmTypeParams']->allow_draft_save; | ||
$allowDraftSave = $displayData['ucmTypeParams']->allow_draft_save; | ||
|
||
$appendUrl = ''; | ||
$csrf = "&" . Session::getFormToken() . '=1'; | ||
|
@@ -93,13 +93,16 @@ | |
} | ||
|
||
?> | ||
<div class="tjucm-wrapper"> | ||
<tr class="row<?php echo $item->id?>"> | ||
<?php | ||
if (isset($item->state)) | ||
{ | ||
$class = ($canChange) ? 'active' : 'disabled'; ?> | ||
<td class="center"> | ||
<a class="<?php echo $class; ?>" href="<?php echo ($canChange) ? 'index.php?option=com_tjucm&task=item.publish&id=' . $item->id . '&state=' . (($item->state + 1) % 2) . $appendUrl . $csrf : '#'; ?>"> | ||
<a class="<?php echo $class; ?>" | ||
href="<?php echo ($canChange) ? 'index.php?option=com_tjucm&task=item.publish&id=' . | ||
$item->id . '&state=' . (($item->state + 1) % 2) . $appendUrl . $csrf : '#'; ?>"> | ||
<?php | ||
if ($item->state == 1) | ||
{ | ||
|
@@ -116,16 +119,21 @@ | |
} | ||
?> | ||
<td> | ||
<a href="<?php echo Route::_('index.php?option=com_tjucm&view=item&id=' . (int) $item->id . "&client=" . $client . '&Itemid=' . $itemId, false); ?>"> | ||
<a href="<?php echo Route::_( | ||
'index.php?option=com_tjucm&view=item&id=' . | ||
(int) $item->id . "&client=" . $client . '&Itemid=' . $itemId, false | ||
); ?>"> | ||
<?php echo $this->escape($item->id); ?> | ||
</a> | ||
</td> | ||
<?php | ||
if ($allowDraftSave) | ||
{ ?> | ||
{ | ||
?> | ||
<td><?php echo ($item->draft) ? Text::_('COM_TJUCM_DATA_STATUS_DRAFT') : Text::_('COM_TJUCM_DATA_STATUS_SAVE'); ?></td> | ||
<?php | ||
} | ||
|
||
if (!empty($item->field_values)) | ||
{ | ||
foreach ($item->field_values as $key => $fieldValue) | ||
|
@@ -147,7 +155,11 @@ | |
{ | ||
$field = $formObject->getField($tjFieldsFieldTable->name); | ||
$field->setValue($fieldValue); | ||
$layoutToUse = (array_key_exists(ucfirst($tjFieldsFieldTable->type), $fieldLayout)) ? $fieldLayout[ucfirst($tjFieldsFieldTable->type)] : 'field'; | ||
$layoutToUse = ( | ||
array_key_exists( | ||
ucfirst($tjFieldsFieldTable->type), $fieldLayout | ||
) | ||
) ? $fieldLayout[ucfirst($tjFieldsFieldTable->type)] : 'field'; | ||
$layout = new JLayoutFile($layoutToUse, JPATH_ROOT . '/components/com_tjfields/layouts/fields'); | ||
$output = $layout->render(array('fieldXml' => $fieldXml, 'field' => $field)); | ||
echo $output; | ||
|
@@ -156,22 +168,36 @@ | |
</td><?php | ||
} | ||
} | ||
|
||
if ($canEdit || $canDelete || $editown || $deleteOwn) | ||
{ | ||
?> | ||
<td class="center"> | ||
<a target="_blank" href="<?php echo $link; ?>" type="button" title="<?php echo Text::_('COM_TJUCM_VIEW_RECORD');?>"><i class="icon-eye-open"></i></a> | ||
<a target="_blank" href="<?php echo $link; ?>" | ||
type="button" title="<?php echo Text::_('COM_TJUCM_VIEW_RECORD');?>"> | ||
<i class="icon-eye-open"></i> | ||
</a> | ||
<?php | ||
if ($canEdit || $editown) | ||
{ | ||
?> | ||
<a target="_blank" href="<?php echo 'index.php?option=com_tjucm&task=itemform.edit&id=' . $item->id . $appendUrl; ?>" type="button" title="<?php echo Text::_('COM_TJUCM_EDIT_ITEM');?>"> | <i class="icon-apply" aria-hidden="true"></i></a> | ||
<a target="_blank" | ||
href="<?php echo 'index.php?option=com_tjucm&task=itemform.edit&id=' . $item->id . $appendUrl; ?>" | ||
type="button" | ||
title="<?php echo Text::_('COM_TJUCM_EDIT_ITEM');?>"> | | ||
<i class="icon-apply" aria-hidden="true"></i> | ||
</a> | ||
<?php | ||
} | ||
|
||
if ($canDelete || $deleteOwn) | ||
{ | ||
?> | ||
<a href="<?php echo 'index.php?option=com_tjucm&task=itemform.remove' . '&id=' . $item->id . $appendUrl . $csrf; ?>" class="delete-button" type="button" title="<?php echo Text::_('COM_TJUCM_DELETE_ITEM');?>"> | <i class="icon-delete" aria-hidden="true"></i></a> | ||
<a href="<?php echo 'index.php?option=com_tjucm&task=itemform.remove' . '&id=' . $item->id . $appendUrl . $csrf; ?>" | ||
class="delete-button" type="button" | ||
title="<?php echo Text::_('COM_TJUCM_DELETE_ITEM');?>"> | | ||
<i class="icon-delete" aria-hidden="true"></i> | ||
</a> | ||
<?php | ||
} | ||
?> | ||
|
@@ -180,3 +206,4 @@ | |
} | ||
?> | ||
</tr> | ||
</div> |
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