Welcome Guest, Not a member yet? Register   Sign In
tinyMca with CI
#4

[eluser]bobbob[/eluser]
Add the tiny mce code in your controller and header view as below and then drop the tinymce folder into your js folder in the root of your site.

root
css
images
index.php
js


Also note the xss_clean feature of this forum removed the script tags.

Controller:

Code:
$extrahead = '[removed]script type="text/javascript" src="js/tiny_mce/tiny_mce.js[removed]
        [removed]
tinyMCE.init({
    // General options
    mode : "textareas",
    theme : "advanced",
    plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",

    // Theme options
    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect",
    theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,forecolor,backcolor",
    
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : false,

    // Example content CSS (should be your site CSS)
    content_css : "styles.css",

    // Drop lists for link/image/media/template dialogs
    template_external_list_url : "js/template_list.js",
    external_link_list_url : "js/link_list.js",
    external_image_list_url : "js/image_list.js",
    media_external_list_url : "js/media_list.js"

    
    
});
[removed]';
            $data['extrahead'] = $extrahead;
            $data['header'] = $this->load->view('header',$data);

HEADER VIEW:
Code:
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo $title; ?></title>
<base href="<?php echo base_url(); ?>">


<?php if(isset($extrahead)) {
echo $extrahead;
}
?>

</head>


Messages In This Thread
tinyMca with CI - by El Forum - 09-06-2009, 03:46 PM
tinyMca with CI - by El Forum - 09-06-2009, 05:01 PM
tinyMca with CI - by El Forum - 09-06-2009, 05:20 PM
tinyMca with CI - by El Forum - 09-06-2009, 05:28 PM
tinyMca with CI - by El Forum - 09-06-2009, 05:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB