Skip to content
Permalink
Browse files

show cache desc languages as native names; updates #109

  • Loading branch information...
following5 committed Aug 18, 2015
1 parent 58e789b commit 9d4f4dd3eb0c8ef359a0576d3b2d609093937e0b
@@ -528,6 +528,12 @@ function dbv_130() // discarded text editor mode (#236)
sql("ALTER TABLE `user` CHANGE COLUMN `no_htmledit_flag` `no_htmledit_flag` tinyint(1) NOT NULL default '0' COMMENT 'inverted meaning'");
}
function dbv_131() // add native language names (#109)
{
if (!sql_field_exists('languages','native'))
sql("ALTER TABLE `languages` ADD COLUMN `native_name` VARCHAR(60) NOT NULL AFTER `trans_id`");
}
// When adding new mutations, take care that they behave well if run multiple
// times. This improves robustness of database versioning.

Large diffs are not rendered by default.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -17,7 +17,7 @@
$error_wrong_node = t('This description has been created on another Opencaching website. The cache can only be edited there.');
$show_all_langs_submit = '&nbsp;<input type="submit" name="show_all_langs" value="' . t('Show all') . '" />';
$show_all_langs_submit = '&nbsp;<input type="submit" name="show_all_langs" value="' . t('Show all') . '" class="formbutton" onclick="submitbutton(\'show_all_langs\')" />';
$error_desc_not_found = t('(internal error) The description is not available.');
$error_desc_exists = t('(internal error) It already exists a description for this language.');
@@ -43,7 +43,8 @@
<td>
<select name="desclang">
{desclangs}
</select>{show_all_langs_submit}
</select>
{show_all_langs_submit}
</td>
</tr>
<tr><td class="spacer" colspan="2"></td></tr>
@@ -19,5 +19,5 @@
$default_lang = t('EN');
$lang_message = '<br/><span class="errormsg">' . t('There already exists a description in this language') . '</span>';
$show_all_langs_submit = '<input type="submit" name="show_all_langs_submit" value="' . t('Show all') . '"/>';
$show_all_langs_submit = '&nbsp;<input type="submit" name="show_all_langs_submit" value="' . t('Show all') . '" class="formbutton" onclick="submitbutton(\'show_all_langs_submit\')" />';
?>
@@ -336,22 +336,20 @@ function showalllists()
<!-- Description -->
<div class="content2-container bg-blue02">
<p class="content-title-noshade-size2">
<img src="resource2/{$opt.template.style}/images/description/22x22-description.png" style="margin-right: 10px;" width="22" height="22" alt="{t}Description{/t}" /> {t}Description{/t}&nbsp;&nbsp;
<img src="resource2/{$opt.template.style}/images/description/22x22-description.png" style="margin-right: 10px;" width="22" height="22" alt="{t}Description{/t}" /> {t}Description{/t}&nbsp;&nbsp;&nbsp;
<span class="content-title-link" style="font-weight:bold" >
{foreach from=$cache.desclanguages item=desclanguagesItem name=desclanguagesItem}
{strip}
{if $smarty.foreach.desclanguagesItem.first==false},&nbsp;{/if}
<img src="images/flags/{$desclanguagesItem|lower}.gif" style="vertical-align:middle" />&nbsp;
<a href="viewcache.php?wp={$cache.wpoc}&desclang={$desclanguagesItem|escape}">
{if $cache.desclanguage==$desclanguagesItem}
<i>{$desclanguagesItem|escape}</i>
{else}
{$desclanguagesItem|escape}
{if $smarty.foreach.desclanguagesItem.first==false} &nbsp;&middot;&nbsp; {/if}
{if $cache.desclanguage==$desclanguagesItem.code}
<span class="txt-black" >{$desclanguagesItem.native_name|escape}</span>
{if $desclanguagesItem.name != $desclanguagesItem.native_name}
<span style="font-weight:normal" class="txt-black">({$desclanguagesItem.name})</span>
{/if}
</a>
{/strip}
{foreachelse}
<b>{$cache.desclanguage|escape}</b>
{/foreach}
{else}
<a href="viewcache.php?wp={$cache.wpoc}&desclang={$desclanguagesItem.code|escape}" class="systemlink" title="{$desclanguagesItem.name}" >{$desclanguagesItem.native_name|escape}</a>
{/if}
{/foreach}
</span>
</p>
</div>
@@ -175,7 +175,18 @@ function getChildWaypoints($cacheid)
$rCache['adminlog'] = !$rCache['log_allowed'] && ($login->admin & ADMIN_USER);
$rCache['desclanguages'] = explode(',', $rCache['desclanguages']);
$rs = sql("
SELECT `short` `code`, `native_name`, `stt`.`text` AS `name`
FROM `languages`
JOIN `cache_desc` ON `cache_desc`.`language`=`languages`.`short`
LEFT JOIN `sys_trans_text` `stt` ON `stt`.`trans_id`=`languages`.`trans_id` AND `stt`.`lang`='&2'
WHERE `cache_desc`.`cache_id`='&1'",
$cacheid, $opt['template']['locale']);
$desclanguages = sql_fetch_assoc_table($rs);
if (count($desclanguages) == 1 && $desclanguages[0]['code'] == $opt['template']['locale'])
$rCache['desclanguages'] = array();
else
$rCache['desclanguages'] = $desclanguages;
$rCache['sizeName'] = labels::getLabelValue('cache_size', $rCache['size']);
$rCache['statusName'] = labels::getLabelValue('cache_status', $rCache['status']);

0 comments on commit 9d4f4dd

Please sign in to comment.
You can’t perform that action at this time.