Commit 7d59832b authored by ricks99's avatar ricks99

[ENH] UI enhancements for the translation notification when a user clicks EDIT...

[ENH] UI enhancements for the translation notification when a user clicks EDIT for a page who's translation is in progress. Removes the module box and title, show page language as primary info. Tx to Alain D. for input and suggestions.
parent 10d0b669
......@@ -37,6 +37,16 @@ function filter_languages_from_pivot( $langInfo ) {
function module_translation( $mod_reference, $module_params ) {
global $pivotLanguage, $tikilib, $smarty, $prefs, $page, $_REQUEST;
//are we arriving from the edit page?
if ( $module_params['from_edit_page'] == 'y') {
$smarty->assign( 'from_edit_page', 'y');
} else {
$smarty->assign( 'from_edit_page', 'n');
}
if ((!$page or $page == '') and isset($_REQUEST['page'])) {
$page = $_REQUEST['page'];
}
......
......@@ -2,7 +2,6 @@
{assign var="default_diff_style" value="inlinediff" }
{if $show_translation_module}
{tikimodule error=$module_params.error title=$tpl_module_title name="translation" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle}
{if $trads|@count eq '1'}<p>{tr}There are no translations of this page.{/tr}<p>{/if}
......@@ -14,11 +13,17 @@
{/if}
{if $mod_translation_better_known or $mod_translation_better_other}
<div>
{if $from_edit_page ne 'y'}
{tr}Import from:{/tr}
{else}
{tr}To <strong>continue translating</strong>, select the language to translate from{/tr}:
{/if}
{if $mod_translation_better_known}
<ul>
{foreach item=better from=$mod_translation_better_known}
<li>
{if $from_edit_page eq 'y'}<a title="{tr}update from it{/tr}" href="tiki-editpage.php?page={if isset($stagingPageName) && $hasStaging == 'y'}{$stagingPageName|escape:'url'}{else}{$page|escape:'url'}{/if}&amp;source_page={$better.page|escape:'url'}&amp;oldver={$better.last_update|escape:'url'}&amp;newver={$better.current_version|escape:'url'}&amp;diff_style={$default_diff_style}">{icon _id=page_translate_from alt="{tr}update from it{/tr}" style="vertical-align:middle"} {$better.lang|langname}</a> ({$better.page|escape})
{else}
{if $tiki_p_edit eq 'y'}
<a href="tiki-editpage.php?page={if isset($stagingPageName) && $hasStaging == 'y'}{$stagingPageName|escape:'url'}{else}{$page|escape:'url'}{/if}&amp;source_page={$better.page|escape:'url'}&amp;oldver={$better.last_update|escape:'url'}&amp;newver={$better.current_version|escape:'url'}&amp;diff_style={$default_diff_style}">{icon _id=page_translate_from alt="{tr}update from it{/tr}" style="vertical-align:middle"}</a>
{/if}
......@@ -29,6 +34,7 @@
{else}
{$better.page|escape}</a> ({$better.lang})
{/if}
{/if}
</li>
{/foreach}
</ul>
......@@ -42,6 +48,9 @@
<ul id="mod-translation-better-ul"{if $prefs.change_language eq 'y'} style="display:none"{/if}>
{foreach item=better from=$mod_translation_better_other}
<li>
{if $from_edit_page eq 'y'}
<a title="{tr}update from it{/tr}" href="tiki-editpage.php?page={if isset($stagingPageName) && $hasStaging == 'y'}{$stagingPageName|escape:'url'}{else}{$page|escape:'url'}{/if}&amp;source_page={$better.page|escape:'url'}&amp;oldver={$better.last_update|escape:'url'}&amp;newver={$better.current_version|escape:'url'}&amp;{$default_diff_style}=htmldiff">{icon _id=page_translate_from alt="{tr}update from it{/tr}" style="vertical-align:middle"} {$better.lang|langname}</a> ({$better.page|escape})
{else}
{if $tiki_p_edit eq 'y'}
<a href="tiki-editpage.php?page={if isset($stagingPageName) && $hasStaging == 'y'}{$stagingPageName|escape:'url'}{else}{$page|escape:'url'}{/if}&amp;source_page={$better.page|escape:'url'}&amp;oldver={$better.last_update|escape:'url'}&amp;newver={$better.current_version|escape:'url'}&amp;{$default_diff_style}=htmldiff">{icon _id=page_translate_from alt="{tr}update from it{/tr}" style="vertical-align:middle"}</a>
{/if}
......@@ -52,12 +61,14 @@
{else}
{$better.page|escape}</a> ({$better.lang})
{/if}
{/if}
</li>
{/foreach}
</ul>
{/if}
</div><br />
{/if}
{if $from_edit_page ne 'y'}
{if $mod_translation_equivalent_known or $mod_translation_equivalent_other}
<div>
{tr}Equivalent translations:{/tr}
......@@ -142,5 +153,6 @@
{/if}
</div>
{/if}
{/if}
{/tikimodule}
{/if}
{remarksbox type="warning" title="{tr}This page is undergoing translation{/tr}"}
<p>
{tr}To <b>continue translating</b>, click on one of the translation icons below.{/tr}
{remarksbox type="warning" title="{tr}Translation of this page is incomplete.{/tr}"}
{$content_of_update_translation_section}
{tr}To make a <b>brand new change</b> to this page, use the editor below.{/tr}
<p>
<p>{tr}To add <strong>new content</strong> to the page{/tr} <strong>{$page}</strong>, {tr}use the editor{/tr}.</p>
{/remarksbox}
......@@ -104,8 +104,14 @@ function translationsToThisPageAreInProgress($page_id) {
function execute_module_translation() {
global $smarty;
// will show the language of the avialble translations. Chnage to 'n' to show the page name
$params['show_language'] = 'y';
// flag to indicate that the module is appearing within the notification area of the edit page
$params['from_edit_page'] = 'y';
$params['nobox'] = 'y';
$module_reference = array(
'name' => 'translation',
'params' => array( 'show_language' => $params['show_language'], 'from_edit_page' => $params['from_edit_page'], 'nobox' => $params['nobox'] )
);
global $modlib; require_once 'lib/modules/modlib.php';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment