Skip to content

Commit

Permalink
Minor fixes/changes to category forms
Browse files Browse the repository at this point in the history
  • Loading branch information
mastervanleeuwen committed Feb 18, 2024
1 parent 1ffc981 commit ce12e91
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
12 changes: 6 additions & 6 deletions administrator/components/com_jtg/models/cat.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function saveCat()

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

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

$query = "INSERT INTO #__jtg_cats SET"
. "\n parent_id='" . $parent . "',"
. "\n title='" . $title . "',"
. "\n title=" . $db->quote($title) . ","
. "\n image='" . $image . "',"
. "\n usepace='" . $usepace . "',"
. "\n default_map=" . $default_map . ","
. "\n ordering=" . $maxordering . ","
. "\n checked_out=0,"
. "\n description='" . $desc . "',"
. "\n description=" . $db->quote(htmlentities($desc)) . ","
. "\n published='" . $published . "'";

$db->setQuery($query);
Expand Down Expand Up @@ -402,7 +402,7 @@ function updateCat()
}

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

if ( (substr($desc, 0, 3) == '<p>') AND (substr($desc, -4, 4) == '</p>') )
{
Expand All @@ -413,11 +413,11 @@ function updateCat()
$parent = $input->getInt('parent');
$query = "UPDATE #__jtg_cats SET"
. "\n parent_id='" . $parent . "',"
. "\n title='" . $title . "',"
. "\n title=" . $db->quote($title) . ","
. "\n image='" . $image . "',"
. "\n usepace='" . $usepace . "',"
. "\n default_map=" . $default_map . ","
. "\n description='" . $desc . "',"
. "\n description=" . $db->quote(htmlentities($desc)) . ","
. "\n published='" . $published . "'"
. "\n WHERE id='" . $id . "'";

Expand Down
7 changes: 3 additions & 4 deletions administrator/components/com_jtg/views/cats/tmpl/editform.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ class="adminForm" enctype="multipart/form-data">
<tbody>
<tr>
<td width="150px"><?php echo JText::_('COM_JTG_TITLE'); ?></td>
<td><input type="text" name="title"
value="<?php echo $this->data->title; ?>" /> (
<?php echo JText::_($this->data->title);?>)
<td><input type="text" name="title" size="30" maxlength="30"
value="<?php echo $this->data->title; ?>" />
</td>
</tr>
<tr>
Expand Down Expand Up @@ -87,7 +86,7 @@ class="adminForm" enctype="multipart/form-data">
</tr>
<tr>
<td><?php echo JText::_('COM_JTG_DESC_JTEXT_ALLOWED'); ?></td>
<td><?php echo $this->editor->display('desc', $this->data->description, '500', '200', '75', '10', false, null); ?>
<td><input type="text" name="desc" size="60" maxlength="255" value="<?php echo $this->data->description; ?>" />
</td>
</tr>
</tbody>
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_jtg/views/cats/tmpl/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class="adminForm" enctype="multipart/form-data">
<tbody>
<tr>
<td width="150px"><?php echo JText::_('COM_JTG_TITLE'); ?></td>
<td><input type="text" name="title" value="" /></td>
<td><input type="text" name="title" value="" size="30" maxlength="30"/></td>
</tr>
<tr>
<td width="150px"><?php echo JText::_('COM_JTG_PARENT'); ?></td>
Expand Down Expand Up @@ -74,7 +74,7 @@ class="adminForm" enctype="multipart/form-data">
</tr>
<tr>
<td><?php echo JText::_('COM_JTG_DESC_JTEXT_ALLOWED'); ?></td>
<td><?php echo $this->editor->display('desc', '', '500', '200', '75', '20', false, null); ?>
<td><input type="text" name="desc" size="60" maxlength="150" value=""/>
</td>
</tr>
</tbody>
Expand Down

0 comments on commit ce12e91

Please sign in to comment.