Skip to content

Commit 607c101

Browse files
committed
Merge branch 'Farsi-Translation' into pocket-size
2 parents eb0eb97 + 1d279fe commit 607c101

34 files changed

+3043
-437
lines changed

admin/class-bread-admin.php

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function enqueue_styles($hook)
7272
wp_enqueue_style("tooltipster", plugin_dir_url(__FILE__) . "css/tooltipster.bundle.min.css", false, "1.2", 'all');
7373
wp_enqueue_style("tooltipster-noir", plugin_dir_url(__FILE__) . "css/tooltipster-sideTip-noir.min.css", false, "1.2", 'all');
7474
wp_enqueue_style("admin", plugin_dir_url(__FILE__) . "css/admin.css", false, "1.2", 'all');
75-
wp_enqueue_style("chosen", plugin_dir_url(__FILE__) . "css/chosen.min.css", false, "1.2", 'all');
75+
wp_enqueue_style("select2", plugin_dir_url(__FILE__) . "css/select2.min.css", false, "1.2", 'all');
7676
wp_enqueue_style("smartWizard-dots", plugin_dir_url(__FILE__) . "css/smart_wizard_dots.css", false, "6.0.6", 'all');
7777
}
7878

@@ -90,13 +90,13 @@ public function enqueue_scripts($hook)
9090
wp_enqueue_script('jquery-ui-tabs');
9191
wp_enqueue_script('jquery-ui-accordion');
9292
wp_enqueue_script('jquery-ui-dialog');
93-
wp_enqueue_script("bmlt_meeting_list", plugin_dir_url(__FILE__) . "js/bmlt_meeting_list.js", array('jquery'), "2.8.0", true);
93+
wp_enqueue_script("bmlt_meeting_list", plugin_dir_url(__FILE__) . "js/bmlt_meeting_list.js", array('jquery'), BREAD_VERSION, true);
9494
wp_enqueue_script("tooltipster", plugin_dir_url(__FILE__) . "js/tooltipster.bundle.min.js", array('jquery'), "1.2", true);
9595
wp_enqueue_script("spectrum", plugin_dir_url(__FILE__) . "js/spectrum.min.js", array('jquery'), "1.2", true);
96-
wp_enqueue_script("chosen", plugin_dir_url(__FILE__) . "js/chosen.jquery.min.js", array('jquery'), "1.2", true);
96+
wp_enqueue_script("select2", plugin_dir_url(__FILE__) . "js/select2.min.js", array('jquery'), "1.2", true);
9797
wp_enqueue_script("fetch-jsonp", plugin_dir_url(__FILE__) . "js/fetch-jsonp.js", array('jquery'), "1.30", true);
9898
wp_enqueue_script("smartWizard", plugin_dir_url(__FILE__) . "js/jquery.smartWizard.js", array('jquery'), "6.0.6", true);
99-
wp_enqueue_script("breadWizard", plugin_dir_url(__FILE__) . "js/bread-wizard.js", array('smartWizard'), "2.8.0", true);
99+
wp_enqueue_script("breadWizard", plugin_dir_url(__FILE__) . "js/bread-wizard.js", array('smartWizard'), BREAD_VERSION, true);
100100
/**
101101
* Make some JSON from PHP available in JS.
102102
*/
@@ -249,9 +249,6 @@ function pwsix_process_settings_export()
249249
if (!isset($_POST['pwsix_export_nonce']) || ! wp_verify_nonce($_POST['pwsix_export_nonce'], 'pwsix_export_nonce')) {
250250
return;
251251
}
252-
if (! current_user_can('manage_bread')) { // TODO: Is this necessary? Why not let the user make a copy
253-
return;
254-
}
255252
$this->download_settings_inner();
256253
}
257254
function download_settings()
@@ -318,13 +315,13 @@ function exportLogFile($file)
318315
}
319316
function current_user_can_modify()
320317
{
321-
if (! current_user_can('manage_bread')) {
322-
return false;
323-
}
324318
$user = wp_get_current_user();
325319
if (in_array('administrator', $user->roles)) {
326320
return true;
327321
}
322+
if (! current_user_can('manage_bread')) {
323+
return false;
324+
}
328325
$authors_safe = $this->bread->getOption('authors');
329326
if (!is_array($authors_safe) || empty($authors_safe)) {
330327
return true;
@@ -336,10 +333,17 @@ function current_user_can_modify()
336333
}
337334
function current_user_can_create()
338335
{
339-
if (! current_user_can('manage_bread')) {
340-
return false;
336+
$user = wp_get_current_user();
337+
if (in_array('administrator', $user->roles)) {
338+
return true;
339+
}
340+
if (current_user_can('manage_options')) {
341+
return true;
342+
}
343+
if (current_user_can('manage_bread')) {
344+
return true;
341345
}
342-
return true;
346+
return false;
343347
}
344348
/**
345349
* Process a settings import from a json file
@@ -349,7 +353,7 @@ function pwsix_process_settings_import()
349353
if (empty($_REQUEST['pwsix_import_nonce']) || !wp_verify_nonce($_REQUEST['pwsix_import_nonce'], 'pwsix_import_nonce')) {
350354
return;
351355
}
352-
if (! current_user_can('manage_bread')) {
356+
if (! $this->current_user_can_modify()) {
353357
return;
354358
}
355359
$this->bread->getConfigurationForSettingId($this->bread->getRequestedSetting());
@@ -377,7 +381,7 @@ function pwsix_process_settings_import()
377381
update_option($this->bread->getOptionsName(), $this->bread->getOptions());
378382
setcookie('current-meeting-list', $this->bread->getRequestedSetting(), time() + 10);
379383
setcookie('bread_import_file', $import_file, time() + 10);
380-
wp_safe_redirect(admin_url('?page=class-bread-admin.php'));
384+
wp_safe_redirect(admin_url('?page=bmlt-enabled-bread'));
381385
}
382386
function my_theme_add_editor_styles()
383387
{
@@ -434,11 +438,15 @@ function admin_submenu_link($parent_slug)
434438
Bread_activate();
435439
$this->bmltEnabled_admin->createMenu();
436440

441+
$cap = 'manage_options';
442+
if (!current_user_can($cap)) {
443+
$cap = 'manage_bread';
444+
}
437445
$this->hook = add_submenu_page(
438446
$parent_slug,
439447
'Printable Meeting Lists',
440448
'Printable Meeting Lists',
441-
'manage_bread',
449+
$cap,
442450
'bmlt-enabled-bread',
443451
array(&$this, 'admin_options_page'),
444452
2

admin/css/admin.css

Lines changed: 61 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.wpbody-content {
22
margin-top: 0;
3-
margin-left: 0;
4-
margin-right: 0;
3+
margin-inline-start: 0;
4+
margin-inline-end: 0;
55
height: 100%;
66
width: 100%;
77
}
@@ -34,7 +34,7 @@ and (orientation: portrait) {
3434
}
3535

3636
.ui-accordion .ui-accordion-icons {
37-
padding-left: 2.2em !important;
37+
padding-inline-start: 2.2em !important;
3838
}
3939
img.box-description {
4040
margin: 0px 10px 0px 10px;
@@ -123,12 +123,12 @@ div#meeting-list-tabs-wrapper li {
123123
margin-top: 1px;
124124
color: #FFF;
125125
float: right;
126-
margin-right: 20px;
126+
margin-inline-end: 20px;
127127
}
128128
#meeting-list-tabs .icon-question2 {
129129
margin-top: 1px;
130130
color: #FFF;
131-
margin-left: 5px;
131+
margin-inline-start: 5px;
132132
}
133133
#meeting-list-tabs .icon-question2:before {
134134
content: "\e6b7";
@@ -205,8 +205,8 @@ a img.alignleft {
205205

206206
a img.aligncenter {
207207
display: block;
208-
margin-left: auto;
209-
margin-right: auto
208+
margin-inline-start: auto;
209+
margin-inline-end: auto
210210
}
211211

212212
.wp-caption {
@@ -273,7 +273,7 @@ width:410px;
273273
vertical-align: top;
274274
border: solid 1px #D5D5D5;
275275
padding: 10px 15px;
276-
margin-left: 5px;
276+
margin-inline-start: 5px;
277277
margin-bottom: 10px;
278278
display: -webkit-inline-box;
279279
color: #999;
@@ -293,10 +293,10 @@ font-size: 22px;
293293
}
294294
.tooltipster-icon {
295295
cursor: help;
296-
margin-left: 10px;
296+
margin-inline-start: 10px;
297297
background: url("images/help-image2.png") no-repeat;
298298
color: rgba(0, 0, 0, 0);
299-
padding-right: 5px;
299+
padding-inline-end: 5px;
300300
}
301301
.mlg.dashicons-search:before
302302
{
@@ -322,17 +322,17 @@ color: #222;
322322
.ui-tabs.ui-tabs-vertical .ui-widget-header {
323323
border: none;
324324
}
325-
.ui-tabs.ui-tabs-vertical .ui-tabs-nav {
325+
.bmlt-ltr .ui-tabs.ui-tabs-vertical .ui-tabs-nav {
326326
float: left;
327327
width: 10em;
328328
background: #CCC;
329329
border-radius: 4px 0 0 4px;
330330
border-right: 1px solid gray;
331-
padding-right: 20px;
331+
padding-inline-end: 20px;
332332
padding-top: 7px;
333-
padding-left: 0;
333+
padding-inline-start: 0;
334334
}
335-
#meeting-list-tabs.ui-tabs.ui-tabs-vertical .ui-tabs-nav li {
335+
.bmlt-ltr #meeting-list-tabs.ui-tabs.ui-tabs-vertical .ui-tabs-nav li {
336336
clear: left;
337337
width: 100%;
338338
margin: 0.2em 0;
@@ -373,7 +373,7 @@ color: #000;
373373
#meeting-list-tabs.ui-tabs.ui-tabs-vertical .ui-tabs-nav li:last-child {
374374
margin-bottom: 10px;
375375
}
376-
#meeting-list-tabs.ui-tabs.ui-tabs-vertical .ui-tabs-panel {
376+
.bmlt-ltr #meeting-list-tabs.ui-tabs.ui-tabs-vertical .ui-tabs-panel {
377377
float: left;
378378
width: 50%;
379379
border-left: 0;
@@ -408,7 +408,7 @@ width: 4em !important;
408408
}
409409
.mce-listbox button {
410410
text-align: left;
411-
padding-right: 20px !important;
411+
padding-inline-end: 20px !important;
412412
position: relative;
413413
}
414414
/*
@@ -473,7 +473,7 @@ h3.help-accordion { background-color: #F5F5F5 !important; color: #000 !important
473473
z-index: 9999;
474474
background: url('images/saving.gif') 50% 50% no-repeat;
475475
}
476-
select.service_body_select {
476+
select.bread_service_body_select {
477477
width: 62%;
478478
max-width: 62%;
479479
}
@@ -496,13 +496,10 @@ select.service_body_select {
496496
.extra_meetings_label {
497497
margin-top: 10px;
498498
}
499-
.exactCenter { width:800px; height:800px; position: fixed; top: 50%; left: 50%; margin-top: -100px; margin-left: -100px; }
499+
.exactCenter { width:800px; height:800px; position: fixed; top: 50%; left: 50%; margin-top: -100px; margin-inline-start: -100px; }
500500
#extra_meetings * {
501501
font-family: 'Courier New', Courier, monospace !important;
502502
}
503-
.chosen-container-multi .chosen-choices li.search-field input[type=text] {
504-
width: 100% !important;
505-
}
506503
.step-description {
507504
margin: 10px;
508505
border: solid;
@@ -517,3 +514,46 @@ select.service_body_select {
517514
color: green;
518515
font-weight: bold;
519516
}
517+
518+
.bmlt-rtl .ui-tabs-vertical { width: 55em; }
519+
.bmlt-rtl .ui-tabs-vertical .ui-tabs-nav li a { display:block; }
520+
.bmlt-rtl .ui-tabs-vertical .ui-tabs-panel {
521+
direction:rtl;
522+
width: 60%;
523+
position: relative;
524+
float: right;
525+
}
526+
.bmlt-rtl .ui-tabs .ui-tabs-nav li a { float:none;}
527+
528+
.bmlt-rtl .ui-tabs-vertical .ui-tabs-nav {
529+
float: right;
530+
width: 10em;
531+
background: #CCC;
532+
border-radius: 4px 0 0 4px;
533+
border-right: 1px solid gray;
534+
padding-inline-end: 20px;
535+
padding-top: 7px;
536+
padding-inline-start: 0;
537+
}
538+
.bmlt-rtl .ui-tabs-vertical .ui-tabs-nav li {
539+
clear: right;
540+
width: 100%;
541+
margin: 0.2em 0;
542+
/* border: 1px solid gray; */
543+
/* border-width: 1px 1px 1px 1px; */
544+
/* border-radius: 4px 4px 4px 4px; */
545+
overflow: hidden;
546+
position: relative;
547+
left: -2px;
548+
z-index: 2;
549+
}
550+
.bmlt-rtl .ui-tabs .ui-tabs-nav li {
551+
float: right !important
552+
}
553+
.select2-container {
554+
width: 50% !important;
555+
}
556+
.nav-tab-wrapper {
557+
width: max-content !important;
558+
}
559+
.select2-search--inline { display: contents; } .select2-search__field:placeholder-shown { width: 100% !important; }

admin/css/chosen-sprite-2x.png

-738 Bytes
Binary file not shown.

admin/css/chosen-sprite.png

-538 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)