| 1: | <?php | 
| 2: |  | 
| 3: |  | 
| 4: |  | 
| 5: |  | 
| 6: |  | 
| 7: |  | 
| 8: |  | 
| 9: |  | 
| 10: |  | 
| 11: |  | 
| 12: |  | 
| 13: |  | 
| 14: |  | 
| 15: |  | 
| 16: | $current_path = __DIR__; | 
| 17: | if (DIRECTORY_SEPARATOR !== '/') { | 
| 18: | $current_path = str_replace(DIRECTORY_SEPARATOR, '/', $current_path); | 
| 19: | } | 
| 20: | $xoops_root_path = substr($current_path, 0, strpos(strtolower($current_path), '/class/xoopseditor/tinymce/')); | 
| 21: | include_once $xoops_root_path . '/mainfile.php'; | 
| 22: | defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); | 
| 23: |  | 
| 24: |  | 
| 25: | function langDropdown() | 
| 26: | { | 
| 27: | $content = ''; | 
| 28: |  | 
| 29: | $time = time(); | 
| 30: | if (!isset($_SESSION['XoopsMLcontent']) && (isset($_SESSION['XoopsMLcontent_expire']) && $_SESSION['XoopsMLcontent_expire'] < $time)) { | 
| 31: | include_once XOOPS_ROOT_PATH . '/kernel/module.php'; | 
| 32: | $xlanguage = XoopsModule::getByDirname('xlanguage'); | 
| 33: | if (is_object($xlanguage) && $xlanguage->getVar('isactive')) { | 
| 34: | include_once(XOOPS_ROOT_PATH . '/modules/xlanguage/include/vars.php'); | 
| 35: | include_once(XOOPS_ROOT_PATH . '/modules/xlanguage/include/functions.php'); | 
| 36: |  | 
| 37: | $xlanguage_handler = xoops_getModuleHandler('language', 'xlanguage'); | 
| 38: | $xlanguage_handler->loadConfig(); | 
| 39: | $lang_list =& $xlanguage_handler->getAllList(); | 
| 40: |  | 
| 41: | $content .= '<select name="mlanguages" id="mlanguages">'; | 
| 42: | $content .= '<option value="">{#xoopsmlcontent_dlg.sellang}</option>'; | 
| 43: | if (!empty($lang_list) && \is_array($lang_list)) { | 
| 44: | foreach (array_keys($lang_list) as $lang_name) { | 
| 45: | $lang =& $lang_list[$lang_name]; | 
| 46: | $content .= '<option value="' . $lang['base']->getVar('lang_code') . '">' . $lang['base']->getVar('lang_name') . '</option>'; | 
| 47: | } | 
| 48: | } | 
| 49: | $content .= '</select>'; | 
| 50: | } elseif (defined('EASIESTML_LANGS') && defined('EASIESTML_LANGNAMES')) { | 
| 51: | $easiestml_langs = explode(',', EASIESTML_LANGS); | 
| 52: | $langnames       = explode(',', EASIESTML_LANGNAMES); | 
| 53: | $lang_options    = ''; | 
| 54: |  | 
| 55: | $content .= '<select name="mlanguages" id="mlanguages">'; | 
| 56: | $content .= '<option value="">{#xoopsmlcontent_dlg.sellang}</option>'; | 
| 57: | foreach ($easiestml_langs as $l => $lang) { | 
| 58: | $content .= '<option value="' . $lang . '">' . $langnames[$l] . '</option>'; | 
| 59: | } | 
| 60: | $content .= '</select>'; | 
| 61: | } else { | 
| 62: | $content .= '<input type="text" name="mlanguages" />'; | 
| 63: | } | 
| 64: | $_SESSION['XoopsMLcontent']        = $content; | 
| 65: | $_SESSION['XoopsMLcontent_expire'] = $time + 300; | 
| 66: | } | 
| 67: |  | 
| 68: | echo $_SESSION['XoopsMLcontent']; | 
| 69: | } | 
| 70: |  | 
| 71: | echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; | 
| 72: | echo '<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="' . _LANGCODE . '" lang="' . _LANGCODE . '">'; | 
| 73: | echo '<head>'; | 
| 74: | echo '<meta http-equiv="content-type" content="text/html; charset=' . _CHARSET . '" />'; | 
| 75: | echo '<meta http-equiv="content-language" content="' . _LANGCODE . '" />'; | 
| 76: | ?> | 
| 77: | <title>{#xoopsmlcontent_dlg.title}</title> | 
| 78: | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | 
| 79: | <script type="text/javascript" src="../../utils/mctabs.js"></script> | 
| 80: | <script type="text/javascript" src="../../utils/form_utils.js"></script> | 
| 81: | <script type="text/javascript" src="../../utils/validate.js"></script> | 
| 82: | <script type="text/javascript" src="js/xoopsmlcontent.js"></script> | 
| 83: | <link href="<?php echo xoops_getcss($xoopsConfig['theme_set']); ?>" rel="stylesheet" type="text/css"/> | 
| 84: | <link href="css/xoopsmlcontent.css" rel="stylesheet" type="text/css"/> | 
| 85: | <base target="_self"/> | 
| 86: | </head> | 
| 87: | <body> | 
| 88: | <form> | 
| 89: | <div class="tabs"> | 
| 90: | <ul> | 
| 91: | <li id="tab_mlcontent" class="current"><span><a href="javascript:mcTabs.displayTab('tab_mlcontent','mlcontent_panel');" | 
| 92: | onmousedown="return false;">{#xoopsmlcontent_dlg.title}</a></span></li> | 
| 93: | </ul> | 
| 94: | </div> | 
| 95: |  | 
| 96: | <div class="panel_wrapper"> | 
| 97: | <div id="mlcontent_panel" class="panel current" style="overflow:auto;"> | 
| 98: | <table border="0" cellspacing="1" width="100%"> | 
| 99: | <tr> | 
| 100: | <th>{#xoopsmlcontent_dlg.subtitle}</th> | 
| 101: | </tr> | 
| 102: |  | 
| 103: | <tr> | 
| 104: | <td class="even"> | 
| 105: | <?php langDropdown(); ?></td> | 
| 106: | </tr> | 
| 107: |  | 
| 108: | <tr> | 
| 109: | <td nowrap="nowrap"> | 
| 110: | <textarea type="text" id="mltext" name="mltext" value="" onkeyup="XoopsmlcontentDialog.onkeyupMLC(this);"></textarea> | 
| 111: | </td> | 
| 112: | </tr> | 
| 113: | <tr> | 
| 114: | <td class="foot bold"> | 
| 115: | <div id="mltext_msg"> | 
| 116: | <script type="text/javascript">XoopsmlcontentDialog.onkeyupMLC(this);</script> | 
| 117: | </div> | 
| 118: | </td> | 
| 119: | </tr> | 
| 120: | </table> | 
| 121: |  | 
| 122: | <div class="mceActionPanel floatright"> | 
| 123: | <input type="submit" id="insert" name="insert" value="{#insert}" onclick="XoopsmlcontentDialog.insertMLC();return false;"/> | 
| 124: | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();"/> | 
| 125: | </div> | 
| 126: | </div> | 
| 127: | </div> | 
| 128: | </form> | 
| 129: | </body> | 
| 130: | </html> | 
| 131: |  |