Welcome Guest, Not a member yet? Register   Sign In
Where shall move this code?
#1

[eluser]shinokada[/eluser]
I have following codes in some of controllers. However I want to move out of controllers.

What is the best way to do it and how?

Should I move it to a plugins? If so how?

I will appreciate any help or directions.

Thanks in advance.

Code:
class Admin extends Admin_Controller {
  function Admin(){
   parent::Admin_Controller();
...
...

// after this, I want to move
$this->tinyMce = '
        <!-- TinyMCE -->
        [removed][removed]
        [removed]
             tinyMCE.init({
    // General options
...
...
    theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
    theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true,

    // Example content CSS (should be your site CSS)
    // content_css : "css/example.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",

    // Replace values for the template plugin
    template_replace_values : {
        username : "Some User",
        staffid : "991234"
    }
});
        [removed]
        <!-- /TinyMCE -->
        ';
#2

[eluser]shinokada[/eluser]
Ok, I just added to js file and called as normally do.

Thanks.
#3

[eluser]JoostV[/eluser]
If you need to use php code in this script, put it in a helper.




Theme © iAndrew 2016 - Forum software by © MyBB