Apologies for the length/complication here!
I have a user-defined tag that creates tinyMCE text areas in some forms that also contain some regular textareas. In 1.2.3, after the first time you load the page, you get one more instance of each WYSIWYG text area with each load. This persists until you clear browser cookies or jump between major areas of the admin interface (re-loading pages in Content doesn't clear it up, but browsing the Extensions pages might.)
The page source HTML only contains one textarea tag, but the tinyMCE.init call provided by tinyconfig.php contains duplicate names in the 'elements:' list, causing some Ajax code to create multiple textareas.
The code in tinyconfig.php that I thought should re-initialize $_SESSION["tiny_live_textareas"] has been commented out (on or about line 56) as has the code in TinyMCE.module.php around line 128. The code in WYSIWYGTextarea() that builds the list does not chek for duplicates (line 87).
HOWEVER, the rest of the system doesn't have duplicate textareas popping up, so there must be some way that $_SESSION["tiny_live_textareas"] is re-initialized. Could someone please clue me in on how $_SESSION["tiny_live_textareas"] should be initialzed/cleared?
Code of my tag with a hack to uniquify the variable is below for reference. Thanks!
global $gCms;
$obj = new stdClass();
$name = $params['name'];
$columns = 80;
$rows = 15;
//echo "\n";
foreach($gCms->modules as $key=> $value)
{
if ($gCms->modules[$key]['object']->GetName() == "TinyMCE")
{
$obj = $gCms->modules[$key]['object'];
$obj->wysiwygactive=true;
// echo "\n";
echo $obj->WYSIWYGTextarea($name,$columns,$rows,'',$params ['content']);
break;
}
}
//echo "\n";
if (isset($_SESSION["tiny_live_textareas"]) && !($_SESSION["tiny_live_textareas"]==''))
{
$areas = Array();
$areas = explode(',', $_SESSION["tiny_live_textareas"]);
$areas =array_unique($areas);
$_SESSION["tiny_live_textareas"] = implode(',',$areas);
}
//echo "\n";
$_SESSION["tiny_live_textareas"] holding duplicates?
Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Return to “Developers Discussion”
Jump to
- Official Boards
- ↳ README FIRST!!!
- ↳ Announcements
- ↳ General Discussion
- Support Boards
- ↳ CMSMS Core
- ↳ Modules/Add-Ons
- ↳ Help Wanted (commercial)
- ↳ Translations
- Community Boards
- ↳ Tips and Tricks
- ↳ CMS Show Off
- ↳ Layout and Design (CSS & HTML)
- ↳ Feature ideas
- ↳ Developers Discussion
- ↳ The Lounge
- International Discussions
- ↳ Czech/Slovak - Česky/Slovensky
- ↳ Danish - Dansk
- ↳ Dutch - Nederlands
- ↳ Aankondigingen
- ↳ Tips en Trucs
- ↳ Vertalingen & Documentatie
- ↳ Hulp gezocht (commercieel)
- ↳ Finnish - Suomi
- ↳ French - Français
- ↳ German - Deutsch
- ↳ BITTE ZUERST LESEN !!!
- ↳ Ankündigungen
- ↳ Installation und Einstellungen
- ↳ Module und Tags
- ↳ Smarty-Tipps und -Tricks
- ↳ Layout und Design
- ↳ Suchmaschinenoptimierung (SEO)
- ↳ HowTo's
- ↳ Übersetzungen
- ↳ Show Off
- ↳ Hilfe gesucht (kommerziell)
- ↳ Stammtisch
- ↳ Hungarian - Magyar
- ↳ Italian - Italiano
- ↳ Moduli/Plugins
- ↳ Lithuanian - Lietuviškai
- ↳ Darbo / bendradarbiavimo pasiūlymai ir paieška
- ↳ Persian / Farsi
- ↳ Polish - Polski
- ↳ Portuguese - Português
- ↳ Russian - русский
- ↳ Предложения и поиск РАБОТЫ
- ↳ Spanish - Español
- ↳ Swedish - Svenska
- Geekmoot Editions
- ↳ Geekmoot 2016
- ↳ Connections and Conversations
- ↳ Geekmoot 2015
- ↳ Geek Moot 2012
- ↳ Locked: Geek Moot 2010
- Old Forums
- ↳ [locked] CMSMS 2.0 Beta
- ↳ Module Developers
- ↳ Closed Issues
- ↳ [locked] Documentation0ld
- ↳ Suggestions, Modifications & Corrections
- ↳ [locked] CMSMS 1.11 Beta
- ↳ Closed Issues
- ↳ [locked] CMSMS 1.10 Beta
- ↳ Closed Issues
- ↳ [locked] CMSMS 2.2 Beta
- ↳ [locked] CMSMS MLE fork
- ↳ Modules/Addon patchs
- ↳ [locked] Quality Assurance
- ↳ [locked] Accessability and Usability
- ↳ [locked] Documentation
- ↳ Media and presentations about CMSMS
- ↳ [locked] Installation, Setup and Upgrade