solved Tabs in quota settings

sbhadauria
@sbhadauria
5 years ago
129 posts
Sections are displaying as a tab in config page of ACP. Same things I need for quota settings. Is there any predefined function or I need to create?
updated by @sbhadauria: 06/06/19 01:14:17PM
paul
@paul
5 years ago
4,326 posts
The tabs in ACP Config views are defined by adding a 'section' parameter to the field arrays. For example -
    // System Name
    $_tmp = array(
        'name'     => 'system_name',
        'default'  => $_SERVER['HTTP_HOST'],
        'type'     => 'text',
        'validate' => 'not_empty',
        'required' => 'on',
        'label'    => 'system name',
        'help'     => 'This is the name of your system.',
        'section'  => 'general',
        'order'    => 1
    );
    jrCore_register_setting('jrCore', $_tmp);

I don't think any core Jamroom modules use this in module quota views so not sure if it would work, but you could try it in your custom module quota.php function.
hth


--
Paul Asher - JR Developer and System Import Specialist
sbhadauria
@sbhadauria
5 years ago
129 posts
Hi @paul I have tried but not working. Any other way to do this?
paul
@paul
5 years ago
4,326 posts
I've just tried it and yes, the 'section' variable doesn't create tabs, but its does create sections on the quota view page so it does look as though tabs are not available for module quota views - Sorry.
Below is my test quota code and attached is what it looks like.
hth

<?php
/**
 * @copyright 2012 Talldude Networks, LLC.
 */

// make sure we are not being called directly
defined('APP_DIR') or exit();

/**
 * quota_config
 */
function jrXxxx_quota_config(){
    $_tmp = array(
        'name'     => '1111',
        'type'     => 'text',
        'label'    => '1111',
        'help'     => '1111',
        'default'  => '1111',
        'section'  => 'section one',
        'validate' => 'core_string'
    );
    jrProfile_register_quota_setting('jrXxxx', $_tmp);

    $_tmp = array(
        'name'     => '2222',
        'type'     => 'text',
        'label'    => '2222',
        'help'     => '2222',
        'default'  => '2222',
        'section'  => 'section two',
        'validate' => 'core_string'
    );
    jrProfile_register_quota_setting('jrXxxx', $_tmp);

    $_tmp = array(
        'name'     => '333',
        'type'     => 'text',
        'label'    => '3333',
        'help'     => '3333',
        'default'  => '3333',
        'section'  => 'section two',
        'validate' => 'core_string'
    );
    jrProfile_register_quota_setting('jrXxxx', $_tmp);

    return true;
}



--
Paul Asher - JR Developer and System Import Specialist
sbhadauria
@sbhadauria
5 years ago
129 posts
ok, thanks @paul

Tags