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,193 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.combobox');
JHtml::_('formbehavior.chosen', 'select');
$hasContent = empty($this->item->module) || $this->item->module == 'custom' || $this->item->module == 'mod_custom';
// Get Params Fieldsets
$this->fieldsets = $this->form->getFieldsets('params');
$script = "Joomla.submitbutton = function(task)
{
if (task == 'module.cancel' || document.formvalidator.isValid(document.id('module-form'))) {";
if ($hasContent)
{
$script .= $this->form->getField('content')->save();
}
$script .= " Joomla.submitform(task, document.getElementById('module-form'));
if (self != top)
{
window.top.setTimeout('window.parent.SqueezeBox.close()', 1000);
}
}
}";
JFactory::getDocument()->addScriptDeclaration($script);
?>
<form action="<?php echo JRoute::_('index.php?option=com_modules&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="module-form" class="form-validate form-horizontal">
<fieldset>
<ul class="nav nav-tabs">
<li class="active"><a href="#details" data-toggle="tab"><?php echo JText::_('JDETAILS'); ?></a></li>
<li><a href="#options" data-toggle="tab"><?php echo JText::_('JOPTIONS'); ?></a></li>
<?php if ($hasContent) : ?>
<li><a href="#custom" data-toggle="tab"><?php echo JText::_('COM_MODULES_CUSTOM_OUTPUT'); ?></a></li>
<?php endif; ?>
<?php if ($this->item->client_id == 0) : ?>
<li><a href="#assignment" data-toggle="tab"><?php echo JText::_('COM_MODULES_MENU_ASSIGNMENT'); ?></a></li>
<?php endif; ?>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="details">
<div class="row-fluid">
<div class="span6">
<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('showtitle'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('showtitle'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('position'); ?>
</div>
<div class="controls">
<?php echo $this->loadTemplate('positions'); ?>
</div>
</div>
<hr />
<?php if ((string) $this->item->xml->name != 'Login Form') : ?>
<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 endif; ?>
<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>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('ordering'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('ordering'); ?>
</div>
</div>
<?php if ((string) $this->item->xml->name != 'Login Form') : ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('publish_up'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('publish_up'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('publish_down'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('publish_down'); ?>
</div>
</div>
<?php endif; ?>
<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>
<div class="span6">
<?php if ($this->item->xml) : ?>
<?php if ($text = trim($this->item->xml->description)) : ?>
<blockquote>
<h4>
<?php echo JText::_('COM_MODULES_MODULE_DESCRIPTION'); ?>
<?php if ($this->item->id) : ?>
<span class="label label-info"><?php echo JText::_('JGRID_HEADING_ID'); ?> : <?php echo $this->item->id; ?></span>
<?php endif; ?>
</h4>
<hr />
<div>
<?php echo JText::_($text); ?>
</div>
<hr />
<div>
<span class="label"><?php echo $this->item->client_id == 0 ? JText::_('JSITE') : JText::_('JADMINISTRATOR'); ?></span> / <span class="label"><?php if ($this->item->xml) echo ($text = (string) $this->item->xml->name) ? JText::_($text) : $this->item->module;else echo JText::_('COM_MODULES_ERR_XML');?></span>
</div>
</blockquote>
<?php endif; ?>
<?php else : ?>
<div class="alert alert-error"><?php echo JText::_('COM_MODULES_ERR_XML'); ?></div>
<?php endif; ?>
</div>
</div>
</div>
<div class="tab-pane" id="options">
<?php echo $this->loadTemplate('options'); ?>
</div>
<?php if ($hasContent) : ?>
<div class="tab-pane" id="custom">
<?php echo $this->form->getInput('content'); ?>
</div>
<?php endif; ?>
<?php if ($this->item->client_id == 0) : ?>
<div class="tab-pane" id="assignment">
<?php echo $this->loadTemplate('assignment'); ?>
</div>
<?php endif; ?>
</div>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
<?php echo $this->form->getInput('module'); ?>
<?php echo $this->form->getInput('client_id'); ?>
</fieldset>
</form>

View File

@ -0,0 +1,150 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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;
// Initiasile related data.
require_once JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php';
$menuTypes = MenusHelper::getMenuLinks();
JHtml::_('script', 'jui/treeselectmenu.jquery.min.js', false, true);
$script = "
jQuery(document).ready(function()
{
menuHide(jQuery('#jform_assignment').val());
jQuery('#jform_assignment').change(function()
{
menuHide(jQuery(this).val());
})
});
function menuHide(val)
{
if (val == 0 || val == '-')
{
jQuery('#menuselect-group').hide();
}
else
{
jQuery('#menuselect-group').show();
}
}
";
// Add the script to the document head
JFactory::getDocument()->addScriptDeclaration($script);
?>
<div class="control-group">
<label id="jform_menus-lbl" class="control-label" for="jform_menus"><?php echo JText::_('COM_MODULES_MODULE_ASSIGN'); ?></label>
<div id="jform_menus" class="controls">
<select name="jform[assignment]" id="jform_assignment">
<?php echo JHtml::_('select.options', ModulesHelper::getAssignmentOptions($this->item->client_id), 'value', 'text', $this->item->assignment, true); ?>
</select>
</div>
</div>
<div id="menuselect-group" class="control-group">
<label id="jform_menuselect-lbl" class="control-label" for="jform_menuselect"><?php echo JText::_('JGLOBAL_MENU_SELECTION'); ?></label>
<div id="jform_menuselect" class="controls">
<?php if (!empty($menuTypes)) : ?>
<?php $id = 'jform_menuselect'; ?>
<div class="well well-small">
<div class="form-inline">
<span class="small"><?php echo JText::_('JSELECT'); ?>:
<a id="treeCheckAll" href="javascript://"><?php echo JText::_('JALL'); ?></a>,
<a id="treeUncheckAll" href="javascript://"><?php echo JText::_('JNONE'); ?></a>
</span>
<span class="width-20">|</span>
<span class="small"><?php echo JText::_('COM_MODULES_EXPAND'); ?>:
<a id="treeExpandAll" href="javascript://"><?php echo JText::_('JALL'); ?></a>,
<a id="treeCollapseAll" href="javascript://"><?php echo JText::_('JNONE'); ?></a>
</span>
<input type="text" id="treeselectfilter" name="treeselectfilter" class="input-medium search-query pull-right" size="16"
autocomplete="off" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" aria-invalid="false" tabindex="-1">
</div>
<div class="clearfix"></div>
<hr class="hr-condensed" />
<ul class="treeselect">
<?php foreach ($menuTypes as &$type) : ?>
<?php if (count($type->links)) : ?>
<?php $prevlevel = 0; ?>
<li>
<div class="treeselect-item pull-left">
<label class="pull-left nav-header"><?php echo $type->title; ?></label></div>
<?php foreach ($type->links as $i => $link) : ?>
<?php
if ($prevlevel < $link->level)
{
echo '<ul class="treeselect-sub">';
} elseif ($prevlevel > $link->level)
{
echo str_repeat('</li></ul>', $prevlevel - $link->level);
} else {
echo '</li>';
}
$selected = 0;
if ($this->item->assignment == 0)
{
$selected = 1;
} elseif ($this->item->assignment < 0)
{
$selected = in_array(-$link->value, $this->item->assigned);
} elseif ($this->item->assignment > 0)
{
$selected = in_array($link->value, $this->item->assigned);
}
?>
<li>
<div class="treeselect-item pull-left">
<input type="checkbox" class="pull-left" name="jform[assigned][]" id="<?php echo $id . $link->value; ?>" value="<?php echo (int) $link->value; ?>"<?php echo $selected ? ' checked="checked"' : ''; ?> />
<label for="<?php echo $id . $link->value; ?>" class="pull-left"><?php echo $link->text; ?> <span class="small"><?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($link->alias));?></span></label>
</div>
<?php
if (!isset($type->links[$i + 1]))
{
echo str_repeat('</li></ul>', $link->level);
}
$prevlevel = $link->level;
?>
<?php endforeach; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<div style="display:none;" id="treeselectmenu">
<div class="pull-left nav-hover treeselect-menu">
<div class="btn-group">
<a href="#" data-toggle="dropdown" class="dropdown-toggle btn btn-micro">
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li class="nav-header"><?php echo JText::_('COM_MODULES_SUBITEMS'); ?></li>
<li class="divider"></li>
<li class=""><a class="checkall" href="javascript://"><i class="icon-checkbox"></i> <?php echo JText::_('JSELECT'); ?></a>
</li>
<li><a class="uncheckall" href="javascript://"><i class="icon-checkbox-unchecked"></i> <?php echo JText::_('COM_MODULES_DESELECT'); ?></a>
</li>
<div class="treeselect-menu-expand">
<li class="divider"></li>
<li><a class="expandall" href="javascript://"><i class="icon-plus"></i> <?php echo JText::_('COM_MODULES_EXPAND'); ?></a></li>
<li><a class="collapseall" href="javascript://"><i class="icon-minus"></i> <?php echo JText::_('COM_MODULES_COLLAPSE'); ?></a></li>
</div>
</ul>
</div>
</div>
</div>
</div>
<?php endif; ?>
</div>
</div>

View File

@ -0,0 +1,38 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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', 'moduleOptions', array('active' => 'collapse0'));
$fieldSets = $this->form->getFieldsets('params');
$i = 0;
foreach ($fieldSets as $name => $fieldSet) :
$label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_MODULES_'.$name.'_FIELDSET_LABEL';
$class = isset($fieldSet->class) && !empty($fieldSet->class) ? $fieldSet->class : '';
echo JHtml::_('bootstrap.addSlide', 'moduleOptions', JText::_($label), 'collapse' . $i++, $class);
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');
endforeach;
echo JHtml::_('bootstrap.endAccordion');

View File

@ -0,0 +1,34 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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;
require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php';
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
$clientId = $this->item->client_id;
$state = 1;
$selectedPosition = $this->item->position;
$positions = JHtml::_('modules.positions', $clientId, $state, $selectedPosition);
// Add custom position to options
$customGroupText = JText::_('COM_MODULES_CUSTOM_POSITION');
// Build field
$attr = array(
'id' => 'jform_position',
'list.select' => $this->item->position,
'list.attr' => 'class="chzn-custom-value input-xlarge" '
. 'data-custom_group_text="' . $customGroupText . '" '
. 'data-no_results_text="' . JText::_('COM_MODULES_ADD_CUSTOM_POSITION') . '" '
. 'data-placeholder="' . JText::_('COM_MODULES_TYPE_OR_SELECT_POSITION') . '" '
);
echo JHtml::_('select.groupedlist', $positions, 'jform[position]', $attr);

View File

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

View File

@ -0,0 +1,26 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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;
?>
<div class="btn-toolbar">
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('module.save');">
<?php echo JText::_('JSAVE');?></button>
</div>
<div class="btn-group">
<button type="button" class="btn" onclick="window.parent.SqueezeBox.close();">
<?php echo JText::_('JCANCEL');?></button>
</div>
<div class="clearfix"></div>
</div>
<?php
$this->setLayout('edit');
echo $this->loadTemplate();

View File

@ -0,0 +1,103 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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;
/**
* View to edit a module.
*
* @package Joomla.Administrator
* @subpackage com_modules
* @since 1.6
*/
class ModulesViewModule 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;
}
$this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JFactory::getApplication()->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 = ModulesHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
JToolbarHelper::title(JText::sprintf('COM_MODULES_MANAGER_MODULE', JText::_($this->item->module)), 'module.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create') ))
{
JToolbarHelper::apply('module.apply');
JToolbarHelper::save('module.save');
}
if (!$checkedOut && $canDo->get('core.create'))
{
JToolbarHelper::save2new('module.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create'))
{
JToolbarHelper::save2copy('module.save2copy');
}
if (empty($this->item->id))
{
JToolbarHelper::cancel('module.cancel');
}
else
{
JToolbarHelper::cancel('module.cancel', 'JTOOLBAR_CLOSE');
}
// 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 = null;
}
JToolbarHelper::help($help->key, false, $url);
}
}

View File

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

View File

@ -0,0 +1,257 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', 'select');
$client = $this->state->get('filter.client_id') ? 'administrator' : 'site';
$user = JFactory::getUser();
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$trashed = $this->state->get('filter.published') == -2 ? true : false;
$canOrder = $user->authorise('core.edit.state', 'com_modules');
$saveOrder = $listOrder == 'ordering';
if ($saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_modules&task=modules.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'articleList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
}
$sortFields = $this->getSortFields();
?>
<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>
<form action="<?php echo JRoute::_('index.php?option=com_modules'); ?>" 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_BANNERS_SEARCH_IN_TITLE');?></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_MODULES_MODULES_FILTER_SEARCH_DESC'); ?>" />
</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="articleList">
<thead>
<tr>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', '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="15%" class="nowrap hidden-phone">
<?php echo JHtml::_('grid.sort', 'COM_MODULES_HEADING_POSITION', 'position', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap hidden-phone" >
<?php echo JHtml::_('grid.sort', 'COM_MODULES_HEADING_MODULE', 'name', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap hidden-phone">
<?php echo JHtml::_('grid.sort', 'COM_MODULES_HEADING_PAGES', 'pages', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap hidden-phone">
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?>
</th>
<th width="5%" class="nowrap hidden-phone">
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'language_title', $listDirn, $listOrder); ?>
</th>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="10">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php foreach ($this->items as $i => $item) :
$ordering = ($listOrder == 'ordering');
$canCreate = $user->authorise('core.create', 'com_modules');
$canEdit = $user->authorise('core.edit', 'com_modules');
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id')|| $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state', 'com_modules') && $canCheckin;
?>
<tr class="row<?php echo $i % 2; ?>" sortable-group-id="<?php echo $item->position?>">
<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 $item->ordering;?>" class="width-20 text-area-order" />
<?php endif; ?>
</td>
<td class="center hidden-phone">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td class="center">
<?php echo JHtml::_('modules.state', $item->published, $i, $canChange, 'cb'); ?>
</td>
<td class="has-context">
<div class="pull-left">
<?php if ($item->checked_out) : ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'modules.', $canCheckin); ?>
<?php endif; ?>
<?php if ($canEdit) : ?>
<a href="<?php echo JRoute::_('index.php?option=com_modules&task=module.edit&id='.(int) $item->id); ?>">
<?php echo $this->escape($item->title); ?></a>
<?php else : ?>
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
<?php if (!empty($item->note)) : ?>
<div class="small">
<?php echo JText::sprintf('JGLOBAL_LIST_NOTE', $this->escape($item->note));?>
</div>
<?php endif; ?>
</div>
<div class="pull-left">
<?php
// Create dropdown items
JHtml::_('dropdown.edit', $item->id, 'module.');
JHtml::_('dropdown.divider');
if ($item->published) :
JHtml::_('dropdown.unpublish', 'cb' . $i, 'modules.');
else :
JHtml::_('dropdown.publish', 'cb' . $i, 'modules.');
endif;
JHtml::_('dropdown.divider');
if ($item->checked_out) :
JHtml::_('dropdown.checkin', 'cb' . $i, 'modules.');
endif;
if ($trashed) :
JHtml::_('dropdown.untrash', 'cb' . $i, 'modules.');
else :
JHtml::_('dropdown.trash', 'cb' . $i, 'modules.');
endif;
// Render dropdown list
echo JHtml::_('dropdown.render');
?>
</div>
</td>
<td class="small hidden-phone">
<?php if ($item->position) : ?>
<span class="label label-info">
<?php echo $item->position; ?>
</span>
<?php else : ?>
<span class="label">
<?php echo JText::_('JNONE'); ?>
</span>
<?php endif; ?>
</td>
<td class="small hidden-phone">
<?php echo $item->name;?>
</td>
<td class="small hidden-phone">
<?php echo $item->pages; ?>
</td>
<td class="small hidden-phone">
<?php echo $this->escape($item->access_level); ?>
</td>
<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">
<?php echo (int) $item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php //Load the batch processing form. ?>
<?php echo $this->loadTemplate('batch'); ?>
<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,70 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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;
$clientId = $this->state->get('filter.client_id');
$published = $this->state->get('filter.published');
$positions = JHtml::_('modules.positions', $clientId, $published);
// Add custom position to options
$customGroupText = JText::_('COM_MODULES_CUSTOM_POSITION');
// Build field
$attr = array(
'id' => 'batch-position-id',
'list.attr' => 'class="chzn-custom-value input-xlarge" '
. 'data-custom_group_text="' . $customGroupText . '" '
. 'data-no_results_text="' . JText::_('COM_MODULES_ADD_CUSTOM_POSITION') . '" '
. 'data-placeholder="' . JText::_('COM_MODULES_TYPE_OR_SELECT_POSITION') . '" '
);
?>
<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_MODULES_BATCH_OPTIONS');?></h3>
</div>
<div class="modal-body">
<p><?php echo JText::_('COM_MODULES_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 class="control-group">
<div class="controls">
<label id="batch-choose-action-lbl" for="batch-choose-action">
<?php echo JText::_('COM_MODULES_BATCH_POSITION_LABEL'); ?>
</label>
<div id="batch-choose-action" class="control-group">
<?php echo JHtml::_('select.groupedlist', $positions, 'batch[position_id]', $attr) ?>
<div id="batch-move-copy" class="control-group radio">
<?php echo JHtml::_('modules.batchOptions'); ?>
</div>
</div>
</div>
</div>
<?php endif; ?>
</div>
<div class="modal-footer">
<button class="btn" type="button" onclick="document.id('batch-position-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('module.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>
</div>
</div>

View File

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

View File

@ -0,0 +1,202 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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;
/**
* View class for a list of modules.
*
* @package Joomla.Administrator
* @subpackage com_modules
* @since 1.6
*/
class ModulesViewModules extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
/**
* Display the view
*/
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
return false;
}
// Check if there are no matching items
if (!count($this->items)){
JFactory::getApplication()->enqueueMessage(
JText::_('COM_MODULES_MSG_MANAGE_NO_MODULES'),
'warning'
);
}
$this->addToolbar();
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = ModulesHelper::getActions();
$user = JFactory::getUser();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_MODULES_MANAGER_MODULES'), 'module.png');
if ($canDo->get('core.create'))
{
$title = JText::_('JTOOLBAR_NEW');
$dhtml = "<button onClick=\"location.href='index.php?option=com_modules&amp;view=select'\" class=\"btn btn-small btn-success\">
<i class=\"icon-plus icon-white\" title=\"$title\"></i>
$title</button>";
$bar->appendButton('Custom', $dhtml, 'new');
}
if ($canDo->get('core.edit'))
{
JToolbarHelper::editList('module.edit');
}
if ($canDo->get('core.create'))
{
JToolbarHelper::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
}
if ($canDo->get('core.edit.state'))
{
JToolbarHelper::publish('modules.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('modules.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::checkin('modules.checkin');
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete'))
{
JToolbarHelper::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state'))
{
JToolbarHelper::trash('modules.trash');
}
// Add a batch button
if ($user->authorise('core.create', 'com_modules') && $user->authorise('core.edit', 'com_modules') && $user->authorise('core.edit.state', 'com_modules'))
{
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');
}
if ($canDo->get('core.admin'))
{
JToolbarHelper::preferences('com_modules');
}
JToolbarHelper::help('JHELP_EXTENSIONS_MODULE_MANAGER');
JHtmlSidebar::addEntry(
JText::_('JSITE'),
'index.php?option=com_modules&filter_client_id=0',
$this->state->get('filter.client_id') == 0
);
JHtmlSidebar::addEntry(
JText::_('JADMINISTRATOR'),
'index.php?option=com_modules&filter_client_id=1',
$this->state->get('filter.client_id') == 1
);
JHtmlSidebar::setAction('index.php?option=com_modules');
JHtmlSidebar::addFilter(
// @todo we need a label for this
'',
'filter_client_id',
JHtml::_('select.options', ModulesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')),
false
);
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_PUBLISHED'),
'filter_state',
JHtml::_('select.options', ModulesHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state'))
);
JHtmlSidebar::addFilter(
JText::_('COM_MODULES_OPTION_SELECT_POSITION'),
'filter_position',
JHtml::_('select.options', ModulesHelper::getPositions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.position'))
);
JHtmlSidebar::addFilter(
JText::_('COM_MODULES_OPTION_SELECT_MODULE'),
'filter_module',
JHtml::_('select.options', ModulesHelper::getModules($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.module'))
);
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'))
);
$this->sidebar = JHtmlSidebar::render();
}
/**
* 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(
'ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.title' => JText::_('JGLOBAL_TITLE'),
'position' => JText::_('COM_MODULES_HEADING_POSITION'),
'name' => JText::_('COM_MODULES_HEADING_MODULE'),
'pages' => JText::_('COM_MODULES_HEADING_PAGES'),
'a.access' => JText::_('JGRID_HEADING_ACCESS'),
'language_title' => JText::_('JGRID_HEADING_LANGUAGE'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}

View File

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

View File

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

View File

@ -0,0 +1,104 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('formbehavior.chosen', 'select');
$function = JFactory::getApplication()->input->getCmd('function', 'jSelectPosition');
$lang = JFactory::getLanguage();
$ordering = $this->escape($this->state->get('list.ordering'));
$direction = $this->escape($this->state->get('list.direction'));
$clientId = $this->state->get('filter.client_id');
$state = $this->state->get('filter.state');
$template = $this->state->get('filter.template');
$type = $this->state->get('filter.type');
?>
<form action="<?php echo JRoute::_('index.php?option=com_modules&view=positions&layout=modal&tmpl=component&function='.$function.'&client_id=' .$clientId);?>" method="post" name="adminForm" id="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->escape($this->state->get('filter.search')); ?>" size="30" title="<?php echo JText::_('COM_MODULES_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_state" class="inputbox" onchange="this.form.submit()">
<option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option>
<?php echo JHtml::_('select.options', JHtml::_('modules.templateStates'), 'value', 'text', $state, true);?>
</select>
<select name="filter_type" class="inputbox" onchange="this.form.submit()">
<option value=""><?php echo JText::_('COM_MODULES_OPTION_SELECT_TYPE');?></option>
<?php echo JHtml::_('select.options', JHtml::_('modules.types'), 'value', 'text', $type, true);?>
</select>
<select name="filter_template" class="inputbox" onchange="this.form.submit()">
<option value=""><?php echo JText::_('JOPTION_SELECT_TEMPLATE');?></option>
<?php echo JHtml::_('select.options', JHtml::_('modules.templates', $clientId), 'value', 'text', $template, true);?>
</select>
</div>
</fieldset>
<table class="adminlist">
<thead>
<tr>
<th class="title" width="20%">
<?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'value', $direction, $ordering); ?>
</th>
<th>
<?php echo JHtml::_('grid.sort', 'COM_MODULES_HEADING_TEMPLATES', 'templates', $direction, $ordering); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="15">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php $i = 1; foreach ($this->items as $value => $templates) : ?>
<tr class="row<?php echo $i = 1 - $i;?>">
<td>
<a class="pointer" onclick="if (window.parent) window.parent.<?php echo $function;?>('<?php echo $value; ?>');"><?php echo $this->escape($value); ?></a>
</td>
<td>
<?php if (!empty($templates)):?>
<a class="pointer" onclick="if (window.parent) window.parent.<?php echo $function;?>('<?php echo $value; ?>');">
<ul>
<?php foreach ($templates as $template => $label):?>
<li><?php echo $lang->hasKey($label) ? JText::sprintf('COM_MODULES_MODULE_TEMPLATE_POSITION', JText::_($template), JText::_($label)) : JText::_($template);?></li>
<?php endforeach;?>
</ul>
</a>
<?php endif;?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $ordering; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $direction; ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>

View File

@ -0,0 +1,43 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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;
/**
* @package Joomla.Administrator
* @subpackage com_modules
* @since 1.6
*/
class ModulesViewPositions extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
/**
* Display the view
*/
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$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);
}
}

View File

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

View File

@ -0,0 +1,29 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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;
?>
<script>
var form = window.top.document.adminForm
var title = form.title.value;
var alltext = window.top.<?php echo $this->editor->getContent('text') ?>;
</script>
<table class="center" width="90%">
<tr>
<td class="contentheading" colspan="2"><script>document.write(title);</script></td>
</tr>
<tr>
<td valign="top" height="90%" colspan="2">
<script>document.write(alltext);</script>
</td>
</tr>
</table>

View File

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

View File

@ -0,0 +1,29 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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;
/**
* HTML View class for the Modules component
*
* @package Joomla.Administrator
* @subpackage com_modules
* @since 1.6
*/
class ModulesViewPreview extends JViewLegacy
{
public function display($tpl = null)
{
$editor = JFactory::getConfig()->get('editor');
$this->editor = JEditor::getInstance($editor);
parent::display($tpl);
}
}

View File

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

View File

@ -0,0 +1,46 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('bootstrap.popover');
$document = JFactory::getDocument();
?>
<h2><?php echo JText::_('COM_MODULES_TYPE_CHOOSE')?></h2>
<ul id="new-modules-list" class="list list-striped">
<?php foreach ($this->items as &$item) : ?>
<?php
// Prepare variables for the link.
$link = 'index.php?option=com_modules&task=module.add&eid='. $item->extension_id;
$name = $this->escape($item->name);
$desc = JHTML::_('string.truncate', ($this->escape($item->desc)), 200);
$short_desc = JHTML::_('string.truncate', ($this->escape($item->desc)), 90);
?>
<?php if ($document->direction != "rtl") : ?>
<li>
<a href="<?php echo JRoute::_($link);?>">
<strong><?php echo $name; ?></strong>
</a>
<small class="hasPopover" data-placement="right" title="<?php echo $name; ?>" data-content="<?php echo $desc; ?>"><?php echo $short_desc; ?></small>
</li>
<?php else : ?>
<li>
<small rel="popover" data-placement="left" title="<?php echo $name; ?>" data-content="<?php echo $desc; ?>"><?php echo $short_desc; ?></small>
<a href="<?php echo JRoute::_($link);?>">
<strong><?php echo $name; ?></strong>
</a>
</li>
<?php endif?>
<?php endforeach; ?>
</ul>
<div class="clr"></div>

View File

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

View File

@ -0,0 +1,67 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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;
/**
* HTML View class for the Modules component
*
* @package Joomla.Administrator
* @subpackage com_modules
* @since 1.6
*/
class ModulesViewSelect extends JViewLegacy
{
protected $state;
protected $items;
/**
* Display the view
*/
public function display($tpl = null)
{
$state = $this->get('State');
$items = $this->get('Items');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->state = &$state;
$this->items = &$items;
$this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 3.0
*/
protected function addToolbar()
{
// Add page title
JToolbarHelper::title(JText::_('COM_MODULES_MANAGER_MODULES'), 'module.png');
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
// Cancel
$title = JText::_('JTOOLBAR_CANCEL');
$dhtml = "<button onClick=\"location.href='index.php?option=com_modules'\" class=\"btn\">
<i class=\"icon-remove\" title=\"$title\"></i>
$title</button>";
$bar->appendButton('Custom', $dhtml, 'new');
}
}