29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-27 07:33:41 +00:00

# [#20312] Access Control not implemented in menus

# [#20450] Missing modal and field for single news feed selection
# Sample data fixes (Elin Waring)

git-svn-id: http://joomlacode.org/svn/joomla/development/trunk@17110 6f6e1ebd-4c2b-0410-823f-f34bde69bce9
This commit is contained in:
Mark Dexter 2010-05-16 22:13:09 +00:00
parent 061f283b5e
commit 3ae0af8158
8 changed files with 503 additions and 264 deletions

View File

@ -0,0 +1 @@
<html><body></body></html>

View File

@ -0,0 +1,92 @@
<?php
/**
* @version $Id$
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
jimport('joomla.form.formfield');
/**
* Supports a modal newsfeeds picker.
*
* @package Joomla.Administrator
* @subpackage com_newsfeeds
* @since 1.6
*/
class JFormFieldModal_Newsfeeds extends JFormField
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
protected $type = 'Modal_Newsfeeds';
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
// Load the javascript and css
JHtml::_('behavior.framework');
JHTML::_('script','system/modal.js', false, true);
JHTML::_('stylesheet','system/modal.css', array(), true);
// Build the script.
$script = array();
$script[] = ' function jSelectChart_'.$this->id.'(id, name, object) {';
$script[] = ' document.id("'.$this->id.'_id").value = id;';
$script[] = ' document.id("'.$this->id.'_name").value = name;';
$script[] = ' SqueezeBox.close();';
$script[] = ' }';
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
// Build the script.
$script = array();
$script[] = ' window.addEvent("domready", function() {';
$script[] = ' var div = new Element("div").setStyle("display", "none").injectBefore(document.id("menu-types"));';
$script[] = ' document.id("menu-types").injectInside(div);';
$script[] = ' SqueezeBox.initialize();';
$script[] = ' SqueezeBox.assign($$("input.modal"), {parse:"rel"});';
$script[] = ' });';
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
// Get the title of the linked chart
$db = & JFactory::getDBO();
$db->setQuery(
'SELECT name' .
' FROM #__newsfeeds' .
' WHERE id = '.(int) $this->value
);
$title = $db->loadResult();
if ($error = $db->getErrorMsg()) {
JError::raiseWarning(500, $error);
}
if (empty($title)) {
$title = JText::_('COM_NEWSFEEDS_SELECT_A_FEED');
}
$link = 'index.php?option=com_newsfeeds&amp;view=newsfeeds&amp;layout=modal&amp;tmpl=component&amp;function=jSelectChart_'.$this->id;
JHTML::_('behavior.modal', 'a.modal');
$html = "\n".'<div class="fltlft"><input type="text" id="'.$this->id.'_name" value="'.htmlspecialchars($title, ENT_QUOTES, 'UTF-8').'" disabled="disabled" /></div>';
$html .= '<div class="button2-left"><div class="blank"><a class="modal" title="'.JText::_('COM_NEWSFEEDS_CHANGE_FEED_BUTTON').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 800, y: 450}}">'.JText::_('COM_NEWSFEEDS_CHANGE_FEED_BUTTON').'</a></div></div>'."\n";
$html .= "\n".'<input type="hidden" id="'.$this->id.'_id" name="'.$this->name.'" value="'.(int) $this->value.'" />';
return $html;
}
}

View File

@ -0,0 +1,114 @@
<?php
/**
* @version $Id$
* @package Joomla.Administrator
* @subpackage com_newsfeeds
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// no direct access
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT.DS.'helpers'.DS.'html');
JHtml::_('behavior.tooltip');
$function = JRequest::getVar('function', 'jSelectNewsfeed');
$listOrder = $this->state->get('list.ordering');
$listDirn = $this->state->get('list.direction');
?>
<form action="<?php echo JRoute::_('index.php?option=com_newsfeeds&view=newsfeeds&layout=modal&tmpl=component');?>" method="post" name="adminForm">
<fieldset class="filter clearfix">
<div class="left">
<label for="filter_search">
<?php echo JText::_('JSEARCH_FILTER_LABEL'); ?>
</label>
<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->state->get('filter.search'); ?>" size="30" title="<?php echo JText::_('COM_NEWSFEEDS_FILTER_SEARCH_DESC'); ?>" />
<button type="submit">
<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
<button type="button" onclick="document.id('filter_search').value='';this.form.submit();">
<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button>
</div>
<div class="right">
<select name="filter_access" class="inputbox" onchange="this.form.submit()">
<option value=""><?php echo JText::_('JOPTION_SELECT_ACCESS');?></option>
<?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'));?>
</select>
<select name="filter_published" class="inputbox" onchange="this.form.submit()">
<option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option>
<?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true);?>
</select>
<select name="filter_category_id" class="inputbox" onchange="this.form.submit()">
<option value=""><?php echo JText::_('JOPTION_SELECT_CATEGORY');?></option>
<?php echo JHtml::_('select.options', JHtml::_('category.options', 'com_content'), 'value', 'text', $this->state->get('filter.category_id'));?>
</select>
</div>
</fieldset>
<table class="adminlist">
<thead>
<tr>
<th width="20">
<input type="checkbox" name="toggle" value="" onclick="checkAll(this)" />
</th>
<th class="title">
<?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
</th>
<th width="5%">
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_CATEGORY', 'a.catid', $listDirn, $listOrder); ?>
</th>
<th width="10%">
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'category', $listDirn, $listOrder); ?>
</th>
<th width="5%">
<?php echo JHtml::_('grid.sort', 'JDATE', 'a.created', $listDirn, $listOrder); ?>
</th>
<th width="1%" nowrap="nowrap">
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="15">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php foreach ($this->items as $i => $item) : ?>
<tr class="row<?php echo $i % 2; ?>">
<td class="center">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td>
<a class="pointer" onclick="if (window.parent) window.parent.<?php echo $function;?>('<?php echo $item->id; ?>', '<?php echo $this->escape($item->name); ?>');">
<?php echo $this->escape($item->name); ?></a>
</td>
<td align="center">
<?php echo $this->escape($item->category_title); ?>
</td>
<td align="center">
<?php echo $this->escape($item->access_level); ?>
</td>
<td align="center">
</td>
<td align="center">
<?php echo (int) $item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
<?php echo JHtml::_('form.token'); ?>
</form>

View File

@ -12,8 +12,7 @@
addfieldpath="/administrator/components/com_newsfeeds/models/fields"
>
<field name="id" type="newsfeed"
default="0"
<field name="id" type="modal_newsfeeds"
description="COM_NEWSFEEDS_FIELD_SELECT_FEED_DESC"
label="COM_NEWSFEEDS_FIELD_SELECT_FEED_LABEL"
required="true"

View File

@ -41,6 +41,10 @@ class JMenuSite extends JMenu
$query->where('m.parent_id > 0');
$query->order('m.lft');
$user =& JFactory::getUser();
$groups = implode(',', $user->authorisedLevels());
$query->where('m.access IN (' . $groups . ')');
// Filter by language
if ($app->getLanguageFilter()) {
$query->where('m.language in (' . $db->Quote(JFactory::getLanguage()->getTag()) . ',' . $db->Quote('*') . ')');
@ -78,4 +82,4 @@ class JMenuSite extends JMenu
$this->_items = $data;
}
}
}
}

View File

@ -27,6 +27,11 @@ $ -> Language fix or change
- -> Removed
! -> Note
16-May-2010 Mark Dexter
# [#20312] Access Control not implemented in menus
# [#20450] Missing modal and field for single news feed selection
# Sample data fixes (Elin Waring)
16-May-2010 Chris Davenport
$ Translate help screen titles in com_admin

View File

@ -893,7 +893,7 @@ CREATE TABLE IF NOT EXISTS `#__template_styles` (
INSERT INTO `#__template_styles` VALUES (1, 'rhuk_milkyway', '0', '0', 'Milkyway - Default', '{"colorVariation":"blue","backgroundVariation":"blue","widthStyle":"fmax"}');
INSERT INTO `#__template_styles` VALUES (2, 'bluestork', '1', '1', 'Bluestork - Default', '{"useRoundedCorners":"1","showSiteName":"0"}');
INSERT INTO `#__template_styles` VALUES (3, 'atomic', '0', '0', 'Atomic - Default', '{}');
INSERT INTO `#__template_styles` VALUES (4, 'beez_20', 0, 1, 'Beez2 - Default', '{"wrapperSmall":"53","wrapperLarge":"72","logo":"joomla_black.gif","navposition":"left","templatecolor":"personal","html5":"0"}');
INSERT INTO `#__template_styles` VALUES (4, 'beez_20', 0, 1, 'Beez2 - Default', '{"wrapperSmall":"53","wrapperLarge":"72","logo":"joomla_black.gif","sitetitle":"Joomla!","sitedescription":"Open Source Content Management Beta","navposition":"left","templatecolor":"personal","html5":"0"}');
INSERT INTO `#__template_styles` VALUES (5, 'hathor', '1', '0', 'Hathor - Default', '{"showSiteName":"0","highContrast":"0","boldText":"0","altMenu":"0"}');
# -------------------------------------------------------

File diff suppressed because one or more lines are too long