Skip to content

Commit b50ebe3

Browse files
Merge pull request #312 from apghalsasi25/bug#152999_new
Bug #311 fix: Frontend>>Editor field not working correctly.
2 parents feab747 + 4447745 commit b50ebe3

File tree

3 files changed

+82
-51
lines changed

3 files changed

+82
-51
lines changed

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

+21-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22
/**
3-
* @package TJ-UCM
4-
*
5-
* @author TechJoomla <extensions@techjoomla.com>
3+
* @package TJ-UCM
4+
*
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
@@ -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)
@@ -178,7 +179,21 @@
178179

179180
$layout = new JLayoutFile($layoutToUse, JPATH_ROOT . '/components/com_tjfields/layouts/fields');
180181
$output = $layout->render(array('fieldXml' => $xmlField, 'field' => $field));
181-
echo $output;
182+
183+
// To align text, textarea, textareacounter and editor fields properly
184+
185+
if ($field->type == 'Textarea'|| $field->type == 'Textareacounter'|| $field->type == 'Text' || $field->type == 'Editor')
186+
{
187+
?>
188+
<div class="tj-wordwrap">
189+
<?php echo $output; ?>
190+
</div>
191+
<?php
192+
}
193+
else
194+
{
195+
echo $output;
196+
}
182197
?>
183198
</div>
184199
</div>
@@ -188,5 +203,6 @@
188203
}
189204
?>
190205
</div>
206+
</div>
191207
<?php
192208
}

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

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
}
9494

9595
?>
96+
<div class="tjucm-wrapper">
9697
<tr class="row<?php echo $item->id?>">
9798
<?php
9899
if (isset($item->state))
@@ -197,3 +198,4 @@ class="delete-button" type="button"
197198
}
198199
?>
199200
</tr>
201+
</div>

src/components/com_tjucm/site/views/items/tmpl/default.php

+59-46
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,22 @@
4848
$fieldsData = array();
4949
$statusColumnWidth = 0;
5050
?>
51+
<div class="tjucm-wrapper">
5152
<form action="<?php echo JRoute::_($link . '&Itemid=' . $itemId); ?>" method="post" name="adminForm" id="adminForm">
5253
<?php
53-
if (isset($this->items))
54-
{
55-
?>
56-
<div class="page-header">
57-
<h1 class="page-title">
58-
<?php echo strtoupper($this->title) . " " . JText::_("COM_TJUCM_FORM_LIST"); ?>
59-
<h1>
60-
</div> <?php
61-
}?>
62-
<?php echo $this->loadTemplate('filters'); ?>
63-
<div class="pull-right">
54+
if (isset($this->items))
55+
{
56+
?>
57+
<div class="page-header">
58+
<h1 class="page-title">
59+
<?php echo strtoupper($this->title) . " " . JText::_("COM_TJUCM_FORM_LIST"); ?>
60+
</h1>
61+
</div> <?php
62+
}
63+
64+
echo $this->loadTemplate('filters');
65+
?>
66+
<div class="pull-right">
6467
<?php
6568
if ($this->allowedToAdd)
6669
{
@@ -90,38 +93,34 @@
9093
if (!empty($this->showList))
9194
{
9295
if (!empty($this->items))
93-
{?>
94-
<thead>
95-
<tr>
96-
<?php
97-
if (isset($this->items[0]->state))
98-
{
96+
{
97+
?>
98+
<thead>
99+
<tr>
100+
<?php
101+
if (isset($this->items[0]->state))
102+
{
99103
?>
100-
<th class="center" width="3%">
104+
<th class="center" width="3%">
101105
<?php echo JHtml::_('grid.sort', 'JPUBLISHED', 'a.state', $listDirn, $listOrder); ?>
102-
</th>
106+
</th>
103107
<?php
104-
}
105-
?>
106-
<th width="2%">
107-
<?php echo JHtml::_('grid.sort', 'COM_TJUCM_ITEMS_ID', 'a.id', $listDirn, $listOrder); ?>
108-
</th>
109-
110-
<?php
111-
if (!empty($this->ucmTypeParams->allow_draft_save) && $this->ucmTypeParams->allow_draft_save == 1)
112-
{
113-
$statusColumnWidth = 2;
114-
?>
108+
}
109+
?>
115110
<th width="2%">
116111
<?php echo JHtml::_('grid.sort', 'COM_TJUCM_DATA_STATUS', 'a.draft', $listDirn, $listOrder); ?>
117112
</th>
118113
<?php
119-
}
120114

121-
if (!empty($this->listcolumn))
122-
{
123-
JTable::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjfields/tables');
124-
$tjFieldsFieldTable = JTable::getInstance('field', 'TjfieldsTable');
115+
if (!empty($this->ucmTypeParams->allow_draft_save) && $this->ucmTypeParams->allow_draft_save == 1)
116+
{
117+
$statusColumnWidth = 2;
118+
?>
119+
<th width="2%">
120+
<?php echo JHtml::_('grid.sort', 'COM_TJUCM_DATA_STATUS', 'a.draft', $listDirn, $listOrder); ?>
121+
</th>
122+
<?php
123+
}
125124

126125
foreach ($this->listcolumn as $fieldId => $col_name)
127126
{
@@ -137,12 +136,11 @@
137136
}
138137
?>
139138

140-
<th style="word-break: break-word;" width="<?php echo (85 - $statusColumnWidth)/count($this->listcolumn).'%';?>">
139+
<th style="word-break: break-word;" width="<?php echo (85 - $statusColumnWidth) / count($this->listcolumn) . '%';?>">
141140
<?php echo htmlspecialchars($col_name, ENT_COMPAT, 'UTF-8'); ?>
142141
</th>
143142
<?php
144143
}
145-
}
146144

147145
if ($this->canEdit || $this->canDelete)
148146
{
@@ -153,18 +151,18 @@
153151
<?php
154152
}
155153
?>
156-
</tr>
157-
</thead>
158-
<?php
159-
}
160-
}?>
154+
</tr>
155+
</thead>
156+
<?php
157+
}
158+
}?>
161159
<?php
162160
if (!empty($this->items))
163161
{
164162
?>
165163
<tfoot>
166164
<tr>
167-
<td colspan="<?php echo isset($this->items[0]) ? count($this->items[0]->field_values)+3 : 10; ?>">
165+
<td colspan="<?php echo isset($this->items[0]) ? count($this->items[0]->field_values) + 3 : 10; ?>">
168166
<?php echo $this->pagination->getListFooter(); ?>
169167
</td>
170168
</tr>
@@ -197,7 +195,18 @@
197195
{
198196
// Call the JLayout to render the fields in the details view
199197
$layout = new JLayoutFile('list.list', JPATH_ROOT . '/components/com_tjucm/');
200-
echo $layout->render(array('itemsData' => $item, 'created_by' => $this->created_by, 'client' => $this->client, 'xmlFormObject' => $formXml, 'ucmTypeId' => $this->ucmTypeId, 'ucmTypeParams' => $this->ucmTypeParams, 'fieldsData' => $fieldsData, 'formObject' => $formObject));
198+
echo $layout->render(
199+
array(
200+
'itemsData' => $item,
201+
'created_by' => $this->created_by,
202+
'client' => $this->client,
203+
'xmlFormObject' => $formXml,
204+
'ucmTypeId' => $this->ucmTypeId,
205+
'ucmTypeParams' => $this->ucmTypeParams,
206+
'fieldsData' => $fieldsData,
207+
'formObject' => $formObject
208+
)
209+
);
201210
}
202211
}
203212
else
@@ -223,8 +232,11 @@
223232
if ($this->allowedToAdd)
224233
{
225234
?>
226-
<a target="_blank" href="<?php echo JRoute::_('index.php?option=com_tjucm&task=itemform.edit' . $appendUrl, false); ?>" class="btn btn-success btn-small">
227-
<i class="icon-plus"></i><?php echo JText::_('COM_TJUCM_ADD_ITEM'); ?>
235+
<a target="_blank"
236+
href="<?php echo JRoute::_('index.php?option=com_tjucm&task=itemform.edit' . $appendUrl, false); ?>"
237+
class="btn btn-success btn-small">
238+
<i class="icon-plus"></i>
239+
<?php echo JText::_('COM_TJUCM_ADD_ITEM'); ?>
228240
</a>
229241
<?php
230242
}
@@ -235,6 +247,7 @@
235247
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>"/>
236248
<?php echo JHtml::_('form.token'); ?>
237249
</form>
250+
</div>
238251
<?php
239252
if ($this->canDelete)
240253
{

0 commit comments

Comments
 (0)