Changeset 561 for trunk/Modules/Translation/Save.php
- Timestamp:
- Aug 13, 2013, 11:31:34 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Translation/Save.php
r554 r561 6 6 { 7 7 global $System, $User, $Config, $TranslationTree; 8 $Output = ''; 9 $CompleteText = array('nedokončený', 'dokončený'); 10 11 unset($Message); 12 $System->ModuleManager->Modules['FrontPage']->HandleLoginForm(); 13 if(isset($Message)) $Output .= ShowMessage($Message, $MessageType); 14 15 $GroupId = LoadGroupIdParameter(); 16 $Group = $TranslationTree[$GroupId]; 17 $Table = $Group['TablePrefix']; 18 if($User->Licence(LICENCE_USER)) 19 { 20 if(array_key_exists('ID', $_POST) and is_numeric($_POST['ID'])) 21 { 22 $Entry = $_POST['entry'] * 1; 23 $TextID = $_POST['ID'] * 1; 24 $Language = $_POST['Language'] * 1; 25 if(array_key_exists('End', $_POST)) $Complete = 1; 26 else $Complete = 0; 27 28 // Get source text record from database by ID 29 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID`='.$TextID); 30 if($DbResult->num_rows > 0) 31 { 32 $SourceText = $DbResult->fetch_assoc(); 33 34 // Get data for english original 35 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry']. 36 ') AND (`Language` = '.$Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart']. 37 ') AND (`VersionEnd` = '.$SourceText['VersionEnd'].')'); 38 if($DbResult->num_rows > 0) 39 { 40 $EnglishText = $DbResult->fetch_assoc(); 41 42 // Get all similar english texts 43 $Filter = ''; 44 foreach($Group['Items'] as $GroupItem) 45 if(($GroupItem['Visible'] == 1) and ($EnglishText[$GroupItem['Column']] != '')) 46 $Filter .= ' OR (`'.$GroupItem['Column'].'` = "'.addslashes($EnglishText[$GroupItem['Column']]).'")'; 47 if(substr($Filter, 0, 3) == ' OR') $Filter = ' AND ('.substr($Filter, 3).')'; 48 49 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = '.$Config['OriginalLanguage'].')'.$Filter); 50 while($EnglishFound = $DbResult->fetch_assoc()) 51 { 52 // Get user translation paired to found english item entry 53 $DbResult2 = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`User` = '.$User->Id. 54 ') AND (`Entry` = '.$EnglishFound['Entry'].') AND (`VersionStart` = '.$EnglishFound['VersionStart']. 55 ') AND (`VersionEnd` = '.$EnglishFound['VersionEnd'].')'); 56 if($DbResult2->num_rows > 0) 57 { 58 // Update existed user translation 59 $ExistedText = $DbResult2->fetch_assoc(); 60 $Values = '`Language` = '.$Language; 61 62 $UpdateModifyTime = false; 63 $Completable = true; 64 $CompleteParts = $ExistedText['CompleteParts']; 65 foreach($Group['Items'] as $GroupItem) 66 { 67 if($GroupItem['Visible'] == 1) 68 { 69 if($SourceText[$GroupItem['Column']] != $ExistedText[$GroupItem['Column']]) 70 $UpdateModifyTime = true; 71 72 if($EnglishFound[$GroupItem['Column']] == $EnglishText[$GroupItem['Column']]) 73 { 74 if(array_key_exists($GroupItem['Column'], $_POST)) 75 { 76 $Values .= ', `'.$GroupItem['Column'].'` = "'.$_POST[$GroupItem['Column']].'"'; 77 $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1)); 78 } 79 } 80 if((($CompleteParts & (1 << ($GroupItem['Sequence'] - 1))) == 0) and ($EnglishFound[$GroupItem['Column']] != '')) $Completable = false; 81 } 82 } 83 if($Completable) $NewComplete = 1; // All parts of text are completed. Make entire text as completed 84 else $NewComplete = 0; 85 if($SourceText['ID'] == $ExistedText['ID']) 86 { 87 $NewComplete = $Complete; // Our original user text, set complete according user choice 88 if($Complete == 1) 89 { 90 foreach($Group['Items'] as $GroupItem) 91 if($GroupItem['Visible'] == 1) $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1)); 92 } 93 } 94 $Values .= ', `Complete`='.$NewComplete.', `CompleteParts` = '.$CompleteParts; 95 96 if($UpdateModifyTime) $Values .= ', `ModifyTime` = NOW()'; 97 98 // Update user translation 99 $System->Database->query('UPDATE `'.$Table.'` SET '.$Values.' WHERE `ID` = '.$ExistedText['ID']); 100 101 $Output .= 'Změny v překladu <a href="form.php?group='.$GroupId.'&ID='.$ExistedText['ID'].'">'.$ExistedText['ID'].'</a> ('.$ExistedText['Entry'].') uloženy jako '.$CompleteText[$NewComplete].'.<br />'; 102 WriteLog('Změny v překladu <a href="form.php?group='.$GroupId.'&ID='.$ExistedText['ID'].'">'.$ExistedText['ID'].'</a> ('.$ExistedText['Entry'].') uloženy jako '.$CompleteText[$NewComplete].'.', LOG_TYPE_TRANSLATION); 103 } else 104 { 105 // Insert new user translation 106 $Columns = '`Entry`, `VersionStart`, `VersionEnd`, `Language`, `User`, `Take`, `ModifyTime`'; 107 $Values = $EnglishFound['Entry'].', '.$EnglishFound['VersionStart'].', '.$EnglishFound['VersionEnd'].', '.$Language.', '.$User->Id.', '.$SourceText['ID'].', NOW()'; 108 109 $CompleteParts = 0; 110 $Completable = true; 111 foreach($Group['Items'] as $GroupItem) 112 { 113 $Columns .= ', `'.$GroupItem['Column'].'`'; 114 if($GroupItem['Visible'] == 1) 115 { 116 if($EnglishFound[$GroupItem['Column']] == $EnglishText[$GroupItem['Column']]) 117 { 118 // Read form user data 119 if(array_key_exists($GroupItem['Column'], $_POST)) 120 { 121 $Values .= ', "'.$_POST[$GroupItem['Column']].'"'; 122 $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1)); 123 } else $Values .= ', "'.addslashes($EnglishFound[$GroupItem['Column']]).'"'; 124 } else $Values .= ', "'.addslashes($EnglishFound[$GroupItem['Column']]).'"'; 125 if((($CompleteParts & (1 << ($GroupItem['Sequence'] - 1))) == 0) and ($EnglishFound[$GroupItem['Column']] != '')) $Completable = false; 126 } else 127 { 128 // Read from english text 129 $Values .= ', "'.$EnglishFound[$GroupItem['Column']].'"'; 130 } 131 } 132 if($Completable) $NewComplete = 1; // All parts of text are completed. Make entire text as completed 133 else $NewComplete = 0; 134 if($SourceText['ID'] == $EnglishFound['ID']) 135 { 136 $NewComplete = $Complete; // Our original user text, set complete according user choice 137 if($Complete == 1) 138 { 139 foreach($Group['Items'] as $GroupItem) 140 if($GroupItem['Visible'] == 1) $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1)); 141 } 142 } 143 $Columns .= ', `Complete`, `CompleteParts`'; 144 $Values .= ', '.$NewComplete.', '.$CompleteParts; 145 146 $System->Database->query('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')'); 147 $LastID = $System->Database->insert_id; 148 149 $Output .= 'Text <a href="form.php?group='.$GroupId.'&ID='.$LastID.'">'.$LastID.'</a> ze skupiny <a href="TranslationList.php?group='.$GroupId.'&user=0&action=filter">'.$TranslationTree[$GroupId]['Name'].'</a> uložen jako '.$CompleteText[$NewComplete].'. Převzat z <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a>.<br/>'; 150 WriteLog('Text <a href="form.php?group='.$GroupId.'&ID='.$LastID.'">'.$LastID.'</a> ze skupiny <a href="TranslationList.php?group='.$GroupId.'&user=0&text=&entry=&action=filter">'.$TranslationTree[$GroupId]['Name'].'</a> uložen jako '.$CompleteText[$NewComplete].'. Převzat z <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a>.', LOG_TYPE_TRANSLATION); 151 } 152 } 153 } else $Output .= ShowMessage('Anglický originál k překladu nenalezen.', MESSAGE_CRITICAL); 154 } else $Output .= ShowMessage('Zadaná položka nenalezena.', MESSAGE_CRITICAL); 155 156 157 // Address and redirecting 158 $Output .= '<br />Překládat: <a href="TranslationList.php?group='.$GroupId.'&state=1&user=0&entry=">Nepřeložené</a> '; 159 160 $prev = FollowingTran($TextID, $Table, $GroupId, True); 161 $next = FollowingTran($TextID, $Table, $GroupId); 162 $Output .= '<br /><br />'; 163 $DbResult = $System->Database->query('SELECT `Redirecting` FROM `User` WHERE `ID`='.$User->Id); 164 $redirecting = $DbResult->fetch_assoc(); 165 166 switch($redirecting['Redirecting']) 167 { 168 case 1: 169 $Output .= '<script type="text/javascript" language="JavaScript" charset="utf-8">'. 170 'setTimeout("parent.location.href=\''.htmlspecialchars_decode('TranslationList.php?group='.$GroupId.'&state=1&user=0').'\'", 1500)'. 171 '</script>'; 172 break; 173 case 2: 174 if($next <> '') 175 $Output .= '<script type="text/javascript" language="JavaScript" charset="utf-8">'. 176 'setTimeout("parent.location.href=\''.htmlspecialchars_decode($next).'\'", 1500)'. 177 '</script>'; 178 break; 179 case 3: 180 if($prev <> '') 181 $Output .= '<script type="text/javascript" language="JavaScript" charset="utf-8">'. 182 'setTimeout("parent.location.href=\''.htmlspecialchars_decode($prev).'\'", 1500)'. 183 '</script>'; 184 break; 185 } 186 187 $Output .= 'Z této stránky můžete být automaticky přesměrování. Nastavit kam chcete být přesměrování si můžete v <a href="'.$System->Link('/Options.php').'" title="Nastavení uživatele">Nastavení</a>'; 188 189 // Update flag for experience info load 190 $System->Database->query('UPDATE `User` SET `NeedUpdate` = 1 WHERE `ID` = '.$User->Id); 191 } else $Output .= ShowMessage('Položka nenalezena', MESSAGE_CRITICAL); 192 } else 193 { 194 if(array_key_exists('ID', $_POST) and array_key_exists('entry', $_POST) and array_key_exists('Language', $_POST) and array_key_exists('user', $_POST)) 195 { 196 $Output .= 'Byli jste automaticky odhlášeni. Pro <strong>Uložení překladu</strong> se musíte přihlásit zde:<br /><br />'. 197 '<form action="save.php?action=login&group='.$GroupId.'" method="post"><div>'. 198 '<input type="hidden" name="entry" value="'.$_POST['entry'].'" />'. 199 '<input type="hidden" name="user" value="'.$_POST['user'].'" />'. 200 '<input type="hidden" name="ID" value="'.$_POST['ID'].'" />'. 201 '<input type="hidden" name="Language" value="'.$_POST['Language'].'" />'; 202 203 foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem) 204 { 205 if(array_key_exists($TextItem['Column'], $_POST)) $Value = $_POST[$TextItem['Column']]; else $Value = ''; 206 $Output .= '<input id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'" type="hidden" value="'.htmlspecialchars($Value).'" />'; 207 } 208 $Output .= '<table>'. 209 '<tr>'. 210 '<td>Jméno: <input type="text" name="LoginUser" size="13" /></td>'. 211 '</tr><tr>'. 212 '<td>Heslo: <input type="password" name="LoginPass" size="13" /></td>'. 213 '</tr><tr>'. 214 '<th><input type="submit" value="Přihlásit a uložit překlad" /></th>'. 215 '</tr>'. 216 '</table>'; 217 } else $Output = ShowMessage('Nezadány požadované údaje.', MESSAGE_CRITICAL); 218 } 8 9 $Output = ''; 10 $CompleteText = array('nedokončený', 'dokončený'); 11 12 unset($Message); 13 $System->ModuleManager->Modules['FrontPage']->HandleLoginForm(); 14 if(isset($Message)) $Output .= ShowMessage($Message, $MessageType); 15 16 $GroupId = LoadGroupIdParameter(); 17 $Group = $TranslationTree[$GroupId]; 18 $Table = $Group['TablePrefix']; 19 if($User->Licence(LICENCE_USER)) 20 { 21 if(array_key_exists('ID', $_POST) and is_numeric($_POST['ID'])) 22 { 23 $Entry = $_POST['entry'] * 1; 24 $TextID = $_POST['ID'] * 1; 25 $Language = $_POST['Language'] * 1; 26 if(array_key_exists('End', $_POST)) $Complete = 1; 27 else $Complete = 0; 28 29 // Get source text record from database by ID 30 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID`='.$TextID); 31 if($DbResult->num_rows > 0) 32 { 33 $SourceText = $DbResult->fetch_assoc(); 34 35 // Get data for english original 36 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry']. 37 ') AND (`Language` = '.$Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart']. 38 ') AND (`VersionEnd` = '.$SourceText['VersionEnd'].')'); 39 if($DbResult->num_rows > 0) 40 { 41 $EnglishText = $DbResult->fetch_assoc(); 42 43 // Get all similar english texts 44 $Filter = ''; 45 foreach($Group['Items'] as $GroupItem) 46 if(($GroupItem['Visible'] == 1) and ($EnglishText[$GroupItem['Column']] != '')) 47 $Filter .= ' OR (`'.$GroupItem['Column'].'` = "'.addslashes($EnglishText[$GroupItem['Column']]).'")'; 48 if(substr($Filter, 0, 3) == ' OR') $Filter = ' AND ('.substr($Filter, 3).')'; 49 50 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = '.$Config['OriginalLanguage'].')'.$Filter); 51 while($EnglishFound = $DbResult->fetch_assoc()) 52 { 53 // Get user translation paired to found english item entry 54 $DbResult2 = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`User` = '.$User->Id. 55 ') AND (`Entry` = '.$EnglishFound['Entry'].') AND (`VersionStart` = '.$EnglishFound['VersionStart']. 56 ') AND (`VersionEnd` = '.$EnglishFound['VersionEnd'].')'); 57 if($DbResult2->num_rows > 0) 58 { 59 // Update existed user translation 60 $ExistedText = $DbResult2->fetch_assoc(); 61 $Values = '`Language` = '.$Language; 62 63 $UpdateModifyTime = false; 64 $Completable = true; 65 $CompleteParts = $ExistedText['CompleteParts']; 66 foreach($Group['Items'] as $GroupItem) 67 { 68 if($GroupItem['Visible'] == 1) 69 { 70 if($SourceText[$GroupItem['Column']] != $ExistedText[$GroupItem['Column']]) 71 $UpdateModifyTime = true; 72 73 if($EnglishFound[$GroupItem['Column']] == $EnglishText[$GroupItem['Column']]) 74 { 75 if(array_key_exists($GroupItem['Column'], $_POST)) 76 { 77 $Values .= ', `'.$GroupItem['Column'].'` = "'.$_POST[$GroupItem['Column']].'"'; 78 $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1)); 79 } 80 } 81 if((($CompleteParts & (1 << ($GroupItem['Sequence'] - 1))) == 0) and ($EnglishFound[$GroupItem['Column']] != '')) $Completable = false; 82 } 83 } 84 if($Completable) $NewComplete = 1; // All parts of text are completed. Make entire text as completed 85 else $NewComplete = 0; 86 if($SourceText['ID'] == $ExistedText['ID']) 87 { 88 $NewComplete = $Complete; // Our original user text, set complete according user choice 89 if($Complete == 1) 90 { 91 foreach($Group['Items'] as $GroupItem) 92 if($GroupItem['Visible'] == 1) $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1)); 93 } 94 } 95 $Values .= ', `Complete`='.$NewComplete.', `CompleteParts` = '.$CompleteParts; 96 97 if($UpdateModifyTime) $Values .= ', `ModifyTime` = NOW()'; 98 99 // Update user translation 100 $System->Database->query('UPDATE `'.$Table.'` SET '.$Values.' WHERE `ID` = '.$ExistedText['ID']); 101 102 $Output .= 'Změny v překladu <a href="form.php?group='.$GroupId.'&ID='.$ExistedText['ID'].'">'.$ExistedText['ID'].'</a> ('.$ExistedText['Entry'].') uloženy jako '.$CompleteText[$NewComplete].'.<br />'; 103 WriteLog('Změny v překladu <a href="form.php?group='.$GroupId.'&ID='.$ExistedText['ID'].'">'.$ExistedText['ID'].'</a> ('.$ExistedText['Entry'].') uloženy jako '.$CompleteText[$NewComplete].'.', LOG_TYPE_TRANSLATION); 104 } else 105 { 106 // Insert new user translation 107 $Columns = '`Entry`, `VersionStart`, `VersionEnd`, `Language`, `User`, `Take`, `ModifyTime`'; 108 $Values = $EnglishFound['Entry'].', '.$EnglishFound['VersionStart'].', '.$EnglishFound['VersionEnd'].', '.$Language.', '.$User->Id.', '.$SourceText['ID'].', NOW()'; 109 110 $CompleteParts = 0; 111 $Completable = true; 112 foreach($Group['Items'] as $GroupItem) 113 { 114 $Columns .= ', `'.$GroupItem['Column'].'`'; 115 if($GroupItem['Visible'] == 1) 116 { 117 if($EnglishFound[$GroupItem['Column']] == $EnglishText[$GroupItem['Column']]) 118 { 119 // Read form user data 120 if(array_key_exists($GroupItem['Column'], $_POST)) 121 { 122 $Values .= ', "'.$_POST[$GroupItem['Column']].'"'; 123 $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1)); 124 } else $Values .= ', "'.addslashes($EnglishFound[$GroupItem['Column']]).'"'; 125 } else $Values .= ', "'.addslashes($EnglishFound[$GroupItem['Column']]).'"'; 126 if((($CompleteParts & (1 << ($GroupItem['Sequence'] - 1))) == 0) and ($EnglishFound[$GroupItem['Column']] != '')) $Completable = false; 127 } else 128 { 129 // Read from english text 130 $Values .= ', "'.$EnglishFound[$GroupItem['Column']].'"'; 131 } 132 } 133 if($Completable) $NewComplete = 1; // All parts of text are completed. Make entire text as completed 134 else $NewComplete = 0; 135 if($SourceText['ID'] == $EnglishFound['ID']) 136 { 137 $NewComplete = $Complete; // Our original user text, set complete according user choice 138 if($Complete == 1) 139 { 140 foreach($Group['Items'] as $GroupItem) 141 if($GroupItem['Visible'] == 1) $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1)); 142 } 143 } 144 $Columns .= ', `Complete`, `CompleteParts`'; 145 $Values .= ', '.$NewComplete.', '.$CompleteParts; 146 147 $System->Database->query('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')'); 148 $LastID = $System->Database->insert_id; 149 150 $Output .= 'Text <a href="form.php?group='.$GroupId.'&ID='.$LastID.'">'.$LastID.'</a> ze skupiny <a href="TranslationList.php?group='.$GroupId.'&user=0&action=filter">'.$TranslationTree[$GroupId]['Name'].'</a> uložen jako '.$CompleteText[$NewComplete].'. Převzat z <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a>.<br/>'; 151 WriteLog('Text <a href="form.php?group='.$GroupId.'&ID='.$LastID.'">'.$LastID.'</a> ze skupiny <a href="TranslationList.php?group='.$GroupId.'&user=0&text=&entry=&action=filter">'.$TranslationTree[$GroupId]['Name'].'</a> uložen jako '.$CompleteText[$NewComplete].'. Převzat z <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a>.', LOG_TYPE_TRANSLATION); 152 } 153 } 154 } else $Output .= ShowMessage('Anglický originál k překladu nenalezen.', MESSAGE_CRITICAL); 155 } else $Output .= ShowMessage('Zadaná položka nenalezena.', MESSAGE_CRITICAL); 156 157 158 // Address and redirecting 159 $Output .= '<br />Překládat: <a href="TranslationList.php?group='.$GroupId.'&state=1&user=0&entry=">Nepřeložené</a> '; 160 161 $prev = FollowingTran($TextID, $Table, $GroupId, True); 162 $next = FollowingTran($TextID, $Table, $GroupId); 163 $Output .= '<br /><br />'; 164 $DbResult = $System->Database->query('SELECT `Redirecting` FROM `User` WHERE `ID`='.$User->Id); 165 $redirecting = $DbResult->fetch_assoc(); 166 167 switch($redirecting['Redirecting']) 168 { 169 case 1: 170 $Output .= '<script type="text/javascript" language="JavaScript" charset="utf-8">'. 171 'setTimeout("parent.location.href=\''.htmlspecialchars_decode('TranslationList.php?group='.$GroupId.'&state=1&user=0').'\'", 1500)'. 172 '</script>'; 173 break; 174 case 2: 175 if($next <> '') 176 $Output .= '<script type="text/javascript" language="JavaScript" charset="utf-8">'. 177 'setTimeout("parent.location.href=\''.htmlspecialchars_decode($next).'\'", 1500)'. 178 '</script>'; 179 break; 180 case 3: 181 if($prev <> '') 182 $Output .= '<script type="text/javascript" language="JavaScript" charset="utf-8">'. 183 'setTimeout("parent.location.href=\''.htmlspecialchars_decode($prev).'\'", 1500)'. 184 '</script>'; 185 break; 186 } 187 188 $Output .= 'Z této stránky můžete být automaticky přesměrování. Nastavit kam chcete být přesměrování si můžete v <a href="'.$System->Link('/Options.php').'" title="Nastavení uživatele">Nastavení</a>'; 189 190 // Update flag for experience info load 191 $System->Database->query('UPDATE `User` SET `NeedUpdate` = 1 WHERE `ID` = '.$User->Id); 192 } else $Output .= ShowMessage('Položka nenalezena', MESSAGE_CRITICAL); 193 } else 194 { 195 if(array_key_exists('ID', $_POST) and array_key_exists('entry', $_POST) and array_key_exists('Language', $_POST) and array_key_exists('user', $_POST)) 196 { 197 $Output .= 'Byli jste automaticky odhlášeni. Pro <strong>Uložení překladu</strong> se musíte přihlásit zde:<br /><br />'. 198 '<form action="save.php?action=login&group='.$GroupId.'" method="post"><div>'. 199 '<input type="hidden" name="entry" value="'.$_POST['entry'].'" />'. 200 '<input type="hidden" name="user" value="'.$_POST['user'].'" />'. 201 '<input type="hidden" name="ID" value="'.$_POST['ID'].'" />'. 202 '<input type="hidden" name="Language" value="'.$_POST['Language'].'" />'; 203 204 foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem) 205 { 206 if(array_key_exists($TextItem['Column'], $_POST)) $Value = $_POST[$TextItem['Column']]; else $Value = ''; 207 $Output .= '<input id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'" type="hidden" value="'.htmlspecialchars($Value).'" />'; 208 } 209 $Output .= '<table>'. 210 '<tr>'. 211 '<td>Jméno: <input type="text" name="LoginUser" size="13" /></td>'. 212 '</tr><tr>'. 213 '<td>Heslo: <input type="password" name="LoginPass" size="13" /></td>'. 214 '</tr><tr>'. 215 '<th><input type="submit" value="Přihlásit a uložit překlad" /></th>'. 216 '</tr>'. 217 '</table>'; 218 } else $Output = ShowMessage('Nezadány požadované údaje.', MESSAGE_CRITICAL); 219 } 219 220 return($Output); 220 221 }
Note:
See TracChangeset
for help on using the changeset viewer.