H-Sphere Documentation Customization Guide

For more information contact us at info@h-sphere.co.uk

Advanced Interface Customization

 

Related Docs:  

Template Customization Rules XML Customization Rules Customizing Control Panel Menu Customizing System E-Mails Providing Multilingual Support Compiling Templates With Client-Side Form Validation

H-Sphere has been created to provide required services with the minimum required adjustments after the installation. The Look and Feel feature of the admin panel allows you to customize control panel colors, images, and texts. See more in Configuring H-Sphere Interface.

However, administrators can have designers and programmers perform more changes than it is allowed by the Control Panel, which would include:

You should remember that advanced customization may produce unpredictable results after updating H-Sphere, since updates involve changes in the template structure and page generating procedure.

Throughout this document we will often relate to the shiva/ directory, which is located in /hsphere/local/home/cpanel/. Hereafter, we will refer to it as shiva.

 

Customizing Templates

Templates are HTML documents that contain instructions for including dynamically-generated data. In other words, context data is put into the templates to create relevant H-Sphere pages. Templates are modified to change the web page layout, e-mail notifications, and context help texts.

The default templates are located in the shiva/shiva-templates/ directory in the 'cpanel' user's home directory.

E-mail notifications issued by H-Sphere are also generated from templates and must be changed according to the instructions laid out in this section. E-mail templates are located in the shiva/shiva-templates/common/mail directory. The purpose of each e-mail template is described here.

Online help files are special templates, each with a topic header and a body. They can be modified according to the procedure described in this section. Online help files are located next to templates in the shiva/shiva-templates/common/online_help directory.

Important: Before you do any customization, log in as the cpanel user, e.g., under root:
# su - cpanel
To implement customization correctly, all template files and directories should have cpanel:cpanel ownership, and the make directive which is performed to rebuild templates should be run ONLY under the cpanel user.

Important: Don't use whitespaces in templates' filenames!

WARNING: DO NOT MAKE ANY CHANGES TO THE DEFAULT TEMPLATES, because
1) You may need them to restore the original setup;
2) You will lose all your changes with the next upgrade.

Instead, do the following:

Step 1. In shiva/, create directory custom/templates/.

Step 2. Copy the templates you would like to substitute into shiva/custom/templates/ preserving their file paths relative to this directory. E.g. If you are going to substitute the
shiva/shiva-templates/not_recomended/to_change/FILE, copy it to
shiva/custom/templates/not_recomended/to_change/FILE. In case of mail templates, copy
shiva/shiva-templates/common/mail/mail_template to
shiva/custom/templates/common/mail/mail_template.

The original configuration can be restored without server restart by simply deleting your custom files from the shiva/custom/templates directory.

Important: Don't copy all the directory content! Your custom templates will override the default templates and you won't see the new features and bugfixes that come with new versions.

Step 3. Make sure the file is owned by cpanel:cpanel.

Step 4. Modify the templates you have copied to the shiva/custom/templates/ directory. Please carefully follow the Template Customization Rules and XML Customization Rules.

Step 5. Now that you have had the templates edited, get them used instead of the defaults. In the file shiva/psoft_config/hsphere.properties find the USER_TEMPLATE_PATH line. Here, enter the full name of the directory with your custom templates, e.g. /hsphere/local/home/shiva/custom/templates/. Important: The directory name must end with a slash! Don't do anything if the directory name is already there.

Step 6. Log in as root and restart H-Sphere. You don't need to restart H-Sphere if you did nothing on step 4. If you don't know how to restart your H-Sphere, click here.

 

Editing Interface Texts
(version 2.07 and higher)

This sections explains how to override original menu items and labels for the admin and user control panels with custom texts. E-mail notifications and context help texts are changed according to the procedure described in the Customizing Templates paragraph.

H-Sphere original menu items and labels are stored in the shiva/psoft/hsphere/lang/ directory in the following files:
- hsphere_lang.properties - template & tooltip texts;
- menu.properties - the navigation menu texts;
- messages.properties - H-Sphere system messages.

WARNING: DO NOT MAKE ANY CHANGES TO THESE FILES!

To alter original menu items and labels, log in as the cpanel user and do the following:

Step 1: Create the directory shiva/custom/bundles/. If this directory already exists, skip this step.

Step 2: In the listed files, find the string you want to modify. Next, in the newly created directory, create a new empty file with exactly the same name as the one with the original string. For example, you are going to change the label Shell Access to SSH Access. It is stored in the shiva/psoft/hsphere/lang/hsphere_lang.properties file. Create the file shiva/custom/bundles/hsphere_lang.properties.

Step 3: Copy the line with the identifier and the value you want to change into the new file and change its value the way you want. You should use two single quotes (apostrophes) instead of one in labels containing curly brackets, such as {0}. For example:
search.view_invoice = View Client's Invoice
but
billing.del_no = No, I don''t want to delete {0}
IMPORTANT: Don't copy the texts you are not changing!

Step 4: Make sure the file is owned by cpanel:cpanel.

Step 5: Now you need to declare the custom files. In the hsphere.properties file, uncomment the line that corresponds to the file you have created:

	CUSTOM_TEMPLATE_BUNDLE = custom.bundles.hsphere_lang
	CUSTOM_MENU_BUNDLE = custom.bundles.menu
	CUSTOM_USER_BUNDLE = custom.bundles.messages
	

Step 6: Create two symlinks in your document root:
hsphere_lang_en.properties to hsphere_lang.properties and
menu_en.properties to menu.properties

Step 7: Log in as root and restart H-Sphere. You don't need to restart H-Sphere if you did nothing on step 4.


Related Docs:  

Template Customization Rules XML Customization Rules Customizing Control Panel Menu Customizing System E-Mails Providing Multilingual Support Compiling Templates With Client-Side Form Validation



Home   Products   Services   Partners   Support   News   Contact   Forum
© Altaire Limited.
All rights reserved.