Skip to content

Commit 3289571

Browse files
author
Aishwarya
committed
Bug techjoomla#311 fix: Frontend>>Editor field not working correctly.
1 parent ddac4a5 commit 3289571

File tree

4 files changed

+151
-105
lines changed

4 files changed

+151
-105
lines changed

src/components/com_tjucm/media/css/tjucm.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ margin-left:5px !important;
77
width:200px !important;
88
}
99

10-
p.tj-wordwrap{
10+
.tjucm-wrapper .tj-wordwrap{
1111
word-break: break-word;
1212
}

src/components/com_tjucm/site/layouts/detail/fields.php

+12-8
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
$count++;
6464
$fieldCount = 0;
6565
?>
66+
<div class="tjucm-wrapper">
6667
<div class="row">
6768
<?php
6869
foreach ($formObject->getFieldset($fieldset->name) as $field)
@@ -162,7 +163,7 @@
162163
$layoutToUse = (array_key_exists($field->type, $fieldLayout)) ? $fieldLayout[$field->type] : 'field';
163164
?>
164165
<div class="<?php echo $controlGroupDivClass;?>">
165-
<div class="<?php echo $labelDivClass;?>">
166+
<div class="<?php echo $labelDivClass;?>">
166167
<?php echo $field->label; ?>:
167168
</div>
168169
<div class="<?php echo $controlDivClass;?>">
@@ -186,18 +187,20 @@
186187
$layout = new JLayoutFile($layoutToUse, JPATH_ROOT . '/components/com_tjfields/layouts/fields');
187188
$output = $layout->render(array('fieldXml' => $xmlField, 'field' => $field));
188189

189-
// To align text, textarea and textareacounter fields properly
190+
// To align text, textarea, textareacounter and editor fields properly
190191

191-
if ($field->type == 'Textarea'|| $field->type == 'Textareacounter'|| $field->type == 'Text')
192+
if ($field->type == 'Textarea'|| $field->type == 'Textareacounter'|| $field->type == 'Text' || $field->type == 'Editor')
192193
{
193194
?>
194-
<p class="tj-wordwrap">
195+
<div class="tj-wordwrap">
195196
<?php echo $output; ?>
196-
</p>
197-
<?php
197+
</div>
198+
<?php
199+
}
200+
else
201+
{
202+
echo $output;
198203
}
199-
200-
echo $output;
201204
?>
202205
</div>
203206
</div>
@@ -207,5 +210,6 @@
207210
}
208211
?>
209212
</div>
213+
</div>
210214
<?php
211215
}

src/components/com_tjucm/site/layouts/list/list.php

+38-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22
/**
3-
* @package TJ-UCM
3+
* @package TJ-UCM
44
*
5-
* @author TechJoomla <extensions@techjoomla.com>
5+
* @author TechJoomla <extensions@techjoomla.com>
66
* @copyright Copyright (c) 2009-2019 TechJoomla. All rights reserved.
7-
* @license GNU General Public License version 2 or later; see LICENSE.txt
7+
* @license GNU General Public License version 2 or later; see LICENSE.txt
88
*/
99

1010
// No direct access
@@ -51,7 +51,7 @@
5151
$xmlFormObject = $displayData['xmlFormObject'];
5252
$formObject = $displayData['formObject'];
5353
$ucmTypeId = $displayData['ucmTypeId'];
54-
$allowDraftSave= $displayData['ucmTypeParams']->allow_draft_save;
54+
$allowDraftSave = $displayData['ucmTypeParams']->allow_draft_save;
5555

5656
$appendUrl = '';
5757
$csrf = "&" . Session::getFormToken() . '=1';
@@ -93,13 +93,16 @@
9393
}
9494

9595
?>
96+
<div class="tjucm-wrapper">
9697
<tr class="row<?php echo $item->id?>">
9798
<?php
9899
if (isset($item->state))
99100
{
100101
$class = ($canChange) ? 'active' : 'disabled'; ?>
101102
<td class="center">
102-
<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 : '#'; ?>">
103+
<a class="<?php echo $class; ?>"
104+
href="<?php echo ($canChange) ? 'index.php?option=com_tjucm&task=item.publish&id=' .
105+
$item->id . '&state=' . (($item->state + 1) % 2) . $appendUrl . $csrf : '#'; ?>">
103106
<?php
104107
if ($item->state == 1)
105108
{
@@ -116,16 +119,21 @@
116119
}
117120
?>
118121
<td>
119-
<a href="<?php echo Route::_('index.php?option=com_tjucm&view=item&id=' . (int) $item->id . "&client=" . $client . '&Itemid=' . $itemId, false); ?>">
122+
<a href="<?php echo Route::_(
123+
'index.php?option=com_tjucm&view=item&id=' .
124+
(int) $item->id . "&client=" . $client . '&Itemid=' . $itemId, false
125+
); ?>">
120126
<?php echo $this->escape($item->id); ?>
121127
</a>
122128
</td>
123129
<?php
124130
if ($allowDraftSave)
125-
{ ?>
131+
{
132+
?>
126133
<td><?php echo ($item->draft) ? Text::_('COM_TJUCM_DATA_STATUS_DRAFT') : Text::_('COM_TJUCM_DATA_STATUS_SAVE'); ?></td>
127134
<?php
128135
}
136+
129137
if (!empty($item->field_values))
130138
{
131139
foreach ($item->field_values as $key => $fieldValue)
@@ -147,7 +155,11 @@
147155
{
148156
$field = $formObject->getField($tjFieldsFieldTable->name);
149157
$field->setValue($fieldValue);
150-
$layoutToUse = (array_key_exists(ucfirst($tjFieldsFieldTable->type), $fieldLayout)) ? $fieldLayout[ucfirst($tjFieldsFieldTable->type)] : 'field';
158+
$layoutToUse = (
159+
array_key_exists(
160+
ucfirst($tjFieldsFieldTable->type), $fieldLayout
161+
)
162+
) ? $fieldLayout[ucfirst($tjFieldsFieldTable->type)] : 'field';
151163
$layout = new JLayoutFile($layoutToUse, JPATH_ROOT . '/components/com_tjfields/layouts/fields');
152164
$output = $layout->render(array('fieldXml' => $fieldXml, 'field' => $field));
153165
echo $output;
@@ -156,22 +168,36 @@
156168
</td><?php
157169
}
158170
}
171+
159172
if ($canEdit || $canDelete || $editown || $deleteOwn)
160173
{
161174
?>
162175
<td class="center">
163-
<a target="_blank" href="<?php echo $link; ?>" type="button" title="<?php echo Text::_('COM_TJUCM_VIEW_RECORD');?>"><i class="icon-eye-open"></i></a>
176+
<a target="_blank" href="<?php echo $link; ?>"
177+
type="button" title="<?php echo Text::_('COM_TJUCM_VIEW_RECORD');?>">
178+
<i class="icon-eye-open"></i>
179+
</a>
164180
<?php
165181
if ($canEdit || $editown)
166182
{
167183
?>
168-
<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>
184+
<a target="_blank"
185+
href="<?php echo 'index.php?option=com_tjucm&task=itemform.edit&id=' . $item->id . $appendUrl; ?>"
186+
type="button"
187+
title="<?php echo Text::_('COM_TJUCM_EDIT_ITEM');?>"> |
188+
<i class="icon-apply" aria-hidden="true"></i>
189+
</a>
169190
<?php
170191
}
192+
171193
if ($canDelete || $deleteOwn)
172194
{
173195
?>
174-
<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>
196+
<a href="<?php echo 'index.php?option=com_tjucm&task=itemform.remove' . '&id=' . $item->id . $appendUrl . $csrf; ?>"
197+
class="delete-button" type="button"
198+
title="<?php echo Text::_('COM_TJUCM_DELETE_ITEM');?>"> |
199+
<i class="icon-delete" aria-hidden="true"></i>
200+
</a>
175201
<?php
176202
}
177203
?>
@@ -180,3 +206,4 @@
180206
}
181207
?>
182208
</tr>
209+
</div>

0 commit comments

Comments
 (0)