Created
June 24, 2014 12:34
-
-
Save BugBuster1701/aaa6ae1b34567526e47b to your computer and use it in GitHub Desktop.
dca, wizard, anonyme Funktion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'color' => array | |
( | |
'label' => &$GLOBALS['TL_LANG']['tl_fp_gallery']['color'], | |
'exclude' => true, | |
'inputType' => 'select', | |
'options_callback' => array('Class', 'getColors'), | |
'eval' => array('tl_class'=>'w50 wizard'), | |
'wizard' => array | |
( | |
function($dc) { | |
$strReturn = '<div class="color_wizard" style="height:24px;width:24px;margin-left:5px;display:inline-block;background-color:#%s;"></div>'; | |
$strReturn .= "<script> | |
window.addEvent('domready', function() { | |
var select = document.id('ctrl_$dc->field'); | |
var colorWizard = select.getSiblings('div.color_wizard')[0]; | |
select.addEvent('change', function() { | |
colorWizard.setStyle('background-color', '#' + this.value); | |
}); | |
}); | |
</script>"; | |
$strColor = $dc->activeRecord->color ?: 'FFFFFF'; | |
return sprintf($strReturn, $strColor); | |
} | |
), | |
'sql' => "varchar(6) NOT NULL default ''" | |
), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment