Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
Small change coming in Jamroom 4.0.1 to module quota config
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 01/18/09 10:05 
I wanted to let everyone know about a small change to the API for Jamroom 4.0.1 that is needed to overcome a Quota config issue.

Currently, if your module defines a quota.php script for Quota config options, within your script you will have a "_config" function such as this (from the sample jrYouTube module):

Code

/**
 * The _config function is used to display the Config options for the given quota.
 * @param array Full quota information for the quota being modified
 * @return bool Returns true
 */
function jrYouTube_quota_config($quota)
{
    // Allow jrYouTube to be turned on/off per Artist quota
    if (isset($quota['quota_type']) && $quota['quota_type'] == 'artist') {
        jmSpanCell('YouTube Videos','Quota Settings for the YouTube Videos Module');
        jmYesNo('YouTube Video Access','quota_jryoutube_access','If this is set to "yes", then profiles in this quota will be allowed to create embedded YouTube videos.',$quota['quota_jryoutube_access']);
    }
    return(true);
}


Note how the function simply returns "true" to let Jamroom know it is done. However, the way this currently works is causing a problem in that it does not allow Jamroom to "know" if any options were displayed (in this case it is only displayed if the quota is an Artist quota). So in Jamroom 4.0.1 (and going forward), it will need to be changed to:


Code

/**
 * The _config function is used to display the Config options for the given quota.
 * @param array Full quota information for the quota being modified
 * @return bool Returns true
 */
function jrYouTube_quota_config($quota)
{
    // Allow jrYouTube to be turned on/off per Artist quota
    if (isset($quota['quota_type']) && $quota['quota_type'] == 'artist') {
        jmSpanCell('YouTube Videos','Quota Settings for the YouTube Videos Module');
        jmYesNo('YouTube Video Access','quota_jryoutube_access','If this is set to "yes", then profiles in this quota will be allowed to create embedded YouTube videos.',$quota['quota_jryoutube_access']);
        return(true);
    }
    return(false);
}


As you can see, the function now returns FALSE if nothing was displayed. This allows Jamroom to do proper form field error checking, and "know" which modules actually displayed settings on the quota tab.

Please let me know if there are any questions.

Thanks!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 01/18/09 16:23 
Thanks man! Very Happy


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 01/19/09 11:12 
Just an update that the Jamroom YouTube sample module has been updated to reflect this change:

http://www.jamroom.net/index.php?m=td_market&o=browse&category=Jamroom+4+Modules

Thanks!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.