brianc

Well-Known Member
May 16, 2003
191
7
168
Now why did you have to go ahead and share that David? I was hoping to charge Roxanne a large fee for this information!:eek:

Well Roxanne now it looks like we both can be happy campers. Still friends? :)
 

Roxanne

Member
PartnerNOC
Jan 10, 2008
14
0
51
Orlando, FL
Giving it some consideration, since there are big scary messages at the top saying to use this functionality at your own risk, it is not supported by our support team - I don't see any issue with sharing this publicly so long as you are mindful of this message.

If you point your browser to ip:2082/frontend/x3/resellers/branding/elementadd.html (where IP is your IP address), you can add icons to the interface.

To remove an element, go to: ip:2082/frontend/x3/resellers/branding/elementdelete.html

To create a new section, simply reference a section that does not exist by default in the X3 interface. If you wish to add something to a section that does exist, section names are rather self-explanatory if you explore the CSS of these various sections with a CSS inspection tool such as Firebug.

Note, you will need to do this within a reseller's account. End users do not have this functionality. Typically, you cannot login to the cPanel interface using root login credentials.
Thank you very much, and no problems there, I have a whole private server to test this out with. =D

BrianC *shakes Hand* Truce :D
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
For those desiring an officially supported solution, here's a follow-up:

Note, this does rely on JavaScript. Making an actual plugin to eliminate the JavaScript requirement is not difficult, but this should work for the majority of users.

You can use the cPanel Plugin Generator to add your own icons to the cPanel interface. You don't need to make an entire plugin to use this generator if you merely want to redirect to an external page.

For my example, I am going to create an icon in the cPanel interface that redirects to cPanel.net/security

The first thing I need is an icon. So I just take my little forum avatar and download it to my computer.

Then I go to the cPanel Plugin Generator at: http://www.cpanel.net/plugins/devel/installgen.html

For name of plugin, I give it an internal name. It shouldn't have spaces and none of your users should ever see this. I am calling mine redirector. For module description I use Icon for cPanel Security Page.

I do want this in Feature Manager, in case I want to remove it from a feature list for some reason or anther. However, if you don't want resellers to have the ability to disable this functionality, uncheck the box for Feature Manager.

The Display Name is what the actual end-user will see. For this I use Visit cPanel Security Page. This is a security thing, so I'll put it in the Security display group. For display order, I'll keep the default value to let it be the last icon in that section. For Access URL, just keep the default value. Don't worry that the default value doesn't exist.

Anchor content is where we are going to put the code that will redirect the user to the URL we want them to go to. Here, I type this Javascript code:

Code:
onclick="window.location='http://www.cpanel.net/security';return false;"
window.location='...' tells the web browser to display this URL instead.

return false; tells the browser to stop requesting the plugin URL, only focus on the I told it to go to in the previous Javascript code.

For Plugin Icon, I click browse, find the icon I want to use (which I previously downloaded). Then click submit. After you click submit, you will be prompted to download a file. Download that file, it is the installation file for your plug-in. Once the plug-in is on the server, follow the instructions at: http://www.cpanel.net/plugins/devel/install.html

Be sure to execute those commands as root (or at least sudo). Executing as a normal user will not result in a functioning plugin. Additionally, I highly recommend executing the command to refresh sprites (mentioned in that documentation). Now just refresh your cPanel interface to see the new icon. You can just leave the installation file in that directory, no need to delete it or anything.

I know this looks very long, but after you do it once, you'll realize it's quick and easy. Additionally, this lets you do things on a package-specific level rather than at a branding level, thus giving you easier control over who sees what.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Dear cPanelDavidG,

We are intensely interested in this as well. Would you please PM use too? Thanks.
Until we have official support for adding a custom group, your options are to add the appropriate CSS before or after the call that displays the icons for the cPanel interface.

So to put a custom section which by default always appears above the other sections, add the following code after <div id="boxes">

HTML:
<div id="myGroup" class="itembox">
  <div id="myGroup-bdrop" class="celldrop"> </div>
  <div class="cellbox">
    <h6   
      id="myGroup-header" 
      title="Double click to collapse/expand.  Click to drag." 
      style="clear:none;" ondblclick="rollbox(this);" class="ie-hover">
      <div id="myGroup-expander"  class="box-collapse-control" 
          style="float:right" onClick="rollbox(this);"> </div>
      myGroup Section Title
    </h6>
    <div id="myGroup-body">
      HTML to go in this custom section.
      <div class="clearit"> </div>
    </div>
  </div>
  <div id="myGroup-adrop" class="celldrop"> </div>
</div>
I just used myGroup as an arbitrary name. You can use any name as long as it isn't used by any of the pre-existing sections.

To have this always appear at the bottom by default, just put the code after that API call.

At this time, there is no method of storing the location the user drags these sections so they always appear where the user has dragged them. Though I heard from one customer that modifying the h6 tag allowed them to disable the drag/drop functionality.