| Current Path : /home/antonen/chenglong.lt/modules/mod_flippingbook/assets/customfields/ |
| Current File : /home/antonen/chenglong.lt/modules/mod_flippingbook/assets/customfields/hideandshow.php |
<?php
/**
* @package mod_flippingbook - Flipping Book
* @version 2.0.3
* @created Oct 2020
* @author PluginJar.com
* @email support@pluginjar.com
* @website https://www.pluginjar.com
* @support https://www.pluginjar.com/premium-support-board.html
* @copyright Copyright (C) 2020 - 2021 PluginJar.com. All rights reserved.
* @license GNU General Public License version 2 and above
*/
defined('_JEXEC') or die;
jimport('joomla.form.formfield');
// The class name must always be the same as the filename (in camel case)
class JFormFieldHideandshow extends JFormField {
//The field class must know its own type through the variable $type.
protected $type = 'hideandshow';
public function getLabel() {
// code that returns HTML that will be shown as the label
}
public function getInput() {
echo '<script>
jQuery(document).ready( function () {
selectedVal = jQuery("#jform_params_theme").val();
if(selectedVal=="lightboxview"){
var thirdLi = jQuery( "#myTabTabs" ).find( "li" ).eq( "3" ).html("<a href=\"#attrib-basics_set\" data-toggle=\"tab\">'.JText::_('MOD_FLIPPINGBOOK_VIEWLIGHTBOX').'</a>");
jQuery( "#myTabTabs" ).find( "li" ).eq( "4" ).hide();
} else if(selectedVal=="linkview"){
var thirdLi = jQuery( "#myTabTabs" ).find( "li" ).eq( "3" ).html("<a href=\"#attrib-basics_set\" data-toggle=\"tab\">'.JText::_('MOD_FLIPPINGBOOK_VIEWLINKBUTTON').'</a>");
jQuery( "#myTabTabs" ).find( "li" ).eq( "4" ).hide();
} else if(selectedVal=="basicview"){
var thirdLi = jQuery( "#myTabTabs" ).find( "li" ).eq( "3" ).html("<a href=\"#attrib-basics_set\" data-toggle=\"tab\">'.JText::_('MOD_FLIPPINGBOOK_VIEWBASIC').'</a>");
jQuery( "#myTabTabs" ).find( "li" ).eq( "4" ).show();
}
console.log(selectedVal);
jQuery("#jform_params_theme").on("change", function(){
selectedVal = jQuery("#jform_params_theme").val();
console.log(selectedVal);
if(selectedVal=="lightboxview"){
var thirdLi = jQuery( "#myTabTabs" ).find( "li" ).eq( "3" ).html("<a href=\"#attrib-basics_set\" data-toggle=\"tab\">'.JText::_('MOD_FLIPPINGBOOK_VIEWLIGHTBOX').'</a>");
jQuery( "#myTabTabs" ).find( "li" ).eq( "4" ).hide();
} else if(selectedVal=="linkview"){
var thirdLi = jQuery( "#myTabTabs" ).find( "li" ).eq( "3" ).html("<a href=\"#attrib-basics_set\" data-toggle=\"tab\">'.JText::_('MOD_FLIPPINGBOOK_VIEWLINKBUTTON').'</a>");
jQuery( "#myTabTabs" ).find( "li" ).eq( "4" ).hide();
} else if(selectedVal=="basicview"){
var thirdLi = jQuery( "#myTabTabs" ).find( "li" ).eq( "3" ).html("<a href=\"#attrib-basics_set\" data-toggle=\"tab\">'.JText::_('MOD_FLIPPINGBOOK_VIEWBASIC').'</a>");
jQuery( "#myTabTabs" ).find( "li" ).eq( "4" ).show();
}
});
});
</script>';
}
}