Started with the first adaptation to implement the ssh protocol as mentioned in gh-230

This commit is contained in:
2018-02-15 02:42:39 +02:00
parent c78ef21678
commit 0c798d9579
59 changed files with 2231 additions and 935 deletions

View File

@@ -1,129 +0,0 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage edit.php
@author Llewellyn van der Merwe <http://joomlacomponentbuilder.com>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = JComponentHelper::getParams('com_componentbuilder');
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='.(int) $this->item->id.$this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('ftp.details_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'ftpTab', array('active' => 'details')); ?>
<?php echo JHtml::_('bootstrap.addTab', 'ftpTab', 'details', JText::_('COM_COMPONENTBUILDER_FTP_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('ftp.details_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php if ($this->canDo->get('joomla_component.access')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'ftpTab', 'linked_components', JText::_('COM_COMPONENTBUILDER_FTP_LINKED_COMPONENTS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('ftp.linked_components_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('ftp.delete') || $this->canDo->get('ftp.edit.created_by') || $this->canDo->get('ftp.edit.state') || $this->canDo->get('ftp.edit.created')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'ftpTab', 'publishing', JText::_('COM_COMPONENTBUILDER_FTP_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('ftp.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('ftp.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'ftpTab', 'permissions', JText::_('COM_COMPONENTBUILDER_FTP_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
<div class="adminformlist">
<?php foreach ($this->form->getFieldset('accesscontrol') as $field): ?>
<div>
<?php echo $field->label; echo $field->input;?>
</div>
<div class="clearfix"></div>
<?php endforeach; ?>
</div>
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="ftp.edit" />
<?php echo JHtml::_('form.token'); ?>
</div>
</div>
</div>
</form>
</div>

View File

@@ -127,93 +127,93 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder');
<script type="text/javascript">
// #jform_location listeners for location_vvvvwat function
// #jform_location listeners for location_vvvvwaz function
jQuery('#jform_location').on('keyup',function()
{
var location_vvvvwat = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwat(location_vvvvwat);
var location_vvvvwaz = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwaz(location_vvvvwaz);
});
jQuery('#adminForm').on('change', '#jform_location',function (e)
{
e.preventDefault();
var location_vvvvwat = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwat(location_vvvvwat);
var location_vvvvwaz = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwaz(location_vvvvwaz);
});
// #jform_location listeners for location_vvvvwau function
// #jform_location listeners for location_vvvvwba function
jQuery('#jform_location').on('keyup',function()
{
var location_vvvvwau = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwau(location_vvvvwau);
var location_vvvvwba = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwba(location_vvvvwba);
});
jQuery('#adminForm').on('change', '#jform_location',function (e)
{
e.preventDefault();
var location_vvvvwau = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwau(location_vvvvwau);
var location_vvvvwba = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwba(location_vvvvwba);
});
// #jform_type listeners for type_vvvvwav function
// #jform_type listeners for type_vvvvwbb function
jQuery('#jform_type').on('keyup',function()
{
var type_vvvvwav = jQuery("#jform_type").val();
vvvvwav(type_vvvvwav);
var type_vvvvwbb = jQuery("#jform_type").val();
vvvvwbb(type_vvvvwbb);
});
jQuery('#adminForm').on('change', '#jform_type',function (e)
{
e.preventDefault();
var type_vvvvwav = jQuery("#jform_type").val();
vvvvwav(type_vvvvwav);
var type_vvvvwbb = jQuery("#jform_type").val();
vvvvwbb(type_vvvvwbb);
});
// #jform_type listeners for type_vvvvwaw function
// #jform_type listeners for type_vvvvwbc function
jQuery('#jform_type').on('keyup',function()
{
var type_vvvvwaw = jQuery("#jform_type").val();
vvvvwaw(type_vvvvwaw);
var type_vvvvwbc = jQuery("#jform_type").val();
vvvvwbc(type_vvvvwbc);
});
jQuery('#adminForm').on('change', '#jform_type',function (e)
{
e.preventDefault();
var type_vvvvwaw = jQuery("#jform_type").val();
vvvvwaw(type_vvvvwaw);
var type_vvvvwbc = jQuery("#jform_type").val();
vvvvwbc(type_vvvvwbc);
});
// #jform_type listeners for type_vvvvwax function
// #jform_type listeners for type_vvvvwbd function
jQuery('#jform_type').on('keyup',function()
{
var type_vvvvwax = jQuery("#jform_type").val();
vvvvwax(type_vvvvwax);
var type_vvvvwbd = jQuery("#jform_type").val();
vvvvwbd(type_vvvvwbd);
});
jQuery('#adminForm').on('change', '#jform_type',function (e)
{
e.preventDefault();
var type_vvvvwax = jQuery("#jform_type").val();
vvvvwax(type_vvvvwax);
var type_vvvvwbd = jQuery("#jform_type").val();
vvvvwbd(type_vvvvwbd);
});
// #jform_target listeners for target_vvvvway function
// #jform_target listeners for target_vvvvwbe function
jQuery('#jform_target').on('keyup',function()
{
var target_vvvvway = jQuery("#jform_target input[type='radio']:checked").val();
vvvvway(target_vvvvway);
var target_vvvvwbe = jQuery("#jform_target input[type='radio']:checked").val();
vvvvwbe(target_vvvvwbe);
});
jQuery('#adminForm').on('change', '#jform_target',function (e)
{
e.preventDefault();
var target_vvvvway = jQuery("#jform_target input[type='radio']:checked").val();
vvvvway(target_vvvvway);
var target_vvvvwbe = jQuery("#jform_target input[type='radio']:checked").val();
vvvvwbe(target_vvvvwbe);
});

View File

@@ -42,7 +42,7 @@ Joomla.submitbutton = function(task)
Joomla.submitform(task);
return true;
} else {
alert(Joomla.JText._('ftp, some values are not acceptable.','Some values are unacceptable'));
alert(Joomla.JText._('server, some values are not acceptable.','Some values are unacceptable'));
return false;
}
}

View File

@@ -0,0 +1,271 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage edit.php
@author Llewellyn van der Merwe <http://joomlacomponentbuilder.com>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = JComponentHelper::getParams('com_componentbuilder');
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='.(int) $this->item->id.$this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('server.details_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'serverTab', array('active' => 'details')); ?>
<?php echo JHtml::_('bootstrap.addTab', 'serverTab', 'details', JText::_('COM_COMPONENTBUILDER_SERVER_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('server.details_left', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('server.details_right', $this); ?>
</div>
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('server.details_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php if ($this->canDo->get('joomla_component.access')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'serverTab', 'linked_components', JText::_('COM_COMPONENTBUILDER_SERVER_LINKED_COMPONENTS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('server.linked_components_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('server.delete') || $this->canDo->get('server.edit.created_by') || $this->canDo->get('server.edit.state') || $this->canDo->get('server.edit.created')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'serverTab', 'publishing', JText::_('COM_COMPONENTBUILDER_SERVER_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('server.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('server.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'serverTab', 'permissions', JText::_('COM_COMPONENTBUILDER_SERVER_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
<div class="adminformlist">
<?php foreach ($this->form->getFieldset('accesscontrol') as $field): ?>
<div>
<?php echo $field->label; echo $field->input;?>
</div>
<div class="clearfix"></div>
<?php endforeach; ?>
</div>
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="server.edit" />
<?php echo JHtml::_('form.token'); ?>
</div>
</div>
</div>
</form>
</div>
<script type="text/javascript">
// #jform_protocol listeners for protocol_vvvvwat function
jQuery('#jform_protocol').on('keyup',function()
{
var protocol_vvvvwat = jQuery("#jform_protocol").val();
vvvvwat(protocol_vvvvwat);
});
jQuery('#adminForm').on('change', '#jform_protocol',function (e)
{
e.preventDefault();
var protocol_vvvvwat = jQuery("#jform_protocol").val();
vvvvwat(protocol_vvvvwat);
});
// #jform_protocol listeners for protocol_vvvvwau function
jQuery('#jform_protocol').on('keyup',function()
{
var protocol_vvvvwau = jQuery("#jform_protocol").val();
vvvvwau(protocol_vvvvwau);
});
jQuery('#adminForm').on('change', '#jform_protocol',function (e)
{
e.preventDefault();
var protocol_vvvvwau = jQuery("#jform_protocol").val();
vvvvwau(protocol_vvvvwau);
});
// #jform_protocol listeners for protocol_vvvvwav function
jQuery('#jform_protocol').on('keyup',function()
{
var protocol_vvvvwav = jQuery("#jform_protocol").val();
var authentication_vvvvwav = jQuery("#jform_authentication input[type='radio']:checked").val();
vvvvwav(protocol_vvvvwav,authentication_vvvvwav);
});
jQuery('#adminForm').on('change', '#jform_protocol',function (e)
{
e.preventDefault();
var protocol_vvvvwav = jQuery("#jform_protocol").val();
var authentication_vvvvwav = jQuery("#jform_authentication input[type='radio']:checked").val();
vvvvwav(protocol_vvvvwav,authentication_vvvvwav);
});
// #jform_authentication listeners for authentication_vvvvwav function
jQuery('#jform_authentication').on('keyup',function()
{
var protocol_vvvvwav = jQuery("#jform_protocol").val();
var authentication_vvvvwav = jQuery("#jform_authentication input[type='radio']:checked").val();
vvvvwav(protocol_vvvvwav,authentication_vvvvwav);
});
jQuery('#adminForm').on('change', '#jform_authentication',function (e)
{
e.preventDefault();
var protocol_vvvvwav = jQuery("#jform_protocol").val();
var authentication_vvvvwav = jQuery("#jform_authentication input[type='radio']:checked").val();
vvvvwav(protocol_vvvvwav,authentication_vvvvwav);
});
// #jform_protocol listeners for protocol_vvvvwax function
jQuery('#jform_protocol').on('keyup',function()
{
var protocol_vvvvwax = jQuery("#jform_protocol").val();
var authentication_vvvvwax = jQuery("#jform_authentication input[type='radio']:checked").val();
vvvvwax(protocol_vvvvwax,authentication_vvvvwax);
});
jQuery('#adminForm').on('change', '#jform_protocol',function (e)
{
e.preventDefault();
var protocol_vvvvwax = jQuery("#jform_protocol").val();
var authentication_vvvvwax = jQuery("#jform_authentication input[type='radio']:checked").val();
vvvvwax(protocol_vvvvwax,authentication_vvvvwax);
});
// #jform_authentication listeners for authentication_vvvvwax function
jQuery('#jform_authentication').on('keyup',function()
{
var protocol_vvvvwax = jQuery("#jform_protocol").val();
var authentication_vvvvwax = jQuery("#jform_authentication input[type='radio']:checked").val();
vvvvwax(protocol_vvvvwax,authentication_vvvvwax);
});
jQuery('#adminForm').on('change', '#jform_authentication',function (e)
{
e.preventDefault();
var protocol_vvvvwax = jQuery("#jform_protocol").val();
var authentication_vvvvwax = jQuery("#jform_authentication input[type='radio']:checked").val();
vvvvwax(protocol_vvvvwax,authentication_vvvvwax);
});
// #jform_authentication listeners for authentication_vvvvway function
jQuery('#jform_authentication').on('keyup',function()
{
var authentication_vvvvway = jQuery("#jform_authentication input[type='radio']:checked").val();
var protocol_vvvvway = jQuery("#jform_protocol").val();
vvvvway(authentication_vvvvway,protocol_vvvvway);
});
jQuery('#adminForm').on('change', '#jform_authentication',function (e)
{
e.preventDefault();
var authentication_vvvvway = jQuery("#jform_authentication input[type='radio']:checked").val();
var protocol_vvvvway = jQuery("#jform_protocol").val();
vvvvway(authentication_vvvvway,protocol_vvvvway);
});
// #jform_protocol listeners for protocol_vvvvway function
jQuery('#jform_protocol').on('keyup',function()
{
var authentication_vvvvway = jQuery("#jform_authentication input[type='radio']:checked").val();
var protocol_vvvvway = jQuery("#jform_protocol").val();
vvvvway(authentication_vvvvway,protocol_vvvvway);
});
jQuery('#adminForm').on('change', '#jform_protocol',function (e)
{
e.preventDefault();
var authentication_vvvvway = jQuery("#jform_authentication input[type='radio']:checked").val();
var protocol_vvvvway = jQuery("#jform_protocol").val();
vvvvway(authentication_vvvvway,protocol_vvvvway);
});
</script>

View File

@@ -30,9 +30,9 @@ defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');
/**
* Ftp View class
* Server View class
*/
class ComponentbuilderViewFtp extends JViewLegacy
class ComponentbuilderViewServer extends JViewLegacy
{
/**
* display method of View
@@ -46,7 +46,7 @@ class ComponentbuilderViewFtp extends JViewLegacy
$this->script = $this->get('Script');
$this->state = $this->get('State');
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('ftp',$this->item);
$this->canDo = ComponentbuilderHelper::getActions('server',$this->item);
// get input
$jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
@@ -64,7 +64,7 @@ class ComponentbuilderViewFtp extends JViewLegacy
}
// Get Linked view data
$this->waelinked_components = $this->get('Waelinked_components');
$this->waplinked_components = $this->get('Waplinked_components');
// Set the toolbar
$this->addToolBar();
@@ -93,29 +93,29 @@ class ComponentbuilderViewFtp extends JViewLegacy
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_FTP_NEW' : 'COM_COMPONENTBUILDER_FTP_EDIT'), 'pencil-2 article-add');
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_SERVER_NEW' : 'COM_COMPONENTBUILDER_SERVER_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if ($this->refid || $this->ref)
{
if ($this->canDo->get('ftp.create') && $isNew)
if ($this->canDo->get('server.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('ftp.save', 'JTOOLBAR_SAVE');
JToolBarHelper::save('server.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('ftp.edit'))
elseif ($this->canDo->get('server.edit'))
{
// We can save the record.
JToolBarHelper::save('ftp.save', 'JTOOLBAR_SAVE');
JToolBarHelper::save('server.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('ftp.cancel', 'JTOOLBAR_CANCEL');
JToolBarHelper::cancel('server.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('ftp.cancel', 'JTOOLBAR_CLOSE');
JToolBarHelper::cancel('server.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@@ -123,43 +123,43 @@ class ComponentbuilderViewFtp extends JViewLegacy
if ($isNew)
{
// For new records, check the create permission.
if ($this->canDo->get('ftp.create'))
if ($this->canDo->get('server.create'))
{
JToolBarHelper::apply('ftp.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('ftp.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('ftp.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
JToolBarHelper::apply('server.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('server.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('server.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('ftp.cancel', 'JTOOLBAR_CANCEL');
JToolBarHelper::cancel('server.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('ftp.edit'))
if ($this->canDo->get('server.edit'))
{
// We can save the new record
JToolBarHelper::apply('ftp.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('ftp.save', 'JTOOLBAR_SAVE');
JToolBarHelper::apply('server.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('server.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('ftp.create'))
if ($this->canDo->get('server.create'))
{
JToolBarHelper::custom('ftp.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
JToolBarHelper::custom('server.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('ftp.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('ftp.edit') && $canVersion)
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('server.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('server.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.ftp', $this->item->id);
JToolbarHelper::versions('com_componentbuilder.server', $this->item->id);
}
if ($this->canDo->get('ftp.create'))
if ($this->canDo->get('server.create'))
{
JToolBarHelper::custom('ftp.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
JToolBarHelper::custom('server.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('ftp.cancel', 'JTOOLBAR_CLOSE');
JToolBarHelper::cancel('server.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
// set help url for this view if found
$help_url = ComponentbuilderHelper::getHelpUrl('ftp');
$help_url = ComponentbuilderHelper::getHelpUrl('server');
if (ComponentbuilderHelper::checkString($help_url))
{
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
@@ -196,8 +196,8 @@ class ComponentbuilderViewFtp extends JViewLegacy
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_FTP_NEW' : 'COM_COMPONENTBUILDER_FTP_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/ftp.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_SERVER_NEW' : 'COM_COMPONENTBUILDER_SERVER_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/server.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
// Add the CSS for Footable
$this->document->addStyleSheet('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');
@@ -209,7 +209,7 @@ class ComponentbuilderViewFtp extends JViewLegacy
$this->document->addScriptDeclaration($footable);
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/ftp/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/server/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
JText::script('view not acceptable. Error');
}
}

View File

@@ -34,8 +34,8 @@ JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_componentbuilder&task=ftps.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'ftpList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
$saveOrderingUrl = 'index.php?option=com_componentbuilder&task=servers.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'serverList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
@@ -56,7 +56,7 @@ if ($this->saveOrder)
Joomla.tableOrdering(order, dirn, '');
}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=ftps'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=servers'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
@@ -72,7 +72,7 @@ if ($this->saveOrder)
</div>
<?php else : ?>
<?php echo $this->loadTemplate('toolbar');?>
<table class="table table-striped" id="ftpList">
<table class="table table-striped" id="serverList">
<thead><?php echo $this->loadTemplate('head');?></thead>
<tfoot><?php echo $this->loadTemplate('foot');?></tfoot>
<tbody><?php echo $this->loadTemplate('body');?></tbody>
@@ -83,7 +83,7 @@ if ($this->saveOrder)
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_COMPONENTBUILDER_FTPS_BATCH_OPTIONS'),
'title' => JText::_('COM_COMPONENTBUILDER_SERVERS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')

View File

@@ -28,5 +28,5 @@ defined('_JEXEC') or die('Restricted access');
?>
<p><?php echo JText::_('COM_COMPONENTBUILDER_FTPS_BATCH_TIP'); ?></p>
<p><?php echo JText::_('COM_COMPONENTBUILDER_SERVERS_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?>

View File

@@ -32,6 +32,6 @@ defined('_JEXEC') or die('Restricted access');
<?php echo JText::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('ftp.batch');">
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('server.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>

View File

@@ -26,18 +26,18 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$edit = "index.php?option=com_componentbuilder&view=ftps&task=ftp.edit";
$edit = "index.php?option=com_componentbuilder&view=servers&task=server.edit";
?>
<?php foreach ($this->items as $i => $item): ?>
<?php
$canCheckin = $this->user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
$userChkOut = JFactory::getUser($item->checked_out);
$canDo = ComponentbuilderHelper::getActions('ftp',$item,'ftps');
$canDo = ComponentbuilderHelper::getActions('server',$item,'servers');
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="order nowrap center hidden-phone">
<?php if ($canDo->get('ftp.edit.state')): ?>
<?php if ($canDo->get('server.edit.state')): ?>
<?php
if ($this->saveOrder)
{
@@ -60,7 +60,7 @@ $edit = "index.php?option=com_componentbuilder&view=ftps&task=ftp.edit";
<?php endif; ?>
</td>
<td class="nowrap center">
<?php if ($canDo->get('ftp.edit')): ?>
<?php if ($canDo->get('server.edit')): ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
@@ -75,30 +75,33 @@ $edit = "index.php?option=com_componentbuilder&view=ftps&task=ftp.edit";
<?php endif; ?>
</td>
<td class="nowrap">
<?php if ($canDo->get('ftp.edit')): ?>
<?php if ($canDo->get('server.edit')): ?>
<div class="name">
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'ftps.', $canCheckin); ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'servers.', $canCheckin); ?>
<?php endif; ?>
</div>
<?php else: ?>
<div class="name"><?php echo $this->escape($item->name); ?></div>
<?php endif; ?>
</td>
<td class="hidden-phone">
<?php echo JText::_($item->protocol); ?>
</td>
<td class="center">
<?php if ($canDo->get('ftp.edit.state')) : ?>
<?php if ($canDo->get('server.edit.state')) : ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'ftps.', true, 'cb'); ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'servers.', true, 'cb'); ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'ftps.', false, 'cb'); ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'servers.', false, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'ftps.', true, 'cb'); ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'servers.', true, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'ftps.', false, 'cb'); ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'servers.', false, 'cb'); ?>
<?php endif; ?>
</td>
<td class="nowrap center hidden-phone">

View File

@@ -28,5 +28,5 @@ defined('_JEXEC') or die('Restricted access');
?>
<tr>
<td colspan="5"><?php echo $this->pagination->getListFooter(); ?></td>
<td colspan="6"><?php echo $this->pagination->getListFooter(); ?></td>
</tr>

View File

@@ -44,18 +44,21 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_FTP_NAME_LABEL', 'name', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_SERVER_NAME_LABEL', 'name', $this->listDirn, $this->listOrder); ?>
</th>
<th class="nowrap hidden-phone" >
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_SERVER_PROTOCOL_LABEL', 'protocol', $this->listDirn, $this->listOrder); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_FTP_STATUS', 'published', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_SERVER_STATUS', 'published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
<?php echo JText::_('COM_COMPONENTBUILDER_FTP_STATUS'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_SERVER_STATUS'); ?>
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_FTP_ID', 'id', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_SERVER_ID', 'id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@@ -30,7 +30,7 @@ defined('_JEXEC') or die('Restricted access');
<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::_('Search');?></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('Search Ftps'); ?>" />
<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('Search Servers'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>

View File

@@ -30,12 +30,12 @@ defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');
/**
* Componentbuilder View class for the Ftps
* Componentbuilder View class for the Servers
*/
class ComponentbuilderViewFtps extends JViewLegacy
class ComponentbuilderViewServers extends JViewLegacy
{
/**
* Ftps view display method
* Servers view display method
* @return void
*/
function display($tpl = null)
@@ -43,7 +43,7 @@ class ComponentbuilderViewFtps extends JViewLegacy
if ($this->getLayout() !== 'modal')
{
// Include helper submenu
ComponentbuilderHelper::addSubmenu('ftps');
ComponentbuilderHelper::addSubmenu('servers');
}
// Assign data to the view
@@ -55,11 +55,11 @@ class ComponentbuilderViewFtps extends JViewLegacy
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('ftp');
$this->canEdit = $this->canDo->get('ftp.edit');
$this->canState = $this->canDo->get('ftp.edit.state');
$this->canCreate = $this->canDo->get('ftp.create');
$this->canDelete = $this->canDo->get('ftp.delete');
$this->canDo = ComponentbuilderHelper::getActions('server');
$this->canEdit = $this->canDo->get('server.edit');
$this->canState = $this->canDo->get('server.edit.state');
$this->canCreate = $this->canDo->get('server.create');
$this->canDelete = $this->canDo->get('server.delete');
$this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window.
@@ -92,13 +92,13 @@ class ComponentbuilderViewFtps extends JViewLegacy
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_FTPS'), 'flash');
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=ftps');
JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_SERVERS'), 'flash');
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=servers');
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
if ($this->canCreate)
{
JToolBarHelper::addNew('ftp.add');
JToolBarHelper::addNew('server.add');
}
// Only load if there are items
@@ -106,18 +106,18 @@ class ComponentbuilderViewFtps extends JViewLegacy
{
if ($this->canEdit)
{
JToolBarHelper::editList('ftp.edit');
JToolBarHelper::editList('server.edit');
}
if ($this->canState)
{
JToolBarHelper::publishList('ftps.publish');
JToolBarHelper::unpublishList('ftps.unpublish');
JToolBarHelper::archiveList('ftps.archive');
JToolBarHelper::publishList('servers.publish');
JToolBarHelper::unpublishList('servers.unpublish');
JToolBarHelper::archiveList('servers.archive');
if ($this->canDo->get('core.admin'))
{
JToolBarHelper::checkin('ftps.checkin');
JToolBarHelper::checkin('servers.checkin');
}
}
@@ -137,26 +137,26 @@ class ComponentbuilderViewFtps extends JViewLegacy
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{
JToolbarHelper::deleteList('', 'ftps.delete', 'JTOOLBAR_EMPTY_TRASH');
JToolbarHelper::deleteList('', 'servers.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($this->canState && $this->canDelete)
{
JToolbarHelper::trash('ftps.trash');
JToolbarHelper::trash('servers.trash');
}
if ($this->canDo->get('core.export') && $this->canDo->get('ftp.export'))
if ($this->canDo->get('core.export') && $this->canDo->get('server.export'))
{
JToolBarHelper::custom('ftps.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true);
JToolBarHelper::custom('servers.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true);
}
}
if ($this->canDo->get('core.import') && $this->canDo->get('ftp.import'))
if ($this->canDo->get('core.import') && $this->canDo->get('server.import'))
{
JToolBarHelper::custom('ftps.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false);
JToolBarHelper::custom('servers.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false);
}
// set help url for this view if found
$help_url = ComponentbuilderHelper::getHelpUrl('ftps');
$help_url = ComponentbuilderHelper::getHelpUrl('servers');
if (ComponentbuilderHelper::checkString($help_url))
{
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
@@ -207,7 +207,7 @@ class ComponentbuilderViewFtps extends JViewLegacy
{
// Name Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_COMPONENTBUILDER_FTP_NAME_LABEL').' -',
'- Select '.JText::_('COM_COMPONENTBUILDER_SERVER_NAME_LABEL').' -',
'filter_name',
JHtml::_('select.options', $this->nameOptions, 'value', 'text', $this->state->get('filter.name'))
);
@@ -216,11 +216,33 @@ class ComponentbuilderViewFtps extends JViewLegacy
{
// Name Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_FTP_NAME_LABEL').' -',
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_SERVER_NAME_LABEL').' -',
'batch[name]',
JHtml::_('select.options', $this->nameOptions, 'value', 'text')
);
}
}
// Set Protocol Selection
$this->protocolOptions = $this->getTheProtocolSelections();
if ($this->protocolOptions)
{
// Protocol Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_COMPONENTBUILDER_SERVER_PROTOCOL_LABEL').' -',
'filter_protocol',
JHtml::_('select.options', $this->protocolOptions, 'value', 'text', $this->state->get('filter.protocol'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Protocol Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_SERVER_PROTOCOL_LABEL').' -',
'batch[protocol]',
JHtml::_('select.options', $this->protocolOptions, 'value', 'text')
);
}
}
}
@@ -235,8 +257,8 @@ class ComponentbuilderViewFtps extends JViewLegacy
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_('COM_COMPONENTBUILDER_FTPS'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/ftps.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->setTitle(JText::_('COM_COMPONENTBUILDER_SERVERS'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/servers.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
}
/**
@@ -267,7 +289,8 @@ class ComponentbuilderViewFtps extends JViewLegacy
return array(
'a.sorting' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.name' => JText::_('COM_COMPONENTBUILDER_FTP_NAME_LABEL'),
'a.name' => JText::_('COM_COMPONENTBUILDER_SERVER_NAME_LABEL'),
'a.protocol' => JText::_('COM_COMPONENTBUILDER_SERVER_PROTOCOL_LABEL'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
@@ -282,7 +305,7 @@ class ComponentbuilderViewFtps extends JViewLegacy
// Select the text.
$query->select($db->quoteName('name'));
$query->from($db->quoteName('#__componentbuilder_ftp'));
$query->from($db->quoteName('#__componentbuilder_server'));
$query->order($db->quoteName('name') . ' ASC');
// Reset the query using our newly populated query object.
@@ -302,5 +325,41 @@ class ComponentbuilderViewFtps extends JViewLegacy
return $_filter;
}
return false;
}
protected function getTheProtocolSelections()
{
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select the text.
$query->select($db->quoteName('protocol'));
$query->from($db->quoteName('#__componentbuilder_server'));
$query->order($db->quoteName('protocol') . ' ASC');
// Reset the query using our newly populated query object.
$db->setQuery($query);
$results = $db->loadColumn();
if ($results)
{
// get model
$model = $this->getModel();
$results = array_unique($results);
$_filter = array();
foreach ($results as $protocol)
{
// Translate the protocol selection
$text = $model->selectionTranslation($protocol,'protocol');
// Now add the protocol and its text to the options array
$_filter[] = JHtml::_('select.option', $protocol, JText::_($text));
}
return $_filter;
}
return false;
}
}