Added GUID to selected views, and started updating JCB accordingly.
This commit is contained in:
@@ -137,7 +137,7 @@ jQuery(document).ready(function(){
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -115,7 +115,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -762,7 +762,7 @@ jQuery('#jform_add_custom_import').on('change',function() {
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -221,36 +221,6 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy
|
||||
}
|
||||
}
|
||||
|
||||
// Set Add Custom Import Selection
|
||||
$this->add_custom_importOptions = $this->getTheAdd_custom_importSelections();
|
||||
// We do some sanitation for Add Custom Import filter
|
||||
if (ComponentbuilderHelper::checkArray($this->add_custom_importOptions) &&
|
||||
isset($this->add_custom_importOptions[0]->value) &&
|
||||
!ComponentbuilderHelper::checkString($this->add_custom_importOptions[0]->value))
|
||||
{
|
||||
unset($this->add_custom_importOptions[0]);
|
||||
}
|
||||
// Only load Add Custom Import filter if it has values
|
||||
if (ComponentbuilderHelper::checkArray($this->add_custom_importOptions))
|
||||
{
|
||||
// Add Custom Import Filter
|
||||
JHtmlSidebar::addFilter(
|
||||
'- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -',
|
||||
'filter_add_custom_import',
|
||||
JHtml::_('select.options', $this->add_custom_importOptions, 'value', 'text', $this->state->get('filter.add_custom_import'))
|
||||
);
|
||||
|
||||
if ($this->canBatch && $this->canCreate && $this->canEdit)
|
||||
{
|
||||
// Add Custom Import Batch Selection
|
||||
JHtmlBatch_::addListSelection(
|
||||
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -',
|
||||
'batch[add_custom_import]',
|
||||
JHtml::_('select.options', $this->add_custom_importOptions, 'value', 'text')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Set Type Selection
|
||||
$this->typeOptions = $this->getTheTypeSelections();
|
||||
// We do some sanitation for Type filter
|
||||
@@ -339,6 +309,36 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy
|
||||
JHtml::_('select.options', $this->add_php_ajaxOptions, 'value', 'text')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Set Add Custom Import Selection
|
||||
$this->add_custom_importOptions = $this->getTheAdd_custom_importSelections();
|
||||
// We do some sanitation for Add Custom Import filter
|
||||
if (ComponentbuilderHelper::checkArray($this->add_custom_importOptions) &&
|
||||
isset($this->add_custom_importOptions[0]->value) &&
|
||||
!ComponentbuilderHelper::checkString($this->add_custom_importOptions[0]->value))
|
||||
{
|
||||
unset($this->add_custom_importOptions[0]);
|
||||
}
|
||||
// Only load Add Custom Import filter if it has values
|
||||
if (ComponentbuilderHelper::checkArray($this->add_custom_importOptions))
|
||||
{
|
||||
// Add Custom Import Filter
|
||||
JHtmlSidebar::addFilter(
|
||||
'- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -',
|
||||
'filter_add_custom_import',
|
||||
JHtml::_('select.options', $this->add_custom_importOptions, 'value', 'text', $this->state->get('filter.add_custom_import'))
|
||||
);
|
||||
|
||||
if ($this->canBatch && $this->canCreate && $this->canEdit)
|
||||
{
|
||||
// Add Custom Import Batch Selection
|
||||
JHtmlBatch_::addListSelection(
|
||||
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -',
|
||||
'batch[add_custom_import]',
|
||||
JHtml::_('select.options', $this->add_custom_importOptions, 'value', 'text')
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -428,42 +428,6 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getTheAdd_custom_importSelections()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select the text.
|
||||
$query->select($db->quoteName('add_custom_import'));
|
||||
$query->from($db->quoteName('#__componentbuilder_admin_view'));
|
||||
$query->order($db->quoteName('add_custom_import') . ' 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 $add_custom_import)
|
||||
{
|
||||
// Translate the add_custom_import selection
|
||||
$text = $model->selectionTranslation($add_custom_import,'add_custom_import');
|
||||
// Now add the add_custom_import and its text to the options array
|
||||
$_filter[] = JHtml::_('select.option', $add_custom_import, JText::_($text));
|
||||
}
|
||||
return $_filter;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getTheTypeSelections()
|
||||
{
|
||||
// Get a db connection.
|
||||
@@ -570,5 +534,41 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy
|
||||
return $_filter;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getTheAdd_custom_importSelections()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select the text.
|
||||
$query->select($db->quoteName('add_custom_import'));
|
||||
$query->from($db->quoteName('#__componentbuilder_admin_view'));
|
||||
$query->order($db->quoteName('add_custom_import') . ' 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 $add_custom_import)
|
||||
{
|
||||
// Translate the add_custom_import selection
|
||||
$text = $model->selectionTranslation($add_custom_import,'add_custom_import');
|
||||
// Now add the add_custom_import and its text to the options array
|
||||
$_filter[] = JHtml::_('select.option', $add_custom_import, JText::_($text));
|
||||
}
|
||||
return $_filter;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -120,7 +120,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -135,7 +135,7 @@ jQuery('#adminForm').on('change', '#jform_extension_type',function (e)
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -130,7 +130,7 @@ jQuery('#adminForm').on('change', '#jform_extension_type',function (e)
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -137,26 +137,7 @@ jQuery('<div id="loading"></div>')
|
||||
</div>
|
||||
<div class="span7">
|
||||
<div id="component-details"><?php echo $selectNotice; ?></div>
|
||||
<div id="noticeboard">
|
||||
<?php echo JHtml::_('bootstrap.startTabSet', 'compiler_tab', array('active' => 'vdm-noticeboard')); ?>
|
||||
<?php echo JHtml::_('bootstrap.addTab', 'compiler_tab', 'vdm-noticeboard', JText::_('COM_COMPONENTBUILDER_VDM_BOARD', true)); ?>
|
||||
<div class="well well-small">
|
||||
<h2 class="module-title nav-header"><?php echo JText::_('COM_COMPONENTBUILDER_VDM_NOTICE_BOARD'); ?><span id="vdm-new-notice" style="display:none; color:red;"> (<?php echo JText::_('COM_COMPONENTBUILDER_NEW_NOTICE'); ?>)</span></h2>
|
||||
<div id="noticeboard-md"><small><?php echo JText::_('COM_COMPONENTBUILDER_THE_NOTICE_BOARD_IS_LOADING'); ?><span class="loading-dots">.</span></small></div>
|
||||
<div style="text-align:right;"><small><a href="https://github.com/Llewellynvdm" target="_blank" style="color:gray"><<ewe>>yn</a></small></div>
|
||||
</div>
|
||||
<div><?php echo ComponentbuilderHelper::getDynamicContent('banner', '728-90'); ?></div>
|
||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||
<?php echo JHtml::_('bootstrap.addTab', 'compiler_tab', 'proboard', JText::_('COM_COMPONENTBUILDER_JCB_PRO_BOARD', true)); ?>
|
||||
<div class="well well-small">
|
||||
<h2 class="module-title nav-header"><?php echo JText::_('COM_COMPONENTBUILDER_JCB_PRO_NOTICE_BOARD'); ?></h2>
|
||||
<div id="proboard-md"><small><?php echo JText::_('COM_COMPONENTBUILDER_THE_PRO_BOARD_IS_LOADING'); ?><span class="loading-dots">.</span></small></div>
|
||||
<div style="text-align:right;"><small><a href="https://vdm.bz/get-jcb-pro-membership" target="_blank" style="color:gray">JCB PRO</a></small></div>
|
||||
</div>
|
||||
<div><?php echo ComponentbuilderHelper::getDynamicContent('banner', '728-90'); ?></div>
|
||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
|
||||
</div>
|
||||
<?php echo JLayoutHelper::render('jcbnoticeboardtabs', null); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="clear" style="display:none;">
|
||||
@@ -205,7 +186,7 @@ jQuery(document).ready( function($) {
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -250,6 +250,7 @@ class ComponentbuilderViewCompiler extends JViewLegacy
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var noticeboard = \"https://vdm.bz/componentbuilder-noticeboard-md\";
|
||||
var proboard = \"https://vdm.bz/componentbuilder-pro-noticeboard-md\";
|
||||
jQuery(document).ready(function () {
|
||||
@@ -299,7 +300,8 @@ class ComponentbuilderViewCompiler extends JViewLegacy
|
||||
data: request,
|
||||
jsonp: false
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
");
|
||||
}
|
||||
|
||||
|
@@ -115,7 +115,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -403,7 +403,7 @@ jQuery(document).ready( function($) {
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -273,7 +273,7 @@ jQuery(document).ready( function($) {
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -688,7 +688,7 @@ jQuery('#adminForm').on('change', '#jform_select_all',function (e)
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -432,7 +432,7 @@ jQuery('#adminForm').on('change', '#jform_fieldtype',function (e) {
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -534,7 +534,7 @@ jQuery('#adminForm').on('change', '#jform_has_defaults',function (e)
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -35,6 +35,7 @@ JHtml::_('behavior.keepalive');
|
||||
<input type="hidden" name="task" value="" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
||||
|
||||
<div id="snippets-github" class="bulk-updater-toggler">
|
||||
<br /><br /><br />
|
||||
<center><h1> <?php echo JText::_('COM_COMPONENTBUILDER_GETTING_AVAILABLE_LIBRARIES'); ?> <br /><?php echo JText::_('COM_COMPONENTBUILDER_LOADING'); ?>.<span class="loading-dots">.</span></h1></center>
|
||||
@@ -233,7 +234,7 @@ jQuery(document).ready( function($) {
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -128,6 +128,7 @@ class ComponentbuilderViewGet_snippets extends JViewLegacy
|
||||
$local_snippets[$path] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
// Add the JavaScript for JStore
|
||||
$this->document->addScript(JURI::root() .'media/com_componentbuilder/js/jquery.json.min.js');
|
||||
$this->document->addScript(JURI::root() .'media/com_componentbuilder/js/jstorage.min.js');
|
||||
@@ -161,6 +162,8 @@ class ComponentbuilderViewGet_snippets extends JViewLegacy
|
||||
// set to use no storage
|
||||
$expire = 30000; // only 30 seconds
|
||||
}
|
||||
// Set the Time To Live To JavaScript
|
||||
$this->document->addScriptDeclaration("var expire = ". (int) $expire.";");
|
||||
// set snippet path
|
||||
$this->document->addScriptDeclaration("var snippetPath = '". ComponentbuilderHelper::$snippetPath ."';");
|
||||
$this->document->addScriptDeclaration("var snippetsPath = '". ComponentbuilderHelper::$snippetsPath ."';");
|
||||
@@ -230,8 +233,6 @@ class ComponentbuilderViewGet_snippets extends JViewLegacy
|
||||
}
|
||||
}
|
||||
");
|
||||
// Set the Time To Live To JavaScript
|
||||
$this->document->addScriptDeclaration("var expire = ". (int) $expire.";");
|
||||
// load the local snippets
|
||||
if (ComponentbuilderHelper::checkArray($this->items))
|
||||
{
|
||||
|
@@ -535,7 +535,7 @@ jQuery(document).ready( function($) {
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -759,7 +759,7 @@ jQuery('#adminForm').on('change', '#jform_translation_tool',function (e)
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -637,7 +637,7 @@ var create_a_snippet = '<?php echo JText::_('COM_COMPONENTBUILDER_CREATE_A_SNIPP
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -631,7 +631,7 @@ jQuery('#adminForm').on('change', '#jform_add_head',function (e)
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -114,7 +114,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -215,7 +215,7 @@ jQuery.fn.selText = function() {
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -580,7 +580,7 @@ jQuery(document).ready(function(){
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -141,7 +141,7 @@ jQuery(document).ready( function($) {
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -421,7 +421,7 @@ jQuery(document).ready( function($) {
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -220,7 +220,7 @@ var create_a_snippet = '<?php echo JText::_('COM_COMPONENTBUILDER_CREATE_A_SNIPP
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
@@ -146,7 +146,7 @@ jQuery(document).ready( function($) {
|
||||
?>
|
||||
function JRouter(link) {
|
||||
<?php
|
||||
if ($app->isSite())
|
||||
if ($app->isClient('site'))
|
||||
{
|
||||
echo 'var url = "'.JURI::root().'";';
|
||||
}
|
||||
|
Reference in New Issue
Block a user