The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Adding cPanel

Discussion in 'cPanel Developers' started by arren, Jun 29, 2011.

  1. arren

    arren Member
    PartnerNOC

    Joined:
    Jul 24, 2008
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Hello Guys,


    I wonder how to add icon groups such as the preferences, mail, domain and etc? I would like to add one more group called partners.

    I am able to add icon but it was located under unnamed groups. Kindly advise.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
  3. arren

    arren Member
    PartnerNOC

    Joined:
    Jul 24, 2008
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Thanks David but I have gone through the page you referred but I am only getting proper guideline on how to create icons and I am able to create new icons with the utility on cPanel Plugins - Developer

    But, it comes out as a new groups without name. I need a group with specified name such as "Partners".

    If you can generate a the group installer file with the group "Partners" for me then it would be great.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Refer to the DynamicUI reference for creating groups. Manipulating the DynamicUI configuration file is how you create groups.

    Let me move this thread to Developer Discussions so our integrators can assist you with any follow-up questions/needs for clarification.
     
  5. arren

    arren Member
    PartnerNOC

    Joined:
    Jul 24, 2008
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Hello David,


    Thank you for your assistance. Any developers can help me on this? If possible can you please generate me the installer script for the groups?
     
  6. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi arren,

    This is documented here: AddingIconsAndGroups < SoftwareDevelopmentKit < TWiki.

    The plugin generator will allow you to create a plugin, but is not sophisticated enough to create new groups.

    If you want to create a new group you need to:
    1) create a group line entry for in one of the dynamicui files, preferably the dynamicui that is related to your plugin.
    2) you must have at least on plugin that uses the group.

    What I suggest is:
    1) use the plugin generator to get your plugin file
    2) install your plugin with `register_cpanelplugin` in your test environment
    3) manually modify the dynamicui file that is created after you install the plugin file so that the group is defined and your icons use set to use that new group
    -- at this point everything should be correct in you testing/development envirnoment --
    4) modify your plugin's deployment/installer script so that it copies the modify dynamicui file and the plugin images to the proper locations and re-generate sprites.

    Typically, a developer's deployment/installer script would just run the register_cpanelplugin script. However, since register_cpanelplugin and the $pluginname.cpanelplugin system is not sophisticated enough to handle new groupings, you must perform these operations yourself (step 4) in you deplyment/installer.

    -- dynamicui files are placed in /usr/local/cpanel/base/frontend/x3/dynamicui (amongst others, see docs)
    -- image files are placed in /usr/local/cpanel/base/frontend/x3/branding/
    -- re-generating sprites is done by executing /usr/local/cpanel/bin/rebuild_sprites

    Step 3 details:
    1) Add a line at the top of the /usr/local/cpanel/base/frontend/x3/dyanmicui/dynamicui_$pluginname.conf file that defines your new group, something like
    Code:
    description=>Testing the UI grouping,file=>group_groupnamehere,group=>groupnamehere,groupdesc=>GroupTitleHere,grouporder=>1,imgtype=>icon,subtype=>img,height=>32,type=>image,width=>32
    2) modify the icon lines in /usr/local/cpanel/base/frontend/x3/dyanmicui/dynamicui_$pluginname.conf so that the proper, new group name is set. That variable key would be "group" and the value is whatever you define in the above step as "group"


    Best Regard,
    -DavidN
     
  7. arren

    arren Member
    PartnerNOC

    Joined:
    Jul 24, 2008
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Hi David,

    Thanks. It is working great.

    One more thing, how to push the group I created to be on top of the list for the group?
     
  8. arren

    arren Member
    PartnerNOC

    Joined:
    Jul 24, 2008
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Also, will the cPanel upgrade override this settings?
     
  9. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    arren,

    1) Ordering: you can specify the order of you group relative to other groups by using the key "grouporder". if you provide a reasonably large negative number it should always be on top (ex: -10)

    2) As long as you only modify configuration files within the /usr/local/cpanel/base/frontend/x3/dynamicui/ directory (or a custom branding directory), you should be fine. A cPanel update will only sync the config file at /usr/local/cpanel/base/frontend/x3/dynamicui.conf and the default images.

    If you find yourself doing heavy modification to the cPanel UI with groups or themes and such, I'd highly recommend you search the forum for branding related threads. Also if you do a web search for 'cPanel' and 'branding' you should get a lot of stuff, including slides from previous conference sessions.

    Regards,
    -DavidN
     
Loading...

Share This Page