From 65ec262bcb1bc155703f4db8077c01dce7f247e9 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Tue, 8 Jul 2014 09:35:35 -0500 Subject: [PATCH] i18n: First attempt at right-to-left layout --- css/rtl.css | 59 +++++++++++++++++++++++++++ include/class.i18n.php | 5 +++ include/i18n/langs.php | 3 ++ include/staff/apikeys.inc.php | 8 ++-- include/staff/banlist.inc.php | 8 ++-- include/staff/cannedresponses.inc.php | 10 ++--- include/staff/categories.inc.php | 10 ++--- include/staff/departments.inc.php | 12 +++--- include/staff/directory.inc.php | 2 +- include/staff/dynamic-form.inc.php | 4 +- include/staff/dynamic-forms.inc.php | 11 ++--- include/staff/dynamic-lists.inc.php | 8 ++-- include/staff/emails.inc.php | 10 ++--- include/staff/faq-categories.inc.php | 2 +- include/staff/faq-category.inc.php | 4 +- include/staff/faq-view.inc.php | 4 +- include/staff/filter.inc.php | 6 +-- include/staff/filters.inc.php | 8 ++-- include/staff/groups.inc.php | 10 ++--- include/staff/header.inc.php | 8 +++- include/staff/helptopics.inc.php | 12 +++--- include/staff/orgs.inc.php | 4 +- include/staff/pages.inc.php | 8 ++-- include/staff/plugins.inc.php | 8 ++-- include/staff/settings-pages.inc.php | 4 +- include/staff/settings-system.inc.php | 2 +- include/staff/slaplans.inc.php | 8 ++-- include/staff/staffmembers.inc.php | 8 ++-- include/staff/syslogs.inc.php | 4 +- include/staff/system.inc.php | 12 +++--- include/staff/teams.inc.php | 10 ++--- include/staff/templates.inc.php | 8 ++-- include/staff/ticket-view.inc.php | 12 +++--- include/staff/tickets.inc.php | 6 +-- include/staff/user-view.inc.php | 4 +- include/staff/users.inc.php | 6 +-- scp/css/scp.css | 13 +++++- 37 files changed, 203 insertions(+), 118 deletions(-) create mode 100644 css/rtl.css diff --git a/css/rtl.css b/css/rtl.css new file mode 100644 index 000000000..d0fc65c9f --- /dev/null +++ b/css/rtl.css @@ -0,0 +1,59 @@ +.rtl { + direction: rtl; + unicode-bidi: embed; +} +.rtl .pull-left { + float: right; +} +.rtl .pull-right { + float: left; +} +.rtl table.list thead th a { + background-position: 0% 50%; + padding-right: 3px; + padding-left: 15px; +} +.rtl table.list thead th, +.rtl table.list caption, +.rtl .dialog th, +.rtl .tip_box th { + text-align: right; +} +.rtl .dialog h3 { + padding-right: inherit; + padding-left: 3em; +} +.rtl .dialog a.close { + right: auto; + left: 1em; +} +.rtl #nav .inactive li { + text-align: right; +} +.rtl #nav .inactive li a { + background-position: 100% 50%; + padding-left: 0; + padding-right: 24px; +} +.rtl #nav li.inactive > ul { + left: auto; + right: -1px; +} +.rtl .tip_close { + right: auto; + left: 0.5em; +} +.rtl .tip_content h1 { + padding-right: 0; + padding-left: 1.5em; +} +.rtl #warning_bar, +.rtl #msg_error, +.rtl .error-banner { + background-position: 99% 50%; + padding-left: 10px; + padding-right: 36px; +} +.rtl .form_table th, .rtl div.section-break { + text-align: right; +} diff --git a/include/class.i18n.php b/include/class.i18n.php index 0ddc78e81..66d00c0a9 100644 --- a/include/class.i18n.php +++ b/include/class.i18n.php @@ -166,6 +166,11 @@ class Internationalization { return $lang; } + static function getLanguageInfo($lang) { + $langs = self::availableLanguages(); + return @$langs[$lang] ?: array(); + } + static function availableLanguages($base=I18N_DIR) { static $cache = false; if ($cache) return $cache; diff --git a/include/i18n/langs.php b/include/i18n/langs.php index 09957c42b..1caed5cb7 100644 --- a/include/i18n/langs.php +++ b/include/i18n/langs.php @@ -29,6 +29,7 @@ return array( "nativeName" => "አማርኛ" ), "ar" => array( + "direction" => "rtl", "name" => "Arabic", "nativeName" => "العربية" ), @@ -229,6 +230,7 @@ return array( "nativeName" => "Hausa, هَوُسَ" ), "he" => array( + "direction" => "rtl", "name" => "Hebrew (modern)", "nativeName" => "עברית" ), @@ -501,6 +503,7 @@ return array( "nativeName" => "पाऴि" ), "fa" => array( + "direction" => "rtl", "name" => "Persian", "nativeName" => "فارسی" ), diff --git a/include/staff/apikeys.inc.php b/include/staff/apikeys.inc.php index 43c8d4f7f..8b1220a34 100644 --- a/include/staff/apikeys.inc.php +++ b/include/staff/apikeys.inc.php @@ -39,10 +39,10 @@ else ?> -<div style="width:700px;padding-top:5px; float:left;"> +<div class="pull-left" style="width:700px;padding-top:5px;"> <h2><?php echo __('API Keys');?></h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> <b><a href="apikeys.php?a=add" class="Icon newapi"><?php echo __('Add New API Key');?></a></b></div> <div class="clear"></div> <form action="apikeys.php" method="POST" name="keys"> @@ -129,10 +129,10 @@ endif; <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/banlist.inc.php b/include/staff/banlist.inc.php index 89f4309b2..075d51aef 100644 --- a/include/staff/banlist.inc.php +++ b/include/staff/banlist.inc.php @@ -49,7 +49,7 @@ $query="$select $from $where ORDER BY $order_by LIMIT ".$pageNav->getStart()."," <h2><?php echo __('Banned Email Addresses');?> <i class="help-tip icon-question-sign" href="#ban_list"></i> </h2> -<div style="width:600; float:left;padding-top:5px;"> +<div class="pull-left" style="width:600;padding-top:5px;"> <form action="banlist.php" method="GET" name="filter"> <input type="hidden" name="a" value="filter" > <div> @@ -59,7 +59,7 @@ $query="$select $from $where ORDER BY $order_by LIMIT ".$pageNav->getStart()."," </div> </form> </div> -<div style="float:right;text-align:right;padding-right:5px;"><b><a href="banlist.php?a=add" class="Icon newstaff"><?php echo __('Ban New Email');?></a></b></div> +<div class="pull-right flush-right" style="padding-right:5px;"><b><a href="banlist.php?a=add" class="Icon newstaff"><?php echo __('Ban New Email');?></a></b></div> <div class="clear"></div> <?php if(($res=db_query($query)) && ($num=db_num_rows($res))) @@ -154,10 +154,10 @@ endif; <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/cannedresponses.inc.php b/include/staff/cannedresponses.inc.php index 0e73eb805..e7b65b58c 100644 --- a/include/staff/cannedresponses.inc.php +++ b/include/staff/cannedresponses.inc.php @@ -48,11 +48,11 @@ else $showing=__('No premade responses found!'); ?> -<div style="width:700px;padding-top:5px; float:left;"> - <h2><?php echo __('Canned Responses');?></h2> +<div class="pull-left" style="width:700px;padding-top:5px;"> + <h2><?php echo __('Canned Responses');?> <i class="help-tip icon-question-sign" href="#canned_responses"></i></h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> <b><a href="canned.php?a=add" class="Icon newReply"><?php echo __('Add New Response');?></a></b></div> <div class="clear"></div> <form action="canned.php" method="POST" name="canned"> @@ -141,10 +141,10 @@ endif; <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/categories.inc.php b/include/staff/categories.inc.php index 82f504998..0fee06ca8 100644 --- a/include/staff/categories.inc.php +++ b/include/staff/categories.inc.php @@ -40,11 +40,11 @@ else $showing=__('No FAQ categories found!'); ?> -<div style="width:700px;padding-top:5px; float:left;"> - <h2><?php echo __('FAQ Categories');?></h2> +<div class="pull-left" style="width:700px;padding-top:5px;"> + <h2><?php echo __('FAQ Categories');?> <i class="help-tip icon-question-sign" href="#faq_categories"></i></h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> <b><a href="categories.php?a=add" class="Icon newCategory"><?php echo __('Add New Category');?></a></b></div> <div class="clear"></div> <form action="categories.php" method="POST" name="cat"> @@ -134,10 +134,10 @@ endif; <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/departments.inc.php b/include/staff/departments.inc.php index 4cbcda17e..7bad3711e 100644 --- a/include/staff/departments.inc.php +++ b/include/staff/departments.inc.php @@ -41,10 +41,10 @@ else $showing=__('No departments found!'); ?> -<div style="width:700px;padding-top:5px; float:left;"> +<div class="pull-left" style="width:700px;padding-top:5px;"> <h2><?php echo __('Departments');?></h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-left flush-right" style="padding-top:5px;padding-right:5px;"> <b><a href="departments.php?a=add" class="Icon newDepartment"><?php echo __('Add New Department');?></a></b></div> <div class="clear"></div> <form action="departments.php" method="POST" name="depts"> @@ -100,8 +100,8 @@ else <?php } ?> </b> </td> - <td><a href="emails.php?id=<?php echo $row['email_id']; ?>"><?php - echo Format::htmlchars($row['email']); ?></a> </td> + <td><span class="ltr"><a href="emails.php?id=<?php echo $row['email_id']; ?>"><?php + echo Format::htmlchars($row['email']); ?></a></span></td> <td><a href="staff.php?id=<?php echo $row['manager_id']; ?>"><?php echo $row['manager']; ?> </a></td> </tr> <?php @@ -152,10 +152,10 @@ endif; <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/directory.inc.php b/include/staff/directory.inc.php index eda6bffc2..7f27db017 100644 --- a/include/staff/directory.inc.php +++ b/include/staff/directory.inc.php @@ -62,7 +62,7 @@ $query="$select $from $where GROUP BY staff.staff_id ORDER BY $order_by LIMIT ". ?> <h2><?php echo __('Agents');?> <i class="help-tip icon-question-sign" href="#staff_members"></i></h2> -<div style="width:700px; float:left;"> +<div class="pull-left" style="width:700px"> <form action="directory.php" method="GET" name="filter"> <input type="text" name="q" value="<?php echo Format::htmlchars($_REQUEST['q']); ?>" > <select name="did" id="did"> diff --git a/include/staff/dynamic-form.inc.php b/include/staff/dynamic-form.inc.php index 94f568698..90d010597 100644 --- a/include/staff/dynamic-form.inc.php +++ b/include/staff/dynamic-form.inc.php @@ -258,10 +258,10 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); <div id="deleted-fields"></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="No, Cancel" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="submit" value="Continue" class="confirm"> </span> </p> diff --git a/include/staff/dynamic-forms.inc.php b/include/staff/dynamic-forms.inc.php index fb7ea48a4..4e456873e 100644 --- a/include/staff/dynamic-forms.inc.php +++ b/include/staff/dynamic-forms.inc.php @@ -1,8 +1,9 @@ -<div style="width:700;padding-top:5px; float:left;"> +<div class="pull-left" style="width:700;padding-top:5px;"> <h2><?php echo __('Custom Forms'); ?></h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> - <b><a href="forms.php?a=add" class="Icon form-add">Add New Custom Form</a></b></div> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> +<b><a href="forms.php?a=add" class="Icon form-add"><?php + echo __('Add New Custom Form'); ?></a></b></div> <div class="clear"></div> <?php @@ -110,10 +111,10 @@ if ($count) //Show options.. <div><?php echo __('Please confirm to continue.'); ?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="No, Cancel" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="Yes, Do it!" class="confirm"> </span> </p> diff --git a/include/staff/dynamic-lists.inc.php b/include/staff/dynamic-lists.inc.php index ad5c6dfe9..fd4f7bf5b 100644 --- a/include/staff/dynamic-lists.inc.php +++ b/include/staff/dynamic-lists.inc.php @@ -1,7 +1,7 @@ -<div style="width:700;padding-top:5px; float:left;"> +<div class="pull-left" style="width:700;padding-top:5px;"> <h2><?php echo __('Custom Lists'); ?></h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> <b><a href="lists.php?a=add" class="Icon list-add"><?php echo __('Add New Custom List'); ?></a></b></div> <div class="clear"></div> @@ -84,10 +84,10 @@ if ($count) //Show options.. <div><?php echo __('Please confirm to continue.'); ?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="No, Cancel" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="Yes, Do it!" class="confirm"> </span> </p> diff --git a/include/staff/emails.inc.php b/include/staff/emails.inc.php index 862eb0b90..d2911eeee 100644 --- a/include/staff/emails.inc.php +++ b/include/staff/emails.inc.php @@ -42,10 +42,10 @@ else $showing=__('No emails found!'); ?> -<div style="width:700px;padding-top:5px; float:left;"> +<div class="pull-left" style="width:700px;padding-top:5px;"> <h2><?php echo __('Email Addresses');?></h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> <b><a href="emails.php?a=add" class="Icon newEmail"><?php echo __('Add New Email');?></a></b></div> <div class="clear"></div> <form action="emails.php" method="POST" name="emails"> @@ -84,7 +84,7 @@ else <input type="checkbox" class="ckb" name="ids[]" value="<?php echo $row['email_id']; ?>" <?php echo $sel?'checked="checked"':''; ?> <?php echo $default?'disabled="disabled"':''; ?>> </td> - <td><a href="emails.php?id=<?php echo $row['email_id']; ?>"><?php echo Format::htmlchars($email); ?></a> </td> + <td><span class="ltr"><a href="emails.php?id=<?php echo $row['email_id']; ?>"><?php echo Format::htmlchars($email); ?></a></span></td> <td><?php echo $row['priority']; ?></td> <td><a href="departments.php?id=<?php echo $row['dept_id']; ?>"><?php echo $row['department']; ?></a></td> <td> <?php echo Format::db_date($row['created']); ?></td> @@ -131,10 +131,10 @@ endif; <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/faq-categories.inc.php b/include/staff/faq-categories.inc.php index 9f7ee3d3a..7ccfc7720 100644 --- a/include/staff/faq-categories.inc.php +++ b/include/staff/faq-categories.inc.php @@ -2,7 +2,7 @@ if(!defined('OSTSTAFFINC') || !$thisstaff) die('Access Denied'); ?> -<h2><?php echo __('Frequently Asked Questions');?></h2> +<h2><?php echo __('Frequently Asked Questions');?> <i class="help-tip icon-question-sign" href="#page_header"></i></h2> <form id="kbSearch" action="kb.php" method="get"> <input type="hidden" name="a" value="search"> diff --git a/include/staff/faq-category.inc.php b/include/staff/faq-category.inc.php index d020fa899..8622a44ab 100644 --- a/include/staff/faq-category.inc.php +++ b/include/staff/faq-category.inc.php @@ -2,10 +2,10 @@ if(!defined('OSTSTAFFINC') || !$category || !$thisstaff) die('Access Denied'); ?> -<div style="width:700px;padding-top:10px; float:left;"> +<div class="pull-left" style="width:700px;padding-top:10px;"> <h2><?php echo __('Frequently Asked Questions');?></h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> </div> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> </div> <div class="clear"></div> <br> <div> diff --git a/include/staff/faq-view.inc.php b/include/staff/faq-view.inc.php index 57fbbb9ff..c7c242f2c 100644 --- a/include/staff/faq-view.inc.php +++ b/include/staff/faq-view.inc.php @@ -10,10 +10,10 @@ $category=$faq->getCategory(); » <a href="kb.php?cid=<?php echo $category->getId(); ?>"><?php echo $category->getName(); ?></a> <span class="faded">(<?php echo $category->isPublic()?__('Public'):__('Internal'); ?>)</span> </div> -<div style="width:700px;padding-top:2px; float:left;"> +<div class="pull-left" style="width:700px;padding-top:2px;"> <strong style="font-size:16px;"><?php echo $faq->getQuestion() ?></strong> <span class="faded"><?php echo $faq->isPublished()?__('(Published)'):''; ?></span> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> <?php if($thisstaff->canManageFAQ()) { echo sprintf('<a href="faq.php?id=%d&a=edit" class="Icon newHelpTopic">'.__('Edit FAQ').'</a>', diff --git a/include/staff/filter.inc.php b/include/staff/filter.inc.php index 772236075..40802ec3b 100644 --- a/include/staff/filter.inc.php +++ b/include/staff/filter.inc.php @@ -148,15 +148,15 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); foreach($match_types as $k=>$v){ $sel=($info["rule_h$i"]==$k)?'selected="selected"':''; echo sprintf('<option value="%s" %s>%s</option>', - $k,$sel,__($v)); + $k,$sel,$v); } ?> </select> - <input type="text" size="60" name="rule_v<?php echo $i; ?>" value="<?php echo $info["rule_v$i"]; ?>"> + <input class="ltr" type="text" size="60" name="rule_v<?php echo $i; ?>" value="<?php echo $info["rule_v$i"]; ?>"> <span class="error"> <?php echo $errors["rule_$i"]; ?></span> <?php if($info["rule_w$i"] || $info["rule_h$i"] || $info["rule_v$i"]){ ?> - <div style="float:right;text-align:right;padding-right:20px;"><a href="#" class="clearrule">(<?php echo __('clear');?>)</a></div> + <div class="pull-right" style="padding-right:20px;"><a href="#" class="clearrule">(<?php echo __('clear');?>)</a></div> <?php } ?> </div> diff --git a/include/staff/filters.inc.php b/include/staff/filters.inc.php index e3cf17a93..60da7230b 100644 --- a/include/staff/filters.inc.php +++ b/include/staff/filters.inc.php @@ -44,10 +44,10 @@ else ?> -<div style="width:700px;padding-top:5px; float:left;"> +<div class="pull-left" style="width:700px;padding-top:5px;"> <h2><?php echo __('Ticket Filters');?></h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> <b><a href="filters.php?a=add" class="Icon newEmailFilter"><?php echo __('Add New Filter');?></a></b></div> <div class="clear"></div> <form action="filters.php" method="POST" name="filters"> @@ -140,10 +140,10 @@ endif; <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/groups.inc.php b/include/staff/groups.inc.php index 12331a99b..538ee9510 100644 --- a/include/staff/groups.inc.php +++ b/include/staff/groups.inc.php @@ -39,12 +39,12 @@ else $showing=__('No groups found!'); ?> -<div style="width:700px;padding-top:5px; float:left;"> - <h2><?php echo __('Agent Groups');?></h2> +<div class="pull-left" style="width:700px;padding-top:5px;"> + <h2><?php echo __('Agent Groups');?> <i class="help-tip icon-question-sign" href="#groups"></i> </h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> <b><a href="groups.php?a=add" class="Icon newgroup"><?php echo __('Add New Group');?></a></b></div> <div class="clear"></div> <form action="groups.php" method="POST" name="groups"> @@ -141,10 +141,10 @@ endif; <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/header.inc.php b/include/staff/header.inc.php index 3499e2dd7..1185f2e19 100644 --- a/include/staff/header.inc.php +++ b/include/staff/header.inc.php @@ -1,6 +1,11 @@ <?php if (!isset($_SERVER['HTTP_X_PJAX'])) { ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html> +<html <?php +if ($thisstaff && ($lang = $thisstaff->getLanguage()) + && ($info = Internationalization::getLanguageInfo($lang)) + && (@$info['direction'] == 'rtl')) + echo 'dir="rtl" class="rtl"'; +?>> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> @@ -35,6 +40,7 @@ <![endif]--> <link type="text/css" rel="stylesheet" href="./css/dropdown.css"> <link type="text/css" rel="stylesheet" href="<?php echo ROOT_PATH; ?>css/loadingbar.css"/> + <link type="text/css" rel="stylesheet" href="<?php echo ROOT_PATH; ?>css/rtl.css"/> <script type="text/javascript" src="./js/jquery.dropdown.js"></script> <?php diff --git a/include/staff/helptopics.inc.php b/include/staff/helptopics.inc.php index 5533a01d1..a01762aa4 100644 --- a/include/staff/helptopics.inc.php +++ b/include/staff/helptopics.inc.php @@ -31,10 +31,10 @@ if ($cfg->getTopicSortMode() == 'a') usort($topics, function($a, $b) { return strcmp($a['name'], $b['name']); }); ?> -<div style="width:700px;padding-top:5px; float:left;"> +<div class="pull-left" style="width:700px;padding-top:5px;"> <h2><?php echo __('Help Topics');?></h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> <b><a href="helptopics.php?a=add" class="Icon newHelpTopic"><?php echo __('Add New Help Topic');?></a></b></div> <div class="clear"></div> <form action="helptopics.php" method="POST" name="topics"> @@ -42,9 +42,9 @@ if ($cfg->getTopicSortMode() == 'a') <input type="hidden" name="do" value="mass_process" > <input type="hidden" id="action" name="a" value="sort" > <table class="list" border="0" cellspacing="1" cellpadding="0" width="940"> - <caption><span style="display:inline-block;vertical-align:middle"><?php + <caption><span class="pull-left" style="display:inline-block;vertical-align:middle"><?php echo $showing; ?></span> - <div class="pull-right"><?php echo _('Sorting Mode'); ?>: + <div class="pull-right"><?php echo __('Sorting Mode'); ?>: <select name="help_topic_sort_mode" onchange="javascript: var $form = $(this).closest('form'); $form.find('input[name=a]').val('sort'); @@ -160,10 +160,10 @@ endif; <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/orgs.inc.php b/include/staff/orgs.inc.php index f9662f70a..7f81447f6 100644 --- a/include/staff/orgs.inc.php +++ b/include/staff/orgs.inc.php @@ -71,7 +71,7 @@ $qhash = md5($query); $_SESSION['orgs_qs_'.$qhash] = $query; ?> <h2><?php echo __('Organizations'); ?></h2> -<div style="width:700px; float:left;"> +<div class="pull-left" style="width:700px;"> <form action="orgs.php" method="get"> <?php csrf_token(); ?> <input type="hidden" name="a" value="search"> @@ -85,7 +85,7 @@ $_SESSION['orgs_qs_'.$qhash] = $query; </table> </form> </div> - <div style="float:right;text-align:right;padding-right:5px;"> + <div class="pull-right flush-right"> <b><a href="#orgs/add" class="Icon newDepartment add-org"><?php echo __('Add New Organization'); ?></a></b></div> <div class="clear"></div> diff --git a/include/staff/pages.inc.php b/include/staff/pages.inc.php index 513e33dee..a98fca84f 100644 --- a/include/staff/pages.inc.php +++ b/include/staff/pages.inc.php @@ -48,12 +48,12 @@ else ?> -<div style="width:700px;padding-top:5px; float:left;"> +<div class="pull-left" style="width:700px;padding-top:5px;"> <h2><?php echo __('Site Pages'); ?> <i class="help-tip icon-question-sign" href="#site_pages"></i> </h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> <b><a href="pages.php?a=add" class="Icon newPage"><?php echo __('Add New Page'); ?></a></b></div> <div class="clear"></div> <form action="pages.php" method="POST" name="tpls"> @@ -148,10 +148,10 @@ endif; <div><?php echo __('Please confirm to continue.'); ?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="No, Cancel" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="Yes, Do it!" class="confirm"> </span> </p> diff --git a/include/staff/plugins.inc.php b/include/staff/plugins.inc.php index 66cdba50d..d550d34a9 100644 --- a/include/staff/plugins.inc.php +++ b/include/staff/plugins.inc.php @@ -1,7 +1,7 @@ -<div style="width:700;padding-top:5px; float:left;"> +<div class="pull-left" style="width:700;padding-top:5px;"> <h2><?php echo __('Currently Installed Plugins'); ?></h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> <b><a href="plugins.php?a=add" class="Icon form-add"><?php echo __('Add New Plugin'); ?></a></b></div> <div class="clear"></div> @@ -91,10 +91,10 @@ if ($count) //Show options.. <div><?php echo __('Please confirm to continue.'); ?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel'); ?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!'); ?>" class="confirm"> </span> </p> diff --git a/include/staff/settings-pages.inc.php b/include/staff/settings-pages.inc.php index 7487df0ad..eba678eba 100644 --- a/include/staff/settings-pages.inc.php +++ b/include/staff/settings-pages.inc.php @@ -177,10 +177,10 @@ $pages = Page::getPages(); <div><?php echo __('Please confirm to continue.'); ?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="No, Cancel" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="Yes, Do it!" class="confirm"> </span> </p> diff --git a/include/staff/settings-system.inc.php b/include/staff/settings-system.inc.php index 542eac3de..bb99bc5cc 100644 --- a/include/staff/settings-system.inc.php +++ b/include/staff/settings-system.inc.php @@ -3,7 +3,7 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) $gmtime = Misc::gmtime(); ?> -<h2><?php echo __('System Settings and Preferences');?> - <span>osTicket (<?php echo $cfg->getVersion(); ?>)</span></h2> +<h2><?php echo __('System Settings and Preferences');?> - <span class="ltr">osTicket (<?php echo $cfg->getVersion(); ?>)</span></h2> <form action="settings.php?t=system" method="post" id="save"> <?php csrf_token(); ?> <input type="hidden" name="t" value="system" > diff --git a/include/staff/slaplans.inc.php b/include/staff/slaplans.inc.php index 35e8ae85c..e6808db4a 100644 --- a/include/staff/slaplans.inc.php +++ b/include/staff/slaplans.inc.php @@ -41,10 +41,10 @@ else ?> -<div style="width:700px;padding-top:5px; float:left;"> +<div class="pull-left" style="width:700px;padding-top:5px;"> <h2><?php echo __('Service Level Agreements');?></h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> <b><a href="slas.php?a=add" class="Icon newsla"><?php echo __('Add New SLA Plan');?></a></b></div> <div class="clear"></div> <form action="slas.php" method="POST" name="slas"> @@ -139,10 +139,10 @@ endif; <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/staffmembers.inc.php b/include/staff/staffmembers.inc.php index c3d1bdf45..acec392d4 100644 --- a/include/staff/staffmembers.inc.php +++ b/include/staff/staffmembers.inc.php @@ -55,7 +55,7 @@ $query="$select $from $where GROUP BY staff.staff_id ORDER BY $order_by LIMIT ". //echo $query; ?> <h2><?php echo __('Agents');?></h2> -<div style="width:700px; float:left;"> +<div class="pull-left" style="width:700px;"> <form action="staff.php" method="GET" name="filter"> <input type="hidden" name="a" value="filter" > <select name="did" id="did"> @@ -106,7 +106,7 @@ $query="$select $from $where GROUP BY staff.staff_id ORDER BY $order_by LIMIT ". <input type="submit" name="submit" value="<?php echo __('Apply');?>"/> </form> </div> -<div style="float:right;text-align:right;padding-right:5px;"><b><a href="staff.php?a=add" class="Icon newstaff"><?php echo __('Add New Agent');?></a></b></div> +<div class="pull-right flush-right" style="padding-right:5px;"><b><a href="staff.php?a=add" class="Icon newstaff"><?php echo __('Add New Agent');?></a></b></div> <div class="clear"></div> <?php $res=db_query($query); @@ -205,10 +205,10 @@ endif; <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/syslogs.inc.php b/include/staff/syslogs.inc.php index 1909ecde1..e490e2a82 100644 --- a/include/staff/syslogs.inc.php +++ b/include/staff/syslogs.inc.php @@ -182,10 +182,10 @@ endif; <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/system.inc.php b/include/staff/system.inc.php index 46fcf64e8..e583f3391 100644 --- a/include/staff/system.inc.php +++ b/include/staff/system.inc.php @@ -13,13 +13,13 @@ $commit = GIT_VERSION != '$git' ? GIT_VERSION : ( </thead> <tbody> <tr><td><?php echo __('osTicket Version'); ?></td> - <td><?php echo sprintf("%s (%s)", THIS_VERSION, $commit); ?></td></tr> + <td><span class="ltr"><?php echo sprintf("%s (%s)", THIS_VERSION, $commit); ?></span></td></tr> <tr><td><?php echo __('Server Software'); ?></td> - <td><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td></tr> + <td><span class="ltr"><?php echo $_SERVER['SERVER_SOFTWARE']; ?></span></td></tr> <tr><td><?php echo __('PHP Version'); ?></td> - <td><?php echo phpversion(); ?></td></tr> + <td><span class="ltr"><?php echo phpversion(); ?></span></td></tr> <tr><td><?php echo __('MySQL Version'); ?></td> - <td><?php echo db_version(); ?></td></tr> + <td><span class="ltr"><?php echo db_version(); ?></span></td></tr> <tr><td><?php echo __('PHP Extensions'); ?></td> <td><table><tbody> @@ -61,9 +61,9 @@ $commit = GIT_VERSION != '$git' ? GIT_VERSION : ( <tr><td><i class="icon icon-<?php echo extension_loaded('mbstring')?'check':'warning-sign'; ?>"></i> </td><td> - <code>cgi.fix_pathinfo</code> = + <span class="ltr"><code>cgi.fix_pathinfo</code> = <?php echo ini_get('cgi.fix_pathinfo'); ?> - </td><td> + </span></td><td> <span class="faded"><?php echo __('"1" is recommended if AJAX is not working'); ?></span> </td></tr> </tbody></table></td></tr> diff --git a/include/staff/teams.inc.php b/include/staff/teams.inc.php index 4991765cf..62d415bfe 100644 --- a/include/staff/teams.inc.php +++ b/include/staff/teams.inc.php @@ -38,12 +38,12 @@ else $showing=__('No teams found!'); ?> -<div style="width:700px;padding-top:5px; float:left;"> - <h2><?php echo __('Teams');?></h2> +<div class="pull-left" style="width:700px;padding-top:5px;"> + <h2><?php echo __('Teams');?> <i class="help-tip icon-question-sign" href="#teams"></i> </h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> <b><a href="teams.php?a=add" class="Icon newteam"><?php echo __('Add New Team');?></a></b></div> <div class="clear"></div> <form action="teams.php" method="POST" name="teams"> @@ -137,10 +137,10 @@ endif; <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/templates.inc.php b/include/staff/templates.inc.php index edb7e96cc..946baccb3 100644 --- a/include/staff/templates.inc.php +++ b/include/staff/templates.inc.php @@ -42,10 +42,10 @@ else ?> -<div style="width:700px;padding-top:5px; float:left;"> +<div class="pull-left" style="width:700px;padding-top:5px;"> <h2><?php echo __('Email Template Sets'); ?></h2> </div> -<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;"> +<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;"> <b><a href="templates.php?a=add" class="Icon newEmailTemplate"><?php echo __('Add New Template Set'); ?></a></b></div> <div class="clear"></div> <form action="templates.php" method="POST" name="tpls"> @@ -139,10 +139,10 @@ endif; <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index 7860f18aa..1c0e31283 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -926,11 +926,11 @@ $tcount+= $ticket->getNumNotes(); </fieldset> <hr style="margin-top:3em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="reset" value="<?php echo __('Reset');?>"> <input type="button" value="<?php echo __('Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="submit" value="<?php echo __('Print');?>"> </span> </p> @@ -958,11 +958,11 @@ $tcount+= $ticket->getNumNotes(); </fieldset> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="reset" value="<?php echo __('Reset');?>"> <input type="button" value="<?php echo __('Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="submit" value="<?php echo $ticket->isClosed()?__('Reopen'):__('Close'); ?>"> </span> </p> @@ -1015,10 +1015,10 @@ $tcount+= $ticket->getNumNotes(); <input type="hidden" name="do" id="action" value=""> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="submit" value="<?php echo __('OK');?>"> </span> </p> diff --git a/include/staff/tickets.inc.php b/include/staff/tickets.inc.php index f6044da73..8a427e1e1 100644 --- a/include/staff/tickets.inc.php +++ b/include/staff/tickets.inc.php @@ -312,7 +312,7 @@ if ($results) { <div style="margin-bottom:20px"> <form action="tickets.php" method="POST" name='tickets'> <?php csrf_token(); ?> - <a class="refresh" href="<?php echo Format::htmlchars($_SERVER['REQUEST_URI']); ?>"><?php echo __('Refresh'); ?></a> + <a class="refresh pull-right" href="<?php echo Format::htmlchars($_SERVER['REQUEST_URI']); ?>"><?php echo __('Refresh'); ?></a> <input type="hidden" name="a" value="mass_process" > <input type="hidden" name="do" id="action" value="" > <input type="hidden" name="status" value="<?php echo Format::htmlchars($_REQUEST['status']); ?>" > @@ -531,10 +531,10 @@ if ($results) { <div><?php echo __('Please confirm to continue.');?></div> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('No, Cancel');?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm"> </span> </p> diff --git a/include/staff/user-view.inc.php b/include/staff/user-view.inc.php index 5962bbf85..283528166 100644 --- a/include/staff/user-view.inc.php +++ b/include/staff/user-view.inc.php @@ -171,10 +171,10 @@ include STAFFINC_DIR . 'templates/notes.tmpl.php'; <input type="hidden" name="do" id="action" value=""> <hr style="margin-top:1em"/> <p class="full-width"> - <span class="buttons" style="float:left"> + <span class="buttons pull-left"> <input type="button" value="<?php echo __('Cancel'); ?>" class="close"> </span> - <span class="buttons" style="float:right"> + <span class="buttons pull-right"> <input type="submit" value="<?php echo __('OK'); ?>"> </span> </p> diff --git a/include/staff/users.inc.php b/include/staff/users.inc.php index 002546ac0..673a67ef7 100644 --- a/include/staff/users.inc.php +++ b/include/staff/users.inc.php @@ -74,7 +74,7 @@ $_SESSION['users_qs_'.$qhash] = $query; ?> <h2><?php echo __('User Directory'); ?></h2> -<div style="width:700px; float:left;"> +<div class="pull-left" style="width:700px;"> <form action="users.php" method="get"> <?php csrf_token(); ?> <input type="hidden" name="a" value="search"> @@ -82,13 +82,13 @@ $_SESSION['users_qs_'.$qhash] = $query; <tr> <td><input type="text" id="basic-user-search" name="query" size=30 value="<?php echo Format::htmlchars($_REQUEST['query']); ?>" autocomplete="off" autocorrect="off" autocapitalize="off"></td> - <td><input type="submit" name="basic_search" class="button" value="Search"></td> + <td><input type="submit" name="basic_search" class="button" value="<?php echo __('Search'); ?>"></td> <!-- <td> <a href="" id="advanced-user-search">[advanced]</a></td> --> </tr> </table> </form> </div> - <div style="float:right;text-align:right;padding-right:5px;"> + <div class="pull-right flush-right" style="padding-right:5px;"> <b><a href="#users/add" class="Icon newstaff popup-dialog"><?php echo __('Add User'); ?></a></b> | <b><a href="#users/import" class="popup-dialog"><i class="icon-cloud-upload icon-large"></i> diff --git a/scp/css/scp.css b/scp/css/scp.css index dcd6222fc..637783343 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -458,6 +458,7 @@ table.list thead th { color:#000; text-align:left; vertical-align:top; + padding: 0 4px; } table.list th a { @@ -477,7 +478,7 @@ table.list tbody td { vertical-align:top; } -table.list tbody td { background: #fff; padding: 1px; padding-left:2px; vertical-align: top; } +table.list tbody td { background: #fff; padding: 1px 3px; vertical-align: top; } table.list tbody tr:nth-child(2n+1) td { background-color: #f0faff; } table.list tbody tr:hover td { background: #ffe; } table.list tbody tr:nth-child(2n+1):hover td { background: #ffd; } @@ -1863,3 +1864,13 @@ table.custom-info td { .delete-draft:hover { background-color: #fc9f41 !important; } +.pull-right { + float: right; +} +.flush-right { + text-align: right; +} +.ltr { + direction: ltr; + unicode-bidi: embed; +} -- GitLab