first commit

This commit is contained in:
alazhar
2020-01-02 22:20:31 +07:00
commit 10eb3340ad
5753 changed files with 631345 additions and 0 deletions

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,292 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.framework');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.modal');
JHtml::_('formbehavior.chosen', 'select');
$app = JFactory::getApplication();
$assoc = isset($app->item_associations) ? $app->item_associations : 0;
?>
<script type="text/javascript">
Joomla.submitbutton = function(task, type)
{
if (task == 'item.setType' || task == 'item.setMenuType')
{
if (task == 'item.setType')
{
document.id('item-form').elements['jform[type]'].value = type;
document.id('fieldtype').value = 'type';
} else {
document.id('item-form').elements['jform[menutype]'].value = type;
}
Joomla.submitform('item.setType', document.id('item-form'));
} else if (task == 'item.cancel' || document.formvalidator.isValid(document.id('item-form')))
{
Joomla.submitform(task, document.id('item-form'));
}
else
{
// special case for modal popups validation response
$$('#item-form .modal-value.invalid').each(function(field){
var idReversed = field.id.split("").reverse().join("");
var separatorLocation = idReversed.indexOf('_');
var name = idReversed.substr(separatorLocation).split("").reverse().join("")+'name';
document.id(name).addClass('invalid');
});
}
}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_menus&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="item-form" class="form-validate form-horizontal">
<fieldset>
<?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'details')); ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'details', JText::_('COM_MENUS_ITEM_DETAILS', true)); ?>
<div class="row-fluid">
<div class="span6">
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('type'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('type'); ?>
</div>
</div>
<?php if ($this->item->type == 'url') : ?>
<?php $this->form->setFieldAttribute('link', 'readonly', 'false');?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('link'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('link'); ?>
</div>
</div>
<?php endif; ?>
<?php if ($this->item->link == 'index.php?Itemid=') : ?>
<?php $fieldSets = $this->form->getFieldsets('params'); ?>
<?php foreach ($this->form->getFieldset('aliasoptions') as $field) : ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php if ($this->item->link == 'index.php?option=com_wrapper&view=wrapper') : ?>
<?php $fieldSets = $this->form->getFieldsets('params'); ?>
<?php foreach ($this->form->getFieldset('request') as $field) : ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php
$fieldSets = $this->form->getFieldsets('request');
if (!empty($fieldSets)) :
$fieldSet = array_shift($fieldSets);
$label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_MENUS_' . $fieldSet->name . '_FIELDSET_LABEL';
if (isset($fieldSet->description) && trim($fieldSet->description)) :
echo '<p class="tip">' . $this->escape(JText::_($fieldSet->description)) . '</p>';
endif;
?>
<?php $hidden_fields = ''; ?>
<?php foreach ($this->form->getFieldset('request') as $field) : ?>
<?php if (!$field->hidden) : ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php else : $hidden_fields .= $field->input; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php echo $hidden_fields; ?>
<?php endif; ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('title'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('title'); ?>
</div>
</div>
<?php if ($this->item->type == 'alias') : ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('aliastip'); ?>
</div>
</div>
<?php endif; ?>
<?php if ($this->item->type != 'url') : ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('alias'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('alias'); ?>
</div>
</div>
<?php endif; ?>
<hr />
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('published'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('published'); ?>
</div>
</div>
<?php if ($this->item->type !== 'url') : ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('link'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('link'); ?>
</div>
</div>
<?php endif ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('menutype'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('menutype'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('parent_id'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('parent_id'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('menuordering'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('menuordering'); ?>
</div>
</div>
</div>
<div class="span6">
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('access'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('access'); ?>
</div>
</div>
<?php if ($this->item->type == 'component') : ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('home'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('home'); ?>
</div>
</div>
<?php endif; ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('browserNav'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('browserNav'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('template_style_id'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('template_style_id'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('language'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('language'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('note'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('note'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('id'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('id'); ?>
</div>
</div>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'options', JText::_('COM_MENUS_ADVANCED_FIELDSET_LABEL', true)); ?>
<?php echo $this->loadTemplate('options'); ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php if ($assoc) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'associations', JText::_('JGLOBAL_FIELDSET_ASSOCIATIONS', true)); ?>
<?php echo $this->loadTemplate('associations'); ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if (!empty($this->modules)) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'modules', JText::_('COM_MENUS_ITEM_MODULE_ASSIGNMENT', true)); ?>
<?php echo $this->loadTemplate('modules'); ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
</fieldset>
<input type="hidden" name="task" value="" />
<?php echo $this->form->getInput('component_id'); ?>
<?php echo JHtml::_('form.token'); ?>
<input type="hidden" id="fieldtype" name="fieldtype" value="" />
</form>

View File

@ -0,0 +1,12 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
echo JLayoutHelper::render('joomla.edit.associations', $this);

View File

@ -0,0 +1,88 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.framework', true);
$script = array();
$script[] = " window.addEvent('domready', function() {";
$script[] = " document.id('showmods').addEvent('click', function(e) {";
$script[] = " document.id('showmods').setStyle('display', 'block');";
$script[] = " jQuery('.table tr.no').toggle();";
$script[] = " });";
$script[] = " })";
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
?>
<div class="control-group">
<div class="control-label">
<label for="showmods"><?php echo JText::_('COM_MENUS_ITEM_FIELD_HIDE_UNASSIGNED');?></label>
</div>
<div class="controls">
<input type="checkbox" id="showmods" />
</div>
</div>
<table class="table table-striped">
<thead>
<tr>
<th class="left">
<?php echo JText::_('COM_MENUS_HEADING_ASSIGN_MODULE');?>
</th>
<th>
<?php echo JText::_('COM_MENUS_HEADING_DISPLAY');?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->modules as $i => &$module) : ?>
<?php if (is_null($module->menuid)) : ?>
<?php if (!$module->except || $module->menuid < 0) : ?>
<tr class="no row<?php echo $i % 2;?>">
<?php else : ?>
<tr class="row<?php echo $i % 2;?>">
<?php endif; ?>
<?php endif; ?>
<td>
<?php $link = 'index.php?option=com_modules&amp;client_id=0&amp;task=module.edit&amp;id=' . $module->id . '&amp;tmpl=component&amp;view=module&amp;layout=modal'; ?>
<a class="modal" href="<?php echo $link;?>" rel="{handler: 'iframe', size: {x: 900, y: 550}}" title="<?php echo JText::_('COM_MENUS_EDIT_MODULE_SETTINGS');?>">
<?php echo JText::sprintf('COM_MENUS_MODULE_ACCESS_POSITION', $this->escape($module->title), $this->escape($module->access_title), $this->escape($module->position)); ?></a>
</td>
<td class="center">
<?php if (is_null($module->menuid)) : ?>
<?php if ($module->except):?>
<span class="label label-success">
<?php echo JText::_('JYES'); ?>
</span>
<?php else : ?>
<span class="label label-important">
<?php echo JText::_('JNO'); ?>
</span>
<?php endif;?>
<?php elseif ($module->menuid > 0) : ?>
<span class="label label-success">
<?php echo JText::_('JYES'); ?>
</span>
<?php elseif ($module->menuid < 0) : ?>
<span class="label label-important">
<?php echo JText::_('JNO'); ?>
</span>
<?php else : ?>
<span class="label label-info">
<?php echo JText::_('JALL'); ?>
</span>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>

View File

@ -0,0 +1,44 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<?php
echo JHtml::_('bootstrap.startAccordion', 'menuOptions', array('active' => 'collapse0'));
$fieldSets = $this->form->getFieldsets('params');
$i = 0;
foreach ($fieldSets as $name => $fieldSet) :
if (!(($this->item->link == 'index.php?option=com_wrapper&view=wrapper') && $fieldSet->name == 'request')
&& !($this->item->link == 'index.php?Itemid=' && $fieldSet->name == 'aliasoptions')) :
$label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_MENUS_'.$name.'_FIELDSET_LABEL';
echo JHtml::_('bootstrap.addSlide', 'menuOptions', JText::_($label), 'collapse' . $i++);
if (isset($fieldSet->description) && trim($fieldSet->description)) :
echo '<p class="tip">'.$this->escape(JText::_($fieldSet->description)).'</p>';
endif;
?>
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php endforeach;
echo JHtml::_('bootstrap.endSlide');
endif;
endforeach;?>
<?php
echo JHtml::_('bootstrap.endAccordion');

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,123 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* The HTML Menus Menu Item View.
*
* @package Joomla.Administrator
* @subpackage com_menus
* @since 1.6
*/
class MenusViewItem extends JViewLegacy
{
protected $form;
protected $item;
protected $modules;
protected $state;
/**
* Display the view
*/
public function display($tpl = null)
{
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->modules = $this->get('Modules');
$this->state = $this->get('State');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
return false;
}
parent::display($tpl);
$this->addToolbar();
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$input = JFactory::getApplication()->input;
$input->set('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
$canDo = MenusHelper::getActions($this->state->get('filter.parent_id'));
JToolbarHelper::title(JText::_($isNew ? 'COM_MENUS_VIEW_NEW_ITEM_TITLE' : 'COM_MENUS_VIEW_EDIT_ITEM_TITLE'), 'menu-add');
// If a new item, can save the item. Allow users with edit permissions to apply changes to prevent returning to grid.
if ($isNew && $canDo->get('core.create'))
{
if ($canDo->get('core.edit'))
{
JToolbarHelper::apply('item.apply');
}
JToolbarHelper::save('item.save');
}
// If not checked out, can save the item.
if (!$isNew && !$checkedOut && $canDo->get('core.edit'))
{
JToolbarHelper::apply('item.apply');
JToolbarHelper::save('item.save');
}
// If the user can create new items, allow them to see Save & New
if ($canDo->get('core.create'))
{
JToolbarHelper::save2new('item.save2new');
}
// If an existing item, can save to a copy only if we have create rights.
if (!$isNew && $canDo->get('core.create'))
{
JToolbarHelper::save2copy('item.save2copy');
}
if ($isNew)
{
JToolbarHelper::cancel('item.cancel');
}
else
{
JToolbarHelper::cancel('item.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
// Get the help information for the menu item.
$lang = JFactory::getLanguage();
$help = $this->get('Help');
if ($lang->hasKey($help->url))
{
$debug = $lang->setDebug(false);
$url = JText::_($help->url);
$lang->setDebug($debug);
}
else
{
$url = $help->url;
}
JToolbarHelper::help($help->key, $help->local, $url);
}
}

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,276 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('formbehavior.chosen', 'select');
$user = JFactory::getUser();
$app = JFactory::getApplication();
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$ordering = ($listOrder == 'a.lft');
$canOrder = $user->authorise('core.edit.state', 'com_menus');
$saveOrder = ($listOrder == 'a.lft' && $listDirn == 'asc');
if ($saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_menus&task=items.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'itemList', 'adminForm', strtolower($listDirn), $saveOrderingUrl, false, true);
}
$sortFields = $this->getSortFields();
$assoc = isset($app->item_associations) ? $app->item_associations : 0;
?>
<script type="text/javascript">
Joomla.orderTable = function()
{
table = document.getElementById("sortTable");
direction = document.getElementById("directionTable");
order = table.options[table.selectedIndex].value;
if (order != '<?php echo $listOrder; ?>')
{
dirn = 'asc';
}
else
{
dirn = direction.options[direction.selectedIndex].value;
}
Joomla.tableOrdering(order, dirn, '');
}
</script>
<?php //Set up the filter bar. ?>
<form action="<?php echo JRoute::_('index.php?option=com_menus&view=items');?>" method="post" name="adminForm" id="adminForm">
<?php if (!empty( $this->sidebar)) : ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif;?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('COM_CONTENT_FILTER_SEARCH_DESC');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('COM_MENUS_ITEMS_SEARCH_FILTER'); ?>" />
</div>
<div class="btn-group pull-left hidden-phone">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
<?php echo JHtml::_('select.options', $sortFields, 'value', 'text', $listOrder);?>
</select>
</div>
</div>
<div class="clearfix"> </div>
<table class="table table-striped" id="itemList">
<thead>
<tr>
<th width="1%" class="hidden-phone">
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'a.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>
</th>
<th width="1%" class="hidden-phone">
<?php echo JHtml::_('grid.checkall'); ?>
</th>
<th width="1%" class="nowrap center">
<?php echo JHtml::_('grid.sort', 'JSTATUS', 'a.published', $listDirn, $listOrder); ?>
</th>
<th class="title">
<?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
</th>
<th width="5%" class="nowrap hidden-phone">
<?php echo JHtml::_('grid.sort', 'COM_MENUS_HEADING_HOME', 'a.home', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap hidden-phone">
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?>
</th>
<?php if ($assoc) : ?>
<th width="5%" class="nowrap hidden-phone">
<?php echo JHtml::_('grid.sort', 'COM_MENUS_HEADING_ASSOCIATION', 'association', $listDirn, $listOrder); ?>
</th>
<?php endif;?>
<th width="5%" class="nowrap hidden-phone">
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'language', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
</th>
<th width="1%" class="nowrap hidden-phone">
<?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
$originalOrders = array();
foreach ($this->items as $i => $item) :
$orderkey = array_search($item->id, $this->ordering[$item->parent_id]);
$canCreate = $user->authorise('core.create', 'com_menus');
$canEdit = $user->authorise('core.edit', 'com_menus');
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id')|| $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state', 'com_menus') && $canCheckin;
// Get the parents of item for sorting
if ($item->level > 1)
{
$parentsStr = "";
$_currentParentId = $item->parent_id;
$parentsStr = " ".$_currentParentId;
for ($j = 0; $j < $item->level; $j++)
{
foreach ($this->ordering as $k => $v)
{
$v = implode("-", $v);
$v = "-" . $v . "-";
if (strpos($v, "-" . $_currentParentId . "-") !== false)
{
$parentsStr .= " " . $k;
$_currentParentId = $k;
break;
}
}
}
}
else
{
$parentsStr = "";
}
?>
<tr class="row<?php echo $i % 2; ?>" sortable-group-id="<?php echo $item->parent_id;?>" item-id="<?php echo $item->id?>" parents="<?php echo $parentsStr?>" level="<?php echo $item->level?>">
<td class="order nowrap center hidden-phone">
<?php
$iconClass = '';
if (!$canChange)
{
$iconClass = ' inactive';
}
elseif (!$saveOrder)
{
$iconClass = ' inactive tip-top hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
}
?>
<span class="sortable-handler<?php echo $iconClass ?>">
<i class="icon-menu"></i>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $orderkey + 1;?>" />
<?php endif; ?>
</td>
<td class="center hidden-phone">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td class="center">
<?php echo JHtml::_('MenusHtml.Menus.state', $item->published, $i, $canChange, 'cb'); ?>
</td>
<td>
<?php echo str_repeat('<span class="gi">|&mdash;</span>', $item->level - 1) ?>
<?php if ($item->checked_out) : ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'items.', $canCheckin); ?>
<?php endif; ?>
<?php if ($canEdit) : ?>
<a href="<?php echo JRoute::_('index.php?option=com_menus&task=item.edit&id='.(int) $item->id);?>">
<?php echo $this->escape($item->title); ?></a>
<?php else : ?>
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
<span class="small">
<?php if ($item->type != 'url') : ?>
<?php if (empty($item->note)) : ?>
<?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias));?>
<?php else : ?>
<?php echo JText::sprintf('JGLOBAL_LIST_ALIAS_NOTE', $this->escape($item->alias), $this->escape($item->note));?>
<?php endif; ?>
<?php elseif ($item->type == 'url' && $item->note) : ?>
<?php echo JText::sprintf('JGLOBAL_LIST_NOTE', $this->escape($item->note));?>
<?php endif; ?>
</span>
<div class="small" title="<?php echo $this->escape($item->path);?>">
<?php echo str_repeat('<span class="gtr">&mdash;</span>', $item->level - 1) ?>
<span title="<?php echo isset($item->item_type_desc) ? htmlspecialchars($this->escape($item->item_type_desc), ENT_COMPAT, 'UTF-8') : ''; ?>">
<?php echo $this->escape($item->item_type); ?></span>
</div>
</td>
<td class="center hidden-phone">
<?php if ($item->type == 'component') : ?>
<?php if ($item->language == '*' || $item->home == '0'):?>
<?php echo JHtml::_('jgrid.isdefault', $item->home, $i, 'items.', ($item->language != '*' || !$item->home) && $canChange);?>
<?php elseif ($canChange):?>
<a href="<?php echo JRoute::_('index.php?option=com_menus&task=items.unsetDefault&cid[]='.$item->id.'&'.JSession::getFormToken().'=1');?>">
<?php echo JHtml::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, array('title' => JText::sprintf('COM_MENUS_GRID_UNSET_LANGUAGE', $item->language_title)), true);?>
</a>
<?php else:?>
<?php echo JHtml::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, array('title' => $item->language_title), true);?>
<?php endif;?>
<?php endif; ?>
</td>
<td class="small hidden-phone">
<?php echo $this->escape($item->access_level); ?>
</td>
<?php if ($assoc):?>
<td class="small hidden-phone">
<?php if ($item->association):?>
<?php echo JHtml::_('MenusHtml.Menus.association', $item->id);?>
<?php endif;?>
</td>
<?php endif;?>
<td class="small hidden-phone">
<?php if ($item->language == ''):?>
<?php echo JText::_('JDEFAULT'); ?>
<?php elseif ($item->language == '*'):?>
<?php echo JText::alt('JALL', 'language'); ?>
<?php else:?>
<?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
<?php endif;?>
</td>
<td class="center hidden-phone">
<span title="<?php echo sprintf('%d-%d', $item->lft, $item->rgt);?>">
<?php echo (int) $item->id; ?></span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php //Load the batch processing form.is user is allowed ?>
<?php if ($user->authorise('core.create', 'com_menus') || $user->authorise('core.edit', 'com_menus')) : ?>
<?php echo $this->loadTemplate('batch'); ?>
<?php endif;?>
<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; ?>" />
<input type="hidden" name="original_order_values" value="<?php echo implode($originalOrders, ','); ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>

View File

@ -0,0 +1,64 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$options = array(
JHtml::_('select.option', 'c', JText::_('JLIB_HTML_BATCH_COPY')),
JHtml::_('select.option', 'm', JText::_('JLIB_HTML_BATCH_MOVE'))
);
$published = $this->state->get('filter.published');
?>
<div class="modal hide fade" id="collapseModal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3><?php echo JText::_('COM_MENUS_BATCH_OPTIONS');?></h3>
</div>
<div class="modal-body">
<p><?php echo JText::_('COM_MENUS_BATCH_TIP'); ?></p>
<div class="control-group">
<div class="controls">
<?php echo JHtml::_('batch.access');?>
</div>
</div>
<div class="control-group">
<div class="controls">
<?php echo JHtml::_('batch.language'); ?>
</div>
</div>
<?php if ($published >= 0)
{
?>
<div id="batch-choose-action" class="combo control-group">
<label id="batch-choose-action-lbl" class="control-label" for="batch-choose-action">
<?php echo JText::_('COM_MENUS_BATCH_MENU_LABEL'); ?>
</label>
<div class="controls">
<select name="batch[menu_id]" class="inputbox" id="batch-menu-id">
<option value=""><?php echo JText::_('JSELECT') ?></option>
<?php echo JHtml::_('select.options', JHtml::_('menu.menuitems', array('published' => $published)));?>
</select>
</div>
</div>
<div id="batch-copy-move" class="control-group radio">
<?php echo JHtml::_('select.radiolist', $options, 'batch[move_copy]', '', 'value', 'text', 'm'); ?>
</div>
<?php
}
?>
</div>
<div class="modal-footer">
<button class="btn" type="button" onclick="document.id('batch-menu-id').value='';document.id('batch-access').value='';document.id('batch-language-id').value=''" data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
</button>
<button class="btn btn-primary" type="submit" onclick="Joomla.submitbutton('item.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>
</div>
</div>

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,309 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* The HTML Menus Menu Items View.
*
* @package Joomla.Administrator
* @subpackage com_menus
* @since 1.6
*/
class MenusViewItems extends JViewLegacy
{
protected $f_levels;
protected $items;
protected $pagination;
protected $state;
/**
* Display the view
*/
public function display($tpl = null)
{
$lang = JFactory::getLanguage();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
MenusHelper::addSubmenu('items');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->ordering = array();
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as $item)
{
$this->ordering[$item->parent_id][] = $item->id;
// item type text
switch ($item->type)
{
case 'url':
$value = JText::_('COM_MENUS_TYPE_EXTERNAL_URL');
break;
case 'alias':
$value = JText::_('COM_MENUS_TYPE_ALIAS');
break;
case 'separator':
$value = JText::_('COM_MENUS_TYPE_SEPARATOR');
break;
case 'heading':
$value = JText::_('COM_MENUS_TYPE_HEADING');
break;
case 'component':
default:
// load language
$lang->load($item->componentname.'.sys', JPATH_ADMINISTRATOR, null, false, false)
|| $lang->load($item->componentname.'.sys', JPATH_ADMINISTRATOR.'/components/'.$item->componentname, null, false, false)
|| $lang->load($item->componentname.'.sys', JPATH_ADMINISTRATOR, $lang->getDefault(), false, false)
|| $lang->load($item->componentname.'.sys', JPATH_ADMINISTRATOR.'/components/'.$item->componentname, $lang->getDefault(), false, false);
if (!empty($item->componentname))
{
$value = JText::_($item->componentname);
$vars = null;
parse_str($item->link, $vars);
if (isset($vars['view']))
{
// Attempt to load the view xml file.
$file = JPATH_SITE.'/components/'.$item->componentname.'/views/'.$vars['view'].'/metadata.xml';
if (is_file($file) && $xml = simplexml_load_file($file))
{
// Look for the first view node off of the root node.
if ($view = $xml->xpath('view[1]'))
{
if (!empty($view[0]['title']))
{
$vars['layout'] = isset($vars['layout']) ? $vars['layout'] : 'default';
// Attempt to load the layout xml file.
// If Alternative Menu Item, get template folder for layout file
if (strpos($vars['layout'], ':') > 0)
{
// Use template folder for layout file
$temp = explode(':', $vars['layout']);
$file = JPATH_SITE.'/templates/'.$temp[0].'/html/'.$item->componentname.'/'.$vars['view'].'/'.$temp[1].'.xml';
// Load template language file
$lang->load('tpl_'.$temp[0].'.sys', JPATH_SITE, null, false, false)
|| $lang->load('tpl_'.$temp[0].'.sys', JPATH_SITE.'/templates/'.$temp[0], null, false, false)
|| $lang->load('tpl_'.$temp[0].'.sys', JPATH_SITE, $lang->getDefault(), false, false)
|| $lang->load('tpl_'.$temp[0].'.sys', JPATH_SITE.'/templates/'.$temp[0], $lang->getDefault(), false, false);
}
else
{
// Get XML file from component folder for standard layouts
$file = JPATH_SITE.'/components/'.$item->componentname.'/views/'.$vars['view'].'/tmpl/'.$vars['layout'].'.xml';
}
if (is_file($file) && $xml = simplexml_load_file($file))
{
// Look for the first view node off of the root node.
if ($layout = $xml->xpath('layout[1]'))
{
if (!empty($layout[0]['title']))
{
$value .= ' » ' . JText::_(trim((string) $layout[0]['title']));
}
}
if (!empty($layout[0]->message[0]))
{
$item->item_type_desc = JText::_(trim((string) $layout[0]->message[0]));
}
}
}
}
unset($xml);
}
else
{
// Special case for absent views
$value .= ' » ' . $vars['view'];
}
}
}
else
{
if (preg_match("/^index.php\?option=([a-zA-Z\-0-9_]*)/", $item->link, $result))
{
$value = JText::sprintf('COM_MENUS_TYPE_UNEXISTING', $result[1]);
}
else {
$value = JText::_('COM_MENUS_TYPE_UNKNOWN');
}
}
break;
}
$item->item_type = $value;
}
// Levels filter.
$options = array();
$options[] = JHtml::_('select.option', '1', JText::_('J1'));
$options[] = JHtml::_('select.option', '2', JText::_('J2'));
$options[] = JHtml::_('select.option', '3', JText::_('J3'));
$options[] = JHtml::_('select.option', '4', JText::_('J4'));
$options[] = JHtml::_('select.option', '5', JText::_('J5'));
$options[] = JHtml::_('select.option', '6', JText::_('J6'));
$options[] = JHtml::_('select.option', '7', JText::_('J7'));
$options[] = JHtml::_('select.option', '8', JText::_('J8'));
$options[] = JHtml::_('select.option', '9', JText::_('J9'));
$options[] = JHtml::_('select.option', '10', JText::_('J10'));
$this->f_levels = $options;
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
// Allow a system plugin to insert dynamic menu types to the list shown in menus:
JDispatcher::getInstance()->trigger('onBeforeRenderMenuItems', array($this));
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT.'/helpers/menus.php';
$canDo = MenusHelper::getActions($this->state->get('filter.parent_id'));
$user = JFactory::getUser();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_MENUS_VIEW_ITEMS_TITLE'), 'menumgr.png');
if ($canDo->get('core.create'))
{
JToolbarHelper::addNew('item.add');
}
if ($canDo->get('core.edit'))
{
JToolbarHelper::editList('item.edit');
}
if ($canDo->get('core.edit.state'))
{
JToolbarHelper::publish('items.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('items.unpublish', 'JTOOLBAR_UNPUBLISH', true);
}
if (JFactory::getUser()->authorise('core.admin'))
{
JToolbarHelper::checkin('items.checkin', 'JTOOLBAR_CHECKIN', true);
}
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete'))
{
JToolbarHelper::deleteList('', 'items.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($canDo->get('core.edit.state'))
{
JToolbarHelper::trash('items.trash');
}
if ($canDo->get('core.edit.state'))
{
JToolbarHelper::makeDefault('items.setDefault', 'COM_MENUS_TOOLBAR_SET_HOME');
}
if (JFactory::getUser()->authorise('core.admin'))
{
JToolbarHelper::custom('items.rebuild', 'refresh.png', 'refresh_f2.png', 'JToolbar_Rebuild', false);
}
// Add a batch button
if ($user->authorise('core.create', 'com_menus') && $user->authorise('core.edit', 'com_menus') && $user->authorise('core.edit.state', 'com_menus'))
{
JHtml::_('bootstrap.modal', 'collapseModal');
$title = JText::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
}
JToolbarHelper::help('JHELP_MENUS_MENU_ITEM_MANAGER');
JHtmlSidebar::setAction('index.php?option=com_menus&view=items');
JHtmlSidebar::addFilter(
// @todo we need a label here
'',
'menutype',
JHtml::_('select.options', JHtml::_('menu.menus'), 'value', 'text', $this->state->get('filter.menutype')),
false
);
JHtmlSidebar::addFilter(
JText::_('COM_MENUS_OPTION_SELECT_LEVEL'),
'filter_level',
JHtml::_('select.options', $this->f_levels, 'value', 'text', $this->state->get('filter.level'))
);
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_PUBLISHED'),
'filter_published',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('archived' => false)), 'value', 'text', $this->state->get('filter.published'), true)
);
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_ACCESS'),
'filter_access',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
);
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_LANGUAGE'),
'filter_language',
JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'))
);
}
/**
* Returns an array of fields the table can be sorted by
*
* @return array Array containing the field name to sort by as the key and display text as value
*
* @since 3.0
*/
protected function getSortFields()
{
return array(
'a.lft' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.title' => JText::_('JGLOBAL_TITLE'),
'a.home' => JText::_('COM_MENUS_HEADING_HOME'),
'a.access' => JText::_('JGRID_HEADING_ACCESS'),
'association' => JText::_('COM_MENUS_HEADING_ASSOCIATION'),
'language' => JText::_('JGRID_HEADING_LANGUAGE'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,59 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
?>
<script type="text/javascript">
Joomla.submitbutton = function(task)
{
if (task == 'menu.cancel' || document.formvalidator.isValid(document.id('item-form')))
{
Joomla.submitform(task, document.getElementById('item-form'));
}
}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_menus&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="item-form" class="form-horizontal">
<fieldset>
<legend><?php echo JText::_('COM_MENUS_MENU_DETAILS');?></legend>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('title'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('title'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('menutype'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('menutype'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('description'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('description'); ?>
</div>
</div>
</fieldset>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,95 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* The HTML Menus Menu Item View.
*
* @package Joomla.Administrator
* @subpackage com_menus
* @since 1.6
*/
class MenusViewMenu extends JViewLegacy
{
protected $form;
protected $item;
protected $state;
/**
* Display the view
*/
public function display($tpl = null)
{
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
return false;
}
parent::display($tpl);
$this->addToolbar();
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$input = JFactory::getApplication()->input;
$input->set('hidemainmenu', true);
$isNew = ($this->item->id == 0);
$canDo = MenusHelper::getActions($this->state->get('filter.parent_id'));
JToolbarHelper::title(JText::_($isNew ? 'COM_MENUS_VIEW_NEW_MENU_TITLE' : 'COM_MENUS_VIEW_EDIT_MENU_TITLE'), 'menu.png');
// If a new item, can save the item. Allow users with edit permissions to apply changes to prevent returning to grid.
if ($isNew && $canDo->get('core.create'))
{
if ($canDo->get('core.edit'))
{
JToolbarHelper::apply('menu.apply');
}
JToolbarHelper::save('menu.save');
}
// If user can edit, can save the item.
if (!$isNew && $canDo->get('core.edit'))
{
JToolbarHelper::apply('menu.apply');
JToolbarHelper::save('menu.save');
}
// If the user can create new items, allow them to see Save & New
if ($canDo->get('core.create'))
{
JToolbarHelper::save2new('menu.save2new');
}
if ($isNew)
{
JToolbarHelper::cancel('menu.cancel');
}
else
{
JToolbarHelper::cancel('menu.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_MENUS_MENU_MANAGER_EDIT');
}
}

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,167 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('behavior.modal');
JHtml::_('formbehavior.chosen', 'select');
$uri = JUri::getInstance();
$return = base64_encode($uri);
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$modMenuId = (int) $this->get('ModMenuId');
?>
<script type="text/javascript">
Joomla.submitbutton = function(task)
{
if (task != 'menus.delete' || confirm('<?php echo JText::_('COM_MENUS_MENU_CONFIRM_DELETE', true);?>'))
{
Joomla.submitform(task);
}
}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_menus&view=menus');?>" method="post" name="adminForm" id="adminForm">
<?php if (!empty( $this->sidebar)) : ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif;?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('COM_MENUS_MENU_SEARCH_FILTER');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('COM_MENUS_ITEMS_SEARCH_FILTER'); ?>" />
</div>
<div class="btn-group pull-left hidden-phone">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
</div>
<div class="clearfix"> </div>
<table class="table table-striped">
<thead>
<tr>
<th width="1%">
<?php echo JHtml::_('grid.checkall'); ?>
</th>
<th>
<?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap center hidden-phone">
<?php echo JText::_('COM_MENUS_HEADING_PUBLISHED_ITEMS'); ?>
</th>
<th width="10%" class="nowrap center hidden-phone">
<?php echo JText::_('COM_MENUS_HEADING_UNPUBLISHED_ITEMS'); ?>
</th>
<th width="10%" class="nowrap center hidden-phone">
<?php echo JText::_('COM_MENUS_HEADING_TRASHED_ITEMS'); ?>
</th>
<th width="20%" class="nowrap hidden-phone">
<?php echo JText::_('COM_MENUS_HEADING_LINKED_MODULES'); ?>
</th>
<th width="1%" class="center 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) :
$canCreate = $user->authorise('core.create', 'com_menus');
$canEdit = $user->authorise('core.edit', 'com_menus');
$canChange = $user->authorise('core.edit.state', 'com_menus');
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="center">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td>
<a href="<?php echo JRoute::_('index.php?option=com_menus&view=items&menutype='.$item->menutype) ?> ">
<?php echo $this->escape($item->title); ?></a>
<p class="small">(<span><?php echo JText::_('COM_MENUS_MENU_MENUTYPE_LABEL') ?></span>
<?php if ($canEdit) : ?>
<?php echo '<a href="'.JRoute::_('index.php?option=com_menus&task=menu.edit&id='.$item->id).' title='.$this->escape($item->description).'">'.
$this->escape($item->menutype).'</a>'; ?>)
<?php else : ?>
<?php echo $this->escape($item->menutype)?>)
<?php endif; ?>
</p>
</td>
<td class="center btns">
<a class="badge badge-success" href="<?php echo JRoute::_('index.php?option=com_menus&view=items&menutype='.$item->menutype.'&filter_published=1');?>">
<?php echo $item->count_published; ?></a>
</td>
<td class="center btns">
<a class="badge" href="<?php echo JRoute::_('index.php?option=com_menus&view=items&menutype='.$item->menutype.'&filter_published=0');?>">
<?php echo $item->count_unpublished; ?></a>
</td>
<td class="center btns">
<a class="badge badge-error" href="<?php echo JRoute::_('index.php?option=com_menus&view=items&menutype='.$item->menutype.'&filter_published=-2');?>">
<?php echo $item->count_trashed; ?></a>
</td>
<td class="left">
<?php if (isset($this->modules[$item->menutype])) : ?>
<div class="btn-group">
<a href="#" class="btn btn-small dropdown-toggle" data-toggle="dropdown">
<?php echo JText::_('COM_MENUS_MODULES') ?>
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<?php foreach ($this->modules[$item->menutype] as &$module) : ?>
<li>
<?php if ($canEdit) : ?>
<a class="small modal" href="<?php echo JRoute::_('index.php?option=com_modules&task=module.edit&id='.$module->id.'&return='.$return.'&tmpl=component&layout=modal');?>" rel="{handler: 'iframe', size: {x: 1024, y: 450}, onClose: function() {window.location.reload()}}" title="<?php echo JText::_('COM_MENUS_EDIT_MODULE_SETTINGS');?>">
<?php echo JText::sprintf('COM_MENUS_MODULE_ACCESS_POSITION', $this->escape($module->title), $this->escape($module->access_title), $this->escape($module->position)); ?></a>
<?php else :?>
<?php echo JText::sprintf('COM_MENUS_MODULE_ACCESS_POSITION', $this->escape($module->title), $this->escape($module->access_title), $this->escape($module->position)); ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php elseif ($modMenuId) : ?>
<a href="<?php echo JRoute::_('index.php?option=com_modules&task=module.add&eid=' . $modMenuId . '&params[menutype]='.$item->menutype); ?>">
<?php echo JText::_('COM_MENUS_ADD_MENU_MODULE'); ?></a>
<?php endif; ?>
</td>
<td class="center">
<?php echo $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'); ?>
</div>
</form>

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,89 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* The HTML Menus Menu Menus View.
*
* @package Joomla.Administrator
* @subpackage com_menus
* @since 1.6
*/
class MenusViewMenus extends JViewLegacy
{
protected $items;
protected $modules;
protected $pagination;
protected $state;
/**
* Display the view
*/
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->modules = $this->get('Modules');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
MenusHelper::addSubmenu('menus');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT.'/helpers/menus.php';
$canDo = MenusHelper::getActions($this->state->get('filter.parent_id'));
JToolbarHelper::title(JText::_('COM_MENUS_VIEW_MENUS_TITLE'), 'menumgr.png');
if ($canDo->get('core.create'))
{
JToolbarHelper::addNew('menu.add');
}
if ($canDo->get('core.edit'))
{
JToolbarHelper::editList('menu.edit');
}
if ($canDo->get('core.delete'))
{
JToolbarHelper::divider();
JToolbarHelper::deleteList('', 'menus.delete');
}
JToolbarHelper::custom('menus.rebuild', 'refresh.png', 'refresh_f2.png', 'JTOOLBAR_REBUILD', false);
if ($canDo->get('core.admin'))
{
JToolbarHelper::divider();
JToolbarHelper::preferences('com_menus');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_MENUS_MENU_MANAGER');
}
}

View File

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

View File

@ -0,0 +1,71 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$input = JFactory::getApplication()->input;
// Checking if loaded via index.php or component.php
$tmpl = $input->getCmd('tmpl', '');
$document = JFactory::getDocument();
?>
<script type="text/javascript">
setmenutype = function(type)
{
<?php if ($tmpl) : ?>
window.parent.Joomla.submitbutton('item.setType', type);
window.parent.SqueezeBox.close();
<?php else : ?>
window.location="index.php?option=com_menus&view=item&task=item.setType&layout=edit&type="+('item.setType', type);
<?php endif; ?>
}
</script>
<?php echo JHtml::_('bootstrap.startAccordion', 'collapseTypes', array('active' => 'slide1')); ?>
<?php
$i = 0;
foreach ($this->types as $name => $list) : ?>
<?php echo JHtml::_('bootstrap.addSlide', 'collapseTypes', JText::_($name), 'collapse' . $i++); ?>
<ul class="nav nav-tabs nav-stacked">
<?php foreach ($list as $item) : ?>
<li>
<a class="choose_type" href="#" title="<?php echo JText::_($item->description); ?>"
onclick="javascript:setmenutype('<?php echo base64_encode(json_encode(array('id' => $this->recordId, 'title' => $item->title, 'request' => $item->request))); ?>')">
<?php echo JText::_($item->title);?> <small class="muted"><?php echo JText::_($item->description); ?></small>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php echo JHtml::_('bootstrap.endSlide'); ?>
<?php endforeach; ?>
<?php echo JHtml::_('bootstrap.addSlide', 'collapseTypes', JText::_('COM_MENUS_TYPE_SYSTEM'), 'collapse-system'); ?>
<ul class="nav nav-tabs nav-stacked">
<li><a class="choose_type" href="#" title="<?php echo JText::_('COM_MENUS_TYPE_EXTERNAL_URL_DESC'); ?>"
onclick="javascript:setmenutype('<?php echo base64_encode(json_encode(array('id' => $this->recordId, 'title' => 'url'))); ?>')">
<?php echo JText::_('COM_MENUS_TYPE_EXTERNAL_URL'); ?> <small class="muted"><?php echo JText::_('COM_MENUS_TYPE_EXTERNAL_URL_DESC'); ?></small>
</a>
</li>
<li><a class="choose_type" href="#" title="<?php echo JText::_('COM_MENUS_TYPE_ALIAS_DESC'); ?>"
onclick="javascript:setmenutype('<?php echo base64_encode(json_encode(array('id' => $this->recordId, 'title' => 'alias'))); ?>')">
<?php echo JText::_('COM_MENUS_TYPE_ALIAS'); ?> <small class="muted"><?php echo JText::_('COM_MENUS_TYPE_ALIAS_DESC'); ?></small>
</a>
</li>
<li><a class="choose_type" href="#" title="<?php echo JText::_('COM_MENUS_TYPE_SEPARATOR_DESC'); ?>"
onclick="javascript:setmenutype('<?php echo base64_encode(json_encode(array('id' => $this->recordId, 'title' => 'separator'))); ?>')">
<?php echo JText::_('COM_MENUS_TYPE_SEPARATOR'); ?> <small class="muted"><?php echo JText::_('COM_MENUS_TYPE_SEPARATOR_DESC'); ?></small>
</a>
</li>
<li><a class="choose_type" href="#" title="<?php echo JText::_('COM_MENUS_TYPE_HEADING_DESC'); ?>"
onclick="javascript:setmenutype('<?php echo base64_encode(json_encode(array('id' => $this->recordId, 'title' => 'heading'))); ?>')">
<?php echo JText::_('COM_MENUS_TYPE_HEADING'); ?> <small class="muted"><?php echo JText::_('COM_MENUS_TYPE_HEADING_DESC'); ?></small>
</a>
</li>
</ul>
<?php echo JHtml::_('bootstrap.endSlide'); ?>
<?php echo JHtml::_('bootstrap.endAccordion'); ?>

View File

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

View File

@ -0,0 +1,55 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* The HTML Menus Menu Item TYpes View.
*
* @package Joomla.Administrator
* @subpackage com_menus
* @since 1.6
*/
class MenusViewMenutypes extends JViewLegacy
{
/**
* Display the view
*/
public function display($tpl = null)
{
$input = JFactory::getApplication()->input;
$this->recordId = $input->getInt('recordId');
$this->types = $this->get('TypeOptions');
$this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 3.0
*/
protected function addToolbar()
{
// Add page title
JToolbarHelper::title(JText::_('COM_MENUS'), 'menumgr.png');
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
// Cancel
$title = JText::_('JTOOLBAR_CANCEL');
$dhtml = "<button onClick=\"location.href='index.php?option=com_menus&view=items'\" class=\"btn\">
<i class=\"icon-remove\" title=\"$title\"></i>
$title</button>";
$bar->appendButton('Custom', $dhtml, 'new');
}
}