Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

JFormHelper::loadFieldClass('list');

require_once __DIR__ . '/../../helpers/templates.php';

/**
* Template Style Field class for the Joomla Framework.
*
* @since 3.5
*/
class JFormFieldTemplateLocation extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 3.5
*/
protected $type = 'TemplateLocation';

/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 3.5
*/
public function getOptions()
{
$options = TemplatesHelper::getClientOptions();

return array_merge(parent::getOptions(), $options);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

JFormHelper::loadFieldClass('list');

require_once __DIR__ . '/../../helpers/templates.php';

/**
* Template Style Field class for the Joomla Framework.
*
* @since 3.5
*/
class JFormFieldTemplateName extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 3.5
*/
protected $type = 'TemplateName';

/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 1.6
*/
public function getOptions()
{
$app = JFactory::getApplication();
$clientId = $app->getUserStateFromRequest('com_templates.styles.filter.client_id', 'filter_client_id', null);
$options = TemplatesHelper::getTemplateOptions($clientId);

return array_merge(parent::getOptions(), $options);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fieldset addfieldpath="/administrator/components/com_templates/models/fields" />

<fields name="filter">
<field
name="search"
type="text"
hint="JSEARCH_FILTER"
/>

<field
name="client_id"
type="templatelocation"
onchange="this.form.submit();"
>
<option value="">JGLOBAL_FILTER_CLIENT</option>
</field>

<field
name="template"
type="templatename"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_TEMPLATE</option>
</field>

</fields>
<fields name="list">
<field
name="limit"
type="limitbox"
class="input-mini"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fieldset addfieldpath="/administrator/components/com_templates/models/fields" />

<fields name="filter">
<field
name="search"
type="text"
hint="JSEARCH_FILTER"
/>

<field
name="client_id"
type="templatelocation"
onchange="this.form.submit();"
>
<option value="">JGLOBAL_FILTER_CLIENT</option>
</field>

</fields>
<fields name="list">
<field
name="limit"
type="limitbox"
class="input-mini"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,7 @@
<?php else : ?>
<div id="j-main-container">
<?php endif;?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER_LABEL'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_TEMPLATES_STYLES_FILTER_SEARCH_DESC'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><span class="icon-search"></span></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value='';this.form.submit();"><span class="icon-remove"></span></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>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<div class="clear"> </div>
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">
Expand Down
27 changes: 6 additions & 21 deletions administrator/components/com_templates/views/styles/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ class TemplatesViewStyles extends JViewLegacy
*/
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->preview = JComponentHelper::getParams('com_templates')->get('template_positions_display');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$this->preview = JComponentHelper::getParams('com_templates')->get('template_positions_display');

TemplatesHelper::addSubmenu('styles');

Expand Down Expand Up @@ -98,22 +100,5 @@ protected function addToolbar()

JHtmlSidebar::setAction('index.php?option=com_templates&view=styles');

JHtmlSidebar::addFilter(
JText::_('COM_TEMPLATES_FILTER_TEMPLATE'),
'filter_template',
JHtml::_(
'select.options',
TemplatesHelper::getTemplateOptions($this->state->get('filter.client_id')),
'value',
'text',
$this->state->get('filter.template')
)
);

JHtmlSidebar::addFilter(
JText::_('JGLOBAL_FILTER_CLIENT'),
'filter_client_id',
JHtml::_('select.options', TemplatesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id'))
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,8 @@
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">

<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('COM_TEMPLATES_TEMPLATES_FILTER_SEARCH_DESC'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_TEMPLATES_TEMPLATES_FILTER_SEARCH_DESC'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><span class="icon-search"></span></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value='';this.form.submit();"><span class="icon-remove"></span></button>
</div>
</div>
<div class="clearfix"> </div>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<div class="clearfix"> </div>
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">
<?php echo JText::_('COM_TEMPLATES_MSG_MANAGE_NO_TEMPLATES'); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ class TemplatesViewTemplates extends JViewLegacy
*/
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->preview = JComponentHelper::getParams('com_templates')->get('template_positions_display');
$this->file = base64_encode('home');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$this->preview = JComponentHelper::getParams('com_templates')->get('template_positions_display');
$this->file = base64_encode('home');

TemplatesHelper::addSubmenu('templates');

Expand Down Expand Up @@ -95,12 +97,6 @@ protected function addToolbar()

JHtmlSidebar::setAction('index.php?option=com_templates&view=templates');

JHtmlSidebar::addFilter(
JText::_('JGLOBAL_FILTER_CLIENT'),
'filter_client_id',
JHtml::_('select.options', TemplatesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id'))
);

$this->sidebar = JHtmlSidebar::render();
}
}