diff --git a/administrator/components/com_menus/helpers/menus.php b/administrator/components/com_menus/helpers/menus.php index b04b55fcf879f..5589b221e8315 100644 --- a/administrator/components/com_menus/helpers/menus.php +++ b/administrator/components/com_menus/helpers/menus.php @@ -164,7 +164,7 @@ public static function getMenuLinks($menuType = null, $parentId = 0, $mode = 0, if (JLanguageMultilang::isEnabled()) { - $query->select('l.title AS language_title, l.image as language_image') + $query->select('l.title AS language_title, l.image AS language_image') ->join('LEFT', $db->quoteName('#__languages') . ' AS l ON l.lang_code = a.language'); } diff --git a/administrator/components/com_menus/models/items.php b/administrator/components/com_menus/models/items.php index 2fb817aa0b9f8..0a9f5c731219f 100644 --- a/administrator/components/com_menus/models/items.php +++ b/administrator/components/com_menus/models/items.php @@ -224,7 +224,7 @@ protected function getListQuery() $query->from($db->quoteName('#__menu') . ' AS a'); // Join over the language - $query->select('l.title AS language_title, l.image as image') + $query->select('l.title AS language_title, l.image AS language_image') ->join('LEFT', $db->quoteName('#__languages') . ' AS l ON l.lang_code = a.language'); // Join over the users. diff --git a/administrator/components/com_menus/views/items/tmpl/default.php b/administrator/components/com_menus/views/items/tmpl/default.php index 48f0d9076dbee..8dd066f57ba24 100644 --- a/administrator/components/com_menus/views/items/tmpl/default.php +++ b/administrator/components/com_menus/views/items/tmpl/default.php @@ -189,14 +189,76 @@ type == 'component') : ?> - language == '*' || $item->home == '0') : ?> - home, $i, 'items.', ($item->language != '*' || !$item->home) && $canChange); ?> - - - image . '.gif', $item->language_title, array('title' => JText::sprintf('COM_MENUS_GRID_UNSET_LANGUAGE', $item->language_title)), true); ?> - + language == '*') : ?> + home, + $i, + array( + 'prefix' => 'items.', + 'states' => array( + 0 => array( + 'setDefault', + '', + JText::_('COM_MENUS_GRID_SET_DEFAULT'), + '', + 1, + 'unfeatured', + 'unfeatured', + 0 + ), + 1 => array( + 'unsetDefault', + '', + JText::_('COM_MENUS_GRID_UNSET_DEFAULT'), + JText::_('COM_MENUS_GRID_DEFAULT'), + 1, + 'featured', + 'featured', + 0 + ) + ) + ), + !$item->home && $canChange, + false + ); + ?> - image . '.gif', $item->language_title, array('title' => $item->language_title), true); ?> + home, + $i, + array( + 'prefix' => 'items.', + 'states' => array( + 0 => array( + 'setDefault', + JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array(), true), + JText::sprintf('COM_MENUS_GRID_SET_DEFAULT_LANGUAGE', $item->language_title), + '', + 1, + '', + '', + 1 + ), + 1 => array( + 'unsetDefault', + JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array(), true), + JText::sprintf('COM_MENUS_GRID_UNSET_DEFAULT_LANGUAGE', $item->language_title), + JText::sprintf('COM_MENUS_GRID_DEFAULT_LANGUAGE', $item->language_title), + 1, + 'active', + 'active', + 1 + ) + ) + ), + $canChange, + false + ); + ?> diff --git a/administrator/components/com_templates/controllers/styles.php b/administrator/components/com_templates/controllers/styles.php index 4312de9c61f47..4d60262d01553 100644 --- a/administrator/components/com_templates/controllers/styles.php +++ b/administrator/components/com_templates/controllers/styles.php @@ -116,7 +116,7 @@ public function unsetDefault() // Check for request forgeries JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN')); - $pks = $this->input->get->get('cid', array(), 'array'); + $pks = $this->input->get('cid', array(), 'array'); JArrayHelper::toInteger($pks); try diff --git a/administrator/components/com_templates/models/styles.php b/administrator/components/com_templates/models/styles.php index a4c63cbdbabf6..4671db752d584 100644 --- a/administrator/components/com_templates/models/styles.php +++ b/administrator/components/com_templates/models/styles.php @@ -108,7 +108,7 @@ protected function getListQuery() $query->select( $this->getState( 'list.select', - 'a.id, a.template, a.title, a.home, a.client_id, l.title AS language_title, l.image as image' + 'a.id, a.template, a.title, a.home, a.client_id, l.title AS language_title, l.image AS language_image' ) ); $query->from($db->quoteName('#__template_styles') . ' AS a'); diff --git a/administrator/components/com_templates/views/styles/tmpl/default.php b/administrator/components/com_templates/views/styles/tmpl/default.php index bb25500104afb..66751f504c8b6 100644 --- a/administrator/components/com_templates/views/styles/tmpl/default.php +++ b/administrator/components/com_templates/views/styles/tmpl/default.php @@ -28,7 +28,7 @@
- + $this)); ?>
items)) : ?> @@ -85,26 +85,88 @@ client_id == '1') : ?> - + - escape($item->title);?> + escape($item->title); ?> - escape($item->title);?> + escape($item->title); ?> - home == '0' || $item->home == '1'):?> - home != '0', $i, 'styles.', $canChange && $item->home != '1');?> - - - image . '.gif', $item->language_title, array('title' => JText::sprintf('COM_TEMPLATES_GRID_UNSET_LANGUAGE', $item->language_title)), true);?> - - - image . '.gif', $item->language_title, array('title' => $item->language_title), true);?> - + home == '0' || $item->home == '1') : ?> + home != '0', + $i, + array( + 'prefix' => 'styles.', + 'states' => array( + 0 => array( + 'setDefault', + '', + JText::_('COM_TEMPLATES_GRID_SET_DEFAULT'), + '', + 1, + 'unfeatured', + 'unfeatured', + 0 + ), + 1 => array( + 'unsetDefault', + '', + JText::_('COM_TEMPLATES_GRID_UNSET_DEFAULT'), + JText::_('COM_TEMPLATES_GRID_DEFAULT'), + 1, + 'featured', + 'featured', + 0 + ) + ) + ), + $canChange && $item->home != '1', + false + ); + ?> + + 'styles.', + 'states' => array( + 0 => array( + 'setDefault', + JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array(), true), + JText::sprintf('COM_TEMPLATES_GRID_SET_DEFAULT_LANGUAGE', $item->language_title), + '', + 1, + '', + '', + 1 + ), + 1 => array( + 'unsetDefault', + JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array(), true), + JText::sprintf('COM_TEMPLATES_GRID_UNSET_DEFAULT_LANGUAGE', $item->language_title), + JText::sprintf('COM_TEMPLATES_GRID_DEFAULT_LANGUAGE', $item->language_title), + 1, + 'active', + 'active', + 1 + ) + ) + ), + $canChange, + false + ); + ?> + assigned > 0) : ?> @@ -117,9 +179,9 @@ client_id == 0 ? JText::_('JSITE') : JText::_('JADMINISTRATOR'); ?> - @@ -130,7 +192,7 @@ - + diff --git a/administrator/language/en-GB/en-GB.com_menus.ini b/administrator/language/en-GB/en-GB.com_menus.ini index 4db646b0a30ac..21c7eacebf68c 100644 --- a/administrator/language/en-GB/en-GB.com_menus.ini +++ b/administrator/language/en-GB/en-GB.com_menus.ini @@ -28,7 +28,12 @@ COM_MENUS_FIELD_VALUE_IGNORE="Ignore" COM_MENUS_FIELD_VALUE_NEW_WITH_NAV="New Window With Navigation" COM_MENUS_FIELD_VALUE_NEW_WITHOUT_NAV="New Without Navigation" COM_MENUS_FIELD_VALUE_PARENT="Parent" -COM_MENUS_GRID_UNSET_LANGUAGE="Unset %s Default" +COM_MENUS_GRID_DEFAULT="Global default page" +COM_MENUS_GRID_DEFAULT_LANGUAGE="Default page for %s language" +COM_MENUS_GRID_SET_DEFAULT="Set this menu item as the global default page" +COM_MENUS_GRID_SET_DEFAULT_LANGUAGE="Set this menu item as the default page for %s language" +COM_MENUS_GRID_UNSET_DEFAULT="Unset this menu item as the global default page" +COM_MENUS_GRID_UNSET_DEFAULT_LANGUAGE="Unset this menu item as the default page for %s language" COM_MENUS_HEADING_ASSIGN_MODULE="Module" COM_MENUS_HEADING_ASSOCIATION="Association" COM_MENUS_HEADING_DISPLAY="Display" diff --git a/administrator/language/en-GB/en-GB.com_templates.ini b/administrator/language/en-GB/en-GB.com_templates.ini index e64f192733b81..6f41154dfeba3 100644 --- a/administrator/language/en-GB/en-GB.com_templates.ini +++ b/administrator/language/en-GB/en-GB.com_templates.ini @@ -136,7 +136,12 @@ COM_TEMPLATES_FOLDER_NAME="Folder Name" COM_TEMPLATES_FOLDER_NOT_EXISTS="The folder does not exist." COM_TEMPLATES_FTP_DESC="For updating the template source files, Joomla will most likely need your FTP account details. Please enter them in the form fields below." COM_TEMPLATES_FTP_TITLE="FTP Login Details" -COM_TEMPLATES_GRID_UNSET_LANGUAGE="Unset %s Default" +COM_TEMPLATES_GRID_DEFAULT="Global default template" +COM_TEMPLATES_GRID_DEFAULT_LANGUAGE="Default template for %s language" +COM_TEMPLATES_GRID_SET_DEFAULT="Set this template as the global default template" +COM_TEMPLATES_GRID_SET_DEFAULT_LANGUAGE="Set this template as the default template for %s language" +COM_TEMPLATES_GRID_UNSET_DEFAULT="Unset this template as the global default template" +COM_TEMPLATES_GRID_UNSET_DEFAULT_LANGUAGE="Unset this template as the default template for %s language" COM_TEMPLATES_HOME_BUTTON="Documentation" COM_TEMPLATES_HOME_HEADING="Select a File" COM_TEMPLATES_HOME_TEXT="You can select from a number of options for customising the look of your templates. The Template Manager supports Source files, Image files, Font files, Zip archives and most of the operations that can be performed on those files. Just select a file and you are good to go. Check the documentation if you want to know more." diff --git a/administrator/templates/hathor/html/com_menus/items/default.php b/administrator/templates/hathor/html/com_menus/items/default.php index b889d13085b94..3374e46b80e6d 100644 --- a/administrator/templates/hathor/html/com_menus/items/default.php +++ b/administrator/templates/hathor/html/com_menus/items/default.php @@ -196,10 +196,10 @@ home, $i, 'items.', ($item->language != '*' || !$item->home) && $canChange);?> - image . '.gif', $item->language_title, array('title' => JText::sprintf('COM_MENUS_GRID_UNSET_LANGUAGE', $item->language_title)), true);?> + language_image . '.gif', $item->language_title, array('title' => JText::sprintf('COM_MENUS_GRID_UNSET_LANGUAGE', $item->language_title)), true);?> - image . '.gif', $item->language_title, array('title' => $item->language_title), true);?> + language_image . '.gif', $item->language_title, array('title' => $item->language_title), true);?> diff --git a/administrator/templates/hathor/html/com_templates/styles/default.php b/administrator/templates/hathor/html/com_templates/styles/default.php index e82c548f51f4f..c02f7bf559102 100644 --- a/administrator/templates/hathor/html/com_templates/styles/default.php +++ b/administrator/templates/hathor/html/com_templates/styles/default.php @@ -122,10 +122,10 @@ home != '0', $i, 'styles.', $canChange && $item->home != '1');?> - image . '.gif', $item->language_title, array('title' => JText::sprintf('COM_TEMPLATES_GRID_UNSET_LANGUAGE', $item->language_title)), true);?> + language_image . '.gif', $item->language_title, array('title' => JText::sprintf('COM_TEMPLATES_GRID_UNSET_LANGUAGE', $item->language_title)), true);?> - image . '.gif', $item->language_title, array('title' => $item->language_title), true);?> + language_image . '.gif', $item->language_title, array('title' => $item->language_title), true);?> diff --git a/libraries/cms/html/jgrid.php b/libraries/cms/html/jgrid.php index 94ada807fdf2c..84d39583f2a6a 100644 --- a/libraries/cms/html/jgrid.php +++ b/libraries/cms/html/jgrid.php @@ -31,13 +31,14 @@ abstract class JHtmlJGrid * @param boolean $enabled An optional setting for access control on the action. * @param boolean $translate An optional setting for translation. * @param string $checkbox An optional prefix for checkboxes. + * @param boolean $show_text An optional setting for showing text inside the button. * * @return string The HTML markup * * @since 1.6 */ public static function action($i, $task, $prefix = '', $text = '', $active_title = '', $inactive_title = '', $tip = false, $active_class = '', - $inactive_class = '', $enabled = true, $translate = true, $checkbox = 'cb') + $inactive_class = '', $enabled = true, $translate = true, $checkbox = 'cb', $show_text = false) { if (is_array($prefix)) { @@ -51,6 +52,7 @@ public static function action($i, $task, $prefix = '', $text = '', $active_title $translate = array_key_exists('translate', $options) ? $options['translate'] : $translate; $checkbox = array_key_exists('checkbox', $options) ? $options['checkbox'] : $checkbox; $prefix = array_key_exists('prefix', $options) ? $options['prefix'] : ''; + $text = array_key_exists('text', $options) ? $options['text'] : $text; } if ($tip) @@ -62,28 +64,42 @@ public static function action($i, $task, $prefix = '', $text = '', $active_title $title = JHtml::tooltipText($title, '', 0); } + if ($show_text) + { + $button_text = $text; + $button_class = 'btn-mini'; + } + else + { + $button_text = ''; + $button_class = 'btn-micro'; + } + if ($enabled) { - $html[] = ''; + $html[] = '' . $button_text . ''; $html[] = ''; } else { - $html[] = ''; } else { - $html[] = ''; + $html[] = ''; + $html[] = $button_text; + $html[] = ''; } $html[] = ''; @@ -130,10 +146,11 @@ public static function state($states, $value, $i, $prefix = '', $enabled = true, $tip = array_key_exists('tip', $state) ? $state['tip'] : (array_key_exists(4, $state) ? $state[4] : false); $active_class = array_key_exists('active_class', $state) ? $state['active_class'] : (array_key_exists(5, $state) ? $state[5] : ''); $inactive_class = array_key_exists('inactive_class', $state) ? $state['inactive_class'] : (array_key_exists(6, $state) ? $state[6] : ''); + $show_text = array_key_exists('show_text', $state) ? $state['show_text'] : (array_key_exists(7, $state) ? $state[7] : ''); return static::action( $i, $task, $prefix, $text, $active_title, $inactive_title, $tip, - $active_class, $inactive_class, $enabled, $translate, $checkbox + $active_class, $inactive_class, $enabled, $translate, $checkbox, $show_text ); } @@ -234,33 +251,35 @@ public static function published($value, $i, $prefix = '', $enabled = true, $che /** * Returns a isDefault state on a grid * - * @param integer $value The state value. - * @param integer $i The row index - * @param string|array $prefix An optional task prefix or an array of options - * @param boolean $enabled An optional setting for access control on the action. - * @param string $checkbox An optional prefix for checkboxes. + * @param integer $value The state value. + * @param integer $i The row index + * @param string|array $prefix An optional task prefix or an array of options + * @param boolean $enabled An optional setting for access control on the action. + * @param boolean $translate An optional setting for translation. + * @param string $checkbox An optional prefix for checkboxes. * * @return string The HTML markup * * @see JHtmlJGrid::state() * @since 1.6 */ - public static function isdefault($value, $i, $prefix = '', $enabled = true, $checkbox = 'cb') + public static function isdefault($value, $i, $prefix = '', $enabled = true, $translate = true, $checkbox = 'cb') { + $states = array( + 0 => array('setDefault', '', 'JLIB_HTML_SETDEFAULT_ITEM', '', 1, 'unfeatured', 'unfeatured', 0), + 1 => array('unsetDefault', 'JDEFAULT', 'JLIB_HTML_UNSETDEFAULT_ITEM', 'JDEFAULT', 1, 'featured', 'featured', 0), + ); + if (is_array($prefix)) { $options = $prefix; $enabled = array_key_exists('enabled', $options) ? $options['enabled'] : $enabled; $checkbox = array_key_exists('checkbox', $options) ? $options['checkbox'] : $checkbox; $prefix = array_key_exists('prefix', $options) ? $options['prefix'] : ''; + $states = array_key_exists('states', $options) ? $options['states'] : $states; } - $states = array( - 0 => array('setDefault', '', 'JLIB_HTML_SETDEFAULT_ITEM', '', 1, 'unfeatured', 'unfeatured'), - 1 => array('unsetDefault', 'JDEFAULT', 'JLIB_HTML_UNSETDEFAULT_ITEM', 'JDEFAULT', 1, 'featured', 'featured'), - ); - - return static::state($states, $value, $i, $prefix, $enabled, true, $checkbox); + return static::state($states, $value, $i, $prefix, $enabled, $translate, $checkbox); } /**