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,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);
}
}