+ Reply to Thread
Results 1 to 5 of 5

Thread: Access roundcube config from javascript

  1. #1
    ba_tux is offline Registered User
    Join Date
    Oct 2009
    Posts
    11
    Downloads
    7
    Uploads
    0

    Default Access roundcube config from javascript

    Hi, I want to customize functions.js. I need a value from Roundcube configuration file (main.inc.php). How to access that value from javascript?

  2. #2
    skaero's Avatar
    skaero is offline Administrator
    Join Date
    Jun 2006
    Location
    USA - New Mexico
    Posts
    2,092
    Downloads
    5
    Uploads
    0

    Default

    Try making a plugin it can get variable from the config an you shouldn't have to modify functions.js

  3. #3
    ba_tux is offline Registered User
    Join Date
    Oct 2009
    Posts
    11
    Downloads
    7
    Uploads
    0

    Default

    It's a great idea, but i just need a little change in js. So, can I access Roundcube configuration via javascript?

  4. #4
    JohnDoh is offline Super Moderator
    Join Date
    May 2007
    Posts
    1,206
    Downloads
    6
    Uploads
    0

    Default

    to access a config from the js it first needs to be added to the env, in a plugin you can do something like
    Code:
    $rcmail->output->set_env('myconfig', 'value');
    and then in the js you can access it at
    Code:
    this.env.myconfig
    Roundcube Patches: Sieverules, SpamAssassin Prefs, and more…

  5. #5
    rosali's Avatar
    rosali is offline Super Moderator
    Join Date
    Dec 2007
    Location
    Germany
    Posts
    2,394
    Downloads
    36
    Uploads
    0

    Default

    ... or by rcmail.env.myconfig ...
    Regards,
    Rosali

    __________________
    MyRoundcube Project http://myroundcube.googlecode.com
    MyRoundcube Online Demo - Free Email Address http://mail4us.net
    MyRoundcube Plugins Generic Installation Guide http://mail4us.net/myroundcube/index.php
    Mailing List http://mail4us.net/?_action=plugin.nabble

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts