Skip to content

Commit 1420f0a

Browse files
committed
New iteration of PHP code sniffing.
Moved linkes from HugoFara/lwt-fork to HugoFara/lwt. Links to "info.htm" moved to "info.php". Regenerated documentation.
1 parent df58e41 commit 1420f0a

82 files changed

Lines changed: 2045 additions & 1406 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> [Learning with Texts](https://sourceforge.net/projects/learning-with-texts) (LWT) is a tool for Language Learning using texts.
44
5-
This is an intricated fork by [@HugoFara](https://github.com/pirtleshell/lwt-fork). As a GitHub fork, it comes from [@chaosarium's fork (archived)](https://github.com/chaosarium/lwt-fork) of [@PirtleShell's fork](https://github.com/pirtleshell/lwt) of [@andreask7's fork](https://github.com/andreask7/lwt). It was also merged from the official LWT (as least until version 2.0.2), and many contributions from the community.
5+
This is an intricated fork by [@HugoFara](https://github.com/hugofara/lwt). As a GitHub fork, it comes from [@chaosarium's fork (archived)](https://github.com/chaosarium/lwt-fork) of [@PirtleShell's fork](https://github.com/pirtleshell/lwt) of [@andreask7's fork](https://github.com/andreask7/lwt). It was also merged from the official LWT (as least until version 2.0.2), and many contributions from the community.
66

77
This version is quicker than this official, has many features not found in the original. It also looks more likely to develop communally, whereas the original is not open for contributions.
88

@@ -37,7 +37,7 @@ IT DIFFERS IN MANY RESPECTS FROM THE OFFICIAL LWT-VERSION
3737
* Support for MeCab for Japanese word-by-word automatic translation
3838

3939
## Useful links
40-
* General documentation at [info.html](info.html).
40+
* General documentation at [ingo.phpl](ingo.phpl).
4141
* Please find more help at [docs/index.html](docs/index.html).
4242
* You can also contact the community by GitHub.
4343

‎ajax_edit_impr_text.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ function make_trans($i, $wid, $trans, $word, $lang)
138138
if(get_first_value(
139139
"select count(WoID) as value from " . $tbpref . "words where WoID = "
140140
. $id
141-
) < 1) { $id = '';
141+
) < 1
142+
) { $id = '';
142143
}
143144
}
144145
}

‎ajax_get_theme.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Learning with Texts (LWT) is a tool for Language Learning.
22

33
PLEASE READ MORE ...
4-
Either open ... info.htm (within the distribution)
4+
Either open ... info.php (within the distribution)
55
or open ... https://learning-with-texts.sourceforge.io
66

77
MOST UP-TO-DATE INSTALLATION INSTRUCTIONS can be found online:

‎bulk_translate_words.php‎

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
$tl=$_REQUEST["tl"];
1212
setcookie("googtrans", '/'.$sl.'/'.$tl, time() + 60, "/");
1313
}
14-
if(isset ($_REQUEST["offset"])) { $pos = $_REQUEST["offset"];
14+
if(isset($_REQUEST["offset"])) { $pos = $_REQUEST["offset"];
1515
}
1616
if (isset($_REQUEST['term'])) {
1717
$cnt=0;
@@ -88,67 +88,67 @@
8888
$('h3,h4,title').addClass('notranslate');
8989
$(window).load(function() {
9090
$('[name="form1"]').submit(function() {
91-
$('[name="WoTranslation"]').attr('name',$('[name="WoTranslation"]').attr('data_name'));
92-
window.parent.frames['ru'].location.href = 'empty.htm';
93-
return true;
91+
$('[name="WoTranslation"]').attr('name',$('[name="WoTranslation"]').attr('data_name'));
92+
window.parent.frames['ru'].location.href = 'empty.htm';
93+
return true;
9494
});
9595
$('td').hoverIntent({over: function() {$( this ).addClass('hover');}, out: function() {$( this ).removeClass('hover');}, interval: 150,selector:"span.dict1, span.dict2, span.dict3"});
9696

9797
$('td').on('click','span.dict1, span.dict2, span.dict3',function(){
98-
if($(this).hasClass( "dict1" ))WBLINK=WBLINK1;
99-
if($(this).hasClass( "dict2" ))WBLINK=WBLINK2;
100-
if($(this).hasClass( "dict3" ))WBLINK=WBLINK3;
101-
if((WBLINK.substr(0,8) == '*http://') || (WBLINK.substr(0,9) == '*https://')) {
102-
owin(createTheDictUrl(WBLINK.replace('*',''),$(this).parent().prev().text()));
103-
}
104-
else{
105-
window.parent.frames['ru'].location.href = createTheDictUrl(WBLINK,$(this).parent().prev().text());
106-
}
107-
$('[name="WoTranslation"]').attr('name',$('[name="WoTranslation"]').attr('data_name'));
108-
el=$(this).parent().parent().next().children();
109-
el.attr('data_name',el.attr('name'));
110-
el.attr('name','WoTranslation');
98+
if($(this).hasClass( "dict1" ))WBLINK=WBLINK1;
99+
if($(this).hasClass( "dict2" ))WBLINK=WBLINK2;
100+
if($(this).hasClass( "dict3" ))WBLINK=WBLINK3;
101+
if((WBLINK.substr(0,8) == '*http://') || (WBLINK.substr(0,9) == '*https://')) {
102+
owin(createTheDictUrl(WBLINK.replace('*',''),$(this).parent().prev().text()));
103+
}
104+
else{
105+
window.parent.frames['ru'].location.href = createTheDictUrl(WBLINK,$(this).parent().prev().text());
106+
}
107+
$('[name="WoTranslation"]').attr('name',$('[name="WoTranslation"]').attr('data_name'));
108+
el=$(this).parent().parent().next().children();
109+
el.attr('data_name',el.attr('name'));
110+
el.attr('name','WoTranslation');
111111
})
112112
.on('click','.del_trans',function(){$(this).prev().val('').focus();});
113-
var myVar = setInterval(function(){
114-
if( $( ".trans>font" ).length == $( ".trans" ).length){
115-
$('.trans').each(function() {
116-
var txt=$(this).text();
117-
var cnt= $(this).attr('id').replace('Trans_', '');
118-
$(this).addClass('notranslate').html('<input type="text" name="term[' + cnt + '][trans]" value="' + txt + '" maxlength="100" size="35"></input><div class="del_trans"></div>');
119-
});
120-
$('.term').each(function(){
121-
txt=$(this).text();
122-
$(this).parent().css('position','relative');
123-
$(this).after('<div class="dict"><?php if(!empty($wb1)) { echo '<span class="dict1">D1</span>';
113+
var myVar = setInterval(function(){
114+
if( $( ".trans>font" ).length == $( ".trans" ).length){
115+
$('.trans').each(function() {
116+
var txt=$(this).text();
117+
var cnt= $(this).attr('id').replace('Trans_', '');
118+
$(this).addClass('notranslate').html('<input type="text" name="term[' + cnt + '][trans]" value="' + txt + '" maxlength="100" size="35"></input><div class="del_trans"></div>');
119+
});
120+
$('.term').each(function(){
121+
txt=$(this).text();
122+
$(this).parent().css('position','relative');
123+
$(this).after('<div class="dict"><?php if(!empty($wb1)) { echo '<span class="dict1">D1</span>';
124124
}
125125
if(!empty($wb2)) { echo '<span class="dict2">D2</span>';
126126
}
127127
if(!empty($wb1)) { echo '<span class="dict3">GTr</span>';
128128
} ?></div>');
129-
});
130-
$('iframe,#google_translate_element').remove();
131-
selectToggle(true,'form1');
132-
$('[name^=term]').prop('disabled', false);
133-
clearInterval(myVar);
134-
}
135-
}, 300);
129+
});
130+
$('iframe,#google_translate_element').remove();
131+
selectToggle(true,'form1');
132+
$('[name^=term]').prop('disabled', false);
133+
clearInterval(myVar);
134+
}
135+
}, 300);
136136
});
137137
$(document).ready( function() {
138-
window.parent.frames['ru'].location.href = 'empty.htm';
139-
$('input[type="checkbox"]').change(function(){
140-
var v = parseInt($(this).val());
141-
var e = '[name=term\\[' + v + '\\]\\[text\\]],[name=term\\[' + v + '\\]\\[lg\\]],[name=term\\[' + v + '\\]\\[status\\]]';
142-
if(this.checked){
143-
$(e).prop('disabled', false);
144-
$('#Trans_'+v+' input').prop('disabled', false);
145-
if($('input[type="checkbox"]:checked').length){$('input[type="submit"]').val('Save');}
146-
}
147-
else{
148-
$(e).prop('disabled', true);$('#Trans_'+v+' input').prop('disabled', true);
149-
if(!$('input[type="checkbox"]:checked').length){if(!$('input[name="offset"]').length)v='End';else v='Next';$('input[type="submit"]').val(v);}
150-
}
151-
});
138+
window.parent.frames['ru'].location.href = 'empty.htm';
139+
$('input[type="checkbox"]').change(function(){
140+
var v = parseInt($(this).val());
141+
var e = '[name=term\\[' + v + '\\]\\[text\\]],[name=term\\[' + v + '\\]\\[lg\\]],[name=term\\[' + v + '\\]\\[status\\]]';
142+
if(this.checked){
143+
$(e).prop('disabled', false);
144+
$('#Trans_'+v+' input').prop('disabled', false);
145+
if($('input[type="checkbox"]:checked').length){$('input[type="submit"]').val('Save');}
146+
}
147+
else{
148+
$(e).prop('disabled', true);$('#Trans_'+v+' input').prop('disabled', true);
149+
if(!$('input[type="checkbox"]:checked').length){if(!$('input[name="offset"]').length)v='End';else v='Next';$('input[type="submit"]').val(v);}
150+
}
151+
});
152152
});
153153
function googleTranslateElementInit() {
154154
new google.translate.TranslateElement({pageLanguage: '<?php echo $sl; ?>', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, includedLanguages: '<?php echo $tl; ?>', autoDisplay: false}, 'google_translate_element');

‎dbutils.inc.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function runsql($sql, $m, $sqlerrdie = true)
8989

9090
/**
9191
* Returns the first line from the database
92+
*
9293
* @param String $sql MySQL query
9394
*/
9495
function get_first_value($sql)

‎delete_mword.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@
6464
if (! $showAll) { ?>
6565
$('*',sid).removeClass('hide');
6666
$('.mword', sid).each(function(){
67-
if($(this).not('.hide').length){
68-
u= parseInt($(this).attr('data_code')) *2 + parseInt($(this).attr('data_order')) -1;
69-
$(this).nextUntil('[id^="ID-' + u + '-"]',sid).addClass('hide');
70-
}
67+
if($(this).not('.hide').length){
68+
u= parseInt($(this).attr('data_code')) *2 + parseInt($(this).attr('data_order')) -1;
69+
$(this).nextUntil('[id^="ID-' + u + '-"]',sid).addClass('hide');
70+
}
7171
});
7272
<?php
7373
}

‎display_impr_text.php‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,43 +67,43 @@
6767
-webkit-overflow-scrolling: touch;
6868
}
6969
#frame-h-2, #frame-l-2 {
70-
display:inline-block;
70+
display:inline-block;
7171
}
7272
</style>
73-
73+
7474
<script type="text/javascript" src="js/jquery.js" charset="utf-8"></script>
75-
75+
7676
<script type="text/javascript">
7777
//<![CDATA[
7878
function rsizeIframes() {
7979
var h_height = <?php echo (isset($audio) ? getSettingWithDefault('set-text-h-frameheight-with-audio') : getSettingWithDefault('set-text-h-frameheight-no-audio')); ?> - 80;
80-
var w = $(window).width();
81-
var h = $(window).height();
82-
var l_height = h - h_height;
83-
$('#frame-h').width(w-5).height(h_height-5).
84-
css('top',0).css('left',0);
85-
$('#frame-h-2').width('100%').height('100%').
86-
css('top',0).css('left',0);
87-
$('#frame-l').width(w-5).height(l_height-5).
88-
css('top',h_height).css('left',0);
89-
$('#frame-l-2').width('100%').height('100%').
90-
css('top',0).css('left',0);
80+
var w = $(window).width();
81+
var h = $(window).height();
82+
var l_height = h - h_height;
83+
$('#frame-h').width(w-5).height(h_height-5).
84+
css('top',0).css('left',0);
85+
$('#frame-h-2').width('100%').height('100%').
86+
css('top',0).css('left',0);
87+
$('#frame-l').width(w-5).height(l_height-5).
88+
css('top',h_height).css('left',0);
89+
$('#frame-l-2').width('100%').height('100%').
90+
css('top',0).css('left',0);
9191
}
9292

9393
function init() {
94-
rsizeIframes();
95-
$(window).resize(rsizeIframes);
94+
rsizeIframes();
95+
$(window).resize(rsizeIframes);
9696
}
9797

9898
$(document).ready(init);
9999
//]]>
100100
</script>
101101

102102
<div id="frame-h">
103-
<iframe id="frame-h-2" src="display_impr_text_header.php?text=<?php echo $_REQUEST['text']; ?>" scrolling="yes" name="header"></iframe>
103+
<iframe id="frame-h-2" src="display_impr_text_header.php?text=<?php echo $_REQUEST['text']; ?>" scrolling="yes" name="header"></iframe>
104104
</div>
105105
<div id="frame-l">
106-
<iframe id="frame-l-2" src="display_impr_text_text.php?text=<?php echo $_REQUEST['text']; ?>" scrolling="yes" name="text"></iframe>
106+
<iframe id="frame-l-2" src="display_impr_text_text.php?text=<?php echo $_REQUEST['text']; ?>" scrolling="yes" name="text"></iframe>
107107
</div>
108108

109109
<?php
@@ -113,8 +113,8 @@ function init() {
113113
?>
114114

115115
<frameset border="3" bordercolor="" rows="<?php echo (isset($audio) ? getSettingWithDefault('set-text-h-frameheight-with-audio')-90 : getSettingWithDefault('set-text-h-frameheight-no-audio')-90 ); ?>,*">
116-
<frame src="display_impr_text_header.php?text=<?php echo $_REQUEST['text']; ?>" scrolling="no" name="header" />
117-
<frame src="display_impr_text_text.php?text=<?php echo $_REQUEST['text']; ?>" scrolling="auto" name="text" />
116+
<frame src="display_impr_text_header.php?text=<?php echo $_REQUEST['text']; ?>" scrolling="no" name="header" />
117+
<frame src="display_impr_text_text.php?text=<?php echo $_REQUEST['text']; ?>" scrolling="auto" name="text" />
118118
</frameset>
119119
<noframes><body><p>Sorry - your browser does not support frames.</p></body></noframes>
120120
</frameset>

‎display_impr_text_header.php‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,26 +64,26 @@
6464

6565
<script type="text/javascript">
6666
//<![CDATA[
67-
function do_hide_t() {
68-
$('#showt').show();
69-
$('#hidet').hide();
70-
$('.anntermruby', window.parent.frames['text'].document).css('color','#E5E4E2').css('background-color', '#E5E4E2');
71-
}
72-
function do_show_t() {
73-
$('#showt').hide();
74-
$('#hidet').show();
75-
$('.anntermruby', window.parent.frames['text'].document).css('color','inherit').css('background-color', '');
76-
}
77-
function do_hide_a() {
78-
$('#show').show();
79-
$('#hide').hide();
80-
$('.anntransruby2', window.parent.frames['text'].document).css('color','#C8DCF0').css('background-color', '#C8DCF0');
81-
}
82-
function do_show_a() {
83-
$('#show').hide();
84-
$('#hide').show();
85-
$('.anntransruby2', window.parent.frames['text'].document).css('color','').css('background-color', '');
86-
}
67+
function do_hide_t() {
68+
$('#showt').show();
69+
$('#hidet').hide();
70+
$('.anntermruby', window.parent.frames['text'].document).css('color','#E5E4E2').css('background-color', '#E5E4E2');
71+
}
72+
function do_show_t() {
73+
$('#showt').hide();
74+
$('#hidet').show();
75+
$('.anntermruby', window.parent.frames['text'].document).css('color','inherit').css('background-color', '');
76+
}
77+
function do_hide_a() {
78+
$('#show').show();
79+
$('#hide').hide();
80+
$('.anntransruby2', window.parent.frames['text'].document).css('color','#C8DCF0').css('background-color', '#C8DCF0');
81+
}
82+
function do_show_a() {
83+
$('#show').hide();
84+
$('#hide').show();
85+
$('.anntransruby2', window.parent.frames['text'].document).css('color','').css('background-color', '');
86+
}
8787
//]]>
8888
</script>
8989

‎display_impr_text_text.php‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,24 @@
7373
//<![CDATA[
7474

7575
function click_ann() {var attr = $(this).attr('style');
76-
if(typeof attr !== 'undefined' && attr !== false && attr !== '') {
77-
$(this).removeAttr( 'style' );
78-
}
79-
else {
80-
$(this).css('color','#C8DCF0');
81-
$(this).css('background-color','#C8DCF0');
82-
}
76+
if(typeof attr !== 'undefined' && attr !== false && attr !== '') {
77+
$(this).removeAttr( 'style' );
78+
}
79+
else {
80+
$(this).css('color','#C8DCF0');
81+
$(this).css('background-color','#C8DCF0');
82+
}
8383
}
8484

8585
function click_text() {bc=$('body').css('color');
86-
if($(this).css('color') != bc) {
87-
$(this).css('color','inherit');
88-
$(this).css('background-color','');
89-
}
90-
else {
91-
$(this).css('color','#E5E4E2');
92-
$(this).css('background-color','#E5E4E2');
93-
}
86+
if($(this).css('color') != bc) {
87+
$(this).css('color','inherit');
88+
$(this).css('background-color','');
89+
}
90+
else {
91+
$(this).css('color','#E5E4E2');
92+
$(this).css('background-color','#E5E4E2');
93+
}
9494
}
9595

9696
$(document).ready(function(){

0 commit comments

Comments
 (0)