<?php
/**
* @package MOStlyCE Admin
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/

/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

/**
* @package Mambo_4.6
*/
class HTML_expConfig {

        function showconfig( &$row, &$lists, $option) {
                global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_lang;
                $tabs = new mosTabs(0);

                if (!file_exists("$mosConfig_absolute_path/administrator/components/com_mostlyce/info/admin_info_$mosConfig_lang.txt"))
                {
                  $admin_info_lang = "english";
                }else{
                  $admin_info_lang = "$mosConfig_lang";
                }
                
                if (!file_exists("$mosConfig_absolute_path/mambots/editors/mostlyce/jscripts/tiny_mce/info/editor_info_$mosConfig_lang.php"))
                {
                  $editor_info_lang = "english";
                }else{
                  $editor_info_lang = "$mosConfig_lang";
                }

                ?>
                <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
                <table class="adminheading">
                <tr>
                        <th class="config">
                        MOStlyCE Configuration :
                        <span class="componentheading">
                        mostlyce_config.php is :
                         <?php echo is_writable( '../mambots/editors/mostlyce/jscripts/tiny_mce/mostlyce_config.php' ) ? '<b><font color="green"> Writeable</font></b>' : '<b><font color="red">Unwriteable</font></b>'?>
                        </span>
                        </th>
                </tr>
                </table>
                <script language="javascript" type="text/javascript">
                function submitbutton(pressbutton) {
                        var form = document.adminForm;
                        if (pressbutton == 'save') {
                                //if (confirm ("Are you sure?")) {
                                submitform( pressbutton );
                                //}
                        } else {
                                document.location.href = 'index2.php';
                        }
                }
                </script>
                <form action="index2.php" method="post" name="adminForm">
                <?php
                $tabs->startPane("mosCE");
                $tabs->startTab(_EDITOR_OPTIONS,"editor_options");
                ?>
                <table class="adminform">
                <tr>
                    <td colspan="2">The URL specified in $mosConfig_live_site in configuration.php is <strong><?php echo $mosConfig_live_site ?></strong><br />
                    You <strong>MUST</strong> access this site from this <strong>exact URL</strong> when editing content.
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_THEMES ?>:
                        </td>
                        <td><?php echo $lists['editor_themes'];?></td>
                </tr>
		<tr>
                        <td width="185">
                        <?php echo _EDITOR_COMPRESSION ?>:
                        </td>
                        <td><?php echo $lists['editor_compression'];
			$tip = _EDITOR_COMPRESSION_TIP;
                                echo mosToolTip( $tip );?>
			</td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_LANG ?>:
                        </td>
                        <td><?php echo $lists['editor_lang']; 
                        $tip = _EDITOR_ADD_LANG;
                                echo mosToolTip( $tip );?></td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_LANG_LIST ?>:
                        </td>
                        <td><input type="text" class="text_area" size="50" name="editor_lang_list" value="<?php echo $row->editor_lang_list; ?>"></td>
                </tr>

                <tr>
                        <td width="185">
                        <?php echo _EDITOR_CSS_OVERRIDE ?>:
                        </td>
                        <td><?php echo $lists['editor_css_override'];
                        $tip = _EDITOR_CSS_OVERRIDE_TIP;
                                echo mosToolTip( $tip );?>
                        </td>
                </tr>
                <tr>
                        <td valign="top">
                        <?php echo _EDITOR_CUSTOM_CSS ?>:
                        </td>
                        <td>
                        <input type="text" class="text_area" size="30" name="editor_custom_css" value="<?php echo $row->editor_custom_css; ?>">
                        <?php $tip = _EDITOR_CUSTOM_CSS_TIP;
                              echo mosToolTip( $tip );?>
                        </td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_NEWLINES ?>:
                        </td>
                        <td><?php echo $lists['editor_newlines'];
                        $tip = _EDITOR_NEWLINES_TIP;
                                echo mosToolTip( $tip );?>
                        </td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_CONVERT_URLS ?>:
                        </td>
                        <td><?php echo $lists['editor_convert_urls'];
                        $tip = _EDITOR_CONVERT_URLS_TIP;
                                echo mosToolTip( $tip );?>
                        </td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_SCRIPT ?>:
                        </td>
                        <td><?php echo $lists['editor_script_acl'];?>
                        &nbsp;
                        <?php echo _EDITOR_SCRIPT_ELMS ?>
                        <input type="text" class="text_area" size="40" name="editor_script_elms" value="<?php echo $row->editor_script_elms; ?>">
                        <?php $tip = _EDITOR_SCRIPT_ELMS_TIP;
                               echo mosToolTip( $tip );?></td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_IFRAME ?>:
                        </td>
                        <td><?php echo $lists['editor_iframe_acl'];?>
                        &nbsp;
                        <?php echo _EDITOR_IFRAME_ELEMENTS ?>
                        <input type="text" class="text_area" size="40" name="editor_iframe_elms" value="<?php echo $row->editor_iframe_elms; ?>">
                        <?php $tip = _EDITOR_IFRAME_ELEMENTS_TIP;
                              echo mosToolTip( $tip );?>
                        </td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_XTD_ELMS ?>:
                        </td>
                        <td><input type="text" class="text_area" size="80" name="editor_xtd_elms" value="<?php echo $row->editor_xtd_elms; ?>">
                        <?php $tip = _EDITOR_XTD_ELMS_TIP;
                              echo mosToolTip( $tip );?>
                        </td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_TMPL_DIR ?>:
                        </td>
                        <td><?php echo $mosConfig_absolute_path;?><input type="text" class="text_area" size="30" name="editor_tmpl_dir" value="<?php echo $row->editor_tmpl_dir; ?>">
                        <?php $tip = _EDITOR_TMPL_DIR_TIP;
                              echo mosToolTip( $tip );?>
                        </td>
                </tr>
                
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_DIRECTION ?>:
                        </td>
                        <td><?php echo $lists['editor_direction']; ?></td>
                </tr>
                </table>
                <?php
                $tabs->endTab();
                $tabs->startTab(_EDITOR_LAYOUT,"editor_layout");
                ?>
                <table class="adminform" border="1">
                <tr>
                    <td>Preview :</td>
                    <td>
                        <div style="width:<?php echo $row->editor_width; ?>px; border: 1px solid #cccccc; background:#F0F0EE;">
                            <div style="padding:3px; border-bottom:1px solid #cccccc" />
                            <?php $row_buttons1 = explode(',', $row->editor_layout_row1);
                            foreach ($row_buttons1 as $btnImg1){
                              echo'<img src="components/com_mostlyce/images/'.$btnImg1.'.gif" alt="'.$btnImg1.'" title="'.$btnImg1.'" />';
                            }?></div>
                            <div style="padding:3px; border-bottom:1px solid #cccccc" />
                            <?php $row_buttons2 = explode(',', $row->editor_layout_row2);
                            foreach ($row_buttons2 as $btnImg2){
                              echo'<img src="components/com_mostlyce/images/'.$btnImg2.'.gif" alt="'.$btnImg2.'" title="'.$btnImg2.'" />';
                            }?></div>
                            <div style="padding:3px; border-bottom:1px solid #cccccc" />
                            <?php $row_buttons3 = explode(',', $row->editor_layout_row3);
                            foreach ($row_buttons3 as $btnImg3){
                              echo'<img src="components/com_mostlyce/images/'.$btnImg3.'.gif" alt="'.$btnImg3.'" title="'.$btnImg3.'" />';
                            }?></div>
                            <div style="padding:3px; "/>
                            <?php $row_buttons4 = explode(',', $row->editor_layout_row4);
                            foreach ($row_buttons4 as $btnImg4){
                              echo'<img src="components/com_mostlyce/images/'.$btnImg4.'.gif" alt="'.$btnImg4.'" title="'.$btnImg4.'" />';
                            }?></div>
                        </div>
                    </td>
                </tr>
                <tr>
                        <td valign="top">
                        <?php echo _EDITOR_WIDTH ?>:
                        </td>
                        <td>
                        <input type="text" class="text_area" size="5" name="editor_width" value="<?php echo $row->editor_width; ?>">&nbsp;px
                        </td>
                </tr>
                <tr>
                        <td valign="top">
                        <?php echo _EDITOR_HEIGHT ?>:
                        </td>
                        <td>
                        <input type="text" class="text_area" size="5" name="editor_height" value="<?php echo $row->editor_height; ?>">&nbsp;px
                        </td>
                </tr>
                <tr>
                        <td valign="top" colspan="2">
                        <?php echo _EDITOR_LAYOUT_TIP ?>
                        </td>
                </tr>
                <tr>
                        <td width="100">
                        <?php echo _EDITOR_LAYOUT_ROW1 ?>:
                        </td>
                        <td><textarea class="text_area" cols="70" rows="5" name="editor_layout_row1"><?php echo $row->editor_layout_row1; ?></textarea></td>
                </tr>
                <tr>
                        <td width="100">
                        <?php echo _EDITOR_LAYOUT_ROW2 ?>:
                        </td>
                        <td><textarea class="text_area" cols="70" rows="5" name="editor_layout_row2"><?php echo $row->editor_layout_row2; ?></textarea></td>
                </tr>
                <tr>
                        <td width="100">
                        <?php echo _EDITOR_LAYOUT_ROW3 ?>:
                        </td>
                        <td><textarea class="text_area" cols="70" rows="5" name="editor_layout_row3"><?php echo $row->editor_layout_row3; ?></textarea></td>
                </tr>
                <tr>
                        <td width="100">
                        <?php echo _EDITOR_LAYOUT_ROW4 ?>:
                        </td>
                        <td><textarea class="text_area" cols="70" rows="5" name="editor_layout_row4"><?php echo $row->editor_layout_row4; ?></textarea></td>
                </tr>
                </table>
                <?php
                $tabs->endTab();
                $tabs->startTab(_EDITOR_PLUGINS,"editor_plugins");
                ?>
                <table class="adminform">
                <tr>
                <td width="350"><?php echo "<b>Note:</b>  Disabling these may speed up the editor since there is less to load,
                            but it will also mean the editor has less functionality.  If you disable plugins you'll probably want to 
                            rearrange your plugin icon layout as well."; ?>
                </td>
                </tr>
                </table>
                <table class="adminform">
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_DATETIME ?>:
                        </td>
                        <td>
                        <?php echo $lists['editor_plugin_datetime_acl']; ?>
                        </td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_DATEFORMAT ?>:
                        </td>
                        <td>
                        <input type="text" class="text_area" size="30" name="editor_plugin_dateformat" value="<?php echo $row->editor_plugin_dateformat; ?>">
                        <?php $tip = _EDITOR_DATEFORMAT_TIP;
                              echo mosToolTip( $tip );?>
                        </td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_TIMEFORMAT ?>:
                        </td>
                        <td>
                        <input type="text" class="text_area" size="30" name="editor_plugin_timeformat" value="<?php echo $row->editor_plugin_timeformat; ?>">
                        <?php $tip = _EDITOR_TIMEFORMAT_TIP;
                              echo mosToolTip( $tip );?>
                        </td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_EMOTIONS ?>:
                        </td>
                        <td>
                        <?php echo $lists['editor_plugin_emotions_acl']; ?>
                        </td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_FLASH ?>:
                        </td>
                        <td>
                        <?php echo $lists['editor_plugin_flash_acl']; ?>
                        </td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_TABLE ?>:
                        </td>
                        <td>
                        <?php echo $lists['editor_plugin_table_acl']; ?>
                        </td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_FONT ?>:
                        </td>
                        <td>
                        <?php echo $lists['editor_font_tools_acl']; ?>
                        </td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_PRINT ?>:
                        </td>
                        <td><?php echo $lists['editor_plugin_print']; ?></td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_SEARCH_REPLACE ?>:
                        </td>
                        <td><?php echo $lists['editor_plugin_searchreplace']; ?></td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_SPELLCHECKER ?>:
                        </td>
                        <td>
                        <?php echo $lists['editor_plugin_spellchecker']; ?>
                        <?php $tip = _EDITOR_SPELLCHECKER_TIP;
                              echo mosToolTip( $tip );?>
                        </td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_LAYER ?>:
                        </td>
                        <td><?php echo $lists['editor_plugin_layer']; ?></td>
                </tr>
                <tr>
                        <td width="185">
                        <?php echo _EDITOR_EXTRA_PLUGINS ?>:
                        </td>
                        <td>
                        <input type="text" class="text_area" size="30" name="editor_extra_plugins" value="<?php echo $row->editor_extra_plugins; ?>">
                        <?php $tip = _EDITOR_EXTRA_PLUGINS_TIP;
                              echo mosToolTip( $tip );?>
                        </td>
                </tr>
                </table>
                <?php
                $tabs->endTab();
                $tabs->startTab(_EDITOR_EDITOR_INFO,"editor_info2");
                ?>
                <table class="adminform">
                <tr>
                    <td>
                    <?php readfile( "$mosConfig_absolute_path/mambots/editors/mostlyce/jscripts/tiny_mce/info/editor_info_$editor_info_lang.txt" ); ?>
                    </td>
                </tr>
                </table>
                <?php
                $tabs->endTab();
                $tabs->endPane();
                ?>

                <input type="hidden" name="option" value="<?php echo $option; ?>">
                <input type="hidden" name="task" value="">
                </form>
                <script language="Javascript" src="<?php echo $mosConfig_live_site;?>/includes/js/overlib_mini.js"></script>
                <?php
        }

}
?>
