getDbo();
+ $db = $this->getDbo();
$query = $db->getQuery(true)
->delete($db->quoteName('#__banner_tracks'));
@@ -374,7 +374,7 @@ protected function getCategoryName()
if ($categoryId)
{
- $db = $this->getDbo();
+ $db = $this->getDbo();
$query = $db->getQuery(true)
->select('title')
->from($db->quoteName('#__categories'))
@@ -411,7 +411,7 @@ protected function getClientName()
if ($clientId)
{
- $db = $this->getDbo();
+ $db = $this->getDbo();
$query = $db->getQuery(true)
->select('name')
->from($db->quoteName('#__banner_clients'))
@@ -470,21 +470,21 @@ public function getContent()
{
if (!isset($this->content))
{
- $this->content = '"' . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_NAME')) . '","' .
- str_replace('"', '""', JText::_('COM_BANNERS_HEADING_CLIENT')) . '","' .
- str_replace('"', '""', JText::_('JCATEGORY')) . '","' .
- str_replace('"', '""', JText::_('COM_BANNERS_HEADING_TYPE')) . '","' .
- str_replace('"', '""', JText::_('COM_BANNERS_HEADING_COUNT')) . '","' .
- str_replace('"', '""', JText::_('JDATE')) . '"' . "\n";
+ $this->content = '"' . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_NAME')) . '","'
+ . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_CLIENT')) . '","'
+ . str_replace('"', '""', JText::_('JCATEGORY')) . '","'
+ . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_TYPE')) . '","'
+ . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_COUNT')) . '","'
+ . str_replace('"', '""', JText::_('JDATE')) . '"' . "\n";
foreach ($this->getItems() as $item)
{
- $this->content .= '"' . str_replace('"', '""', $item->name) . '","' .
- str_replace('"', '""', $item->client_name) . '","' .
- str_replace('"', '""', $item->category_title) . '","' .
- str_replace('"', '""', ($item->track_type == 1 ? JText::_('COM_BANNERS_IMPRESSION') : JText::_('COM_BANNERS_CLICK'))) . '","' .
- str_replace('"', '""', $item->count) . '","' .
- str_replace('"', '""', $item->track_date) . '"' . "\n";
+ $this->content .= '"' . str_replace('"', '""', $item->name) . '","'
+ . str_replace('"', '""', $item->client_name) . '","'
+ . str_replace('"', '""', $item->category_title) . '","'
+ . str_replace('"', '""', ($item->track_type == 1 ? JText::_('COM_BANNERS_IMPRESSION') : JText::_('COM_BANNERS_CLICK'))) . '","'
+ . str_replace('"', '""', $item->count) . '","'
+ . str_replace('"', '""', $item->track_date) . '"' . "\n";
}
if ($this->getState('compressed'))
diff --git a/administrator/components/com_banners/tables/banner.php b/administrator/components/com_banners/tables/banner.php
index f853ec9b7619a..dfa2ab822cd05 100644
--- a/administrator/components/com_banners/tables/banner.php
+++ b/administrator/components/com_banners/tables/banner.php
@@ -65,11 +65,16 @@ public function check()
$this->name = htmlspecialchars_decode($this->name, ENT_QUOTES);
// Set alias
- $this->alias = JApplicationHelper::stringURLSafe($this->alias);
+ if (trim($this->alias) == '')
+ {
+ $this->alias = $this->name;
+ }
+
+ $this->alias = JApplicationHelper::stringURLSafe($this->alias, $this->language);
- if (empty($this->alias))
+ if (trim(str_replace('-', '', $this->alias)) == '')
{
- $this->alias = JApplicationHelper::stringURLSafe($this->name);
+ $this->alias = JFactory::getDate()->format("Y-m-d-H-i-s");
}
// Check the publish down date is not earlier than publish up.
diff --git a/administrator/components/com_banners/tables/client.php b/administrator/components/com_banners/tables/client.php
index ae0e62f1fe4b9..998e63d87855d 100644
--- a/administrator/components/com_banners/tables/client.php
+++ b/administrator/components/com_banners/tables/client.php
@@ -86,10 +86,10 @@ public function publish($pks = null, $state = 1, $userId = 0)
// Update the publishing state for rows with the given primary keys.
$this->_db->setQuery(
- 'UPDATE ' . $this->_db->quoteName($this->_tbl) .
- ' SET ' . $this->_db->quoteName('state') . ' = ' . (int) $state .
- ' WHERE (' . $where . ')' .
- $checkin
+ 'UPDATE ' . $this->_db->quoteName($this->_tbl)
+ . ' SET ' . $this->_db->quoteName('state') . ' = ' . (int) $state
+ . ' WHERE (' . $where . ')'
+ . $checkin
);
try
diff --git a/administrator/components/com_banners/views/banner/tmpl/edit.php b/administrator/components/com_banners/views/banner/tmpl/edit.php
index 8c3b53e53d64c..4c299b4588fac 100644
--- a/administrator/components/com_banners/views/banner/tmpl/edit.php
+++ b/administrator/components/com_banners/views/banner/tmpl/edit.php
@@ -11,7 +11,7 @@
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.formvalidator');
-JHtml::_('formbehavior.chosen', 'select');
+JHtml::_('formbehavior.chosen', 'select', null, array('disable_search_threshold' => 0 ));
JFactory::getDocument()->addScriptDeclaration('
Joomla.submitbutton = function(task)
@@ -23,12 +23,12 @@
};
jQuery(document).ready(function ($){
$("#jform_type").on("change", function (a, params) {
-
+
var v = typeof(params) !== "object" ? $("#jform_type").val() : params.selected;
-
+
var img_url = $("#image, #url");
var custom = $("#custom");
-
+
switch (v) {
case "0":
// Image
diff --git a/administrator/components/com_banners/views/banners/tmpl/default.php b/administrator/components/com_banners/views/banners/tmpl/default.php
index f4eabd6ac8b5e..a87a929e44f0a 100644
--- a/administrator/components/com_banners/views/banners/tmpl/default.php
+++ b/administrator/components/com_banners/views/banners/tmpl/default.php
@@ -97,6 +97,7 @@
state, $i, 'clients.', $canChange); ?>
state === 2 ? 'un' : '') . 'archive', 'cb' . $i, 'clients');
diff --git a/administrator/components/com_banners/views/clients/view.html.php b/administrator/components/com_banners/views/clients/view.html.php
index 295aa03a86358..29f4b8aa4b1ae 100644
--- a/administrator/components/com_banners/views/clients/view.html.php
+++ b/administrator/components/com_banners/views/clients/view.html.php
@@ -128,12 +128,12 @@ protected function addToolbar()
protected function getSortFields()
{
return array(
- 'a.status' => JText::_('JSTATUS'),
- 'a.name' => JText::_('COM_BANNERS_HEADING_CLIENT'),
- 'contact' => JText::_('COM_BANNERS_HEADING_CONTACT'),
+ 'a.status' => JText::_('JSTATUS'),
+ 'a.name' => JText::_('COM_BANNERS_HEADING_CLIENT'),
+ 'contact' => JText::_('COM_BANNERS_HEADING_CONTACT'),
'client_name' => JText::_('COM_BANNERS_HEADING_CLIENT'),
- 'nbanners' => JText::_('COM_BANNERS_HEADING_ACTIVE'),
- 'a.id' => JText::_('JGRID_HEADING_ID')
+ 'nbanners' => JText::_('COM_BANNERS_HEADING_ACTIVE'),
+ 'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
diff --git a/administrator/components/com_banners/views/tracks/view.html.php b/administrator/components/com_banners/views/tracks/view.html.php
index f623d70ac5af1..0135cafaa5c40 100644
--- a/administrator/components/com_banners/views/tracks/view.html.php
+++ b/administrator/components/com_banners/views/tracks/view.html.php
@@ -104,7 +104,6 @@ protected function addToolbar()
JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_TRACKS');
JHtmlSidebar::setAction('index.php?option=com_banners&view=tracks');
-
}
/**
@@ -117,10 +116,10 @@ protected function addToolbar()
protected function getSortFields()
{
return array(
- 'b.name' => JText::_('COM_BANNERS_HEADING_NAME'),
- 'cl.name' => JText::_('COM_BANNERS_HEADING_CLIENT'),
+ 'b.name' => JText::_('COM_BANNERS_HEADING_NAME'),
+ 'cl.name' => JText::_('COM_BANNERS_HEADING_CLIENT'),
'track_type' => JText::_('COM_BANNERS_HEADING_TYPE'),
- 'count' => JText::_('COM_BANNERS_HEADING_COUNT'),
+ 'count' => JText::_('COM_BANNERS_HEADING_COUNT'),
'track_date' => JText::_('JDATE')
);
}
diff --git a/administrator/components/com_categories/categories.xml b/administrator/components/com_categories/categories.xml
index 16b1b1d1e4786..2570edb438169 100644
--- a/administrator/components/com_categories/categories.xml
+++ b/administrator/components/com_categories/categories.xml
@@ -25,5 +25,3 @@
-
-
diff --git a/administrator/components/com_categories/helpers/categories.php b/administrator/components/com_categories/helpers/categories.php
index 60c74bcbc9420..e4589f6704bbd 100644
--- a/administrator/components/com_categories/helpers/categories.php
+++ b/administrator/components/com_categories/helpers/categories.php
@@ -109,4 +109,50 @@ public static function getAssociations($pk, $extension = 'com_content')
return $associations;
}
+
+ /**
+ * Check if Category ID exists otherwise assign to ROOT category.
+ *
+ * @param mixed $catid Name or ID of category.
+ * @param string $extension Extension that triggers this function
+ *
+ * @return int $catid Category ID.
+ */
+ public static function validateCategoryId($catid, $extension)
+ {
+ JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_categories/tables');
+
+ $categoryTable = JTable::getInstance('Category');
+
+ $data = array();
+ $data['id'] = $catid;
+ $data['extension'] = $extension;
+
+ if (!$categoryTable->load($data))
+ {
+ $catid = 0;
+ }
+
+ return (int) $catid;
+ }
+
+ /**
+ * Create new Category from within item view.
+ *
+ * @param array $data Array of data for new category.
+ *
+ * @return integer.
+ */
+ public static function createCategory($data)
+ {
+ JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_categories/models');
+ JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_categories/tables');
+
+ $categoryModel = JModelLegacy::getInstance('Category', 'CategoriesModel');
+ $categoryModel->save($data);
+
+ $catid = $categoryModel->getState('category.id');
+
+ return $catid;
+ }
}
diff --git a/administrator/components/com_categories/models/fields/categoryedit.php b/administrator/components/com_categories/models/fields/categoryedit.php
index 9789b17e9e5c8..ad352f6d0083e 100644
--- a/administrator/components/com_categories/models/fields/categoryedit.php
+++ b/administrator/components/com_categories/models/fields/categoryedit.php
@@ -20,6 +20,14 @@
*/
class JFormFieldCategoryEdit extends JFormFieldList
{
+ /**
+ * To allow creation of new categories.
+ *
+ * @var int
+ * @since 3.6
+ */
+ protected $allowAdd;
+
/**
* A flexible category list that respects access controls
*
@@ -28,6 +36,77 @@ class JFormFieldCategoryEdit extends JFormFieldList
*/
public $type = 'CategoryEdit';
+ /**
+ * Method to attach a JForm object to the field.
+ *
+ * @param SimpleXMLElement $element The SimpleXMLElement object representing the tag for the form field object.
+ * @param mixed $value The form field value to validate.
+ * @param string $group The field name group control value. This acts as as an array container for the field.
+ * For example if the field has name="foo" and the group value is set to "bar" then the
+ * full field name would end up being "bar[foo]".
+ *
+ * @return boolean True on success.
+ *
+ * @see JFormField::setup()
+ * @since 3.2
+ */
+ public function setup(SimpleXMLElement $element, $value, $group = null)
+ {
+ $return = parent::setup($element, $value, $group);
+
+ if ($return)
+ {
+ $this->allowAdd = isset($this->element['allowAdd']) ? $this->element['allowAdd'] : '';
+ }
+
+ return $return;
+ }
+
+ /**
+ * Method to get certain otherwise inaccessible properties from the form field object.
+ *
+ * @param string $name The property name for which to the the value.
+ *
+ * @return mixed The property value or null.
+ *
+ * @since 3.6
+ */
+ public function __get($name)
+ {
+ switch ($name)
+ {
+ case 'allowAdd':
+ return $this->$name;
+ }
+
+ return parent::__get($name);
+ }
+
+ /**
+ * Method to set certain otherwise inaccessible properties of the form field object.
+ *
+ * @param string $name The property name for which to the the value.
+ * @param mixed $value The value of the property.
+ *
+ * @return void
+ *
+ * @since 3.6
+ */
+ public function __set($name, $value)
+ {
+ $value = (string) $value;
+
+ switch ($name)
+ {
+ case 'allowAdd':
+ $value = (string) $value;
+ $this->$name = ($value === 'true' || $value === $name || $value === '1');
+ break;
+ default:
+ parent::__set($name, $value);
+ }
+ }
+
/**
* Method to get a list of categories that respects access controls and can be used for
* either category assignment or parent category assignment in edit screens.
@@ -244,4 +323,85 @@ protected function getOptions()
// Merge any additional options in the XML definition.
return array_merge(parent::getOptions(), $options);
}
+
+ /**
+ * Method to get the field input markup for a generic list.
+ * Use the multiple attribute to enable multiselect.
+ *
+ * @return string The field input markup.
+ *
+ * @since 3.6
+ */
+ protected function getInput()
+ {
+ $html = array();
+ $class = array();
+ $attr = '';
+
+ // Initialize some field attributes.
+ $class[] = !empty($this->class) ? $this->class : '';
+
+ if ($this->allowAdd)
+ {
+ $customGroupText = JText::_('JGLOBAL_CUSTOM_CATEGORY');
+
+ $class[] = 'chzn-custom-value';
+ $attr .= ' data-custom_group_text="' . $customGroupText . '" '
+ . 'data-no_results_text="' . JText::_('JGLOBAL_ADD_CUSTOM_CATEGORY') . '" '
+ . 'data-placeholder="' . JText::_('JGLOBAL_TYPE_OR_SELECT_CATEGORY') . '" ';
+ }
+
+ if ($class)
+ {
+ $attr .= 'class="' . implode(' ', $class) . '"';
+ }
+
+ $attr .= !empty($this->size) ? ' size="' . $this->size . '"' : '';
+ $attr .= $this->multiple ? ' multiple' : '';
+ $attr .= $this->required ? ' required aria-required="true"' : '';
+ $attr .= $this->autofocus ? ' autofocus' : '';
+
+ // To avoid user's confusion, readonly="true" should imply disabled="true".
+ if ((string) $this->readonly == '1' || (string) $this->readonly == 'true' || (string) $this->disabled == '1'|| (string) $this->disabled == 'true')
+ {
+ $attr .= ' disabled="disabled"';
+ }
+
+ // Initialize JavaScript field attributes.
+ $attr .= $this->onchange ? ' onchange="' . $this->onchange . '"' : '';
+
+ // Get the field options.
+ $options = (array) $this->getOptions();
+
+ // Create a read-only list (no name) with hidden input(s) to store the value(s).
+ if ((string) $this->readonly == '1' || (string) $this->readonly == 'true')
+ {
+ $html[] = JHtml::_('select.genericlist', $options, '', trim($attr), 'value', 'text', $this->value, $this->id);
+
+ // E.g. form field type tag sends $this->value as array
+ if ($this->multiple && is_array($this->value))
+ {
+ if (!count($this->value))
+ {
+ $this->value[] = '';
+ }
+
+ foreach ($this->value as $value)
+ {
+ $html[] = ' ';
+ }
+ }
+ else
+ {
+ $html[] = ' ';
+ }
+ }
+ else
+ // Create a regular list.
+ {
+ $html[] = JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id);
+ }
+
+ return implode($html);
+ }
}
diff --git a/administrator/components/com_categories/models/fields/modal/category.php b/administrator/components/com_categories/models/fields/modal/category.php
index b0e8b5fb9d4d8..6adf6db29c436 100644
--- a/administrator/components/com_categories/models/fields/modal/category.php
+++ b/administrator/components/com_categories/models/fields/modal/category.php
@@ -19,7 +19,7 @@ class JFormFieldModal_Category extends JFormField
/**
* The form field type.
*
- * @var string
+ * @var string
* @since 1.6
*/
protected $type = 'Modal_Category';
@@ -27,7 +27,7 @@ class JFormFieldModal_Category extends JFormField
/**
* Method to get the field input markup.
*
- * @return string The field input markup.
+ * @return string The field input markup.
*
* @since 1.6
*/
@@ -48,6 +48,9 @@ protected function getInput()
// Load language
JFactory::getLanguage()->load('com_categories', JPATH_ADMINISTRATOR);
+ // The active category id field.
+ $value = (int) $this->value > 0 ? (int) $this->value : '';
+
// Build the script.
$script = array();
@@ -58,7 +61,11 @@ protected function getInput()
if ($allowEdit)
{
- $script[] = ' jQuery("#' . $this->id . '_edit").removeClass("hidden");';
+ $script[] = ' if (id == "' . (int) $this->value . '") {';
+ $script[] = ' jQuery("#' . $this->id . '_edit").removeClass("hidden");';
+ $script[] = ' } else {';
+ $script[] = ' jQuery("#' . $this->id . '_edit").addClass("hidden");';
+ $script[] = ' }';
}
if ($allowClear)
@@ -66,7 +73,12 @@ protected function getInput()
$script[] = ' jQuery("#' . $this->id . '_clear").removeClass("hidden");';
}
- $script[] = ' jQuery("#modalCategory-' . $this->id . '").modal("hide");';
+ $script[] = ' jQuery("#categorySelect' . $this->id . 'Modal").modal("hide");';
+ $script[] = ' }';
+
+ // Edit button script
+ $script[] = ' function jEditCategory_' . $value . '(title) {';
+ $script[] = ' document.getElementById("' . $this->id . '_name").value = title;';
$script[] = ' }';
// Clear button script
@@ -93,21 +105,31 @@ protected function getInput()
// Setup variables for display.
$html = array();
- $link = 'index.php?option=com_categories&view=categories&layout=modal&tmpl=component&extension='
- . $extension . '&function=jSelectCategory_' . $this->id;
+
+ $linkCategories = 'index.php?option=com_categories&view=categories&layout=modal&tmpl=component'
+ . '&extension=' . $extension
+ . '&function=jSelectCategory_' . $this->id;
+
+ $linkCategory = 'index.php?option=com_categories&view=category&layout=modal&tmpl=component'
+ . '&task=category.edit'
+ . '&function=jEditCategory_' . $value;
if (isset($this->element['language']))
{
- $link .= '&forcedLanguage=' . $this->element['language'];
+ $linkCategories .= '&forcedLanguage=' . $this->element['language'];
+ $linkCategory .= '&forcedLanguage=' . $this->element['language'];
}
- if ((int) $this->value > 0)
+ $urlSelect = $linkCategories . '&' . JSession::getFormToken() . '=1';
+ $urlEdit = $linkCategory . '&id=' . $value . '&' . JSession::getFormToken() . '=1';
+
+ if ($value)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('title'))
->from($db->quoteName('#__categories'))
- ->where($db->quoteName('id') . ' = ' . (int) $this->value);
+ ->where($db->quoteName('id') . ' = ' . (int) $value);
$db->setQuery($query);
try
@@ -127,21 +149,16 @@ protected function getInput()
$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
- // The active category id field.
- if (0 == (int) $this->value)
- {
- $value = '';
- }
- else
- {
- $value = (int) $this->value;
- }
-
// The current category display field.
$html[] = '';
- $html[] = ' ';
- $html[] = ' ';
+
+ // Select category button
+ $html[] = ''
. ' ' . JText::_('JSELECT')
. ' ';
@@ -151,32 +168,21 @@ protected function getInput()
{
$html[] = ''
- . ' ' . JText::_('JACTION_EDIT')
+ . ' id="' . $this->id . '_edit"'
+ . ' data-toggle="modal"'
+ . ' role="button"'
+ . ' href="#categoryEdit' . $value . 'Modal"'
+ . ' title="' . JHtml::tooltipText('COM_CATEGORIES_EDIT_CATEGORY') . '">'
+ . ' ' . JText::_('JACTION_EDIT')
. ' ';
}
- $html[] = JHtml::_(
- 'bootstrap.renderModal',
- 'modalCategory-' . $this->id,
- array(
- 'url' => $link . '&' . JSession::getFormToken() . '=1"',
- 'title' => JText::_('COM_CATEGORIES_SELECT_A_CATEGORY'),
- 'width' => '800px',
- 'height' => '300px',
- 'footer' => ''
- . JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . ' '
- )
- );
-
// Clear category button
if ($allowClear)
{
$html[] = ''
. ' ' . JText::_('JCLEAR')
. ' ';
@@ -184,13 +190,50 @@ protected function getInput()
$html[] = ' ';
- // Note: class='required' for client side validation
- $class = '';
+ // Select category modal
+ $html[] = JHtml::_(
+ 'bootstrap.renderModal',
+ 'categorySelect' . $this->id . 'Modal',
+ array(
+ 'title' => JText::_('COM_CATEGORIES_SELECT_A_CATEGORY'),
+ 'url' => $urlSelect,
+ 'height' => '400px',
+ 'width' => '800px',
+ 'bodyHeight' => '70',
+ 'modalWidth' => '80',
+ 'footer' => ''
+ . JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . ' ',
+ )
+ );
- if ($this->required)
- {
- $class = ' class="required modal-value"';
- }
+ // Edit category modal
+ $html[] = JHtml::_(
+ 'bootstrap.renderModal',
+ 'categoryEdit' . $value . 'Modal',
+ array(
+ 'title' => JText::_('COM_CATEGORIES_EDIT_CATEGORY'),
+ 'backdrop' => 'static',
+ 'keyboard' => false,
+ 'closeButton' => false,
+ 'url' => $urlEdit,
+ 'height' => '400px',
+ 'width' => '800px',
+ 'bodyHeight' => '70',
+ 'modalWidth' => '80',
+ 'footer' => ''
+ . JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . ' '
+ . ''
+ . JText::_("JSAVE") . ' '
+ . ''
+ . JText::_("JAPPLY") . ' ',
+ )
+ );
+
+ // Note: class='required' for client side validation
+ $class = $this->required ? ' class="required modal-value"' : '';
$html[] = ' ';
diff --git a/administrator/components/com_categories/models/forms/category.xml b/administrator/components/com_categories/models/forms/category.xml
index b13683b368ff3..1b41ed27ac806 100644
--- a/administrator/components/com_categories/models/forms/category.xml
+++ b/administrator/components/com_categories/models/forms/category.xml
@@ -1,48 +1,56 @@
- —', $item->level - 1) ?>
+ $item->level)); ?>
checked_out) : ?>
editor, $item->checked_out_time, 'categories.', $canCheckin); ?>
diff --git a/administrator/components/com_categories/views/categories/tmpl/modal.php b/administrator/components/com_categories/views/categories/tmpl/modal.php
index b6e243d5c0169..b10924e8ae63c 100644
--- a/administrator/components/com_categories/views/categories/tmpl/modal.php
+++ b/administrator/components/com_categories/views/categories/tmpl/modal.php
@@ -20,113 +20,125 @@
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
+
JHtml::_('behavior.core');
-JHtml::_('bootstrap.tooltip');
+JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom'));
JHtml::_('formbehavior.chosen', 'select');
+// Special case for the search field tooltip.
+$searchFilterDesc = $this->filterForm->getFieldAttribute('search', 'description', null, 'filter');
+JHtml::_('bootstrap.tooltip', '#filter_search', array('title' => JText::_($searchFilterDesc), 'placement' => 'bottom'));
+
$extension = $this->escape($this->state->get('filter.extension'));
$function = $app->input->getCmd('function', 'jSelectCategory');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
?>
-
-
- $this)); ?>
- items)) : ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- pagination->getListFooter(); ?>
-
-
-
-
- 'icon-trash',
- 0 => 'icon-unpublish',
- 1 => 'icon-publish',
- 2 => 'icon-archive',
- );
- ?>
- items as $i => $item) : ?>
- language && JLanguageMultilang::isEnabled())
- {
- $tag = strlen($item->language);
- if ($tag == 5)
- {
- $lang = substr($item->language, 0, 2);
- }
- elseif ($tag == 6)
+
+
+
+
+
+
+
+
+
-
+
+
diff --git a/administrator/components/com_categories/views/category/tmpl/edit.php b/administrator/components/com_categories/views/category/tmpl/edit.php
index d57c7ab7fbc89..71086a67b1b98 100644
--- a/administrator/components/com_categories/views/category/tmpl/edit.php
+++ b/administrator/components/com_categories/views/category/tmpl/edit.php
@@ -31,6 +31,11 @@
jQuery("#permissions-sliders select").attr("disabled", "disabled");
' . $this->form->getField("description")->save() . '
Joomla.submitform(task, document.getElementById("item-form"));
+
+ if (task !== "category.apply")
+ {
+ window.parent.jQuery("#categoryEdit' . $this->item->id . 'Modal").modal("hide");
+ }
}
};
');
@@ -38,9 +43,13 @@
// Fieldsets to not automatically render by /layouts/joomla/edit/params.php
$this->ignore_fieldsets = array('jmetadata', 'item_associations');
+// In case of modal
+$isModal = $input->get('layout') == 'modal' ? true : false;
+$layout = $isModal ? 'modal' : 'edit';
+$tmpl = $isModal ? '&tmpl=component' : '';
?>
-
+
@@ -70,10 +79,12 @@
-
+
loadTemplate('associations'); ?>
+
+ loadTemplate('associations'); ?>
canDo->get('core.admin')) : ?>
diff --git a/administrator/components/com_categories/views/category/tmpl/modal.php b/administrator/components/com_categories/views/category/tmpl/modal.php
index 376c817c05f73..28203343ec637 100644
--- a/administrator/components/com_categories/views/category/tmpl/modal.php
+++ b/administrator/components/com_categories/views/category/tmpl/modal.php
@@ -9,96 +9,24 @@
defined('_JEXEC') or die;
-// Include the component HTML helpers.
-JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
+JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom'));
-JHtml::_('behavior.formvalidator');
-JHtml::_('behavior.keepalive');
-JHtml::_('formbehavior.chosen', 'select');
+$function = JFactory::getApplication()->input->getCmd('function', 'jEditCategory_' . (int) $this->item->id);
-$app = JFactory::getApplication();
-$input = $app->input;
-
-$assoc = JLanguageAssociations::isEnabled();
-
-JFactory::getDocument()->addScriptDeclaration("
- Joomla.submitbutton = function(task)
- {
- if (task == 'category.cancel' || document.formvalidator.isValid(document.getElementById('item-form')))
- {
- " . $this->form->getField('description')->save() . "
-
- if (window.opener && (task == 'category.save' || task == 'category.cancel'))
- {
- window.opener.document.closeEditWindow = self;
- window.opener.setTimeout('window.document.closeEditWindow.close()', 1000);
- }
-
- Joomla.submitform(task, document.getElementById('item-form'));
+// Function to update input title when changed
+JFactory::getDocument()->addScriptDeclaration('
+ function jEditCategoryModal() {
+ if (window.parent && document.formvalidator.isValid(document.getElementById("item-form"))) {
+ return window.parent.' . $this->escape($function) . '(document.getElementById("jform_title").value);
}
- };
-");
-
-// Fieldsets to not automatically render by /layouts/joomla/edit/params.php
-$this->ignore_fieldsets = array('jmetadata', 'item_associations');
+ }
+');
?>
-