2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Don't rely on JS executing as PHP for ckeditor - won't translate though

This commit is contained in:
Adam Zammit
2013-04-04 05:03:02 +00:00
parent bf582ac6ad
commit 94d6a1861d

View File

@@ -10,34 +10,20 @@ CKEDITOR.plugins.add( 'tokens',
// Gets the list of tags from the settings. // Gets the list of tags from the settings.
var tags = []; //new Array(); var tags = []; //new Array();
//this.add('value', 'drop_text', 'drop_label'); //this.add('value', 'drop_text', 'drop_label');
tags[0]=["{PERIODOFDAY}","Period of day (e.g. Morning)","Period of day (e.g. Morning)"];
<?php tags[1]=["{RESPONDENT:FIRSTNAME}","Respondent first name","Respondent first name"];
include_once("../../../../config.inc.php"); tags[2]=["{RESPONDENT:LASTNAME}","Respondent last name","Respondent last name"];
include_once("../../../../lang.inc.php"); tags[3]=["{OPERATOR:FIRSTNAME}", "Operator first name","Operator first name"];
tags[4]=["{OPERATOR:LASTNAME}","Operator last name","Operator last name"];
$tags = array(); tags[5]=["{SAMPLE:VAR}","Sample value (replace VAR)","Sample value (replace VAR)"];
$tags[] = array("{PeriodOfDay}",T_("Period of day (e.g. Morning)"));
$tags[] = array("{Respondent:firstName}",T_("Respondent first name"));
$tags[] = array("{Respondent:lastName}",T_("Respondent last name"));
$tags[] = array("{Operator:firstName}",T_("Operator first name"));
$tags[] = array("{Operator:lastName}",T_("Operator last name"));
$tags[] = array("{Sample:var}",T_("Sample value (replace var)"));
$tn = 0;
foreach($tags as $t)
{
print "tags[$tn]=[\"{$t[0]}\",\"{$t[1]}\",\"{$t[1]}\"];\n";
$tn++;
}
?>
// Create style objects for all defined styles. // Create style objects for all defined styles.
editor.ui.addRichCombo( 'tokens', editor.ui.addRichCombo( 'tokens',
{ {
label : "<?php echo T_("Insert tokens"); ?>", label : "Insert tokens",
title :"<?php echo T_("Insert tokens"); ?>", title :"Insert tokens",
voiceLabel : "<?php echo T_("Insert tokens"); ?>", voiceLabel : "Insert tokens",
className : 'cke_format', className : 'cke_format',
multiSelect : false, multiSelect : false,
@@ -49,7 +35,7 @@ CKEDITOR.plugins.add( 'tokens',
init : function() init : function()
{ {
this.startGroup( "<?php echo T_("Insert Tokens"); ?>" ); this.startGroup( "Insert Tokens" );
//this.add('value', 'drop_text', 'drop_label'); //this.add('value', 'drop_text', 'drop_label');
for (var this_tag in tags){ for (var this_tag in tags){
this.add(tags[this_tag][0], tags[this_tag][1], tags[this_tag][2]); this.add(tags[this_tag][0], tags[this_tag][1], tags[this_tag][2]);