After upgrading to 0.9.6, I have a strange problem that seems to be related. The TinyMCE Theme does not print the "selected" text to indicate which option I have selected in the Manager Settings Interface, so the Simple theme is always shown even though it is not what is in the database settings. The change to a different editor theme is recorded in the database and the setting is pulled from the database without a problem. I have even duplicated the code for the $themeOptions variable as shown to see how it prints out and it works fine on the snippet I created to test the code. I have been scratching my head as to why the selected text is not printing. Any thoughts would be much appreciated.
I have been looking at the following code:
From the TinyMCE Snippet:
case "OnInterfaceSettingsRender":
$manager_language = $modx->config['manager_language'];
$html = getTinyMCESettings($_lang, $tinyPath, $modx->config['manager_language'], $modx->config['use_editor'], $modx->config['tinymce_editor_theme'], $modx->config['tinymce_css_selectors'], $modx->config['tinymce_custom_plugins'], $modx->config['tinymce_custom_buttons1'], $modx->config['tinymce_custom_buttons2'], $modx->config['tinymce_custom_buttons3'], $modx->config['tinymce_custom_buttons4'], $displayStyle);
$e->output($html);
break;
From the TinyMCE.functions.php:
$arrThemes[] = array("simple",$_lang['tinymce_theme_simple']);
$arrThemes[] = array("advanced",$_lang['tinymce_theme_advanced']);
$arrThemes[] = array("editor",$_lang['tinymce_theme_editor']);
$arrThemes[] = array("custom",$_lang['tinymce_theme_custom']);
$arrThemesCount = count($arrThemes);
for ($i=0;$i<$arrThemesCount;$i++) {
$themeOptions .= " <option value=\"".$arrThemes[$i][0]."\"".($arrThemes[$i][0] == $theme ? " selected=\"selected\"" : "").">".$arrThemes[$i][1]."</option>\n";
}
The HTML output from TinyMCE for the theme info.
<tr class='row1' style="display: $display">
<td nowrap class="warning"><b>{$_lang["tinymce_editor_theme_title"]}</b></td>
<td><select name="tinymce_editor_theme">{$themeOptions}</select></td>
</tr>
My Custom snippet, which successfully displays the select option from the database:
$manager_language = $modx->config['manager_language'];
$path = $modx->config['base_path'].'assets/plugins/tinymce2111';
include_once($path.'/lang/'.$manager_language.'.inc.php');
$theme = $modx->config['tinymce_editor_theme'];
$arrThemes[] = array("simple",$_lang['tinymce_theme_simple']);
$arrThemes[] = array("advanced",$_lang['tinymce_theme_advanced']);
$arrThemes[] = array("editor",$_lang['tinymce_theme_editor']);
$arrThemes[] = array("custom",$_lang['tinymce_theme_custom']);
$arrThemesCount = count($arrThemes);
for ($i=0;$i<$arrThemesCount;$i++) {
$themeOptions .= " <option value=\"".$arrThemes[$i][0]."\"".($arrThemes[$i][0] == $theme ? " selected=\"selected\"" : "").">".$arrThemes[$i][1]."</option>\n";
}
echo("<select>".$themeOptions."</select>");