diff --git a/install/install.php b/install/install.php index e5a410ab..6a7ace97 100644 --- a/install/install.php +++ b/install/install.php @@ -100,23 +100,23 @@ function page_header() { - + - - + + - - + + Froxlor Server Management Panel - Installation @@ -154,13 +154,13 @@ function status_message($case, $text) function requirement_checks() { - global $lng; + global $lng, $theme; page_header(); ?>
- Froxlor Server Management Panel + Froxlor Server Management Panel
@@ -520,7 +520,7 @@ if(isset($_POST['installstep']) ?>
- Froxlor Server Management Panel + Froxlor Server Management Panel
@@ -841,7 +841,7 @@ else ?>
- Froxlor Server Management Panel + Froxlor Server Management Panel

diff --git a/install/updates/preconfig/0.9/preconfig_0.9.inc.php b/install/updates/preconfig/0.9/preconfig_0.9.inc.php index 390e29eb..29ccaeab 100644 --- a/install/updates/preconfig/0.9/preconfig_0.9.inc.php +++ b/install/updates/preconfig/0.9/preconfig_0.9.inc.php @@ -26,7 +26,7 @@ */ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) { - global $settings, $lng, $db; + global $settings, $lng, $db, $theme; if(versionInUpdate($current_version, '0.9.4-svn2')) { diff --git a/lib/classes/aps/class.ApsParser.php b/lib/classes/aps/class.ApsParser.php index 59990e28..f7dac9a0 100644 --- a/lib/classes/aps/class.ApsParser.php +++ b/lib/classes/aps/class.ApsParser.php @@ -62,7 +62,7 @@ class ApsParser private function ManageInstances() { - global $lng, $filename, $s, $page, $action; + global $lng, $filename, $s, $page, $action, $theme; $Question = false; //dont do anything if there is no instance @@ -170,7 +170,7 @@ class ApsParser //create table with contents based on instance status if($Question != true) { - global $settings; + global $settings, $theme; $Instances = ''; if((int)$this->userinfo['customers_see_all'] == 1) @@ -317,7 +317,7 @@ class ApsParser private function ManagePackages() { - global $lng, $filename, $s, $page, $action; + global $lng, $filename, $s, $page, $action, $theme; $Question = false; if(isset($_POST['save'])) @@ -611,7 +611,7 @@ class ApsParser private function UploadNewPackages() { - global $lng, $filename, $s, $page, $action; + global $lng, $filename, $s, $page, $action, $theme; //define how many files can be uploaded at once @@ -724,7 +724,7 @@ class ApsParser private function SearchPackages() { - global $lng, $filename, $s, $page, $action; + global $lng, $filename, $s, $page, $action, $theme; $Error = 0; $Ids = array(); $ShowAll = 0; @@ -852,7 +852,7 @@ class ApsParser private function CustomerStatus($CustomerId) { - global $lng, $filename, $s, $page, $action; + global $lng, $filename, $s, $page, $action, $theme; $Data = ''; $Fieldname = ''; $Fieldvalue = ''; @@ -877,7 +877,7 @@ class ApsParser //skip if parse of xml has failed if($Xml == false)continue; - $Icon = './images/Classic/default.png'; + $Icon = 'templates/'.$theme.'/assets/img/default.png'; $this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0'; @@ -1033,7 +1033,7 @@ class ApsParser private function CreatePackageInstance($PackageId, $CustomerId) { - global $lng; + global $lng, $theme; if(!self::IsValidPackageId($PackageId, true))return false; @@ -1141,7 +1141,7 @@ class ApsParser private function CheckException($Category, $Item, $Value) { - global $settings; + global $settings, $theme; //search for element within system settings @@ -1164,7 +1164,7 @@ class ApsParser private function CheckSubmappings($ParentMapping, $Url) { - global $lng; + global $lng, $theme; $Error = array(); //check for special PHP handler extensions @@ -1243,7 +1243,7 @@ class ApsParser private function InstallNewPackage($Filename) { - global $lng, $userinfo; + global $lng, $userinfo, $theme; if(file_exists($Filename) && $Xml = self::GetXmlFromZip($Filename)) @@ -1726,7 +1726,7 @@ class ApsParser public function MainHandler($Action) { - global $lng, $filename, $s, $page, $action, $Id, $userinfo; + global $lng, $filename, $s, $page, $action, $Id, $userinfo, $theme; //check for basic functions, classes and permissions @@ -2810,7 +2810,7 @@ class ApsParser private function ShowPackageInstaller($PackageId, $WrongData, $CustomerId) { - global $lng, $filename, $s, $page, $action; + global $lng, $filename, $s, $page, $action, $theme; $Data = ''; $Fieldname = ''; $Fieldvalue = ''; @@ -2838,7 +2838,7 @@ class ApsParser //icon for package - $Icon = './images/Classic/default.png'; + $Icon = 'templates/'.$theme.'/img/default.png'; if($this->aps_version != '1.0') { @@ -3231,7 +3231,7 @@ class ApsParser private function ShowPackageInfo($PackageId, $All = false) { - global $lng, $filename, $s, $page, $action, $userinfo; + global $lng, $filename, $s, $page, $action, $userinfo, $theme; $Data = ''; $Fieldname = ''; $Fieldvalue = ''; @@ -3245,7 +3245,7 @@ class ApsParser //return if parse of xml file has failed if($Xml == false)return false; - $Icon = './images/Classic/default.png'; + $Icon = 'templates/'.$theme.'/img/default.png'; $this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0'; @@ -3460,7 +3460,7 @@ class ApsParser */ private function InfoBox($Message, $Type = 0) { - global $lng, $filename, $s, $page, $action; + global $lng, $filename, $s, $page, $action, $theme; //shows a box with informations eval("echo \"" . getTemplate("aps/infobox") . "\";"); } diff --git a/lib/classes/database/class.db.php b/lib/classes/database/class.db.php index 4fa27bfb..35930943 100644 --- a/lib/classes/database/class.db.php +++ b/lib/classes/database/class.db.php @@ -189,7 +189,7 @@ class db function query($query_str, $unbuffered = false, $suppress_error = false) { - global $numbqueries; + global $numbqueries, $theme; if (!mysql_ping($this->link_id)) { @@ -349,7 +349,7 @@ class db function showerror($errormsg, $mysqlActive = true) { - global $filename; + global $filename, $theme; $text = 'MySQL - Error: ' . str_replace("\n", "\t", $errormsg); if($mysqlActive) diff --git a/lib/classes/output/class.htmlform.php b/lib/classes/output/class.htmlform.php index 51468bff..6aa3a2c3 100644 --- a/lib/classes/output/class.htmlform.php +++ b/lib/classes/output/class.htmlform.php @@ -26,7 +26,7 @@ class htmlform public static function genHTMLForm($data = array()) { - global $lng; + global $lng, $theme; $nob = false; self::$_form = ''; diff --git a/lib/classes/output/class.paging.php b/lib/classes/output/class.paging.php index c9cf07ca..6fdfdda6 100644 --- a/lib/classes/output/class.paging.php +++ b/lib/classes/output/class.paging.php @@ -421,6 +421,8 @@ class paging function getHtmlArrowCode($baseurl, $field = '') { + global $theme; + if($field != '' && isset($this->fields[$field])) { diff --git a/lib/classes/ticket/class.ticket.php b/lib/classes/ticket/class.ticket.php index 85f91cd7..b3a9d744 100644 --- a/lib/classes/ticket/class.ticket.php +++ b/lib/classes/ticket/class.ticket.php @@ -260,7 +260,7 @@ class ticket public function sendMail($customerid = - 1, $template_subject = null, $default_subject = null, $template_body = null, $default_body = null) { - global $mail; + global $mail, $theme; // Some checks are to be made here in the future @@ -680,13 +680,13 @@ class ticket private function convertLatin1ToHtml($str) { $html_entities = array ( - "Ä" => "Ä", - "ä" => "ä", - "Ö" => "Ö", - "ö" => "ö", - "Ü" => "Ü", - "ü" => "ü", - "ß" => "ß" + "Ä" => "Ä", + "ä" => "ä", + "Ö" => "Ö", + "ö" => "ö", + "Ü" => "Ü", + "ü" => "ü", + "ß" => "ß" /* * @TODO continue this table for all the special-characters */ diff --git a/lib/functions.php b/lib/functions.php index 6b4d89f9..cd246ba1 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -44,7 +44,7 @@ function includeFunctions($dirname) function __autoload($classname) { - global $libdirname; + global $libdirname, $theme; findIncludeClass($libdirname . '/classes/', $classname); } diff --git a/lib/functions/aps/function.domainHasApsInstances.php b/lib/functions/aps/function.domainHasApsInstances.php index 97d5e888..4d20de6e 100644 --- a/lib/functions/aps/function.domainHasApsInstances.php +++ b/lib/functions/aps/function.domainHasApsInstances.php @@ -28,7 +28,7 @@ */ function domainHasApsInstances($domainid = 0) { - global $db, $settings; + global $db, $settings, $theme; if($settings['aps']['aps_active'] == '1') { diff --git a/lib/functions/database/function.correctMysqlUsers.php b/lib/functions/database/function.correctMysqlUsers.php index 69f7e773..9bbd7db4 100644 --- a/lib/functions/database/function.correctMysqlUsers.php +++ b/lib/functions/database/function.correctMysqlUsers.php @@ -19,7 +19,7 @@ function correctMysqlUsers($mysql_access_host_array) { - global $db, $settings, $sql, $sql_root; + global $db, $settings, $sql, $sql_root, $theme; foreach($sql_root as $mysql_server => $mysql_server_details) { diff --git a/lib/functions/filedir/function.maildirExists.php b/lib/functions/filedir/function.maildirExists.php index 516a940f..bb096bad 100644 --- a/lib/functions/filedir/function.maildirExists.php +++ b/lib/functions/filedir/function.maildirExists.php @@ -24,7 +24,7 @@ */ function maildirExists($result = null) { - global $settings; + global $settings, $theme; if(is_array($result)) { diff --git a/lib/functions/filedir/function.makeChownWithNewStats.php b/lib/functions/filedir/function.makeChownWithNewStats.php index b0b1b5dc..343fdc2f 100644 --- a/lib/functions/filedir/function.makeChownWithNewStats.php +++ b/lib/functions/filedir/function.makeChownWithNewStats.php @@ -26,7 +26,7 @@ */ function makeChownWithNewStats($row) { - global $settings; + global $settings, $theme; // get correct user if($settings['system']['mod_fcgid'] == '1' && isset($row['deactivated']) && $row['deactivated'] == '0') diff --git a/lib/functions/filedir/function.makePathfield.php b/lib/functions/filedir/function.makePathfield.php index a24c1d32..ed52d37c 100644 --- a/lib/functions/filedir/function.makePathfield.php +++ b/lib/functions/filedir/function.makePathfield.php @@ -34,7 +34,7 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '', $dom = false) { - global $lng; + global $lng, $theme; $value = str_replace($path, '', $value); $field = array(); diff --git a/lib/functions/filedir/function.safe_exec.php b/lib/functions/filedir/function.safe_exec.php index aae4d54d..97b3b55e 100644 --- a/lib/functions/filedir/function.safe_exec.php +++ b/lib/functions/filedir/function.safe_exec.php @@ -33,7 +33,7 @@ function safe_exec($exec_string, &$return_value = false) { - global $settings; + global $settings, $theme; // // define allowed system commands diff --git a/lib/functions/filedir/function.storeDefaultIndex.php b/lib/functions/filedir/function.storeDefaultIndex.php index 8e758dfb..88ab5e18 100644 --- a/lib/functions/filedir/function.storeDefaultIndex.php +++ b/lib/functions/filedir/function.storeDefaultIndex.php @@ -27,7 +27,7 @@ */ function storeDefaultIndex($loginname = null, $destination = null, $logger = null, $force = false) { - global $db, $settings, $pathtophpfiles; + global $db, $settings, $pathtophpfiles, $theme; if ($force || (int)$settings['system']['store_index_file_subs'] == 1 diff --git a/lib/functions/formfields/function.buildFormEx.php b/lib/functions/formfields/function.buildFormEx.php index 31747e16..a916dd0c 100644 --- a/lib/functions/formfields/function.buildFormEx.php +++ b/lib/functions/formfields/function.buildFormEx.php @@ -17,7 +17,7 @@ function buildFormEx($form, $part = '') { - global $settings; + global $settings, $theme; $fields = ''; if(validateFormDefinition($form)) diff --git a/lib/functions/formfields/function.getFormFieldOutput.php b/lib/functions/formfields/function.getFormFieldOutput.php index 4ddfcb4a..b6ac4f22 100644 --- a/lib/functions/formfields/function.getFormFieldOutput.php +++ b/lib/functions/formfields/function.getFormFieldOutput.php @@ -19,7 +19,7 @@ function getFormFieldOutput($fieldname, $fielddata) { - global $settings; + global $settings, $theme; $returnvalue = ''; if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldOutput' . ucfirst($fielddata['type']))) diff --git a/lib/functions/formfields/function.getFormGroupOutput.php b/lib/functions/formfields/function.getFormGroupOutput.php index 49b90a13..e410bbc3 100644 --- a/lib/functions/formfields/function.getFormGroupOutput.php +++ b/lib/functions/formfields/function.getFormGroupOutput.php @@ -19,14 +19,14 @@ function getFormGroupOutput($groupname, $groupdetails) { - global $lng; + global $lng, $theme; eval("\$group = \"" . getTemplate("settings/settings_group") . "\";"); return $group; } function getFormOverviewGroupOutput($groupname, $groupdetails) { - global $lng, $settings, $filename, $s; + global $lng, $settings, $filename, $s, $theme; $group = ''; $title = $groupdetails['title']; diff --git a/lib/functions/froxlor/function.CorrectErrorDocument.php b/lib/functions/froxlor/function.CorrectErrorDocument.php index 6fbf88b0..cda65525 100644 --- a/lib/functions/froxlor/function.CorrectErrorDocument.php +++ b/lib/functions/froxlor/function.CorrectErrorDocument.php @@ -26,7 +26,7 @@ */ function correctErrorDocument($errdoc = null) { - global $settings, $idna_convert; + global $settings, $idna_convert, $theme; if($errdoc !== null && $errdoc != '') { diff --git a/lib/functions/froxlor/function.CronjobFunctions.php b/lib/functions/froxlor/function.CronjobFunctions.php index ad1c208d..22ad728e 100644 --- a/lib/functions/froxlor/function.CronjobFunctions.php +++ b/lib/functions/froxlor/function.CronjobFunctions.php @@ -24,7 +24,7 @@ */ function getNextCronjobs() { - global $db; + global $db, $theme; $query = "SELECT `id`, `cronfile` FROM `".TABLE_PANEL_CRONRUNS."` WHERE `interval` <> '0' AND `isactive` = '1' AND ("; @@ -60,7 +60,7 @@ function getNextCronjobs() function includeCronjobs($debugHandler, $pathtophpfiles) { - global $settings; + global $settings, $theme; $cronjobs = getNextCronjobs(); @@ -84,7 +84,7 @@ function includeCronjobs($debugHandler, $pathtophpfiles) function getIntervalOptions() { - global $db, $lng, $cronlog; + global $db, $lng, $cronlog, $theme; $query = "SELECT DISTINCT `interval` FROM `" . TABLE_PANEL_CRONRUNS . "` ORDER BY `interval` ASC;"; $result = $db->query($query); @@ -110,7 +110,7 @@ function getIntervalOptions() function getCronjobsLastRun() { - global $db, $lng; + global $db, $lng, $theme; $query = "SELECT `lastrun`, `desc_lng_key` FROM `".TABLE_PANEL_CRONRUNS."` WHERE `isactive` = '1' ORDER BY `cronfile` ASC"; $result = $db->query($query); @@ -135,7 +135,7 @@ function getCronjobsLastRun() function toggleCronStatus($module = null, $isactive = 0) { - global $db; + global $db, $theme; if($isactive != 1) { $isactive = 0; @@ -148,7 +148,7 @@ function toggleCronStatus($module = null, $isactive = 0) function getOutstandingTasks() { - global $db, $lng; + global $db, $lng, $theme; $query = "SELECT * FROM `".TABLE_PANEL_TASKS."` ORDER BY `type` ASC"; $result = $db->query($query); diff --git a/lib/functions/froxlor/function.createAWStatsConf.php b/lib/functions/froxlor/function.createAWStatsConf.php index 33149994..faa1d3b1 100644 --- a/lib/functions/froxlor/function.createAWStatsConf.php +++ b/lib/functions/froxlor/function.createAWStatsConf.php @@ -29,7 +29,7 @@ function createAWStatsConf($logFile, $siteDomain, $hostAliases, $customerDocroot, $awstats_params = array()) { - global $pathtophpfiles, $settings; + global $pathtophpfiles, $settings, $theme; // Generation header diff --git a/lib/functions/froxlor/function.customerHasPerlEnabled.php b/lib/functions/froxlor/function.customerHasPerlEnabled.php index 90683dc3..207a7f4c 100644 --- a/lib/functions/froxlor/function.customerHasPerlEnabled.php +++ b/lib/functions/froxlor/function.customerHasPerlEnabled.php @@ -27,7 +27,7 @@ */ function customerHasPerlEnabled($cid = 0) { - global $db; + global $db, $theme; if($cid > 0) { diff --git a/lib/functions/froxlor/function.domainHasMainSubDomains.php b/lib/functions/froxlor/function.domainHasMainSubDomains.php index 48f109ae..22a78bdf 100644 --- a/lib/functions/froxlor/function.domainHasMainSubDomains.php +++ b/lib/functions/froxlor/function.domainHasMainSubDomains.php @@ -25,7 +25,7 @@ */ function domainHasMainSubDomains($id = 0) { - global $db; + global $db, $theme; $sql = "SELECT COUNT(`id`) as `mainsubs` FROM `".TABLE_PANEL_DOMAINS."` WHERE `ismainbutsubto` = '".(int)$id."'"; $result = $db->query_first($sql); @@ -47,7 +47,7 @@ function domainHasMainSubDomains($id = 0) */ function domainMainToSubExists($id = 0) { - global $db; + global $db, $theme; $sql = "SELECT `id` FROM `".TABLE_PANEL_DOMAINS."` WHERE `id` = '".(int)$id."'"; $result = $db->query_first($sql); diff --git a/lib/functions/froxlor/function.generatePassword.php b/lib/functions/froxlor/function.generatePassword.php index 78c8f9b7..26b4285f 100644 --- a/lib/functions/froxlor/function.generatePassword.php +++ b/lib/functions/froxlor/function.generatePassword.php @@ -21,7 +21,7 @@ function generatePassword() { - global $db, $settings; + global $db, $settings, $theme; return substr(md5(uniqid(microtime(), 1)), 24, 10); } diff --git a/lib/functions/froxlor/function.getAdmins.php b/lib/functions/froxlor/function.getAdmins.php index 4d100aee..8c940e6d 100644 --- a/lib/functions/froxlor/function.getAdmins.php +++ b/lib/functions/froxlor/function.getAdmins.php @@ -19,7 +19,7 @@ function getAdmins($limit_resource = '') { - global $db; + global $db, $theme; $additional_conditions = ''; $additional_conditions_array = array(); diff --git a/lib/functions/froxlor/function.getCustomerDetail.php b/lib/functions/froxlor/function.getCustomerDetail.php index 2d5babf4..730eb22d 100644 --- a/lib/functions/froxlor/function.getCustomerDetail.php +++ b/lib/functions/froxlor/function.getCustomerDetail.php @@ -19,7 +19,7 @@ function getCustomerDetail($customerid, $varname) { - global $db; + global $db, $theme; $query = 'SELECT `' . $db->escape($varname) . '` FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `customerid` = \'' . (int)$customerid . '\''; $customer = $db->query_first($query); diff --git a/lib/functions/froxlor/function.getCustomerIdByDomain.php b/lib/functions/froxlor/function.getCustomerIdByDomain.php index b562b5c5..124c27b3 100644 --- a/lib/functions/froxlor/function.getCustomerIdByDomain.php +++ b/lib/functions/froxlor/function.getCustomerIdByDomain.php @@ -9,10 +9,10 @@ */ function getCustomerIdByDomain($domain = null) { - global $db; + global $db, $theme; $result = $db->query_first("SELECT `customerid` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain` = '".$domain."'"); - if(is_array($result) + if(is_array($result) && isset($result['customerid']) ) { return $result['customerid']; diff --git a/lib/functions/froxlor/function.getCustomers.php b/lib/functions/froxlor/function.getCustomers.php index 9f6c6928..d1a8b456 100644 --- a/lib/functions/froxlor/function.getCustomers.php +++ b/lib/functions/froxlor/function.getCustomers.php @@ -19,7 +19,7 @@ function getCustomers($limit_resource = '') { - global $db; + global $db, $theme; $additional_conditions = ''; $additional_conditions_array = array(); diff --git a/lib/functions/froxlor/function.getFilesystemQuota.php b/lib/functions/froxlor/function.getFilesystemQuota.php index f821f1c1..d7063172 100644 --- a/lib/functions/froxlor/function.getFilesystemQuota.php +++ b/lib/functions/froxlor/function.getFilesystemQuota.php @@ -17,7 +17,7 @@ function getFilesystemQuota() { - global $settings; + global $settings, $theme; if ($settings['system']['diskquota_enabled']) { # Fetch all quota in the desired partition diff --git a/lib/functions/froxlor/function.getIpAddresses.php b/lib/functions/froxlor/function.getIpAddresses.php index c8309059..28ed30ab 100644 --- a/lib/functions/froxlor/function.getIpAddresses.php +++ b/lib/functions/froxlor/function.getIpAddresses.php @@ -19,7 +19,7 @@ function getIpAddresses() { - global $db; + global $db, $theme; $query = 'SELECT `id`, `ip`, `port` FROM `' . TABLE_PANEL_IPSANDPORTS . '` ORDER BY `ip` ASC, `port` ASC'; $result = $db->query($query); diff --git a/lib/functions/froxlor/function.getIpPortCombinations.php b/lib/functions/froxlor/function.getIpPortCombinations.php index dad987f8..24ba82e4 100644 --- a/lib/functions/froxlor/function.getIpPortCombinations.php +++ b/lib/functions/froxlor/function.getIpPortCombinations.php @@ -19,7 +19,7 @@ function getIpPortCombinations($ssl = null) { - global $db; + global $db, $theme; $additional_conditions = ''; $additional_conditions_array = array(); diff --git a/lib/functions/froxlor/function.getLanguages.php b/lib/functions/froxlor/function.getLanguages.php index 20889d55..f26832dd 100644 --- a/lib/functions/froxlor/function.getLanguages.php +++ b/lib/functions/froxlor/function.getLanguages.php @@ -19,7 +19,7 @@ function getLanguages() { - global $db; + global $db, $theme; $query = 'SELECT * FROM `' . TABLE_PANEL_LANGUAGE . '` '; $result = $db->query($query); diff --git a/lib/functions/froxlor/function.getLoginNameByUid.php b/lib/functions/froxlor/function.getLoginNameByUid.php index 87df4561..d09c20d8 100644 --- a/lib/functions/froxlor/function.getLoginNameByUid.php +++ b/lib/functions/froxlor/function.getLoginNameByUid.php @@ -9,10 +9,10 @@ */ function getLoginNameByUid($uid = null) { - global $db; + global $db, $theme; $result = $db->query_first("SELECT `loginname` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `guid` = '".(int)$uid."'"); - if(is_array($result) + if(is_array($result) && isset($result['loginname']) ) { return $result['loginname']; diff --git a/lib/functions/froxlor/function.getPhpConfigs.php b/lib/functions/froxlor/function.getPhpConfigs.php index 06eb6fc0..587368a1 100644 --- a/lib/functions/froxlor/function.getPhpConfigs.php +++ b/lib/functions/froxlor/function.getPhpConfigs.php @@ -22,7 +22,7 @@ */ function getPhpConfigs() { - global $db; + global $db, $theme; $query = 'SELECT * FROM `' . TABLE_PANEL_PHPCONFIGS . '` '; $result = $db->query($query, false, true); diff --git a/lib/functions/froxlor/function.getServerId.php b/lib/functions/froxlor/function.getServerId.php index f1f871c4..70e3913d 100644 --- a/lib/functions/froxlor/function.getServerId.php +++ b/lib/functions/froxlor/function.getServerId.php @@ -25,10 +25,10 @@ */ function getServerId() { - global $server_id; + global $server_id, $theme; - if(isset($server_id) - && is_numeric($server_id) + if(isset($server_id) + && is_numeric($server_id) && $server_id > 0 ) { return $server_id; diff --git a/lib/functions/froxlor/function.getSessionUserDetail.php b/lib/functions/froxlor/function.getSessionUserDetail.php index a9b8a032..da516090 100644 --- a/lib/functions/froxlor/function.getSessionUserDetail.php +++ b/lib/functions/froxlor/function.getSessionUserDetail.php @@ -19,7 +19,7 @@ function getSessionUserDetail($varname) { - global $userinfo; + global $userinfo, $theme; if(isset($userinfo[$varname])) { diff --git a/lib/functions/froxlor/function.inserttask.php b/lib/functions/froxlor/function.inserttask.php index 279ac4e8..34fa92f2 100644 --- a/lib/functions/froxlor/function.inserttask.php +++ b/lib/functions/froxlor/function.inserttask.php @@ -29,7 +29,7 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '', $param4 = '') { - global $db, $settings; + global $db, $settings, $theme; if($type == '1' || $type == '3' diff --git a/lib/functions/froxlor/function.isCustomerStdSubdomain.php b/lib/functions/froxlor/function.isCustomerStdSubdomain.php index 936f45f4..c5acb6a6 100644 --- a/lib/functions/froxlor/function.isCustomerStdSubdomain.php +++ b/lib/functions/froxlor/function.isCustomerStdSubdomain.php @@ -26,7 +26,7 @@ */ function isCustomerStdSubdomain($did = 0) { - global $db; + global $db, $theme; if($did > 0) { diff --git a/lib/functions/froxlor/function.loadConfigArrayDir.php b/lib/functions/froxlor/function.loadConfigArrayDir.php index 6dac2341..e8c4d44c 100644 --- a/lib/functions/froxlor/function.loadConfigArrayDir.php +++ b/lib/functions/froxlor/function.loadConfigArrayDir.php @@ -20,7 +20,7 @@ function loadConfigArrayDir() { // Workaround until we use gettext - global $lng; + global $lng, $theme; // we now use dynamic function parameters // so we can read from more than one directory diff --git a/lib/functions/froxlor/function.openRootDB.php b/lib/functions/froxlor/function.openRootDB.php index 926416ea..7e14efe7 100644 --- a/lib/functions/froxlor/function.openRootDB.php +++ b/lib/functions/froxlor/function.openRootDB.php @@ -28,7 +28,7 @@ */ function openRootDB($debugHandler = false, $lockfile = false) { - global $db_root; + global $db_root, $theme; require dirname(dirname(dirname(__FILE__))).'/userdata.inc.php'; @@ -68,6 +68,6 @@ function openRootDB($debugHandler = false, $lockfile = false) function closeRootDB() { - global $db_root; + global $db_root, $theme; if(isset($db_root)) unset($db_root); } diff --git a/lib/functions/froxlor/function.updateCounters.php b/lib/functions/froxlor/function.updateCounters.php index 3813b3f2..aeaa59d2 100644 --- a/lib/functions/froxlor/function.updateCounters.php +++ b/lib/functions/froxlor/function.updateCounters.php @@ -28,7 +28,7 @@ function updateCounters($returndebuginfo = false) { - global $db; + global $db, $theme; $returnval = array(); if($returndebuginfo === true) diff --git a/lib/functions/froxlor/function.updateFunctions.php b/lib/functions/froxlor/function.updateFunctions.php index 3739a9cc..b66a0f12 100644 --- a/lib/functions/froxlor/function.updateFunctions.php +++ b/lib/functions/froxlor/function.updateFunctions.php @@ -27,7 +27,7 @@ */ function updateToVersion($new_version = null) { - global $db, $settings; + global $db, $settings, $theme; if($new_version !== null && $new_version != '') { @@ -48,7 +48,7 @@ function updateToVersion($new_version = null) */ function isFroxlor() { - global $settings; + global $settings, $theme; if(isset($settings['panel']['frontend']) && $settings['panel']['frontend'] == 'froxlor') @@ -70,7 +70,7 @@ function isFroxlor() */ function isFroxlorVersion($to_check = null) { - global $settings; + global $settings, $theme; if($settings['panel']['frontend'] == 'froxlor' && $settings['panel']['version'] == $to_check) @@ -92,7 +92,7 @@ function isFroxlorVersion($to_check = null) */ function hasUpdates($to_check = null) { - global $settings; + global $settings, $theme; if(!isset($settings['panel']['version']) || $settings['panel']['version'] != $to_check) @@ -115,7 +115,7 @@ function hasUpdates($to_check = null) */ function showUpdateStep($task = null, $needs_status = true) { - global $updatelog, $filelog; + global $updatelog, $filelog, $theme; // output echo $task; @@ -141,7 +141,7 @@ function showUpdateStep($task = null, $needs_status = true) */ function lastStepStatus($status = -1, $message = '') { - global $updatelog, $filelog; + global $updatelog, $filelog, $theme; switch($status) { diff --git a/lib/functions/output/function.RedirectCode.php b/lib/functions/output/function.RedirectCode.php index 9d4dc467..37145fef 100644 --- a/lib/functions/output/function.RedirectCode.php +++ b/lib/functions/output/function.RedirectCode.php @@ -22,7 +22,7 @@ */ function getRedirectCodesArray() { - global $db; + global $db, $theme; $sql = "SELECT * FROM `".TABLE_PANEL_REDIRECTCODES."` WHERE `enabled` = '1' ORDER BY `id` ASC"; $result = $db->query($sql); @@ -44,7 +44,7 @@ function getRedirectCodesArray() */ function getRedirectCodes() { - global $db, $lng; + global $db, $lng, $theme; $sql = "SELECT * FROM `".TABLE_PANEL_REDIRECTCODES."` WHERE `enabled` = '1' ORDER BY `id` ASC"; $result = $db->query($sql); @@ -68,7 +68,7 @@ function getRedirectCodes() */ function getDomainRedirectCode($domainid = 0) { - global $db; + global $db, $theme; $code = ''; if($domainid > 0) @@ -98,7 +98,7 @@ function getDomainRedirectCode($domainid = 0) */ function getDomainRedirectId($domainid = 0) { - global $db; + global $db, $theme; $code = 1; if($domainid > 0) @@ -128,10 +128,10 @@ function getDomainRedirectId($domainid = 0) */ function addRedirectToDomain($domainid = 0, $redirect = 1) { - global $db; + global $db, $theme; if($domainid > 0) { - $db->query("INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."` + $db->query("INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."` SET `rid` = '".(int)$redirect."', `did` = '".(int)$domainid."'"); } } @@ -147,7 +147,7 @@ function addRedirectToDomain($domainid = 0, $redirect = 1) */ function updateRedirectOfDomain($domainid = 0, $redirect = false) { - global $db; + global $db, $theme; if($redirect == false) { @@ -158,7 +158,7 @@ function updateRedirectOfDomain($domainid = 0, $redirect = false) { $db->query("DELETE FROM `".TABLE_PANEL_DOMAINREDIRECTS."` WHERE `did` = '".(int)$domainid."'"); - $db->query("INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."` + $db->query("INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."` SET `rid` = '".(int)$redirect."', `did` = '".(int)$domainid."'"); } -} \ No newline at end of file +} diff --git a/lib/functions/output/function.ask_yesno.php b/lib/functions/output/function.ask_yesno.php index 9cff2c92..876953ea 100644 --- a/lib/functions/output/function.ask_yesno.php +++ b/lib/functions/output/function.ask_yesno.php @@ -34,7 +34,7 @@ function ask_yesno($text, $yesfile, $params = array(), $targetname = '', $back_nr = 1) { - global $userinfo, $db, $s, $header, $footer, $lng; + global $userinfo, $db, $s, $header, $footer, $lng, $theme; $hiddenparams = ''; @@ -58,7 +58,7 @@ function ask_yesno($text, $yesfile, $params = array(), $targetname = '', $back_n function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true) { - global $userinfo, $db, $s, $header, $footer, $lng; + global $userinfo, $db, $s, $header, $footer, $lng, $theme; $hiddenparams = ''; diff --git a/lib/functions/output/function.makeyesno.php b/lib/functions/output/function.makeyesno.php index 3707a5d3..29b2b738 100644 --- a/lib/functions/output/function.makeyesno.php +++ b/lib/functions/output/function.makeyesno.php @@ -32,7 +32,7 @@ function makeyesno($name, $yesvalue, $novalue = '', $yesselected = '', $disabled = false) { - global $lng; + global $lng, $theme; if($disabled) { $d = ' disabled="disabled"'; diff --git a/lib/functions/output/function.redirectTo.php b/lib/functions/output/function.redirectTo.php index ec318522..a2c6f20e 100644 --- a/lib/functions/output/function.redirectTo.php +++ b/lib/functions/output/function.redirectTo.php @@ -38,7 +38,7 @@ function redirectTo($destination, $get_variables = array(), $isRelative = false) { - global $s; + global $s, $theme; if(is_array($get_variables)) { diff --git a/lib/functions/output/function.standard_error.php b/lib/functions/output/function.standard_error.php index 95dc41c5..76c0f001 100644 --- a/lib/functions/output/function.standard_error.php +++ b/lib/functions/output/function.standard_error.php @@ -28,7 +28,7 @@ function standard_error($errors = '', $replacer = '') { - global $db, $userinfo, $s, $header, $footer, $lng; + global $db, $userinfo, $s, $header, $footer, $lng, $theme; $_SESSION['requestData'] = $_POST; $replacer = htmlentities($replacer); diff --git a/lib/functions/output/function.standard_success.php b/lib/functions/output/function.standard_success.php index 88a21afa..ae996b25 100644 --- a/lib/functions/output/function.standard_success.php +++ b/lib/functions/output/function.standard_success.php @@ -27,7 +27,7 @@ function standard_success($success_message = '', $replacer = '', $params = array()) { - global $s, $header, $footer, $lng; + global $s, $header, $footer, $lng, $theme; if(isset($lng['success'][$success_message])) { diff --git a/lib/functions/settings/function.getSetting.php b/lib/functions/settings/function.getSetting.php index 468ba033..ac20878e 100644 --- a/lib/functions/settings/function.getSetting.php +++ b/lib/functions/settings/function.getSetting.php @@ -19,7 +19,7 @@ function getSetting($settinggroup, $varname) { - global $settings; + global $settings, $theme; if(isset($settings[$settinggroup]) && is_array($settings[$settinggroup]) && isset($settings[$settinggroup][$varname])) { return $settings[$settinggroup][$varname]; diff --git a/lib/functions/settings/function.saveSetting.php b/lib/functions/settings/function.saveSetting.php index e1c8831c..aef9a270 100644 --- a/lib/functions/settings/function.saveSetting.php +++ b/lib/functions/settings/function.saveSetting.php @@ -19,7 +19,7 @@ function saveSetting($settinggroup, $varname, $newvalue) { - global $db; + global $db, $theme; $query = 'UPDATE `' . TABLE_PANEL_SETTINGS . '` SET `value` = \'' . $db->escape($newvalue) . '\' WHERE `settinggroup` = \'' . $db->escape($settinggroup) . '\' AND `varname`=\'' . $db->escape($varname) . '\''; return $db->query($query); } diff --git a/lib/functions/settings/function.storeSettingDefaultIp.php b/lib/functions/settings/function.storeSettingDefaultIp.php index 65cb26e8..66b9be4b 100644 --- a/lib/functions/settings/function.storeSettingDefaultIp.php +++ b/lib/functions/settings/function.storeSettingDefaultIp.php @@ -23,7 +23,7 @@ function storeSettingDefaultIp($fieldname, $fielddata, $newfieldvalue) if($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'system' && isset($fielddata['varname']) && $fielddata['varname'] == 'defaultip') { - global $db; + global $db, $theme; $customerstddomains_result = $db->query('SELECT `standardsubdomain` FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `standardsubdomain` <> \'0\''); $ids = array(); diff --git a/lib/functions/settings/function.storeSettingHostname.php b/lib/functions/settings/function.storeSettingHostname.php index 7f192429..d74077cb 100644 --- a/lib/functions/settings/function.storeSettingHostname.php +++ b/lib/functions/settings/function.storeSettingHostname.php @@ -23,7 +23,7 @@ function storeSettingHostname($fieldname, $fielddata, $newfieldvalue) if($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'system' && isset($fielddata['varname']) && $fielddata['varname'] == 'hostname') { - global $db, $idna_convert; + global $db, $idna_convert, $theme; $newfieldvalue = $idna_convert->encode($newfieldvalue); $customerstddomains_result = $db->query('SELECT `standardsubdomain` FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `standardsubdomain` <> \'0\''); diff --git a/lib/functions/system/function.checklastguid.php b/lib/functions/system/function.checklastguid.php index 5e6db055..653c7e14 100644 --- a/lib/functions/system/function.checklastguid.php +++ b/lib/functions/system/function.checklastguid.php @@ -31,7 +31,7 @@ */ function checkLastGuid() { - global $log, $cronlog, $db, $settings; + global $log, $cronlog, $db, $settings, $theme; $mylog = null; if (isset($cronlog) && $cronlog instanceof FroxlorLogger) { diff --git a/lib/functions/validate/function.checkFcgidPhpFpm.php b/lib/functions/validate/function.checkFcgidPhpFpm.php index b5f78e5c..43dbfec1 100644 --- a/lib/functions/validate/function.checkFcgidPhpFpm.php +++ b/lib/functions/validate/function.checkFcgidPhpFpm.php @@ -17,7 +17,7 @@ function checkFcgidPhpFpm($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues) { - global $settings; + global $settings, $theme; $returnvalue = array(FORMFIELDS_PLAUSIBILITY_CHECK_OK); diff --git a/lib/functions/validate/function.checkPathConflicts.php b/lib/functions/validate/function.checkPathConflicts.php index 99a135d0..df87a070 100644 --- a/lib/functions/validate/function.checkPathConflicts.php +++ b/lib/functions/validate/function.checkPathConflicts.php @@ -17,7 +17,7 @@ function checkPathConflicts($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues) { - global $settings; + global $settings, $theme; if((int)$settings['system']['mod_fcgid'] == 1) { /** diff --git a/lib/functions/validate/function.checkUsername.php b/lib/functions/validate/function.checkUsername.php index 7d2ea34e..ba26c275 100644 --- a/lib/functions/validate/function.checkUsername.php +++ b/lib/functions/validate/function.checkUsername.php @@ -19,7 +19,7 @@ function checkUsername($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues) { - global $settings; + global $settings, $theme; if(!isset($allnewfieldvalues['customer_mysqlprefix'])) { $allnewfieldvalues['customer_mysqlprefix'] = $settings['customer']['mysqlprefix']; diff --git a/lib/functions/validate/function.setCycleOfCronjob.php b/lib/functions/validate/function.setCycleOfCronjob.php index 0324d064..45a885d9 100644 --- a/lib/functions/validate/function.setCycleOfCronjob.php +++ b/lib/functions/validate/function.setCycleOfCronjob.php @@ -17,7 +17,7 @@ function setCycleOfCronjob($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues) { - global $settings, $db; + global $settings, $db, $theme; switch($newfieldvalue) { diff --git a/lib/functions/validate/function.validate.php b/lib/functions/validate/function.validate.php index 2366449b..54af7617 100644 --- a/lib/functions/validate/function.validate.php +++ b/lib/functions/validate/function.validate.php @@ -33,7 +33,7 @@ function validate($str, $fieldname, $pattern = '', $lng = '', $emptydefault = array()) { - global $log; + global $log, $theme; if(!is_array($emptydefault)) { diff --git a/lib/functions/validate/function.validatePassword.php b/lib/functions/validate/function.validatePassword.php index 89f2f699..84481fcd 100644 --- a/lib/functions/validate/function.validatePassword.php +++ b/lib/functions/validate/function.validatePassword.php @@ -28,7 +28,7 @@ */ function validatePassword($password = null) { - global $settings; + global $settings, $theme; if ($settings['panel']['password_min_length'] > 0) { $password = validate( diff --git a/lib/functions/validate/function.validateUrl.php b/lib/functions/validate/function.validateUrl.php index 1ba860ad..67b335eb 100644 --- a/lib/functions/validate/function.validateUrl.php +++ b/lib/functions/validate/function.validateUrl.php @@ -28,7 +28,7 @@ function validateUrl($url) { - global $idna_convert; + global $idna_convert, $theme; if(strtolower(substr($url, 0, 7)) != "http://" && strtolower(substr($url, 0, 8)) != "https://") diff --git a/lib/init.php b/lib/init.php index f71cbd53..674f2881 100644 --- a/lib/init.php +++ b/lib/init.php @@ -363,8 +363,9 @@ if(isset($userinfo['theme']) && $userinfo['theme'] != $theme) /* * check for custom header-graphic */ -$hl_path = 'images/'.$theme; +$hl_path = 'templates/'.$theme.'/assets/img'; $header_logo = $hl_path.'/logo.png'; + if(file_exists($hl_path.'/logo_custom.png')) { $header_logo = $hl_path.'/logo_custom.png'; } diff --git a/scripts/jobs/cron_lighttp.htaccess.php b/scripts/jobs/cron_lighttp.htaccess.php index 670ab1d9..72170d28 100644 --- a/scripts/jobs/cron_lighttp.htaccess.php +++ b/scripts/jobs/cron_lighttp.htaccess.php @@ -47,7 +47,7 @@ else function read_directory($dir1 = null, $min_depth = 25, $htaccessfh = null) { - global $htaccessfh; + global $htaccessfh, $theme; if(!is_string($dir1)) { @@ -95,7 +95,7 @@ function read_directory($dir1 = null, $min_depth = 25, $htaccessfh = null) function parseHtaccess($file = null) { - global $debugHandler, $htaccessfh; + global $debugHandler, $htaccessfh, $theme; $htacc = @file_get_contents($file); if($htacc != "") diff --git a/scripts/jobs/cron_traffic.inc.functions.php b/scripts/jobs/cron_traffic.inc.functions.php index a34e1850..0847e52a 100644 --- a/scripts/jobs/cron_traffic.inc.functions.php +++ b/scripts/jobs/cron_traffic.inc.functions.php @@ -19,7 +19,7 @@ function awstatsDoSingleDomain($domain, $outputdir) { - global $cronlog, $settings; + global $cronlog, $settings, $theme; $returnval = 0; $domainconfig = makeCorrectFile($settings['system']['awstats_conf'].'/awstats.' . $domain . '.conf'); @@ -104,7 +104,7 @@ function awstatsDoSingleDomain($domain, $outputdir) function callAwstatsGetTraffic($customerid, $outputdir, $usersdomainlist) { - global $settings, $db, $cronlog; + global $settings, $db, $cronlog, $theme; $returnval = 0; foreach($usersdomainlist as $domainid => $singledomain) @@ -156,7 +156,7 @@ function callAwstatsGetTraffic($customerid, $outputdir, $usersdomainlist) function callWebalizerGetTraffic($logfile, $outputdir, $caption, $usersdomainlist) { - global $settings, $cronlog; + global $settings, $cronlog, $theme; $returnval = 0; if(file_exists($settings['system']['logfiles_directory'] . $logfile . '-access.log')) @@ -305,7 +305,7 @@ function callWebalizerGetTraffic($logfile, $outputdir, $caption, $usersdomainlis function safeSQLLogfile($domains, $loginname) { - global $db, $settings; + global $db, $settings, $theme; $sql = "SELECT * FROM access_log "; $where = "WHERE virtual_host = "; diff --git a/templates/Classic/admin/admins/admins.tpl b/templates/Classic/admin/admins/admins.tpl index 48449c00..fd751480 100644 --- a/templates/Classic/admin/admins/admins.tpl +++ b/templates/Classic/admin/admins/admins.tpl @@ -4,7 +4,7 @@ $header - + @@ -42,4 +42,4 @@ $header

-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/admin/admins/admins_add.tpl b/templates/Classic/admin/admins/admins_add.tpl index 14ba176b..941cc07b 100644 --- a/templates/Classic/admin/admins/admins_add.tpl +++ b/templates/Classic/admin/admins/admins_add.tpl @@ -6,7 +6,7 @@ $header
 {$lng['admin']['admins']} ({$admincount}) {$lng['admin']['admins']} ({$admincount}) {$searchcode}
- + {$admin_add_form}
{$title} {$title}{$title} {$title}
diff --git a/templates/Classic/admin/admins/admins_edit.tpl b/templates/Classic/admin/admins/admins_edit.tpl index 0b79c226..1d5f7492 100644 --- a/templates/Classic/admin/admins/admins_edit.tpl +++ b/templates/Classic/admin/admins/admins_edit.tpl @@ -7,7 +7,7 @@ $header - + {$admin_edit_form}
{$title} {$title}{$title} {$title}
@@ -23,4 +23,4 @@ $header

-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/admin/aps/askyesno.tpl b/templates/Classic/admin/aps/askyesno.tpl index 767c15d8..7a0e231e 100644 --- a/templates/Classic/admin/aps/askyesno.tpl +++ b/templates/Classic/admin/aps/askyesno.tpl @@ -1,6 +1,6 @@ - + ').prependTo(this._elem); + } + else{ + tr = $('').appendTo(this._elem); + } + for (j=0; j0){ + pad = true; + } + else{ + pad = false; + } + } + else{ + if (i == nr -1){ + pad = false; + } + else{ + pad = true; + } + } + rs = (pad) ? this.rowSpacing : '0'; + + td1 = $(''); + td2 = $(''); + if (this.escapeHtml){ + td2.text(lt); + } + else { + td2.html(lt); + } + if (reverse) { + td2.prependTo(tr); + td1.prependTo(tr); + } + else { + td1.appendTo(tr); + td2.appendTo(tr); + } + pad = true; + } + idx++; + } + } + + tr = null; + td1 = null; + td2 = null; + } + } + return this._elem; + }; + + $.jqplot.MekkoLegendRenderer.prototype.pack = function(offsets) { + if (this.show) { + // fake a grid for positioning + var grid = {_top:offsets.top, _left:offsets.left, _right:offsets.right, _bottom:this._plotDimensions.height - offsets.bottom}; + if (this.placement == 'insideGrid') { + switch (this.location) { + case 'nw': + var a = grid._left + this.xoffset; + var b = grid._top + this.yoffset; + this._elem.css('left', a); + this._elem.css('top', b); + break; + case 'n': + var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + var b = grid._top + this.yoffset; + this._elem.css('left', a); + this._elem.css('top', b); + break; + case 'ne': + var a = offsets.right + this.xoffset; + var b = grid._top + this.yoffset; + this._elem.css({right:a, top:b}); + break; + case 'e': + var a = offsets.right + this.xoffset; + var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + this._elem.css({right:a, top:b}); + break; + case 'se': + var a = offsets.right + this.xoffset; + var b = offsets.bottom + this.yoffset; + this._elem.css({right:a, bottom:b}); + break; + case 's': + var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + var b = offsets.bottom + this.yoffset; + this._elem.css({left:a, bottom:b}); + break; + case 'sw': + var a = grid._left + this.xoffset; + var b = offsets.bottom + this.yoffset; + this._elem.css({left:a, bottom:b}); + break; + case 'w': + var a = grid._left + this.xoffset; + var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + this._elem.css({left:a, top:b}); + break; + default: // same as 'se' + var a = grid._right - this.xoffset; + var b = grid._bottom + this.yoffset; + this._elem.css({right:a, bottom:b}); + break; + } + + } + else { + switch (this.location) { + case 'nw': + var a = this._plotDimensions.width - grid._left + this.xoffset; + var b = grid._top + this.yoffset; + this._elem.css('right', a); + this._elem.css('top', b); + break; + case 'n': + var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + var b = this._plotDimensions.height - grid._top + this.yoffset; + this._elem.css('left', a); + this._elem.css('bottom', b); + break; + case 'ne': + var a = this._plotDimensions.width - offsets.right + this.xoffset; + var b = grid._top + this.yoffset; + this._elem.css({left:a, top:b}); + break; + case 'e': + var a = this._plotDimensions.width - offsets.right + this.xoffset; + var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + this._elem.css({left:a, top:b}); + break; + case 'se': + var a = this._plotDimensions.width - offsets.right + this.xoffset; + var b = offsets.bottom + this.yoffset; + this._elem.css({left:a, bottom:b}); + break; + case 's': + var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + var b = this._plotDimensions.height - offsets.bottom + this.yoffset; + this._elem.css({left:a, top:b}); + break; + case 'sw': + var a = this._plotDimensions.width - grid._left + this.xoffset; + var b = offsets.bottom + this.yoffset; + this._elem.css({right:a, bottom:b}); + break; + case 'w': + var a = this._plotDimensions.width - grid._left + this.xoffset; + var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + this._elem.css({right:a, top:b}); + break; + default: // same as 'se' + var a = grid._right - this.xoffset; + var b = grid._bottom + this.yoffset; + this._elem.css({right:a, bottom:b}); + break; + } + } + } + }; + + // setup default renderers for axes and legend so user doesn't have to + // called with scope of plot + function preInit(target, data, options) { + options = options || {}; + options.axesDefaults = options.axesDefaults || {}; + options.legend = options.legend || {}; + options.seriesDefaults = options.seriesDefaults || {}; + var setopts = false; + if (options.seriesDefaults.renderer == $.jqplot.MekkoRenderer) { + setopts = true; + } + else if (options.series) { + for (var i=0; i < options.series.length; i++) { + if (options.series[i].renderer == $.jqplot.MekkoRenderer) { + setopts = true; + } + } + } + + if (setopts) { + options.axesDefaults.renderer = $.jqplot.MekkoAxisRenderer; + options.legend.renderer = $.jqplot.MekkoLegendRenderer; + options.legend.preDraw = true; + } + } + + $.jqplot.preInitHooks.push(preInit); + +})(jQuery); \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.mekkoRenderer.min.js b/templates/Froxlor/assets/js/plugins/jqplot.mekkoRenderer.min.js new file mode 100644 index 00000000..bb53e5f5 --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.mekkoRenderer.min.js @@ -0,0 +1,30 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function(b){b.jqplot.MekkoRenderer=function(){this.shapeRenderer=new b.jqplot.ShapeRenderer();this.borderColor=null;this.showBorders=true};b.jqplot.MekkoRenderer.prototype.init=function(c,e){this.fill=false;this.fillRect=true;this.strokeRect=true;this.shadow=false;this._xwidth=0;this._xstart=0;b.extend(true,this.renderer,c);var d={lineJoin:"miter",lineCap:"butt",isarc:false,fillRect:this.fillRect,strokeRect:this.strokeRect};this.renderer.shapeRenderer.init(d);e.axes.x2axis._series.push(this);this._type="mekko"};b.jqplot.MekkoRenderer.prototype.setGridData=function(h){var e=this._xaxis.series_u2p;var c=this._yaxis.series_u2p;var g=this._plotData;this.gridData=[];this._xwidth=e(this._sumy)-e(0);if(this.index>0){this._xstart=h.series[this.index-1]._xstart+h.series[this.index-1]._xwidth}var l=this.canvas.getHeight();var d=0;var k;var j;for(var f=0;f
$Message
diff --git a/templates/Classic/admin/aps/infobox.tpl b/templates/Classic/admin/aps/infobox.tpl index bf515fd5..e8db19bf 100644 --- a/templates/Classic/admin/aps/infobox.tpl +++ b/templates/Classic/admin/aps/infobox.tpl @@ -1,6 +1,6 @@ - +
$Message
diff --git a/templates/Classic/admin/aps/manage_instances.tpl b/templates/Classic/admin/aps/manage_instances.tpl index 8a3ace35..cf408e69 100644 --- a/templates/Classic/admin/aps/manage_instances.tpl +++ b/templates/Classic/admin/aps/manage_instances.tpl @@ -1,6 +1,6 @@ - + @@ -15,7 +15,7 @@
 {$lng['aps']['specialoptions']} {$lng['aps']['specialoptions']}
{$lng['aps']['statistics']}
- + diff --git a/templates/Classic/admin/aps/manage_packages.tpl b/templates/Classic/admin/aps/manage_packages.tpl index 74cbfc5c..fe2f28f0 100644 --- a/templates/Classic/admin/aps/manage_packages.tpl +++ b/templates/Classic/admin/aps/manage_packages.tpl @@ -1,6 +1,6 @@
 {$lng['aps']['manageinstances']} {$lng['aps']['manageinstances']}
{$lng['aps']['packagenameandstatus']}
- + @@ -50,7 +50,7 @@
 {$lng['aps']['specialoptions']} {$lng['aps']['specialoptions']}
{$lng['admin']['phpsettings']['actions']}
- + diff --git a/templates/Classic/admin/aps/manage_packages_download.tpl b/templates/Classic/admin/aps/manage_packages_download.tpl index 4db78e95..131e6266 100644 --- a/templates/Classic/admin/aps/manage_packages_download.tpl +++ b/templates/Classic/admin/aps/manage_packages_download.tpl @@ -1,6 +1,6 @@
 {$lng['aps']['managepackages']} {$lng['aps']['managepackages']}
{$lng['aps']['packagenameandversion']}
- + @@ -16,4 +16,4 @@
 {$lng['aps']['specialoptions']} {$lng['aps']['specialoptions']}
{$lng['admin']['phpsettings']['actions']}

-
\ No newline at end of file +
diff --git a/templates/Classic/admin/aps/upload.tpl b/templates/Classic/admin/aps/upload.tpl index 854f6efb..f6133442 100644 --- a/templates/Classic/admin/aps/upload.tpl +++ b/templates/Classic/admin/aps/upload.tpl @@ -4,7 +4,7 @@ - + @@ -16,4 +16,4 @@
 {$lng['aps']['upload']} {$lng['aps']['upload']}
{$lng['aps']['upload_description']} http://www.apsstandard.org/
-
\ No newline at end of file + diff --git a/templates/Classic/admin/configfiles/choose.tpl b/templates/Classic/admin/configfiles/choose.tpl index 472d4cd2..56164e45 100644 --- a/templates/Classic/admin/configfiles/choose.tpl +++ b/templates/Classic/admin/configfiles/choose.tpl @@ -1,10 +1,10 @@ $header - + $distributions
 {$lng['admin']['configfiles']['serverconfiguration']} [getLink(array('section' => 'configfiles', 'page' => 'configfiles'))}">{$lng['admin']['configfiles']['wizard']}] {$lng['admin']['configfiles']['serverconfiguration']} [getLink(array('section' => 'configfiles', 'page' => 'configfiles'))}">{$lng['admin']['configfiles']['wizard']}]


-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/admin/configfiles/configfiles.tpl b/templates/Classic/admin/configfiles/configfiles.tpl index b1b94646..870585fa 100644 --- a/templates/Classic/admin/configfiles/configfiles.tpl +++ b/templates/Classic/admin/configfiles/configfiles.tpl @@ -1,7 +1,7 @@ $header - + {$configpage} @@ -12,4 +12,4 @@ $header
 {$configfiles[$distribution]['label']} » {$configfiles[$distribution]['services'][$service]['label']} » {$configfiles[$distribution]['services'][$service]['daemons'][$daemon]['label']} [{$lng['panel']['back']}] {$configfiles[$distribution]['label']} » {$configfiles[$distribution]['services'][$service]['label']} » {$configfiles[$distribution]['services'][$service]['daemons'][$daemon]['label']} [{$lng['panel']['back']}]


-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/admin/configfiles/wizard.tpl b/templates/Classic/admin/configfiles/wizard.tpl index 51ddce6b..de33f0e3 100644 --- a/templates/Classic/admin/configfiles/wizard.tpl +++ b/templates/Classic/admin/configfiles/wizard.tpl @@ -4,7 +4,7 @@ $header - + @@ -25,4 +25,4 @@ $header

-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/admin/cronjobs/cronjob_edit.tpl b/templates/Classic/admin/cronjobs/cronjob_edit.tpl index 782e667b..09d22d92 100644 --- a/templates/Classic/admin/cronjobs/cronjob_edit.tpl +++ b/templates/Classic/admin/cronjobs/cronjob_edit.tpl @@ -7,7 +7,7 @@ $header
 {$lng['admin']['configfiles']['serverconfiguration']} [{$lng['admin']['configfiles']['overview']}] {$lng['admin']['configfiles']['serverconfiguration']} [{$lng['admin']['configfiles']['overview']}]
{$lng['admin']['configfiles']['distribution']}:
- + {$cronjobs_edit_form}
{$title} {$title}{$title} {$title}
diff --git a/templates/Classic/admin/cronjobs/cronjobs.tpl b/templates/Classic/admin/cronjobs/cronjobs.tpl index bd744c71..d3c1dc34 100644 --- a/templates/Classic/admin/cronjobs/cronjobs.tpl +++ b/templates/Classic/admin/cronjobs/cronjobs.tpl @@ -4,7 +4,7 @@ $header - +
 {$lng['admin']['warning']} {$lng['admin']['warning']}
@@ -18,7 +18,7 @@ $header
- + diff --git a/templates/Classic/admin/customers/customers.tpl b/templates/Classic/admin/customers/customers.tpl index cf79a4ba..18a59807 100644 --- a/templates/Classic/admin/customers/customers.tpl +++ b/templates/Classic/admin/customers/customers.tpl @@ -4,7 +4,7 @@ $header
 {$lng['admin']['cron']['cronsettings']} {$lng['admin']['cron']['cronsettings']}
{$lng['cron']['description']}
- + diff --git a/templates/Classic/admin/customers/customers_add.tpl b/templates/Classic/admin/customers/customers_add.tpl index b195443d..396f2f07 100644 --- a/templates/Classic/admin/customers/customers_add.tpl +++ b/templates/Classic/admin/customers/customers_add.tpl @@ -6,7 +6,7 @@ $header
 {$lng['admin']['customers']} ({$customercount}) {$lng['admin']['customers']} ({$customercount}) {$searchcode}
- + {$customer_add_form}
{$title} {$title}{$title} {$title}
diff --git a/templates/Classic/admin/customers/customers_edit.tpl b/templates/Classic/admin/customers/customers_edit.tpl index a2b3d3ac..1deb8636 100644 --- a/templates/Classic/admin/customers/customers_edit.tpl +++ b/templates/Classic/admin/customers/customers_edit.tpl @@ -7,7 +7,7 @@ $header - + {$customer_edit_form}
 {$title} {$title}
diff --git a/templates/Classic/admin/domains/domains.tpl b/templates/Classic/admin/domains/domains.tpl index 7622319f..e9ac9c11 100644 --- a/templates/Classic/admin/domains/domains.tpl +++ b/templates/Classic/admin/domains/domains.tpl @@ -4,7 +4,7 @@ $header - + @@ -38,4 +38,4 @@ $header

-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/admin/domains/domains_add.tpl b/templates/Classic/admin/domains/domains_add.tpl index 78a6fead..293dc204 100644 --- a/templates/Classic/admin/domains/domains_add.tpl +++ b/templates/Classic/admin/domains/domains_add.tpl @@ -6,7 +6,7 @@ $header
 {$lng['admin']['domains']} ({$domainscount}) {$lng['admin']['domains']} ({$domainscount}) {$searchcode}
- + {$domain_add_form}
{$title} {$title}{$title} {$title}
diff --git a/templates/Classic/admin/domains/domains_edit.tpl b/templates/Classic/admin/domains/domains_edit.tpl index ec339ec4..025278bc 100644 --- a/templates/Classic/admin/domains/domains_edit.tpl +++ b/templates/Classic/admin/domains/domains_edit.tpl @@ -7,7 +7,7 @@ $header - + {$domain_edit_form}
 {$title} {$title}
diff --git a/templates/Classic/admin/froxlorclients/froxlorclient_settings.tpl b/templates/Classic/admin/froxlorclients/froxlorclient_settings.tpl index de003662..e639c4e9 100644 --- a/templates/Classic/admin/froxlorclients/froxlorclient_settings.tpl +++ b/templates/Classic/admin/froxlorclients/froxlorclient_settings.tpl @@ -1,6 +1,6 @@ - $fields diff --git a/templates/Classic/admin/froxlorclients/froxlorclient_settingsoverview.tpl b/templates/Classic/admin/froxlorclients/froxlorclient_settingsoverview.tpl index 6bdf2e2b..c5c579b4 100644 --- a/templates/Classic/admin/froxlorclients/froxlorclient_settingsoverview.tpl +++ b/templates/Classic/admin/froxlorclients/froxlorclient_settingsoverview.tpl @@ -1,7 +1,7 @@
 {$lng['admin']['froxlorclient_settings']} "{$client->Get('name')}" +  {$lng['admin']['froxlorclient_settings']} "{$client->Get('name')}" [{$lng['admin']['configfiles']['compactoverview']}]
diff --git a/templates/Classic/admin/froxlorclients/froxlorclient_settingsoverviewgroup.tpl b/templates/Classic/admin/froxlorclients/froxlorclient_settingsoverviewgroup.tpl index d331b732..0c0434a9 100644 --- a/templates/Classic/admin/froxlorclients/froxlorclient_settingsoverviewgroup.tpl +++ b/templates/Classic/admin/froxlorclients/froxlorclient_settingsoverviewgroup.tpl @@ -1,6 +1,6 @@ ').prependTo(this._elem)}else{o=e('').appendTo(this._elem)}for(C=0;C0){E=true}else{E=false}}else{if(D==m-1){E=false}else{E=true}}v=(E)?this.rowSpacing:"0";r=e('');q=e('');if(this.escapeHtml){q.text(t)}else{q.html(t)}if(w){q.prependTo(o);r.prependTo(o)}else{r.appendTo(o);q.appendTo(o)}E=true}z++}}}}return this._elem};function c(q,p,n){n=n||{};n.axesDefaults=n.axesDefaults||{};n.legend=n.legend||{};n.seriesDefaults=n.seriesDefaults||{};var m=false;if(n.seriesDefaults.renderer==e.jqplot.FunnelRenderer){m=true}else{if(n.series){for(var o=0;o + * + * A tooltip providing information about the data point is enabled by default. + * To disable the tooltip, set "showTooltip" to false. + * + * You can control what data is displayed in the tooltip with various + * options. The "tooltipAxes" option controls wether the x, y or both + * data values are displayed. + * + * Some chart types (e.g. hi-low-close) have more than one y value per + * data point. To display the additional values in the tooltip, set the + * "yvalues" option to the desired number of y values present (3 for a hlc chart). + * + * By default, data values will be formatted with the same formatting + * specifiers as used to format the axis ticks. A custom format code + * can be supplied with the tooltipFormatString option. This will apply + * to all values in the tooltip. + * + * For more complete control, the "formatString" option can be set. This + * Allows conplete control over tooltip formatting. Values are passed to + * the format string in an order determined by the "tooltipAxes" and "yvalues" + * options. So, if you have a hi-low-close chart and you just want to display + * the hi-low-close values in the tooltip, you could set a formatString like: + * + * > highlighter: { + * > tooltipAxes: 'y', + * > yvalues: 3, + * > formatString:'
-  {$lng['admin']['configfiles']['serverconfiguration']} "{$client->Get('name')}" +  {$lng['admin']['configfiles']['serverconfiguration']} "{$client->Get('name')}" [{$lng['admin']['configfiles']['overview']}]
-  {$title} +  {$title} {$option} diff --git a/templates/Classic/admin/froxlorclients/froxlorclients.tpl b/templates/Classic/admin/froxlorclients/froxlorclients.tpl index 60ee1a94..0747f5b3 100644 --- a/templates/Classic/admin/froxlorclients/froxlorclients.tpl +++ b/templates/Classic/admin/froxlorclients/froxlorclients.tpl @@ -4,7 +4,7 @@ $header - + diff --git a/templates/Classic/admin/froxlorclients/froxlorclients_add.tpl b/templates/Classic/admin/froxlorclients/froxlorclients_add.tpl index 71ceac19..f3cad1d6 100644 --- a/templates/Classic/admin/froxlorclients/froxlorclients_add.tpl +++ b/templates/Classic/admin/froxlorclients/froxlorclients_add.tpl @@ -5,7 +5,7 @@ $header
 {$lng['menue']['multiserver']['clients']} {$lng['menue']['multiserver']['clients']} {$searchcode}
- + + Client #{$row['id']} diff --git a/templates/Classic/admin/froxlorclients/froxlorclients_edit.tpl b/templates/Classic/admin/froxlorclients/froxlorclients_edit.tpl index 54c90f65..3af4c5a5 100644 --- a/templates/Classic/admin/froxlorclients/froxlorclients_edit.tpl +++ b/templates/Classic/admin/froxlorclients/froxlorclients_edit.tpl @@ -7,7 +7,7 @@ $header
 {$lng['admin']['froxlorclients']['add']} {$lng['admin']['froxlorclients']['add']}
@@ -15,7 +15,7 @@ $header
-  {$lng['admin']['froxlorclients']['client']} +  {$lng['admin']['froxlorclients']['client']} diff --git a/templates/Classic/admin/froxlorclients/froxlorclients_client.tpl b/templates/Classic/admin/froxlorclients/froxlorclients_client.tpl index 2d0ec74d..b7b5c695 100644 --- a/templates/Classic/admin/froxlorclients/froxlorclients_client.tpl +++ b/templates/Classic/admin/froxlorclients/froxlorclients_client.tpl @@ -1,17 +1,17 @@
- Client #{$row['id']} {$row['name']}
{$row['desc']}
- {$lng['panel']['yes']} + {$lng['panel']['yes']} - {$lng['panel']['no']} + {$lng['panel']['no']} - {$lng['admin']['froxlorclients']['view']} + {$lng['admin']['froxlorclients']['view']}
- + ').prependTo(this._elem); + } + else{ + tr = $('').appendTo(this._elem); + } + for (j=0; j0){ + pad = true; + } + else{ + pad = false; + } + } + else{ + if (i == nr -1){ + pad = false; + } + else{ + pad = true; + } + } + rs = (pad) ? this.rowSpacing : '0'; + + td1 = $(''); + td2 = $(''); + if (this.escapeHtml){ + td2.text(lt); + } + else { + td2.html(lt); + } + if (reverse) { + td2.prependTo(tr); + td1.prependTo(tr); + } + else { + td1.appendTo(tr); + td2.appendTo(tr); + } + pad = true; + } + idx++; + } + } + } + } + return this._elem; + }; + + // $.jqplot.FunnelLegendRenderer.prototype.pack = function(offsets) { + // if (this.show) { + // // fake a grid for positioning + // var grid = {_top:offsets.top, _left:offsets.left, _right:offsets.right, _bottom:this._plotDimensions.height - offsets.bottom}; + // if (this.placement == 'insideGrid') { + // switch (this.location) { + // case 'nw': + // var a = grid._left + this.xoffset; + // var b = grid._top + this.yoffset; + // this._elem.css('left', a); + // this._elem.css('top', b); + // break; + // case 'n': + // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + // var b = grid._top + this.yoffset; + // this._elem.css('left', a); + // this._elem.css('top', b); + // break; + // case 'ne': + // var a = offsets.right + this.xoffset; + // var b = grid._top + this.yoffset; + // this._elem.css({right:a, top:b}); + // break; + // case 'e': + // var a = offsets.right + this.xoffset; + // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + // this._elem.css({right:a, top:b}); + // break; + // case 'se': + // var a = offsets.right + this.xoffset; + // var b = offsets.bottom + this.yoffset; + // this._elem.css({right:a, bottom:b}); + // break; + // case 's': + // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + // var b = offsets.bottom + this.yoffset; + // this._elem.css({left:a, bottom:b}); + // break; + // case 'sw': + // var a = grid._left + this.xoffset; + // var b = offsets.bottom + this.yoffset; + // this._elem.css({left:a, bottom:b}); + // break; + // case 'w': + // var a = grid._left + this.xoffset; + // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + // this._elem.css({left:a, top:b}); + // break; + // default: // same as 'se' + // var a = grid._right - this.xoffset; + // var b = grid._bottom + this.yoffset; + // this._elem.css({right:a, bottom:b}); + // break; + // } + // + // } + // else { + // switch (this.location) { + // case 'nw': + // var a = this._plotDimensions.width - grid._left + this.xoffset; + // var b = grid._top + this.yoffset; + // this._elem.css('right', a); + // this._elem.css('top', b); + // break; + // case 'n': + // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + // var b = this._plotDimensions.height - grid._top + this.yoffset; + // this._elem.css('left', a); + // this._elem.css('bottom', b); + // break; + // case 'ne': + // var a = this._plotDimensions.width - offsets.right + this.xoffset; + // var b = grid._top + this.yoffset; + // this._elem.css({left:a, top:b}); + // break; + // case 'e': + // var a = this._plotDimensions.width - offsets.right + this.xoffset; + // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + // this._elem.css({left:a, top:b}); + // break; + // case 'se': + // var a = this._plotDimensions.width - offsets.right + this.xoffset; + // var b = offsets.bottom + this.yoffset; + // this._elem.css({left:a, bottom:b}); + // break; + // case 's': + // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + // var b = this._plotDimensions.height - offsets.bottom + this.yoffset; + // this._elem.css({left:a, top:b}); + // break; + // case 'sw': + // var a = this._plotDimensions.width - grid._left + this.xoffset; + // var b = offsets.bottom + this.yoffset; + // this._elem.css({right:a, bottom:b}); + // break; + // case 'w': + // var a = this._plotDimensions.width - grid._left + this.xoffset; + // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + // this._elem.css({right:a, top:b}); + // break; + // default: // same as 'se' + // var a = grid._right - this.xoffset; + // var b = grid._bottom + this.yoffset; + // this._elem.css({right:a, bottom:b}); + // break; + // } + // } + // } + // }; + + // setup default renderers for axes and legend so user doesn't have to + // called with scope of plot + function preInit(target, data, options) { + options = options || {}; + options.axesDefaults = options.axesDefaults || {}; + options.legend = options.legend || {}; + options.seriesDefaults = options.seriesDefaults || {}; + // only set these if there is a funnel series + var setopts = false; + if (options.seriesDefaults.renderer == $.jqplot.FunnelRenderer) { + setopts = true; + } + else if (options.series) { + for (var i=0; i < options.series.length; i++) { + if (options.series[i].renderer == $.jqplot.FunnelRenderer) { + setopts = true; + } + } + } + + if (setopts) { + options.axesDefaults.renderer = $.jqplot.FunnelAxisRenderer; + options.legend.renderer = $.jqplot.FunnelLegendRenderer; + options.legend.preDraw = true; + options.sortData = false; + options.seriesDefaults.pointLabels = {show: false}; + } + } + + function postInit(target, data, options) { + // if multiple series, add a reference to the previous one so that + // funnel rings can nest. + for (var i=0; i570)?m[n]*0.8:m[n]+0.4*(255-m[n]);m[n]=parseInt(m[n],10)}this.highlightColors.push("rgb("+m[0]+","+m[1]+","+m[2]+")")}}t.postParseOptionsHooks.addOnce(k);t.postInitHooks.addOnce(g);t.eventListenerHooks.addOnce("jqplotMouseMove",a);t.eventListenerHooks.addOnce("jqplotMouseDown",b);t.eventListenerHooks.addOnce("jqplotMouseUp",j);t.eventListenerHooks.addOnce("jqplotClick",f);t.eventListenerHooks.addOnce("jqplotRightClick",l);t.postDrawHooks.addOnce(h)};e.jqplot.FunnelRenderer.prototype.setGridData=function(o){var n=0;var p=[];for(var m=0;mthis._lengths[Y]*n&&W<100){this._lengths[Y]=this._areas[Y]/(this._bases[Y]-this._lengths[Y]*Math.tan(this._angle));aa=Math.abs(this._lengths[Y]-E);this._bases[Y+1]=this._bases[Y]-(2*this._lengths[Y]*Math.tan(this._angle));E=this._lengths[Y];W++}Q+=this._lengths[Y]}this._vertices=new Array(B.length);var ae=[t,F],ad=[t+this._bases[0],F],ac=[t+(this._bases[0]-this._bases[this._bases.length-1])/2,F+this._length],ab=[ac[0]+this._bases[this._bases.length-1],ac[1]];function V(ag){var x=(ae[1]-ac[1])/(ae[0]-ac[0]);var v=ae[1]-x*ae[0];var ah=ag+ae[1];return[(ah-v)/x,ah]}function D(ag){var x=(ad[1]-ab[1])/(ad[0]-ab[0]);var v=ad[1]-x*ad[0];var ah=ag+ad[1];return[(ah-v)/x,ah]}var T=w,S=u;var Z=0,m=0;for(Y=0;Y0&&Y0&&Y=this.dataLabelThreshold){var K,X;if(this.dataLabels=="label"){K=this.dataLabelFormatString||"%s";X=e.jqplot.sprintf(K,B[Y][0])}else{if(this.dataLabels=="value"){K=this.dataLabelFormatString||"%d";X=e.jqplot.sprintf(K,this.data[Y][1])}else{if(this.dataLabels=="percent"){K=this.dataLabelFormatString||"%d%%";X=e.jqplot.sprintf(K,B[Y][1]*100)}else{if(this.dataLabels.constructor==Array){K=this.dataLabelFormatString||"%s";X=e.jqplot.sprintf(K,this.dataLabels[this._dataIndices[Y]])}}}}var s=(this._radius)*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge;var T=(U[0][0]+U[1][0])/2+this.canvas._offsets.left;var S=(U[1][1]+U[2][1])/2+this.canvas._offsets.top;var z=e(''+X+"").insertBefore(p.eventCanvas._elem);T-=z.width()/2;S-=z.height()/2;T=Math.round(T);S=Math.round(S);z.css({left:T,top:S})}}};e.jqplot.FunnelAxisRenderer=function(){e.jqplot.LinearAxisRenderer.call(this)};e.jqplot.FunnelAxisRenderer.prototype=new e.jqplot.LinearAxisRenderer();e.jqplot.FunnelAxisRenderer.prototype.constructor=e.jqplot.FunnelAxisRenderer;e.jqplot.FunnelAxisRenderer.prototype.init=function(m){this.tickRenderer=e.jqplot.FunnelTickRenderer;e.extend(true,this,m);this._dataBounds={min:0,max:100};this.min=0;this.max=100;this.showTicks=false;this.ticks=[];this.showMark=false;this.show=false};e.jqplot.FunnelLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)};e.jqplot.FunnelLegendRenderer.prototype=new e.jqplot.TableLegendRenderer();e.jqplot.FunnelLegendRenderer.prototype.constructor=e.jqplot.FunnelLegendRenderer;e.jqplot.FunnelLegendRenderer.prototype.init=function(m){this.numberRows=null;this.numberColumns=null;e.extend(true,this,m)};e.jqplot.FunnelLegendRenderer.prototype.draw=function(){var p=this;if(this.show){var x=this._series;var A="position:absolute;";A+=(this.background)?"background:"+this.background+";":"";A+=(this.border)?"border:"+this.border+";":"";A+=(this.fontSize)?"font-size:"+this.fontSize+";":"";A+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";A+=(this.textColor)?"color:"+this.textColor+";":"";A+=(this.marginTop!=null)?"margin-top:"+this.marginTop+";":"";A+=(this.marginBottom!=null)?"margin-bottom:"+this.marginBottom+";":"";A+=(this.marginLeft!=null)?"margin-left:"+this.marginLeft+";":"";A+=(this.marginRight!=null)?"margin-right:"+this.marginRight+";":"";this._elem=e('
 {$lng['admin']['froxlorclients']['edit']} {$lng['admin']['froxlorclients']['edit']}
@@ -17,7 +17,7 @@ $header
-  {$lng['admin']['froxlorclients']['client']} +  {$lng['admin']['froxlorclients']['client']} diff --git a/templates/Classic/admin/froxlorclients/froxlorclients_view.tpl b/templates/Classic/admin/froxlorclients/froxlorclients_view.tpl index 346cdfa2..3bf2e02e 100644 --- a/templates/Classic/admin/froxlorclients/froxlorclients_view.tpl +++ b/templates/Classic/admin/froxlorclients/froxlorclients_view.tpl @@ -4,7 +4,7 @@ $header - + diff --git a/templates/Classic/admin/index/change_language.tpl b/templates/Classic/admin/index/change_language.tpl index 92b61b6c..dbdcf870 100644 --- a/templates/Classic/admin/index/change_language.tpl +++ b/templates/Classic/admin/index/change_language.tpl @@ -4,10 +4,10 @@ $header
 {$lng['menue']['multiserver']['clients']} "{$client->Get('name')}" {$lng['menue']['multiserver']['clients']} "{$client->Get('name')}"
@TODO infos about client "{$client->Get('name')}"
- + - + @@ -20,4 +20,4 @@ $header

-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/admin/index/change_password.tpl b/templates/Classic/admin/index/change_password.tpl index 9894b62b..2f1c21ad 100644 --- a/templates/Classic/admin/index/change_password.tpl +++ b/templates/Classic/admin/index/change_password.tpl @@ -4,10 +4,10 @@ $header
 {$lng['menue']['main']['changelanguage']} {$lng['menue']['main']['changelanguage']}
{$lng['login']['language']}
- + - + @@ -28,4 +28,4 @@ $header

-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/admin/index/change_theme.tpl b/templates/Classic/admin/index/change_theme.tpl index a2d84a21..bee7f614 100644 --- a/templates/Classic/admin/index/change_theme.tpl +++ b/templates/Classic/admin/index/change_theme.tpl @@ -4,10 +4,10 @@ $header
 {$lng['menue']['main']['changepassword']} {$lng['menue']['main']['changepassword']}
{$lng['changepassword']['old_password']}
- + - + diff --git a/templates/Classic/admin/index/index.tpl b/templates/Classic/admin/index/index.tpl index 364a5e9b..ce75809d 100644 --- a/templates/Classic/admin/index/index.tpl +++ b/templates/Classic/admin/index/index.tpl @@ -1,7 +1,7 @@ $header
 {$lng['menue']['main']['changetheme']} {$lng['menue']['main']['changetheme']}
{$lng['panel']['theme']}
- + @@ -78,7 +78,7 @@ $header - + @@ -121,9 +121,9 @@ $header - + - {$outstanding_tasks} + {$outstanding_tasks} {$cron_last_runs} diff --git a/templates/Classic/admin/ipsandports/ipsandports.tpl b/templates/Classic/admin/ipsandports/ipsandports.tpl index 6f3c63e0..d64fce4a 100644 --- a/templates/Classic/admin/ipsandports/ipsandports.tpl +++ b/templates/Classic/admin/ipsandports/ipsandports.tpl @@ -4,7 +4,7 @@ $header
 {$lng['admin']['ressourcedetails']} {$lng['admin']['ressourcedetails']}
{$lng['admin']['customers']}:
 {$lng['admin']['systemdetails']} {$lng['admin']['systemdetails']}
{$lng['admin']['serversoftware']}:
 {$lng['admin']['froxlordetails']} {$lng['admin']['froxlordetails']}
{$lng['admin']['installedversion']}:
- + diff --git a/templates/Classic/admin/ipsandports/ipsandports_add.tpl b/templates/Classic/admin/ipsandports/ipsandports_add.tpl index 459b29c6..9987f54d 100644 --- a/templates/Classic/admin/ipsandports/ipsandports_add.tpl +++ b/templates/Classic/admin/ipsandports/ipsandports_add.tpl @@ -6,7 +6,7 @@ $header
 {$lng['admin']['ipsandports']['ipsandports']} {$lng['admin']['ipsandports']['ipsandports']} {$searchcode}
- + {$ipsandports_add_form}
{$title} {$title}{$title} {$title}
diff --git a/templates/Classic/admin/ipsandports/ipsandports_edit.tpl b/templates/Classic/admin/ipsandports/ipsandports_edit.tpl index b8c9ed65..c56269a7 100644 --- a/templates/Classic/admin/ipsandports/ipsandports_edit.tpl +++ b/templates/Classic/admin/ipsandports/ipsandports_edit.tpl @@ -7,7 +7,7 @@ $header - + {$ipsandports_edit_form}
{$title} {$title}{$title} {$title}
diff --git a/templates/Classic/admin/logger/logger.tpl b/templates/Classic/admin/logger/logger.tpl index 24499265..ee187efb 100644 --- a/templates/Classic/admin/logger/logger.tpl +++ b/templates/Classic/admin/logger/logger.tpl @@ -5,7 +5,7 @@ $header - + @@ -27,4 +27,4 @@ $header

-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/admin/message/message.tpl b/templates/Classic/admin/message/message.tpl index 03fb2e6a..b960d6f2 100644 --- a/templates/Classic/admin/message/message.tpl +++ b/templates/Classic/admin/message/message.tpl @@ -14,7 +14,7 @@ $header
 {$lng['menue']['logger']['logger']} {$lng['menue']['logger']['logger']} {$searchcode}
- + diff --git a/templates/Classic/admin/phpconfig/overview.tpl b/templates/Classic/admin/phpconfig/overview.tpl index 5944eafa..0582453b 100644 --- a/templates/Classic/admin/phpconfig/overview.tpl +++ b/templates/Classic/admin/phpconfig/overview.tpl @@ -1,7 +1,7 @@ $header
 {$lng['admin']['message']} {$lng['admin']['message']}
{$lng['admin']['receipient']}
- + diff --git a/templates/Classic/admin/phpconfig/overview_add.tpl b/templates/Classic/admin/phpconfig/overview_add.tpl index 95d771be..018bef65 100644 --- a/templates/Classic/admin/phpconfig/overview_add.tpl +++ b/templates/Classic/admin/phpconfig/overview_add.tpl @@ -6,7 +6,7 @@ $header
 {$lng['menue']['phpsettings']['maintitle']} {$lng['menue']['phpsettings']['maintitle']}  
- + {$phpconfig_add_form}
{$title} {$title}{$title} {$title}
@@ -15,7 +15,7 @@ $header
- + diff --git a/templates/Classic/admin/phpconfig/overview_edit.tpl b/templates/Classic/admin/phpconfig/overview_edit.tpl index 871b1845..0ee6760b 100644 --- a/templates/Classic/admin/phpconfig/overview_edit.tpl +++ b/templates/Classic/admin/phpconfig/overview_edit.tpl @@ -7,7 +7,7 @@ $header
  {$lng['admin']['phpconfig']['template_replace_vars']}  {$lng['admin']['phpconfig']['template_replace_vars']}
{SAFE_MODE}
- + {$phpconfig_edit_form}
{$title} {$title}{$title} {$title}
@@ -16,7 +16,7 @@ $header
- + diff --git a/templates/Classic/admin/settings/settings.tpl b/templates/Classic/admin/settings/settings.tpl index a315a55d..ecafc7ea 100644 --- a/templates/Classic/admin/settings/settings.tpl +++ b/templates/Classic/admin/settings/settings.tpl @@ -1,6 +1,6 @@
  {$lng['admin']['phpconfig']['template_replace_vars']}  {$lng['admin']['phpconfig']['template_replace_vars']}
{SAFE_MODE}
- $fields diff --git a/templates/Classic/admin/settings/settings_group.tpl b/templates/Classic/admin/settings/settings_group.tpl index c35e9594..2b52e513 100644 --- a/templates/Classic/admin/settings/settings_group.tpl +++ b/templates/Classic/admin/settings/settings_group.tpl @@ -1,6 +1,6 @@ ').prependTo(this._elem)}else{d=b('').appendTo(this._elem)}for(t=0;t0){w=true}else{w=false}}else{if(v==c-1){w=false}else{w=true}}l=(w)?this.rowSpacing:"0";g=b('');f=b('');if(this.escapeHtml){f.text(h)}else{f.html(h)}if(m){if(this.showLabels){f.prependTo(d)}if(this.showSwatches){g.prependTo(d)}}else{if(this.showSwatches){g.appendTo(d)}if(this.showLabels){f.appendTo(d)}}if(this.seriesToggle){var u;if(typeof(this.seriesToggle)=="string"||typeof(this.seriesToggle)=="number"){if(!b.jqplot.use_excanvas||!this.disableIEFading){u=this.seriesToggle}}if(this.showSwatches){g.bind("click",{series:o,speed:u},o.toggleDisplay);g.addClass("jqplot-seriesToggle")}if(this.showLabels){f.bind("click",{series:o,speed:u},o.toggleDisplay);f.addClass("jqplot-seriesToggle")}}w=true}}p++}}}return this._elem};var a=function(){if(this.legend.renderer.constructor==b.jqplot.EnhancedLegendRenderer&&this.legend.seriesToggle){var c=this.legend._elem.detach();this.eventCanvas._elem.after(c)}}})(jQuery); \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.funnelRenderer.js b/templates/Froxlor/assets/js/plugins/jqplot.funnelRenderer.js new file mode 100644 index 00000000..e1cefd96 --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.funnelRenderer.js @@ -0,0 +1,938 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + /** + * Class: $.jqplot.FunnelRenderer + * Plugin renderer to draw a funnel chart. + * x values, if present, will be used as labels. + * y values give area size. + * + * Funnel charts will draw a single series + * only. + * + * To use this renderer, you need to include the + * funnel renderer plugin, for example: + * + * > + * + * Properties described here are passed into the $.jqplot function + * as options on the series renderer. For example: + * + * > plot2 = $.jqplot('chart2', [s1, s2], { + * > seriesDefaults: { + * > renderer:$.jqplot.FunnelRenderer, + * > rendererOptions:{ + * > sectionMargin: 12, + * > widthRatio: 0.3 + * > } + * > } + * > }); + * + * IMPORTANT + * + * *The funnel renderer will reorder data in descending order* so the largest value in + * the data set is first and displayed on top of the funnel. Data will then + * be displayed in descending order down the funnel. The area of each funnel + * section will correspond to the value of each data point relative to the sum + * of all values. That is section area is proportional to section value divided by + * sum of all section values. + * + * If your data is not in descending order when passed into the plot, *it will be + * reordered* when stored in the series.data property. A copy of the unordered + * data is kept in the series._unorderedData property. + * + * A funnel plot will trigger events on the plot target + * according to user interaction. All events return the event object, + * the series index, the point (section) index, and the point data for + * the appropriate section. *Note* the point index will referr to the ordered + * data, not the original unordered data. + * + * 'jqplotDataMouseOver' - triggered when mousing over a section. + * 'jqplotDataHighlight' - triggered the first time user mouses over a section, + * if highlighting is enabled. + * 'jqplotDataUnhighlight' - triggered when a user moves the mouse out of + * a highlighted section. + * 'jqplotDataClick' - triggered when the user clicks on a section. + * 'jqplotDataRightClick' - tiggered when the user right clicks on a section if + * the "captureRightClick" option is set to true on the plot. + */ + $.jqplot.FunnelRenderer = function(){ + $.jqplot.LineRenderer.call(this); + }; + + $.jqplot.FunnelRenderer.prototype = new $.jqplot.LineRenderer(); + $.jqplot.FunnelRenderer.prototype.constructor = $.jqplot.FunnelRenderer; + + // called with scope of a series + $.jqplot.FunnelRenderer.prototype.init = function(options, plot) { + // Group: Properties + // + // prop: padding + // padding between the funnel and plot edges, legend, etc. + this.padding = {top: 20, right: 20, bottom: 20, left: 20}; + // prop: sectionMargin + // spacing between funnel sections in pixels. + this.sectionMargin = 6; + // prop: fill + // true or false, wether to fill the areas. + this.fill = true; + // prop: shadowOffset + // offset of the shadow from the area and offset of + // each succesive stroke of the shadow from the last. + this.shadowOffset = 2; + // prop: shadowAlpha + // transparency of the shadow (0 = transparent, 1 = opaque) + this.shadowAlpha = 0.07; + // prop: shadowDepth + // number of strokes to apply to the shadow, + // each stroke offset shadowOffset from the last. + this.shadowDepth = 5; + // prop: highlightMouseOver + // True to highlight area when moused over. + // This must be false to enable highlightMouseDown to highlight when clicking on a area. + this.highlightMouseOver = true; + // prop: highlightMouseDown + // True to highlight when a mouse button is pressed over a area. + // This will be disabled if highlightMouseOver is true. + this.highlightMouseDown = false; + // prop: highlightColors + // array of colors to use when highlighting an area. + this.highlightColors = []; + // prop: widthRatio + // The ratio of the width of the top of the funnel to the bottom. + // a ratio of 0 will make an upside down pyramid. + this.widthRatio = 0.2; + // prop: lineWidth + // width of line if areas are stroked and not filled. + this.lineWidth = 2; + // prop: dataLabels + // Either 'label', 'value', 'percent' or an array of labels to place on the pie slices. + // Defaults to percentage of each pie slice. + this.dataLabels = 'percent'; + // prop: showDataLabels + // true to show data labels on slices. + this.showDataLabels = false; + // prop: dataLabelFormatString + // Format string for data labels. If none, '%s' is used for "label" and for arrays, '%d' for value and '%d%%' for percentage. + this.dataLabelFormatString = null; + // prop: dataLabelThreshold + // Threshhold in percentage (0 - 100) of pie area, below which no label will be displayed. + // This applies to all label types, not just to percentage labels. + this.dataLabelThreshold = 3; + this._type = 'funnel'; + + this.tickRenderer = $.jqplot.FunnelTickRenderer; + + // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver + if (options.highlightMouseDown && options.highlightMouseOver == null) { + options.highlightMouseOver = false; + } + + $.extend(true, this, options); + + // index of the currenty highlighted point, if any + this._highlightedPoint = null; + + // lengths of bases, or horizontal sides of areas of trapezoid. + this._bases = []; + // total area + this._atot; + // areas of segments. + this._areas = []; + // vertical lengths of segments. + this._lengths = []; + // angle of the funnel to vertical. + this._angle; + this._dataIndices = []; + + // sort data + this._unorderedData = $.extend(true, [], this.data); + var idxs = $.extend(true, [], this.data); + for (var i=0; i 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.4 * (255 - newrgb[j]); + newrgb[j] = parseInt(newrgb[j], 10); + } + this.highlightColors.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')'); + } + } + + plot.postParseOptionsHooks.addOnce(postParseOptions); + plot.postInitHooks.addOnce(postInit); + plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove); + plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown); + plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp); + plot.eventListenerHooks.addOnce('jqplotClick', handleClick); + plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick); + plot.postDrawHooks.addOnce(postPlotDraw); + + }; + + // gridData will be of form [label, percentage of total] + $.jqplot.FunnelRenderer.prototype.setGridData = function(plot) { + // set gridData property. This will hold angle in radians of each data point. + var sum = 0; + var td = []; + for (var i=0; i this._lengths[i]*tolerance && count < 100) { + this._lengths[i] = this._areas[i]/(this._bases[i] - this._lengths[i] * Math.tan(this._angle)); + err = Math.abs(this._lengths[i] - guess); + this._bases[i+1] = this._bases[i] - (2*this._lengths[i]*Math.tan(this._angle)); + guess = this._lengths[i]; + count++; + } + lsum += this._lengths[i]; + } + + // figure out vertices of each section + this._vertices = new Array(gd.length); + + // these are 4 coners of entire trapezoid + var p0 = [loff, toff], + p1 = [loff+this._bases[0], toff], + p2 = [loff + (this._bases[0] - this._bases[this._bases.length-1])/2, toff + this._length], + p3 = [p2[0] + this._bases[this._bases.length-1], p2[1]]; + + // equations of right and left sides, returns x, y values given height of section (y value) + function findleft (l) { + var m = (p0[1] - p2[1])/(p0[0] - p2[0]); + var b = p0[1] - m*p0[0]; + var y = l + p0[1]; + + return [(y - b)/m, y]; + } + + function findright (l) { + var m = (p1[1] - p3[1])/(p1[0] - p3[0]); + var b = p1[1] - m*p1[0]; + var y = l + p1[1]; + + return [(y - b)/m, y]; + } + + var x = offx, y = offy; + var h=0, adj=0; + + for (i=0; i 0 && i < gd.length-1) { + adj = sm/2; + } + else if (i == gd.length -1) { + adj = 2*sm/3; + } + v.push(findleft(h+adj)); + v.push(findright(h+adj)); + h += this._lengths[i]; + if (i == 0) { + adj = -2*sm/3; + } + else if (i > 0 && i < gd.length-1) { + adj = -sm/2; + } + else if (i == gd.length - 1) { + adj = 0; + } + v.push(findright(h+adj)); + v.push(findleft(h+adj)); + + } + + if (this.shadow) { + var shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')'; + for (var i=0; i= this.dataLabelThreshold) { + var fstr, label; + + if (this.dataLabels == 'label') { + fstr = this.dataLabelFormatString || '%s'; + label = $.jqplot.sprintf(fstr, gd[i][0]); + } + else if (this.dataLabels == 'value') { + fstr = this.dataLabelFormatString || '%d'; + label = $.jqplot.sprintf(fstr, this.data[i][1]); + } + else if (this.dataLabels == 'percent') { + fstr = this.dataLabelFormatString || '%d%%'; + label = $.jqplot.sprintf(fstr, gd[i][1]*100); + } + else if (this.dataLabels.constructor == Array) { + fstr = this.dataLabelFormatString || '%s'; + label = $.jqplot.sprintf(fstr, this.dataLabels[this._dataIndices[i]]); + } + + var fact = (this._radius ) * this.dataLabelPositionFactor + this.sliceMargin + this.dataLabelNudge; + + var x = (v[0][0] + v[1][0])/2 + this.canvas._offsets.left; + var y = (v[1][1] + v[2][1])/2 + this.canvas._offsets.top; + + var labelelem = $('' + label + '').insertBefore(plot.eventCanvas._elem); + x -= labelelem.width()/2; + y -= labelelem.height()/2; + x = Math.round(x); + y = Math.round(y); + labelelem.css({left: x, top: y}); + } + + } + + }; + + $.jqplot.FunnelAxisRenderer = function() { + $.jqplot.LinearAxisRenderer.call(this); + }; + + $.jqplot.FunnelAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer(); + $.jqplot.FunnelAxisRenderer.prototype.constructor = $.jqplot.FunnelAxisRenderer; + + + // There are no traditional axes on a funnel chart. We just need to provide + // dummy objects with properties so the plot will render. + // called with scope of axis object. + $.jqplot.FunnelAxisRenderer.prototype.init = function(options){ + // + this.tickRenderer = $.jqplot.FunnelTickRenderer; + $.extend(true, this, options); + // I don't think I'm going to need _dataBounds here. + // have to go Axis scaling in a way to fit chart onto plot area + // and provide u2p and p2u functionality for mouse cursor, etc. + // for convienence set _dataBounds to 0 and 100 and + // set min/max to 0 and 100. + this._dataBounds = {min:0, max:100}; + this.min = 0; + this.max = 100; + this.showTicks = false; + this.ticks = []; + this.showMark = false; + this.show = false; + }; + + + + /** + * Class: $.jqplot.FunnelLegendRenderer + * Legend Renderer specific to funnel plots. Set by default + * when the user creates a funnel plot. + */ + $.jqplot.FunnelLegendRenderer = function(){ + $.jqplot.TableLegendRenderer.call(this); + }; + + $.jqplot.FunnelLegendRenderer.prototype = new $.jqplot.TableLegendRenderer(); + $.jqplot.FunnelLegendRenderer.prototype.constructor = $.jqplot.FunnelLegendRenderer; + + $.jqplot.FunnelLegendRenderer.prototype.init = function(options) { + // Group: Properties + // + // prop: numberRows + // Maximum number of rows in the legend. 0 or null for unlimited. + this.numberRows = null; + // prop: numberColumns + // Maximum number of columns in the legend. 0 or null for unlimited. + this.numberColumns = null; + $.extend(true, this, options); + }; + + // called with context of legend + $.jqplot.FunnelLegendRenderer.prototype.draw = function() { + var legend = this; + if (this.show) { + var series = this._series; + var ss = 'position:absolute;'; + ss += (this.background) ? 'background:'+this.background+';' : ''; + ss += (this.border) ? 'border:'+this.border+';' : ''; + ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : ''; + ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : ''; + ss += (this.textColor) ? 'color:'+this.textColor+';' : ''; + ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : ''; + ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : ''; + ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : ''; + ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : ''; + this._elem = $('
 {$lng['admin']['serversettings']} +  {$lng['admin']['serversettings']} [{$lng['admin']['configfiles']['compactoverview']}]
-  {$groupdetails['title']} +  {$groupdetails['title']} diff --git a/templates/Classic/admin/settings/settings_overview.tpl b/templates/Classic/admin/settings/settings_overview.tpl index f8c2e458..1be1168b 100644 --- a/templates/Classic/admin/settings/settings_overview.tpl +++ b/templates/Classic/admin/settings/settings_overview.tpl @@ -1,7 +1,7 @@ diff --git a/templates/Classic/admin/settings/settings_overviewgroup.tpl b/templates/Classic/admin/settings/settings_overviewgroup.tpl index 10185e73..390677bf 100644 --- a/templates/Classic/admin/settings/settings_overviewgroup.tpl +++ b/templates/Classic/admin/settings/settings_overviewgroup.tpl @@ -1,6 +1,6 @@ ').prependTo(this._elem); + } + else{ + tr = $('').appendTo(this._elem); + } + for (j=0; j0){ + pad = true; + } + else{ + pad = false; + } + } + else{ + if (i == nr -1){ + pad = false; + } + else{ + pad = true; + } + } + rs = (pad) ? this.rowSpacing : '0'; + + td1 = $(''); + td2 = $(''); + if (this.escapeHtml){ + td2.text(lt); + } + else { + td2.html(lt); + } + if (reverse) { + if (this.showLabels) {td2.prependTo(tr);} + if (this.showSwatches) {td1.prependTo(tr);} + } + else { + if (this.showSwatches) {td1.appendTo(tr);} + if (this.showLabels) {td2.appendTo(tr);} + } + + if (this.seriesToggle) { + var speed; + if (typeof(this.seriesToggle) == 'string' || typeof(this.seriesToggle) == 'number') { + if (!$.jqplot.use_excanvas || !this.disableIEFading) { + speed = this.seriesToggle; + } + } + if (this.showSwatches) { + td1.bind('click', {series:s, speed:speed}, s.toggleDisplay); + td1.addClass('jqplot-seriesToggle'); + } + if (this.showLabels) { + td2.bind('click', {series:s, speed:speed}, s.toggleDisplay); + td2.addClass('jqplot-seriesToggle'); + } + } + + pad = true; + } + } + idx++; + } + } + } + return this._elem; + }; + + // called with scope of plot. + var postDraw = function () { + if (this.legend.renderer.constructor == $.jqplot.EnhancedLegendRenderer && this.legend.seriesToggle){ + var e = this.legend._elem.detach(); + this.eventCanvas._elem.after(e); + } + }; +})(jQuery); \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.enhancedLegendRenderer.min.js b/templates/Froxlor/assets/js/plugins/jqplot.enhancedLegendRenderer.min.js new file mode 100644 index 00000000..90d33766 --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.enhancedLegendRenderer.min.js @@ -0,0 +1,30 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function(b){b.jqplot.EnhancedLegendRenderer=function(){b.jqplot.TableLegendRenderer.call(this)};b.jqplot.EnhancedLegendRenderer.prototype=new b.jqplot.TableLegendRenderer();b.jqplot.EnhancedLegendRenderer.prototype.constructor=b.jqplot.EnhancedLegendRenderer;b.jqplot.EnhancedLegendRenderer.prototype.init=function(c){this.numberRows=null;this.numberColumns=null;this.seriesToggle="normal";this.disableIEFading=true;b.extend(true,this,c);if(this.seriesToggle){b.jqplot.postDrawHooks.push(a)}};b.jqplot.EnhancedLegendRenderer.prototype.draw=function(){var e=this;if(this.show){var n=this._series;var o;var q="position:absolute;";q+=(this.background)?"background:"+this.background+";":"";q+=(this.border)?"border:"+this.border+";":"";q+=(this.fontSize)?"font-size:"+this.fontSize+";":"";q+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";q+=(this.textColor)?"color:"+this.textColor+";":"";q+=(this.marginTop!=null)?"margin-top:"+this.marginTop+";":"";q+=(this.marginBottom!=null)?"margin-bottom:"+this.marginBottom+";":"";q+=(this.marginLeft!=null)?"margin-left:"+this.marginLeft+";":"";q+=(this.marginRight!=null)?"margin-right:"+this.marginRight+";":"";this._elem=b('
-  {$lng['admin']['configfiles']['serverconfiguration']} +  {$lng['admin']['configfiles']['serverconfiguration']} [{$lng['admin']['configfiles']['overview']}]
-  {$title} +  {$title} {$option} diff --git a/templates/Classic/admin/settings/updatecounters.tpl b/templates/Classic/admin/settings/updatecounters.tpl index abf661c7..bb1dea84 100644 --- a/templates/Classic/admin/settings/updatecounters.tpl +++ b/templates/Classic/admin/settings/updatecounters.tpl @@ -2,13 +2,13 @@ $header {$customers} {$admins} diff --git a/templates/Classic/admin/templates/filetemplates_add.tpl b/templates/Classic/admin/templates/filetemplates_add.tpl index 9efb890e..fcbaff9f 100644 --- a/templates/Classic/admin/templates/filetemplates_add.tpl +++ b/templates/Classic/admin/templates/filetemplates_add.tpl @@ -5,7 +5,7 @@ $header
-  {$lng['admin']['updatecounters']}: {$lng['admin']['customers']} +  {$lng['admin']['updatecounters']}: {$lng['admin']['customers']}
-  {$lng['admin']['updatecounters']}: {$lng['admin']['admins']} +  {$lng['admin']['updatecounters']}: {$lng['admin']['admins']}
- + @@ -23,7 +23,7 @@ $header
 {$lng['admin']['templates']['template_add']} {$lng['admin']['templates']['template_add']}
{$lng['admin']['templates']['action']}
- + @@ -52,4 +52,4 @@ $header

-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/admin/templates/filetemplates_edit.tpl b/templates/Classic/admin/templates/filetemplates_edit.tpl index e042334a..096d1765 100644 --- a/templates/Classic/admin/templates/filetemplates_edit.tpl +++ b/templates/Classic/admin/templates/filetemplates_edit.tpl @@ -6,7 +6,7 @@ $header
  {$lng['admin']['templates']['template_replace_vars']}  {$lng['admin']['templates']['template_replace_vars']}
{$lng['admin']['templates']['index_html']}
- + @@ -24,7 +24,7 @@ $header
 {$lng['admin']['templates']['template_add']} {$lng['admin']['templates']['template_add']}
{$lng['admin']['templates']['action']}
- + @@ -53,4 +53,4 @@ $header

-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/admin/templates/templates.tpl b/templates/Classic/admin/templates/templates.tpl index bdc04367..63f05d49 100644 --- a/templates/Classic/admin/templates/templates.tpl +++ b/templates/Classic/admin/templates/templates.tpl @@ -1,7 +1,7 @@ $header
  {$lng['admin']['templates']['template_replace_vars']}  {$lng['admin']['templates']['template_replace_vars']}
{$lng['admin']['templates']['index_html']}
- + @@ -18,7 +18,7 @@ $header
 {$lng['admin']['templates']['templates']} {$lng['admin']['templates']['templates']}
{$lng['login']['language']}
- + @@ -34,4 +34,4 @@ $header
 {$lng['admin']['templates']['filetemplates']} {$lng['admin']['templates']['filetemplates']}
{$lng['admin']['templates']['action']}


-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/admin/templates/templates_add_1.tpl b/templates/Classic/admin/templates/templates_add_1.tpl index ff84a0fa..2024db70 100644 --- a/templates/Classic/admin/templates/templates_add_1.tpl +++ b/templates/Classic/admin/templates/templates_add_1.tpl @@ -5,7 +5,7 @@ $header - + @@ -18,4 +18,4 @@ $header

-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/admin/templates/templates_add_2.tpl b/templates/Classic/admin/templates/templates_add_2.tpl index 84c12c2e..113a6d59 100644 --- a/templates/Classic/admin/templates/templates_add_2.tpl +++ b/templates/Classic/admin/templates/templates_add_2.tpl @@ -5,7 +5,7 @@ $header
 {$lng['admin']['templates']['template_add']} {$lng['admin']['templates']['template_add']}
{$lng['login']['language']}:
- + @@ -31,7 +31,7 @@ $header
 {$lng['admin']['templates']['template_add']} {$lng['admin']['templates']['template_add']}
{$lng['login']['language']}
- + diff --git a/templates/Classic/admin/templates/templates_edit.tpl b/templates/Classic/admin/templates/templates_edit.tpl index edad06c3..2b294d98 100644 --- a/templates/Classic/admin/templates/templates_edit.tpl +++ b/templates/Classic/admin/templates/templates_edit.tpl @@ -7,7 +7,7 @@ $header
  {$lng['admin']['templates']['template_replace_vars']}  {$lng['admin']['templates']['template_replace_vars']}
{$lng['admin']['templates']['createcustomer']}
- + @@ -33,7 +33,7 @@ $header
 {$lng['admin']['templates']['template_edit']} {$lng['admin']['templates']['template_edit']}
{$lng['login']['language']}
- + diff --git a/templates/Classic/admin/tickets/archive.tpl b/templates/Classic/admin/tickets/archive.tpl index beaf9834..c7d5059a 100644 --- a/templates/Classic/admin/tickets/archive.tpl +++ b/templates/Classic/admin/tickets/archive.tpl @@ -5,7 +5,7 @@ $header
  {$lng['admin']['templates']['template_replace_vars']}  {$lng['admin']['templates']['template_replace_vars']}
{$lng['admin']['templates']['createcustomer']}
- + @@ -27,7 +27,7 @@ $header
 {$lng['ticket']['lastarchived']} {$lng['ticket']['lastarchived']}  
- + diff --git a/templates/Classic/admin/tickets/archivesearch.tpl b/templates/Classic/admin/tickets/archivesearch.tpl index bcfdb9a7..11855a36 100644 --- a/templates/Classic/admin/tickets/archivesearch.tpl +++ b/templates/Classic/admin/tickets/archivesearch.tpl @@ -5,7 +5,7 @@ $header
 {$lng['ticket']['search']} {$lng['ticket']['search']}
{$lng['ticket']['subject']}:
- + diff --git a/templates/Classic/admin/tickets/categories.tpl b/templates/Classic/admin/tickets/categories.tpl index 5f50eea2..6b8d3bdf 100644 --- a/templates/Classic/admin/tickets/categories.tpl +++ b/templates/Classic/admin/tickets/categories.tpl @@ -5,7 +5,7 @@ $header
 {$lng['ticket']['archivesearch']} {$lng['ticket']['archivesearch']}  
- + diff --git a/templates/Classic/admin/tickets/tickets.tpl b/templates/Classic/admin/tickets/tickets.tpl index 8a4b4464..53a20e4c 100644 --- a/templates/Classic/admin/tickets/tickets.tpl +++ b/templates/Classic/admin/tickets/tickets.tpl @@ -5,7 +5,7 @@ $header
 {$lng['menue']['ticket']['categories']} {$lng['menue']['ticket']['categories']} {$searchcode}
- + diff --git a/templates/Classic/admin/tickets/tickets_editcategory.tpl b/templates/Classic/admin/tickets/tickets_editcategory.tpl index 02a706da..31ab5d76 100644 --- a/templates/Classic/admin/tickets/tickets_editcategory.tpl +++ b/templates/Classic/admin/tickets/tickets_editcategory.tpl @@ -7,7 +7,7 @@ $header
 {$lng['menue']['ticket']['ticket']} {$lng['menue']['ticket']['ticket']} {$searchcode}
- + {$category_edit_form}
{$title} {$title}{$title} {$title}
diff --git a/templates/Classic/admin/tickets/tickets_new.tpl b/templates/Classic/admin/tickets/tickets_new.tpl index 37f0bada..a80efcd0 100644 --- a/templates/Classic/admin/tickets/tickets_new.tpl +++ b/templates/Classic/admin/tickets/tickets_new.tpl @@ -6,7 +6,7 @@ $header - + {$ticket_new_form}
{$title} {$title}{$title} {$title}
diff --git a/templates/Classic/admin/tickets/tickets_newcategory.tpl b/templates/Classic/admin/tickets/tickets_newcategory.tpl index f96e689f..84eef559 100644 --- a/templates/Classic/admin/tickets/tickets_newcategory.tpl +++ b/templates/Classic/admin/tickets/tickets_newcategory.tpl @@ -6,7 +6,7 @@ $header - + {$category_new_form}
{$title} {$title}{$title} {$title}
diff --git a/templates/Classic/admin/tickets/tickets_reply.tpl b/templates/Classic/admin/tickets/tickets_reply.tpl index 088fea70..f83cad4e 100644 --- a/templates/Classic/admin/tickets/tickets_reply.tpl +++ b/templates/Classic/admin/tickets/tickets_reply.tpl @@ -11,7 +11,7 @@ $header - + {$ticket_reply_form}
{$title} {$title}{$title} {$title}
@@ -19,7 +19,7 @@ $header - + diff --git a/templates/Classic/admin/tickets/tickets_tickets_list.tpl b/templates/Classic/admin/tickets/tickets_tickets_list.tpl index f2979ab4..3966dba9 100644 --- a/templates/Classic/admin/tickets/tickets_tickets_list.tpl +++ b/templates/Classic/admin/tickets/tickets_tickets_list.tpl @@ -1,6 +1,6 @@
 {$lng['ticket']['ticket_reopen']} {$lng['ticket']['ticket_reopen']}
{$lng['ticket']['ticket_reopen']}
- + diff --git a/templates/Classic/admin/tickets/tickets_tickets_main.tpl b/templates/Classic/admin/tickets/tickets_tickets_main.tpl index fc41aae3..d380b887 100644 --- a/templates/Classic/admin/tickets/tickets_tickets_main.tpl +++ b/templates/Classic/admin/tickets/tickets_tickets_main.tpl @@ -1,6 +1,6 @@
  {$lastchange} {$lng['ticket']['by']} {$by}  {$lastchange} {$lng['ticket']['by']} {$by}
{$subject}
- + diff --git a/templates/Classic/admin/tickets/tickets_view.tpl b/templates/Classic/admin/tickets/tickets_view.tpl index 22f63b8c..599bc223 100644 --- a/templates/Classic/admin/tickets/tickets_view.tpl +++ b/templates/Classic/admin/tickets/tickets_view.tpl @@ -1,10 +1,10 @@ $header
  {$dt} {$lng['ticket']['by']} {$by} ({$status})  {$dt} {$lng['ticket']['by']} {$by} ({$status})
{$subject}
- + - +
 {$lng['ticket']['ticket_delete']} {$lng['ticket']['ticket_delete']}
{$lng['panel']['delete']}{$lng['panel']['delete']}

diff --git a/templates/Classic/admin/traffic/index.tpl b/templates/Classic/admin/traffic/index.tpl index 88490e5f..027664f1 100644 --- a/templates/Classic/admin/traffic/index.tpl +++ b/templates/Classic/admin/traffic/index.tpl @@ -1,5 +1,5 @@ $header - + - - + + + + <if isset($userinfo['loginname']) && $userinfo['loginname'] != ''>{$userinfo['loginname']} - </if>Froxlor diff --git a/js/excanvas.min.js b/templates/Classic/js/excanvas.min.js similarity index 100% rename from js/excanvas.min.js rename to templates/Classic/js/excanvas.min.js diff --git a/js/jquery-ui-1.8.13.min.js b/templates/Classic/js/jquery-ui-1.8.13.min.js similarity index 100% rename from js/jquery-ui-1.8.13.min.js rename to templates/Classic/js/jquery-ui-1.8.13.min.js diff --git a/js/jquery-ui.min.js b/templates/Classic/js/jquery-ui.min.js similarity index 100% rename from js/jquery-ui.min.js rename to templates/Classic/js/jquery-ui.min.js diff --git a/js/jquery.jqplot.min.js b/templates/Classic/js/jquery.jqplot.min.js similarity index 100% rename from js/jquery.jqplot.min.js rename to templates/Classic/js/jquery.jqplot.min.js diff --git a/js/jquery.min.js b/templates/Classic/js/jquery.min.js similarity index 100% rename from js/jquery.min.js rename to templates/Classic/js/jquery.min.js diff --git a/js/jquery.tablesorter.min.js b/templates/Classic/js/jquery.tablesorter.min.js similarity index 100% rename from js/jquery.tablesorter.min.js rename to templates/Classic/js/jquery.tablesorter.min.js diff --git a/templates/Classic/js/froxlor.js b/templates/Classic/js/main.js similarity index 100% rename from templates/Classic/js/froxlor.js rename to templates/Classic/js/main.js diff --git a/js/plugins/jqplot.BezierCurveRenderer.js b/templates/Classic/js/plugins/jqplot.BezierCurveRenderer.js similarity index 100% rename from js/plugins/jqplot.BezierCurveRenderer.js rename to templates/Classic/js/plugins/jqplot.BezierCurveRenderer.js diff --git a/js/plugins/jqplot.BezierCurveRenderer.min.js b/templates/Classic/js/plugins/jqplot.BezierCurveRenderer.min.js similarity index 100% rename from js/plugins/jqplot.BezierCurveRenderer.min.js rename to templates/Classic/js/plugins/jqplot.BezierCurveRenderer.min.js diff --git a/js/plugins/jqplot.barRenderer.js b/templates/Classic/js/plugins/jqplot.barRenderer.js similarity index 100% rename from js/plugins/jqplot.barRenderer.js rename to templates/Classic/js/plugins/jqplot.barRenderer.js diff --git a/js/plugins/jqplot.barRenderer.min.js b/templates/Classic/js/plugins/jqplot.barRenderer.min.js similarity index 100% rename from js/plugins/jqplot.barRenderer.min.js rename to templates/Classic/js/plugins/jqplot.barRenderer.min.js diff --git a/js/plugins/jqplot.blockRenderer.js b/templates/Classic/js/plugins/jqplot.blockRenderer.js similarity index 100% rename from js/plugins/jqplot.blockRenderer.js rename to templates/Classic/js/plugins/jqplot.blockRenderer.js diff --git a/js/plugins/jqplot.blockRenderer.min.js b/templates/Classic/js/plugins/jqplot.blockRenderer.min.js similarity index 100% rename from js/plugins/jqplot.blockRenderer.min.js rename to templates/Classic/js/plugins/jqplot.blockRenderer.min.js diff --git a/js/plugins/jqplot.bubbleRenderer.js b/templates/Classic/js/plugins/jqplot.bubbleRenderer.js similarity index 100% rename from js/plugins/jqplot.bubbleRenderer.js rename to templates/Classic/js/plugins/jqplot.bubbleRenderer.js diff --git a/js/plugins/jqplot.bubbleRenderer.min.js b/templates/Classic/js/plugins/jqplot.bubbleRenderer.min.js similarity index 100% rename from js/plugins/jqplot.bubbleRenderer.min.js rename to templates/Classic/js/plugins/jqplot.bubbleRenderer.min.js diff --git a/js/plugins/jqplot.canvasAxisLabelRenderer.js b/templates/Classic/js/plugins/jqplot.canvasAxisLabelRenderer.js similarity index 100% rename from js/plugins/jqplot.canvasAxisLabelRenderer.js rename to templates/Classic/js/plugins/jqplot.canvasAxisLabelRenderer.js diff --git a/js/plugins/jqplot.canvasAxisLabelRenderer.min.js b/templates/Classic/js/plugins/jqplot.canvasAxisLabelRenderer.min.js similarity index 100% rename from js/plugins/jqplot.canvasAxisLabelRenderer.min.js rename to templates/Classic/js/plugins/jqplot.canvasAxisLabelRenderer.min.js diff --git a/js/plugins/jqplot.canvasAxisTickRenderer.js b/templates/Classic/js/plugins/jqplot.canvasAxisTickRenderer.js similarity index 100% rename from js/plugins/jqplot.canvasAxisTickRenderer.js rename to templates/Classic/js/plugins/jqplot.canvasAxisTickRenderer.js diff --git a/js/plugins/jqplot.canvasAxisTickRenderer.min.js b/templates/Classic/js/plugins/jqplot.canvasAxisTickRenderer.min.js similarity index 100% rename from js/plugins/jqplot.canvasAxisTickRenderer.min.js rename to templates/Classic/js/plugins/jqplot.canvasAxisTickRenderer.min.js diff --git a/js/plugins/jqplot.canvasOverlay.js b/templates/Classic/js/plugins/jqplot.canvasOverlay.js similarity index 100% rename from js/plugins/jqplot.canvasOverlay.js rename to templates/Classic/js/plugins/jqplot.canvasOverlay.js diff --git a/js/plugins/jqplot.canvasOverlay.min.js b/templates/Classic/js/plugins/jqplot.canvasOverlay.min.js similarity index 100% rename from js/plugins/jqplot.canvasOverlay.min.js rename to templates/Classic/js/plugins/jqplot.canvasOverlay.min.js diff --git a/js/plugins/jqplot.canvasTextRenderer.js b/templates/Classic/js/plugins/jqplot.canvasTextRenderer.js similarity index 100% rename from js/plugins/jqplot.canvasTextRenderer.js rename to templates/Classic/js/plugins/jqplot.canvasTextRenderer.js diff --git a/js/plugins/jqplot.canvasTextRenderer.min.js b/templates/Classic/js/plugins/jqplot.canvasTextRenderer.min.js similarity index 100% rename from js/plugins/jqplot.canvasTextRenderer.min.js rename to templates/Classic/js/plugins/jqplot.canvasTextRenderer.min.js diff --git a/js/plugins/jqplot.categoryAxisRenderer.js b/templates/Classic/js/plugins/jqplot.categoryAxisRenderer.js similarity index 100% rename from js/plugins/jqplot.categoryAxisRenderer.js rename to templates/Classic/js/plugins/jqplot.categoryAxisRenderer.js diff --git a/js/plugins/jqplot.categoryAxisRenderer.min.js b/templates/Classic/js/plugins/jqplot.categoryAxisRenderer.min.js similarity index 100% rename from js/plugins/jqplot.categoryAxisRenderer.min.js rename to templates/Classic/js/plugins/jqplot.categoryAxisRenderer.min.js diff --git a/js/plugins/jqplot.ciParser.js b/templates/Classic/js/plugins/jqplot.ciParser.js similarity index 100% rename from js/plugins/jqplot.ciParser.js rename to templates/Classic/js/plugins/jqplot.ciParser.js diff --git a/js/plugins/jqplot.ciParser.min.js b/templates/Classic/js/plugins/jqplot.ciParser.min.js similarity index 100% rename from js/plugins/jqplot.ciParser.min.js rename to templates/Classic/js/plugins/jqplot.ciParser.min.js diff --git a/js/plugins/jqplot.cursor.js b/templates/Classic/js/plugins/jqplot.cursor.js similarity index 100% rename from js/plugins/jqplot.cursor.js rename to templates/Classic/js/plugins/jqplot.cursor.js diff --git a/js/plugins/jqplot.cursor.min.js b/templates/Classic/js/plugins/jqplot.cursor.min.js similarity index 100% rename from js/plugins/jqplot.cursor.min.js rename to templates/Classic/js/plugins/jqplot.cursor.min.js diff --git a/js/plugins/jqplot.dateAxisRenderer.js b/templates/Classic/js/plugins/jqplot.dateAxisRenderer.js similarity index 100% rename from js/plugins/jqplot.dateAxisRenderer.js rename to templates/Classic/js/plugins/jqplot.dateAxisRenderer.js diff --git a/js/plugins/jqplot.dateAxisRenderer.min.js b/templates/Classic/js/plugins/jqplot.dateAxisRenderer.min.js similarity index 100% rename from js/plugins/jqplot.dateAxisRenderer.min.js rename to templates/Classic/js/plugins/jqplot.dateAxisRenderer.min.js diff --git a/js/plugins/jqplot.donutRenderer.js b/templates/Classic/js/plugins/jqplot.donutRenderer.js similarity index 100% rename from js/plugins/jqplot.donutRenderer.js rename to templates/Classic/js/plugins/jqplot.donutRenderer.js diff --git a/js/plugins/jqplot.donutRenderer.min.js b/templates/Classic/js/plugins/jqplot.donutRenderer.min.js similarity index 100% rename from js/plugins/jqplot.donutRenderer.min.js rename to templates/Classic/js/plugins/jqplot.donutRenderer.min.js diff --git a/js/plugins/jqplot.dragable.js b/templates/Classic/js/plugins/jqplot.dragable.js similarity index 100% rename from js/plugins/jqplot.dragable.js rename to templates/Classic/js/plugins/jqplot.dragable.js diff --git a/js/plugins/jqplot.dragable.min.js b/templates/Classic/js/plugins/jqplot.dragable.min.js similarity index 100% rename from js/plugins/jqplot.dragable.min.js rename to templates/Classic/js/plugins/jqplot.dragable.min.js diff --git a/js/plugins/jqplot.enhancedLegendRenderer.js b/templates/Classic/js/plugins/jqplot.enhancedLegendRenderer.js similarity index 100% rename from js/plugins/jqplot.enhancedLegendRenderer.js rename to templates/Classic/js/plugins/jqplot.enhancedLegendRenderer.js diff --git a/js/plugins/jqplot.enhancedLegendRenderer.min.js b/templates/Classic/js/plugins/jqplot.enhancedLegendRenderer.min.js similarity index 100% rename from js/plugins/jqplot.enhancedLegendRenderer.min.js rename to templates/Classic/js/plugins/jqplot.enhancedLegendRenderer.min.js diff --git a/js/plugins/jqplot.funnelRenderer.js b/templates/Classic/js/plugins/jqplot.funnelRenderer.js similarity index 100% rename from js/plugins/jqplot.funnelRenderer.js rename to templates/Classic/js/plugins/jqplot.funnelRenderer.js diff --git a/js/plugins/jqplot.funnelRenderer.min.js b/templates/Classic/js/plugins/jqplot.funnelRenderer.min.js similarity index 100% rename from js/plugins/jqplot.funnelRenderer.min.js rename to templates/Classic/js/plugins/jqplot.funnelRenderer.min.js diff --git a/js/plugins/jqplot.highlighter.js b/templates/Classic/js/plugins/jqplot.highlighter.js similarity index 100% rename from js/plugins/jqplot.highlighter.js rename to templates/Classic/js/plugins/jqplot.highlighter.js diff --git a/js/plugins/jqplot.highlighter.min.js b/templates/Classic/js/plugins/jqplot.highlighter.min.js similarity index 100% rename from js/plugins/jqplot.highlighter.min.js rename to templates/Classic/js/plugins/jqplot.highlighter.min.js diff --git a/js/plugins/jqplot.json2.js b/templates/Classic/js/plugins/jqplot.json2.js similarity index 100% rename from js/plugins/jqplot.json2.js rename to templates/Classic/js/plugins/jqplot.json2.js diff --git a/js/plugins/jqplot.json2.min.js b/templates/Classic/js/plugins/jqplot.json2.min.js similarity index 100% rename from js/plugins/jqplot.json2.min.js rename to templates/Classic/js/plugins/jqplot.json2.min.js diff --git a/js/plugins/jqplot.logAxisRenderer.js b/templates/Classic/js/plugins/jqplot.logAxisRenderer.js similarity index 100% rename from js/plugins/jqplot.logAxisRenderer.js rename to templates/Classic/js/plugins/jqplot.logAxisRenderer.js diff --git a/js/plugins/jqplot.logAxisRenderer.min.js b/templates/Classic/js/plugins/jqplot.logAxisRenderer.min.js similarity index 100% rename from js/plugins/jqplot.logAxisRenderer.min.js rename to templates/Classic/js/plugins/jqplot.logAxisRenderer.min.js diff --git a/js/plugins/jqplot.mekkoAxisRenderer.js b/templates/Classic/js/plugins/jqplot.mekkoAxisRenderer.js similarity index 100% rename from js/plugins/jqplot.mekkoAxisRenderer.js rename to templates/Classic/js/plugins/jqplot.mekkoAxisRenderer.js diff --git a/js/plugins/jqplot.mekkoAxisRenderer.min.js b/templates/Classic/js/plugins/jqplot.mekkoAxisRenderer.min.js similarity index 100% rename from js/plugins/jqplot.mekkoAxisRenderer.min.js rename to templates/Classic/js/plugins/jqplot.mekkoAxisRenderer.min.js diff --git a/js/plugins/jqplot.mekkoRenderer.js b/templates/Classic/js/plugins/jqplot.mekkoRenderer.js similarity index 100% rename from js/plugins/jqplot.mekkoRenderer.js rename to templates/Classic/js/plugins/jqplot.mekkoRenderer.js diff --git a/js/plugins/jqplot.mekkoRenderer.min.js b/templates/Classic/js/plugins/jqplot.mekkoRenderer.min.js similarity index 100% rename from js/plugins/jqplot.mekkoRenderer.min.js rename to templates/Classic/js/plugins/jqplot.mekkoRenderer.min.js diff --git a/js/plugins/jqplot.meterGaugeRenderer.js b/templates/Classic/js/plugins/jqplot.meterGaugeRenderer.js similarity index 100% rename from js/plugins/jqplot.meterGaugeRenderer.js rename to templates/Classic/js/plugins/jqplot.meterGaugeRenderer.js diff --git a/js/plugins/jqplot.meterGaugeRenderer.min.js b/templates/Classic/js/plugins/jqplot.meterGaugeRenderer.min.js similarity index 100% rename from js/plugins/jqplot.meterGaugeRenderer.min.js rename to templates/Classic/js/plugins/jqplot.meterGaugeRenderer.min.js diff --git a/js/plugins/jqplot.ohlcRenderer.js b/templates/Classic/js/plugins/jqplot.ohlcRenderer.js similarity index 100% rename from js/plugins/jqplot.ohlcRenderer.js rename to templates/Classic/js/plugins/jqplot.ohlcRenderer.js diff --git a/js/plugins/jqplot.ohlcRenderer.min.js b/templates/Classic/js/plugins/jqplot.ohlcRenderer.min.js similarity index 100% rename from js/plugins/jqplot.ohlcRenderer.min.js rename to templates/Classic/js/plugins/jqplot.ohlcRenderer.min.js diff --git a/js/plugins/jqplot.pieRenderer.js b/templates/Classic/js/plugins/jqplot.pieRenderer.js similarity index 100% rename from js/plugins/jqplot.pieRenderer.js rename to templates/Classic/js/plugins/jqplot.pieRenderer.js diff --git a/js/plugins/jqplot.pieRenderer.min.js b/templates/Classic/js/plugins/jqplot.pieRenderer.min.js similarity index 100% rename from js/plugins/jqplot.pieRenderer.min.js rename to templates/Classic/js/plugins/jqplot.pieRenderer.min.js diff --git a/js/plugins/jqplot.pointLabels.js b/templates/Classic/js/plugins/jqplot.pointLabels.js similarity index 100% rename from js/plugins/jqplot.pointLabels.js rename to templates/Classic/js/plugins/jqplot.pointLabels.js diff --git a/js/plugins/jqplot.pointLabels.min.js b/templates/Classic/js/plugins/jqplot.pointLabels.min.js similarity index 100% rename from js/plugins/jqplot.pointLabels.min.js rename to templates/Classic/js/plugins/jqplot.pointLabels.min.js diff --git a/js/plugins/jqplot.trendline.js b/templates/Classic/js/plugins/jqplot.trendline.js similarity index 100% rename from js/plugins/jqplot.trendline.js rename to templates/Classic/js/plugins/jqplot.trendline.js diff --git a/js/plugins/jqplot.trendline.min.js b/templates/Classic/js/plugins/jqplot.trendline.min.js similarity index 100% rename from js/plugins/jqplot.trendline.min.js rename to templates/Classic/js/plugins/jqplot.trendline.min.js diff --git a/js/traffic.js b/templates/Classic/js/traffic.js similarity index 100% rename from js/traffic.js rename to templates/Classic/js/traffic.js diff --git a/templates/Classic/login/fpwd.tpl b/templates/Classic/login/fpwd.tpl index 08c1a9ff..7b5b2990 100644 --- a/templates/Classic/login/fpwd.tpl +++ b/templates/Classic/login/fpwd.tpl @@ -5,10 +5,10 @@ $header - + - +
  {$lng['error']['error']}/{$lng['error']['info']}  {$lng['error']['error']}/{$lng['error']['info']}
$message
@@ -18,10 +18,10 @@ $header - + - + @@ -41,4 +41,4 @@ $header


-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/login/login.tpl b/templates/Classic/login/login.tpl index 1d8fa48a..73310f8f 100644 --- a/templates/Classic/login/login.tpl +++ b/templates/Classic/login/login.tpl @@ -4,10 +4,10 @@ $header
 Froxlor - {$lng['login']['presend']} Froxlor - {$lng['login']['presend']}
{$lng['login']['username']}:
- + - +
  {$lng['error']['error']}/{$lng['error']['info']}  {$lng['error']['error']}/{$lng['error']['info']}
$message
@@ -16,10 +16,10 @@ $header
- + - + diff --git a/templates/Classic/misc/error.tpl b/templates/Classic/misc/error.tpl index 44b51c6b..259a438d 100644 --- a/templates/Classic/misc/error.tpl +++ b/templates/Classic/misc/error.tpl @@ -1,10 +1,10 @@ $header
 Froxlor - Login Froxlor - Login
{$lng['login']['username']}:
- + - + @@ -14,4 +14,4 @@ $header
  {$lng['error']['error']}  {$lng['error']['error']}
$error


-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/misc/form/table_section.tpl b/templates/Classic/misc/form/table_section.tpl index 0febf2f0..a91444f2 100644 --- a/templates/Classic/misc/form/table_section.tpl +++ b/templates/Classic/misc/form/table_section.tpl @@ -1,6 +1,6 @@
- {$title} {$title} + {$title} {$title} diff --git a/templates/Classic/misc/htmlarrowcode.tpl b/templates/Classic/misc/htmlarrowcode.tpl index 0c419605..2b32c4f6 100644 --- a/templates/Classic/misc/htmlarrowcode.tpl +++ b/templates/Classic/misc/htmlarrowcode.tpl @@ -1,6 +1,6 @@ - + - + diff --git a/templates/Classic/misc/question_yesno.tpl b/templates/Classic/misc/question_yesno.tpl index 6ce363bd..6a5726af 100644 --- a/templates/Classic/misc/question_yesno.tpl +++ b/templates/Classic/misc/question_yesno.tpl @@ -5,7 +5,7 @@ $header $hiddenparams - + @@ -15,4 +15,4 @@ $header

-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/misc/question_yesno_checkbox.tpl b/templates/Classic/misc/question_yesno_checkbox.tpl index 3d7f3f91..d8c6dc3f 100644 --- a/templates/Classic/misc/question_yesno_checkbox.tpl +++ b/templates/Classic/misc/question_yesno_checkbox.tpl @@ -5,7 +5,7 @@ $header $hiddenparams
  {$lng['question']['question']}  {$lng['question']['question']}
$text
- + @@ -18,4 +18,4 @@ $header

-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/misc/success.tpl b/templates/Classic/misc/success.tpl index 588c7c07..14948d1b 100644 --- a/templates/Classic/misc/success.tpl +++ b/templates/Classic/misc/success.tpl @@ -1,13 +1,13 @@ $header
  {$lng['question']['question']}  {$lng['question']['question']}
$text
- + - +
  {$lng['success']['success']}  {$lng['success']['success']}
$success_message
{$lng['success']['clickheretocontinue']}


-$footer \ No newline at end of file +$footer diff --git a/templates/Classic/navigation_element.tpl b/templates/Classic/navigation_element.tpl index d13eb735..3ae45685 100644 --- a/templates/Classic/navigation_element.tpl +++ b/templates/Classic/navigation_element.tpl @@ -1,7 +1,7 @@
- + diff --git a/templates/Classic/navigation_link.tpl b/templates/Classic/navigation_link.tpl index bab71ede..822ee88e 100644 --- a/templates/Classic/navigation_link.tpl +++ b/templates/Classic/navigation_link.tpl @@ -1,2 +1,2 @@ -   {$completeLink} -
\ No newline at end of file +   {$completeLink} +
diff --git a/templates/Froxlor/admin/admins/admins.tpl b/templates/Froxlor/admin/admins/admins.tpl index 0a037b79..2ea440bb 100644 --- a/templates/Froxlor/admin/admins/admins.tpl +++ b/templates/Froxlor/admin/admins/admins.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['admin']['admins']} ({$admincount})

@@ -17,7 +17,7 @@ $header @@ -52,7 +52,7 @@ $header diff --git a/templates/Froxlor/admin/admins/admins_add.tpl b/templates/Froxlor/admin/admins/admins_add.tpl index 4d6ebc59..01973060 100644 --- a/templates/Froxlor/admin/admins/admins_add.tpl +++ b/templates/Froxlor/admin/admins/admins_add.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/admin/admins/admins_admin.tpl b/templates/Froxlor/admin/admins/admins_admin.tpl index 38b73938..2fb9003f 100644 --- a/templates/Froxlor/admin/admins/admins_admin.tpl +++ b/templates/Froxlor/admin/admins/admins_admin.tpl @@ -51,10 +51,10 @@
diff --git a/templates/Froxlor/admin/admins/admins_edit.tpl b/templates/Froxlor/admin/admins/admins_edit.tpl index 25c498bc..b42257aa 100644 --- a/templates/Froxlor/admin/admins/admins_edit.tpl +++ b/templates/Froxlor/admin/admins/admins_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/admin/aps/manage_instances.tpl b/templates/Froxlor/admin/aps/manage_instances.tpl index 4ecbbdbd..cabd79e2 100644 --- a/templates/Froxlor/admin/aps/manage_instances.tpl +++ b/templates/Froxlor/admin/aps/manage_instances.tpl @@ -1,7 +1,7 @@

-   +   {$lng['aps']['specialoptions']}

@@ -21,7 +21,7 @@

-   +   {$lng['aps']['manageinstances']}

diff --git a/templates/Froxlor/admin/aps/manage_packages.tpl b/templates/Froxlor/admin/aps/manage_packages.tpl index 0dcbb46d..ca3b367c 100644 --- a/templates/Froxlor/admin/aps/manage_packages.tpl +++ b/templates/Froxlor/admin/aps/manage_packages.tpl @@ -1,7 +1,7 @@

-   +   {$lng['aps']['specialoptions']}

@@ -62,7 +62,7 @@

-   +   {$lng['aps']['managepackages']}

diff --git a/templates/Froxlor/admin/aps/manage_packages_download.tpl b/templates/Froxlor/admin/aps/manage_packages_download.tpl index ad08fb34..e2eceaf7 100644 --- a/templates/Froxlor/admin/aps/manage_packages_download.tpl +++ b/templates/Froxlor/admin/aps/manage_packages_download.tpl @@ -1,7 +1,7 @@

-   +   {$lng['aps']['specialoptions']}

diff --git a/templates/Froxlor/admin/aps/upload.tpl b/templates/Froxlor/admin/aps/upload.tpl index f2f053b1..7744e666 100644 --- a/templates/Froxlor/admin/aps/upload.tpl +++ b/templates/Froxlor/admin/aps/upload.tpl @@ -1,7 +1,7 @@

-   +   {$lng['aps']['upload']}

diff --git a/templates/Froxlor/admin/configfiles/choose.tpl b/templates/Froxlor/admin/configfiles/choose.tpl index 13ce6f1d..4b80345b 100644 --- a/templates/Froxlor/admin/configfiles/choose.tpl +++ b/templates/Froxlor/admin/configfiles/choose.tpl @@ -2,7 +2,7 @@ $header

- {$lng['admin']['configfiles']['serverconfiguration']}  + {$lng['admin']['configfiles']['serverconfiguration']}  {$lng['admin']['configfiles']['serverconfiguration']}   [{$lng['admin']['configfiles']['wizard']}]

diff --git a/templates/Froxlor/admin/configfiles/configfiles.tpl b/templates/Froxlor/admin/configfiles/configfiles.tpl index 8abf7226..96e306a1 100644 --- a/templates/Froxlor/admin/configfiles/configfiles.tpl +++ b/templates/Froxlor/admin/configfiles/configfiles.tpl @@ -2,7 +2,7 @@ $header

-   +   {$configfiles[$distribution]['label']} »  {$configfiles[$distribution]['services'][$service]['label']} »  {$configfiles[$distribution]['services'][$service]['daemons'][$daemon]['label']}  diff --git a/templates/Froxlor/admin/configfiles/wizard.tpl b/templates/Froxlor/admin/configfiles/wizard.tpl index b876a2c1..76fa9ea6 100644 --- a/templates/Froxlor/admin/configfiles/wizard.tpl +++ b/templates/Froxlor/admin/configfiles/wizard.tpl @@ -2,7 +2,7 @@ $header

- {$lng['admin']['configfiles']['serverconfiguration']}  + {$lng['admin']['configfiles']['serverconfiguration']}  {$lng['admin']['configfiles']['serverconfiguration']}   [{$lng['admin']['configfiles']['overview']}]

diff --git a/templates/Froxlor/admin/cronjobs/cronjob_edit.tpl b/templates/Froxlor/admin/cronjobs/cronjob_edit.tpl index 25004b08..7722c794 100644 --- a/templates/Froxlor/admin/cronjobs/cronjob_edit.tpl +++ b/templates/Froxlor/admin/cronjobs/cronjob_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/admin/cronjobs/cronjobs.tpl b/templates/Froxlor/admin/cronjobs/cronjobs.tpl index 91bdd751..42fdaac1 100644 --- a/templates/Froxlor/admin/cronjobs/cronjobs.tpl +++ b/templates/Froxlor/admin/cronjobs/cronjobs.tpl @@ -1,7 +1,7 @@ $header
-

+

{$lng['admin']['cron']['cronsettings']}

diff --git a/templates/Froxlor/admin/cronjobs/cronjobs_cronjob.tpl b/templates/Froxlor/admin/cronjobs/cronjobs_cronjob.tpl index aceafc47..b19858d2 100644 --- a/templates/Froxlor/admin/cronjobs/cronjobs_cronjob.tpl +++ b/templates/Froxlor/admin/cronjobs/cronjobs_cronjob.tpl @@ -5,7 +5,7 @@

diff --git a/templates/Froxlor/admin/customers/customers.tpl b/templates/Froxlor/admin/customers/customers.tpl index 26f2b2e7..e811f8a8 100644 --- a/templates/Froxlor/admin/customers/customers.tpl +++ b/templates/Froxlor/admin/customers/customers.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['admin']['customers']} ({$customercount})

@@ -17,7 +17,7 @@ $header @@ -55,7 +55,7 @@ $header diff --git a/templates/Froxlor/admin/customers/customers_add.tpl b/templates/Froxlor/admin/customers/customers_add.tpl index acee1490..7a3892e9 100644 --- a/templates/Froxlor/admin/customers/customers_add.tpl +++ b/templates/Froxlor/admin/customers/customers_add.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/admin/customers/customers_customer.tpl b/templates/Froxlor/admin/customers/customers_customer.tpl index dd4842fe..f9f070c5 100644 --- a/templates/Froxlor/admin/customers/customers_customer.tpl +++ b/templates/Froxlor/admin/customers/customers_customer.tpl @@ -51,10 +51,10 @@
diff --git a/templates/Froxlor/admin/customers/customers_edit.tpl b/templates/Froxlor/admin/customers/customers_edit.tpl index f70df89d..36cf7775 100644 --- a/templates/Froxlor/admin/customers/customers_edit.tpl +++ b/templates/Froxlor/admin/customers/customers_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/admin/domains/domains.tpl b/templates/Froxlor/admin/domains/domains.tpl index 774ede02..1420e111 100644 --- a/templates/Froxlor/admin/domains/domains.tpl +++ b/templates/Froxlor/admin/domains/domains.tpl @@ -2,7 +2,7 @@

-   +   {$lng['admin']['domains']} ({$domainscount})

@@ -17,7 +17,7 @@ @@ -61,7 +61,7 @@ diff --git a/templates/Froxlor/admin/domains/domains_add.tpl b/templates/Froxlor/admin/domains/domains_add.tpl index 38f322c8..d5651d36 100644 --- a/templates/Froxlor/admin/domains/domains_add.tpl +++ b/templates/Froxlor/admin/domains/domains_add.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/admin/domains/domains_domain.tpl b/templates/Froxlor/admin/domains/domains_domain.tpl index 48450829..ea42f88f 100644 --- a/templates/Froxlor/admin/domains/domains_domain.tpl +++ b/templates/Froxlor/admin/domains/domains_domain.tpl @@ -10,12 +10,12 @@
').prependTo(this._elem)}else{p=e('').appendTo(this._elem)}for(D=0;D0){F=true}else{F=false}}else{if(E==n-1){F=false}else{F=true}}w=(F)?this.rowSpacing:"0";t=e('');r=e('');if(this.escapeHtml){r.text(u)}else{r.html(u)}if(x){r.prependTo(p);t.prependTo(p)}else{t.appendTo(p);r.appendTo(p)}F=true}A++}}}}return this._elem};function c(r,q,o){o=o||{};o.axesDefaults=o.axesDefaults||{};o.legend=o.legend||{};o.seriesDefaults=o.seriesDefaults||{};var n=false;if(o.seriesDefaults.renderer==e.jqplot.DonutRenderer){n=true}else{if(o.series){for(var p=0;p= 0.6) ? rgba[3]*0.6 : rgba[3]*(2-rgba[3]); + drag.color = 'rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+alpha+')'; + } + mr.color = drag.color; + mr.init(); + + var start = (neighbor.pointIndex > 0) ? neighbor.pointIndex - 1 : 0; + var end = neighbor.pointIndex+2; + drag._gridData = s.gridData.slice(start, end); + } + + function handleMove(ev, gridpos, datapos, neighbor, plot) { + if (plot.plugins.dragable.dragCanvas.isDragging) { + var dc = plot.plugins.dragable.dragCanvas; + var dp = dc._neighbor; + var s = plot.series[dp.seriesIndex]; + var drag = s.plugins.dragable; + var gd = s.gridData; + + // compute the new grid position with any constraints. + var x = (drag.constrainTo == 'y') ? dp.gridData[0] : gridpos.x; + var y = (drag.constrainTo == 'x') ? dp.gridData[1] : gridpos.y; + + // compute data values for any listeners. + var xu = s._xaxis.series_p2u(x); + var yu = s._yaxis.series_p2u(y); + + // clear the canvas then redraw effect at new position. + var ctx = dc._ctx; + ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); + + // adjust our gridData for the new mouse position + if (dp.pointIndex > 0) { + drag._gridData[1] = [x, y]; + } + else { + drag._gridData[0] = [x, y]; + } + plot.series[dp.seriesIndex].draw(dc._ctx, {gridData:drag._gridData, shadow:false, preventJqPlotSeriesDrawTrigger:true, color:drag.color, markerOptions:{color:drag.color, shadow:false}, trendline:{show:false}}); + plot.target.trigger('jqplotSeriesPointChange', [dp.seriesIndex, dp.pointIndex, [xu,yu], [x,y]]); + } + else if (neighbor != null) { + var series = plot.series[neighbor.seriesIndex]; + if (series.isDragable) { + var dc = plot.plugins.dragable.dragCanvas; + if (!dc.isOver) { + dc._cursors.push(ev.target.style.cursor); + ev.target.style.cursor = "pointer"; + } + dc.isOver = true; + } + } + else if (neighbor == null) { + var dc = plot.plugins.dragable.dragCanvas; + if (dc.isOver) { + ev.target.style.cursor = dc._cursors.pop(); + dc.isOver = false; + } + } + } + + function handleDown(ev, gridpos, datapos, neighbor, plot) { + var dc = plot.plugins.dragable.dragCanvas; + dc._cursors.push(ev.target.style.cursor); + if (neighbor != null) { + var s = plot.series[neighbor.seriesIndex]; + var drag = s.plugins.dragable; + if (s.isDragable && !dc.isDragging) { + dc._neighbor = neighbor; + dc.isDragging = true; + initDragPoint(plot, neighbor); + drag.markerRenderer.draw(s.gridData[neighbor.pointIndex][0], s.gridData[neighbor.pointIndex][1], dc._ctx); + ev.target.style.cursor = "move"; + plot.target.trigger('jqplotDragStart', [neighbor.seriesIndex, neighbor.pointIndex, gridpos, datapos]); + } + } + // Just in case of a hickup, we'll clear the drag canvas and reset. + else { + var ctx = dc._ctx; + ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); + dc.isDragging = false; + } + } + + function handleUp(ev, gridpos, datapos, neighbor, plot) { + if (plot.plugins.dragable.dragCanvas.isDragging) { + var dc = plot.plugins.dragable.dragCanvas; + // clear the canvas + var ctx = dc._ctx; + ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); + dc.isDragging = false; + // redraw the series canvas at the new point. + var dp = dc._neighbor; + var s = plot.series[dp.seriesIndex]; + var drag = s.plugins.dragable; + // compute the new grid position with any constraints. + var x = (drag.constrainTo == 'y') ? dp.data[0] : datapos[s.xaxis]; + var y = (drag.constrainTo == 'x') ? dp.data[1] : datapos[s.yaxis]; + // var x = datapos[s.xaxis]; + // var y = datapos[s.yaxis]; + s.data[dp.pointIndex][0] = x; + s.data[dp.pointIndex][1] = y; + plot.drawSeries({preventJqPlotSeriesDrawTrigger:true}, dp.seriesIndex); + dc._neighbor = null; + ev.target.style.cursor = dc._cursors.pop(); + plot.target.trigger('jqplotDragStop', [gridpos, datapos]); + } + } +})(jQuery); \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.dragable.min.js b/templates/Froxlor/assets/js/plugins/jqplot.dragable.min.js new file mode 100644 index 00000000..480d9a33 --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.dragable.min.js @@ -0,0 +1,30 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function(d){d.jqplot.Dragable=function(g){this.markerRenderer=new d.jqplot.MarkerRenderer({shadow:false});this.shapeRenderer=new d.jqplot.ShapeRenderer();this.isDragging=false;this.isOver=false;this._ctx;this._elem;this._point;this._gridData;this.color;this.constrainTo="none";d.extend(true,this,g)};function b(){d.jqplot.GenericCanvas.call(this);this.isDragging=false;this.isOver=false;this._neighbor;this._cursors=[]}b.prototype=new d.jqplot.GenericCanvas();b.prototype.constructor=b;d.jqplot.Dragable.parseOptions=function(i,h){var g=h||{};this.plugins.dragable=new d.jqplot.Dragable(g.dragable);this.isDragable=d.jqplot.config.enablePlugins};d.jqplot.Dragable.postPlotDraw=function(){if(this.plugins.dragable&&this.plugins.dragable.highlightCanvas){this.plugins.dragable.highlightCanvas.resetCanvas();this.plugins.dragable.highlightCanvas=null}this.plugins.dragable={previousCursor:"auto",isOver:false};this.plugins.dragable.dragCanvas=new b();this.eventCanvas._elem.before(this.plugins.dragable.dragCanvas.createElement(this._gridPadding,"jqplot-dragable-canvas",this._plotDimensions,this));var g=this.plugins.dragable.dragCanvas.setContext()};d.jqplot.preParseSeriesOptionsHooks.push(d.jqplot.Dragable.parseOptions);d.jqplot.postDrawHooks.push(d.jqplot.Dragable.postPlotDraw);d.jqplot.eventListenerHooks.push(["jqplotMouseMove",e]);d.jqplot.eventListenerHooks.push(["jqplotMouseDown",c]);d.jqplot.eventListenerHooks.push(["jqplotMouseUp",a]);function f(n,p){var q=n.series[p.seriesIndex];var m=q.plugins.dragable;var h=q.markerRenderer;var i=m.markerRenderer;i.style=h.style;i.lineWidth=h.lineWidth+2.5;i.size=h.size+5;if(!m.color){var l=d.jqplot.getColorComponents(h.color);var o=[l[0],l[1],l[2]];var k=(l[3]>=0.6)?l[3]*0.6:l[3]*(2-l[3]);m.color="rgba("+o[0]+","+o[1]+","+o[2]+","+k+")"}i.color=m.color;i.init();var g=(p.pointIndex>0)?p.pointIndex-1:0;var j=p.pointIndex+2;m._gridData=q.gridData.slice(g,j)}function e(o,l,h,t,m){if(m.plugins.dragable.dragCanvas.isDragging){var u=m.plugins.dragable.dragCanvas;var i=u._neighbor;var w=m.series[i.seriesIndex];var k=w.plugins.dragable;var r=w.gridData;var p=(k.constrainTo=="y")?i.gridData[0]:l.x;var n=(k.constrainTo=="x")?i.gridData[1]:l.y;var g=w._xaxis.series_p2u(p);var q=w._yaxis.series_p2u(n);var v=u._ctx;v.clearRect(0,0,v.canvas.width,v.canvas.height);if(i.pointIndex>0){k._gridData[1]=[p,n]}else{k._gridData[0]=[p,n]}m.series[i.seriesIndex].draw(u._ctx,{gridData:k._gridData,shadow:false,preventJqPlotSeriesDrawTrigger:true,color:k.color,markerOptions:{color:k.color,shadow:false},trendline:{show:false}});m.target.trigger("jqplotSeriesPointChange",[i.seriesIndex,i.pointIndex,[g,q],[p,n]])}else{if(t!=null){var j=m.series[t.seriesIndex];if(j.isDragable){var u=m.plugins.dragable.dragCanvas;if(!u.isOver){u._cursors.push(o.target.style.cursor);o.target.style.cursor="pointer"}u.isOver=true}}else{if(t==null){var u=m.plugins.dragable.dragCanvas;if(u.isOver){o.target.style.cursor=u._cursors.pop();u.isOver=false}}}}}function c(k,i,g,l,j){var m=j.plugins.dragable.dragCanvas;m._cursors.push(k.target.style.cursor);if(l!=null){var o=j.series[l.seriesIndex];var h=o.plugins.dragable;if(o.isDragable&&!m.isDragging){m._neighbor=l;m.isDragging=true;f(j,l);h.markerRenderer.draw(o.gridData[l.pointIndex][0],o.gridData[l.pointIndex][1],m._ctx);k.target.style.cursor="move";j.target.trigger("jqplotDragStart",[l.seriesIndex,l.pointIndex,i,g])}}else{var n=m._ctx;n.clearRect(0,0,n.canvas.width,n.canvas.height);m.isDragging=false}}function a(m,j,g,o,k){if(k.plugins.dragable.dragCanvas.isDragging){var p=k.plugins.dragable.dragCanvas;var q=p._ctx;q.clearRect(0,0,q.canvas.width,q.canvas.height);p.isDragging=false;var h=p._neighbor;var r=k.series[h.seriesIndex];var i=r.plugins.dragable;var n=(i.constrainTo=="y")?h.data[0]:g[r.xaxis];var l=(i.constrainTo=="x")?h.data[1]:g[r.yaxis];r.data[h.pointIndex][0]=n;r.data[h.pointIndex][1]=l;k.drawSeries({preventJqPlotSeriesDrawTrigger:true},h.seriesIndex);p._neighbor=null;m.target.style.cursor=p._cursors.pop();k.target.trigger("jqplotDragStop",[j,g])}}})(jQuery); \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.enhancedLegendRenderer.js b/templates/Froxlor/assets/js/plugins/jqplot.enhancedLegendRenderer.js new file mode 100644 index 00000000..fc06d207 --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.enhancedLegendRenderer.js @@ -0,0 +1,199 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + // class $.jqplot.EnhancedLegendRenderer + // Legend renderer which can specify the number of rows and/or columns in the legend. + $.jqplot.EnhancedLegendRenderer = function(){ + $.jqplot.TableLegendRenderer.call(this); + }; + + $.jqplot.EnhancedLegendRenderer.prototype = new $.jqplot.TableLegendRenderer(); + $.jqplot.EnhancedLegendRenderer.prototype.constructor = $.jqplot.EnhancedLegendRenderer; + + // called with scope of legend. + $.jqplot.EnhancedLegendRenderer.prototype.init = function(options) { + // prop: numberRows + // Maximum number of rows in the legend. 0 or null for unlimited. + this.numberRows = null; + // prop: numberColumns + // Maximum number of columns in the legend. 0 or null for unlimited. + this.numberColumns = null; + // prop: seriesToggle + // false to not enable series on/off toggling on the legend. + // true or a fadein/fadeout speed (number of milliseconds or 'fast', 'normal', 'slow') + // to enable show/hide of series on click of legend item. + this.seriesToggle = 'normal'; + // prop: disableIEFading + // true to toggle series with a show/hide method only and not allow fading in/out. + // This is to overcome poor performance of fade in some versions of IE. + this.disableIEFading = true; + $.extend(true, this, options); + + if (this.seriesToggle) { + $.jqplot.postDrawHooks.push(postDraw); + } + }; + + // called with scope of legend + $.jqplot.EnhancedLegendRenderer.prototype.draw = function() { + var legend = this; + if (this.show) { + var series = this._series; + var s; + var ss = 'position:absolute;'; + ss += (this.background) ? 'background:'+this.background+';' : ''; + ss += (this.border) ? 'border:'+this.border+';' : ''; + ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : ''; + ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : ''; + ss += (this.textColor) ? 'color:'+this.textColor+';' : ''; + ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : ''; + ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : ''; + ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : ''; + ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : ''; + this._elem = $('
   $completeLink   $completeLink
$navigation_links - {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']}
{$row['isactive']} - {$lng['panel']['edit']} + {$lng['panel']['edit']}
- {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']}
- {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']} diff --git a/templates/Froxlor/admin/domains/domains_edit.tpl b/templates/Froxlor/admin/domains/domains_edit.tpl index eca91668..0af64edb 100644 --- a/templates/Froxlor/admin/domains/domains_edit.tpl +++ b/templates/Froxlor/admin/domains/domains_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/admin/froxlorclients/froxlorclient_settings.tpl b/templates/Froxlor/admin/froxlorclients/froxlorclient_settings.tpl index c61df999..5991da67 100644 --- a/templates/Froxlor/admin/froxlorclients/froxlorclient_settings.tpl +++ b/templates/Froxlor/admin/froxlorclients/froxlorclient_settings.tpl @@ -1,6 +1,6 @@ - diff --git a/templates/Froxlor/admin/froxlorclients/froxlorclient_settingsoverview.tpl b/templates/Froxlor/admin/froxlorclients/froxlorclient_settingsoverview.tpl index 0501faab..546067ae 100644 --- a/templates/Froxlor/admin/froxlorclients/froxlorclient_settingsoverview.tpl +++ b/templates/Froxlor/admin/froxlorclients/froxlorclient_settingsoverview.tpl @@ -1,7 +1,7 @@
 {$lng['admin']['froxlorclient_settings']}  +  {$lng['admin']['froxlorclient_settings']}  "{$client->Get('name')}" [{$lng['admin']['configfiles']['compactoverview']}]
diff --git a/templates/Froxlor/admin/froxlorclients/froxlorclient_settingsoverviewgroup.tpl b/templates/Froxlor/admin/froxlorclients/froxlorclient_settingsoverviewgroup.tpl index 7c961c35..e9a96778 100644 --- a/templates/Froxlor/admin/froxlorclients/froxlorclient_settingsoverviewgroup.tpl +++ b/templates/Froxlor/admin/froxlorclients/froxlorclient_settingsoverviewgroup.tpl @@ -1,6 +1,6 @@ ').prependTo(this._elem); + } + else{ + tr = $('').appendTo(this._elem); + } + for (j=0; j0){ + pad = true; + } + else{ + pad = false; + } + } + else{ + if (i == nr -1){ + pad = false; + } + else{ + pad = true; + } + } + rs = (pad) ? this.rowSpacing : '0'; + + td1 = $(''); + td2 = $(''); + if (this.escapeHtml){ + td2.text(lt); + } + else { + td2.html(lt); + } + if (reverse) { + td2.prependTo(tr); + td1.prependTo(tr); + } + else { + td1.appendTo(tr); + td2.appendTo(tr); + } + pad = true; + } + idx++; + } + } + } + } + return this._elem; + }; + + // $.jqplot.DonutLegendRenderer.prototype.pack = function(offsets) { + // if (this.show) { + // // fake a grid for positioning + // var grid = {_top:offsets.top, _left:offsets.left, _right:offsets.right, _bottom:this._plotDimensions.height - offsets.bottom}; + // if (this.placement == 'insideGrid') { + // switch (this.location) { + // case 'nw': + // var a = grid._left + this.xoffset; + // var b = grid._top + this.yoffset; + // this._elem.css('left', a); + // this._elem.css('top', b); + // break; + // case 'n': + // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + // var b = grid._top + this.yoffset; + // this._elem.css('left', a); + // this._elem.css('top', b); + // break; + // case 'ne': + // var a = offsets.right + this.xoffset; + // var b = grid._top + this.yoffset; + // this._elem.css({right:a, top:b}); + // break; + // case 'e': + // var a = offsets.right + this.xoffset; + // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + // this._elem.css({right:a, top:b}); + // break; + // case 'se': + // var a = offsets.right + this.xoffset; + // var b = offsets.bottom + this.yoffset; + // this._elem.css({right:a, bottom:b}); + // break; + // case 's': + // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + // var b = offsets.bottom + this.yoffset; + // this._elem.css({left:a, bottom:b}); + // break; + // case 'sw': + // var a = grid._left + this.xoffset; + // var b = offsets.bottom + this.yoffset; + // this._elem.css({left:a, bottom:b}); + // break; + // case 'w': + // var a = grid._left + this.xoffset; + // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + // this._elem.css({left:a, top:b}); + // break; + // default: // same as 'se' + // var a = grid._right - this.xoffset; + // var b = grid._bottom + this.yoffset; + // this._elem.css({right:a, bottom:b}); + // break; + // } + // + // } + // else { + // switch (this.location) { + // case 'nw': + // var a = this._plotDimensions.width - grid._left + this.xoffset; + // var b = grid._top + this.yoffset; + // this._elem.css('right', a); + // this._elem.css('top', b); + // break; + // case 'n': + // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + // var b = this._plotDimensions.height - grid._top + this.yoffset; + // this._elem.css('left', a); + // this._elem.css('bottom', b); + // break; + // case 'ne': + // var a = this._plotDimensions.width - offsets.right + this.xoffset; + // var b = grid._top + this.yoffset; + // this._elem.css({left:a, top:b}); + // break; + // case 'e': + // var a = this._plotDimensions.width - offsets.right + this.xoffset; + // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + // this._elem.css({left:a, top:b}); + // break; + // case 'se': + // var a = this._plotDimensions.width - offsets.right + this.xoffset; + // var b = offsets.bottom + this.yoffset; + // this._elem.css({left:a, bottom:b}); + // break; + // case 's': + // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + // var b = this._plotDimensions.height - offsets.bottom + this.yoffset; + // this._elem.css({left:a, top:b}); + // break; + // case 'sw': + // var a = this._plotDimensions.width - grid._left + this.xoffset; + // var b = offsets.bottom + this.yoffset; + // this._elem.css({right:a, bottom:b}); + // break; + // case 'w': + // var a = this._plotDimensions.width - grid._left + this.xoffset; + // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + // this._elem.css({right:a, top:b}); + // break; + // default: // same as 'se' + // var a = grid._right - this.xoffset; + // var b = grid._bottom + this.yoffset; + // this._elem.css({right:a, bottom:b}); + // break; + // } + // } + // } + // }; + + // setup default renderers for axes and legend so user doesn't have to + // called with scope of plot + function preInit(target, data, options) { + options = options || {}; + options.axesDefaults = options.axesDefaults || {}; + options.legend = options.legend || {}; + options.seriesDefaults = options.seriesDefaults || {}; + // only set these if there is a donut series + var setopts = false; + if (options.seriesDefaults.renderer == $.jqplot.DonutRenderer) { + setopts = true; + } + else if (options.series) { + for (var i=0; i < options.series.length; i++) { + if (options.series[i].renderer == $.jqplot.DonutRenderer) { + setopts = true; + } + } + } + + if (setopts) { + options.axesDefaults.renderer = $.jqplot.DonutAxisRenderer; + options.legend.renderer = $.jqplot.DonutLegendRenderer; + options.legend.preDraw = true; + options.seriesDefaults.pointLabels = {show: false}; + } + } + + // called with scope of plot. + function postInit(target, data, options) { + // if multiple series, add a reference to the previous one so that + // donut rings can nest. + for (var i=1; i570)?n[o]*0.8:n[o]+0.3*(255-n[o]);n[o]=parseInt(n[o],10)}this.highlightColors.push("rgb("+n[0]+","+n[1]+","+n[2]+")")}}t.postParseOptionsHooks.addOnce(l);t.postInitHooks.addOnce(g);t.eventListenerHooks.addOnce("jqplotMouseMove",b);t.eventListenerHooks.addOnce("jqplotMouseDown",a);t.eventListenerHooks.addOnce("jqplotMouseUp",j);t.eventListenerHooks.addOnce("jqplotClick",f);t.eventListenerHooks.addOnce("jqplotRightClick",m);t.postDrawHooks.addOnce(h)};e.jqplot.DonutRenderer.prototype.setGridData=function(s){var o=[];var t=[];var n=this.startAngle/180*Math.PI;var r=0;this._drawData=false;for(var q=0;q0){o[q]+=o[q-1]}r+=this.data[q][1]}var p=Math.PI*2/o[o.length-1];for(var q=0;q0){o[q]+=o[q-1]}r+=s[q][1]}var p=Math.PI*2/o[o.length-1];for(var q=0;q6.282+this.startAngle){t=6.282+this.startAngle;if(u>t){u=6.281+this.startAngle}}if(u>=t){return}x.beginPath();x.fillStyle=p;x.strokeStyle=p;x.arc(0,0,n,u,t,false);x.lineTo(v*Math.cos(t),v*Math.sin(t));x.arc(0,0,v,t,u,true);x.closePath();if(w){x.fill()}else{x.stroke()}}if(s){for(var q=0;q1&&this.index>0)?this._previousSeries[0]._diameter:this._diameter;this._thickness=this.thickness||(M-this.innerDiameter-2*X*this._numberSeries)/this._numberSeries/2}else{this._thickness=this.thickness||v/2/(this._numberSeries+1)*0.85}var K=this._radius=this._diameter/2;this._innerRadius=this._radius-this._thickness;var o=this.startAngle/180*Math.PI;this._center=[(s-u*q)/2+u*q,(H-u*p)/2+u*p];if(this.shadow){var L="rgba(0,0,0,"+this.shadowAlpha+")";for(var Q=0;Q=this.dataLabelThreshold){var S,U=(A+z)/2,C;if(this.dataLabels=="label"){S=this.dataLabelFormatString||"%s";C=e.jqplot.sprintf(S,V[Q][0])}else{if(this.dataLabels=="value"){S=this.dataLabelFormatString||"%d";C=e.jqplot.sprintf(S,this.data[Q][1])}else{if(this.dataLabels=="percent"){S=this.dataLabelFormatString||"%d%%";C=e.jqplot.sprintf(S,V[Q][2]*100)}else{if(this.dataLabels.constructor==Array){S=this.dataLabelFormatString||"%s";C=e.jqplot.sprintf(S,this.dataLabels[Q])}}}}var n=this._innerRadius+this._thickness*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge;var F=this._center[0]+Math.cos(U)*n+this.canvas._offsets.left;var E=this._center[1]+Math.sin(U)*n+this.canvas._offsets.top;var D=e(''+C+"").insertBefore(P.eventCanvas._elem);F-=D.width()/2;E-=D.height()/2;F=Math.round(F);E=Math.round(E);D.css({left:F,top:E})}}};e.jqplot.DonutAxisRenderer=function(){e.jqplot.LinearAxisRenderer.call(this)};e.jqplot.DonutAxisRenderer.prototype=new e.jqplot.LinearAxisRenderer();e.jqplot.DonutAxisRenderer.prototype.constructor=e.jqplot.DonutAxisRenderer;e.jqplot.DonutAxisRenderer.prototype.init=function(n){this.tickRenderer=e.jqplot.DonutTickRenderer;e.extend(true,this,n);this._dataBounds={min:0,max:100};this.min=0;this.max=100;this.showTicks=false;this.ticks=[];this.showMark=false;this.show=false};e.jqplot.DonutLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)};e.jqplot.DonutLegendRenderer.prototype=new e.jqplot.TableLegendRenderer();e.jqplot.DonutLegendRenderer.prototype.constructor=e.jqplot.DonutLegendRenderer;e.jqplot.DonutLegendRenderer.prototype.init=function(n){this.numberRows=null;this.numberColumns=null;e.extend(true,this,n)};e.jqplot.DonutLegendRenderer.prototype.draw=function(){var q=this;if(this.show){var y=this._series;var B="position:absolute;";B+=(this.background)?"background:"+this.background+";":"";B+=(this.border)?"border:"+this.border+";":"";B+=(this.fontSize)?"font-size:"+this.fontSize+";":"";B+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";B+=(this.textColor)?"color:"+this.textColor+";":"";B+=(this.marginTop!=null)?"margin-top:"+this.marginTop+";":"";B+=(this.marginBottom!=null)?"margin-bottom:"+this.marginBottom+";":"";B+=(this.marginLeft!=null)?"margin-left:"+this.marginLeft+";":"";B+=(this.marginRight!=null)?"margin-right:"+this.marginRight+";":"";this._elem=e('
-  {$lng['admin']['configfiles']['serverconfiguration']}  +  {$lng['admin']['configfiles']['serverconfiguration']}  "{$client->Get('name')}" [{$lng['admin']['configfiles']['overview']}]
-  {$title} +  {$title} {$option} diff --git a/templates/Froxlor/admin/froxlorclients/froxlorclients.tpl b/templates/Froxlor/admin/froxlorclients/froxlorclients.tpl index 72f71f94..921daa5a 100644 --- a/templates/Froxlor/admin/froxlorclients/froxlorclients.tpl +++ b/templates/Froxlor/admin/froxlorclients/froxlorclients.tpl @@ -4,7 +4,7 @@ $header - + diff --git a/templates/Froxlor/admin/froxlorclients/froxlorclients_add.tpl b/templates/Froxlor/admin/froxlorclients/froxlorclients_add.tpl index 614237cd..b5de16cd 100644 --- a/templates/Froxlor/admin/froxlorclients/froxlorclients_add.tpl +++ b/templates/Froxlor/admin/froxlorclients/froxlorclients_add.tpl @@ -5,11 +5,11 @@ $header
 {$lng['menue']['multiserver']['clients']} {$lng['menue']['multiserver']['clients']} {$searchcode}
- + diff --git a/templates/Froxlor/admin/froxlorclients/froxlorclients_edit.tpl b/templates/Froxlor/admin/froxlorclients/froxlorclients_edit.tpl index 9a231403..7c71840b 100644 --- a/templates/Froxlor/admin/froxlorclients/froxlorclients_edit.tpl +++ b/templates/Froxlor/admin/froxlorclients/froxlorclients_edit.tpl @@ -7,11 +7,11 @@ $header
 {$lng['admin']['froxlorclients']['add']} {$lng['admin']['froxlorclients']['add']}
-  {$lng['admin']['froxlorclients']['client']} +  {$lng['admin']['froxlorclients']['client']} diff --git a/templates/Froxlor/admin/froxlorclients/froxlorclients_client.tpl b/templates/Froxlor/admin/froxlorclients/froxlorclients_client.tpl index 10ef004d..b4a626a9 100644 --- a/templates/Froxlor/admin/froxlorclients/froxlorclients_client.tpl +++ b/templates/Froxlor/admin/froxlorclients/froxlorclients_client.tpl @@ -1,7 +1,7 @@
- Client #{$row['id']} + Client #{$row['id']} @@ -12,17 +12,17 @@ - {$lng['panel']['yes']} + {$lng['panel']['yes']} - {$lng['panel']['no']} + {$lng['panel']['no']} - {$lng['admin']['froxlorclients']['view']} + {$lng['admin']['froxlorclients']['view']}
- + diff --git a/templates/Froxlor/admin/settings/settings.tpl b/templates/Froxlor/admin/settings/settings.tpl index 30a7f497..2f33d536 100644 --- a/templates/Froxlor/admin/settings/settings.tpl +++ b/templates/Froxlor/admin/settings/settings.tpl @@ -1,7 +1,7 @@

-   +   {$lng['admin']['serversettings']}   [{$lng['admin']['configfiles']['compactoverview']}]

diff --git a/templates/Froxlor/admin/settings/settings_group.tpl b/templates/Froxlor/admin/settings/settings_group.tpl index 66cdb0e2..eac70035 100644 --- a/templates/Froxlor/admin/settings/settings_group.tpl +++ b/templates/Froxlor/admin/settings/settings_group.tpl @@ -1,6 +1,6 @@
diff --git a/templates/Froxlor/admin/templates/templates_template.tpl b/templates/Froxlor/admin/templates/templates_template.tpl index 4ecc0088..765ba676 100644 --- a/templates/Froxlor/admin/templates/templates_template.tpl +++ b/templates/Froxlor/admin/templates/templates_template.tpl @@ -3,10 +3,10 @@ diff --git a/templates/Froxlor/admin/tickets/archive.tpl b/templates/Froxlor/admin/tickets/archive.tpl index 50387d0b..b43688b2 100644 --- a/templates/Froxlor/admin/tickets/archive.tpl +++ b/templates/Froxlor/admin/tickets/archive.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['ticket']['lastarchived']}

@@ -32,7 +32,7 @@ $header

-   +   {$lng['ticket']['search']}

diff --git a/templates/Froxlor/admin/tickets/archived_tickets.tpl b/templates/Froxlor/admin/tickets/archived_tickets.tpl index da41c39c..a93c2e8a 100644 --- a/templates/Froxlor/admin/tickets/archived_tickets.tpl +++ b/templates/Froxlor/admin/tickets/archived_tickets.tpl @@ -6,7 +6,7 @@
diff --git a/templates/Froxlor/admin/tickets/archivesearch.tpl b/templates/Froxlor/admin/tickets/archivesearch.tpl index 57c16729..ed9d1f1c 100644 --- a/templates/Froxlor/admin/tickets/archivesearch.tpl +++ b/templates/Froxlor/admin/tickets/archivesearch.tpl @@ -5,7 +5,7 @@ $header
 {$lng['admin']['froxlorclients']['edit']} {$lng['admin']['froxlorclients']['edit']}
-  {$lng['admin']['froxlorclients']['client']} +  {$lng['admin']['froxlorclients']['client']} diff --git a/templates/Froxlor/admin/froxlorclients/froxlorclients_tasks.tpl b/templates/Froxlor/admin/froxlorclients/froxlorclients_tasks.tpl index 968ea9b1..acc16481 100644 --- a/templates/Froxlor/admin/froxlorclients/froxlorclients_tasks.tpl +++ b/templates/Froxlor/admin/froxlorclients/froxlorclients_tasks.tpl @@ -1,7 +1,7 @@ $header - + {$outstanding_tasks}
 {$lng['admin']['multiservercronjobs']} {$lng['admin']['multiservercronjobs']}
diff --git a/templates/Froxlor/admin/froxlorclients/froxlorclients_tasks_head.tpl b/templates/Froxlor/admin/froxlorclients/froxlorclients_tasks_head.tpl index 52b1f19d..d6ca5a45 100644 --- a/templates/Froxlor/admin/froxlorclients/froxlorclients_tasks_head.tpl +++ b/templates/Froxlor/admin/froxlorclients/froxlorclients_tasks_head.tpl @@ -1,7 +1,7 @@
- {$client->Get('name')} + {$client->Get('name')}

{$client->Get('name')} diff --git a/templates/Froxlor/admin/froxlorclients/froxlorclients_view.tpl b/templates/Froxlor/admin/froxlorclients/froxlorclients_view.tpl index 4359a1e1..fd943a79 100644 --- a/templates/Froxlor/admin/froxlorclients/froxlorclients_view.tpl +++ b/templates/Froxlor/admin/froxlorclients/froxlorclients_view.tpl @@ -5,11 +5,11 @@ $header - + @@ -49,10 +49,10 @@ $header {$lastrefresh} - {$lng['admin']['froxlorclients']['refreshsysinfo']} + {$lng['admin']['froxlorclients']['refreshsysinfo']} - {$lastrefresh} + {$lastrefresh} diff --git a/templates/Froxlor/admin/index/change_language.tpl b/templates/Froxlor/admin/index/change_language.tpl index 393cde15..f3ceccc1 100644 --- a/templates/Froxlor/admin/index/change_language.tpl +++ b/templates/Froxlor/admin/index/change_language.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['menue']['main']['changelanguage']}

diff --git a/templates/Froxlor/admin/index/change_password.tpl b/templates/Froxlor/admin/index/change_password.tpl index cd8649c0..920587d5 100644 --- a/templates/Froxlor/admin/index/change_password.tpl +++ b/templates/Froxlor/admin/index/change_password.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['menue']['main']['changepassword']}

diff --git a/templates/Froxlor/admin/index/change_theme.tpl b/templates/Froxlor/admin/index/change_theme.tpl index d34c97d6..db9c8cd4 100644 --- a/templates/Froxlor/admin/index/change_theme.tpl +++ b/templates/Froxlor/admin/index/change_theme.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['menue']['main']['changetheme']}

diff --git a/templates/Froxlor/admin/ipsandports/ipsandports.tpl b/templates/Froxlor/admin/ipsandports/ipsandports.tpl index 70ed67a0..ec0330c3 100644 --- a/templates/Froxlor/admin/ipsandports/ipsandports.tpl +++ b/templates/Froxlor/admin/ipsandports/ipsandports.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['admin']['ipsandports']['ipsandports']}

@@ -17,7 +17,7 @@ $header @@ -55,7 +55,7 @@ $header diff --git a/templates/Froxlor/admin/ipsandports/ipsandports_add.tpl b/templates/Froxlor/admin/ipsandports/ipsandports_add.tpl index 97dc5032..0c24d350 100644 --- a/templates/Froxlor/admin/ipsandports/ipsandports_add.tpl +++ b/templates/Froxlor/admin/ipsandports/ipsandports_add.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/admin/ipsandports/ipsandports_edit.tpl b/templates/Froxlor/admin/ipsandports/ipsandports_edit.tpl index 598b0212..0bcddf38 100644 --- a/templates/Froxlor/admin/ipsandports/ipsandports_edit.tpl +++ b/templates/Froxlor/admin/ipsandports/ipsandports_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/admin/ipsandports/ipsandports_ipandport.tpl b/templates/Froxlor/admin/ipsandports/ipsandports_ipandport.tpl index 11bc8908..7190e18f 100644 --- a/templates/Froxlor/admin/ipsandports/ipsandports_ipandport.tpl +++ b/templates/Froxlor/admin/ipsandports/ipsandports_ipandport.tpl @@ -8,10 +8,10 @@
diff --git a/templates/Froxlor/admin/logger/logger.tpl b/templates/Froxlor/admin/logger/logger.tpl index 3e2c7192..8c7697e2 100644 --- a/templates/Froxlor/admin/logger/logger.tpl +++ b/templates/Froxlor/admin/logger/logger.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['menue']['logger']['logger']}

@@ -17,7 +17,7 @@ $header @@ -45,7 +45,7 @@ $header diff --git a/templates/Froxlor/admin/message/message.tpl b/templates/Froxlor/admin/message/message.tpl index faa0b7f8..09417695 100644 --- a/templates/Froxlor/admin/message/message.tpl +++ b/templates/Froxlor/admin/message/message.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['admin']['message']}

diff --git a/templates/Froxlor/admin/phpconfig/overview.tpl b/templates/Froxlor/admin/phpconfig/overview.tpl index d32ccd7a..236c3a29 100644 --- a/templates/Froxlor/admin/phpconfig/overview.tpl +++ b/templates/Froxlor/admin/phpconfig/overview.tpl @@ -2,7 +2,7 @@ $header
 {$lng['menue']['multiserver']['clients']} "{$client->Get('name')}" {$lng['menue']['multiserver']['clients']} "{$client->Get('name')}"
- Client #{$row['id']} + Client #{$row['id']}

Froxlor-client "{$client->Get('name')}"

@@ -20,20 +20,20 @@ $header
- {$lng['admin']['froxlorclients']['settings']} + {$lng['admin']['froxlorclients']['settings']}   - {$lng['admin']['froxlorclients']['deploy']} + {$lng['admin']['froxlorclients']['deploy']}   - {$lng['admin']['froxlorclients']['settings']} :: {$lng['admin']['froxlorclients']['clientdisabled']}  - {$lng['admin']['froxlorclients']['deploy']} :: {$lng['admin']['froxlorclients']['clientdisabled']} + {$lng['admin']['froxlorclients']['settings']} :: {$lng['admin']['froxlorclients']['clientdisabled']}  + {$lng['admin']['froxlorclients']['deploy']} :: {$lng['admin']['froxlorclients']['clientdisabled']} - {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']}
{$lng['panel']['yes']}{$lng['panel']['no']} - {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']}
diff --git a/templates/Froxlor/admin/phpconfig/overview_add.tpl b/templates/Froxlor/admin/phpconfig/overview_add.tpl index fa953e26..631b30b6 100644 --- a/templates/Froxlor/admin/phpconfig/overview_add.tpl +++ b/templates/Froxlor/admin/phpconfig/overview_add.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

@@ -33,7 +33,7 @@ $header

-   +   {$lng['admin']['templates']['template_replace_vars']}

diff --git a/templates/Froxlor/admin/phpconfig/overview_edit.tpl b/templates/Froxlor/admin/phpconfig/overview_edit.tpl index b6e6d193..dc14a1e6 100644 --- a/templates/Froxlor/admin/phpconfig/overview_edit.tpl +++ b/templates/Froxlor/admin/phpconfig/overview_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

@@ -34,7 +34,7 @@ $header

-   +   {$lng['admin']['templates']['template_replace_vars']}

diff --git a/templates/Froxlor/admin/phpconfig/overview_overview.tpl b/templates/Froxlor/admin/phpconfig/overview_overview.tpl index 6182a449..49792004 100644 --- a/templates/Froxlor/admin/phpconfig/overview_overview.tpl +++ b/templates/Froxlor/admin/phpconfig/overview_overview.tpl @@ -5,11 +5,11 @@
{$row['file_extensions']} - {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']}
- {$groupdetails['title']} {$groupdetails['title']} + {$groupdetails['title']} {$groupdetails['title']} diff --git a/templates/Froxlor/admin/settings/settings_overview.tpl b/templates/Froxlor/admin/settings/settings_overview.tpl index 7e9baa4a..6f38a6c6 100644 --- a/templates/Froxlor/admin/settings/settings_overview.tpl +++ b/templates/Froxlor/admin/settings/settings_overview.tpl @@ -1,7 +1,7 @@

-   +   {$lng['admin']['configfiles']['serverconfiguration']}   [{$lng['admin']['configfiles']['overview']}]

diff --git a/templates/Froxlor/admin/settings/updatecounters.tpl b/templates/Froxlor/admin/settings/updatecounters.tpl index a15ea11c..7913d0ac 100644 --- a/templates/Froxlor/admin/settings/updatecounters.tpl +++ b/templates/Froxlor/admin/settings/updatecounters.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['admin']['updatecounters']}

@@ -10,7 +10,7 @@ $header
- + {$customers}
 {$lng['admin']['customers']} {$lng['admin']['customers']}
@@ -20,7 +20,7 @@ $header
- + {$admins}
 {$lng['admin']['admins']} {$lng['admin']['admins']}
diff --git a/templates/Froxlor/admin/templates/filetemplates_add.tpl b/templates/Froxlor/admin/templates/filetemplates_add.tpl index 6bac13fa..27ff6363 100644 --- a/templates/Froxlor/admin/templates/filetemplates_add.tpl +++ b/templates/Froxlor/admin/templates/filetemplates_add.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

@@ -32,7 +32,7 @@ $header

-   +   {$lng['admin']['templates']['template_replace_vars']}

diff --git a/templates/Froxlor/admin/templates/filetemplates_edit.tpl b/templates/Froxlor/admin/templates/filetemplates_edit.tpl index 9b20e384..6ff46641 100644 --- a/templates/Froxlor/admin/templates/filetemplates_edit.tpl +++ b/templates/Froxlor/admin/templates/filetemplates_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

@@ -33,7 +33,7 @@ $header

-   +   {$lng['admin']['templates']['template_replace_vars']}

diff --git a/templates/Froxlor/admin/templates/templates.tpl b/templates/Froxlor/admin/templates/templates.tpl index 7916dbdd..d726d435 100644 --- a/templates/Froxlor/admin/templates/templates.tpl +++ b/templates/Froxlor/admin/templates/templates.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['admin']['templates']['templates']}

@@ -23,7 +23,7 @@ $header @@ -35,7 +35,7 @@ $header

-   +   {$lng['admin']['templates']['filetemplates']}

@@ -55,7 +55,7 @@ $header diff --git a/templates/Froxlor/admin/templates/templates_add_1.tpl b/templates/Froxlor/admin/templates/templates_add_1.tpl index f33b3cb2..795f6cae 100644 --- a/templates/Froxlor/admin/templates/templates_add_1.tpl +++ b/templates/Froxlor/admin/templates/templates_add_1.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['admin']['templates']['template_add']}

diff --git a/templates/Froxlor/admin/templates/templates_add_2.tpl b/templates/Froxlor/admin/templates/templates_add_2.tpl index b31e023c..3c3d3e9b 100644 --- a/templates/Froxlor/admin/templates/templates_add_2.tpl +++ b/templates/Froxlor/admin/templates/templates_add_2.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

@@ -33,7 +33,7 @@ $header

-   +   {$lng['admin']['templates']['template_replace_vars']}

diff --git a/templates/Froxlor/admin/templates/templates_edit.tpl b/templates/Froxlor/admin/templates/templates_edit.tpl index ae31fb37..0f8f015b 100644 --- a/templates/Froxlor/admin/templates/templates_edit.tpl +++ b/templates/Froxlor/admin/templates/templates_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

@@ -34,7 +34,7 @@ $header

-   +   {$lng['admin']['templates']['template_replace_vars']}

diff --git a/templates/Froxlor/admin/templates/templates_filetemplate.tpl b/templates/Froxlor/admin/templates/templates_filetemplate.tpl index df9077a0..141cf4f2 100644 --- a/templates/Froxlor/admin/templates/templates_filetemplate.tpl +++ b/templates/Froxlor/admin/templates/templates_filetemplate.tpl @@ -2,10 +2,10 @@
{$lng['admin']['templates'][$row['varname']]} - {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']}
{$template} - {$lng['panel']['edit']} -   + {$lng['panel']['edit']} +   - {$lng['panel']['delete']} + {$lng['panel']['delete']}
{$ticket['priority']} - {$lng['ticket']['show']} + {$lng['ticket']['show']}
- + diff --git a/templates/Froxlor/admin/tickets/categories.tpl b/templates/Froxlor/admin/tickets/categories.tpl index a0c16bfa..39ab5615 100644 --- a/templates/Froxlor/admin/tickets/categories.tpl +++ b/templates/Froxlor/admin/tickets/categories.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['menue']['ticket']['categories']}

@@ -17,7 +17,7 @@ $header @@ -52,7 +52,7 @@ $header diff --git a/templates/Froxlor/admin/tickets/tickets.tpl b/templates/Froxlor/admin/tickets/tickets.tpl index 01fe1b3c..752c6708 100644 --- a/templates/Froxlor/admin/tickets/tickets.tpl +++ b/templates/Froxlor/admin/tickets/tickets.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['menue']['ticket']['ticket']}

@@ -17,7 +17,7 @@ $header @@ -56,7 +56,7 @@ $header diff --git a/templates/Froxlor/admin/tickets/tickets_categories.tpl b/templates/Froxlor/admin/tickets/tickets_categories.tpl index 8eebbeb6..7a0323ee 100644 --- a/templates/Froxlor/admin/tickets/tickets_categories.tpl +++ b/templates/Froxlor/admin/tickets/tickets_categories.tpl @@ -4,10 +4,10 @@
diff --git a/templates/Froxlor/admin/tickets/tickets_editcategory.tpl b/templates/Froxlor/admin/tickets/tickets_editcategory.tpl index 48cab203..4c65b7b9 100644 --- a/templates/Froxlor/admin/tickets/tickets_editcategory.tpl +++ b/templates/Froxlor/admin/tickets/tickets_editcategory.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/admin/tickets/tickets_new.tpl b/templates/Froxlor/admin/tickets/tickets_new.tpl index 9f3c7956..35121e0d 100644 --- a/templates/Froxlor/admin/tickets/tickets_new.tpl +++ b/templates/Froxlor/admin/tickets/tickets_new.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/admin/tickets/tickets_newcategory.tpl b/templates/Froxlor/admin/tickets/tickets_newcategory.tpl index c0ffa9bc..f789ffa9 100644 --- a/templates/Froxlor/admin/tickets/tickets_newcategory.tpl +++ b/templates/Froxlor/admin/tickets/tickets_newcategory.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/admin/tickets/tickets_reply.tpl b/templates/Froxlor/admin/tickets/tickets_reply.tpl index 148febde..aa45364c 100644 --- a/templates/Froxlor/admin/tickets/tickets_reply.tpl +++ b/templates/Froxlor/admin/tickets/tickets_reply.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/admin/tickets/tickets_tickets.tpl b/templates/Froxlor/admin/tickets/tickets_tickets.tpl index 8ebeed8b..563cad2c 100644 --- a/templates/Froxlor/admin/tickets/tickets_tickets.tpl +++ b/templates/Froxlor/admin/tickets/tickets_tickets.tpl @@ -8,27 +8,27 @@
diff --git a/templates/Froxlor/admin/tickets/tickets_view.tpl b/templates/Froxlor/admin/tickets/tickets_view.tpl index fbd9d131..50678cca 100644 --- a/templates/Froxlor/admin/tickets/tickets_view.tpl +++ b/templates/Froxlor/admin/tickets/tickets_view.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['ticket']['ticket_delete']}

diff --git a/templates/Froxlor/admin/traffic/index.tpl b/templates/Froxlor/admin/traffic/index.tpl index ee7bd2d3..fb21a17b 100644 --- a/templates/Froxlor/admin/traffic/index.tpl +++ b/templates/Froxlor/admin/traffic/index.tpl @@ -1,5 +1,5 @@ $header - + + * + * Data must be supplied in + * the form: + * + * > [[x1, y1, r1,
').appendTo(this._elem); + tr.data('seriesIndex', idx); + $('').appendTo(tr); + var td = $(''); + td.appendTo(tr); + td.data('seriesIndex', idx); + if (this.escapeHtml) { + td.text(label); + } + else { + td.html(label); + } + tr = null; + td = null; + } + return this._elem; + }; + +})(jQuery); \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.cursor.min.js b/templates/Froxlor/assets/js/plugins/jqplot.cursor.min.js new file mode 100644 index 00000000..c79f7271 --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.cursor.min.js @@ -0,0 +1,30 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function(j){j.jqplot.Cursor=function(q){this.style="crosshair";this.previousCursor="auto";this.show=j.jqplot.config.enablePlugins;this.showTooltip=true;this.followMouse=false;this.tooltipLocation="se";this.tooltipOffset=6;this.showTooltipGridPosition=false;this.showTooltipUnitPosition=true;this.showTooltipDataPosition=false;this.tooltipFormatString="%.4P, %.4P";this.useAxesFormatters=true;this.tooltipAxisGroups=[];this.zoom=false;this.zoomProxy=false;this.zoomTarget=false;this.looseZoom=false;this.clickReset=false;this.dblClickReset=true;this.showVerticalLine=false;this.showHorizontalLine=false;this.constrainZoomTo="none";this.shapeRenderer=new j.jqplot.ShapeRenderer();this._zoom={start:[],end:[],started:false,zooming:false,isZoomed:false,axes:{start:{},end:{}},gridpos:{},datapos:{}};this._tooltipElem;this.zoomCanvas;this.cursorCanvas;this.intersectionThreshold=2;this.showCursorLegend=false;this.cursorLegendFormatString=j.jqplot.Cursor.cursorLegendFormatString;this._oldHandlers={onselectstart:null,ondrag:null,onmousedown:null};this.constrainOutsideZoom=true;this.showTooltipOutsideZoom=false;this.onGrid=false;j.extend(true,this,q)};j.jqplot.Cursor.cursorLegendFormatString="%s x:%s, y:%s";j.jqplot.Cursor.init=function(t,s,r){var q=r||{};this.plugins.cursor=new j.jqplot.Cursor(q.cursor);var u=this.plugins.cursor;if(u.show){j.jqplot.eventListenerHooks.push(["jqplotMouseEnter",b]);j.jqplot.eventListenerHooks.push(["jqplotMouseLeave",f]);j.jqplot.eventListenerHooks.push(["jqplotMouseMove",i]);if(u.showCursorLegend){r.legend=r.legend||{};r.legend.renderer=j.jqplot.CursorLegendRenderer;r.legend.formatString=this.plugins.cursor.cursorLegendFormatString;r.legend.show=true}if(u.zoom){j.jqplot.eventListenerHooks.push(["jqplotMouseDown",a]);if(u.clickReset){j.jqplot.eventListenerHooks.push(["jqplotClick",k])}if(u.dblClickReset){j.jqplot.eventListenerHooks.push(["jqplotDblClick",c])}}this.resetZoom=function(){var x=this.axes;if(!u.zoomProxy){for(var w in x){x[w].reset();x[w]._ticks=[];x[w]._autoFormatString=u._zoom.axes[w].tickFormatString}this.redraw()}else{var v=this.plugins.cursor.zoomCanvas._ctx;v.clearRect(0,0,v.canvas.width,v.canvas.height);v=null}this.plugins.cursor._zoom.isZoomed=false;this.target.trigger("jqplotResetZoom",[this,this.plugins.cursor])};if(u.showTooltipDataPosition){u.showTooltipUnitPosition=false;u.showTooltipGridPosition=false;if(q.cursor.tooltipFormatString==undefined){u.tooltipFormatString=j.jqplot.Cursor.cursorLegendFormatString}}}};j.jqplot.Cursor.postDraw=function(){var x=this.plugins.cursor;if(x.zoomCanvas){x.zoomCanvas.resetCanvas();x.zoomCanvas=null}if(x.cursorCanvas){x.cursorCanvas.resetCanvas();x.cursorCanvas=null}if(x._tooltipElem){x._tooltipElem.emptyForce();x._tooltipElem=null}if(x.zoom){x.zoomCanvas=new j.jqplot.GenericCanvas();this.eventCanvas._elem.before(x.zoomCanvas.createElement(this._gridPadding,"jqplot-zoom-canvas",this._plotDimensions,this));x.zoomCanvas.setContext()}var v=document.createElement("div");x._tooltipElem=j(v);v=null;x._tooltipElem.addClass("jqplot-cursor-tooltip");x._tooltipElem.css({position:"absolute",display:"none"});if(x.zoomCanvas){x.zoomCanvas._elem.before(x._tooltipElem)}else{this.eventCanvas._elem.before(x._tooltipElem)}if(x.showVerticalLine||x.showHorizontalLine){x.cursorCanvas=new j.jqplot.GenericCanvas();this.eventCanvas._elem.before(x.cursorCanvas.createElement(this._gridPadding,"jqplot-cursor-canvas",this._plotDimensions,this));x.cursorCanvas.setContext()}if(x.showTooltipUnitPosition){if(x.tooltipAxisGroups.length===0){var t=this.series;var u;var q=[];for(var r=0;r6&&Math.abs(F.y-G._zoom.start[1])>6)||(G.constrainZoomTo=="x"&&Math.abs(F.x-G._zoom.start[0])>6)||(G.constrainZoomTo=="y"&&Math.abs(F.y-G._zoom.start[1])>6)){if(!B.plugins.cursor.zoomProxy){for(var x in s){if(G._zoom.axes[x]==undefined){G._zoom.axes[x]={};G._zoom.axes[x].numberTicks=E[x].numberTicks;G._zoom.axes[x].tickInterval=E[x].tickInterval;G._zoom.axes[x].daTickInterval=E[x].daTickInterval;G._zoom.axes[x].min=E[x].min;G._zoom.axes[x].max=E[x].max;G._zoom.axes[x].tickFormatString=(E[x].tickOptions!=null)?E[x].tickOptions.formatString:""}if((G.constrainZoomTo=="none")||(G.constrainZoomTo=="x"&&x.charAt(0)=="x")||(G.constrainZoomTo=="y"&&x.charAt(0)=="y")){y=s[x];if(y!=null){var u,w;if(y>v[x]){u=v[x];w=y}else{C=v[x]-y;u=y;w=v[x]}if(this.looseZoom&&(E[x].renderer.constructor===j.jqplot.LinearAxisRenderer||E[x].renderer.constructor===j.jqplot.DateAxisRenderer)){var H=j.jqplot.LinearTickGenerator(u,w);E[x].min=H[0];E[x].max=H[1];E[x]._autoFormatString=H[3];E[x].numberTicks=H[2];E[x].tickInterval=H[4];E[x].daTickInterval=[H[4]/1000,"seconds"]}else{E[x].min=u;E[x].max=w;E[x].tickInterval=null;E[x].daTickInterval=null}E[x]._ticks=[]}}}z.clearRect(0,0,z.canvas.width,z.canvas.height);B.redraw();G._zoom.isZoomed=true;z=null}B.target.trigger("jqplotZoom",[F,s,B,t])}};j.jqplot.preInitHooks.push(j.jqplot.Cursor.init);j.jqplot.postDrawHooks.push(j.jqplot.Cursor.postDraw);function e(E,r,B){var G=B.plugins.cursor;var w="";var K=false;if(G.showTooltipGridPosition){w=E.x+", "+E.y;K=true}if(G.showTooltipUnitPosition){var D;for(var C=0;C"}if(G.useAxesFormatters){var A=B.axes[D[0]]._ticks[0].formatter;var q=B.axes[D[1]]._ticks[0].formatter;var H=B.axes[D[0]]._ticks[0].formatString;var v=B.axes[D[1]]._ticks[0].formatString;w+=A(H,r[D[0]])+", "+q(v,r[D[1]])}else{w+=j.jqplot.sprintf(G.tooltipFormatString,r[D[0]],r[D[1]])}K=true}}if(G.showTooltipDataPosition){var u=B.series;var J=d(B,E.x,E.y);var K=false;for(var C=0;C"}w+=j.jqplot.sprintf(G.tooltipFormatString,t,z,x);K=true}}}}G._tooltipElem.html(w)}function g(C,A){var E=A.plugins.cursor;var z=E.cursorCanvas._ctx;z.clearRect(0,0,z.canvas.width,z.canvas.height);if(E.showVerticalLine){E.shapeRenderer.draw(z,[[C.x,0],[C.x,z.canvas.height]])}if(E.showHorizontalLine){E.shapeRenderer.draw(z,[[0,C.y],[z.canvas.width,C.y]])}var G=d(A,C.x,C.y);if(E.showCursorLegend){var r=j(A.targetId+" td.jqplot-cursor-legend-label");for(var B=0;B0;r--){s=v[r-1];if(q[s].show){u[s]=q[s].series_p2u(w[s.charAt(0)])}}return{offsets:t,gridPos:w,dataPos:u}}function h(z){var x=z.data.plot;var y=x.plugins.cursor;if(y.show&&y.zoom&&y._zoom.started&&!y.zoomTarget){var B=y.zoomCanvas._ctx;var v=o(z);var w=v.gridPos;var t=v.dataPos;y._zoom.gridpos=w;y._zoom.datapos=t;y._zoom.zooming=true;var u=w.x;var s=w.y;var A=B.canvas.height;var q=B.canvas.width;if(y.showTooltip&&!y.onGrid&&y.showTooltipOutsideZoom){e(w,t,x);if(y.followMouse){n(w,x)}}if(y.constrainZoomTo=="x"){y._zoom.end=[u,A]}else{if(y.constrainZoomTo=="y"){y._zoom.end=[q,s]}else{y._zoom.end=[u,s]}}var r=window.getSelection;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(r&&!r().isCollapsed){r().collapse()}}l.call(y);B=null}}function a(w,s,r,x,t){var v=t.plugins.cursor;j(document).one("mouseup.jqplot_cursor",{plot:t},p);var u=t.axes;if(document.onselectstart!=undefined){v._oldHandlers.onselectstart=document.onselectstart;document.onselectstart=function(){return false}}if(document.ondrag!=undefined){v._oldHandlers.ondrag=document.ondrag;document.ondrag=function(){return false}}if(document.onmousedown!=undefined){v._oldHandlers.onmousedown=document.onmousedown;document.onmousedown=function(){return false}}if(v.zoom){if(!v.zoomProxy){var y=v.zoomCanvas._ctx;y.clearRect(0,0,y.canvas.width,y.canvas.height);y=null}if(v.constrainZoomTo=="x"){v._zoom.start=[s.x,0]}else{if(v.constrainZoomTo=="y"){v._zoom.start=[0,s.y]}else{v._zoom.start=[s.x,s.y]}}v._zoom.started=true;for(var q in r){v._zoom.axes.start[q]=r[q]}j(document).bind("mousemove.jqplotCursor",{plot:t},h)}}function p(y){var v=y.data.plot;var x=v.plugins.cursor;if(x.zoom&&x._zoom.zooming&&!x.zoomTarget){var u=x._zoom.gridpos.x;var r=x._zoom.gridpos.y;var t=x._zoom.datapos;var z=x.zoomCanvas._ctx.canvas.height;var q=x.zoomCanvas._ctx.canvas.width;var w=v.axes;if(x.constrainOutsideZoom&&!x.onGrid){if(u<0){u=0}else{if(u>q){u=q}}if(r<0){r=0}else{if(r>z){r=z}}for(var s in t){if(t[s]){if(s.charAt(0)=="x"){t[s]=w[s].series_p2u(u)}else{t[s]=w[s].series_p2u(r)}}}}if(x.constrainZoomTo=="x"){r=z}else{if(x.constrainZoomTo=="y"){u=q}}x._zoom.end=[u,r];x._zoom.gridpos={x:u,y:r};x.doZoom(x._zoom.gridpos,t,v,x)}x._zoom.started=false;x._zoom.zooming=false;j(document).unbind("mousemove.jqplotCursor",h);if(document.onselectstart!=undefined&&x._oldHandlers.onselectstart!=null){document.onselectstart=x._oldHandlers.onselectstart;x._oldHandlers.onselectstart=null}if(document.ondrag!=undefined&&x._oldHandlers.ondrag!=null){document.ondrag=x._oldHandlers.ondrag;x._oldHandlers.ondrag=null}if(document.onmousedown!=undefined&&x._oldHandlers.onmousedown!=null){document.onmousedown=x._oldHandlers.onmousedown;x._oldHandlers.onmousedown=null}}function l(){var y=this._zoom.start;var u=this._zoom.end;var s=this.zoomCanvas._ctx;var r,v,x,q;if(u[0]>y[0]){r=y[0];q=u[0]-y[0]}else{r=u[0];q=y[0]-u[0]}if(u[1]>y[1]){v=y[1];x=u[1]-y[1]}else{v=u[1];x=y[1]-u[1]}s.fillStyle="rgba(0,0,0,0.2)";s.strokeStyle="#999999";s.lineWidth=1;s.clearRect(0,0,s.canvas.width,s.canvas.height);s.fillRect(0,0,s.canvas.width,s.canvas.height);s.clearRect(r,v,q,x);s.strokeRect(r,v,q,x);s=null}j.jqplot.CursorLegendRenderer=function(q){j.jqplot.TableLegendRenderer.call(this,q);this.formatString="%s"};j.jqplot.CursorLegendRenderer.prototype=new j.jqplot.TableLegendRenderer();j.jqplot.CursorLegendRenderer.prototype.constructor=j.jqplot.CursorLegendRenderer;j.jqplot.CursorLegendRenderer.prototype.draw=function(){if(this._elem){this._elem.emptyForce();this._elem=null}if(this.show){var w=this._series,A;var r=document.createElement("div");this._elem=j(r);r=null;this._elem.addClass("jqplot-legend jqplot-cursor-legend");this._elem.css("position","absolute");var q=false;for(var x=0;x').appendTo(this._elem);E.data("seriesIndex",s);j('').appendTo(E);var G=j('');G.appendTo(E);G.data("seriesIndex",s);if(this.escapeHtml){G.text(D)}else{G.html(D)}E=null;G=null}return this._elem}})(jQuery); \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.dateAxisRenderer.js b/templates/Froxlor/assets/js/plugins/jqplot.dateAxisRenderer.js new file mode 100644 index 00000000..94a48c0d --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.dateAxisRenderer.js @@ -0,0 +1,439 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + /** + * Class: $.jqplot.DateAxisRenderer + * A plugin for a jqPlot to render an axis as a series of date values. + * This renderer has no options beyond those supplied by the class. + * It supplies it's own tick formatter, so the tickOptions.formatter option + * should not be overridden. + * + * Thanks to Ken Synder for his enhanced Date instance methods which are + * included with this code . + * + * To use this renderer, include the plugin in your source + * > + * + * and supply the appropriate options to your plot + * + * > {axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer}}} + * + * Dates can be passed into the axis in almost any recognizable value and + * will be parsed. They will be rendered on the axis in the format + * specified by tickOptions.formatString. e.g. tickOptions.formatString = '%Y-%m-%d'. + * + * Accecptable format codes + * are: + * + * > Code Result Description + * > == Years == + * > %Y 2008 Four-digit year + * > %y 08 Two-digit year + * > == Months == + * > %m 09 Two-digit month + * > %#m 9 One or two-digit month + * > %B September Full month name + * > %b Sep Abbreviated month name + * > == Days == + * > %d 05 Two-digit day of month + * > %#d 5 One or two-digit day of month + * > %e 5 One or two-digit day of month + * > %A Sunday Full name of the day of the week + * > %a Sun Abbreviated name of the day of the week + * > %w 0 Number of the day of the week (0 = Sunday, 6 = Saturday) + * > %o th The ordinal suffix string following the day of the month + * > == Hours == + * > %H 23 Hours in 24-hour format (two digits) + * > %#H 3 Hours in 24-hour integer format (one or two digits) + * > %I 11 Hours in 12-hour format (two digits) + * > %#I 3 Hours in 12-hour integer format (one or two digits) + * > %p PM AM or PM + * > == Minutes == + * > %M 09 Minutes (two digits) + * > %#M 9 Minutes (one or two digits) + * > == Seconds == + * > %S 02 Seconds (two digits) + * > %#S 2 Seconds (one or two digits) + * > %s 1206567625723 Unix timestamp (Seconds past 1970-01-01 00:00:00) + * > == Milliseconds == + * > %N 008 Milliseconds (three digits) + * > %#N 8 Milliseconds (one to three digits) + * > == Timezone == + * > %O 360 difference in minutes between local time and GMT + * > %Z Mountain Standard Time Name of timezone as reported by browser + * > %G -06:00 Hours and minutes between GMT + * > == Shortcuts == + * > %F 2008-03-26 %Y-%m-%d + * > %T 05:06:30 %H:%M:%S + * > %X 05:06:30 %H:%M:%S + * > %x 03/26/08 %m/%d/%y + * > %D 03/26/08 %m/%d/%y + * > %#c Wed Mar 26 15:31:00 2008 %a %b %e %H:%M:%S %Y + * > %v 3-Sep-2008 %e-%b-%Y + * > %R 15:31 %H:%M + * > %r 3:31:00 PM %I:%M:%S %p + * > == Characters == + * > %n \n Newline + * > %t \t Tab + * > %% % Percent Symbol + */ + $.jqplot.DateAxisRenderer = function() { + $.jqplot.LinearAxisRenderer.call(this); + this.date = new $.jsDate(); + }; + + $.jqplot.DateAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer(); + $.jqplot.DateAxisRenderer.prototype.constructor = $.jqplot.DateAxisRenderer; + + $.jqplot.DateTickFormatter = function(format, val) { + if (!format) { + format = '%Y/%m/%d'; + } + return $.jsDate.strftime(val, format); + }; + + $.jqplot.DateAxisRenderer.prototype.init = function(options){ + // prop: tickRenderer + // A class of a rendering engine for creating the ticks labels displayed on the plot, + // See <$.jqplot.AxisTickRenderer>. + // this.tickRenderer = $.jqplot.AxisTickRenderer; + // this.labelRenderer = $.jqplot.AxisLabelRenderer; + this.tickOptions.formatter = $.jqplot.DateTickFormatter; + this.daTickInterval = null; + this._daTickInterval = null; + + $.extend(true, this, options); + + var db = this._dataBounds, + stats, + sum, + s, + d, + pd, + sd, + intv; + + // Go through all the series attached to this axis and find + // the min/max bounds for this axis. + for (var i=0; i db.max) || db.max == null) { + db.max = d[j][0]; + } + if (j>0) { + intv = Math.abs(d[j][0] - d[j-1][0]); + stats.intervals.push(intv); + if (stats.frequencies.hasOwnProperty(intv)) { + stats.frequencies[intv] += 1; + } + else { + stats.frequencies[intv] = 1; + } + } + sum += intv; + + } + else { + d[j][1] = new $.jsDate(d[j][1]).getTime(); + pd[j][1] = new $.jsDate(d[j][1]).getTime(); + sd[j][1] = new $.jsDate(d[j][1]).getTime(); + if ((d[j][1] != null && d[j][1] < db.min) || db.min == null) { + db.min = d[j][1]; + } + if ((d[j][1] != null && d[j][1] > db.max) || db.max == null) { + db.max = d[j][1]; + } + if (j>0) { + intv = Math.abs(d[j][1] - d[j-1][1]); + stats.intervals.push(intv); + if (stats.frequencies.hasOwnProperty(intv)) { + stats.frequencies[intv] += 1; + } + else { + stats.frequencies[intv] = 1; + } + } + } + sum += intv; + } + + var tempf = 0, + tempn=0; + for (var n in stats.frequencies) { + stats.sortedIntervals.push({interval:n, frequency:stats.frequencies[n]}); + } + stats.sortedIntervals.sort(function(a, b){ + return b.frequency - a.frequency; + }); + + stats.min = $.jqplot.arrayMin(stats.intervals); + stats.max = $.jqplot.arrayMax(stats.intervals); + stats.mean = sum/d.length; + this._intervalStats.push(stats); + stats = sum = s = d = pd = sd = null; + } + db = null; + + }; + + // called with scope of an axis + $.jqplot.DateAxisRenderer.prototype.reset = function() { + this.min = this._min; + this.max = this._max; + this.tickInterval = this._tickInterval; + this.numberTicks = this._numberTicks; + this.daTickInterval = this._daTickInterval; + // this._ticks = this.__ticks; + }; + + $.jqplot.DateAxisRenderer.prototype.createTicks = function() { + // we're are operating on an axis here + var ticks = this._ticks; + var userTicks = this.ticks; + var name = this.name; + // databounds were set on axis initialization. + var db = this._dataBounds; + var iv = this._intervalStats; + var dim, interval; + var min, max; + var pos1, pos2; + var tt, i; + + // if we already have ticks, use them. + // ticks must be in order of increasing value. + + min = ((this.min != null) ? new $.jsDate(this.min).getTime() : db.min); + max = ((this.max != null) ? new $.jsDate(this.max).getTime() : db.max); + + var range = max - min; + + if (userTicks.length) { + // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed + for (i=0; i= tumax) { + tumin = min - range*(this.padMin - 1); + tumax = max + range*(this.padMax - 1); + ret = $.jqplot.LinearTickGenerator(tumin, tumax); + } + + this.min = ret[0]; + this.max = ret[1]; + this.numberTicks = ret[2]; + this.tickInterval = ret[4]; + this.daTickInterval = [this.tickInterval/1000, 'seconds']; + + for (var i=0; i 200) { + this.numberTicks = parseInt(3+(dim-200)/100, 10); + } + else { + this.numberTicks = 2; + } + } + + if (this.daTickInterval == null) { + this.daTickInterval = [range / (this.numberTicks-1)/1000, 'seconds']; + } + for (var i=0; iq.max)||q.max==null){q.max=l[e][0]}if(e>0){b=Math.abs(l[e][0]-l[e-1][0]);g.intervals.push(b);if(g.frequencies.hasOwnProperty(b)){g.frequencies[b]+=1}else{g.frequencies[b]=1}}k+=b}else{l[e][1]=new a.jsDate(l[e][1]).getTime();o[e][1]=new a.jsDate(l[e][1]).getTime();m[e][1]=new a.jsDate(l[e][1]).getTime();if((l[e][1]!=null&&l[e][1]q.max)||q.max==null){q.max=l[e][1]}if(e>0){b=Math.abs(l[e][1]-l[e-1][1]);g.intervals.push(b);if(g.frequencies.hasOwnProperty(b)){g.frequencies[b]+=1}else{g.frequencies[b]=1}}}k+=b}var p=0,h=0;for(var c in g.frequencies){g.sortedIntervals.push({interval:c,frequency:g.frequencies[c]})}g.sortedIntervals.sort(function(i,d){return d.frequency-i.frequency});g.min=a.jqplot.arrayMin(g.intervals);g.max=a.jqplot.arrayMax(g.intervals);g.mean=k/l.length;this._intervalStats.push(g);g=k=r=l=o=m=null}q=null};a.jqplot.DateAxisRenderer.prototype.reset=function(){this.min=this._min;this.max=this._max;this.tickInterval=this._tickInterval;this.numberTicks=this._numberTicks;this.daTickInterval=this._daTickInterval};a.jqplot.DateAxisRenderer.prototype.createTicks=function(){var z=this._ticks;var w=this.ticks;var B=this.name;var y=this._dataBounds;var e=this._intervalStats;var q,x;var o,s;var d,c;var b,u;o=((this.min!=null)?new a.jsDate(this.min).getTime():y.min);s=((this.max!=null)?new a.jsDate(this.max).getTime():y.max);var k=s-o;if(w.length){for(u=0;u=r){n=o-k*(this.padMin-1);r=s+k*(this.padMax-1);A=a.jqplot.LinearTickGenerator(n,r)}this.min=A[0];this.max=A[1];this.numberTicks=A[2];this.tickInterval=A[4];this.daTickInterval=[this.tickInterval/1000,"seconds"];for(var u=0;u200){this.numberTicks=parseInt(3+(q-200)/100,10)}else{this.numberTicks=2}}}if(this.daTickInterval==null){this.daTickInterval=[k/(this.numberTicks-1)/1000,"seconds"]}for(var u=0;u + * + * Properties described here are passed into the $.jqplot function + * as options on the series renderer. For example: + * + * > plot2 = $.jqplot('chart2', [s1, s2], { + * > seriesDefaults: { + * > renderer:$.jqplot.DonutRenderer, + * > rendererOptions:{ + * > sliceMargin: 2, + * > innerDiameter: 110, + * > startAngle: -90 + * > } + * > } + * > }); + * + * A donut plot will trigger events on the plot target + * according to user interaction. All events return the event object, + * the series index, the point (slice) index, and the point data for + * the appropriate slice. + * + * 'jqplotDataMouseOver' - triggered when user mouseing over a slice. + * 'jqplotDataHighlight' - triggered the first time user mouses over a slice, + * if highlighting is enabled. + * 'jqplotDataUnhighlight' - triggered when a user moves the mouse out of + * a highlighted slice. + * 'jqplotDataClick' - triggered when the user clicks on a slice. + * 'jqplotDataRightClick' - tiggered when the user right clicks on a slice if + * the "captureRightClick" option is set to true on the plot. + */ + $.jqplot.DonutRenderer = function(){ + $.jqplot.LineRenderer.call(this); + }; + + $.jqplot.DonutRenderer.prototype = new $.jqplot.LineRenderer(); + $.jqplot.DonutRenderer.prototype.constructor = $.jqplot.DonutRenderer; + + // called with scope of a series + $.jqplot.DonutRenderer.prototype.init = function(options, plot) { + // Group: Properties + // + // prop: diameter + // Outer diameter of the donut, auto computed by default + this.diameter = null; + // prop: innerDiameter + // Inner diameter of the donut, auto calculated by default. + // If specified will override thickness value. + this.innerDiameter = null; + // prop: thickness + // thickness of the donut, auto computed by default + // Overridden by if innerDiameter is specified. + this.thickness = null; + // prop: padding + // padding between the donut and plot edges, legend, etc. + this.padding = 20; + // prop: sliceMargin + // angular spacing between donut slices in degrees. + this.sliceMargin = 0; + // prop: ringMargin + // pixel distance between rings, or multiple series in a donut plot. + // null will compute ringMargin based on sliceMargin. + this.ringMargin = null; + // prop: fill + // true or false, wether to fil the slices. + this.fill = true; + // prop: shadowOffset + // offset of the shadow from the slice and offset of + // each succesive stroke of the shadow from the last. + this.shadowOffset = 2; + // prop: shadowAlpha + // transparency of the shadow (0 = transparent, 1 = opaque) + this.shadowAlpha = 0.07; + // prop: shadowDepth + // number of strokes to apply to the shadow, + // each stroke offset shadowOffset from the last. + this.shadowDepth = 5; + // prop: highlightMouseOver + // True to highlight slice when moused over. + // This must be false to enable highlightMouseDown to highlight when clicking on a slice. + this.highlightMouseOver = true; + // prop: highlightMouseDown + // True to highlight when a mouse button is pressed over a slice. + // This will be disabled if highlightMouseOver is true. + this.highlightMouseDown = false; + // prop: highlightColors + // an array of colors to use when highlighting a slice. + this.highlightColors = []; + // prop: dataLabels + // Either 'label', 'value', 'percent' or an array of labels to place on the pie slices. + // Defaults to percentage of each pie slice. + this.dataLabels = 'percent'; + // prop: showDataLabels + // true to show data labels on slices. + this.showDataLabels = false; + // prop: dataLabelFormatString + // Format string for data labels. If none, '%s' is used for "label" and for arrays, '%d' for value and '%d%%' for percentage. + this.dataLabelFormatString = null; + // prop: dataLabelThreshold + // Threshhold in percentage (0 - 100) of pie area, below which no label will be displayed. + // This applies to all label types, not just to percentage labels. + this.dataLabelThreshold = 3; + // prop: dataLabelPositionFactor + // A Multiplier (0-1) of the pie radius which controls position of label on slice. + // Increasing will slide label toward edge of pie, decreasing will slide label toward center of pie. + this.dataLabelPositionFactor = 0.4; + // prop: dataLabelNudge + // Number of pixels to slide the label away from (+) or toward (-) the center of the pie. + this.dataLabelNudge = 0; + // prop: startAngle + // Angle to start drawing donut in degrees. + // According to orientation of canvas coordinate system: + // 0 = on the positive x axis + // -90 = on the positive y axis. + // 90 = on the negaive y axis. + // 180 or - 180 = on the negative x axis. + this.startAngle = 0; + this.tickRenderer = $.jqplot.DonutTickRenderer; + // Used as check for conditions where donut shouldn't be drawn. + this._drawData = true; + this._type = 'donut'; + + // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver + if (options.highlightMouseDown && options.highlightMouseOver == null) { + options.highlightMouseOver = false; + } + + $.extend(true, this, options); + if (this.diameter != null) { + this.diameter = this.diameter - this.sliceMargin; + } + this._diameter = null; + this._innerDiameter = null; + this._radius = null; + this._innerRadius = null; + this._thickness = null; + // references to the previous series in the plot to properly calculate diameters + // and thicknesses of nested rings. + this._previousSeries = []; + this._numberSeries = 1; + // array of [start,end] angles arrays, one for each slice. In radians. + this._sliceAngles = []; + // index of the currenty highlighted point, if any + this._highlightedPoint = null; + + // set highlight colors if none provided + if (this.highlightColors.length == 0) { + for (var i=0; i 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]); + newrgb[j] = parseInt(newrgb[j], 10); + } + this.highlightColors.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')'); + } + } + + plot.postParseOptionsHooks.addOnce(postParseOptions); + plot.postInitHooks.addOnce(postInit); + plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove); + plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown); + plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp); + plot.eventListenerHooks.addOnce('jqplotClick', handleClick); + plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick); + plot.postDrawHooks.addOnce(postPlotDraw); + + + }; + + $.jqplot.DonutRenderer.prototype.setGridData = function(plot) { + // set gridData property. This will hold angle in radians of each data point. + var stack = []; + var td = []; + var sa = this.startAngle/180*Math.PI; + var tot = 0; + // don't know if we have any valid data yet, so set plot to not draw. + this._drawData = false; + for (var i=0; i0) { + stack[i] += stack[i-1]; + } + tot += this.data[i][1]; + } + var fact = Math.PI*2/stack[stack.length - 1]; + + for (var i=0; i0) { + stack[i] += stack[i-1]; + } + tot += data[i][1]; + } + var fact = Math.PI*2/stack[stack.length - 1]; + + for (var i=0; i 6.282 + this.startAngle) { + ang2 = 6.282 + this.startAngle; + if (ang1 > ang2) { + ang1 = 6.281 + this.startAngle; + } + } + // Fix for IE, where it can't seem to handle 0 degree angles. Also avoids + // ugly line on unfilled donuts. + if (ang1 >= ang2) { + return; + } + ctx.beginPath(); + ctx.fillStyle = color; + ctx.strokeStyle = color; + // ctx.lineWidth = lineWidth; + ctx.arc(0, 0, r, ang1, ang2, false); + ctx.lineTo(ri*Math.cos(ang2), ri*Math.sin(ang2)); + ctx.arc(0,0, ri, ang2, ang1, true); + ctx.closePath(); + if (fill) { + ctx.fill(); + } + else { + ctx.stroke(); + } + } + + if (isShadow) { + for (var i=0; i 1 && this.index > 0) ? this._previousSeries[0]._diameter : this._diameter; + this._thickness = this.thickness || (od - this.innerDiameter - 2.0*ringmargin*this._numberSeries) / this._numberSeries/2.0; + } + else { + this._thickness = this.thickness || mindim / 2 / (this._numberSeries + 1) * 0.85; + } + + var r = this._radius = this._diameter/2; + this._innerRadius = this._radius - this._thickness; + var sa = this.startAngle / 180 * Math.PI; + this._center = [(cw - trans * offx)/2 + trans * offx, (ch - trans*offy)/2 + trans * offy]; + + if (this.shadow) { + var shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')'; + for (var i=0; i= this.dataLabelThreshold) { + var fstr, avgang = (ang1+ang2)/2, label; + + if (this.dataLabels == 'label') { + fstr = this.dataLabelFormatString || '%s'; + label = $.jqplot.sprintf(fstr, gd[i][0]); + } + else if (this.dataLabels == 'value') { + fstr = this.dataLabelFormatString || '%d'; + label = $.jqplot.sprintf(fstr, this.data[i][1]); + } + else if (this.dataLabels == 'percent') { + fstr = this.dataLabelFormatString || '%d%%'; + label = $.jqplot.sprintf(fstr, gd[i][2]*100); + } + else if (this.dataLabels.constructor == Array) { + fstr = this.dataLabelFormatString || '%s'; + label = $.jqplot.sprintf(fstr, this.dataLabels[i]); + } + + var fact = this._innerRadius + this._thickness * this.dataLabelPositionFactor + this.sliceMargin + this.dataLabelNudge; + + var x = this._center[0] + Math.cos(avgang) * fact + this.canvas._offsets.left; + var y = this._center[1] + Math.sin(avgang) * fact + this.canvas._offsets.top; + + var labelelem = $('' + label + '').insertBefore(plot.eventCanvas._elem); + x -= labelelem.width()/2; + y -= labelelem.height()/2; + x = Math.round(x); + y = Math.round(y); + labelelem.css({left: x, top: y}); + } + } + + }; + + $.jqplot.DonutAxisRenderer = function() { + $.jqplot.LinearAxisRenderer.call(this); + }; + + $.jqplot.DonutAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer(); + $.jqplot.DonutAxisRenderer.prototype.constructor = $.jqplot.DonutAxisRenderer; + + + // There are no traditional axes on a donut chart. We just need to provide + // dummy objects with properties so the plot will render. + // called with scope of axis object. + $.jqplot.DonutAxisRenderer.prototype.init = function(options){ + // + this.tickRenderer = $.jqplot.DonutTickRenderer; + $.extend(true, this, options); + // I don't think I'm going to need _dataBounds here. + // have to go Axis scaling in a way to fit chart onto plot area + // and provide u2p and p2u functionality for mouse cursor, etc. + // for convienence set _dataBounds to 0 and 100 and + // set min/max to 0 and 100. + this._dataBounds = {min:0, max:100}; + this.min = 0; + this.max = 100; + this.showTicks = false; + this.ticks = []; + this.showMark = false; + this.show = false; + }; + + + + + $.jqplot.DonutLegendRenderer = function(){ + $.jqplot.TableLegendRenderer.call(this); + }; + + $.jqplot.DonutLegendRenderer.prototype = new $.jqplot.TableLegendRenderer(); + $.jqplot.DonutLegendRenderer.prototype.constructor = $.jqplot.DonutLegendRenderer; + + /** + * Class: $.jqplot.DonutLegendRenderer + * Legend Renderer specific to donut plots. Set by default + * when user creates a donut plot. + */ + $.jqplot.DonutLegendRenderer.prototype.init = function(options) { + // Group: Properties + // + // prop: numberRows + // Maximum number of rows in the legend. 0 or null for unlimited. + this.numberRows = null; + // prop: numberColumns + // Maximum number of columns in the legend. 0 or null for unlimited. + this.numberColumns = null; + $.extend(true, this, options); + }; + + // called with context of legend + $.jqplot.DonutLegendRenderer.prototype.draw = function() { + var legend = this; + if (this.show) { + var series = this._series; + var ss = 'position:absolute;'; + ss += (this.background) ? 'background:'+this.background+';' : ''; + ss += (this.border) ? 'border:'+this.border+';' : ''; + ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : ''; + ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : ''; + ss += (this.textColor) ? 'color:'+this.textColor+';' : ''; + ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : ''; + ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : ''; + ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : ''; + ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : ''; + this._elem = $('
 {$lng['ticket']['archivesearch']} {$lng['ticket']['archivesearch']}  
{$row['ticketcount']} ({$row['ticketcountnotclosed']} {$lng['ticket']['open']} | {$closedtickets_count} {$lng['ticket']['closed']}) - {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']}
- {$lng['ticket']['show']} + {$lng['ticket']['show']} - {$lng['ticket']['answer']} + {$lng['ticket']['answer']}   - {$lng['ticket']['close']} + {$lng['ticket']['close']}   - {$lng['ticket']['reopen']} + {$lng['ticket']['reopen']}   - {$lng['ticket']['archive']} + {$lng['ticket']['archive']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']}
'+ + '
'+ + '
'+ + '
'); + // Donut charts legends don't go by number of series, but by number of data points + // in the series. Refactor things here for that. + + var pad = false, + reverse = false, + nr, nc; + var s = series[0]; + var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors); + + if (s.show) { + var pd = s.data; + if (this.numberRows) { + nr = this.numberRows; + if (!this.numberColumns){ + nc = Math.ceil(pd.length/nr); + } + else{ + nc = this.numberColumns; + } + } + else if (this.numberColumns) { + nc = this.numberColumns; + nr = Math.ceil(pd.length/this.numberColumns); + } + else { + nr = pd.length; + nc = 1; + } + + var i, j, tr, td1, td2, lt, rs, color; + var idx = 0; + + for (i=0; i
'+ + '
'+ + '
');var F=false,x=false,n,v;var z=y[0];var o=new e.jqplot.ColorGenerator(z.seriesColors);if(z.show){var G=z.data;if(this.numberRows){n=this.numberRows;if(!this.numberColumns){v=Math.ceil(G.length/n)}else{v=this.numberColumns}}else{if(this.numberColumns){v=this.numberColumns;n=Math.ceil(G.length/this.numberColumns)}else{n=G.length;v=1}}var E,D,p,t,r,u,w,C;var A=0;for(E=0;E
'); + if (this.seriesToggle) { + this._elem.css('z-index', '3'); + } + + var pad = false, + reverse = false, + nr, nc; + if (this.numberRows) { + nr = this.numberRows; + if (!this.numberColumns){ + nc = Math.ceil(series.length/nr); + } + else{ + nc = this.numberColumns; + } + } + else if (this.numberColumns) { + nc = this.numberColumns; + nr = Math.ceil(series.length/this.numberColumns); + } + else { + nr = series.length; + nc = 1; + } + + var i, j, tr, td1, td2, lt, rs; + var idx = 0; + // check to see if we need to reverse + for (i=series.length-1; i>=0; i--) { + if (series[i]._stack || series[i].renderer.constructor == $.jqplot.BezierCurveRenderer){ + reverse = true; + } + } + + for (i=0; i
'+ + '
'+ + '
');if(this.seriesToggle){this._elem.css("z-index","3")}var w=false,m=false,c,k;if(this.numberRows){c=this.numberRows;if(!this.numberColumns){k=Math.ceil(n.length/c)}else{k=this.numberColumns}}else{if(this.numberColumns){k=this.numberColumns;c=Math.ceil(n.length/this.numberColumns)}else{c=n.length;k=1}}var v,t,d,g,f,h,l;var p=0;for(v=n.length-1;v>=0;v--){if(n[v]._stack||n[v].renderer.constructor==b.jqplot.BezierCurveRenderer){m=true}}for(v=0;v
'); + // Funnel charts legends don't go by number of series, but by number of data points + // in the series. Refactor things here for that. + + var pad = false, + reverse = false, + nr, nc; + var s = series[0]; + var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors); + + if (s.show) { + var pd = s.data; + if (this.numberRows) { + nr = this.numberRows; + if (!this.numberColumns){ + nc = Math.ceil(pd.length/nr); + } + else{ + nc = this.numberColumns; + } + } + else if (this.numberColumns) { + nc = this.numberColumns; + nr = Math.ceil(pd.length/this.numberColumns); + } + else { + nr = pd.length; + nc = 1; + } + + var i, j, tr, td1, td2, lt, rs, color; + var idx = 0; + + for (i=0; i
'+ + '
'+ + '
');var E=false,w=false,m,u;var y=x[0];var n=new e.jqplot.ColorGenerator(y.seriesColors);if(y.show){var F=y.data;if(this.numberRows){m=this.numberRows;if(!this.numberColumns){u=Math.ceil(F.length/m)}else{u=this.numberColumns}}else{if(this.numberColumns){u=this.numberColumns;m=Math.ceil(F.length/this.numberColumns)}else{m=F.length;u=1}}var D,C,o,r,q,t,v,B;var z=0;for(D=0;D
+ * > + * > + * >
hi:%s
low:%s
close:%s
' + * > } + * + */ + $.jqplot.Highlighter = function(options) { + // Group: Properties + // + //prop: show + // true to show the highlight. + this.show = $.jqplot.config.enablePlugins; + // prop: markerRenderer + // Renderer used to draw the marker of the highlighted point. + // Renderer will assimilate attributes from the data point being highlighted, + // so no attributes need set on the renderer directly. + // Default is to turn off shadow drawing on the highlighted point. + this.markerRenderer = new $.jqplot.MarkerRenderer({shadow:false}); + // prop: showMarker + // true to show the marker + this.showMarker = true; + // prop: lineWidthAdjust + // Pixels to add to the lineWidth of the highlight. + this.lineWidthAdjust = 2.5; + // prop: sizeAdjust + // Pixels to add to the overall size of the highlight. + this.sizeAdjust = 5; + // prop: showTooltip + // Show a tooltip with data point values. + this.showTooltip = true; + // prop: tooltipLocation + // Where to position tooltip, 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw' + this.tooltipLocation = 'nw'; + // prop: fadeTooltip + // true = fade in/out tooltip, flase = show/hide tooltip + this.fadeTooltip = true; + // prop: tooltipFadeSpeed + // 'slow', 'def', 'fast', or number of milliseconds. + this.tooltipFadeSpeed = "fast"; + // prop: tooltipOffset + // Pixel offset of tooltip from the highlight. + this.tooltipOffset = 2; + // prop: tooltipAxes + // Which axes to display in tooltip, 'x', 'y' or 'both', 'xy' or 'yx' + // 'both' and 'xy' are equivalent, 'yx' reverses order of labels. + this.tooltipAxes = 'both'; + // prop; tooltipSeparator + // String to use to separate x and y axes in tooltip. + this.tooltipSeparator = ', '; + // prop; tooltipContentEditor + // Function used to edit/augment/replace the formatted tooltip contents. + // Called as str = tooltipContentEditor(str, seriesIndex, pointIndex) + // where str is the generated tooltip html and seriesIndex and pointIndex identify + // the data point being highlighted. Should return the html for the tooltip contents. + this.tooltipContentEditor = null; + // prop: useAxesFormatters + // Use the x and y axes formatters to format the text in the tooltip. + this.useAxesFormatters = true; + // prop: tooltipFormatString + // sprintf format string for the tooltip. + // Uses Ash Searle's javascript sprintf implementation + // found here: http://hexmen.com/blog/2007/03/printf-sprintf/ + // See http://perldoc.perl.org/functions/sprintf.html for reference. + // Additional "p" and "P" format specifiers added by Chris Leonello. + this.tooltipFormatString = '%.5P'; + // prop: formatString + // alternative to tooltipFormatString + // will format the whole tooltip text, populating with x, y values as + // indicated by tooltipAxes option. So, you could have a tooltip like: + // 'Date: %s, number of cats: %d' to format the whole tooltip at one go. + // If useAxesFormatters is true, values will be formatted according to + // Axes formatters and you can populate your tooltip string with + // %s placeholders. + this.formatString = null; + // prop: yvalues + // Number of y values to expect in the data point array. + // Typically this is 1. Certain plots, like OHLC, will + // have more y values in each data point array. + this.yvalues = 1; + // prop: bringSeriesToFront + // This option requires jQuery 1.4+ + // True to bring the series of the highlighted point to the front + // of other series. + this.bringSeriesToFront = false; + this._tooltipElem; + this.isHighlighting = false; + + $.extend(true, this, options); + }; + + var locations = ['nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w']; + var locationIndicies = {'nw':0, 'n':1, 'ne':2, 'e':3, 'se':4, 's':5, 'sw':6, 'w':7}; + var oppositeLocations = ['se', 's', 'sw', 'w', 'nw', 'n', 'ne', 'e']; + + // axis.renderer.tickrenderer.formatter + + // called with scope of plot + $.jqplot.Highlighter.init = function (target, data, opts){ + var options = opts || {}; + // add a highlighter attribute to the plot + this.plugins.highlighter = new $.jqplot.Highlighter(options.highlighter); + }; + + // called within scope of series + $.jqplot.Highlighter.parseOptions = function (defaults, options) { + // Add a showHighlight option to the series + // and set it to true by default. + this.showHighlight = true; + }; + + // called within context of plot + // create a canvas which we can draw on. + // insert it before the eventCanvas, so eventCanvas will still capture events. + $.jqplot.Highlighter.postPlotDraw = function() { + // Memory Leaks patch + if (this.plugins.highlighter && this.plugins.highlighter.highlightCanvas) { + this.plugins.highlighter.highlightCanvas.resetCanvas(); + this.plugins.highlighter.highlightCanvas = null; + } + + if (this.plugins.highlighter && this.plugins.highlighter._tooltipElem) { + this.plugins.highlighter._tooltipElem.emptyForce(); + this.plugins.highlighter._tooltipElem = null; + } + + this.plugins.highlighter.highlightCanvas = new $.jqplot.GenericCanvas(); + + this.eventCanvas._elem.before(this.plugins.highlighter.highlightCanvas.createElement(this._gridPadding, 'jqplot-highlight-canvas', this._plotDimensions, this)); + this.plugins.highlighter.highlightCanvas.setContext(); + + var elem = document.createElement('div'); + this.plugins.highlighter._tooltipElem = $(elem); + elem = null; + this.plugins.highlighter._tooltipElem.addClass('jqplot-highlighter-tooltip'); + this.plugins.highlighter._tooltipElem.css({position:'absolute', display:'none'}); + + this.eventCanvas._elem.before(this.plugins.highlighter._tooltipElem); + }; + + $.jqplot.preInitHooks.push($.jqplot.Highlighter.init); + $.jqplot.preParseSeriesOptionsHooks.push($.jqplot.Highlighter.parseOptions); + $.jqplot.postDrawHooks.push($.jqplot.Highlighter.postPlotDraw); + + function draw(plot, neighbor) { + var hl = plot.plugins.highlighter; + var s = plot.series[neighbor.seriesIndex]; + var smr = s.markerRenderer; + var mr = hl.markerRenderer; + mr.style = smr.style; + mr.lineWidth = smr.lineWidth + hl.lineWidthAdjust; + mr.size = smr.size + hl.sizeAdjust; + var rgba = $.jqplot.getColorComponents(smr.color); + var newrgb = [rgba[0], rgba[1], rgba[2]]; + var alpha = (rgba[3] >= 0.6) ? rgba[3]*0.6 : rgba[3]*(2-rgba[3]); + mr.color = 'rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+alpha+')'; + mr.init(); + mr.draw(s.gridData[neighbor.pointIndex][0], s.gridData[neighbor.pointIndex][1], hl.highlightCanvas._ctx); + } + + function showTooltip(plot, series, neighbor) { + // neighbor looks like: {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]} + // gridData should be x,y pixel coords on the grid. + // add the plot._gridPadding to that to get x,y in the target. + var hl = plot.plugins.highlighter; + var elem = hl._tooltipElem; + if (hl.useAxesFormatters) { + var xf = series._xaxis._ticks[0].formatter; + var yf = series._yaxis._ticks[0].formatter; + var xfstr = series._xaxis._ticks[0].formatString; + var yfstr = series._yaxis._ticks[0].formatString; + var str; + var xstr = xf(xfstr, neighbor.data[0]); + var ystrs = []; + for (var i=1; i=0.6)?l[3]*0.6:l[3]*(2-l[3]);i.color="rgba("+n[0]+","+n[1]+","+n[2]+","+k+")";i.init();i.draw(p.gridData[o.pointIndex][0],p.gridData[o.pointIndex][1],j.highlightCanvas._ctx)}function g(w,q,m){var k=w.plugins.highlighter;var B=k._tooltipElem;if(k.useAxesFormatters){var u=q._xaxis._ticks[0].formatter;var h=q._yaxis._ticks[0].formatter;var C=q._xaxis._ticks[0].formatString;var r=q._yaxis._ticks[0].formatString;var v;var s=u(C,m.data[0]);var l=[];for(var z=1;z + * + * and supply the appropriate options to your plot + * + * > {axes:{xaxis:{renderer:$.jqplot.LogAxisRenderer}}} + **/ + $.jqplot.LogAxisRenderer = function() { + $.jqplot.LinearAxisRenderer.call(this); + // prop: axisDefaults + // Default properties which will be applied directly to the series. + // + // Group: Properties + // + // Properties + // + /// base - the logarithmic base, commonly 2, 10 or Math.E + // tickDistribution - 'even' or 'power'. 'even' gives equal pixel + // spacing of the ticks on the plot. 'power' gives ticks in powers + // of 10. + this.axisDefaults = { + base : 10, + tickDistribution :'even' + }; + }; + + $.jqplot.LogAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer(); + $.jqplot.LogAxisRenderer.prototype.constructor = $.jqplot.LogAxisRenderer; + + $.jqplot.LogAxisRenderer.prototype.init = function(options) { + // prop: tickRenderer + // A class of a rendering engine for creating the ticks labels displayed on the plot, + // See <$.jqplot.AxisTickRenderer>. + // this.tickRenderer = $.jqplot.AxisTickRenderer; + // this.labelRenderer = $.jqplot.AxisLabelRenderer; + $.extend(true, this.renderer, options); + for (var d in this.renderer.axisDefaults) { + if (this[d] == null) { + this[d] = this.renderer.axisDefaults[d]; + } + } + var db = this._dataBounds; + // Go through all the series attached to this axis and find + // the min/max bounds for this axis. + for (var i=0; i db.max) || db.max == null) { + db.max = d[j][0]; + } + } + else { + if ((d[j][1] != null && d[j][1] < db.min) || db.min == null) { + db.min = d[j][1]; + } + if ((d[j][1] != null && d[j][1] > db.max) || db.max == null) { + db.max = d[j][1]; + } + } + } + } + }; + + $.jqplot.LogAxisRenderer.prototype.createTicks = function() { + // we're are operating on an axis here + var ticks = this._ticks; + var userTicks = this.ticks; + var name = this.name; + var db = this._dataBounds; + var dim, interval; + var min, max; + var pos1, pos2; + var tt, i; + + // if we already have ticks, use them. + // ticks must be in order of increasing value. + if (userTicks.length) { + // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed + for (i=0; i1.99) this.pad = 1.99; + var range = max - min; + var rmin, rmax; + + if (this.tickDistribution == 'even') { + rmin = (this.min != null) ? this.min : min - min*((this.padMin-1)/2); + rmax = (this.max != null) ? this.max : max + max*((this.padMax-1)/2); + this.min = rmin; + this.max = rmax; + range = this.max - this.min; + + if (this.numberTicks == null){ + if (dim > 100) { + this.numberTicks = parseInt(3+(dim-100)/75, 10); + } + else { + this.numberTicks = 2; + } + } + + var u = Math.pow(this.base, (1/(this.numberTicks-1)*Math.log(this.max/this.min)/Math.log(this.base))); + for (var i=0; i 100) { + this.numberTicks = Math.round(Math.log(this.max/this.min)/Math.log(this.base) + 1); + if (this.numberTicks < 2) { + this.numberTicks = 2; + } + fittedTicks = parseInt(3+(dim-100)/75, 10); + } + else { + this.numberTicks = 2; + fittedTicks = 2; + } + // if we don't have enough ticks, add some intermediate ticks + // how many to have between major ticks. + if (this.numberTicks < fittedTicks-1) { + minorTicks = Math.floor(fittedTicks/this.numberTicks); + } + } + + for (var i=0; i=0; j--) { + var val = tt1-interval*(j+1); + var t = new this.tickRenderer(this.tickOptions); + if (!this.showTicks) { + t.showLabel = false; + t.showMark = false; + } + else if (!this.showTickMarks) { + t.showMark = false; + } + t.setTick(val, this.name); + this._ticks.push(t); + } + } + } + } + } + }; + + $.jqplot.LogAxisRenderer.prototype.pack = function(pos, offsets) { + var lb = parseInt(this.base, 10); + var ticks = this._ticks; + var trans = function (v) { return Math.log(v)/Math.log(lb); }; + var invtrans = function (v) { return Math.pow(Math.E, (Math.log(lb)*v)); }; + var max = trans(this.max); + var min = trans(this.min); + var offmax = offsets.max; + var offmin = offsets.min; + var lshow = (this._label == null) ? false : this._label.show; + + for (var p in pos) { + this._elem.css(p, pos[p]); + } + + this._offsets = offsets; + // pixellength will be + for x axes and - for y axes becasue pixels always measured from top left. + var pixellength = offmax - offmin; + var unitlength = max - min; + + // point to unit and unit to point conversions references to Plot DOM element top left corner. + this.p2u = function(p){ + return invtrans((p - offmin) * unitlength / pixellength + min); + }; + + this.u2p = function(u){ + return (trans(u) - min) * pixellength / unitlength + offmin; + }; + + if (this.name == 'xaxis' || this.name == 'x2axis'){ + this.series_u2p = function(u){ + return (trans(u) - min) * pixellength / unitlength; + }; + this.series_p2u = function(p){ + return invtrans(p * unitlength / pixellength + min); + }; + } + // yaxis is max at top of canvas. + else { + this.series_u2p = function(u){ + return (trans(u) - max) * pixellength / unitlength; + }; + this.series_p2u = function(p){ + return invtrans(p * unitlength / pixellength + max); + }; + } + + if (this.show) { + if (this.name == 'xaxis' || this.name == 'x2axis') { + for (var i=0; i 0) { + shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2; + } + else { + shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2; + } + break; + case 'middle': + // if (t.angle > 0) { + // shim = -t.getHeight()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2; + // } + // else { + // shim = -t.getHeight()/2 - t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2; + // } + shim = -t.getHeight()/2; + break; + default: + shim = -t.getHeight()/2; + break; + } + } + else { + shim = -t.getHeight()/2; + } + + var val = this.u2p(t.value) + shim + 'px'; + t._elem.css('top', val); + t.pack(); + } + } + if (lshow) { + var h = this._label._elem.outerHeight(true); + this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px'); + if (this.name == 'yaxis') { + this._label._elem.css('left', '0px'); + } + else { + this._label._elem.css('right', '0px'); + } + this._label.pack(); + } + } + } + }; +})(jQuery); \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.logAxisRenderer.min.js b/templates/Froxlor/assets/js/plugins/jqplot.logAxisRenderer.min.js new file mode 100644 index 00000000..227c2ca9 --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.logAxisRenderer.min.js @@ -0,0 +1,30 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function(a){a.jqplot.LogAxisRenderer=function(){a.jqplot.LinearAxisRenderer.call(this);this.axisDefaults={base:10,tickDistribution:"even"}};a.jqplot.LogAxisRenderer.prototype=new a.jqplot.LinearAxisRenderer();a.jqplot.LogAxisRenderer.prototype.constructor=a.jqplot.LogAxisRenderer;a.jqplot.LogAxisRenderer.prototype.init=function(e){a.extend(true,this.renderer,e);for(var h in this.renderer.axisDefaults){if(this[h]==null){this[h]=this.renderer.axisDefaults[h]}}var b=this._dataBounds;for(var f=0;fb.max)||b.max==null){b.max=h[c][0]}}else{if((h[c][1]!=null&&h[c][1]b.max)||b.max==null){b.max=h[c][1]}}}}};a.jqplot.LogAxisRenderer.prototype.createTicks=function(){var A=this._ticks;var x=this.ticks;var D=this.name;var z=this._dataBounds;var s,y;var o,v;var e,d;var b,w;if(x.length){for(w=0;w100){this.numberTicks=parseInt(3+(s-100)/75,10)}else{this.numberTicks=2}}var h=Math.pow(this.base,(1/(this.numberTicks-1)*Math.log(this.max/this.min)/Math.log(this.base)));for(var w=0;w100){this.numberTicks=Math.round(Math.log(this.max/this.min)/Math.log(this.base)+1);if(this.numberTicks<2){this.numberTicks=2}q=parseInt(3+(s-100)/75,10)}else{this.numberTicks=2;q=2}if(this.numberTicks=0;p--){var C=m-y*(p+1);var k=new this.tickRenderer(this.tickOptions);if(!this.showTicks){k.showLabel=false;k.showMark=false}else{if(!this.showTickMarks){k.showMark=false}}k.setTick(C,this.name);this._ticks.push(k)}}}}}}};a.jqplot.LogAxisRenderer.prototype.pack=function(f,e){var r=parseInt(this.base,10);var y=this._ticks;var d=function(h){return Math.log(h)/Math.log(r)};var b=function(h){return Math.pow(Math.E,(Math.log(r)*h))};var u=d(this.max);var s=d(this.min);var m=e.max;var k=e.min;var o=(this._label==null)?false:this._label.show;for(var q in f){this._elem.css(q,f[q])}this._offsets=e;var g=m-k;var j=u-s;this.p2u=function(h){return b((h-k)*j/g+s)};this.u2p=function(h){return(d(h)-s)*g/j+k};if(this.name=="xaxis"||this.name=="x2axis"){this.series_u2p=function(h){return(d(h)-s)*g/j};this.series_p2u=function(h){return b(h*j/g+s)}}else{this.series_u2p=function(h){return(d(h)-u)*g/j};this.series_p2u=function(h){return b(h*j/g+u)}}if(this.show){if(this.name=="xaxis"||this.name=="x2axis"){for(var v=0;v0){c=-n._textRenderer.height*Math.cos(-n._textRenderer.angle)/2}else{c=-n.getHeight()+n._textRenderer.height*Math.cos(n._textRenderer.angle)/2}break;case"middle":c=-n.getHeight()/2;break;default:c=-n.getHeight()/2;break}}else{c=-n.getHeight()/2}var z=this.u2p(n.value)+c+"px";n._elem.css("top",z);n.pack()}}if(o){var x=this._label._elem.outerHeight(true);this._label._elem.css("top",m-g/2-x/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px")}else{this._label._elem.css("right","0px")}this._label.pack()}}}}})(jQuery); \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.mekkoAxisRenderer.js b/templates/Froxlor/assets/js/plugins/jqplot.mekkoAxisRenderer.js new file mode 100644 index 00000000..991ed878 --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.mekkoAxisRenderer.js @@ -0,0 +1,610 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + // class: $.jqplot.MekkoAxisRenderer + // An axis renderer for a Mekko chart. + // Should be used with a Mekko chart where the mekkoRenderer is used on the series. + // Displays the Y axis as a range from 0 to 1 (0 to 100%) and the x axis with a tick + // for each series scaled to the sum of all the y values. + $.jqplot.MekkoAxisRenderer = function() { + }; + + // called with scope of axis object. + $.jqplot.MekkoAxisRenderer.prototype.init = function(options){ + // prop: tickMode + // How to space the ticks on the axis. + // 'bar' will place a tick at the width of each bar. + // This is the default for the x axis. + // 'even' will place ticks at even intervals. This is + // the default for x2 axis and y axis. y axis cannot be changed. + this.tickMode; + // prop: barLabelRenderer + // renderer to use to draw labels under each bar. + this.barLabelRenderer = $.jqplot.AxisLabelRenderer; + // prop: barLabels + // array of labels to put under each bar. + this.barLabels = this.barLabels || []; + // prop: barLabelOptions + // options object to pass to the bar label renderer. + this.barLabelOptions = {}; + this.tickOptions = $.extend(true, {showGridline:false}, this.tickOptions); + this._barLabels = []; + $.extend(true, this, options); + if (this.name == 'yaxis') { + this.tickOptions.formatString = this.tickOptions.formatString || "%d\%"; + } + var db = this._dataBounds; + db.min = 0; + // for y axes, scale always go from 0 to 1 (0 to 100%) + if (this.name == 'yaxis' || this.name == 'y2axis') { + db.max = 100; + this.tickMode = 'even'; + } + // For x axes, scale goes from 0 to sum of all y values. + else if (this.name == 'xaxis'){ + this.tickMode = (this.tickMode == null) ? 'bar' : this.tickMode; + for (var i=0; i dim) { + dim = temp; + } + } + } + + if (lshow) { + w = this._label._elem.outerWidth(true); + h = this._label._elem.outerHeight(true); + } + if (this.name == 'xaxis') { + dim = dim + h; + this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'}); + } + else if (this.name == 'x2axis') { + dim = dim + h; + this._elem.css({'height':dim+'px', left:'0px', top:'0px'}); + } + else if (this.name == 'yaxis') { + dim = dim + w; + this._elem.css({'width':dim+'px', left:'0px', top:'0px'}); + if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) { + this._label._elem.css('width', w+'px'); + } + } + else { + dim = dim + w; + this._elem.css({'width':dim+'px', right:'0px', top:'0px'}); + if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) { + this._label._elem.css('width', w+'px'); + } + } + } + }; + + // called with scope of axis + $.jqplot.MekkoAxisRenderer.prototype.createTicks = function() { + // we're are operating on an axis here + var ticks = this._ticks; + var userTicks = this.ticks; + var name = this.name; + // databounds were set on axis initialization. + var db = this._dataBounds; + var dim, interval; + var min, max; + var pos1, pos2; + var t, tt, i, j; + + // if we already have ticks, use them. + // ticks must be in order of increasing value. + + if (userTicks.length) { + // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed + for (i=0; i 0) { + adj = Math.max(Math.log(min)/Math.LN10, 0.05); + } + min -= adj; + max += adj; + } + + var range = max - min; + var rmin, rmax; + var temp, prev, curr; + var ynumticks = [3,5,6,11,21]; + + // yaxis divide ticks in nice intervals from 0 to 1. + if (this.name == 'yaxis' || this.name == 'y2axis') { + this.min = 0; + this.max = 100; + // user didn't specify number of ticks. + if (!this.numberTicks){ + if (this.tickInterval) { + this.numberTicks = 3 + Math.ceil(range / this.tickInterval); + } + else { + temp = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing); + for (i=0; i 1) { + prev = curr; + continue; + } + else if (curr < 1) { + // was prev or is curr closer to one? + if (Math.abs(prev - 1) < Math.abs(curr - 1)) { + this.numberTicks = ynumticks[i-1]; + break; + } + else { + this.numberTicks = ynumticks[i]; + break; + } + } + else if (i == ynumticks.length -1) { + this.numberTicks = ynumticks[i]; + } + } + this.tickInterval = range / (this.numberTicks - 1); + } + } + + // user did specify number of ticks. + else { + this.tickInterval = range / (this.numberTicks - 1); + } + + for (var i=0; i temp) { + t = new this.tickRenderer(this.tickOptions); + if (!this.showTicks) { + t.showLabel = false; + t.showMark = false; + } + else if (!this.showTickMarks) { + t.showMark = false; + } + t.setTick(this.max, this.name); + this._ticks.push(t); + + } + } + + else if (this.tickMode == 'even') { + this.min = 0; + this.max = this.max || db.max; + // get a desired number of ticks + var nt = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing); + range = this.max - this.min; + this.numberTicks = nt; + this.tickInterval = range / (this.numberTicks - 1); + + for (i=0; i 0) { + shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2; + } + else { + shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2; + } + break; + case 'middle': + shim = -t.getHeight()/2; + break; + default: + shim = -t.getHeight()/2; + break; + } + } + else { + shim = -t.getHeight()/2; + } + + var val = this.u2p(t.value) + shim + 'px'; + t._elem.css('top', val); + t.pack(); + } + } + if (lshow) { + var h = this._label._elem.outerHeight(true); + this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px'); + if (this.name == 'yaxis') { + this._label._elem.css('left', '0px'); + } + else { + this._label._elem.css('right', '0px'); + } + this._label.pack(); + } + } + } + }; +})(jQuery); diff --git a/templates/Froxlor/assets/js/plugins/jqplot.mekkoAxisRenderer.min.js b/templates/Froxlor/assets/js/plugins/jqplot.mekkoAxisRenderer.min.js new file mode 100644 index 00000000..fe79d7ce --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.mekkoAxisRenderer.min.js @@ -0,0 +1,30 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function(a){a.jqplot.MekkoAxisRenderer=function(){};a.jqplot.MekkoAxisRenderer.prototype.init=function(c){this.tickMode;this.barLabelRenderer=a.jqplot.AxisLabelRenderer;this.barLabels=this.barLabels||[];this.barLabelOptions={};this.tickOptions=a.extend(true,{showGridline:false},this.tickOptions);this._barLabels=[];a.extend(true,this,c);if(this.name=="yaxis"){this.tickOptions.formatString=this.tickOptions.formatString||"%d%"}var b=this._dataBounds;b.min=0;if(this.name=="yaxis"||this.name=="y2axis"){b.max=100;this.tickMode="even"}else{if(this.name=="xaxis"){this.tickMode=(this.tickMode==null)?"bar":this.tickMode;for(var d=0;dk){k=d}}}if(b){c=this._label._elem.outerWidth(true);j=this._label._elem.outerHeight(true)}if(this.name=="xaxis"){k=k+j;this._elem.css({height:k+"px",left:"0px",bottom:"0px"})}else{if(this.name=="x2axis"){k=k+j;this._elem.css({height:k+"px",left:"0px",top:"0px"})}else{if(this.name=="yaxis"){k=k+c;this._elem.css({width:k+"px",left:"0px",top:"0px"});if(b&&this._label.constructor==a.jqplot.AxisLabelRenderer){this._label._elem.css("width",c+"px")}}else{k=k+c;this._elem.css({width:k+"px",right:"0px",top:"0px"});if(b&&this._label.constructor==a.jqplot.AxisLabelRenderer){this._label._elem.css("width",c+"px")}}}}}};a.jqplot.MekkoAxisRenderer.prototype.createTicks=function(){var z=this._ticks;var w=this.ticks;var B=this.name;var y=this._dataBounds;var p,x;var n,r;var d,c;var h,b,s,q;if(w.length){for(s=0;s0){g=Math.max(Math.log(n)/Math.LN10,0.05)}n-=g;r+=g}var k=r-n;var m,o;var v,l,u;var f=[3,5,6,11,21];if(this.name=="yaxis"||this.name=="y2axis"){this.min=0;this.max=100;if(!this.numberTicks){if(this.tickInterval){this.numberTicks=3+Math.ceil(k/this.tickInterval)}else{v=2+Math.ceil((p-(this.tickSpacing-1))/this.tickSpacing);for(s=0;s1){l=u;continue}else{if(u<1){if(Math.abs(l-1)v){h=new this.tickRenderer(this.tickOptions);if(!this.showTicks){h.showLabel=false;h.showMark=false}else{if(!this.showTickMarks){h.showMark=false}}h.setTick(this.max,this.name);this._ticks.push(h)}}else{if(this.tickMode=="even"){this.min=0;this.max=this.max||y.max;var A=2+Math.ceil((p-(this.tickSpacing-1))/this.tickSpacing);k=this.max-this.min;this.numberTicks=A;this.tickInterval=k/(this.numberTicks-1);for(s=0;s0){c=-n._textRenderer.height*Math.cos(-n._textRenderer.angle)/2}else{c=-n.getHeight()+n._textRenderer.height*Math.cos(n._textRenderer.angle)/2}break;case"middle":c=-n.getHeight()/2;break;default:c=-n.getHeight()/2;break}}else{c=-n.getHeight()/2}var D=this.u2p(n.value)+c+"px";n._elem.css("top",D);n.pack()}}if(o){var z=this._label._elem.outerHeight(true);this._label._elem.css("top",m-f/2-z/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px")}else{this._label._elem.css("right","0px")}this._label.pack()}}}}})(jQuery); \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.mekkoRenderer.js b/templates/Froxlor/assets/js/plugins/jqplot.mekkoRenderer.js new file mode 100644 index 00000000..207f7061 --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.mekkoRenderer.js @@ -0,0 +1,436 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + /** + * Class: $.jqplot.MekkoRenderer + * Draws a Mekko style chart which shows 3 dimensional data on a 2 dimensional graph. + * the <$.jqplot.MekkoAxisRenderer> should be used with mekko charts. The mekko renderer + * overrides the default legend renderer with it's own $.jqplot.MekkoLegendRenderer + * which allows more flexibility to specify number of rows and columns in the legend. + * + * Data is specified per bar in the chart. You can specify data as an array of y values, or as + * an array of [label, value] pairs. Note that labels are used only on the first series. + * Labels on subsequent series are ignored: + * + * > bar1 = [['shirts', 8],['hats', 14],['shoes', 6],['gloves', 16],['dolls', 12]]; + * > bar2 = [15,6,9,13,6]; + * > bar3 = [['grumpy',4],['sneezy',2],['happy',7],['sleepy',9],['doc',7]]; + * + * If you want to place labels for each bar under the axis, you use the barLabels option on + * the axes. The bar labels can be styled with the ".jqplot-mekko-barLabel" css class. + * + * > barLabels = ['Mickey Mouse', 'Donald Duck', 'Goofy']; + * > axes:{xaxis:{barLabels:barLabels}} + * + */ + + + $.jqplot.MekkoRenderer = function(){ + this.shapeRenderer = new $.jqplot.ShapeRenderer(); + // prop: borderColor + // color of the borders between areas on the chart + this.borderColor = null; + // prop: showBorders + // True to draw borders lines between areas on the chart. + // False will draw borders lines with the same color as the area. + this.showBorders = true; + }; + + // called with scope of series. + $.jqplot.MekkoRenderer.prototype.init = function(options, plot) { + this.fill = false; + this.fillRect = true; + this.strokeRect = true; + this.shadow = false; + // width of bar on x axis. + this._xwidth = 0; + this._xstart = 0; + $.extend(true, this.renderer, options); + // set the shape renderer options + var opts = {lineJoin:'miter', lineCap:'butt', isarc:false, fillRect:this.fillRect, strokeRect:this.strokeRect}; + this.renderer.shapeRenderer.init(opts); + plot.axes.x2axis._series.push(this); + this._type = 'mekko'; + }; + + // Method: setGridData + // converts the user data values to grid coordinates and stores them + // in the gridData array. Will convert user data into appropriate + // rectangles. + // Called with scope of a series. + $.jqplot.MekkoRenderer.prototype.setGridData = function(plot) { + // recalculate the grid data + var xp = this._xaxis.series_u2p; + var yp = this._yaxis.series_u2p; + var data = this._plotData; + this.gridData = []; + // figure out width on x axis. + // this._xwidth = this._sumy / plot._sumy * this.canvas.getWidth(); + this._xwidth = xp(this._sumy) - xp(0); + if (this.index>0) { + this._xstart = plot.series[this.index-1]._xstart + plot.series[this.index-1]._xwidth; + } + var totheight = this.canvas.getHeight(); + var sumy = 0; + var cury; + var curheight; + for (var i=0; i
'); + // Mekko charts legends don't go by number of series, but by number of data points + // in the series. Refactor things here for that. + + var pad = false, + reverse = true, // mekko charts are always stacked, so reverse + nr, nc; + var s = series[0]; + var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors); + + if (s.show) { + var pd = s.data; + if (this.numberRows) { + nr = this.numberRows; + if (!this.numberColumns){ + nc = Math.ceil(pd.length/nr); + } + else{ + nc = this.numberColumns; + } + } + else if (this.numberColumns) { + nc = this.numberColumns; + nr = Math.ceil(pd.length/this.numberColumns); + } + else { + nr = pd.length; + nc = 1; + } + + var i, j, tr, td1, td2, lt, rs, color; + var idx = 0; + + for (i=0; i
'+ + '
'+ + '
');var w=false,n=true,c,l;var p=o[0];var d=new b.jqplot.ColorGenerator(p.seriesColors);if(p.show){var x=p.data;if(this.numberRows){c=this.numberRows;if(!this.numberColumns){l=Math.ceil(x.length/c)}else{l=this.numberColumns}}else{if(this.numberColumns){l=this.numberColumns;c=Math.ceil(x.length/this.numberColumns)}else{c=x.length;l=1}}var v,u,e,h,g,k,m,t;var q=0;for(v=0;v').prependTo(this._elem)}else{e=b('').appendTo(this._elem)}for(u=0;u0){w=true}else{w=false}}else{if(v==c-1){w=false}else{w=true}}m=(w)?this.rowSpacing:"0";h=b('
');g=b('');if(this.escapeHtml){g.text(k)}else{g.html(k)}if(n){g.prependTo(e);h.prependTo(e)}else{h.appendTo(e);g.appendTo(e)}w=true}q++}}e=null;h=null;g=null}}return this._elem};b.jqplot.MekkoLegendRenderer.prototype.pack=function(f){if(this.show){var e={_top:f.top,_left:f.left,_right:f.right,_bottom:this._plotDimensions.height-f.bottom};if(this.placement=="insideGrid"){switch(this.location){case"nw":var d=e._left+this.xoffset;var c=e._top+this.yoffset;this._elem.css("left",d);this._elem.css("top",c);break;case"n":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=e._top+this.yoffset;this._elem.css("left",d);this._elem.css("top",c);break;case"ne":var d=f.right+this.xoffset;var c=e._top+this.yoffset;this._elem.css({right:d,top:c});break;case"e":var d=f.right+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({right:d,top:c});break;case"se":var d=f.right+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({right:d,bottom:c});break;case"s":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=f.bottom+this.yoffset;this._elem.css({left:d,bottom:c});break;case"sw":var d=e._left+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({left:d,bottom:c});break;case"w":var d=e._left+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({left:d,top:c});break;default:var d=e._right-this.xoffset;var c=e._bottom+this.yoffset;this._elem.css({right:d,bottom:c});break}}else{switch(this.location){case"nw":var d=this._plotDimensions.width-e._left+this.xoffset;var c=e._top+this.yoffset;this._elem.css("right",d);this._elem.css("top",c);break;case"n":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=this._plotDimensions.height-e._top+this.yoffset;this._elem.css("left",d);this._elem.css("bottom",c);break;case"ne":var d=this._plotDimensions.width-f.right+this.xoffset;var c=e._top+this.yoffset;this._elem.css({left:d,top:c});break;case"e":var d=this._plotDimensions.width-f.right+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({left:d,top:c});break;case"se":var d=this._plotDimensions.width-f.right+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({left:d,bottom:c});break;case"s":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=this._plotDimensions.height-f.bottom+this.yoffset;this._elem.css({left:d,top:c});break;case"sw":var d=this._plotDimensions.width-e._left+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({right:d,bottom:c});break;case"w":var d=this._plotDimensions.width-e._left+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({right:d,top:c});break;default:var d=e._right-this.xoffset;var c=e._bottom+this.yoffset;this._elem.css({right:d,bottom:c});break}}}};function a(g,f,d){d=d||{};d.axesDefaults=d.axesDefaults||{};d.legend=d.legend||{};d.seriesDefaults=d.seriesDefaults||{};var c=false;if(d.seriesDefaults.renderer==b.jqplot.MekkoRenderer){c=true}else{if(d.series){for(var e=0;e + * + * Properties described here are passed into the $.jqplot function + * as options on the series renderer. For example: + * + * > plot0 = $.jqplot('chart0',[[18]],{ + * > title: 'Network Speed', + * > seriesDefaults: { + * > renderer: $.jqplot.MeterGaugeRenderer, + * > rendererOptions: { + * > label: 'MB/s' + * > } + * > } + * > }); + * + * A meterGauge plot does not support events. + */ + $.jqplot.MeterGaugeRenderer = function(){ + $.jqplot.LineRenderer.call(this); + }; + + $.jqplot.MeterGaugeRenderer.prototype = new $.jqplot.LineRenderer(); + $.jqplot.MeterGaugeRenderer.prototype.constructor = $.jqplot.MeterGaugeRenderer; + + // called with scope of a series + $.jqplot.MeterGaugeRenderer.prototype.init = function(options) { + // Group: Properties + // + // prop: diameter + // Outer diameter of the meterGauge, auto computed by default + this.diameter = null; + // prop: padding + // padding between the meterGauge and plot edges, auto + // calculated by default. + this.padding = null; + // prop: shadowOffset + // offset of the shadow from the gauge ring and offset of + // each succesive stroke of the shadow from the last. + this.shadowOffset = 2; + // prop: shadowAlpha + // transparency of the shadow (0 = transparent, 1 = opaque) + this.shadowAlpha = 0.07; + // prop: shadowDepth + // number of strokes to apply to the shadow, + // each stroke offset shadowOffset from the last. + this.shadowDepth = 4; + // prop: background + // background color of the inside of the gauge. + this.background = "#efefef"; + // prop: ringColor + // color of the outer ring, hub, and needle of the gauge. + this.ringColor = "#BBC6D0"; + // needle color not implemented yet. + this.needleColor = "#C3D3E5"; + // prop: tickColor + // color of the tick marks around the gauge. + this.tickColor = "989898"; + // prop: ringWidth + // width of the ring around the gauge. Auto computed by default. + this.ringWidth = null; + // prop: min + // Minimum value on the gauge. Auto computed by default + this.min; + // prop: max + // Maximum value on the gauge. Auto computed by default + this.max; + // prop: ticks + // Array of tick values. Auto computed by default. + this.ticks = []; + // prop: showTicks + // true to show ticks around gauge. + this.showTicks = true; + // prop: showTickLabels + // true to show tick labels next to ticks. + this.showTickLabels = true; + // prop: label + // A gauge label like 'kph' or 'Volts' + this.label = null; + // prop: labelHeightAdjust + // Number of Pixels to offset the label up (-) or down (+) from its default position. + this.labelHeightAdjust = 0; + // prop: labelPosition + // Where to position the label, either 'inside' or 'bottom'. + this.labelPosition = 'inside'; + // prop: intervals + // Array of ranges to be drawn around the gauge. + // Array of form: + // > [value1, value2, ...] + // indicating the values for the first, second, ... intervals. + this.intervals = []; + // prop: intervalColors + // Array of colors to use for the intervals. + this.intervalColors = [ "#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"]; + // prop: intervalInnerRadius + // Radius of the inner circle of the interval ring. + this.intervalInnerRadius = null; + // prop: intervalOuterRadius + // Radius of the outer circle of the interval ring. + this.intervalOuterRadius = null; + this.tickRenderer = $.jqplot.MeterGaugeTickRenderer; + // ticks spaced every 1, 2, 2.5, 5, 10, 20, .1, .2, .25, .5, etc. + this.tickPositions = [1, 2, 2.5, 5, 10]; + // prop: tickSpacing + // Degrees between ticks. This is a target number, if + // incompatible span and ticks are supplied, a suitable + // spacing close to this value will be computed. + this.tickSpacing = 30; + this.numberMinorTicks = null; + // prop: hubRadius + // Radius of the hub at the bottom center of gauge which the needle attaches to. + // Auto computed by default + this.hubRadius = null; + // prop: tickPadding + // padding of the tick marks to the outer ring and the tick labels to marks. + // Auto computed by default. + this.tickPadding = null; + // prop: needleThickness + // Maximum thickness the needle. Auto computed by default. + this.needleThickness = null; + // prop: needlePad + // Padding between needle and inner edge of the ring when the needle is at the min or max gauge value. + this.needlePad = 6; + // prop: pegNeedle + // True will stop needle just below/above the min/max values if data is below/above min/max, + // as if the meter is "pegged". + this.pegNeedle = true; + this._type = 'meterGauge'; + + $.extend(true, this, options); + this.type = null; + this.numberTicks = null; + this.tickInterval = null; + // span, the sweep (in degrees) from min to max. This gauge is + // a semi-circle. + this.span = 180; + // get rid of this nonsense + // this.innerSpan = this.span; + if (this.type == 'circular') { + this.semiCircular = false; + } + else if (this.type != 'circular') { + this.semiCircular = true; + } + else { + this.semiCircular = (this.span <= 180) ? true : false; + } + this._tickPoints = []; + // reference to label element. + this._labelElm = null; + + // start the gauge at the beginning of the span + this.startAngle = (90 + (360 - this.span)/2) * Math.PI/180; + this.endAngle = (90 - (360 - this.span)/2) * Math.PI/180; + + this.setmin = !!(this.min == null); + this.setmax = !!(this.max == null); + + // if given intervals and is an array of values, create labels and colors. + if (this.intervals.length) { + if (this.intervals[0].length == null || this.intervals.length == 1) { + for (var i=0; i= this.data[0][1]) { + this.max = this.intervals[this.intervals.length-1][0]; + this.setmax = false; + } + } + else { + this.setmax = false; + } + } + + else { + // no ticks and no intervals supplied, put needle in middle + this.min = (this.min == null) ? 0 : this.min; + this.setmin = false; + if (this.max == null) { + this.max = this.data[0][1] * 1.25; + this.setmax = true; + } + else { + this.setmax = false; + } + } + }; + + $.jqplot.MeterGaugeRenderer.prototype.setGridData = function(plot) { + // set gridData property. This will hold angle in radians of each data point. + var stack = []; + var td = []; + var sa = this.startAngle; + for (var i=0; i0) { + stack[i] += stack[i-1]; + } + } + var fact = Math.PI*2/stack[stack.length - 1]; + + for (var i=0; i0) { + stack[i] += stack[i-1]; + } + } + var fact = Math.PI*2/stack[stack.length - 1]; + + for (var i=0; i=0; i--) { + temp = interval/(pos[i] * Math.pow(10, fact)); + if (temp == 4 || temp == 5) { + return temp - 1; + } + } + return null; + } + + // called with scope of series + $.jqplot.MeterGaugeRenderer.prototype.draw = function (ctx, gd, options) { + var i; + var opts = (options != undefined) ? options : {}; + // offset and direction of offset due to legend placement + var offx = 0; + var offy = 0; + var trans = 1; + if (options.legendInfo && options.legendInfo.placement == 'inside') { + var li = options.legendInfo; + switch (li.location) { + case 'nw': + offx = li.width + li.xoffset; + break; + case 'w': + offx = li.width + li.xoffset; + break; + case 'sw': + offx = li.width + li.xoffset; + break; + case 'ne': + offx = li.width + li.xoffset; + trans = -1; + break; + case 'e': + offx = li.width + li.xoffset; + trans = -1; + break; + case 'se': + offx = li.width + li.xoffset; + trans = -1; + break; + case 'n': + offy = li.height + li.yoffset; + break; + case 's': + offy = li.height + li.yoffset; + trans = -1; + break; + default: + break; + } + } + + + + // pre-draw so can get it's dimensions. + if (this.label) { + this._labelElem = $('
'+this.label+'
'); + this.canvas._elem.after(this._labelElem); + } + + var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow; + var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine; + var fill = (opts.fill != undefined) ? opts.fill : this.fill; + var cw = ctx.canvas.width; + var ch = ctx.canvas.height; + if (this.padding == null) { + this.padding = Math.round(Math.min(cw, ch)/30); + } + var w = cw - offx - 2 * this.padding; + var h = ch - offy - 2 * this.padding; + if (this.labelPosition == 'bottom' && this.label) { + h -= this._labelElem.outerHeight(true); + } + var mindim = Math.min(w,h); + var d = mindim; + + if (!this.diameter) { + if (this.semiCircular) { + if ( w >= 2*h) { + if (!this.ringWidth) { + this.ringWidth = 2*h/35; + } + this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8); + this.innerPad = this.ringWidth/2 + this.needleThickness/2 + this.needlePad; + this.diameter = 2 * (h - 2*this.innerPad); + } + else { + if (!this.ringWidth) { + this.ringWidth = w/35; + } + this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8); + this.innerPad = this.ringWidth/2 + this.needleThickness/2 + this.needlePad; + this.diameter = w - 2*this.innerPad; + } + // center taking into account legend and over draw for gauge bottom below hub. + // this will be center of hub. + this._center = [(cw - trans * offx)/2 + trans * offx, (ch + trans*offy - this.padding - this.ringWidth - this.innerPad)]; + } + else { + if (!this.ringWidth) { + this.ringWidth = d/35; + } + this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8); + this.innerPad = 0; + this.diameter = d - this.ringWidth; + // center in middle of canvas taking into account legend. + // will be center of hub. + this._center = [(cw-trans*offx)/2 + trans * offx, (ch-trans*offy)/2 + trans * offy]; + } + } + + if (this._labelElem && this.labelPosition == 'bottom') { + this._center[1] -= this._labelElem.outerHeight(true); + } + + this._radius = this.diameter/2; + + this.tickSpacing = 6000/this.diameter; + + if (!this.hubRadius) { + this.hubRadius = this.diameter/18; + } + + this.shadowOffset = 0.5 + this.ringWidth/9; + this.shadowWidth = this.ringWidth*1; + + this.tickPadding = 3 + Math.pow(this.diameter/20, 0.7); + this.tickOuterRadius = this._radius - this.ringWidth/2 - this.tickPadding; + this.tickLength = (this.showTicks) ? this._radius/13 : 0; + + if (this.ticks.length == 0) { + // no ticks, lets make some. + var max = this.max, + min = this.min, + setmax = this.setmax, + setmin = this.setmin, + ti = (max - min) * this.tickSpacing / this.span; + var tf = Math.floor(parseFloat((Math.log(ti)/Math.log(10)).toFixed(11))); + var tp = (ti/Math.pow(10, tf)); + (tp > 2 && tp <= 2.5) ? tp = 2.5 : tp = Math.ceil(tp); + var t = this.tickPositions; + var tpindex, nt; + + for (i=0; i 0) ? min - min % ti : min - min % ti - ti; + if (!this.forceZero) { + var diff = Math.min(min - tmin, 0.8*ti); + var ntp = Math.floor(diff/t[tpindex]); + if (ntp > 1) { + tmin = tmin + t[tpindex] * (ntp-1); + if (parseInt(tmin, 10) != tmin && parseInt(tmin-t[tpindex], 10) == tmin-t[tpindex]) { + tmin = tmin - t[tpindex]; + } + } + } + if (min == tmin) { + min -= ti; + } + else { + // tmin should always be lower than dataMin + if (min - tmin > 0.23*ti) { + min = tmin; + } + else { + min = tmin -ti; + nt += 1; + } + } + nt += 1; + var tmax = min + (nt - 1) * ti; + if (max >= tmax) { + tmax += ti; + nt += 1; + } + // now tmax should always be mroe than dataMax + if (tmax - max < 0.23*ti) { + tmax += ti; + nt += 1; + } + this.max = max = tmax; + this.min = min; + + this.tickInterval = ti; + this.numberTicks = nt; + var it; + for (i=0; i= tmax) { + max = tmax + ti; + nt += 1; + } + else { + max = tmax; + } + + this.tickInterval = this.tickInterval || ti; + this.numberTicks = this.numberTicks || nt; + var it; + for (i=0; i 1) { + var rstr = String(range); + if (rstr.search(/\./) == -1) { + var pos = rstr.search(/0+$/); + nonSigDigits = (pos > 0) ? rstr.length - pos - 1 : 0; + } + } + sigRange = range/Math.pow(10, nonSigDigits); + for (i=0; i'+this.ticks[i][1]+''); + this.canvas._elem.after(elem); + ew = elem.outerWidth(true); + eh = elem.outerHeight(true); + l = this._tickPoints[i][0] - ew * (this._tickPoints[i][2]-Math.PI)/Math.PI - tp * Math.cos(this._tickPoints[i][2]); + t = this._tickPoints[i][1] - eh/2 + eh/2 * Math.pow(Math.abs((Math.sin(this._tickPoints[i][2]))), 0.5) + tp/3 * Math.pow(Math.abs((Math.sin(this._tickPoints[i][2]))), 0.5) ; + // t = this._tickPoints[i][1] - eh/2 - eh/2 * Math.sin(this._tickPoints[i][2]) - tp/2 * Math.sin(this._tickPoints[i][2]); + elem.css({left:l, top:t}); + dim = ew*Math.cos(this._tickPoints[i][2]) + eh*Math.sin(Math.PI/2+this._tickPoints[i][2]/2); + maxdim = (dim > maxdim) ? dim : maxdim; + } + } + + // draw the gauge label + if (this.label && this.labelPosition == 'inside') { + var l = this._center[0] + this.canvas._offsets.left; + var tp = this.tickPadding * (1 - 1/(this.diameter/80+1)); + var t = 0.5*(this._center[1] + this.canvas._offsets.top - this.hubRadius) + 0.5*(this._center[1] + this.canvas._offsets.top - this.tickOuterRadius + this.tickLength + tp) + this.labelHeightAdjust; + // this._labelElem = $('
'+this.label+'
'); + // this.canvas._elem.after(this._labelElem); + l -= this._labelElem.outerWidth(true)/2; + t -= this._labelElem.outerHeight(true)/2; + this._labelElem.css({left:l, top:t}); + } + + else if (this.label && this.labelPosition == 'bottom') { + var l = this._center[0] + this.canvas._offsets.left - this._labelElem.outerWidth(true)/2; + var t = this._center[1] + this.canvas._offsets.top + this.innerPad + + this.ringWidth + this.padding + this.labelHeightAdjust; + this._labelElem.css({left:l, top:t}); + + } + + // draw the intervals + + ctx.save(); + var inner = this.intervalInnerRadius || this.hubRadius * 1.5; + if (this.intervalOuterRadius == null) { + if (this.showTickLabels) { + var outer = (this.tickOuterRadius - this.tickLength - this.tickPadding - this.diameter/8); + } + else { + var outer = (this.tickOuterRadius - this.tickLength - this.diameter/16); + } + } + else { + var outer = this.intervalOuterRadius; + } + var range = this.max - this.min; + var intrange = this.intervals[this.intervals.length-1] - this.min; + var start, end, span = this.span*Math.PI/180; + for (i=0; i this.max + dataspan*3/this.span) { + datapoint = this.max + dataspan*3/this.span; + } + if (this.data[0][1] < this.min - dataspan*3/this.span) { + datapoint = this.min - dataspan*3/this.span; + } + } + var dataang = (datapoint - this.min)/dataspan * this.span * Math.PI/180 + this.startAngle; + + + ctx.save(); + ctx.beginPath(); + ctx.fillStyle = this.ringColor; + ctx.strokeStyle = this.ringColor; + this.needleLength = (this.tickOuterRadius - this.tickLength) * 0.85; + this.needleThickness = (this.needleThickness < 2) ? 2 : this.needleThickness; + var endwidth = this.needleThickness * 0.4; + + + var dl = this.needleLength/10; + var dt = (this.needleThickness - endwidth)/10; + var templ; + for (var i=0; i<10; i++) { + templ = this.needleThickness - i*dt; + ctx.moveTo(dl*i*Math.cos(dataang), dl*i*Math.sin(dataang)); + ctx.lineWidth = templ; + ctx.lineTo(dl*(i+1)*Math.cos(dataang), dl*(i+1)*Math.sin(dataang)); + ctx.stroke(); + } + + ctx.restore(); + } + else { + this._center = [(cw - trans * offx)/2 + trans * offx, (ch - trans*offy)/2 + trans * offy]; + } + }; + + $.jqplot.MeterGaugeAxisRenderer = function() { + $.jqplot.LinearAxisRenderer.call(this); + }; + + $.jqplot.MeterGaugeAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer(); + $.jqplot.MeterGaugeAxisRenderer.prototype.constructor = $.jqplot.MeterGaugeAxisRenderer; + + + // There are no traditional axes on a gauge chart. We just need to provide + // dummy objects with properties so the plot will render. + // called with scope of axis object. + $.jqplot.MeterGaugeAxisRenderer.prototype.init = function(options){ + // + this.tickRenderer = $.jqplot.MeterGaugeTickRenderer; + $.extend(true, this, options); + // I don't think I'm going to need _dataBounds here. + // have to go Axis scaling in a way to fit chart onto plot area + // and provide u2p and p2u functionality for mouse cursor, etc. + // for convienence set _dataBounds to 0 and 100 and + // set min/max to 0 and 100. + this._dataBounds = {min:0, max:100}; + this.min = 0; + this.max = 100; + this.showTicks = false; + this.ticks = []; + this.showMark = false; + this.show = false; + }; + + $.jqplot.MeterGaugeLegendRenderer = function(){ + $.jqplot.TableLegendRenderer.call(this); + }; + + $.jqplot.MeterGaugeLegendRenderer.prototype = new $.jqplot.TableLegendRenderer(); + $.jqplot.MeterGaugeLegendRenderer.prototype.constructor = $.jqplot.MeterGaugeLegendRenderer; + + /** + * Class: $.jqplot.MeterGaugeLegendRenderer + *Meter gauges don't typically have a legend, this overrides the default legend renderer. + */ + $.jqplot.MeterGaugeLegendRenderer.prototype.init = function(options) { + // Maximum number of rows in the legend. 0 or null for unlimited. + this.numberRows = null; + // Maximum number of columns in the legend. 0 or null for unlimited. + this.numberColumns = null; + $.extend(true, this, options); + }; + + // called with context of legend + $.jqplot.MeterGaugeLegendRenderer.prototype.draw = function() { + if (this.show) { + var series = this._series; + var ss = 'position:absolute;'; + ss += (this.background) ? 'background:'+this.background+';' : ''; + ss += (this.border) ? 'border:'+this.border+';' : ''; + ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : ''; + ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : ''; + ss += (this.textColor) ? 'color:'+this.textColor+';' : ''; + ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : ''; + ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : ''; + ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : ''; + ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : ''; + this._elem = $('
'); + // MeterGauge charts legends don't go by number of series, but by number of data points + // in the series. Refactor things here for that. + + var pad = false, + reverse = false, + nr, nc; + var s = series[0]; + + if (s.show) { + var pd = s.data; + if (this.numberRows) { + nr = this.numberRows; + if (!this.numberColumns){ + nc = Math.ceil(pd.length/nr); + } + else{ + nc = this.numberColumns; + } + } + else if (this.numberColumns) { + nc = this.numberColumns; + nr = Math.ceil(pd.length/this.numberColumns); + } + else { + nr = pd.length; + nc = 1; + } + + var i, j, tr, td1, td2, lt, rs, color; + var idx = 0; + + for (i=0; i').prependTo(this._elem); + } + else{ + tr = $('').appendTo(this._elem); + } + for (j=0; j0){ + pad = true; + } + else{ + pad = false; + } + } + else{ + if (i == nr -1){ + pad = false; + } + else{ + pad = true; + } + } + rs = (pad) ? this.rowSpacing : '0'; + + td1 = $(''+ + '
'+ + '
'); + td2 = $(''); + if (this.escapeHtml){ + td2.text(lt); + } + else { + td2.html(lt); + } + if (reverse) { + td2.prependTo(tr); + td1.prependTo(tr); + } + else { + td1.appendTo(tr); + td2.appendTo(tr); + } + pad = true; + } + idx++; + } + } + } + } + return this._elem; + }; + + + // setup default renderers for axes and legend so user doesn't have to + // called with scope of plot + function preInit(target, data, options) { + // debugger + options = options || {}; + options.axesDefaults = options.axesDefaults || {}; + options.legend = options.legend || {}; + options.seriesDefaults = options.seriesDefaults || {}; + options.grid = options.grid || {}; + options.gridPadding = options.gridPadding || {}; + + // only set these if there is a gauge series + var setopts = false; + if (options.seriesDefaults.renderer == $.jqplot.MeterGaugeRenderer) { + setopts = true; + } + else if (options.series) { + for (var i=0; i < options.series.length; i++) { + if (options.series[i].renderer == $.jqplot.MeterGaugeRenderer) { + setopts = true; + } + } + } + + if (setopts) { + options.axesDefaults.renderer = $.jqplot.MeterGaugeAxisRenderer; + options.legend.renderer = $.jqplot.MeterGaugeLegendRenderer; + options.legend.preDraw = true; + options.grid.background = options.grid.background || 'white'; + options.grid.drawGridlines = false; + options.grid.borderWidth = (options.grid.borderWidth != null) ? options.grid.borderWidth : 0; + options.grid.shadow = (options.grid.shadow != null) ? options.grid.shadow : false; + options.gridPadding.top = (options.gridPadding.top != null) ? options.gridPadding.top : 0; + options.gridPadding.bottom = (options.gridPadding.bottom != null) ? options.gridPadding.bottom : 0; + options.gridPadding.left = (options.gridPadding.left != null) ? options.gridPadding.left : 0; + options.gridPadding.right = (options.gridPadding.right != null) ? options.gridPadding.right : 0; + } + } + + // called with scope of plot + function postParseOptions(options) { + // + } + + $.jqplot.preInitHooks.push(preInit); + $.jqplot.postParseOptionsHooks.push(postParseOptions); + + $.jqplot.MeterGaugeTickRenderer = function() { + $.jqplot.AxisTickRenderer.call(this); + }; + + $.jqplot.MeterGaugeTickRenderer.prototype = new $.jqplot.AxisTickRenderer(); + $.jqplot.MeterGaugeTickRenderer.prototype.constructor = $.jqplot.MeterGaugeTickRenderer; + +})(jQuery); + + \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.meterGaugeRenderer.min.js b/templates/Froxlor/assets/js/plugins/jqplot.meterGaugeRenderer.min.js new file mode 100644 index 00000000..ebd89cbf --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.meterGaugeRenderer.min.js @@ -0,0 +1,30 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function(c){c.jqplot.MeterGaugeRenderer=function(){c.jqplot.LineRenderer.call(this)};c.jqplot.MeterGaugeRenderer.prototype=new c.jqplot.LineRenderer();c.jqplot.MeterGaugeRenderer.prototype.constructor=c.jqplot.MeterGaugeRenderer;c.jqplot.MeterGaugeRenderer.prototype.init=function(e){this.diameter=null;this.padding=null;this.shadowOffset=2;this.shadowAlpha=0.07;this.shadowDepth=4;this.background="#efefef";this.ringColor="#BBC6D0";this.needleColor="#C3D3E5";this.tickColor="989898";this.ringWidth=null;this.min;this.max;this.ticks=[];this.showTicks=true;this.showTickLabels=true;this.label=null;this.labelHeightAdjust=0;this.labelPosition="inside";this.intervals=[];this.intervalColors=["#4bb2c5","#EAA228","#c5b47f","#579575","#839557","#958c12","#953579","#4b5de4","#d8b83f","#ff5800","#0085cc","#c747a3","#cddf54","#FBD178","#26B4E3","#bd70c7"];this.intervalInnerRadius=null;this.intervalOuterRadius=null;this.tickRenderer=c.jqplot.MeterGaugeTickRenderer;this.tickPositions=[1,2,2.5,5,10];this.tickSpacing=30;this.numberMinorTicks=null;this.hubRadius=null;this.tickPadding=null;this.needleThickness=null;this.needlePad=6;this.pegNeedle=true;this._type="meterGauge";c.extend(true,this,e);this.type=null;this.numberTicks=null;this.tickInterval=null;this.span=180;if(this.type=="circular"){this.semiCircular=false}else{if(this.type!="circular"){this.semiCircular=true}else{this.semiCircular=(this.span<=180)?true:false}}this._tickPoints=[];this._labelElm=null;this.startAngle=(90+(360-this.span)/2)*Math.PI/180;this.endAngle=(90-(360-this.span)/2)*Math.PI/180;this.setmin=!!(this.min==null);this.setmax=!!(this.max==null);if(this.intervals.length){if(this.intervals[0].length==null||this.intervals.length==1){for(var f=0;f=this.data[0][1]){this.max=this.intervals[this.intervals.length-1][0];this.setmax=false}}else{this.setmax=false}}else{this.min=(this.min==null)?0:this.min;this.setmin=false;if(this.max==null){this.max=this.data[0][1]*1.25;this.setmax=true}else{this.setmax=false}}}};c.jqplot.MeterGaugeRenderer.prototype.setGridData=function(j){var f=[];var k=[];var e=this.startAngle;for(var h=0;h0){f[h]+=f[h-1]}}var g=Math.PI*2/f[f.length-1];for(var h=0;h0){f[h]+=f[h-1]}}var g=Math.PI*2/f[f.length-1];for(var h=0;h=0;h--){e=f/(j[h]*Math.pow(10,g));if(e==4||e==5){return e-1}}return null}c.jqplot.MeterGaugeRenderer.prototype.draw=function(X,aC,ap){var aa;var aM=(ap!=undefined)?ap:{};var ai=0;var ah=0;var at=1;if(ap.legendInfo&&ap.legendInfo.placement=="inside"){var aI=ap.legendInfo;switch(aI.location){case"nw":ai=aI.width+aI.xoffset;break;case"w":ai=aI.width+aI.xoffset;break;case"sw":ai=aI.width+aI.xoffset;break;case"ne":ai=aI.width+aI.xoffset;at=-1;break;case"e":ai=aI.width+aI.xoffset;at=-1;break;case"se":ai=aI.width+aI.xoffset;at=-1;break;case"n":ah=aI.height+aI.yoffset;break;case"s":ah=aI.height+aI.yoffset;at=-1;break;default:break}}if(this.label){this._labelElem=c('
'+this.label+"
");this.canvas._elem.after(this._labelElem)}var m=(aM.shadow!=undefined)?aM.shadow:this.shadow;var N=(aM.showLine!=undefined)?aM.showLine:this.showLine;var I=(aM.fill!=undefined)?aM.fill:this.fill;var K=X.canvas.width;var S=X.canvas.height;if(this.padding==null){this.padding=Math.round(Math.min(K,S)/30)}var Q=K-ai-2*this.padding;var ab=S-ah-2*this.padding;if(this.labelPosition=="bottom"&&this.label){ab-=this._labelElem.outerHeight(true)}var L=Math.min(Q,ab);var ad=L;if(!this.diameter){if(this.semiCircular){if(Q>=2*ab){if(!this.ringWidth){this.ringWidth=2*ab/35}this.needleThickness=this.needleThickness||2+Math.pow(this.ringWidth,0.8);this.innerPad=this.ringWidth/2+this.needleThickness/2+this.needlePad;this.diameter=2*(ab-2*this.innerPad)}else{if(!this.ringWidth){this.ringWidth=Q/35}this.needleThickness=this.needleThickness||2+Math.pow(this.ringWidth,0.8);this.innerPad=this.ringWidth/2+this.needleThickness/2+this.needlePad;this.diameter=Q-2*this.innerPad}this._center=[(K-at*ai)/2+at*ai,(S+at*ah-this.padding-this.ringWidth-this.innerPad)]}else{if(!this.ringWidth){this.ringWidth=ad/35}this.needleThickness=this.needleThickness||2+Math.pow(this.ringWidth,0.8);this.innerPad=0;this.diameter=ad-this.ringWidth;this._center=[(K-at*ai)/2+at*ai,(S-at*ah)/2+at*ah]}}if(this._labelElem&&this.labelPosition=="bottom"){this._center[1]-=this._labelElem.outerHeight(true)}this._radius=this.diameter/2;this.tickSpacing=6000/this.diameter;if(!this.hubRadius){this.hubRadius=this.diameter/18}this.shadowOffset=0.5+this.ringWidth/9;this.shadowWidth=this.ringWidth*1;this.tickPadding=3+Math.pow(this.diameter/20,0.7);this.tickOuterRadius=this._radius-this.ringWidth/2-this.tickPadding;this.tickLength=(this.showTicks)?this._radius/13:0;if(this.ticks.length==0){var A=this.max,aL=this.min,q=this.setmax,aG=this.setmin,au=(A-aL)*this.tickSpacing/this.span;var aw=Math.floor(parseFloat((Math.log(au)/Math.log(10)).toFixed(11)));var an=(au/Math.pow(10,aw));(an>2&&an<=2.5)?an=2.5:an=Math.ceil(an);var T=this.tickPositions;var aA,ak;for(aa=0;aa0)?aL-aL%au:aL-aL%au-au;if(!this.forceZero){var D=Math.min(aL-aP,0.8*au);var o=Math.floor(D/T[aA]);if(o>1){aP=aP+T[aA]*(o-1);if(parseInt(aP,10)!=aP&&parseInt(aP-T[aA],10)==aP-T[aA]){aP=aP-T[aA]}}}if(aL==aP){aL-=au}else{if(aL-aP>0.23*au){aL=aP}else{aL=aP-au;ak+=1}}ak+=1;var E=aL+(ak-1)*au;if(A>=E){E+=au;ak+=1}if(E-A<0.23*au){E+=au;ak+=1}this.max=A=E;this.min=aL;this.tickInterval=au;this.numberTicks=ak;var O;for(aa=0;aa=E){A=E+au;ak+=1}else{A=E}this.tickInterval=this.tickInterval||au;this.numberTicks=this.numberTicks||ak;var O;for(aa=0;aa1){var aJ=String(P);if(aJ.search(/\./)==-1){var aF=aJ.search(/0+$/);av=(aF>0)?aJ.length-aF-1:0}}M=P/Math.pow(10,av);for(aa=0;aa'+this.ticks[aa][1]+"");this.canvas._elem.after(J);aO=J.outerWidth(true);g=J.outerHeight(true);W=this._tickPoints[aa][0]-aO*(this._tickPoints[aa][2]-Math.PI)/Math.PI-an*Math.cos(this._tickPoints[aa][2]);T=this._tickPoints[aa][1]-g/2+g/2*Math.pow(Math.abs((Math.sin(this._tickPoints[aa][2]))),0.5)+an/3*Math.pow(Math.abs((Math.sin(this._tickPoints[aa][2]))),0.5);J.css({left:W,top:T});G=aO*Math.cos(this._tickPoints[aa][2])+g*Math.sin(Math.PI/2+this._tickPoints[aa][2]/2);n=(G>n)?G:n}}if(this.label&&this.labelPosition=="inside"){var W=this._center[0]+this.canvas._offsets.left;var an=this.tickPadding*(1-1/(this.diameter/80+1));var T=0.5*(this._center[1]+this.canvas._offsets.top-this.hubRadius)+0.5*(this._center[1]+this.canvas._offsets.top-this.tickOuterRadius+this.tickLength+an)+this.labelHeightAdjust;W-=this._labelElem.outerWidth(true)/2;T-=this._labelElem.outerHeight(true)/2;this._labelElem.css({left:W,top:T})}else{if(this.label&&this.labelPosition=="bottom"){var W=this._center[0]+this.canvas._offsets.left-this._labelElem.outerWidth(true)/2;var T=this._center[1]+this.canvas._offsets.top+this.innerPad+ +this.ringWidth+this.padding+this.labelHeightAdjust;this._labelElem.css({left:W,top:T})}}X.save();var ax=this.intervalInnerRadius||this.hubRadius*1.5;if(this.intervalOuterRadius==null){if(this.showTickLabels){var ag=(this.tickOuterRadius-this.tickLength-this.tickPadding-this.diameter/8)}else{var ag=(this.tickOuterRadius-this.tickLength-this.diameter/16)}}else{var ag=this.intervalOuterRadius}var P=this.max-this.min;var aD=this.intervals[this.intervals.length-1]-this.min;var y,Z,u=this.span*Math.PI/180;for(aa=0;aathis.max+R*3/this.span){ay=this.max+R*3/this.span}if(this.data[0][1]');var f=false,q=false,u,o;var w=p[0];if(w.show){var t=w.data;if(this.numberRows){u=this.numberRows;if(!this.numberColumns){o=Math.ceil(t.length/u)}else{o=this.numberColumns}}else{if(this.numberColumns){o=this.numberColumns;u=Math.ceil(t.length/this.numberColumns)}else{u=t.length;o=1}}var n,m,r,g,e,l,k,h;var v=0;for(n=0;n').prependTo(this._elem)}else{r=c('').appendTo(this._elem)}for(m=0;m0){f=true}else{f=false}}else{if(n==u-1){f=false}else{f=true}}k=(f)?this.rowSpacing:"0";g=c('
');e=c('');if(this.escapeHtml){e.text(l)}else{e.html(l)}if(q){e.prependTo(r);g.prependTo(r)}else{g.appendTo(r);e.appendTo(r)}f=true}v++}}}}return this._elem};function a(j,h,f){f=f||{};f.axesDefaults=f.axesDefaults||{};f.legend=f.legend||{};f.seriesDefaults=f.seriesDefaults||{};f.grid=f.grid||{};f.gridPadding=f.gridPadding||{};var e=false;if(f.seriesDefaults.renderer==c.jqplot.MeterGaugeRenderer){e=true}else{if(f.series){for(var g=0;g + * + * You will most likely want to use a date axis renderer + * for the x axis also, so include the date axis render js file also: + * + * > + * + * Then you set the renderer in the series options on your plot: + * + * > series: [{renderer:$.jqplot.OHLCRenderer}] + * + * For OHLC and candlestick charts, data should be specified + * like so: + * + * > dat = [['07/06/2009',138.7,139.68,135.18,135.4], ['06/29/2009',143.46,144.66,139.79,140.02], ...] + * + * If the data array has only 4 values per point instead of 5, + * the renderer will create a Hi Low Close chart instead. In that case, + * data should be supplied like: + * + * > dat = [['07/06/2009',139.68,135.18,135.4], ['06/29/2009',144.66,139.79,140.02], ...] + * + * To generate a candlestick chart instead of an OHLC chart, + * set the "candlestick" option to true: + * + * > series: [{renderer:$.jqplot.OHLCRenderer, rendererOptions:{candleStick:true}}], + * + */ + $.jqplot.OHLCRenderer = function(){ + // subclass line renderer to make use of some of it's methods. + $.jqplot.LineRenderer.call(this); + // prop: candleStick + // true to render chart as candleStick. + // Must have an open price, cannot be a hlc chart. + this.candleStick = false; + // prop: tickLength + // length of the line in pixels indicating open and close price. + // Default will auto calculate based on plot width and + // number of points displayed. + this.tickLength = 'auto'; + // prop: bodyWidth + // width of the candlestick body in pixels. Default will auto calculate + // based on plot width and number of candlesticks displayed. + this.bodyWidth = 'auto'; + // prop: openColor + // color of the open price tick mark. Default is series color. + this.openColor = null; + // prop: closeColor + // color of the close price tick mark. Default is series color. + this.closeColor = null; + // prop: wickColor + // color of the hi-lo line thorugh the candlestick body. + // Default is the series color. + this.wickColor = null; + // prop: fillUpBody + // true to render an "up" day (close price greater than open price) + // with a filled candlestick body. + this.fillUpBody = false; + // prop: fillDownBody + // true to render a "down" day (close price lower than open price) + // with a filled candlestick body. + this.fillDownBody = true; + // prop: upBodyColor + // Color of candlestick body of an "up" day. Default is series color. + this.upBodyColor = null; + // prop: downBodyColor + // Color of candlestick body on a "down" day. Default is series color. + this.downBodyColor = null; + // prop: hlc + // true if is a hi-low-close chart (no open price). + // This is determined automatically from the series data. + this.hlc = false; + // prop: lineWidth + // Width of the hi-low line and open/close ticks. + // Must be set in the rendererOptions for the series. + this.lineWidth = 1.5; + this._tickLength; + this._bodyWidth; + }; + + $.jqplot.OHLCRenderer.prototype = new $.jqplot.LineRenderer(); + $.jqplot.OHLCRenderer.prototype.constructor = $.jqplot.OHLCRenderer; + + // called with scope of series. + $.jqplot.OHLCRenderer.prototype.init = function(options) { + options = options || {}; + // lineWidth has to be set on the series, changes in renderer + // constructor have no effect. set the default here + // if no renderer option for lineWidth is specified. + this.lineWidth = options.lineWidth || 1.5; + $.jqplot.LineRenderer.prototype.init.call(this, options); + this._type = 'ohlc'; + // set the yaxis data bounds here to account for hi and low values + var db = this._yaxis._dataBounds; + var d = this._plotData; + // if data points have less than 5 values, force a hlc chart. + if (d[0].length < 5) { + this.renderer.hlc = true; + + for (var j=0; j db.max || db.max == null) { + db.max = d[j][1]; + } + } + } + else { + for (var j=0; j db.max || db.max == null) { + db.max = d[j][2]; + } + } + } + + }; + + // called within scope of series. + $.jqplot.OHLCRenderer.prototype.draw = function(ctx, gd, options) { + var d = this.data; + var xmin = this._xaxis.min; + var xmax = this._xaxis.max; + // index of last value below range of plot. + var xminidx = 0; + // index of first value above range of plot. + var xmaxidx = d.length; + var xp = this._xaxis.series_u2p; + var yp = this._yaxis.series_u2p; + var i, prevColor, ops, b, h, w, a, points; + var o; + var r = this.renderer; + var opts = (options != undefined) ? options : {}; + var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow; + var fill = (opts.fill != undefined) ? opts.fill : this.fill; + var fillAndStroke = (opts.fillAndStroke != undefined) ? opts.fillAndStroke : this.fillAndStroke; + r.bodyWidth = (opts.bodyWidth != undefined) ? opts.bodyWidth : r.bodyWidth; + r.tickLength = (opts.tickLength != undefined) ? opts.tickLength : r.tickLength; + ctx.save(); + if (this.show) { + var x, open, hi, low, close; + // need to get widths based on number of points shown, + // not on total number of points. Use the results + // to speed up drawing in next step. + for (var i=0; i open) { + // draw wick + if (r.wickColor) { + o.color = r.wickColor; + } + else if (r.downBodyColor) { + o.color = r.downBodyColor; + } + ops = $.extend(true, {}, opts, o); + r.shapeRenderer.draw(ctx, [[x, hi], [x, open]], ops); + r.shapeRenderer.draw(ctx, [[x, close], [x, low]], ops); + + o = {}; + + b = open; + h = close - open; + // if color specified, use it + if (r.fillDownBody) { + o.fillRect = true; + } + else { + o.strokeRect = true; + w = w - this.lineWidth; + a = x - w/2; + } + if (r.downBodyColor) { + o.color = r.downBodyColor; + o.fillStyle = r.downBodyColor; + } + points = [a, b, w, h]; + } + // even, open = close + else { + // draw wick + if (r.wickColor) { + o.color = r.wickColor; + } + ops = $.extend(true, {}, opts, o); + r.shapeRenderer.draw(ctx, [[x, hi], [x, low]], ops); + o = {}; + o.fillRect = false; + o.strokeRect = false; + a = [x - w/2, open]; + b = [x + w/2, close]; + w = null; + h = null; + points = [a, b]; + } + ops = $.extend(true, {}, opts, o); + r.shapeRenderer.draw(ctx, points, ops); + } + else { + prevColor = opts.color; + if (r.openColor) { + opts.color = r.openColor; + } + // draw open tick + if (!r.hlc) { + r.shapeRenderer.draw(ctx, [[x-r._tickLength, open], [x, open]], opts); + } + opts.color = prevColor; + // draw wick + if (r.wickColor) { + opts.color = r.wickColor; + } + r.shapeRenderer.draw(ctx, [[x, hi], [x, low]], opts); + opts.color = prevColor; + // draw close tick + if (r.closeColor) { + opts.color = r.closeColor; + } + r.shapeRenderer.draw(ctx, [[x, close], [x+r._tickLength, close]], opts); + opts.color = prevColor; + } + } + } + + ctx.restore(); + }; + + $.jqplot.OHLCRenderer.prototype.drawShadow = function(ctx, gd, options) { + // This is a no-op, shadows drawn with lines. + }; + + // called with scope of plot. + $.jqplot.OHLCRenderer.checkOptions = function(target, data, options) { + // provide some sensible highlighter options by default + // These aren't good for hlc, only for ohlc or candlestick + if (!options.highlighter) { + options.highlighter = { + showMarker:false, + tooltipAxes: 'y', + yvalues: 4, + formatString:'
date:%s
open:%s
hi:%s
low:%s
close:%s
' + }; + } + }; + + //$.jqplot.preInitHooks.push($.jqplot.OHLCRenderer.checkOptions); + +})(jQuery); \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.ohlcRenderer.min.js b/templates/Froxlor/assets/js/plugins/jqplot.ohlcRenderer.min.js new file mode 100644 index 00000000..97a265a3 --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.ohlcRenderer.min.js @@ -0,0 +1,30 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function(a){a.jqplot.OHLCRenderer=function(){a.jqplot.LineRenderer.call(this);this.candleStick=false;this.tickLength="auto";this.bodyWidth="auto";this.openColor=null;this.closeColor=null;this.wickColor=null;this.fillUpBody=false;this.fillDownBody=true;this.upBodyColor=null;this.downBodyColor=null;this.hlc=false;this.lineWidth=1.5;this._tickLength;this._bodyWidth};a.jqplot.OHLCRenderer.prototype=new a.jqplot.LineRenderer();a.jqplot.OHLCRenderer.prototype.constructor=a.jqplot.OHLCRenderer;a.jqplot.OHLCRenderer.prototype.init=function(e){e=e||{};this.lineWidth=e.lineWidth||1.5;a.jqplot.LineRenderer.prototype.init.call(this,e);this._type="ohlc";var b=this._yaxis._dataBounds;var f=this._plotData;if(f[0].length<5){this.renderer.hlc=true;for(var c=0;cb.max||b.max==null){b.max=f[c][1]}}}else{for(var c=0;cb.max||b.max==null){b.max=f[c][2]}}}};a.jqplot.OHLCRenderer.prototype.draw=function(A,N,j){var J=this.data;var v=this._xaxis.min;var z=this._xaxis.max;var l=0;var K=J.length;var p=this._xaxis.series_u2p;var G=this._yaxis.series_u2p;var D,E,f,M,F,n,O,C;var y;var u=this.renderer;var s=(j!=undefined)?j:{};var k=(s.shadow!=undefined)?s.shadow:this.shadow;var B=(s.fill!=undefined)?s.fill:this.fill;var c=(s.fillAndStroke!=undefined)?s.fillAndStroke:this.fillAndStroke;u.bodyWidth=(s.bodyWidth!=undefined)?s.bodyWidth:u.bodyWidth;u.tickLength=(s.tickLength!=undefined)?s.tickLength:u.tickLength;A.save();if(this.show){var m,q,g,Q,t;for(var D=0;Dq){if(u.wickColor){y.color=u.wickColor}else{if(u.downBodyColor){y.color=u.downBodyColor}}f=a.extend(true,{},s,y);u.shapeRenderer.draw(A,[[m,g],[m,q]],f);u.shapeRenderer.draw(A,[[m,t],[m,Q]],f);y={};M=q;F=t-q;if(u.fillDownBody){y.fillRect=true}else{y.strokeRect=true;n=n-this.lineWidth;O=m-n/2}if(u.downBodyColor){y.color=u.downBodyColor;y.fillStyle=u.downBodyColor}C=[O,M,n,F]}else{if(u.wickColor){y.color=u.wickColor}f=a.extend(true,{},s,y);u.shapeRenderer.draw(A,[[m,g],[m,Q]],f);y={};y.fillRect=false;y.strokeRect=false;O=[m-n/2,q];M=[m+n/2,t];n=null;F=null;C=[O,M]}}f=a.extend(true,{},s,y);u.shapeRenderer.draw(A,C,f)}else{E=s.color;if(u.openColor){s.color=u.openColor}if(!u.hlc){u.shapeRenderer.draw(A,[[m-u._tickLength,q],[m,q]],s)}s.color=E;if(u.wickColor){s.color=u.wickColor}u.shapeRenderer.draw(A,[[m,g],[m,Q]],s);s.color=E;if(u.closeColor){s.color=u.closeColor}u.shapeRenderer.draw(A,[[m,t],[m+u._tickLength,t]],s);s.color=E}}}A.restore()};a.jqplot.OHLCRenderer.prototype.drawShadow=function(b,d,c){};a.jqplot.OHLCRenderer.checkOptions=function(d,c,b){if(!b.highlighter){b.highlighter={showMarker:false,tooltipAxes:"y",yvalues:4,formatString:'
date:%s
open:%s
hi:%s
low:%s
close:%s
'}}}})(jQuery); \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.pieRenderer.js b/templates/Froxlor/assets/js/plugins/jqplot.pieRenderer.js new file mode 100644 index 00000000..4aa7340a --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.pieRenderer.js @@ -0,0 +1,898 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + /** + * Class: $.jqplot.PieRenderer + * Plugin renderer to draw a pie chart. + * x values, if present, will be used as slice labels. + * y values give slice size. + * + * To use this renderer, you need to include the + * pie renderer plugin, for example: + * + * > + * + * Properties described here are passed into the $.jqplot function + * as options on the series renderer. For example: + * + * > plot2 = $.jqplot('chart2', [s1, s2], { + * > seriesDefaults: { + * > renderer:$.jqplot.PieRenderer, + * > rendererOptions:{ + * > sliceMargin: 2, + * > startAngle: -90 + * > } + * > } + * > }); + * + * A pie plot will trigger events on the plot target + * according to user interaction. All events return the event object, + * the series index, the point (slice) index, and the point data for + * the appropriate slice. + * + * 'jqplotDataMouseOver' - triggered when user mouseing over a slice. + * 'jqplotDataHighlight' - triggered the first time user mouses over a slice, + * if highlighting is enabled. + * 'jqplotDataUnhighlight' - triggered when a user moves the mouse out of + * a highlighted slice. + * 'jqplotDataClick' - triggered when the user clicks on a slice. + * 'jqplotDataRightClick' - tiggered when the user right clicks on a slice if + * the "captureRightClick" option is set to true on the plot. + */ + $.jqplot.PieRenderer = function(){ + $.jqplot.LineRenderer.call(this); + }; + + $.jqplot.PieRenderer.prototype = new $.jqplot.LineRenderer(); + $.jqplot.PieRenderer.prototype.constructor = $.jqplot.PieRenderer; + + // called with scope of a series + $.jqplot.PieRenderer.prototype.init = function(options, plot) { + // Group: Properties + // + // prop: diameter + // Outer diameter of the pie, auto computed by default + this.diameter = null; + // prop: padding + // padding between the pie and plot edges, legend, etc. + this.padding = 20; + // prop: sliceMargin + // angular spacing between pie slices in degrees. + this.sliceMargin = 0; + // prop: fill + // true or false, wether to fil the slices. + this.fill = true; + // prop: shadowOffset + // offset of the shadow from the slice and offset of + // each succesive stroke of the shadow from the last. + this.shadowOffset = 2; + // prop: shadowAlpha + // transparency of the shadow (0 = transparent, 1 = opaque) + this.shadowAlpha = 0.07; + // prop: shadowDepth + // number of strokes to apply to the shadow, + // each stroke offset shadowOffset from the last. + this.shadowDepth = 5; + // prop: highlightMouseOver + // True to highlight slice when moused over. + // This must be false to enable highlightMouseDown to highlight when clicking on a slice. + this.highlightMouseOver = true; + // prop: highlightMouseDown + // True to highlight when a mouse button is pressed over a slice. + // This will be disabled if highlightMouseOver is true. + this.highlightMouseDown = false; + // prop: highlightColors + // an array of colors to use when highlighting a slice. + this.highlightColors = []; + // prop: dataLabels + // Either 'label', 'value', 'percent' or an array of labels to place on the pie slices. + // Defaults to percentage of each pie slice. + this.dataLabels = 'percent'; + // prop: showDataLabels + // true to show data labels on slices. + this.showDataLabels = false; + // prop: dataLabelFormatString + // Format string for data labels. If none, '%s' is used for "label" and for arrays, '%d' for value and '%d%%' for percentage. + this.dataLabelFormatString = null; + // prop: dataLabelThreshold + // Threshhold in percentage (0-100) of pie area, below which no label will be displayed. + // This applies to all label types, not just to percentage labels. + this.dataLabelThreshold = 3; + // prop: dataLabelPositionFactor + // A Multiplier (0-1) of the pie radius which controls position of label on slice. + // Increasing will slide label toward edge of pie, decreasing will slide label toward center of pie. + this.dataLabelPositionFactor = 0.52; + // prop: dataLabelNudge + // Number of pixels to slide the label away from (+) or toward (-) the center of the pie. + this.dataLabelNudge = 2; + // prop: dataLabelCenterOn + // True to center the data label at its position. + // False to set the inside facing edge of the label at its position. + this.dataLabelCenterOn = true; + // prop: startAngle + // Angle to start drawing pie in degrees. + // According to orientation of canvas coordinate system: + // 0 = on the positive x axis + // -90 = on the positive y axis. + // 90 = on the negaive y axis. + // 180 or - 180 = on the negative x axis. + this.startAngle = 0; + this.tickRenderer = $.jqplot.PieTickRenderer; + // Used as check for conditions where pie shouldn't be drawn. + this._drawData = true; + this._type = 'pie'; + + // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver + if (options.highlightMouseDown && options.highlightMouseOver == null) { + options.highlightMouseOver = false; + } + + $.extend(true, this, options); + + if (this.sliceMargin < 0) { + this.sliceMargin = 0; + } + + this._diameter = null; + this._radius = null; + // array of [start,end] angles arrays, one for each slice. In radians. + this._sliceAngles = []; + // index of the currenty highlighted point, if any + this._highlightedPoint = null; + + // set highlight colors if none provided + if (this.highlightColors.length == 0) { + for (var i=0; i 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]); + newrgb[j] = parseInt(newrgb[j], 10); + } + this.highlightColors.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')'); + } + } + + this.highlightColorGenerator = new $.jqplot.ColorGenerator(this.highlightColors); + + plot.postParseOptionsHooks.addOnce(postParseOptions); + plot.postInitHooks.addOnce(postInit); + plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove); + plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown); + plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp); + plot.eventListenerHooks.addOnce('jqplotClick', handleClick); + plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick); + plot.postDrawHooks.addOnce(postPlotDraw); + }; + + $.jqplot.PieRenderer.prototype.setGridData = function(plot) { + // set gridData property. This will hold angle in radians of each data point. + var stack = []; + var td = []; + var sa = this.startAngle/180*Math.PI; + var tot = 0; + // don't know if we have any valid data yet, so set plot to not draw. + this._drawData = false; + for (var i=0; i0) { + stack[i] += stack[i-1]; + } + tot += this.data[i][1]; + } + var fact = Math.PI*2/stack[stack.length - 1]; + + for (var i=0; i0) { + stack[i] += stack[i-1]; + } + tot += data[i][1]; + } + var fact = Math.PI*2/stack[stack.length - 1]; + + for (var i=0; i 0 && absang > 0.01 && absang < 6.282) { + rprime = parseFloat(sm) / 2.0 / calcRadiusAdjustment(ang); + } + + return rprime; + } + + $.jqplot.PieRenderer.prototype.drawSlice = function (ctx, ang1, ang2, color, isShadow) { + if (this._drawData) { + var r = this._radius; + var fill = this.fill; + var lineWidth = this.lineWidth; + var sm = this.sliceMargin; + if (this.fill == false) { + sm += this.lineWidth; + } + ctx.save(); + ctx.translate(this._center[0], this._center[1]); + + var rprime = calcRPrime(ang1, ang2, this.sliceMargin, this.fill, this.lineWidth); + + var transx = rprime * Math.cos((ang1 + ang2) / 2.0); + var transy = rprime * Math.sin((ang1 + ang2) / 2.0); + + if ((ang2 - ang1) <= Math.PI) { + r -= rprime; + } + else { + r += rprime; + } + + ctx.translate(transx, transy); + + if (isShadow) { + for (var i=0, l=this.shadowDepth; i 6.282 + this.startAngle) { + ang2 = 6.282 + this.startAngle; + if (ang1 > ang2) { + ang1 = 6.281 + this.startAngle; + } + } + // Fix for IE, where it can't seem to handle 0 degree angles. Also avoids + // ugly line on unfilled pies. + if (ang1 >= ang2) { + return; + } + + ctx.beginPath(); + ctx.fillStyle = color; + ctx.strokeStyle = color; + ctx.lineWidth = lineWidth; + ctx.arc(0, 0, rad, ang1, ang2, false); + ctx.lineTo(0,0); + ctx.closePath(); + + if (fill) { + ctx.fill(); + } + else { + ctx.stroke(); + } + } + }; + + // called with scope of series + $.jqplot.PieRenderer.prototype.draw = function (ctx, gd, options, plot) { + var i; + var opts = (options != undefined) ? options : {}; + // offset and direction of offset due to legend placement + var offx = 0; + var offy = 0; + var trans = 1; + var colorGenerator = new $.jqplot.ColorGenerator(this.seriesColors); + if (options.legendInfo && options.legendInfo.placement == 'insideGrid') { + var li = options.legendInfo; + switch (li.location) { + case 'nw': + offx = li.width + li.xoffset; + break; + case 'w': + offx = li.width + li.xoffset; + break; + case 'sw': + offx = li.width + li.xoffset; + break; + case 'ne': + offx = li.width + li.xoffset; + trans = -1; + break; + case 'e': + offx = li.width + li.xoffset; + trans = -1; + break; + case 'se': + offx = li.width + li.xoffset; + trans = -1; + break; + case 'n': + offy = li.height + li.yoffset; + break; + case 's': + offy = li.height + li.yoffset; + trans = -1; + break; + default: + break; + } + } + + var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow; + var fill = (opts.fill != undefined) ? opts.fill : this.fill; + var cw = ctx.canvas.width; + var ch = ctx.canvas.height; + var w = cw - offx - 2 * this.padding; + var h = ch - offy - 2 * this.padding; + var mindim = Math.min(w,h); + var d = mindim; + + // Fixes issue #272. Thanks hugwijst! + // reset slice angles array. + this._sliceAngles = []; + + var sm = this.sliceMargin; + if (this.fill == false) { + sm += this.lineWidth; + } + + var rprime; + var maxrprime = 0; + + var ang, ang1, ang2, shadowColor; + var sa = this.startAngle / 180 * Math.PI; + + // have to pre-draw shadows, so loop throgh here and calculate some values also. + for (var i=0, l=gd.length; i Math.PI) { + maxrprime = Math.max(rprime, maxrprime); + } + } + + if (this.diameter != null && this.diameter > 0) { + this._diameter = this.diameter - 2*maxrprime; + } + else { + this._diameter = d - 2*maxrprime; + } + + // Need to check for undersized pie. This can happen if + // plot area too small and legend is too big. + if (this._diameter < 6) { + $.jqplot.log('Diameter of pie too small, not rendering.'); + return; + } + + var r = this._radius = this._diameter/2; + + this._center = [(cw - trans * offx)/2 + trans * offx + maxrprime * Math.cos(sa), (ch - trans*offy)/2 + trans * offy + maxrprime * Math.sin(sa)]; + + if (this.shadow) { + for (var i=0, l=gd.length; i= this.dataLabelThreshold) { + var fstr, avgang = (this._sliceAngles[i][0] + this._sliceAngles[i][1])/2, label; + + if (this.dataLabels == 'label') { + fstr = this.dataLabelFormatString || '%s'; + label = $.jqplot.sprintf(fstr, gd[i][0]); + } + else if (this.dataLabels == 'value') { + fstr = this.dataLabelFormatString || '%d'; + label = $.jqplot.sprintf(fstr, this.data[i][1]); + } + else if (this.dataLabels == 'percent') { + fstr = this.dataLabelFormatString || '%d%%'; + label = $.jqplot.sprintf(fstr, gd[i][2]*100); + } + else if (this.dataLabels.constructor == Array) { + fstr = this.dataLabelFormatString || '%s'; + label = $.jqplot.sprintf(fstr, this.dataLabels[i]); + } + + var fact = (this._radius ) * this.dataLabelPositionFactor + this.sliceMargin + this.dataLabelNudge; + + var x = this._center[0] + Math.cos(avgang) * fact + this.canvas._offsets.left; + var y = this._center[1] + Math.sin(avgang) * fact + this.canvas._offsets.top; + + var labelelem = $('
' + label + '
').insertBefore(plot.eventCanvas._elem); + if (this.dataLabelCenterOn) { + x -= labelelem.width()/2; + y -= labelelem.height()/2; + } + else { + x -= labelelem.width() * Math.sin(avgang/2); + y -= labelelem.height()/2; + } + x = Math.round(x); + y = Math.round(y); + labelelem.css({left: x, top: y}); + } + } + }; + + $.jqplot.PieAxisRenderer = function() { + $.jqplot.LinearAxisRenderer.call(this); + }; + + $.jqplot.PieAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer(); + $.jqplot.PieAxisRenderer.prototype.constructor = $.jqplot.PieAxisRenderer; + + + // There are no traditional axes on a pie chart. We just need to provide + // dummy objects with properties so the plot will render. + // called with scope of axis object. + $.jqplot.PieAxisRenderer.prototype.init = function(options){ + // + this.tickRenderer = $.jqplot.PieTickRenderer; + $.extend(true, this, options); + // I don't think I'm going to need _dataBounds here. + // have to go Axis scaling in a way to fit chart onto plot area + // and provide u2p and p2u functionality for mouse cursor, etc. + // for convienence set _dataBounds to 0 and 100 and + // set min/max to 0 and 100. + this._dataBounds = {min:0, max:100}; + this.min = 0; + this.max = 100; + this.showTicks = false; + this.ticks = []; + this.showMark = false; + this.show = false; + }; + + + + + $.jqplot.PieLegendRenderer = function(){ + $.jqplot.TableLegendRenderer.call(this); + }; + + $.jqplot.PieLegendRenderer.prototype = new $.jqplot.TableLegendRenderer(); + $.jqplot.PieLegendRenderer.prototype.constructor = $.jqplot.PieLegendRenderer; + + /** + * Class: $.jqplot.PieLegendRenderer + * Legend Renderer specific to pie plots. Set by default + * when user creates a pie plot. + */ + $.jqplot.PieLegendRenderer.prototype.init = function(options) { + // Group: Properties + // + // prop: numberRows + // Maximum number of rows in the legend. 0 or null for unlimited. + this.numberRows = null; + // prop: numberColumns + // Maximum number of columns in the legend. 0 or null for unlimited. + this.numberColumns = null; + $.extend(true, this, options); + }; + + // called with context of legend + $.jqplot.PieLegendRenderer.prototype.draw = function() { + var legend = this; + if (this.show) { + var series = this._series; + + + this._elem = $(document.createElement('table')); + this._elem.addClass('jqplot-table-legend'); + + var ss = {position:'absolute'}; + if (this.background) { + ss['background'] = this.background; + } + if (this.border) { + ss['border'] = this.border; + } + if (this.fontSize) { + ss['fontSize'] = this.fontSize; + } + if (this.fontFamily) { + ss['fontFamily'] = this.fontFamily; + } + if (this.textColor) { + ss['textColor'] = this.textColor; + } + if (this.marginTop != null) { + ss['marginTop'] = this.marginTop; + } + if (this.marginBottom != null) { + ss['marginBottom'] = this.marginBottom; + } + if (this.marginLeft != null) { + ss['marginLeft'] = this.marginLeft; + } + if (this.marginRight != null) { + ss['marginRight'] = this.marginRight; + } + + this._elem.css(ss); + + // Pie charts legends don't go by number of series, but by number of data points + // in the series. Refactor things here for that. + + var pad = false, + reverse = false, + nr, + nc; + var s = series[0]; + var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors); + + if (s.show) { + var pd = s.data; + if (this.numberRows) { + nr = this.numberRows; + if (!this.numberColumns){ + nc = Math.ceil(pd.length/nr); + } + else{ + nc = this.numberColumns; + } + } + else if (this.numberColumns) { + nc = this.numberColumns; + nr = Math.ceil(pd.length/this.numberColumns); + } + else { + nr = pd.length; + nc = 1; + } + + var i, j; + var tr, td1, td2; + var lt, rs, color; + var idx = 0; + var div0, div1; + + for (i=0; i0){ + pad = true; + } + else{ + pad = false; + } + } + else{ + if (i == nr -1){ + pad = false; + } + else{ + pad = true; + } + } + rs = (pad) ? this.rowSpacing : '0'; + + + + td1 = $(document.createElement('td')); + td1.addClass('jqplot-table-legend'); + td1.css({textAlign: 'center', paddingTop: rs}); + + div0 = $(document.createElement('div')); + div1 = $(document.createElement('div')); + div1.addClass('jqplot-table-legend-swatch'); + div1.css({backgroundColor: color, borderColor: color}); + td1.append(div0.append(div1)); + + td2 = $(document.createElement('td')); + td2.addClass('jqplot-table-legend'); + td2.css('paddingTop', rs); + + if (this.escapeHtml){ + td2.text(lt); + } + else { + td2.html(lt); + } + if (reverse) { + td2.prependTo(tr); + td1.prependTo(tr); + } + else { + td1.appendTo(tr); + td2.appendTo(tr); + } + pad = true; + } + idx++; + } + } + } + } + return this._elem; + }; + + $.jqplot.PieRenderer.prototype.handleMove = function(ev, gridpos, datapos, neighbor, plot) { + if (neighbor) { + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data]; + plot.target.trigger('jqplotDataMouseOver', ins); + if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.pieRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) { + plot.target.trigger('jqplotDataHighlight', ins); + highlight (plot, ins[0], ins[1]); + } + } + else if (neighbor == null) { + unhighlight (plot); + } + }; + + + // this.eventCanvas._elem.bind($.jqplot.eventListenerHooks[i][0], {plot:this}, $.jqplot.eventListenerHooks[i][1]); + + // setup default renderers for axes and legend so user doesn't have to + // called with scope of plot + function preInit(target, data, options) { + options = options || {}; + options.axesDefaults = options.axesDefaults || {}; + options.legend = options.legend || {}; + options.seriesDefaults = options.seriesDefaults || {}; + // only set these if there is a pie series + var setopts = false; + if (options.seriesDefaults.renderer == $.jqplot.PieRenderer) { + setopts = true; + } + else if (options.series) { + for (var i=0; i < options.series.length; i++) { + if (options.series[i].renderer == $.jqplot.PieRenderer) { + setopts = true; + } + } + } + + if (setopts) { + options.axesDefaults.renderer = $.jqplot.PieAxisRenderer; + options.legend.renderer = $.jqplot.PieLegendRenderer; + options.legend.preDraw = true; + options.seriesDefaults.pointLabels = {show: false}; + } + } + + function postInit(target, data, options) { + for (var i=0; i570)?o[p]*0.8:o[p]+0.3*(255-o[p]);o[p]=parseInt(o[p],10)}this.highlightColors.push("rgb("+o[0]+","+o[1]+","+o[2]+")")}}this.highlightColorGenerator=new e.jqplot.ColorGenerator(this.highlightColors);u.postParseOptionsHooks.addOnce(m);u.postInitHooks.addOnce(g);u.eventListenerHooks.addOnce("jqplotMouseMove",b);u.eventListenerHooks.addOnce("jqplotMouseDown",a);u.eventListenerHooks.addOnce("jqplotMouseUp",l);u.eventListenerHooks.addOnce("jqplotClick",f);u.eventListenerHooks.addOnce("jqplotRightClick",n);u.postDrawHooks.addOnce(i)};e.jqplot.PieRenderer.prototype.setGridData=function(t){var p=[];var u=[];var o=this.startAngle/180*Math.PI;var s=0;this._drawData=false;for(var r=0;r0){p[r]+=p[r-1]}s+=this.data[r][1]}var q=Math.PI*2/p[p.length-1];for(var r=0;r0){p[r]+=p[r-1]}s+=t[r][1]}var q=Math.PI*2/p[p.length-1];for(var r=0;r0&&s>0.01&&s<6.282){w=parseFloat(p)/2/h(q)}return w}e.jqplot.PieRenderer.prototype.drawSlice=function(B,z,y,u,w){if(this._drawData){var p=this._radius;var A=this.fill;var x=this.lineWidth;var s=this.sliceMargin;if(this.fill==false){s+=this.lineWidth}B.save();B.translate(this._center[0],this._center[1]);var D=j(z,y,this.sliceMargin,this.fill,this.lineWidth);var o=D*Math.cos((z+y)/2);var C=D*Math.sin((z+y)/2);if((y-z)<=Math.PI){p-=D}else{p+=D}B.translate(o,C);if(w){for(var v=0,t=this.shadowDepth;v6.282+this.startAngle){y=6.282+this.startAngle;if(z>y){z=6.281+this.startAngle}}if(z>=y){return}B.beginPath();B.fillStyle=u;B.strokeStyle=u;B.lineWidth=x;B.arc(0,0,r,z,y,false);B.lineTo(0,0);B.closePath();if(A){B.fill()}else{B.stroke()}}};e.jqplot.PieRenderer.prototype.draw=function(B,z,E,o){var W;var H=(E!=undefined)?E:{};var t=0;var s=0;var N=1;var L=new e.jqplot.ColorGenerator(this.seriesColors);if(E.legendInfo&&E.legendInfo.placement=="insideGrid"){var J=E.legendInfo;switch(J.location){case"nw":t=J.width+J.xoffset;break;case"w":t=J.width+J.xoffset;break;case"sw":t=J.width+J.xoffset;break;case"ne":t=J.width+J.xoffset;N=-1;break;case"e":t=J.width+J.xoffset;N=-1;break;case"se":t=J.width+J.xoffset;N=-1;break;case"n":s=J.height+J.yoffset;break;case"s":s=J.height+J.yoffset;N=-1;break;default:break}}var K=(H.shadow!=undefined)?H.shadow:this.shadow;var A=(H.fill!=undefined)?H.fill:this.fill;var C=B.canvas.width;var I=B.canvas.height;var Q=C-t-2*this.padding;var X=I-s-2*this.padding;var M=Math.min(Q,X);var Y=M;this._sliceAngles=[];var v=this.sliceMargin;if(this.fill==false){v+=this.lineWidth}var q;var G=0;var R,aa,Z,ab;var D=this.startAngle/180*Math.PI;for(var W=0,V=z.length;WMath.PI){G=Math.max(q,G)}}if(this.diameter!=null&&this.diameter>0){this._diameter=this.diameter-2*G}else{this._diameter=Y-2*G}if(this._diameter<6){e.jqplot.log("Diameter of pie too small, not rendering.");return}var S=this._radius=this._diameter/2;this._center=[(C-N*t)/2+N*t+G*Math.cos(D),(I-N*s)/2+N*s+G*Math.sin(D)];if(this.shadow){for(var W=0,V=z.length;W=this.dataLabelThreshold){var F,U=(this._sliceAngles[W][0]+this._sliceAngles[W][1])/2,T;if(this.dataLabels=="label"){F=this.dataLabelFormatString||"%s";T=e.jqplot.sprintf(F,z[W][0])}else{if(this.dataLabels=="value"){F=this.dataLabelFormatString||"%d";T=e.jqplot.sprintf(F,this.data[W][1])}else{if(this.dataLabels=="percent"){F=this.dataLabelFormatString||"%d%%";T=e.jqplot.sprintf(F,z[W][2]*100)}else{if(this.dataLabels.constructor==Array){F=this.dataLabelFormatString||"%s";T=e.jqplot.sprintf(F,this.dataLabels[W])}}}}var p=(this._radius)*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge;var P=this._center[0]+Math.cos(U)*p+this.canvas._offsets.left;var O=this._center[1]+Math.sin(U)*p+this.canvas._offsets.top;var u=e('
'+T+"
").insertBefore(o.eventCanvas._elem);if(this.dataLabelCenterOn){P-=u.width()/2;O-=u.height()/2}else{P-=u.width()*Math.sin(U/2);O-=u.height()/2}P=Math.round(P);O=Math.round(O);u.css({left:P,top:O})}}};e.jqplot.PieAxisRenderer=function(){e.jqplot.LinearAxisRenderer.call(this)};e.jqplot.PieAxisRenderer.prototype=new e.jqplot.LinearAxisRenderer();e.jqplot.PieAxisRenderer.prototype.constructor=e.jqplot.PieAxisRenderer;e.jqplot.PieAxisRenderer.prototype.init=function(o){this.tickRenderer=e.jqplot.PieTickRenderer;e.extend(true,this,o);this._dataBounds={min:0,max:100};this.min=0;this.max=100;this.showTicks=false;this.ticks=[];this.showMark=false;this.show=false};e.jqplot.PieLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)};e.jqplot.PieLegendRenderer.prototype=new e.jqplot.TableLegendRenderer();e.jqplot.PieLegendRenderer.prototype.constructor=e.jqplot.PieLegendRenderer;e.jqplot.PieLegendRenderer.prototype.init=function(o){this.numberRows=null;this.numberColumns=null;e.extend(true,this,o)};e.jqplot.PieLegendRenderer.prototype.draw=function(){var r=this;if(this.show){var B=this._series;this._elem=e(document.createElement("table"));this._elem.addClass("jqplot-table-legend");var E={position:"absolute"};if(this.background){E.background=this.background}if(this.border){E.border=this.border}if(this.fontSize){E.fontSize=this.fontSize}if(this.fontFamily){E.fontFamily=this.fontFamily}if(this.textColor){E.textColor=this.textColor}if(this.marginTop!=null){E.marginTop=this.marginTop}if(this.marginBottom!=null){E.marginBottom=this.marginBottom}if(this.marginLeft!=null){E.marginLeft=this.marginLeft}if(this.marginRight!=null){E.marginRight=this.marginRight}this._elem.css(E);var I=false,A=false,o,y;var C=B[0];var p=new e.jqplot.ColorGenerator(C.seriesColors);if(C.show){var J=C.data;if(this.numberRows){o=this.numberRows;if(!this.numberColumns){y=Math.ceil(J.length/o)}else{y=this.numberColumns}}else{if(this.numberColumns){y=this.numberColumns;o=Math.ceil(J.length/this.numberColumns)}else{o=J.length;y=1}}var H,G;var q,w,v;var x,z,F;var D=0;var u,t;for(H=0;H0){I=true}else{I=false}}else{if(H==o-1){I=false}else{I=true}}z=(I)?this.rowSpacing:"0";w=e(document.createElement("td"));w.addClass("jqplot-table-legend");w.css({textAlign:"center",paddingTop:z});u=e(document.createElement("div"));t=e(document.createElement("div"));t.addClass("jqplot-table-legend-swatch");t.css({backgroundColor:F,borderColor:F});w.append(u.append(t));v=e(document.createElement("td"));v.addClass("jqplot-table-legend");v.css("paddingTop",z);if(this.escapeHtml){v.text(x)}else{v.html(x)}if(A){v.prependTo(q);w.prependTo(q)}else{w.appendTo(q);v.appendTo(q)}I=true}D++}}}}return this._elem};e.jqplot.PieRenderer.prototype.handleMove=function(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];r.target.trigger("jqplotDataMouseOver",o);if(r.series[o[0]].highlightMouseOver&&!(o[0]==r.plugins.pieRenderer.highlightedSeriesIndex&&o[1]==r.series[o[0]]._highlightedPoint)){r.target.trigger("jqplotDataHighlight",o);d(r,o[0],o[1])}}else{if(s==null){k(r)}}};function c(s,r,p){p=p||{};p.axesDefaults=p.axesDefaults||{};p.legend=p.legend||{};p.seriesDefaults=p.seriesDefaults||{};var o=false;if(p.seriesDefaults.renderer==e.jqplot.PieRenderer){o=true}else{if(p.series){for(var q=0;q + * + * By default, the last value in the data ponit array in the data series is used + * for the label. For most series renderers, extra data can be added to the + * data point arrays and the last value will be used as the label. + * + * For instance, + * this series: + * + * > [[1,4], [3,5], [7,2]] + * + * Would, by default, use the y values in the labels. + * Extra data can be added to the series like so: + * + * > [[1,4,'mid'], [3 5,'hi'], [7,2,'low']] + * + * And now the point labels would be 'mid', 'low', and 'hi'. + * + * Options to the point labels and a custom labels array can be passed into the + * "pointLabels" option on the series option like so: + * + * > series:[{pointLabels:{ + * > labels:['mid', 'hi', 'low'], + * > location:'se', + * > ypadding: 12 + * > } + * > }] + * + * A custom labels array in the options takes precendence over any labels + * in the series data. If you have a custom labels array in the options, + * but still want to use values from the series array as labels, set the + * "labelsFromSeries" option to true. + * + * By default, html entities (<, >, etc.) are escaped in point labels. + * If you want to include actual html markup in the labels, + * set the "escapeHTML" option to false. + * + */ + $.jqplot.PointLabels = function(options) { + // Group: Properties + // + // prop: show + // show the labels or not. + this.show = $.jqplot.config.enablePlugins; + // prop: location + // compass location where to position the label around the point. + // 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw' + this.location = 'n'; + // prop: labelsFromSeries + // true to use labels within data point arrays. + this.labelsFromSeries = false; + // prop: seriesLabelIndex + // array index for location of labels within data point arrays. + // if null, will use the last element of the data point array. + this.seriesLabelIndex = null; + // prop: labels + // array of arrays of labels, one array for each series. + this.labels = []; + // actual labels that will get displayed. + // needed to preserve user specified labels in labels array. + this._labels = []; + // prop: stackedValue + // true to display value as stacked in a stacked plot. + // no effect if labels is specified. + this.stackedValue = false; + // prop: ypadding + // vertical padding in pixels between point and label + this.ypadding = 6; + // prop: xpadding + // horizontal padding in pixels between point and label + this.xpadding = 6; + // prop: escapeHTML + // true to escape html entities in the labels. + // If you want to include markup in the labels, set to false. + this.escapeHTML = true; + // prop: edgeTolerance + // Number of pixels that the label must be away from an axis + // boundary in order to be drawn. Negative values will allow overlap + // with the grid boundaries. + this.edgeTolerance = -5; + // prop: formatter + // A class of a formatter for the tick text. sprintf by default. + this.formatter = $.jqplot.DefaultTickFormatter; + // prop: formatString + // string passed to the formatter. + this.formatString = ''; + // prop: hideZeros + // true to not show a label for a value which is 0. + this.hideZeros = false; + this._elems = []; + + $.extend(true, this, options); + }; + + var locations = ['nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w']; + var locationIndicies = {'nw':0, 'n':1, 'ne':2, 'e':3, 'se':4, 's':5, 'sw':6, 'w':7}; + var oppositeLocations = ['se', 's', 'sw', 'w', 'nw', 'n', 'ne', 'e']; + + // called with scope of a series + $.jqplot.PointLabels.init = function (target, data, seriesDefaults, opts){ + var options = $.extend(true, {}, seriesDefaults, opts); + options.pointLabels = options.pointLabels || {}; + if (this.renderer.constructor == $.jqplot.BarRenderer && this.barDirection == 'horizontal' && !options.pointLabels.location) { + options.pointLabels.location = 'e'; + } + // add a pointLabels attribute to the series plugins + this.plugins.pointLabels = new $.jqplot.PointLabels(options.pointLabels); + this.plugins.pointLabels.setLabels.call(this); + }; + + // called with scope of series + $.jqplot.PointLabels.prototype.setLabels = function() { + var p = this.plugins.pointLabels; + var labelIdx; + if (p.seriesLabelIndex != null) { + labelIdx = p.seriesLabelIndex; + } + else if (this.renderer.constructor == $.jqplot.BarRenderer && this.barDirection == 'horizontal') { + labelIdx = 0; + } + else { + labelIdx = this._plotData[0].length -1; + } + p._labels = []; + if (p.labels.length == 0 || p.labelsFromSeries) { + if (p.stackedValue) { + if (this._plotData.length && this._plotData[0].length){ + // var idx = p.seriesLabelIndex || this._plotData[0].length -1; + for (var i=0; i scr || elb + et > scb) { + elem.remove(); + } + elem = null; + helem = null; + } + } + }; + + $.jqplot.postSeriesInitHooks.push($.jqplot.PointLabels.init); + $.jqplot.postDrawSeriesHooks.push($.jqplot.PointLabels.draw); +})(jQuery); \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.pointLabels.min.js b/templates/Froxlor/assets/js/plugins/jqplot.pointLabels.min.js new file mode 100644 index 00000000..86b3fd8c --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.pointLabels.min.js @@ -0,0 +1,30 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function(c){c.jqplot.PointLabels=function(e){this.show=c.jqplot.config.enablePlugins;this.location="n";this.labelsFromSeries=false;this.seriesLabelIndex=null;this.labels=[];this._labels=[];this.stackedValue=false;this.ypadding=6;this.xpadding=6;this.escapeHTML=true;this.edgeTolerance=-5;this.formatter=c.jqplot.DefaultTickFormatter;this.formatString="";this.hideZeros=false;this._elems=[];c.extend(true,this,e)};var a=["nw","n","ne","e","se","s","sw","w"];var d={nw:0,n:1,ne:2,e:3,se:4,s:5,sw:6,w:7};var b=["se","s","sw","w","nw","n","ne","e"];c.jqplot.PointLabels.init=function(i,h,f,g){var e=c.extend(true,{},f,g);e.pointLabels=e.pointLabels||{};if(this.renderer.constructor==c.jqplot.BarRenderer&&this.barDirection=="horizontal"&&!e.pointLabels.location){e.pointLabels.location="e"}this.plugins.pointLabels=new c.jqplot.PointLabels(e.pointLabels);this.plugins.pointLabels.setLabels.call(this)};c.jqplot.PointLabels.prototype.setLabels=function(){var f=this.plugins.pointLabels;var h;if(f.seriesLabelIndex!=null){h=f.seriesLabelIndex}else{if(this.renderer.constructor==c.jqplot.BarRenderer&&this.barDirection=="horizontal"){h=0}else{h=this._plotData[0].length-1}}f._labels=[];if(f.labels.length==0||f.labelsFromSeries){if(f.stackedValue){if(this._plotData.length&&this._plotData[0].length){for(var e=0;eA||s+B>m){y.remove()}y=null;f=null}}};c.jqplot.postSeriesInitHooks.push(c.jqplot.PointLabels.init);c.jqplot.postDrawSeriesHooks.push(c.jqplot.PointLabels.draw)})(jQuery); \ No newline at end of file diff --git a/templates/Froxlor/assets/js/plugins/jqplot.trendline.js b/templates/Froxlor/assets/js/plugins/jqplot.trendline.js new file mode 100644 index 00000000..57c6ec5f --- /dev/null +++ b/templates/Froxlor/assets/js/plugins/jqplot.trendline.js @@ -0,0 +1,220 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.0b2_r792 + * + * Copyright (c) 2009-2011 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + + /** + * Class: $.jqplot.Trendline + * Plugin which will automatically compute and draw trendlines for plotted data. + */ + $.jqplot.Trendline = function() { + // Group: Properties + + // prop: show + // Wether or not to show the trend line. + this.show = $.jqplot.config.enablePlugins; + // prop: color + // CSS color spec for the trend line. + // By default this wil be the same color as the primary line. + this.color = '#666666'; + // prop: renderer + // Renderer to use to draw the trend line. + // The data series that is plotted may not be rendered as a line. + // Therefore, we use our own line renderer here to draw a trend line. + this.renderer = new $.jqplot.LineRenderer(); + // prop: rendererOptions + // Options to pass to the line renderer. + // By default, markers are not shown on trend lines. + this.rendererOptions = {marker:{show:false}}; + // prop: label + // Label for the trend line to use in the legend. + this.label = ''; + // prop: type + // Either 'exponential', 'exp', or 'linear'. + this.type = 'linear'; + // prop: shadow + // true or false, wether or not to show the shadow. + this.shadow = true; + // prop: markerRenderer + // Renderer to use to draw markers on the line. + // I think this is wrong. + this.markerRenderer = {show:false}; + // prop: lineWidth + // Width of the trend line. + this.lineWidth = 1.5; + // prop: shadowAngle + // Angle of the shadow on the trend line. + this.shadowAngle = 45; + // prop: shadowOffset + // pixel offset for each stroke of the shadow. + this.shadowOffset = 1.0; + // prop: shadowAlpha + // Alpha transparency of the shadow. + this.shadowAlpha = 0.07; + // prop: shadowDepth + // number of strokes to make of the shadow. + this.shadowDepth = 3; + this.isTrendline = true; + + }; + + $.jqplot.postSeriesInitHooks.push(parseTrendLineOptions); + $.jqplot.postDrawSeriesHooks.push(drawTrendline); + $.jqplot.addLegendRowHooks.push(addTrendlineLegend); + + // called witin scope of the legend object + // current series passed in + // must return null or an object {label:label, color:color} + function addTrendlineLegend(series) { + var lt = series.trendline.label.toString(); + var ret = null; + if (this.renderer.constructor != $.jqplot.PieRenderer && series.trendline.show && lt) { + ret = {label:lt, color:series.trendline.color}; + } + return ret; + } + + // called within scope of a series + function parseTrendLineOptions (target, data, seriesDefaults, options, plot) { + if (this.renderer.constructor == $.jqplot.LineRenderer) { + this.trendline = new $.jqplot.Trendline(); + options = options || {}; + $.extend(true, this.trendline, {color:this.color}, seriesDefaults.trendline, options.trendline); + this.trendline.renderer.init.call(this.trendline, null); + } + } + + // called within scope of series object + function drawTrendline(sctx, options) { + // if we have options, merge trendline options in with precedence + options = $.extend(true, {}, this.trendline, options); + + if (options.show && this.renderer.constructor != $.jqplot.PieRenderer) { + var fit; + // this.renderer.setGridData.call(this); + var data = options.data || this.data; + fit = fitData(data, this.trendline.type); + var gridData = options.gridData || this.renderer.makeGridData.call(this, fit.data); + this.trendline.renderer.draw.call(this.trendline, sctx, gridData, {showLine:true, shadow:this.trendline.shadow}); + } + } + + function regression(x, y, typ) { + var type = (typ == null) ? 'linear' : typ; + var N = x.length; + var slope; + var intercept; + var SX = 0; + var SY = 0; + var SXX = 0; + var SXY = 0; + var SYY = 0; + var Y = []; + var X = []; + + if (type == 'linear') { + X = x; + Y = y; + } + else if (type == 'exp' || type == 'exponential') { + for ( var i=0; i 0) + { + links.push($(row).children().last().html()); + } + ftp.push([parseFloat(ftpd), i]); + http.push([parseFloat(httpd), i]); + mail.push([parseFloat(maild), i]); + if (ftpd > max) + { + max = ftpd; + } + if (httpd > max) + { + max = httpd; + } + if (maild > max) + { + max = maild; + } + ticks.push(day); + i++; + }); + $('#datatable').hide(); + $('#chartdiv').height(parseFloat(i) * 50); + data.push(ftp); + data.push(http); + data.push(mail); + if (links.length > 0) + { + var tmp = $('
', {id: 'linkslist'}); + $.each(links, function(i, link) { + tmp.append(link); + if (i != links.length - 1) + { + tmp.append(' | '); + } + }); + tmp.insertBefore($('#datatable')); + } + var plot2 = $.jqplot('chartdiv', data, { + stackSeries: false, + captureRightClick: true, + seriesDefaults: { + renderer:$.jqplot.BarRenderer, + pointLabels: { show: true, location: 'e', edgeTolerance: -15 }, + shadowAngle: 135, + rendererOptions: { + barDirection: 'horizontal', + highlightMouseOver: true, + } + }, + series: [ + {color: '#019522'}, + {color: '#0000FF'}, + {color: '#800000'} + ], + axes: { + yaxis: { + renderer: $.jqplot.CategoryAxisRenderer, + ticks: ticks, + }, + xaxis: { + min: 0, + }, + }, + }) +}); + diff --git a/templates/Froxlor/customer/aps/installer.tpl b/templates/Froxlor/customer/aps/installer.tpl index b2a15477..8e2bfda2 100644 --- a/templates/Froxlor/customer/aps/installer.tpl +++ b/templates/Froxlor/customer/aps/installer.tpl @@ -1,7 +1,7 @@

- {$Xml->name}  + {$Xml->name}  {$Xml->name}

diff --git a/templates/Froxlor/customer/aps/package.tpl b/templates/Froxlor/customer/aps/package.tpl index b8cda3f1..b959e67a 100644 --- a/templates/Froxlor/customer/aps/package.tpl +++ b/templates/Froxlor/customer/aps/package.tpl @@ -1,7 +1,7 @@

- {$Xml->name}  + {$Xml->name}  {$Xml->name}

diff --git a/templates/Froxlor/customer/aps/package_status.tpl b/templates/Froxlor/customer/aps/package_status.tpl index 149b47f0..d566b0d3 100644 --- a/templates/Froxlor/customer/aps/package_status.tpl +++ b/templates/Froxlor/customer/aps/package_status.tpl @@ -1,7 +1,7 @@

- {$Xml->name}  + {$Xml->name}  {$Xml->name}

diff --git a/templates/Froxlor/customer/aps/search.tpl b/templates/Froxlor/customer/aps/search.tpl index 5cacc252..d24ddc2b 100644 --- a/templates/Froxlor/customer/aps/search.tpl +++ b/templates/Froxlor/customer/aps/search.tpl @@ -1,7 +1,7 @@

-   +   {$lng['aps']['search']}

diff --git a/templates/Froxlor/customer/autoresponder/autoresponder.tpl b/templates/Froxlor/customer/autoresponder/autoresponder.tpl index 7c86c50c..54e0afd5 100644 --- a/templates/Froxlor/customer/autoresponder/autoresponder.tpl +++ b/templates/Froxlor/customer/autoresponder/autoresponder.tpl @@ -2,7 +2,7 @@

-   +   {$lng['menue']['email']['autoresponder']}

@@ -11,7 +11,7 @@ @@ -33,7 +33,7 @@ diff --git a/templates/Froxlor/customer/autoresponder/autoresponder_add.tpl b/templates/Froxlor/customer/autoresponder/autoresponder_add.tpl index d920e458..276b908f 100644 --- a/templates/Froxlor/customer/autoresponder/autoresponder_add.tpl +++ b/templates/Froxlor/customer/autoresponder/autoresponder_add.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/autoresponder/autoresponder_autoresponder.tpl b/templates/Froxlor/customer/autoresponder/autoresponder_autoresponder.tpl index 0a96131d..0df6bbac 100644 --- a/templates/Froxlor/customer/autoresponder/autoresponder_autoresponder.tpl +++ b/templates/Froxlor/customer/autoresponder/autoresponder_autoresponder.tpl @@ -7,10 +7,10 @@ $activated_date - {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']} diff --git a/templates/Froxlor/customer/autoresponder/autoresponder_edit.tpl b/templates/Froxlor/customer/autoresponder/autoresponder_edit.tpl index 11cdad6c..636d894d 100644 --- a/templates/Froxlor/customer/autoresponder/autoresponder_edit.tpl +++ b/templates/Froxlor/customer/autoresponder/autoresponder_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/domains/domainlist.tpl b/templates/Froxlor/customer/domains/domainlist.tpl index 5442f998..4b880c4f 100644 --- a/templates/Froxlor/customer/domains/domainlist.tpl +++ b/templates/Froxlor/customer/domains/domainlist.tpl @@ -2,7 +2,7 @@

-   +   {$lng['domains']['domainsettings']} ({$domains_count})

@@ -17,7 +17,7 @@ @@ -51,7 +51,7 @@ diff --git a/templates/Froxlor/customer/domains/domains_add.tpl b/templates/Froxlor/customer/domains/domains_add.tpl index 544c94d0..eee35f11 100644 --- a/templates/Froxlor/customer/domains/domains_add.tpl +++ b/templates/Froxlor/customer/domains/domains_add.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/domains/domains_domain.tpl b/templates/Froxlor/customer/domains/domains_domain.tpl index e178556e..8899e07a 100644 --- a/templates/Froxlor/customer/domains/domains_domain.tpl +++ b/templates/Froxlor/customer/domains/domains_domain.tpl @@ -7,12 +7,12 @@ - {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']}   diff --git a/templates/Froxlor/customer/domains/domains_edit.tpl b/templates/Froxlor/customer/domains/domains_edit.tpl index 1731bacd..39a3a800 100644 --- a/templates/Froxlor/customer/domains/domains_edit.tpl +++ b/templates/Froxlor/customer/domains/domains_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/email/account_add.tpl b/templates/Froxlor/customer/email/account_add.tpl index 530f7078..9ebb063f 100644 --- a/templates/Froxlor/customer/email/account_add.tpl +++ b/templates/Froxlor/customer/email/account_add.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/email/account_changepw.tpl b/templates/Froxlor/customer/email/account_changepw.tpl index 0e2ce7b2..a1314f72 100644 --- a/templates/Froxlor/customer/email/account_changepw.tpl +++ b/templates/Froxlor/customer/email/account_changepw.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/email/account_changequota.tpl b/templates/Froxlor/customer/email/account_changequota.tpl index 06918fd2..47ca9d02 100644 --- a/templates/Froxlor/customer/email/account_changequota.tpl +++ b/templates/Froxlor/customer/email/account_changequota.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/email/emails.tpl b/templates/Froxlor/customer/email/emails.tpl index 3dffe63d..996853e1 100644 --- a/templates/Froxlor/customer/email/emails.tpl +++ b/templates/Froxlor/customer/email/emails.tpl @@ -2,7 +2,7 @@

-   +   {$lng['menue']['email']['emails']} ({$emailscount})

@@ -17,7 +17,7 @@ @@ -56,7 +56,7 @@ diff --git a/templates/Froxlor/customer/email/emails_add.tpl b/templates/Froxlor/customer/email/emails_add.tpl index daad8e26..8f37c418 100644 --- a/templates/Froxlor/customer/email/emails_add.tpl +++ b/templates/Froxlor/customer/email/emails_add.tpl @@ -11,7 +11,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/email/emails_edit.tpl b/templates/Froxlor/customer/email/emails_edit.tpl index 060bed46..8fa4468f 100644 --- a/templates/Froxlor/customer/email/emails_edit.tpl +++ b/templates/Froxlor/customer/email/emails_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/email/emails_email.tpl b/templates/Froxlor/customer/email/emails_email.tpl index 916a893e..c0307151 100644 --- a/templates/Froxlor/customer/email/emails_email.tpl +++ b/templates/Froxlor/customer/email/emails_email.tpl @@ -6,10 +6,10 @@ {$lng['emails']['noquota']}{$row['quota']} MB - {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']} diff --git a/templates/Froxlor/customer/email/forwarder_add.tpl b/templates/Froxlor/customer/email/forwarder_add.tpl index 63385133..b7cdaf03 100644 --- a/templates/Froxlor/customer/email/forwarder_add.tpl +++ b/templates/Froxlor/customer/email/forwarder_add.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/extras/backup.tpl b/templates/Froxlor/customer/extras/backup.tpl index a13ac1d5..da04460a 100644 --- a/templates/Froxlor/customer/extras/backup.tpl +++ b/templates/Froxlor/customer/extras/backup.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

@@ -29,4 +29,4 @@ $header
-$footer \ No newline at end of file +$footer diff --git a/templates/Froxlor/customer/extras/htaccess.tpl b/templates/Froxlor/customer/extras/htaccess.tpl index 8a103964..6accfe4a 100644 --- a/templates/Froxlor/customer/extras/htaccess.tpl +++ b/templates/Froxlor/customer/extras/htaccess.tpl @@ -2,7 +2,7 @@

-   +   {$lng['menue']['extras']['pathoptions']}

@@ -17,7 +17,7 @@ @@ -54,7 +54,7 @@

diff --git a/templates/Froxlor/customer/extras/htaccess_add.tpl b/templates/Froxlor/customer/extras/htaccess_add.tpl index 1e709af7..f4188956 100644 --- a/templates/Froxlor/customer/extras/htaccess_add.tpl +++ b/templates/Froxlor/customer/extras/htaccess_add.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/extras/htaccess_edit.tpl b/templates/Froxlor/customer/extras/htaccess_edit.tpl index d57d72d8..4604178b 100644 --- a/templates/Froxlor/customer/extras/htaccess_edit.tpl +++ b/templates/Froxlor/customer/extras/htaccess_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/extras/htaccess_htaccess.tpl b/templates/Froxlor/customer/extras/htaccess_htaccess.tpl index 728850ad..ae7c1838 100644 --- a/templates/Froxlor/customer/extras/htaccess_htaccess.tpl +++ b/templates/Froxlor/customer/extras/htaccess_htaccess.tpl @@ -9,10 +9,10 @@ - {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']} diff --git a/templates/Froxlor/customer/extras/htpasswds.tpl b/templates/Froxlor/customer/extras/htpasswds.tpl index c0e2d4f2..74a71fc5 100644 --- a/templates/Froxlor/customer/extras/htpasswds.tpl +++ b/templates/Froxlor/customer/extras/htpasswds.tpl @@ -2,7 +2,7 @@

-   +   {$lng['menue']['extras']['directoryprotection']}

@@ -17,7 +17,7 @@ @@ -50,7 +50,7 @@ diff --git a/templates/Froxlor/customer/extras/htpasswds_add.tpl b/templates/Froxlor/customer/extras/htpasswds_add.tpl index 486c78ec..5ca61655 100644 --- a/templates/Froxlor/customer/extras/htpasswds_add.tpl +++ b/templates/Froxlor/customer/extras/htpasswds_add.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/extras/htpasswds_edit.tpl b/templates/Froxlor/customer/extras/htpasswds_edit.tpl index f8305f56..d2887ec8 100644 --- a/templates/Froxlor/customer/extras/htpasswds_edit.tpl +++ b/templates/Froxlor/customer/extras/htpasswds_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/extras/htpasswds_htpasswd.tpl b/templates/Froxlor/customer/extras/htpasswds_htpasswd.tpl index 4580dad5..cca4dc60 100644 --- a/templates/Froxlor/customer/extras/htpasswds_htpasswd.tpl +++ b/templates/Froxlor/customer/extras/htpasswds_htpasswd.tpl @@ -3,10 +3,10 @@ {$row['path']} - {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']} diff --git a/templates/Froxlor/customer/ftp/accounts.tpl b/templates/Froxlor/customer/ftp/accounts.tpl index d9084655..c00f2ad3 100644 --- a/templates/Froxlor/customer/ftp/accounts.tpl +++ b/templates/Froxlor/customer/ftp/accounts.tpl @@ -2,7 +2,7 @@

-   +   {$lng['menue']['ftp']['accounts']} ({$ftps_count})

@@ -17,7 +17,7 @@ @@ -51,7 +51,7 @@ diff --git a/templates/Froxlor/customer/ftp/accounts_account.tpl b/templates/Froxlor/customer/ftp/accounts_account.tpl index 9097039a..b72f37ea 100644 --- a/templates/Froxlor/customer/ftp/accounts_account.tpl +++ b/templates/Froxlor/customer/ftp/accounts_account.tpl @@ -3,10 +3,10 @@ {$row['documentroot']} - {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']} diff --git a/templates/Froxlor/customer/ftp/accounts_add.tpl b/templates/Froxlor/customer/ftp/accounts_add.tpl index 95f51467..cd598295 100644 --- a/templates/Froxlor/customer/ftp/accounts_add.tpl +++ b/templates/Froxlor/customer/ftp/accounts_add.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/ftp/accounts_edit.tpl b/templates/Froxlor/customer/ftp/accounts_edit.tpl index 9ce51dc4..2686bb9a 100644 --- a/templates/Froxlor/customer/ftp/accounts_edit.tpl +++ b/templates/Froxlor/customer/ftp/accounts_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/index/change_language.tpl b/templates/Froxlor/customer/index/change_language.tpl index fe4d3bf8..1285f515 100644 --- a/templates/Froxlor/customer/index/change_language.tpl +++ b/templates/Froxlor/customer/index/change_language.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['menue']['main']['changelanguage']}

diff --git a/templates/Froxlor/customer/index/change_password.tpl b/templates/Froxlor/customer/index/change_password.tpl index e38c077b..5afab9c8 100644 --- a/templates/Froxlor/customer/index/change_password.tpl +++ b/templates/Froxlor/customer/index/change_password.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['menue']['main']['changepassword']}

diff --git a/templates/Froxlor/customer/index/change_theme.tpl b/templates/Froxlor/customer/index/change_theme.tpl index 78531dde..b1ecd985 100644 --- a/templates/Froxlor/customer/index/change_theme.tpl +++ b/templates/Froxlor/customer/index/change_theme.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['menue']['main']['changetheme']}

diff --git a/templates/Froxlor/customer/mysql/mysqls.tpl b/templates/Froxlor/customer/mysql/mysqls.tpl index 4284f6a4..023491f7 100644 --- a/templates/Froxlor/customer/mysql/mysqls.tpl +++ b/templates/Froxlor/customer/mysql/mysqls.tpl @@ -2,7 +2,7 @@

-   +   {$lng['menue']['mysql']['databases']} ({$mysqls_count})

@@ -17,7 +17,7 @@ @@ -53,7 +53,7 @@ diff --git a/templates/Froxlor/customer/mysql/mysqls_add.tpl b/templates/Froxlor/customer/mysql/mysqls_add.tpl index 27d1e621..406e3a5b 100644 --- a/templates/Froxlor/customer/mysql/mysqls_add.tpl +++ b/templates/Froxlor/customer/mysql/mysqls_add.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/mysql/mysqls_database.tpl b/templates/Froxlor/customer/mysql/mysqls_database.tpl index 31c3fb86..62489f23 100644 --- a/templates/Froxlor/customer/mysql/mysqls_database.tpl +++ b/templates/Froxlor/customer/mysql/mysqls_database.tpl @@ -6,10 +6,10 @@ - {$lng['panel']['edit']} + {$lng['panel']['edit']}   - {$lng['panel']['delete']} + {$lng['panel']['delete']} diff --git a/templates/Froxlor/customer/mysql/mysqls_edit.tpl b/templates/Froxlor/customer/mysql/mysqls_edit.tpl index 5420e963..4250dd67 100644 --- a/templates/Froxlor/customer/mysql/mysqls_edit.tpl +++ b/templates/Froxlor/customer/mysql/mysqls_edit.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/tickets/tickets.tpl b/templates/Froxlor/customer/tickets/tickets.tpl index 218a52ea..00403fac 100644 --- a/templates/Froxlor/customer/tickets/tickets.tpl +++ b/templates/Froxlor/customer/tickets/tickets.tpl @@ -2,7 +2,7 @@ $header

-   +   {$lng['menue']['ticket']['ticket']}

@@ -30,7 +30,7 @@ $header @@ -69,7 +69,7 @@ $header diff --git a/templates/Froxlor/customer/tickets/tickets_new.tpl b/templates/Froxlor/customer/tickets/tickets_new.tpl index 494d87a5..5e13d845 100644 --- a/templates/Froxlor/customer/tickets/tickets_new.tpl +++ b/templates/Froxlor/customer/tickets/tickets_new.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/tickets/tickets_reply.tpl b/templates/Froxlor/customer/tickets/tickets_reply.tpl index 7d49a05b..a4a9086b 100644 --- a/templates/Froxlor/customer/tickets/tickets_reply.tpl +++ b/templates/Froxlor/customer/tickets/tickets_reply.tpl @@ -2,7 +2,7 @@ $header

- {$title}  + {$title}  {$title}

diff --git a/templates/Froxlor/customer/tickets/tickets_tickets.tpl b/templates/Froxlor/customer/tickets/tickets_tickets.tpl index 090642fb..e02bbc7a 100644 --- a/templates/Froxlor/customer/tickets/tickets_tickets.tpl +++ b/templates/Froxlor/customer/tickets/tickets_tickets.tpl @@ -8,20 +8,20 @@ - {$lng['ticket']['show']} + {$lng['ticket']['show']} - {$lng['ticket']['answer']} + {$lng['ticket']['answer']}   - {$lng['ticket']['close']} + {$lng['ticket']['close']}   - {$lng['ticket']['reopen']} + {$lng['ticket']['reopen']} diff --git a/templates/Froxlor/customer/traffic/traffic.tpl b/templates/Froxlor/customer/traffic/traffic.tpl index 21c89f07..5189fe07 100644 --- a/templates/Froxlor/customer/traffic/traffic.tpl +++ b/templates/Froxlor/customer/traffic/traffic.tpl @@ -2,7 +2,7 @@ $header

- {$lng['menue']['traffic']['traffic']}  + {$lng['menue']['traffic']['traffic']}  {$lng['menue']['traffic']['traffic']}

diff --git a/templates/Froxlor/customer/traffic/traffic_details.tpl b/templates/Froxlor/customer/traffic/traffic_details.tpl index e3d8f274..5546abe0 100644 --- a/templates/Froxlor/customer/traffic/traffic_details.tpl +++ b/templates/Froxlor/customer/traffic/traffic_details.tpl @@ -2,7 +2,7 @@ $header

- {$lng['menue']['traffic']['traffic']}  + {$lng['menue']['traffic']['traffic']}  {$lng['menue']['traffic']['traffic']} $show

diff --git a/templates/Froxlor/header.tpl b/templates/Froxlor/header.tpl index 3cffe7aa..2f2051d0 100644 --- a/templates/Froxlor/header.tpl +++ b/templates/Froxlor/header.tpl @@ -1,30 +1,30 @@ - <if isset($userinfo['loginname']) && $userinfo['loginname'] != ''>{$userinfo['loginname']} - </if>Froxlor Server Management Panel - + - - + + - - - - - - - + + + + + + + - - - - - + + + + + + <if isset($userinfo['loginname']) && $userinfo['loginname'] != ''>{$userinfo['loginname']} - </if>Froxlor Server Management Panel diff --git a/templates/Froxlor/index.tpl b/templates/Froxlor/index.tpl index 253eac39..9edc562a 100644 --- a/templates/Froxlor/index.tpl +++ b/templates/Froxlor/index.tpl @@ -7,11 +7,11 @@ {/if} - - + + - - + + {$title}Froxlor Server Management Panel diff --git a/templates/Froxlor/login/fpwd.tpl b/templates/Froxlor/login/fpwd.tpl index 1764e47d..6e18716e 100644 --- a/templates/Froxlor/login/fpwd.tpl +++ b/templates/Froxlor/login/fpwd.tpl @@ -1,7 +1,7 @@ $header
-
\ No newline at end of file +
diff --git a/templates/Froxlor/misc/alreadyinstalledhint.tpl b/templates/Froxlor/misc/alreadyinstalledhint.tpl index d1475d99..e08f318b 100644 --- a/templates/Froxlor/misc/alreadyinstalledhint.tpl +++ b/templates/Froxlor/misc/alreadyinstalledhint.tpl @@ -1,20 +1,20 @@ - + - - + + - - + + Froxlor Server Management Panel - Installation
- Froxlor Server Management Panel + Froxlor Server Management Panel
diff --git a/templates/Froxlor/misc/configurehint.tpl b/templates/Froxlor/misc/configurehint.tpl index 53bdf2b3..e04309fb 100644 --- a/templates/Froxlor/misc/configurehint.tpl +++ b/templates/Froxlor/misc/configurehint.tpl @@ -3,18 +3,18 @@ - - + + - - + + Froxlor Server Management Panel - Installation
\ No newline at end of file +
diff --git a/templates/Froxlor/webftp/webftp_main_header.tpl b/templates/Froxlor/webftp/webftp_main_header.tpl index ab127788..7f03ada4 100644 --- a/templates/Froxlor/webftp/webftp_main_header.tpl +++ b/templates/Froxlor/webftp/webftp_main_header.tpl @@ -1,7 +1,7 @@

-   +   {$connected_to} ({$mode})

diff --git a/webftp.php b/webftp.php index 33cd0f59..c1d522dc 100644 --- a/webftp.php +++ b/webftp.php @@ -113,10 +113,10 @@ else $settings['panel']['default_theme'] = 'Froxlor'; } */ -# Until we have other themes: enforce the Froxlor - layout +// Until we have other themes: enforce the Froxlor - layout $settings['panel']['default_theme'] = 'Froxlor'; -# Initialize Smarty +// Initialize Smarty include('./lib/classes/Smarty/Smarty.class.php'); $smarty = new Smarty; @@ -124,13 +124,13 @@ $smarty->template_dir = './templates/' . $settings['panel']['default_theme'] . ' $smarty->compile_dir = './templates_c/'; $smarty->cache_dir = './cache/'; -# Set the language +// Set the language require('./lib/classes/output/class.languageSelect.php'); $language = new languageSelect(); $language->useBrowser = true; $language->setLanguage(); -# Activate gettext for smarty; +// Activate gettext for smarty; define('HAVE_GETTEXT', true); require ('./lib/functions/smarty_plugins/gettext-prefilter.php'); @@ -154,21 +154,35 @@ if ($result = $db->query("SELECT `value` FROM `panel_settings` WHERE `settinggro $db->close(); unset($db); -# Set default options for template -$image_path = 'images/'.$settings['panel']['default_theme']; -$header_logo = $image_path.'/logo.png'; -if(file_exists($image_path.'/logo_custom.png')) + +// global Theme-variable + +$theme = isset($settings['panel']['default_theme']) ? $settings['panel']['default_theme'] : 'Froxlor'; + +// overwrite with customer/admin theme if defined + +if(isset($userinfo['theme']) && $userinfo['theme'] != $theme) { - $header_logo = $image_path.'/logo_custom.png'; + $theme = $userinfo['theme']; } + +// Set default options for template +$hl_path = 'templates/'.$theme.'/assets/img'; +$header_logo = $hl_path.'/logo.png'; + +if(file_exists($hl_path.'/logo_custom.png')) { + $header_logo = $hl_path.'/logo_custom.png'; +} + $smarty->assign('header_logo', $header_logo); +$smarty->assign('theme', $theme); $smarty->assign('settings', $settings); $smarty->assign('loggedin', 0); $smarty->assign('current_year', date('Y')); $smarty->assign('image_folder', $image_path); $smarty->assign('title', 'WebFTP - '); -# Let's start the program +// Let's start the program session_start(); $s = session_id();