Skip to content

Commit ce12e91

Browse files
Minor fixes/changes to category forms
1 parent 1ffc981 commit ce12e91

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

administrator/components/com_jtg/models/cat.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ function saveCat()
283283

284284
$input = JFactory::getApplication()->input;
285285
$published = $input->getInt('publish');
286-
$desc = $input->get('desc', '', 'raw');
286+
$desc = $input->get('desc', '', 'string');
287287

288288
if ( (substr($desc, 0, 3) == '<p>') AND (substr($desc, -4, 4) == '</p>') )
289289
{
@@ -302,13 +302,13 @@ function saveCat()
302302

303303
$query = "INSERT INTO #__jtg_cats SET"
304304
. "\n parent_id='" . $parent . "',"
305-
. "\n title='" . $title . "',"
305+
. "\n title=" . $db->quote($title) . ","
306306
. "\n image='" . $image . "',"
307307
. "\n usepace='" . $usepace . "',"
308308
. "\n default_map=" . $default_map . ","
309309
. "\n ordering=" . $maxordering . ","
310310
. "\n checked_out=0,"
311-
. "\n description='" . $desc . "',"
311+
. "\n description=" . $db->quote(htmlentities($desc)) . ","
312312
. "\n published='" . $published . "'";
313313

314314
$db->setQuery($query);
@@ -402,7 +402,7 @@ function updateCat()
402402
}
403403

404404
$published = $input->getInt('publish');
405-
$desc = $input->get('desc', '', 'raw');
405+
$desc = $input->get('desc', '', 'string');
406406

407407
if ( (substr($desc, 0, 3) == '<p>') AND (substr($desc, -4, 4) == '</p>') )
408408
{
@@ -413,11 +413,11 @@ function updateCat()
413413
$parent = $input->getInt('parent');
414414
$query = "UPDATE #__jtg_cats SET"
415415
. "\n parent_id='" . $parent . "',"
416-
. "\n title='" . $title . "',"
416+
. "\n title=" . $db->quote($title) . ","
417417
. "\n image='" . $image . "',"
418418
. "\n usepace='" . $usepace . "',"
419419
. "\n default_map=" . $default_map . ","
420-
. "\n description='" . $desc . "',"
420+
. "\n description=" . $db->quote(htmlentities($desc)) . ","
421421
. "\n published='" . $published . "'"
422422
. "\n WHERE id='" . $id . "'";
423423

administrator/components/com_jtg/views/cats/tmpl/editform.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ class="adminForm" enctype="multipart/form-data">
3838
<tbody>
3939
<tr>
4040
<td width="150px"><?php echo JText::_('COM_JTG_TITLE'); ?></td>
41-
<td><input type="text" name="title"
42-
value="<?php echo $this->data->title; ?>" /> (
43-
<?php echo JText::_($this->data->title);?>)
41+
<td><input type="text" name="title" size="30" maxlength="30"
42+
value="<?php echo $this->data->title; ?>" />
4443
</td>
4544
</tr>
4645
<tr>
@@ -87,7 +86,7 @@ class="adminForm" enctype="multipart/form-data">
8786
</tr>
8887
<tr>
8988
<td><?php echo JText::_('COM_JTG_DESC_JTEXT_ALLOWED'); ?></td>
90-
<td><?php echo $this->editor->display('desc', $this->data->description, '500', '200', '75', '10', false, null); ?>
89+
<td><input type="text" name="desc" size="60" maxlength="255" value="<?php echo $this->data->description; ?>" />
9190
</td>
9291
</tr>
9392
</tbody>

administrator/components/com_jtg/views/cats/tmpl/form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class="adminForm" enctype="multipart/form-data">
3737
<tbody>
3838
<tr>
3939
<td width="150px"><?php echo JText::_('COM_JTG_TITLE'); ?></td>
40-
<td><input type="text" name="title" value="" /></td>
40+
<td><input type="text" name="title" value="" size="30" maxlength="30"/></td>
4141
</tr>
4242
<tr>
4343
<td width="150px"><?php echo JText::_('COM_JTG_PARENT'); ?></td>
@@ -74,7 +74,7 @@ class="adminForm" enctype="multipart/form-data">
7474
</tr>
7575
<tr>
7676
<td><?php echo JText::_('COM_JTG_DESC_JTEXT_ALLOWED'); ?></td>
77-
<td><?php echo $this->editor->display('desc', '', '500', '200', '75', '20', false, null); ?>
77+
<td><input type="text" name="desc" size="60" maxlength="150" value=""/>
7878
</td>
7979
</tr>
8080
</tbody>

0 commit comments

Comments
 (0)