Skip to content

Commit ae09f25

Browse files
committed
Remove Duplicate links if new content
Fixes #2045 and #2043.
1 parent 201cad6 commit ae09f25

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

textpattern/include/txp_article.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,10 +1795,10 @@ function article_partial_article_clone($rs)
17951795
{
17961796
extract($rs);
17971797

1798-
return n . tag('<span class="ui-icon ui-icon-copy" title="' . gTxt('duplicate') . '"></span>' . sp . gTxt('duplicate'), 'button', array(
1798+
return ($ID) ? n . tag('<span class="ui-icon ui-icon-copy" title="' . gTxt('duplicate') . '"></span>' . sp . gTxt('duplicate'), 'button', array(
17991799
'class' => 'txp-clone txp-reduced-ui-button',
18001800
'id' => 'article_partial_article_clone',
1801-
));
1801+
)) : '';
18021802
}
18031803

18041804
/**

textpattern/include/txp_link.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,15 @@ function link_edit($message = '')
481481
pluggable_ui('link_ui', 'extend_detail_form', '', $rs) .
482482
'<button type="submit" class="hidden"></button>' .
483483
graf(
484-
tag(
485-
'<span class="ui-icon ui-icon-copy" title="' . gTxt('duplicate') . '"></span>' . sp . gTxt('duplicate'), 'button',
486-
array(
487-
'class' => 'txp-clone txp-reduced-ui-button',
488-
'data-form' => 'link_details',
484+
($is_edit
485+
? tag(
486+
'<span class="ui-icon ui-icon-copy" title="' . gTxt('duplicate') . '"></span>' . sp . gTxt('duplicate'), 'button',
487+
array(
488+
'class' => 'txp-clone txp-reduced-ui-button',
489+
'data-form' => 'link_details',
490+
)
489491
)
492+
: ''
490493
) .
491494
sLink('link', '', gTxt('cancel'), 'txp-button') .
492495
fInput('submit', '', gTxt('save'), 'publish'),

0 commit comments

Comments
 (0)