Parallels H Sphere 3.6.3 Customization Guide Hsphere Custom Eng

User Manual: parallels H-Sphere - 3.6.3 - Customization Guide Free User Guide for Parallels H-Sphere Software, Manual

Open the PDF directly: View PDF PDF.
Page Count: 130

DownloadParallels H-Sphere 3.6.3 Customization Guide - Hsphere-3.6.3-custom-eng
Open PDF In BrowserView PDF
Parallels H-Sphere 3.6.3 Customization
Guide

Printed on 11 December, 2013

Legal and Copyright Notice
Parallels IP Holdings GmbH
Vordergasse 59
CH-Schaffhausen
Switzerland
Phone: +41-526320-411
Fax: +41-52672-2010
Copyright © 2012 Parallels IP Holdings GmbH. All rights reserved.
www.parallels.com
This product is protected by United States and international copyright laws. The product’s
underlying technology, patents, and trademarks are listed at
http://www.parallels.com/trademarks.
Microsoft, Windows, Windows Server, Windows NT, Windows Vista, and MS-DOS are
registered trademarks of Microsoft Corporation.
Linux is a registered trademark of Linus Torvalds.
Mac is a registered trademark of Apple, Inc.
All other marks and names mentioned herein may be trademarks of their respective owners.

Contents
Preface

6

Typographical Conventions ........................................................................................................... 6
Feedback ....................................................................................................................................... 7

Introduction To Parallels H-Sphere Customization
Template Customization

8
10

Understanding Parallels H-Sphere Templates ............................................................................ 11
What Are Templates ......................................................................................................... 11
Location of Templates ....................................................................................................... 11
System E-Mail Notification Templates .............................................................................. 11
Skeletons........................................................................................................................... 12
Web Interface Templates .................................................................................................. 12
Designs ............................................................................................................................. 14
Replacements ................................................................................................................... 14
Template Directory Structure ............................................................................................ 14
Template Lookup Sequence ............................................................................................. 15
Customizing Templates Step by Step ......................................................................................... 16
Pre-Cautions ..................................................................................................................... 16
Pre-Requisites ................................................................................................................... 16
Step-By-Step Template Customization Procedure ........................................................... 16
Compiling Templates With Client-Side Form Validation ............................................................. 18
Customizing Skeleton Templates ................................................................................................ 19
Adding Context Help Pages ........................................................................................................ 19
System E-Mail Templates ........................................................................................................... 21
Customizing User Signup ............................................................................................................ 24

Design Customization

30

Skin And Icon Set Customization ................................................................................................ 31
Design XML Customization ............................................................................................... 31
Implementation of Custom Design Templates .................................................................. 32
Design XML Configuration .......................................................................................................... 34
Icons .................................................................................................................................. 34
Skill Icon Groups ............................................................................................................... 35
Icon Image Sets ................................................................................................................ 36
Common Images ............................................................................................................... 37
Color Types ....................................................................................................................... 37
Designs ............................................................................................................................. 38
Interface Controls And Colors in Templates ............................................................................... 40
Interface Colors ................................................................................................................. 41
Adding Custom Icons .................................................................................................................. 42

Menu Customization

45

Menu XML Customization ........................................................................................................... 46
Changing Menu Structure ........................................................................................................... 46
Location ............................................................................................................................. 46
XML Structure ................................................................................................................... 47
Modifying Menu Groups And Items ................................................................................... 47

4
Configuring Individual Menu Layouts For Different Hosting Plans ................................... 48
Assigning External Links to Menu Items ........................................................................... 49
Menu Design Customization ....................................................................................................... 51

Interface Text Customization (Language Bundles)

54

Understanding Interface Text (Language) Bundles .................................................................... 55
Interface Text Customization ....................................................................................................... 57
Language Bundle Compiler ......................................................................................................... 58

Localization

61

Adding New Languages To Parallels H-Sphere .......................................................................... 62
Translating Language Bundles ......................................................................................... 62
Adding New Language Bundles Into Parallels H-Sphere ................................................. 63
With packages ................................................................................................................... 63
Compiling bundles ............................................................................................................. 63
Changing Language of Context Help .......................................................................................... 65
Updating Translation of Parallels H-Sphere Interface ................................................................. 66

XML Customization

67

Merging XML Configuration Files ................................................................................................ 68
XML Manager .............................................................................................................................. 70
XML Manager Implementation .......................................................................................... 70
XML Merge Processing Instructions ................................................................................. 72
Creating Plan Wizards with XML ................................................................................................. 74
Introduction........................................................................................................................ 74
Adding a New Wizard to the List of Plan Wizards............................................................. 75
Defining Plan Wizard ......................................................................................................... 75
Adding Custom CP Cron Jobs .................................................................................................... 80
CP Cron XML Configuration.............................................................................................. 82
Adding Custom Promotion Validators and Calculators ............................................................... 84
Adding Custom MS Exchange Plans into Parallels H-Sphere .................................................... 87
Customizing E-Mail Notification List ............................................................................................ 90
Using Variables in Parallels H-Sphere E-Mail Notifications .............................................. 92

Packages

108

Building Packages ..................................................................................................................... 109
Step 1. Preconfiguration .................................................................................................. 110
Step 2. Configuration ...................................................................................................... 112
Step 3. Package Builder .................................................................................................. 114
Building Language Packages .................................................................................................... 114
Java Tools For Packaging ......................................................................................................... 116
Package Configurator ..................................................................................................... 117
Package Builder .............................................................................................................. 119
Package Installer ............................................................................................................. 119
Package Uninstaller ........................................................................................................ 120
Package Checker ............................................................................................................ 120
Package XML Configuration File (_pkg.xml) ............................................................................. 121
Template Customization With Packages .................................................................................. 123
XML Customization With Packages .......................................................................................... 125
Package Installation .................................................................................................................. 126
Package Uninstallation .............................................................................................................. 127
Package Upgrade ...................................................................................................................... 128

5

Appendix

129

Logging in as the cpanel User ................................................................................................... 130
Restarting Parallels H-Sphere Control Panel ............................................................................ 130

CHAPTER 1

Preface
In this chapter:
Typographical Conventions ............................................................................... 6
Feedback .......................................................................................................... 7

Typographical Conventions
Before you start using this guide, it is important to understand the documentation
conventions used in it.
The following kinds of formatting in the text identify special information.
Formatting convention

Type of Information

Example

Special Bold

Items you must select,
such as menu options,
command buttons, or
items in a list.

Go to the System tab.

Read the Basic
Titles of chapters,
sections, and subsections. Administration chapter.
Italics

Used to emphasize the
The system supports the
so called wildcard
importance of a point, to
character search.
introduce a term or to
designate a command line
placeholder, which is to be
replaced with a real name
or value.

Monospace

The names of commands,
files, directories, and
domain names.

The license file is located
in the
http://docs/common/
licenses directory.

7
Preformatted

Preformatted
Bold

# ls –al /files
On-screen computer
total 14470
output in your commandline sessions; source code
in XML, C++, or other
programming languages.
What you type, contrasted
with on-screen computer
output.

# cd /root/rpms/php

CAPITALS

Names of keys on the
keyboard.

SHIFT, CTRL, ALT

KEY+KEY

Key combinations for
CTRL+P, ALT+F4
which the user must press
and hold down one key
and then press another.

Feedback
If you have found a mistake in this guide, or if you have suggestions or ideas on how to
improve this guide, please send your feedback using the online form at
http://www.parallels.com/en/support/usersdoc/. Please include in your report the
guide‟s title, chapter and section titles, and the fragment of text in which you have
found an error.

CHAPTER 2

Introduction To Parallels H-Sphere
Customization
There are the following tiers of Parallels H-Sphere control panel customization:





Basic interface settings can be configured through the control panel. The Look and Feel
menu allows to set skins and colors, images and icons, and some interface texts.
Advanced interface customization is what goes beyond the scope of the Control Panel
settings. It is performed on the Parallels H-Sphere CP server by designers and
programmers with administrative rights, in order to create or modify Parallels HSphere interface elements.
Parallels H-Sphere Packages (.hsp) are installable addons that extend H-Sphere
functionality. This is a way to share custom elements between Parallels H-Sphere
installations. Third parties can use it to develop and distribute packages that add
new or extend/override standard Parallels H-Sphere functionality. Documentation
on building packages is introduced in Parallels H-Sphere Developer Guide.

This Customization Guide explains how to customize the following Parallels H-Sphere
elements:
Customizable
Elements

Description

Templates

Design and control patterns for dynamic HTML
generation. They are to be modified if you need to
restructure the layout of certain pages of the Control
Panel interface, or to change the look of the Control
Panel header and footer.

System E-Mail
Notifications

A special type of templates used to generate standard
email notifications sent by Parallels H-Sphere.

Context Help

A special type of templates to generate context help
for certain elements of the Control Panel interface.

GUI Texts

Standard messages and labels that appear on the
interface pages are placed in the special configuration
files and may be set for different languages.

Localization

Adding new languages to the interface and modifying
language files with interface texts in different
languages.

CP Menu

Generating and modifying control panel menus and
submenus and adding external links to the menu.

GUI Design
Parallels H-Sphere interface design has a broader
(Skins And Icon meaning than just configuration of certain color

9

Sets)

schemes and the corresponding icon sets, what is
called the skin. It also determines the set of skins
available for this design, specifies the sets of icons in
the Quick Access page and enables to override the
standard settings with the custom ones.

CP Crons

Parallels H-Sphere utilities regularily executed on the
Control Panel server.

Plan Wizards

Custom plan wizards defined and configured in XML
documents.

Merchant
Gateways

The media for making real-time payments with online
credit card processing centers automatically from the
CP.

Web Payment
Systems

The media for making payments manually from the
web interface of the payment systems.

Signup Forms

Generating custom signup forms to sign up users
aside from the standard signup procedure provided in
Parallels H-Sphere, as well as modifying the standard
signup pages.

Warning:
1. Advanced customization may produce unpredictable results after updating Parallels
H-Sphere, since updates affect the template structure and the page generation.
2. Advanced customization performed by Parallels H-Sphere customers is done at their
own risk and is not supported by the Parallels.

CHAPTER 3

Template Customization
This section explains how to customize Parallels H-Sphere templates.

In this chapter:
Understanding Parallels H-Sphere Templates ................................................... 11
Customizing Templates Step by Step ................................................................ 16
Compiling Templates With Client-Side Form Validation ..................................... 18
Customizing Skeleton Templates ...................................................................... 19
Adding Context Help Pages .............................................................................. 19
System E-Mail Templates.................................................................................. 21
Customizing User Signup .................................................................................. 24

11

Understanding Parallels H-Sphere
Templates
What Are Templates
Parallels H-Sphere templates lay behind the Parallels H-Sphere Control Panel Web
interface. For the most part, templates are written using Freemarker Java processing
language for dynamic content generation.

Location of Templates
Template root directory
Parallels H-Sphere template root directory is by default ~cpanel/shiva/shivatemplates. It is set by the TEMPLATE_PATH parameter in the
~cpanel/shiva/psoft_config/hsphere.properties file:
TEMPLATE_PATH = /hsphere/local/home/cpanel/shiva/shivatemplates/

Default (common) design directory
Design, or skin, is the Control Panel GUI representation. Each design is defined by its
own sets of templates, images, CSS styles, JavaScripts, etc. The most important part
of GUI, templates, are placed in separate subdirectories of the template root directory
in accordance with a design they belong to. The special common subdirectory is used
to store templates that are the same for different designs. Also, this directory contains
templates for the Left Menu design which is the default Parallels H-Sphere design. The
path to this directory, relative to TEMPLATE_PATH, is set in hsphere.properties:
DEFAULT_TEMPLATES = common/
Important: Common template directory must always exist!

Custom template directory
Custom template directory is usually ~cpanel/shiva/custom/templates. Its
location is set in hsphere.properties:
USER_TEMPLATE_PATH=/hsphere/local/home/cpanel/shiva/custom/te
mplates/
Custom templates directory structure should correspond with the default template root
directory (shiva-templates) tree. However, you should be aware that templates in
the custom template directory override the corresponding templates in the default
template directory, thus all modifications and new features in existing default templates
coming with new Parallels H-Sphere releases would be also overriden by custom
templates. Therefore, only customized templates should be placed to your custom
template directory.

System E-Mail Notification Templates

12

System email notifications templates are used to generate standard Parallels H-Sphere
e-mail messages sent to customers or to admins on certain events related to account
management, billing, and the like. It is made possible to edit these messages directly
from Control Panel, in plain text or HTML and for each of the available languages,
without the need of customizing the default templates.
E-mail templates are located in the ~cpanel/shiva/shivatemplates/common/mail directory and have .txt extension. See the list of the
system e-mail templates (on page 21).

Skeletons
Skeleton templates, or skeletons, are special templates designed to generate user
default sites for newly created domains in corresponding domain subdirectories of user
home directories. Skeleton templates are written in HTML (without Freemarker
instructions) and located in the /hsphere/shared/skel directory. See how to
modify default skeletons (on page 19).

Web Interface Templates
Templates for generating Control Panel interface pages are of the following types:







main templates
control templates
submit templates
function templates
special purpose templates
context help page templates

Main Templates
Main, or basic, templates are templates for generating the entire Web page in CP. The
code of a main template represents a framework that contains calls of functions (on
page 21) for generation of the page header, menu and footer, and includes control
templates for processing forms.
Main templates are .html files located in the ~cpanel/shiva/shivatemplates// directories for each design (on page 21).

Control Templates
Contol templates, or controls, are responsible for generation and management of forms
in the working area of Parallels H-Sphere interface. They represent the part of HTML
code included in the main templates.
Control templates are with or without form field validation mechanism implemented:


Client-side form validation: .html.in templates provide client-side form validation.
They need to be compiled to apply changes made in them. The corresponding .html
templates are generated as the result of compilation of .html.in templates of the
same name. Thus, if there is a pair of .html and .html.in templates with the
same name, it is recommended to modify the .html.in template and then to
recompile it. Read more about compiling templates with client-side validation (on
page 18).

13



No field validation mechanism is implemented in .html templates that do not have the
initial .html.in templates of the same name. Changes in .html templates take
effect immediately.

Control templates are located in the ~cpanel/shiva/shivatemplates//control directories for each group of main templates.
Control templates assign submit templates that do not have visual HTML
representation and serve solely to process form submits.

Submit Templates
Submit templates do not have visual representation. They contain instructions to be
performed upon the form submit. These templates provide server-side validation of
submitted data and scenarios of subsequent actions if submit is successful or if an
error occurs. Submit template files have .sbm extension.

Function Templates
These templates contain collections of functions (or macros) used in other templates,
for example, for drawing menu, footer and header.







~cpanel/shiva/shiva-templates/common/functions - generic macro
collection, Does not depend on designs.
~cpanel/shiva/shiva-templates//menu.fn - functions for drawing
menu for a particular design.
~cpanel/shiva/shiva-templates//design.fn - functions for
drawing interface elements for a particular design (implemented for common and
XPressia/XPressia Lite designs)
~cpanel/shiva/shiva-templates//extra.fn - extra functions.
~cpanel/shiva/shivatemplates/common/control/signup_function.html - functions for signup
templates.

Templates For Special Purposes
There are some Web interface templates that do not fall into any of the above
mentioned categories. They are designed for special tasks such as to draw a menu on
the left, or the page header or footer, or login page, etc. Some special purpose
templates are located in the ~cpanel/shiva/shivatemplates//design/ directory, some like signup_top.html.in or
signup_bottom.html in the ~cpanel/shiva/shivatemplates//signup directory. There is no general classification for such
templates.

Context Help Templates
Context help templates are special templates for generating online help message in
popup windows. Each context help template has its topic header and body. They can
be modified as usual Parallels H-Sphere templates.
Online help files are located in the ~cpanel/shiva/shivatemplates/common/online_help directory. They have .oh extension and contain
the text in HTML format. See the instructions how to add context help pages to
Parallels H-Sphere interface (on page 19). Also read about context help in different
languages (on page 65).

14

Designs
Design, or skin, is the Control Panel GUI representation. It provides a different look of
menu (left menu or dropdown menu on the top, or no menu present at all), CSS styles,
colors and images, and the Quick Access page with icon links to different CP pages.
These are basic Parallels H-Sphere designs whose templates are located in the
corresponding design template directories of ~cpanel/shiva/shiva-templates
(referred to as  in the document):








common - the left-menu design (Left Menu in CP). All core templates are made for this
design scheme. Other templates that do not depend on design, inlcuding online
help templates (on page 11) and system e-mail notification templates (on page 11),
are also located there.
nomenu - the design with no left menu (No Menu in CP). It is turned on as the default
user design after the Parallels H-Sphere installation.
text_based is the alternative look of the No Menu design (Text-Based in CP) where only
captions with no icons are provided in the Quick Access menu page.
xcp - the XPressia design with dropdown menus, extensive use of CSS styles and
other advancements.
xcpl - the XPressia Lite design, a simpler and faster implementation of XPressia.
reloaded - the XP Reloaded design introduced in H-Sphere 3.0.

If a certain template is not found for a particular design, Parallels H-Sphere gets that
template in the common directory.
The default design configuration file design_config.xml is located in the
~cpanel/shiva/psoft/hsphere/ directory.

Replacements
Replacements are templates that override basic templates for particular plans.
Replacements‟ root directory for each design is the ~cpanel/shiva/shivatemplates//replacements directory. Replacements are located in
separate subdirectories specified in plan settings as the Template Directory parameter,
relative to the replacement directory.
Parallels H-Sphere first searches for a template in the
/replacements/ directory which has the same structure as the
 directory. If the template is not found, it starts to look for it in the 
directory. Read more about template lookup sequence (on page 11).

Template Directory Structure






~cpanel/shiva/shiva-templates/ - template directory for one of the
Parallels H-Sphere basic designs.
~cpanel/shiva/shiva-templates/common/JS - JavaScript functions (used
for all designs)
~cpanel/shiva/shiva-templates//design - contains templates for
special purposes such as login page, password reminder page, header and footer
templates and the like.
~cpanel/shiva/shiva-templates//CSS - CSS styles for a design.

15












~cpanel/shiva/shiva-templates// - main templates are
placed into separate subdirectories, according to their tasks, e.g., admin,
billing, MSSQL, etc.
~cpanel/shiva/shiva-templates//control/ corresponding control templates.
~cpanel/shiva/shiva-templates//submit/ - corresponding
submit templates.
~cpanel/shiva/shiva-templates//replacements/ - template
replacements for different types of plans.
~cpanel/shiva/shiva-templates//replacements//
- template replacements overriding templates in corresponding subdirectories for
that design. directory.
~cpanel/shiva/shivatemplates//replacements/control/ - control templates
for corresponding replacements.
~cpanel/shiva/shivatemplates//replacements/submit/ - submit
templates for corresponding replacements.

Template Lookup Sequence
1. Parallels H-Sphere searches for a template of a particular design first in
the custom template directory in replacements, then, if the template is
not found there, it proceeds to the corresponding default template
directory:
~cpanel/shiva/custom/templates//replacements/
~cpanel/shiva/shiva-templates//replacements/

2. If the template is not found in replacements, Parallels H-Sphere
searches in the design directory, first in among the custom templates,
then amonng the corresponding default templates:
~cpanel/shiva/custom/templates//
~cpanel/shiva/shiva-templates//

3. If the template is not found for this design, the search continues in the
same sequence in the common design template directory:
~cpanel/shiva/custom/templates/common/replacements/
~cpanel/shiva/shiva-templates/common/replacements/
~cpanel/shiva/custom/templates/common/
~cpanel/shiva/shiva-templates/common/

16

Customizing Templates Step by Step
This document will guide you through the generic step-by-step instruction on
customizing templates. This implies you are already familiar with the concept of
templates (on page 11) in Parallels H-Sphere.
It is possible to create and install packages of templates. Read more about template
packages in Developer Guide.

Pre-Cautions
1. Advanced customization may produce unpredictable results after
updating Parallels H-Sphere, since updates affect the template
structure and the page generation.
2. Advanced customization performed by Parallels H-Sphere customers is
done at their own risk and is not supported by the PSoft team.
3. Template customization affects ALL Parallels H-Sphere accounts, regardless of their
plans!
In terms of Parallels H-Sphere customization, only two types of accounts are
customized, regardless of plans: admin accounts which are Parallels H-Sphere
administrative accounts, and user accounts - all other accounts. Reseller accounts
are regarded as user accounts, except for the reseller administrative account which
relates to the admin account type.

Pre-Requisites



Before you do any customization, log into CP server under root as the cpanel (on
page 130) user.
Make sure templates have the cpanel:cpanel ownership. Mind, however, that
images, CSS and JavaScript files and directories have cpanel:httpdcp
ownership and you must not change their ownership to cpanel:cpanel. Parallels
H-Sphere updater checks and automatically sets correct ownership and
permissions on respective default and custom files and directories (this does not
refer to Parallels H-Sphere packages).
Note: We don‟t recommend changing manually the ownership and permissions of
default templates!





The make directive which is performed to rebuild *.html templates should be run
ONLY under cpanel.
Do not use whitespaces in the template filenames!
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, follow the step-by-step instructions specified below.

Step-By-Step Template Customization Procedure

17

1. On the CP server, log in as the cpanel (on page 130) user.
2. In the ~cpanel/shiva/ directory, create the custom template
directory custom/templates/ if it doesn‟t exist.
3. In the ~cpanel/shiva/psoft_config/hsphere.properties file,
find the USER_TEMPLATE_PATH parameter. Here, the full to your
custom template directory must be specified:
USER_TEMPLATE_PATH=/hsphere/local/home/cpanel/shiva/custom/te
mplates/
The directory name must end with a slash. Don‟t do anything if the directory name
is already there.
Warning: Don‟t change the TEMPLATE_PATH variable in hsphere.properties!
TEMPLATE_PATH points to the default template directory. If you change it, you
won‟t see any updates in the default templates.

4. Copy the templates you would like to customize into
shiva/custom/templates/, preserving their file paths relative to
this directory.
For instance, if you are going to customize the ~cpanel/shiva/shivatemplates/path_to_template/FILE,
copy it to ~cpanel/shiva/custom/templates/path_to_template/FILE.
The original configuration can be restored without server restart by simply deleting
your custom files from the custom template directory.
Warning: Don‟t copy the whole 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!

5. Modify the templates you have copied to the
~cpanel/shiva/custom/templates/ directory.
The following documents will be helpful:
 Interface Controls and Colors (on page 40)
 Skin and Icon Set Customization (on page 31)
 Edit Interface Texts (on page 57)
Important:
1. We don‟t recommend inserting the interface text directly into the templates. Use
text labels defined in language bundles (on page 55) to ensure multilingual
support.
2. Parallels H-Sphere uses the Unicode (UTF-8) charset for all languages.
Therefore, text directly inserted into templates (i.e., not by means of text labels
defined in language bundles) must be in the UTF-8 encoding.

6. Restart Parallels H-Sphere (on page 130).

18

Compiling Templates With Client-Side
Form Validation
There are two types of templates that are responsible for generating Control Panel web
content:



*.html.in templates with client-side form validation that require compilation
before modifications in them would take effect, and
*.html templates that provide server-side form validation and don‟t need to be
recompiled after their modification.

This document provides step-by-step instructions on how to compile control panel
templates with the client-side validation of HTML form input fields.

 To compile templates with client-side form validation:
1. Log into the control panel server as the cpanel (on page 130)
user.
To implement customization correctly, all template files and directories should have
the cpanel:cpanel ownership.

2. Check settings in
~cpanel/shiva/psoft_config/hsphere.properties:
1. Check the TEMPLATE_PATH parameter. It should point to the default template
directory. Default setting is:
TEMPLATE_PATH = /hsphere/local/home/cpanel/shiva/shivatemplates/
2. Uncomment the USER_TEMPLATE_PATH parameter and set it to your custom
templates directory, for example:
USER_TEMPLATE_PATH =
/hsphere/local/home/cpanel/shiva/custom/templates/
3. Check the JS (JavaScripts) and IMAGES parameters:
JS =
IMAGES =
By default, JS and IMAGES are left blank. It means that javascripts and images
are placed inside each design directory (on page 11). You don‟t need to change
these parameters if you have default system settings.

3. Go to the default templates directory (DocumentRoot,
~cpanel/shiva/shiva-templates by default). Check parameters in
the configure file:


SHIVA_ROOT - Parallels H-Sphere Control Panel‟s root directory
(~cpanel/shiva by default)



HSPHERE_PROPERTIES - path to the hsphere.properties file.

4. Run ./configure in the templates directory. This will create
Makefile‟s for all of designs.

19

Warning: Running ./configure clean would remove ALL the compiled
templates in the nested directories and delete ALL Makefile‟s created by the
previous configure execution! After that, your control panel interface would not
show up correctly!

5. To compile all modified templates, run make or make all in your
default templates directory (gmake for FreeBSD). If you need just to
modify one template, run make from the directory where this template is
located.
Warning: Running the make clean command from a certain template directory
would clear all the compiled template files (*.html) in the nested directories! After
that, your control panel interface would not show up correctly!

Customizing Skeleton Templates
When an end-user adds a new domain, the system generates initial web site based on
skeleton templates. Skeleton templates are written in HTML. Unlike FreeMarker
templates (on page 10), Skeleton templates are customized right in the directory they
are located.

 To modify Skeleton templates:
1. Log in as the cpanel (on page 130) user.
2. Enter the Skeleton template directory:
cd /hsphere/shared/skel

3. Customize the template files directly according to your needs.
Please only pay attention that with each automatic upgrade of web boxes, all the
customizations get lost. So, after performing the customization, backup the templates
into a safe location to get them back working after performing box upgrades.

Adding Context Help Pages
Context help (or online help) is implemented through special templates, each with a
topic header and a body. Context help files are located in the
/hsphere/local/home/cpanel/shiva/shivatemplates/common/online_help directory. They have .oh extension and contain
text in HTML format. Context help may be implemented in different languages (on page
65).

 To add a new context help page to Parallels H-Sphere interface:
1. Log into the CP server as the cpanel (on page 130) user.
2. Create an online help file and put it anywhere inside
~cpanel/shiva/shiva-templates/common/online_help/. You
can create new subdirectories for your files where necessary.

20

3. In ~cpanel/shiva/psoft/hsphere/online_help.xml, add an
id/file correspondence, where file is the path and filename of the context
help file, and id is the string that will be used in the template.
4. Find the template where the context help icon will be added. The
easiest way to find the name of the template is to view html page
source code. The templates you need are located in
~cpanel/shiva/shiva-templates/common/control/. More
about templates (on page 11)
5. Add context help function call to the template. The function call has the
following syntax:

where HELP_ID is the id of the file specified in
~cpanel/shiva/psoft/hsphere/online_help.xml, and LABEL is the
description used as the title in the html link.
If the second parameter is left empty, the default text (“Click to get help”) is
used. For example:

Alternatively, you can call the function that draws help PLUS gives a link to send a
trouble ticket:


6. In plan creation and edit wizard templates, context help file IDs are
passed with resource calls:

where OH_ID is the id of the file specified in
~cpanel/shiva/psoft/hsphere/online_help.xml. For example:


7. If the edited template is in *.html.in format, run make in this
template‟s directory.
8. Restart Parallels H-Sphere (on page 130).

21

System E-Mail Templates
System e-mail notifications are messages Parallels H-Sphere automatically sends to
customers.
It is possible to edit system emails in the admin CP interface, in the
Settings/Notifications/E-Mail Notifications menu (see Parallels H-Sphere Administrator
Guide for details). Both default messages and messages in each interface language
can be customized there. Custom modifications are stored in the Parallels H-Sphere
database and do not affect the system email templates. On the contrary, default
settings can be restored from the templates.
This document explains where to find the default system email templates and how to
customize them.
Note: Support info and checks info is modified in the Settings -> Look and Feel -> Misc.Text
menu by filling in the Customer Support Info and Checks Info forms.
Important: It is strongly recommended not to touch the default system email
templates; instead, you should edit notifications in the administrator‟s Control Panel to
be able to restore default texts from the templates.
Here is the list of default templates for system email messages (located in the
~cpanel/shiva/shiva-templates/common/mail/ directory) that can be
customized via CP interface:
Template

Filename

Notification Sent

Welcome
Letter

new_account.txt

to customer on account
activation

Welcome
Letter for
Moderated
Accounts

new_account_moderated.txt to customer on
moderated check
account registration
(accounts waiting
activation)

Welcome
Letter For
Moderated
Account
with CC

new_account_moderated_cc. to customer on
txt
moderated credit card
registration

Welcome
Letter For
Moderated
Trial
Account

trial_moderated.txt

trial_account.txt
Trial
Registration

to customer on
moderated trial account
registration

to customer on account
trial period expiration

22

Invoice

invoice.txt

Money Back money_back.txt

to customer: - on each
paid operation
- at the beginning of
the next billing period
- on switching to
another billing period
to admin when a user
chooses to cancel
hosting and wants
his/her money back

Overlimit
Notification

overlimit.txt

to customers when
they reach traffic or
disk usage limit

Account
Suspended
Notification

suspended_account.txt

to customers when
their accounts get
suspended

Account
Resumed
Notification

resumed_account.txt

to customers when
their accounts get
suspended

Accounting
Error letter

accounting_error.txt

to admin on accounting
error

Lost
Password

forgot_passwd.txt

to customers after they
enter their email
address on the “forgot
your password” page

Failed
Signup
Notification

you_have_files_signups.tx to admin when
t
customer signup fails

Domain
Transfer
Message

tranfer_domain.txt

to customers
explaining how to
transfer an external
domain

Internal
Ticket

ticket_internal.txt

to admin in case of
internal problems

Shell
Access
Notificaton

ssh_notification.txt

to the customer when
Shell Access is granted
or refused (disabled)

Welcome
Letter (Tax
Exemption)

new_account_tax_exemption to new customers
.txt
awaiting approval of
their Tax Exemption
Codes

23

Tax
Exemption
Approved
Notification
(Moderated
Accounts)

tax_exemption_approved_ne to new customers
w.txt
signed up to tax
exemption plan,
awaiting moderation

Tax
Exemption
Rejected
Notification
(Moderated
Accounts)

tax_exemption_rejected_ne to new customers
w.txt
signed up to tax
exemption plan, on
failing to verify tax
exemption data

Tax
Exemption
Approved
Notification
(Live
Accounts)

tax_exemption_approved.tx to customers on tax
t
exemption approval

Tax
Exemption
Rejected
Notification
(Live
Accounts)

tax_exemption_rejected.tx to customers on failing
t
to verify tax exemption
data

Below is the list of templates for standard texts sent as mass mail. Messages in these
templates cannot be customized via Parallels H-Sphere interface:
Template

Filename

Notification Sent

Welcome Letter

welcome.txt

optionally from mass
mail

User login and
password

login_psw.txt

optionally from mass
mail

User balance

balance.txt

optionally from mass
mail

24

Customizing User Signup
This document explains how to modify standard user signup (order) forms or replace
them with custom forms.
Before you begin signup customization, please note the following:







The default signup forms contain validation scripts. It is recommended that your
custom signup forms also provide a client side validation mechanism (on page 18).
When Parallels H-Sphere server-side validation rejects user data, the user is
redirected to the error page generated based on the template
~cpanel/shiva/shiva-templates/common/signup/end.html, which has
the look and feel of the standard Parallels H-Sphere interface and links to the
STANDARD Parallels H-Sphere signup forms. Normally, you would want to
customize this template to ensure that:
 it has the look and feel of your custom signup forms,
 it gives a way to go back to the signup forms, then modify and re-submit the
signup data.
The template has been written in FreeMarker, and in order to make changes to its
code, please become familiar with the FreeMarker technology, the documentation
available at http://freemarker.org. The way you customize the page will totally
depend on how you organize your signup forms.
Custom signup fields must match those in the default signup. If more fields are
added in newer versions, you will need to update your custom forms.

Your signup script has to put the collected data into the html fields below and submit
them to the following URL:
or . For example: Note: psoft.hsphere.CP is case sensitive! Some signup texts can be customized through the control panel from Look And Feel -> Signup Texts. If you have customized texts through the control panel, they will override the texts in your custom signup forms, so you may need to remove them. Signup fields:      Basic (service fields required for signup) User Contact Info Billing Info (not used for trial registration) Credit Cards Billing Period 25    Domains Domain Registration Domain Regisration Contact Info Basic (service fields required for signup) Field name Possible Values Explanation _eul_accept “1” Accept terms of End User License Agreement _mod       “signup” - transfer domain, “opensrs” - domain registration, “nodomain” - stopgap domain, “3ldomain” - third level domain, “service” - service domain, “empty” - signup without domain Signup mode action “signup” Service parameter plan_id numeric Number of the plan for signup signup “yes” Service parameter login alphanumeric user login password alphanumeric user password password2 alphanumeric Confirm user password template_name The so-called submit template “submit/signup/end.sbm” (“submit/signup/end_osrs located in the .sbm” for Domain registration) ~cpanel/shiva/shivatemplates/common directory and used to perform server-side form validation. admin_signup “yes” - if we sign user up from the admin panel Service parameter User Contact Info Field name Possible Values Explanation _ci_first_name alphanumeric User‟s first name _ci_last_name alphanumeric User‟s last name _ci_address1 alphanumeric User‟s address 1 _ci_address2 alphanumeric User‟s address 2 _ci_city alphanumeric User‟s city of residence _ci_company alphanumeric User‟s company name _ci_country alphanumeric User‟s country code _ci_email alphanumeric User‟s contact e-mail address _ci_phone numeric User‟s phone number 26 _ci_postal_code numeric _ci_state e.g.: “NY”; “NA” for User‟s state code. In the custom form for non non US or Canada US or Canada residents, you should add this residents. field as hidden. _ci_state2 alphanumeric User‟s state or province for non US and Canada residents. Should be present in the custom form only in case _ci_state=‟NA‟. _promo_code alphanumeric PROMO code for subsidized plan. Contains 2-20 chars and starts from the letter. User‟s zip code Billing Info (not used for trial registration) Field name Possible Values Explanation _bi_first_nam e alphanumeric User‟s first name _bi_last_name alphanumeric User‟s last name _bi_address1 alphanumeric User‟s address 1 _bi_address2 alphanumeric User‟s address 2 _bi_city alphanumeric User‟s city of residence _bi_company alphanumeric User‟s company name _bi_country alphanumeric User‟s country code _bi_email alphanumeric User‟s contact e-mail address _bi_phone numeric User‟s phone number _bi_postal_co de numeric User‟s zip code _bi_state e.g.: “NY”; “NA” for non US User‟s state code. In the custom form or Canada residents. for non US or Canada residents, you should add this field as hidden. _bi_state2 alphanumeric _bi_type      “CC” - credit card, “Check” - check or bank transfer, “PayPal” - PayPal, “2CheckOut” 2CheckOut, “TRIAL” User‟s state or province for non US or Canada residents. Should be present in the custom form only in case _bi_state=‟NA‟. Payment type Credit Cards Field name Possible Values Explanation _bi_cc_name alphanumeric Credit card name _bi_cc_number numeric Credit Card number 27 _bi_cc_type strings available in Credit Card type the Merchant Gateway Manager: “VISA”, “MC”, etc. _bi_cc_exp_month two digits the month of Credit Card expiry date _bi_cc_exp_year the year of Credit Card expiry date four digits Below are the fields for Solo/Switch debit cards used in some countries: Field name Possible Values Explanation _bi_cc_issues_no alphanumeric Issue number _bi_cc_start_mon two digits th Card Start Month _bi_cc_start_yea four digits r Card Start Year Billing Period Field name Possible Values Explanation _bp 0 or a positive integer Sequence number of the billing period in the list of billing periods for the selected plan. To see the list of the billing periods, go to your control panel, click the Settings link for this plan and scroll down to the Billing configuration section. Domains Field name Possible Values type_domain        _mod        Explanation “transfer_new_misc_domain” - transfer Type of new domain domain without registrar changes “domain_transfer” - transfer domain with registrar changes “without_domain” - stopgap domain “3ldomain” - third level domain “service_domain” - service domain “empty_domain” - signup without domain “new_opensrs_domain” - register new domain “signup” - transfer domain without registrar changes “dtransfer” - transfer domain with registrar changes. It accepts the same fields as OpenSRS registration except the period field and extra contact/billing info for domain registration. “nodomain” - stopgap domain “3ldomain” - third level domain “service” - service domain “empty” - signup without domain “opensrs” - register new domain Domain registration mode. 28 domain_name alphanumeric Domain name; may be omitted if type_domain=”empt y_domain” Domain Registration Field name Possible Values Explanation period numeric Registrar‟s periods (years) _srs_owner_first_nam e alphanumeric User‟s first name _srs_owner_last_name alphanumeric User‟s last name _srs_owner_address1 alphanumeric User‟s address 1 _srs_owner_address2 alphanumeric User‟s address 2 _srs_owner_city alphanumeric User‟s city of residence _srs_owner_org_name alphanumeric User‟s company name _srs_owner_country alphanumeric User‟s country code _srs_owner_email alphanumeric User‟s contact e-mail address _srs_owner_phone numeric User‟s phone number _srs_owner_postal_co de numeric User‟s zip code _srs_owner_state e.g.: “NY”; “NA” for non US or Canada residents. User‟s state code. In the custom form for non US or Canada residents, you should add this field as hidden. _srs_owner_state2 alphanumeric User‟s state or province for non US or Canada residents. Should be present in the custom form only in case _srs_owner_state=‟NA‟. Domain Registration Contact Info Field name Possible Values Explanation _srs_billing_first_name alphanumeric User‟s first name _srs_billing_last_name alphanumeric User‟s last name _srs_billing_address1 alphanumeric User‟s address 1 _srs_billing_address2 alphanumeric User‟s address 2 _srs_billing_city alphanumeric User‟s city of residence _srs_billing_org_name alphanumeric User‟s company name _srs_billing_country alphanumeric User‟s country code _srs_billing_email alphanumeric User‟s contact e-mail address _srs_billing_phone numeric User‟s phone number _srs_billing_postal_code numeric User‟s zip code 29 _srs_billing_state e.g.: “NY”; “NA” for non US or Canada residents. User‟s state code. In the custom form for non US or Canada residents, you should add this field as hidden. _srs_billing_state2 alphanumeric User‟s state or province for non US or Canada residents. Should be present in the custom form only in case _srs_billing_state=‟NA ‟. CHAPTER 4 Design Customization This chapter explains how to customize graphic elements of the Parallels H-Sphere Web interface. In this chapter: Skin And Icon Set Customization ...................................................................... 31 Design XML Configuration................................................................................. 34 Interface Controls And Colors in Templates ...................................................... 40 Adding Custom Icons ........................................................................................ 42 Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. 31 Skin And Icon Set Customization Parallels H-Sphere interface design has a broader meaning than just configuration of certain color schemes and the corresponding icon sets, what is called the skin. It also determines the set of skins available for this design, specifies the sets of icons in the Quick Access page and enables to override the standard settings with the custom ones. To provide multiple design support, Parallels H-Sphere uses the design_config.xml file, which can be found in the /hsphere/local/home/cpanel/shiva/psoft/hsphere/ directory. Its structure is explained in the Design XML Configuration (on page 34) guide. The current document shows you how to customize this file to add your own designs, color schemes, colors and images. For this, you need to: 1. customize design_config.xml 2. implement custom design templates Design XML Customization A designer should have access to the Parallels H-Sphere server as the cpanel user. To implement customization correctly, all template files and directories should have cpanel:cpanel ownership. In version 2.5 and up templates, images, CSS and JavaScript files and directories must have cpanel:httpdcp ownership. Important: We don‟t recommend you to modify the default ~cpanel/shiva/psoft/hsphere/design_config.xml file. These modifications will be lost with the next Parallels H-Sphere updates. There are the following ways of customizing design XML configuration:  With packages You can customize design_config.xml by means of packages. In this case, within a package you create custom XML file that will be merged with default XML configuration (on page 68).  Merging custom XML configuration Instead of creating a package, create a custom XML configuration file to be merged with the default XML configuration (on page 68) and a custom package XML if installed.  Overrriding default XML configuration with custom XML configuration 1. You create the custom design configuration file and perform modifications there: 2. Login to the CP server as the cpanel (on page 130) user under root. 3. Copy the standard design_config.xml file to a certain custom directory (it may be ~cpanel/shiva/custom/xml): cp ~cpanel/shiva/psoft/hsphere/design_config.xml ~cpanel/shiva/custom/xml/design_config.xml 32 Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. 4. Make changes into the custom design_config.xml structure (on page 34). 5. In ~cpanel/shiva/psoft_config/hsphere.properties, change the DESIGN_SCHEME_CONFIG variable to point to this new file: DESIGN_SCHEME_CONFIG = /hsphere/local/home/cpanel/shiva/custom/xml/design_config.xml Implementation of Custom Design Templates Custom design templates are created in the ~cpanel/shiva/custom/templates custom template directory. In order to implement these custom designs, the symlinks to them should be put into the Apache DocumentRoot directory which is set by default to the ~cpanel/shiva/shiva-templates standard templates directory. However, on the subsequent Parallels H-Sphere update all symlinks in ~cpanel/shiva/shiva-templates would be lost, and custom designs would not be displayed correctly. To avoid this, we suggest to use another directory as DocumentRoot and to create there the symlinks to ALL design directories, for both custom designs and the Parallels H-Sphere built-in designs. Warning: Don‟t change the TEMPLATE_PATH variable in hsphere.properties! TEMPLATE_PATH points to the default template directory. If you change it, you won‟t see any updates in the default templates. 1. Log into the CP server as the cpanel (on page 130) user. 2. Create the ~cpanel/shiva/web directory. 3. Create the symlinks to the design directories using the ln -s command. You should have something similar to this: $ pwd /hsphere/local/home/cpanel/shiva/web $ ls -la Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. 33 ... lrwxrwxrwx 1 cpanel cpanel 55 Jun 4 08:55 common -> /hsphere/local/home/cpanel/shiva/shiva-templates/common lrwxrwxrwx 1 cpanel cpanel 46 Jun 2 13:39 counter -> /hsphere/shared/SiteStudio/public_html/counter lrwxrwxrwx 1 cpanel cpanel 47 Jun 2 13:39 custom-images -> /hsphere/local/home/cpanel/shiva/custom/images/ lrwxrwxrwx 1 cpanel cpanel 50 Jun 2 13:39 custom-templates -> /hsphere/local/home/cpanel/shiva/custom-templates/ lrwxrwxrwx 1 cpanel cpanel 48 Jun 2 13:40 guestbook -> /hsphere/shared/SiteStudio/public_html/guestbook lrwxrwxrwx 1 cpanel cpanel 55 Jun 2 13:42 IMAGES -> /hsphere/local/home/cpanel/shiva/shiva-templates/IMAGES lrwxrwxrwx 1 cpanel cpanel 46 Jun 2 13:40 masonry -> /hsphere/shared/SiteStudio/public_html/masonry lrwxrwxrwx 1 cpanel cpanel 55 Jun 4 08:55 nomenu -> /hsphere/local/home/cpanel/shiva/shiva-templates/nomenu lrwxrwxrwx 1 cpanel cpanel 43 Jun 2 13:40 poll -> /hsphere/shared/SiteStudio/public_html/poll lrwxrwxrwx 1 cpanel cpanel 48 Jun 2 13:41 shiva-templates -> /hsphere/local/home/cpanel/shiva/shiva-templates lrwxrwxrwx 1 cpanel cpanel 59 Jun 4 08:55 text_based -> /hsphere/local/home/cpanel/shiva/shiva-templates/text_based lrwxrwxrwx 1 cpanel cpanel 62 Jun 2 15:19 YourDesign1 -> /hsphere/local/home/cpanel/shiva/custom/templates/YourDesign1 lrwxrwxrwx 1 cpanel cpanel 62 Jun 2 15:19 YourDesign2 -> /hsphere/local/home/cpanel/shiva/custom/templates/YourDesign2 Here, the counter, guestbook, masonry, and poll directories are Parallels SiteStudio-related directories; YourDesign1 and YourDesign2 are custom design directories. 4. Make the ~cpanel/shiva/web directory in the DocumentRoot directory. To do this, in the ~cpanel/apache/etc/httpd.conf Apache configuration file change the DocumentRoot global definition line: DocumentRoot “/hsphere/local/home/cpanel/shiva/shivatemplates” to the following line: DocumentRoot “/hsphere/local/home/cpanel/shiva/web” Then, delete all other instances of the DocumentRoot definition (for virtual hosts) in this file. Also, delete all DocumentRoot definitions in all configuration files located in the ~cpanel/apache/etc/sites directory. 4. Logout from cpanel back to root and restart Parallels H-Sphere (on page 130). 34 Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. Design XML Configuration Parallels H-Sphere design configuration is represented in the design_config.xml file, which can be found by default in the /hsphere/local/home/cpanel/shiva/psoft/hsphere/ directory. You can customize (on page 31) this XML configuration to add your own designs, color schemes, colors and images. This document explains all important parts of the design configuration file, including:       Icons Skill Icon Groups Icon Image Sets Common Images Color Types Designs (Skins) Important: 1) Do not make changes into the default XML configuration file! Instead, follow instructions on design.xml customization (on page 31). 2) Changing design XML configuration implies proper knowledge of XML. Errors in XML structure may badly damage your Control Panel interface. Icons By icon we mean an Parallels H-Sphere control that provides quick access to a certain functional page of the control panel. All Parallels H-Sphere icons are displayed only on the Quick Access page, which is based on the quick/quick_view.html template. icon An icon description includes the following:    id - the mnemonic system name of the icon url_param - typically, the name of the base template for the functional page this icon links to. Multiple url parameters are separated with the & delimiter rtype - the list of Parallels H-Sphere resource types whose availability determines whether the icon will be drawn. It may include simple resource types separated by semicolons and commas in the following way:  res1 - simple resource type, icon will appear if the resource is available;  res1, res2, res3 - group of resources where all of them must be available to show an icon (operation „AND‟);  res1; res2; res3 - icon will be shown if any of the resources is available (operation „OR‟). Example: rtype=”webalizer; modlogan; urchin”  res1,res2; res3,res4; res5,res6 - combination of groups where an icon will be shown if any of the groups: res1,res2 or res3,res4 or res5,res6 includes both available resources. If translated to C or Java, this would mean (res1 & res2) || (res3 & res4) || (res5 & res6) Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. 35     platform - operating system (unix|win2k) on which plans using this icon are based. If platform=unix or platform=win2k, this means that the icon is displayed for Unix-based or Windows-based plans, respectively. If the platform attribute is left empty, the icon is available for all plans. label - mnemonic id of the caption under the icon image. It must be defined in the hsphere_lang.properties file tip - mnemonic id of the HTML tooltip of the icon. It must be defined in the hsphere_lang.properties file help - reserved for future use. One icon can have many visual representations. This means that it will have a different look depending on which icon image set was selected by the user. You can specify which icon image sets will be available for each individual design, for example: Skill Icon Groups In terms of the Parallels H-Sphere interface visual settings, only two types of accounts are customized, regardless of plans:   admin accounts which are Parallels H-Sphere administrative accounts, user accounts - all other accounts. Reseller accounts are regarded as user accounts, except for the reseller administrative account which relates to the admin account type. Skill icon groups determine the structure of the icon groups in the Quick Access page for these two types of accounts and are defined as follows: . . . . . . . . . . . . 36 Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. . . . . . . Account types:   admin for admin accounts user for user accounts. Skill set ids are of the following types:    standard for the common (left menu) interface. advanced for the „no menu‟ interface. simplified skill set may be chosen for any of the two types of accounts. Icon groups are defined within the skill_set element structure. The icon group id attribute corresponds to menu groups, such as Info, FTP, mail, etc., and is a mnemonic identifier of the icon group (mail, admin_mail, and the like). icon_group construction enlists the set of icons which are displayed in this icon group. Each icon is defined in the icons construction described above in the previous section. Icon Image Sets By icon image set we mean the set of icons corresponding to a certain Parallels HSphere color scheme:  . . . . . . base_dir attribute defines the directory where the Parallels H-Sphere images, both standard and custom, are to be stored. Typically, it is the IMAGES directory in the Apache document root directory (usually, ~cpanel/shiva/shiva-templates). Note: The base image directory is actually relative to the alternative directory for images which is located in the document root. This directory is set in the IMAGES variable in the hsphere.properties file. If it is not set there, base_dir contains the path relative to the document root. icon_image_set The icon_image_set element sets the list of images corresponding to a color scheme. Attributes: Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. 37   id attribute refers to mnemonic name of the color scheme. It is default for the default color scheme; cocoa, bubble and some other schemes go with Parallels H-Sphere installation, while others may be created manually. dir is the path relative to the base_dir directory. If it is empty, images are located in the base images directory. preview_image The preview_image tag refers to the preview image appeared in the Parallels HSphere Look and Feel interface when choosing the available design. The following attributes are determined for the preview image:    file - filename and path to the preview image relative to the document root directory. width, height - image width and height. image - image description tag. Please keep in mind that the image should be set for EACH color scheme. In order to add a new image, first, add the image definition to the icons tag, and then add image elements with the same id attribute to EACH icon_image_set element. The following attributes should be set:    id attribute value refers to the icon described in the icons section. file is the image filename with the path relative to the icon image set subdirectory of the image set basic directory. For example, if base_dir=”/IMAGES” and dir=”wooden”, then images for wooden scheme will be located in /IMAGES/wooden directory. However, if dir=””, then, to do so that Parallels H-Sphere would find, let say, a GIF image, you should set the file attribute as file=”wooden/name_of_the_file.gif”. width, height - image width and height. Unless these parameters are not changed, the user custom image would be displayed by Parallels H-Sphere with this width and height, regardless of the image size parameters. Common Images Common images are the set of images that have the same look in all designs, such as, arrows, bullets, home icon, etc. The common_images element structure is as follows: . . .   The base_dir attribute is defined in the same way as for the icon image sets. The image id attribute is an image mnemonic name used in templates. Color Types Color types comprise all possible interface entities for which colors are set: basic text, background, header, menu, error messages, etc. The following attributes are present in the color_type tag:  id is a mnemonic color type identifier later used in designs description; 38 Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться.  label is a mnemonic id to the caption under which this color type is configured in the CP interface. Designs Design, or skin, is a GUI representation including certain icon image sets and color schemes. The following designs are included into the default Parallels H-Sphere installation:     common is the Left Menu design. All basic templates are made for this design scheme. nomenu (No Menu) is the design with no left menu. It is turned on as the default user design after the Parallels H-Sphere installation. text-based (Text-Based) is the alternative look of the nomenu design where only captions with no icons are provided in the Quick Access menu page. xcp, xcpl - XPressia and XPressia Lite are designs with dropdown menus. reloaded (XP Reloaded) is a left-menu design, default in Parallels H-Sphere 3.1 and up. design Attributes of the design element:     id is a design mnemonic identifier: nomenu, common, text-based, xcp, xcpl, reloaded. label is a mnemonic id to the design name in the CP interface. template_dir is a directory relative to the document root directory where where template files for this design are located. default_color_scheme is the default color scheme identifier (see below, the color_scheme tag description). preview_image The preview_image tag defines the design preview image settings. The structure is the same as for the icon image sets. colors The colors element defines all available colors for this design. They are taken by default for every color scheme. Individual color settings for each color scheme could be defined in the corresponding color_scheme constructions (see description below). Color id attribute refers to the color type identifier (see Color types). base_images base_images is the set of images that look the same for all color schemes in this design. The base_images tag structure is the same as for the common images. image_sets The image_sets element contains the settings for each image set enabled for this design. base_dir attribute points to the images directory (usually, IMAGES). The element includes the following tags:  the set_images element contains the list of images in a standard image description which are taken by default for this design. Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. 39  the image_set tag contains image definitions for a color scheme to override the set_images default definitions. Here you may set an alternative directory where images for this color scheme will be searched, or modify settings so that an image will be taken from a file different from the default image file. image_set may contain image tags for images with alternative settings (for example, if the image file name is different from the default one). Attributes:    id - identifier for a color scheme (for example, default or cocoa); label - color scheme label; dir - alternative image directory relative to the base_dir directory; if it is empty the image search would be performed in the base_dir directory (usually, IMAGES). For example, if we need to change the banner.jpg image to banner1.jpg in the default color scheme so that this image would be searched in the base directory, the image tag should be inserted into the image_set construction in the following way: allowed_skill_icon_sets The allowed_skill_icon_sets tags are used to determine a skill icon set for user and admin accounts (see Skill icon groups): allowed_icon_image_sets The allowed_icon_image_sets tags determine icon image sets that would be available for each account type (see Icon sets): color_scheme color_scheme sets page colors, image sets and icon image sets in this design. Attributes:     id - color scheme identifier (for example, blue_haze or default); label - color scheme label defined in hsphere.properties; image_set - image set identifier (for example, blue_haze or default); icon_image_set - icon image set identifier (for example, blue_haze or default). The color_scheme element may include the color tags to set colors for this color scheme. If these colors are not set here, default colors would be taken from the colors tag definition for this design. Example: . . . 40 Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. Interface Controls And Colors in Templates This document introduces basic Freemarker functions related to interface controls (images, buttons, interface texts, etc.) and interface colors in Parallels H-Sphere templates. To generate HTML representation of Parallels H-Sphere control panel, we use Java and Java-based FreeMarker package. Parallels H-Sphere templates contain calls to FreeMarker functions, variables, and substitutions. Due to the added support of multiple designs in user‟s control panel, some of the functions needed to be changed. If you are using templates that have been developed for Parallels H-Sphere earlier than 2.1, you need to bring parameters in all FreeMarker function calls in line with the following list: Inserting HTML images: draw_image_width(image_id, image_width)> draw_image_alt(image_id, alt_msg)> draw_image_align(image_id, img_align)> draw_image_align_alt(image_id, img_align, alt_msg)> draw_spacer(s__width,s__height)> Inserting ON/OFF buttons: draw_state_on(toDisableURL)> draw_state_off(toEnableURL)> draw_off()> draw_on()> draw_on_always()> Inserting other control images: draw_edit(editURL, label)> draw_delete(deleteURL, label)> draw_change(editURL, label)> draw_select(selectURL, label)> draw_fix(selectURL, label)> draw_setup(selectURL, label)> draw_select_signup(plan)> draw_select_adminsignup(plan)> draw_preview(previewURL, label)> draw_preview_large(previewURL, label)> draw_launch(launchURL, label)> draw_launch_large(launchURL, label)> draw_uninstall(launchURL, label)> draw_credit(jumpURL, label)> Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. 41 draw_debit(jumpURL, label)> draw_set_period_begin(jumpURL, label)> draw_login_account(loginURL, label)> draw_suspend_account(toSuspendURL, label)> draw_resume_account(toResumeURL, label)> draw_delete_account(toDeleteURL, label)> draw_mail_type(editURL, image_id, label)> draw_mailbox_type(editURL)> draw_mailforward_type(editURL)> draw_mailalias_type(editURL)> draw_maillist_type(editURL)> draw_submit(field_name, image_id)> draw_oscommerce(previewURL, label)> draw_oscommerce_admin(previewURL, label)> Inserting text labels/messages: draw_colored_label_bold(llabel,lcolor)> draw_label(label)> draw_label_bold(label)> draw_header(header)> draw_important_label(label)> draw_important_header(header)> Inserting basic link elements (t - target, p - picture, a - alt): draw_tlink(url,target,label)> draw_plink(url, image_id)> draw_palink(url, image_id, alter)> draw_ptlink(url, target, image_id)> draw_ptalink(url, target, image_id, alter)> draw_onclick_palink(img, onClick, alt)> Drawing traffic and disk usage charts: Interface Colors Designs in Parallels H-Sphere have customizable color schemes. To display interface elements, we use colors, each having its own id_handle. For example, bgcolor is the id for the background of the HTML page other than the menu and the header. Its color can be set in the Look And Feel menu. To get the RGB value of the color by color_id, the following syntax is used: ${design.color(“color_id”)} Note: the color_id value must be replaced with an approprate handle and must be enclosed in double quotation marks. Some colors are predefined in the functions file: 42 Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. DARK_STRIP=design.color(“table_dark_strip”)> HEADER_COLOR=design.color(“header_color”)> ERROR_COLOR = design.color(“error_color”)> BG_COLOR = design.color(“bgcolor”)> Use them as follows: ${BG_COLOR} Adding Custom Icons To provide multiple design support, Parallels H-Sphere uses the design_config.xml file, which can be found in the /hsphere/local/home/cpanel/shiva/psoft/hsphere/ directory. Its structure is explained in the Design XML Configuration (on page 34) guide. The current document provides an example of how to customize this file to add your own custom icons. For this, you need to: 1. Create custom design_config file in custom location that will be merged with the default XML configuration file (on page 68). Your design_config.xml should include only differences in relation to the original Parallels H-Sphere one. 2. As Parallels H-Sphere supports several icon sets, create an icon for each icon set and include information about this icon location into your custom design_config.xml. To do this: 1. Declare the url and the image id that will be used for your icon: Where:  The email/custom_email.html is a custom template from which a customer will be redirected to your url.  The quick.your_custom_mail_web_app label should be described in the customized hsphere_lang.properties file. 2. Specify the place where the icon will be displayed. It can be included into the Quick Access page for the Admin Account or end user Quick Access page: ... ... Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. 43 So, your icon will be included into standard and advanced Quick Access of the Mail section. 3. Describe which image will be used for each icon set. Use the custom image directory to store your new icons /hsphere/local/home/cpanel/shiva/custom/images: ... ... 44 Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. 3. Create images for each icon set and place them into the corresponding directories. The base directory for your images is /hsphere/local/home/cpanel/shiva/custom/images. CHAPTER 5 Menu Customization Control Panel menu customization affects the following elements:    menu structure (on page 46): by customizing the menu XML configuration file, you can restructure menu, add/delete menu groups and items, configure menu layouts for individual plans, add external links to menu. menu texts (on page 57): texts for menu item labels are stored in menu language bundles. menu design (on page 51): you can change the menu appearance: color, bullets, etc. In this chapter: Menu XML Customization ..................................................................................46 Changing Menu Structure ..................................................................................46 Menu Design Customization ..............................................................................51 46 Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. Menu XML Customization The Control Panel menu structure (on page 46) is represented in an XML file. Its default location is set in ~cpanel/shiva/psoft_config/hsphere.properties by the MENU_CONFIG parameter: MENU_CONFIG=/hsphere/local/home/cpanel/shiva/psoft/hsphere/me nu.xml You should not make changes in the default menu.xml file, because these changes will be lost with the next Parallels H-Sphere upgrade. Instead, you create custom XML files that either override or merge changes with default configuration. Below are the alternative ways to customize menu.xml.   With Packages You create a custom menu.xml file within an Parallels H-Sphere package (on page 108). After the package is installed, this custom XML configuration will be merged with default XML configuration. Merging custom XML configuration If you need minor modifications in menu configuration, you don‟t need to rebuild a package. Instead, you create a custom XML configuration (on page 46) file to be merged with the default XML configuration and a custom package XML if installed. In this case, you avoid changing the default MENU_CONFIG property in hsphere.properties and use the CUSTOM_MENU_CONFIG parameter to specify your custom menu.xml location. Changing Menu Structure Parallels H-Sphere‟s control panel menu structure is defined in XML file, ~cpanel/shiva/psoft/hsphere/menu.xml by default. This document explains how you can make changes into the XML structure in order to:    modify menu items and groups configure individual menu layouts for different plans add external links to menu items Location The default location of menu.xml is set in ~cpanel/shiva/psoft_config/hsphere.properties: MENU_CONFIG = /hsphere/local/home/cpanel/shiva/psoft/hsphere/menu.xml Texts for menu elements are set in language bundles: MENU_BUNDLE = psoft.hsphere.lang.menu Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. 47 You should not make changes into the default ~cpanel/shiva/psoft/hsphere/menu.xml file! There are several ways how to customize menu XML data correctly, and they are explained in a separate Menu XML Customization (on page 46) document. Here in the text we refer to menu.xml assuming it is correctly customized according to menu.xml customization rules. XML Structure menu.xml consists of the following blocks going one after another: 1. DTD Scheme: http://hsphere.parallels.com/HSdocumentation/xmls/menu.dtd; 2. definition of menu groups (tag ) 3. definition of menu layouts for different hosting plans (tag ) Here is an example of menu.xml: http://hsphere.parallels.com/HSdocumentation/xmls/menu.xml. Modifying Menu Groups And Items Groups of menu items are set within the menus tag. Each group is defined by a menu tag and comprises definitions of items in this group (menuitem tags), as well as inclusions of submenus (initmenu tags). . . . . . . . . . . . . . . . These menu groups are grouped into different menu layouts defined below in menu.xml within the interface container. menu Attributes of the menu tag:  name - the name of the group. 48 Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться.   label - the mnemonic identifier of the text label for the menu group name displayed in CP. This label is set in the menu.properties bundle, for example: somemenu.label = Sample Menu Group See more about interface text bundles (on page 57). defaultitem - the name of the menu item that becomes active by default when the menu group is opened; contains the menu item name (the name attribute of the menu tag). tip - the menu group tooltip label set in the menu.properties bundle. menuitem Attributes of the menuitem tag:      name - the name of the item. label - the menu item mnemonic identifier from the menu.properties bundle (see explanation above for the label attribute of the menu tag). URL - the template file the item refers to, the pathname is relative to each design directory in the template directory. Read more in Understanding Templates (on page 11) for template directory structure. resource - the resource name that must exist in the account for this item to be shown in the menu. tip - the menu item tooltip label set in menu.properties. initmenu Attributes of the initmenu tag:  name - name of the menu group referred to the name attribute of the menu tag described among other menus in the menus container. According to menu.xml customization rules (on page 46), you can do the following modifications in the structure of menu items and groups: 1. add/delete menu groups, items and submenus, and edit their attributes. 2. choose menu items to be activated by default when menu group is opened in CP. 3. restructure the order of menu items within a group. Configuring Individual Menu Layouts For Different Hosting Plans Each hosting plan in Parallels H-Sphere may have its own menu configuration set in menu.xml after the description of menu groups. Plan menu structure is set by the menudef tag within the interface container. For example: . . . Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. 49 . . . The menudef tags contain sets of menu groups (on page 46) and separate items in order of their appearance in Parallels H-Sphere interface. The name attribute of initmenu tags points to the name of the respective menu group defined above in menu.xml in the menus container. The value for the id attribute of the menudef tag (TestPlan in the example above) must be the same as of the menuId parameter in the Plan Settings form (the Plans menu, the Settings icon for the plan, in admin CP). Please refer to the Plan Settings document in the Parallels H-Sphere Administrator Guide. These are default menu identifiers for the standard Parallels H-Sphere plan types:           unix - Unix plan; admin - Admin plan; ttadmin - Trouble Ticket Admin plan; bill - Billing plan; reseller - Reseller plan; winduz - Windows plan; real - Real Server plan; mysql - MySQL Only plan; email_only - Mail Only plan; vps - VPS plan.  To add your custom menu and assign it to a specific plan: 1. According to menu.xml customization rules (on page 46), add the new menudef structure for the plan and fill it with menu groups and items as shown in the above example: ... 2. In the admin control panel, in the plan‟s Settings form, set the menuId custom value to custom_menuId (read the Plan Settings document in the Parallels H-Sphere Administrator Guide for details.) Assigning External Links to Menu Items It is not possible to put a direct URL to the external page in the menu XML description. The path in the URL attribute of the menuitem element is relative to design subdirectories of the template directory (~cpanel/shiva/shiva-templates by default) and will be searched by Parallels H-Sphere according to its template lookup sequence (on page 11). A solution is in creating a template (specially-formatted HTML document) redirecting to an external URL. Consider an example of menu customization where to a certain external page on logout from admin CP. We assume that menu.xml (on page 46) and the template (on page 10) created are customized properly according to the respective customization rules. 50 Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. Note: Alternatively, instead of creating a new logout_redirect.html template with an external link, you may customize the standard logout.html template without customizing menu.xml. The example below is given merely to illustrate menu.xml customization. 1. In menu.xml, find the element corresponding to the admin plan: This would mean we are going to change CP menu only for the admin user and the change would not affect resellers and other plans. 2. Within this menudef element, find the line: 3. Change the URL attribute to the HTML file which would redirect to the URL you want. It is preferable to place this file to the ~cpanel/shiva/shiva-templates/common/misc directory. In this case, the URL attribute should be set as: URL=”misc/logout_redirect.html” 4. In the specified directory, create the redirecting HTML file. Parallels H Sphere will search for it in ~cpanel/shiva/custom/templates/common/misc/logout_red irect.html. The HTML redirecting document will be organized as follows: 5. Restart Parallels H-Sphere (on page 130). 6. Refresh browser to see the changes. It is better to log out and in again. Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. 51 Menu Design Customization This document explains how to change the appearance of the navigation menu in the Parallels H-Sphere control panel. You are expected to be familiar with the FreeMarker technology and with Parallels H-Sphere templates (on page 11). The template to be customized is ~cpanel/shiva/shivatemplates/common/menu.fn. The instruction below is the regular way of template customization. This customization can be also performed by means of Parallels HSphere packages (on page 108). 1. Login as the cpanel (on page 130) user from root. 2. Create the ~cpanel/shiva/custom directory if it doesn‟t exist yet. 3. Inside the custom/ directory, create the following directories if they aren‟t there:    templates/ images/ bundles/ Note: If the images/ directory is created, there must be a symlink to this directory from the Apache document root (which is the default template directory ~cpanel/shiva/shiva-templates); if not, users should place their images into the IMAGES directory. 4. Put your images into the images/ directory and your interface text files (on page 57) (bundles) into the bundles/ directory. 5. In the templates/ directory, create the common/ directory if it doesn‟t exist and copy the menu.fn file from the shivatemplates/common/ directory into that directory. 6. Make changes in the custom menu.fn. The following Freemarker functions are used in menu.fn to draw the navigation menu: ; ; ; . These functions draw different elements of the control panel menu. If you change them, please note that the HTML tags you add must be well ordered and valid. For example, you have to make sure that the number of columns in the menu table, which is set in draw_menu, is the same in all these functions. 1. The draw_menu function calls the other mentioned functions to draw the menu and also defines the menu table as follows: . 2. The draw_sub function draws the menu item which is the node for the submenu (group name): 52 Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. The menu_was_drawn variable is used to figure out how to show the next item. 3. The draw_item function draws the menu item which does not have a submenu. It may be a second-level item: Or, it could be even a first-level item that does not fall into any menu group: Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. 53 4. The draw_sub_items function checks the type of the menu item and calls the function draw_item or draw_sub. If you don‟t want to use a standard Parallels H-Sphere image, change the following calls: with: where path_to_your_image could be set either as the /IMAGES URL relative to the Apache document root, or as any absolute URL to your image, like http://www.yourdomain.com/replacing/image/dir/. 7. Open the ~cpanel/shiva/psoft_config/hsphere.properties file, uncomment and correct (if necessary) the following lines: USER_TEMPLATE_PATH = /hsphere/local/home/cpanel/shiva/custom/templates/ CUSTOM_MENU_BUNDLE = custom.bundles.menu See more about template customization (on page 10) and menu.xml customization (on page 46). Note: Don‟t initialize the variables you are not using! 8. Login as root and restart Parallels H-Sphere (on page 130). CHAPTER 6 Interface Text Customization (Language Bundles) This chapter explains how to add and modify texts in the Parallels H-Sphere Control Panel interface. In this chapter: Understanding Interface Text (Language) Bundles ........................................... 55 Interface Text Customization ............................................................................. 57 Language Bundle Compiler ............................................................................... 58 Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. 55 Understanding Interface Text (Language) Bundles Interface texts are defined in key=value sets collected in separate files for each language and encoding, where key is a mnemonic identifier for the text, and value is the text itself that is different for each language and encoding. Such files are called resource bundles, or language bundles, or simply bundles. Parallels H-Sphere templates (on page 11) include mnemonic identifiers and thus generate languageindependent dynamic content. We distinguish the following types of language bundles:    Default bundles - bundles installed with Parallels H-Sphere and containing default interface text values. Custom bundles - bundles created by H-Sphere customers that adding new interface texts or overriding the default ones. Internal bundles - resulting bundles whereto default and custom bundles are merged after language bundle compilation. Default bundles Default bundle location is set in ~cpanel/shiva/psoft_config/hsphere.properties: TEMPLATE_BUNDLE=psoft.hsphere.lang.hsphere_lang It means that default bundles are set in the following files of the ~cpanel/shiva/psoft/hsphere/lang/ directory.  hsphere_lang.properties - default English bundle. Important: Starting with Parallels H-Sphere 3.0 RC 1, menu.properties and messages.properties with navigation menu and system email notification texts become deprecated, and all labels are collected in a single hsphere_lang.properties for each language!  hsphere_lang___.properties - default language bundles in other languages. Please refer to the tables of canonical identifiers:  Language: http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt  Countries: http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html  Encodings (charsets or variants): http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html Note: For CP server under FreeBSD, use canonical encodings for Java 1.3: http://java.sun.com/j2se/1.3/docs/guide/intl/encoding.doc.html. All source bundles, in whatever encoding they were created, are compiled into Unicode (UTF-8). Therefore, in most cases and identifiers may be omitted in bundle names according to the following rules:  Some languages have different character sets, e.g., standard Chinese and simplified Chinese. In such case you cannot omit the encoding in bundle names. 56 Ошибка! Используйте вкладку "Главная" для применения Heading 1 к тексту, который должен здесь отображаться. Standard Chinese (Big5 encoding) bundle will look like: hsphere_lang_zh_CN_Big5.properties  Simplified Chinese (EUC_CN encoding) bundle will be: hsphere_lang_zh_CN_EUC_CN.properties Some languages have variations in different countries, e.g., Portuguese (Portugal) and Portuguese (Brazil). Then, you specify language and country for each case:  Portuguese (Portugal) bundle will be: hsphere_lang_pt_PT.properties     Portuguese (Brazil) bundle will be: hsphere_lang_pt_BR.properties If you know for sure the language won‟t be used for other countries, you may omit the country identifier. For example, for Russian: hsphere_lang_ru.properties Important: In any case, you must fully specify the correct language, country and encoding identifiers in the LANG_LIST parameter in hsphere.properties or in package properties file for Parallels H-Sphere packages (on page 108). In particular, Parallels H-Sphere should know in what encoding the bundles were created to be able to convert them to Unicode. LANG_LIST contains definitions for the languages, delimited with whitespace, each including the following components: __|:misc.langs.