function tep_modules_init(&$modules)
    {
        global $parametersMod;
        global $site;
        $site->requireConfig('developer/std_mod/config.php');
        $answer = '';
        $answer .= '<script type="text/javascript">
        //<![CDATA[
    ';
        $translations = $parametersMod->getGroups('standard', 'content_management');
        foreach ($translations as $key => $translation_group) {
            foreach ($translation_group as $key2 => $translation) {
                $answer .= "var translation_edit_menu_{$key2} = '" . addslashes($translation->value) . "'; ";
            }
        }
        $answer .= '
      //]]>    
      </script>';
        //$answer .= '<script type="text/javascript" src="'.BASE_URL.LIBRARY_DIR.'js/tiny_mce/tiny_mce_gzip.js"></script>';
        $answer .= '<script type="text/javascript" src="' . BASE_URL . LIBRARY_DIR . 'js/tiny_mce/tiny_mce.js"></script>';
        //$answer .= '<script type="text/javascript" src="'.BASE_URL.LIBRARY_DIR.'js/ext/adapter/prototype/prototype.js"></script>';
        $answer .= '
<script type="text/javascript">
//<![CDATA[
  ' . \Modules\developer\std_mod\Config::getMceInit('mode: "exact"', 'elements : "tmp,parameters"', 'frontend') . '


       
//]]>     
</script>
		';
        $answer .= '<script type="text/javascript" src="' . BASE_URL . LIBRARY_DIR . 'js/positioning.js"></script>';
        $answer .= '<script type="text/javascript" src="' . BASE_URL . LIBRARY_DIR . 'js/mouse.js"></script>';
        $answer .= '<script type="text/javascript" src="' . BASE_URL . LIBRARY_DIR . 'js/windowsize.js"></script>';
        $answer .= '<script type="text/javascript" src="' . BASE_URL . $this->module_url . 'module_dimensions.js"></script>';
        $answer .= '<script type="text/javascript" src="' . BASE_URL . $this->module_url . 'edit_menu_management.js"></script>';
        $answer .= '<script type="text/javascript">
        //<![CDATA[
        var all_modules = Array();
        var all_modules_translations = Array();
      //]]>
      </script>';
        $sql = "select translation_key from `" . DB_PREF . "module` where type_menu order by row_number";
        $rs = mysql_query($sql);
        $modules = $this->db_module->menuModules();
        //tinymce styles
        $site->requireConfig('standard/content_management/config.php');
        $tinyMceStylesStr = '';
        foreach (Config::getMceStyles() as $style) {
            if ($tinyMceStylesStr != '') {
                $tinyMceStylesStr .= ';';
            }
            $tinyMceStylesStr .= $style['translation'] . '=' . $style['css_style'];
        }
        //end tinymce styles
        $answer .= '<script type="text/javascript">
        //<![CDATA[
        var global_config_modules_url = \'' . str_replace('/', '\\/', BASE_URL . MODULE_DIR) . '\';
        var global_config_image_url = \'' . str_replace('/', '\\/', BASE_URL . IMAGE_DIR) . '\';
        var global_config_tmp_image_url = \'' . str_replace('/', '\\/', BASE_URL . TMP_IMAGE_DIR) . '\';
        var global_config_file_url = \'' . str_replace('/', '\\/', BASE_URL . FILE_DIR) . '\';
        var global_config_tmp_file_url = \'' . str_replace('/', '\\/', BASE_URL . TMP_FILE_DIR) . '\';
        var global_config_video_url = \'' . str_replace('/', '\\/', BASE_URL . VIDEO_DIR) . '\';
        var global_config_tmp_video_url = \'' . str_replace('/', '\\/', BASE_URL . TMP_VIDEO_DIR) . '\';
        var global_config_base_url = \'' . str_replace('/', '\\/', BASE_URL) . '\';
        var global_config_library_url = \'' . str_replace('/', '\\/', LIBRARY_DIR) . '\';
        var global_config_template_url = \'' . str_replace('/', '\\/', THEME_DIR) . '\';
        var global_config_template = \'' . str_replace('/', '\\/', THEME) . '\';
        var global_config_backend_worker_file = \'' . str_replace('/', '\\/', BACKEND_WORKER_FILE) . '\';
        var global_config_tiny_mce_styles = \'' . str_replace('/', '\\/', $tinyMceStylesStr) . '\';
        var global_config_security_token = \'' . str_replace('/', '\\/', $_SESSION['backend_session']['security_token']) . '\';
        //]]>
      </script>';
        if ($modules) {
            require_once CONTENT_MODULE_URL . "widget.php";
            foreach ($modules as $key => $group) {
                foreach ($group as $key2 => $module) {
                    eval(" require_once('" . CONTENT_MODULE_URL . $module['group_name'] . "/" . $module['module_name'] . "/module.php'); ");
                    eval(' $new_module = new \\Modules\\standard\\content_management\\Widgets\\' . $module['group_name'] . '\\' . $module['module_name'] . '\\Module(); ');
                    $answer .= $new_module->init();
                    $answer .= '<script type="text/javascript">
              //<![CDATA[
              all_modules.push(\'' . $module['module_name'] . '\');
              all_modules_translations.push(\'' . $module['module_translation'] . '\'); 
            ';
                    $answer .= "\n            //]]>\n          </script>";
                }
            }
            $answer .= '<script type="text/javascript">
          //<![CDATA[
          ';
            //$menu_mod_parameters = new standard_menu_management_parameter($this->db_module);
            //$menu_mod_parameters = $menu_mod_parameters->load_menu_mod_parameters($module['group_name'], $module['module_name']);
            $menu_mod_parameters = $parametersMod->getGroups('standard', 'content_management');
            foreach ($menu_mod_parameters as $key3 => $parameter_g) {
                foreach ($parameter_g as $key4 => $parameter) {
                    $answer .= " var " . $key3 . "_" . $key4 . " = '" . addslashes($parameter->value) . "'; ";
                }
            }
            $answer .= "\n        //]]>\n      </script>";
        }
        $answer .= '<div id="modules"></div>';
        $tmp_module = \Db::getModule('', $this->mod_group, $this->mod_name);
        $answer .= '
      <script type="text/javascript">
        //<![CDATA[
        var mod_management = new edit_menu_management();
        mod_management.init(document.getElementById(\'modules\'), all_modules, all_modules_translations, \'mod_management\', ' . $tmp_module['id'] . '); 
      //]]>
      </script>';
        $modules_in_page = $this->db_module->pageModules($this->current_element);
        if ($modules_in_page) {
            foreach ($modules_in_page as $key => $module) {
                //$menu_mod_parameters = new standard_menu_management_parameter($this->db_module);
                //$menu_mod_parameters = $menu_mod_parameters->load_menu_mod_parameters($module['group_name'], $module['module_name']);
                eval(' $tmp_module = new \\Modules\\standard\\content_management\\Widgets\\' . $module['group_name'] . '\\' . $module['module_name'] . '\\Module(); ');
                $answer .= $tmp_module->add_to_modules('mod_management', $key, $module['instance_id'], $module['visible']);
            }
        }
        $answer .= '
        <script type="text/javascript">
          //<![CDATA[
          mod_management.print();
          //]]>
        </script>';
        return $answer;
    }
    function wysiwyg($name, $value = '', $disabled = false)
    {
        global $site;
        $site->requireConfig('developer/std_mod/config.php');
        if ($disabled) {
            $disabled_str = ' disabled ';
        } else {
            $disabled_str = ' ';
        }
        if ($name == '') {
            $this->html .= $this->error("Input without name ");
        }
        global $cms;
        if (!$cms->tiny_mce) {
            //tinymce styles
            global $site;
            $site->requireConfig('standard/content_management/config.php');
            $tinyMceStylesStr = '';
            foreach (\Modules\standard\content_management\Config::getMceStyles() as $style) {
                if ($tinyMceStylesStr != '') {
                    $tinyMceStylesStr .= ';';
                }
                $tinyMceStylesStr .= $style['translation'] . '=' . $style['css_style'];
            }
            //end tinymce styles
            $cms->tiny_mce = true;
            $this->html .= '
<script src="' . LIBRARY_DIR . 'js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="' . BASE_URL . LIBRARY_DIR . 'js/ext/adapter/prototype/prototype.js"></script>
<script type="text/javascript" src="' . BASE_URL . LIBRARY_DIR . 'js/tiny_mce/paste_function.js"></script>
';
            $this->html .= "\n<script type=\"text/javascript\">\n  //<![CDATA[\n    " . \Modules\developer\std_mod\Config::getMceInit('mode: "specific_textareas"', 'editor_selector : "mceEditor"', 'backend') . "\n  //]]>\n</script>\n";
        }
        $this->html .= '<textarea class="mceEditor" mce_editable="true" ' . $disabled_str . ' class="stdMod" cols="100" rows="10" name="' . htmlspecialchars($name) . '">' . $value . '</textarea>';
    }