Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "smartling/wordpress-connector",
"license": "GPL-2.0-or-later",
"version": "5.5.0",
"version": "5.5.1",
"description": "",
"type": "wordpress-plugin",
"repositories": [
Expand Down
263 changes: 124 additions & 139 deletions inc/Smartling/WP/View/ContentEditJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,150 +91,135 @@
let globalButton;
</script>

<?php if ($needWrapper && false) : ?>
<div class="postbox-container" style="width: 550px">
<div id="panel-box" class="postbox hndle"><h2><span>Translate content</span></h2>
<div class="inside">
<?php endif; ?>

<div class="job-wizard">
<div id="placeholder"><span class="loader"></span> Please wait...</div>
<div id="tab-existing" class="tab-content hidden">
<div id="job-tabs">
<span class="active" data-action="new">New Job</span>
<span data-action="existing">Existing Job</span>
<?= $isBulkSubmitPage ? '' : '<span data-action="clone">Clone</span>'?>
</div>
<table>
<tr id="jobList" class="hidden hideWhenCloning">
<th>
<label for="jobSelect">Existing jobs</label>
</th>
<td>
<select id="jobSelect"></select>
</td>
</tr>
<tr class="hideWhenCloning">
<th><label for="name-sm">Name</label></th>
<td><input id="name-sm" name="jobName" type="text"/></td>
</tr>
<tr class="hideWhenCloning">
<th><label for="description-sm">Description</label</th>
<td><textarea id="description-sm" name="description-sm"></textarea></td>
</tr>
<tr class="hideWhenCloning">
<th><label for="dueDate">Due Date</label</th>
<td><input type="text" id="dueDate" name="dueDate"/></td>
</tr>
<tr class="hideWhenCloning">
<th><label for="cbAuthorize">Authorize Job</label</th>
<td><input type="checkbox" class="authorize" id="cbAuthorize"
name="cbAuthorize" <?= $profile->getAutoAuthorize() ? 'checked="checked"' : '' ?>/>
</td>
</tr>

<?php
$contentType = $data['contentType'];

$locales = $profile->getTargetLocales();
ArrayHelper::sortLocales($locales);
?>
<tr>
<th>Target Locales</th>
<td>
<div>
<?= WPAbstract::checkUncheckBlock($widgetName) ?>
</div>
<div class="locale-list">
<?php

$localeList = [];

foreach ($locales as $locale) {
if (!$locale->isEnabled()) {
continue;
}

$localeList[] = $locale->getBlogId();
?>
<p class="locale-list">
<?= WPAbstract::localeSelectionCheckboxBlock(
$widgetName,
$locale->getBlogId(),
$locale->getLabel(),
false,
true,
'',
[
'data-smartling-locale' => $locale->getSmartlingLocale(),
]
) ?>
</p>
<?php } ?>
<script>
var localeList = "<?= implode(',', $localeList)?>";
</script>
</div>
</td>
</tr>
<tr>
<th>Related content</th>
<td>
<?= HtmlTagGeneratorHelper::tag(
'select',
HtmlTagGeneratorHelper::renderSelectOptions(
GlobalSettingsManager::getRelatedContentSelectState(),
<div class="job-wizard">
<div id="placeholder"><span class="loader"></span> Please wait...</div>
<div id="tab-existing" class="tab-content hidden">
<div id="job-tabs">
<span class="active" data-action="new">New Job</span>
<span data-action="existing">Existing Job</span>
<?= $isBulkSubmitPage ? '' : '<span data-action="clone">Clone</span>'?>
</div>
<table>
<tr id="jobList" class="hidden hideWhenCloning">
<th>
<label for="jobSelect">Existing jobs</label>
</th>
<td>
<select id="jobSelect"></select>
</td>
</tr>
<tr class="hideWhenCloning">
<th><label for="name-sm">Name</label></th>
<td><input id="name-sm" name="jobName" type="text"/></td>
</tr>
<tr class="hideWhenCloning">
<th><label for="description-sm">Description</label</th>
<td><textarea id="description-sm" name="description-sm"></textarea></td>
</tr>
<tr class="hideWhenCloning">
<th><label for="dueDate">Due Date</label</th>
<td><input type="text" id="dueDate" name="dueDate"/></td>
</tr>
<tr class="hideWhenCloning">
<th><label for="cbAuthorize">Authorize Job</label</th>
<td><input type="checkbox" class="authorize" id="cbAuthorize"
name="cbAuthorize" <?= $profile->getAutoAuthorize() ? 'checked="checked"' : '' ?>/>
</td>
</tr>

<?php
$contentType = $data['contentType'];

$locales = $profile->getTargetLocales();
ArrayHelper::sortLocales($locales);
?>
<tr>
<th>Target Locales</th>
<td>
<div>
<?= WPAbstract::checkUncheckBlock($widgetName) ?>
</div>
<div class="locale-list">
<?php

$localeList = [];

foreach ($locales as $locale) {
if (!$locale->isEnabled()) {
continue;
}

$localeList[] = $locale->getBlogId();
?>
<p class="locale-list">
<?= WPAbstract::localeSelectionCheckboxBlock(
$widgetName,
$locale->getBlogId(),
$locale->getLabel(),
false,
true,
'',
[
0 => 'Don\'t send related content',
1 => 'Send related content one level deep',
2 => 'Send related content two levels deep',
'data-smartling-locale' => $locale->getSmartlingLocale(),
]
),
[
'id' => 'depth',
'name' => 'depth',
],
)?>
</td>
</tr>
<tr id="relationsInfo">
<th>Related content to be uploaded:</th>
<td id="relatedContent">
</td>
</tr>
<tr>
<th class="center" colspan="2">
<div id="error-messages"></div>
<div id="progress-indicator" class="hidden" style="margin: 10px 0;">
<div style="background: #f0f0f0; border-radius: 4px; overflow: hidden; height: 20px;">
<div id="progress-bar" style="background: #2271b1; height: 100%; width: 0; transition: width 0.3s;"></div>
</div>
<div id="progress-text" style="margin-top: 5px; font-size: 12px;"></div>
</div>
<div id="loader-image" class="hidden"><span class="loader"></span></div>
<button class="button button-primary components-button is-primary" id="createJob"
title="Create a new job and add content into it">Create Job
</button>
<button class="button button-primary components-button is-primary hidden" id="addToJob"
title="Add content into your chosen job">Add to selected Job
</button>
<button class="button button-primary components-button is-primary hidden" id="cloneButton">Clone</button>
</th>
</tr>
<input type="hidden" id="timezone-sm" name="timezone-sm" value="UTC"/>
</table>

</div>


</div>

<?php if ($needWrapper) : ?>
) ?>
</p>
<?php } ?>
<script>
var localeList = "<?= implode(',', $localeList)?>";
</script>
</div>
</td>
</tr>
<tr>
<th>Related content</th>
<td>
<?= HtmlTagGeneratorHelper::tag(
'select',
HtmlTagGeneratorHelper::renderSelectOptions(
GlobalSettingsManager::getRelatedContentSelectState(),
[
0 => 'Don\'t send related content',
1 => 'Send related content one level deep',
2 => 'Send related content two levels deep',
]
),
[
'id' => 'depth',
'name' => 'depth',
],
)?>
</td>
</tr>
<tr id="relationsInfo">
<th>Related content to be uploaded:</th>
<td id="relatedContent">
</td>
</tr>
<tr>
<th class="center" colspan="2">
<div id="error-messages"></div>
<div id="progress-indicator" class="hidden" style="margin: 10px 0;">
<div style="background: #f0f0f0; border-radius: 4px; overflow: hidden; height: 20px;">
<div id="progress-bar" style="background: #2271b1; height: 100%; width: 0; transition: width 0.3s;"></div>
</div>
<div id="progress-text" style="margin-top: 5px; font-size: 12px;"></div>
</div>
<div id="loader-image" class="hidden"><span class="loader"></span></div>
<button class="button button-primary components-button is-primary" id="createJob"
title="Create a new job and add content into it">Create Job
</button>
<button class="button button-primary components-button is-primary hidden" id="addToJob"
title="Add content into your chosen job">Add to selected Job
</button>
<button class="button button-primary components-button is-primary hidden" id="cloneButton">Clone</button>
</th>
</tr>
<input type="hidden" id="timezone-sm" name="timezone-sm" value="UTC"/>
</table>
</div>
</div>
</div>
<?php endif; ?>


<?php
$id = 0;
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: translation, localization, multilingual, internationalization, smartling
Requires at least: 5.5
Tested up to: 6.9
Requires PHP: 8.0
Stable tag: 5.5.0
Stable tag: 5.5.1
License: GPLv2 or later

Translate content in WordPress quickly and seamlessly with Smartling, the industry-leading Translation Management System.
Expand Down Expand Up @@ -62,6 +62,9 @@ Additional information on the Smartling Connector for WordPress can be found [he
3. Track translation status within WordPress from the Submissions Board. View overall progress of submitted translation requests as well as resend updated content.

== Changelog ==
= 5.5.1 =
* Fixed broken HTML in the content edit view that prevented WordPress postboxes below the Smartling box from opening after the Smartling box was collapsed

= 5.5.0 =
* Reworked ACF configuration ingestion to improve image attachments not being found in ACF fields nested in repeater, group, or flexible_content layouts

Expand Down
4 changes: 2 additions & 2 deletions smartling-connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Smartling Connector
* Plugin URI: https://www.smartling.com/products/automate/integrations/wordpress/
* Description: Integrate your WordPress site with Smartling to upload your content and download translations.
* Version: 5.5.0
* Version: 5.5.1
* Author: Smartling
* Author URI: https://www.smartling.com
* License: GPL-2.0+
Expand All @@ -20,7 +20,7 @@
* Text Domain: smartling-connector
* Domain Path: /languages
* Requires PHP: 8.0
* Elementor tested up to: 3.20.2
* Elementor tested up to: 4.0.4
*/

// If this file is called directly, abort.
Expand Down
Loading