Skip to content

Commit

Permalink
Merge branch '4.8.6' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
philwareham committed May 18, 2021
2 parents e4f4ab6 + bde2df8 commit f8a5f5f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
1 change: 1 addition & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Changes in 4.8.6 (upcoming)
* Added: Latest text translations. Thank you to all our translators.
* Changed: <txp:variable trim> trims its own output (thanks, cara-tm).
* Changed: No Edit options in Write panel without appropriate privileges.
* Changed: No disabled update buttons on Languages panel (thanks, phiw13).
* Developer: New articles>multi_edit.$method callback on Articles list panel.
* Developer: Permit step=false to hook into explicit empty step callbacks and
step=null to indicate 'any step'.
Expand Down
41 changes: 23 additions & 18 deletions textpattern/include/txp_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,30 +153,35 @@ function list_languages($message = '')
}

$installLink = ($disabled
? span($btnText, array('class' => 'txp-button disabled'))
? ''
: tag($btnText, 'button', array(
'type' => 'submit',
'name' => 'get_language',
)));

$langMeta = graf(
($icon ? '<span class="ui-icon '.$icon.'" role="status">'.$status.'</span>' : '').n.
tag(gTxt($langdata['name']), 'strong', array('dir' => 'auto')).br.
tag($langname, 'code', array('dir' => 'ltr')).
($btnRemove && array_key_exists($langname, $langUse) ? n.$langUse[$langname] : '')
);

$btnSet = trim((has_privs('lang.edit')
? $installLink
: '')
.n. $btnRemove);

$grid .= tag(
form(
graf(
($icon ? '<span class="ui-icon '.$icon.'" role="status">'.$status.'</span>' : '').n.
tag(gTxt($langdata['name']), 'strong', array('dir' => 'auto')).br.
tag($langname, 'code', array('dir' => 'ltr')).
($btnRemove && array_key_exists($langname, $langUse) ? n.$langUse[$langname] : '')
).
graf(
(has_privs('lang.edit')
? $installLink
: '')
.n. $btnRemove
).
hInput('lang_code', $langname).
eInput('lang').
sInput(null)
, '', '', 'post'),
($btnSet
? form(
$langMeta.
graf($btnSet).
hInput('lang_code', $langname).
eInput('lang').
sInput(null)
, '', '', 'post')
: $langMeta
),
'li',
array('class' => 'txp-grid-cell txp-grid-cell-2span'.($cellclass ? ' '.$cellclass : ''))
).n;
Expand Down

0 comments on commit f8a5f5f

Please sign in to comment.