Skip to content

Commit

Permalink
Merge pull request #22 from joomla/2.5.x
Browse files Browse the repository at this point in the history
Update to the latest 2.5.x
  • Loading branch information
nicksavov committed Apr 2, 2013
2 parents 18d4c6d + 316710e commit 25e95fd
Show file tree
Hide file tree
Showing 37 changed files with 368 additions and 128 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @package Joomla.Administrator
* @subpackage com_categories
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

Expand Down Expand Up @@ -86,7 +86,25 @@
<?php echo $this->loadTemplate('metadata'); ?>
</fieldset>

<?php echo JHtml::_('sliders.end'); ?>
<?php $fieldSets = $this->form->getFieldsets('attribs'); ?>
<?php foreach ($fieldSets as $name => $fieldSet) : ?>
<?php $label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_CATEGORIES_'.$name.'_FIELDSET_LABEL'; ?>
<?php if ($name != 'editorConfig' && $name != 'basic-limited') : ?>
<?php echo JHtml::_('sliders.panel', JText::_($label), $name.'-options'); ?>
<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
<p class="tip"><?php echo $this->escape(JText::_($fieldSet->description));?></p>
<?php endif; ?>
<fieldset class="panelform">
<ul class="adminformlist">
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
<li><?php echo $field->label; ?>
<?php echo $field->input; ?></li>
<?php endforeach; ?>
</ul>
</fieldset>
<?php endif ?>
<?php endforeach; ?>
<?php echo JHtml::_('sliders.end'); ?>
</div>
<div class="clr"></div>

Expand Down
54 changes: 46 additions & 8 deletions administrator/components/com_config/models/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@
*/
class ConfigModelComponent extends JModelForm
{
/**
* The event to trigger before saving the data.
*
* @var string
* @since 2.5.10
*/
protected $event_before_save = 'onConfigurationBeforeSave';

/**
* The event to trigger before deleting the data.
*
* @var string
* @since 2.5.10
*/
protected $event_after_save = 'onConfigurationAfterSave';

/**
* Method to auto-populate the model state.
*
Expand Down Expand Up @@ -68,7 +84,8 @@ public function getForm($data = array(), $loadData = true)
'/config'
);

if (empty($form)) {
if (empty($form))
{
return false;
}

Expand Down Expand Up @@ -108,14 +125,18 @@ function getComponent()
*/
public function save($data)
{
$dispatcher = JDispatcher::getInstance();
$table = JTable::getInstance('extension');
$isNew = true;

// Save the rules.
if (isset($data['params']) && isset($data['params']['rules'])) {
if (isset($data['params']) && isset($data['params']['rules']))
{
$rules = new JAccessRules($data['params']['rules']);
$asset = JTable::getInstance('asset');

if (!$asset->loadByName($data['option'])) {
if (!$asset->loadByName($data['option']))
{
$root = JTable::getInstance('asset');
$root->loadByName('root.1');
$asset->name = $data['option'];
Expand All @@ -124,7 +145,8 @@ public function save($data)
}
$asset->rules = (string) $rules;

if (!$asset->check() || !$asset->store()) {
if (!$asset->check() || !$asset->store())
{
$this->setError($asset->getError());
return false;
}
Expand All @@ -135,34 +157,50 @@ public function save($data)
}

// Load the previous Data
if (!$table->load($data['id'])) {
if (!$table->load($data['id']))
{
$this->setError($table->getError());
return false;
}

unset($data['id']);

// Bind the data.
if (!$table->bind($data)) {
if (!$table->bind($data))
{
$this->setError($table->getError());
return false;
}

// Check the data.
if (!$table->check()) {
if (!$table->check())
{
$this->setError($table->getError());
return false;
}

// Trigger the oonConfigurationBeforeSave event.
$result = $dispatcher->trigger($this->event_before_save, array($this->option . '.' . $this->name, $table, $isNew));

if (in_array(false, $result, true))
{
$this->setError($table->getError());
return false;
}

// Store the data.
if (!$table->store()) {
if (!$table->store())
{
$this->setError($table->getError());
return false;
}

// Clean the component cache.
$this->cleanCache('_system');

// Trigger the onConfigurationAfterSave event.
$dispatcher->trigger($this->event_after_save, array($this->option . '.' . $this->name, $table, $isNew));

return true;
}
}
9 changes: 0 additions & 9 deletions administrator/components/com_contact/tables/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,6 @@ function check()
$this->setError(JText::_('COM_CONTACT_WARNING_PROVIDE_VALID_NAME'));
return false;
}
/** check for existing name */
$query = 'SELECT id FROM #__contact_details WHERE name = '.$this->_db->Quote($this->name).' AND catid = '.(int) $this->catid;
$this->_db->setQuery($query);

$xid = intval($this->_db->loadResult());
if ($xid && $xid != intval($this->id)) {
$this->setError(JText::_('COM_CONTACT_WARNING_SAME_NAME'));
return false;
}

if (empty($this->alias)) {
$this->alias = $this->name;
Expand Down
8 changes: 7 additions & 1 deletion administrator/components/com_content/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,13 @@
extension="com_content"
view="category"
/>

<field name="show_category_heading_title_text" type="radio"
label="JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_LABEL"
description="JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_DESC"
default="1">
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_category_title" type="radio"
label="JGLOBAL_SHOW_CATEGORY_TITLE"
description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
Expand Down
5 changes: 4 additions & 1 deletion administrator/components/com_plugins/models/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,11 @@ protected function _getList($query, $limitstart=0, $limit=0)
}
}
}

$lang = JFactory::getLanguage();
JArrayHelper::sortObjects($result, 'name', $this->getState('list.direction') == 'desc' ? -1 : 1, true, $lang->getLocale());
$direction = ($this->getState('list.direction') == 'desc') ? -1 : 1;
JArrayHelper::sortObjects($result, $ordering, $direction, true, $lang->getLocale());

$total = count($result);
$this->cache[$this->getStoreId('getTotal')] = $total;
if ($total < $limitstart) {
Expand Down
2 changes: 2 additions & 0 deletions administrator/includes/toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public static function title($title, $icon = 'generic.png')

$app = JFactory::getApplication();
$app->JComponentTitle = $html;
$doc = JFactory::getDocument();
$doc->setTitle($app->getCfg('sitename'). ' - ' .JText::_('JADMINISTRATION').' - '.$title);
}

/**
Expand Down
1 change: 0 additions & 1 deletion administrator/language/en-GB/en-GB.com_contact.ini
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ COM_CONTACT_UNFEATURED="Unfeatured contact"
COM_CONTACT_WARNING_CATEGORY="This category is invalid"
COM_CONTACT_WARNING_PROVIDE_VALID_NAME="Please provide a valid name"
COM_CONTACT_WARNING_PROVIDE_VALID_URL="Please provide a valid URL"
COM_CONTACT_WARNING_SAME_NAME="The name of this contact is already used. Please enter another name"
COM_CONTACT_WARNING_SELECT_CONTACT_TOPUBLISH="Please select a contact to publish"
COM_CONTACT_XML_DESCRIPTION="This component shows a listing of contact information"
JGLOBAL_NEWITEMSLAST_DESC="New Contacts default to the last position. Ordering can be changed after this Contact is saved."
Expand Down
2 changes: 2 additions & 0 deletions administrator/language/en-GB/en-GB.ini
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC="Show or hide the description of the sele
JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL="Category Description"
JGLOBAL_SHOW_CATEGORY_IMAGE_DESC="Show or hide the image of the selected Category."
JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL="Category Image"
JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_LABEL="Show Subcategories Text"
JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_DESC="If Show, the &quot;Subcategories&quot; will show as a subheading on the page. The subheading is usually displayed inside the &quot;H3&quot; tag."
JGLOBAL_SHOW_CATEGORY_LABEL="Show Category"
JGLOBAL_SHOW_CATEGORY_TITLE="Category Title"
JGLOBAL_SHOW_CATEGORY_TITLE_DESC="If Show, the Category Title will show as a subheading on the page. The subheading is usually displayed inside the &quot;H2&quot; tag."
Expand Down
14 changes: 9 additions & 5 deletions administrator/language/en-GB/en-GB.plg_system_languagefilter.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
; Note : All ini files need to be saved as UTF-8

PLG_SYSTEM_LANGUAGEFILTER="System - Language Filter"
PLG_SYSTEM_LANGUAGEFILTER_XML_DESCRIPTION="This plugin filters the displayed content depending on language.<br /><strong>This plugin is to be enabled only when the Language Switcher module is published.</strong><br />If this plugin is activated, it is suggested to publish the administrator multilanguage status module."
PLG_SYSTEM_LANGUAGEFILTER_BROWSER_SETTINGS="Browser Settings"
PLG_SYSTEM_LANGUAGEFILTER_FIELD_ALTERNATE_META_DESC="Add alternate meta tags for menu items with associated menu items in other languages."
PLG_SYSTEM_LANGUAGEFILTER_FIELD_ALTERNATE_META_LABEL="Add alternate meta tags"
PLG_SYSTEM_LANGUAGEFILTER_FIELD_AUTOMATIC_CHANGE_DESC="This option will automatically change the content language used in the frontend when a user site language is changed"
PLG_SYSTEM_LANGUAGEFILTER_FIELD_AUTOMATIC_CHANGE_LABEL="Automatic Language Change"
PLG_SYSTEM_LANGUAGEFILTER_FIELD_COOKIE_DESC="Language cookies can be set to expire at the end of the session or after a year. Default is a year."
PLG_SYSTEM_LANGUAGEFILTER_FIELD_COOKIE_LABEL="Cookie Lifetime"
PLG_SYSTEM_LANGUAGEFILTER_FIELD_DETECT_BROWSER_DESC="Choose Site default language or try to detect the browser settings language. It will default to site language if browser settings can't be found."
PLG_SYSTEM_LANGUAGEFILTER_FIELD_DETECT_BROWSER_LABEL="Language Selection for new Visitors."
PLG_SYSTEM_LANGUAGEFILTER_BROWSER_SETTINGS="Browser Settings"
PLG_SYSTEM_LANGUAGEFILTER_SITE_LANGUAGE="Site Language"
PLG_SYSTEM_LANGUAGEFILTER_FIELD_MENU_ASSOCIATIONS_DESC="This option will allow menu associations when switching from one language to another"
PLG_SYSTEM_LANGUAGEFILTER_FIELD_MENU_ASSOCIATIONS_LABEL="Menu associations"
PLG_SYSTEM_LANGUAGEFILTER_FIELD_REMOVE_DEFAULT_PREFIX_DESC="Remove the defined URL Language Code of the Content Language that corresponds to the default site language when Search Engine Friendly URLs is set to 'Yes'."
PLG_SYSTEM_LANGUAGEFILTER_FIELD_REMOVE_DEFAULT_PREFIX_LABEL="Remove URL Language Code"
PLG_SYSTEM_LANGUAGEFILTER_FIELD_ALTERNATE_META_DESC="Add alternate meta tags for menu items with associated menu items in other languages."
PLG_SYSTEM_LANGUAGEFILTER_FIELD_ALTERNATE_META_LABEL="Add alternate meta tags"
PLG_SYSTEM_LANGUAGEFILTER_OPTION_SESSION="Session"
PLG_SYSTEM_LANGUAGEFILTER_OPTION_YEAR="Year"
PLG_SYSTEM_LANGUAGEFILTER_SITE_LANGUAGE="Site Language"
PLG_SYSTEM_LANGUAGEFILTER_XML_DESCRIPTION="This plugin filters the displayed content depending on language.<br /><strong>This plugin is to be enabled only when the Language Switcher module is published.</strong><br />If this plugin is activated, it is suggested to publish the administrator multilanguage status module."
2 changes: 1 addition & 1 deletion administrator/language/en-GB/en-GB.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile version="2.5" client="administrator">
<name>English (United Kingdom)</name>
<version>2.5.5</version>
<version>2.5.10</version>
<creationDate>2008-03-15</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,24 @@
<?php echo $this->loadTemplate('metadata'); ?>
</fieldset>

<?php $fieldSets = $this->form->getFieldsets('attribs'); ?>
<?php foreach ($fieldSets as $name => $fieldSet) : ?>
<?php $label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_CATEGORIES_'.$name.'_FIELDSET_LABEL'; ?>
<?php if ($name != 'editorConfig' && $name != 'basic-limited') : ?>
<?php echo JHtml::_('sliders.panel', JText::_($label), $name.'-options'); ?>
<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
<p class="tip"><?php echo $this->escape(JText::_($fieldSet->description));?></p>
<?php endif; ?>
<fieldset class="panelform">
<ul class="adminformlist">
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
<li><?php echo $field->label; ?>
<?php echo $field->input; ?></li>
<?php endforeach; ?>
</ul>
</fieldset>
<?php endif ?>
<?php endforeach; ?>
<?php echo JHtml::_('sliders.end'); ?>
</div>
<div class="clr"></div>
Expand Down
4 changes: 2 additions & 2 deletions build/build.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"tmp/index.html\n" => true,
"htaccess.txt\n" => true,
"web.config.txt\n" => true,
"robots.txt\n" => true,
"robots.txt.dist\n" => true,
"LICENSE.txt\n" => true,
"README.txt\n" => true,
"index.php\n" => true,
Expand Down Expand Up @@ -140,7 +140,7 @@
echo "Skipping create archive for version $version.$num\n";
continue;
}

$fromName = $num == 0 ? 'x' : $num;
// Create the diff archive packages using the file name list.
system('tar --create --bzip2 --no-recursion --directory '.$full.' --file packages'.$version.'/Joomla_'.$version.'.'.$fromName.'_to_'.$full.'-Stable-Patch_Package.tar.bz2 --files-from diffconvert/'.$version.'.'.$num . '> /dev/null');
Expand Down
2 changes: 1 addition & 1 deletion components/com_content/helpers/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static function orderbySecondary($orderby, $orderDate = 'created')
break;

case 'front' :
$orderby = 'fp.ordering';
$orderby = 'a.featured DESC, fp.ordering';
break;

default :
Expand Down
13 changes: 11 additions & 2 deletions components/com_content/models/article.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ protected function populateState()
$this->setState('filter.published', 1);
$this->setState('filter.archived', 2);
}

$this->setState('filter.language', JLanguageMultilang::isEnabled());
}

/**
Expand Down Expand Up @@ -101,7 +103,7 @@ public function &getItem($pk = null)
// Join on user table.
$query->select('u.name AS author');
$query->join('LEFT', '#__users AS u on u.id = a.created_by');

// Join on contact table
$subQuery = $db->getQuery(true);
$subQuery->select('contact.user_id, MAX(contact.id) AS id, contact.language');
Expand All @@ -110,7 +112,14 @@ public function &getItem($pk = null)
$subQuery->group('contact.user_id, contact.language');
$query->select('contact.id as contactid' );
$query->join('LEFT', '(' . $subQuery . ') AS contact ON contact.user_id = a.created_by');


// Filter by language
if ($this->getState('filter.language'))
{
$query->where('a.language in ('.$db->quote(JFactory::getLanguage()->getTag()).','.$db->quote('*').')');
$query->where('(contact.language in ('.$db->quote(JFactory::getLanguage()->getTag()).','.$db->quote('*').') OR contact.language IS NULL)');
}

// Join over the categories to get parent category titles
$query->select('parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias');
$query->join('LEFT', '#__categories as parent ON parent.id = c.parent_id');
Expand Down
6 changes: 4 additions & 2 deletions components/com_content/views/category/tmpl/blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@

<?php if (!empty($this->children[$this->category->id])&& $this->maxLevel != 0) : ?>
<div class="cat-children">
<?php if ($this->params->get('show_category_heading_title_text', 1) == 1) : ?>
<h3>
<?php echo JTEXT::_('JGLOBAL_SUBCATEGORIES'); ?>
</h3>
<?php echo JTEXT::_('JGLOBAL_SUBCATEGORIES'); ?>
</h3>
<?php endif; ?>
<?php echo $this->loadTemplate('children'); ?>
</div>
<?php endif; ?>
Expand Down
9 changes: 8 additions & 1 deletion components/com_content/views/category/tmpl/blog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@
type="hidden"
default="blog"
/>

<field name="show_category_heading_title_text" type="list"
label="JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_LABEL"
description="JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_DESC"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_category_title" type="list"
label="JGLOBAL_SHOW_CATEGORY_TITLE"
description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
Expand Down
3 changes: 3 additions & 0 deletions components/com_content/views/category/tmpl/blog_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@
src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/>
</div>
<?php endif; ?>

<?php if ($params->get('show_intro')) : ?>
<?php echo $this->item->introtext; ?>
<?php endif; ?>

<?php if ($params->get('show_readmore') && $this->item->readmore) :
if ($params->get('access-view')) :
Expand Down
3 changes: 2 additions & 1 deletion components/com_content/views/category/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@

<?php if (!empty($this->children[$this->category->id])&& $this->maxLevel != 0) : ?>
<div class="cat-children">
<?php if ($this->params->get('show_category_heading_title_text', 1) == 1) : ?>
<h3>
<?php echo JTEXT::_('JGLOBAL_SUBCATEGORIES'); ?>
</h3>

<?php endif; ?>
<?php echo $this->loadTemplate('children'); ?>
</div>
<?php endif; ?>
Expand Down
Loading

0 comments on commit 25e95fd

Please sign in to comment.