1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15:
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17:
18: 19: 20:
21: class cGuiScrollListAlltranslations extends cGuiScrollList {
22:
23: function __construct() {
24: parent::__construct(false);
25: $this->objTable->setClass("generic alltranslations");
26: $this->objTable->updateAttributes(array(
27: "cellpadding" => "2"
28: ));
29: }
30:
31: 32: 33: 34: 35:
36: public function onRenderRow($row) {
37: }
38:
39: 40: 41: 42: 43:
44: public function onRenderColumn($column) {
45: $iColums = count($this->data[0]);
46:
47: switch ($column) {
48: case 1:
49: $sClass = 'module';
50: break;
51: case 2:
52: $sClass = 'inuse';
53: break;
54: case 3:
55: $sClass = 'keyword';
56: break;
57: case $iColums:
58: $sClass = 'actions';
59: break;
60:
61: default:
62: $sClass = 'translation';
63: break;
64: }
65:
66: $this->objItem->setClass($sClass);
67: }
68:
69: 70: 71: 72: 73: 74:
75: public function sort($field, $order) {
76: if ($order == "") {
77: $order = SORT_ASC;
78: }
79:
80: if ($order == "ASC") {
81: $order = SORT_ASC;
82: }
83:
84: if ($order == "DESC") {
85: $order = SORT_DESC;
86: }
87:
88: $this->sortkey = $field;
89: $this->sortmode = $order;
90:
91: $field = $field + 1;
92:
93: if ($field > 3) {
94: $sortby = array();
95: foreach ($this->data as $row => $cols) {
96: $sortby[$row] = trim(strtolower(conHtmlentities($cols[$field])));
97: }
98: $this->data = cArray::csort($this->data, $sortby, $order);
99: } else {
100: $this->data = cArray::csort($this->data, "$field", $order);
101: }
102: }
103:
104: }
105:
106: 107: 108: 109: 110: 111: 112:
113: function addSortImages($index, $text) {
114: global $cfg;
115: $sortUp = '<img src="' . $cfg["path"]["contenido_fullhtml"] . $cfg['path']['images'] . 'sort_up.gif" alt="' . i18n("Sort") . '" title="' . i18n("Sort") . '">';
116: $sortDown = '<img src="' . $cfg["path"]["contenido_fullhtml"] . $cfg['path']['images'] . 'sort_down.gif" alt="' . i18n("Sort") . '" title="' . i18n("Sort") . '">';
117:
118: if ($_REQUEST["sortby"] == $index) {
119: if ($_REQUEST["sortmode"] == 'ASC') {
120: $sortString = $text . $sortUp;
121: } else {
122: $sortString = $text . $sortDown;
123: }
124: } else {
125: $sortString = $text . $sortUp . $sortDown;
126: }
127: return $sortString;
128: }
129:
130: $page = new cGuiPage("con_translate");
131:
132: if (empty($action)) {
133: $action = 'con_translate_view';
134: }
135:
136:
137: if (!$perm->have_perm_area_action($area, $action)) {
138: $page->displayCriticalError(i18n('Permission denied'));
139: $page->render();
140: return;
141: }
142:
143:
144: if (!(int) $client > 0) {
145: $page->render();
146: return;
147: }
148:
149: $inUseCollection = new cApiInUseCollection();
150: list($inUse, $message) = $inUseCollection->checkAndMark("translations", $client, true, i18n("Translations are used by %s (%s)"), true, "main.php?area=$area&frame=$frame");
151: unset($inUseCollection);
152: if ($inUse == true) {
153: $message .= "<br>";
154: }
155:
156:
157: $elemPerPage = array(
158: 25 => "25",
159: 50 => "50"
160: );
161:
162: $db = cRegistry::getDb();
163:
164: $langobj = new cApiLanguage($lang);
165:
166: $langstring = $langobj->get('name') . ' (' . $lang . ')';
167:
168: $aTmpExtraLanguages = $_REQUEST["extralang"];
169: $extraLanguages = array();
170: if (is_array($aTmpExtraLanguages)) {
171: foreach ($aTmpExtraLanguages as $idlang) {
172: if ($idlang != $_REQUEST["dellang"]) {
173: $extraLanguages[] = $idlang;
174: }
175: }
176: }
177: $allLanguages = array_merge(array(
178: $lang
179: ), $extraLanguages);
180:
181: $editstring = $_REQUEST["editstring"];
182: $editlang = $_REQUEST["editlang"];
183: if ($editlang != 'all') {
184: $editlang = cSecurity::toInteger($editlang);
185: }
186:
187: $search = strtolower(trim($_REQUEST["search"]));
188: $filter = $_REQUEST["filter"];
189:
190: $cApiModuleCollection = new cApiModuleCollection();
191: $modulesInUse = $cApiModuleCollection->getModulesInUse();
192:
193: $iNextPage = cSecurity::toInteger($_GET['nextpage']);
194: if ($iNextPage <= 0) {
195: $iNextPage = 1;
196: }
197:
198: if ($_REQUEST["sortmode"] !== "DESC") {
199: $_REQUEST["sortmode"] = "ASC";
200: }
201:
202:
203: $oUser = new cApiUser($auth->auth["uid"]);
204: if (!isset($_REQUEST["elemperpage"]) || !is_numeric($_REQUEST['elemperpage']) || $_REQUEST['elemperpage'] < 0) {
205: $_REQUEST["elemperpage"] = $oUser->getProperty("itemsperpage", $area);
206: }
207: if (!is_numeric($_REQUEST["elemperpage"])) {
208: $_REQUEST["elemperpage"] = 25;
209: }
210: if ($_REQUEST["elemperpage"] > 0) {
211:
212:
213: $oUser->setProperty("itemsperpage", $area, $_REQUEST["elemperpage"]);
214: }
215: unset($oUser);
216:
217: if (!isset($_REQUEST["page"]) || !is_numeric($_REQUEST['page']) || $_REQUEST['page'] <= 0 || $_REQUEST["elemperpage"] == 0) {
218: $_REQUEST["page"] = 1;
219: }
220:
221:
222: if ($action == 'con_translate_edit') {
223: $error = false;
224:
225: $savetranslations = $_REQUEST["modtrans"];
226: if (is_array($savetranslations)) {
227: foreach ($savetranslations as $idmod => $savemodtranslations) {
228:
229:
230: $module = new cApiModule($idmod);
231: $moduleKeywords = $module->parseModuleForStringsLoadFromFile($cfg, $client, $lang);
232: $moduleKeywordsHashes = array();
233: foreach ($moduleKeywords as $keyword) {
234: $moduleKeywordsHashes[md5($keyword)] = $keyword;
235: }
236:
237: foreach ($savemodtranslations as $hash => $stringtranslations) {
238: foreach ($stringtranslations as $idlang => $modlangtranslation) {
239: $contenidoTranslateFromFile = new cModuleFileTranslation($idmod, false, $idlang);
240: $fileTranslations = $contenidoTranslateFromFile->getTranslationArray();
241:
242: $hashparts = explode('_', $hash);
243: $translationKey = $moduleKeywordsHashes[$hashparts[1]];
244: $fileTranslations[stripslashes($translationKey)] = stripslashes($modlangtranslation);
245: $thislangerror = $contenidoTranslateFromFile->saveTranslationArray($fileTranslations);
246: if (!$thislangerror) {
247: $error = true;
248: }
249: }
250: }
251: }
252: }
253:
254: if (!$error) {
255: $page->displayInfo(i18n('Saved translation successfully!'));
256: } else {
257: $page->displayError(i18n("Can't save translation!"));
258: }
259: }
260:
261:
262: $sql = sprintf("SELECT idmod, name FROM %s WHERE idclient = %s ORDER BY name", $cfg['tab']['mod'], $client);
263: $db->query($sql);
264:
265: $allModules = array();
266: $allTranslations = array();
267:
268: while ($db->nextRecord()) {
269: $idmod = $db->f('idmod');
270: $allModules[$idmod] = $db->f('name');
271: $module = new cApiModule($idmod);
272:
273:
274: $strings = $module->parseModuleForStringsLoadFromFile($cfg, $client, $lang);
275:
276: foreach ($allLanguages as $idlang) {
277:
278:
279: $contenidoTranslateFromFile = new cModuleFileTranslation($idmod, false, $idlang);
280: $fileTranslations = $contenidoTranslateFromFile->getTranslationArray();
281: $translations = array();
282: foreach ($fileTranslations as $key => $value) {
283: $hash = $idmod . '_' . md5($key);
284: $translations[$hash] = $value;
285: }
286:
287: $currentModuleTranslations = array();
288:
289:
290: foreach ($strings as $string) {
291: $hash = $idmod . '_' . md5($string);
292: if (isset($translations[$hash])) {
293: $currentTranslation = $translations[$hash];
294: } else {
295: $currentTranslation = '';
296: }
297: if (isset($allTranslations[$hash])) {
298: $allTranslations[$hash]['translations'][$idlang] = $currentTranslation;
299: } else {
300: $allTranslations[$hash] = array(
301: 'string' => $string,
302: 'translations' => array(
303: $idlang => $currentTranslation
304: ),
305: 'idmod' => $idmod
306: );
307: }
308: }
309: }
310: }
311:
312:
313: $aAllTemplates = array();
314: $sql = "SELECT
315: *
316: FROM
317: " . $cfg["tab"]["tpl"] . "
318: WHERE
319: idclient = '" . cSecurity::toInteger($client) . "'
320: ORDER BY
321: name";
322:
323: $db->query($sql);
324: while ($db->nextRecord()) {
325: $aAllTemplates[$db->f("idtpl")] = $db->f('name');
326: }
327:
328:
329: if ($search != '' || ($filter != '' && $filter != -1)) {
330: foreach ($allTranslations as $hash => $aTranslation) {
331:
332: if ($search != '') {
333: $bFoundSearch = false;
334: if (stripos($aTranslation['string'], $search) !== false) {
335: $bFoundSearch = true;
336: }
337: foreach ($aTranslation['translations'] as $idlang => $langTranslation) {
338: if (stripos($langTranslation, $search) !== false) {
339: $bFoundSearch = true;
340: }
341: }
342: } else {
343: $bFoundSearch = true;
344: }
345:
346:
347: if ($filter != '' && $filter != -1) {
348: $bFoundFilter = false;
349: $aFilterType = explode('_', $filter);
350: if ($aFilterType[0] == 'module') {
351: $iFilterModule = $aFilterType[1];
352: if ($aTranslation['idmod'] == $iFilterModule) {
353: $bFoundFilter = true;
354: }
355: } else {
356: $iFilterTemplate = $aFilterType[1];
357: if (is_array($modulesInUse[$aTranslation['idmod']]) && array_key_exists($iFilterTemplate, $modulesInUse[$aTranslation['idmod']])) {
358: $bFoundFilter = true;
359: }
360: }
361: } else {
362: $bFoundFilter = true;
363: }
364:
365: if (!$bFoundSearch || !$bFoundFilter) {
366: unset($allTranslations[$hash]);
367: }
368: }
369: }
370:
371: unset($strings);
372: unset($fileTranslations);
373: unset($translations);
374:
375:
376: $formExtraLangsString = '';
377: if (is_array($allLanguages)) {
378:
379: $formExtraLangs = new cHTMLForm('extralangs');
380: $formExtraLangs->setVar('area', $area);
381: $formExtraLangs->setVar('frame', $frame);
382: $formExtraLangs->setVar("elemperpage", $_REQUEST["elemperpage"]);
383: $formExtraLangs->setVar("sortby", $_REQUEST["sortby"]);
384: $formExtraLangs->setVar("sortmode", $_REQUEST["sortmode"]);
385: $formExtraLangs->setVar("search", $search);
386: $formExtraLangs->setVar("filter", $filter);
387: foreach ($extraLanguages as $idExtraLang) {
388: $formExtraLangs->setVar('extralang[]', $idExtraLang);
389: }
390:
391: $labelExtraLangs = new cHTMLSpan(i18n("New language for editing") . ': ', "vALignMiddle");
392: $selectExtraLangs = new cHTMLSelectElement('extralang[]', "100px", 'newlang');
393: $selectExtraLangs->setClass("vAlignTop");
394:
395: $sql = "SELECT
396: A.name AS name, A.idlang AS idlang, B.idclientslang AS idclientslang
397: FROM
398: " . $cfg["tab"]["lang"] . " AS A,
399: " . $cfg["tab"]["clients_lang"] . " AS B
400: WHERE
401: A.idlang = B.idlang AND
402: B.idclient = '" . cSecurity::toInteger($client) . "'
403: ORDER BY A.idlang";
404:
405: $db->query($sql);
406:
407: $langNames = array();
408: $countExtraLangOptions = 0;
409: while ($db->nextRecord()) {
410: $idlang = $db->f("idlang");
411: $langString = $db->f("name") . " (" . $db->f("idlang") . ")";
412: $langNames[$idlang] = $langString;
413: if (!in_array($idlang, $allLanguages)) {
414: $option = new cHTMLOptionElement($langString, $idlang);
415: $selectExtraLangs->addOptionElement($idlang, $option);
416: $countExtraLangOptions++;
417: }
418: }
419: $submitExtraLangs = new cHTMLButton('newlangsubmit', i18n("Add"), 'newlangsubmit', false, NULL, '', 'image', "vAlignTop tableElement");
420: $submitExtraLangs->setImageSource($cfg["path"]["contenido_fullhtml"] . $cfg['path']['images'] . 'but_art_new.gif');
421:
422: $formExtraLangs->setContent($labelExtraLangs->render() . $selectExtraLangs->render() . $submitExtraLangs->render());
423: if ($countExtraLangOptions > 0) {
424: $formExtraLangsString = $formExtraLangs->render();
425: }
426: }
427:
428:
429: $formElementsPerPage = new cHTMLForm('elementsperpage');
430: $formElementsPerPage->setVar('area', $area);
431: $formElementsPerPage->setVar('frame', $frame);
432: $formElementsPerPage->setVar('idclient', $client);
433: $formElementsPerPage->setVar("sortby", $_REQUEST["sortby"]);
434: $formElementsPerPage->setVar("sortmode", $_REQUEST["sortmode"]);
435: $formElementsPerPage->setVar("search", $search);
436: $formElementsPerPage->setVar("filter", $filter);
437: foreach ($extraLanguages as $idExtraLang) {
438: $formElementsPerPage->setVar('extralang[]', $idExtraLang);
439: }
440: $labelElementsPerPage = new cHTMLLabel(i18n("Items per page:") . ':', 'elemperpage');
441: $selectElementsPerPage = new cHTMLSelectElement('elemperpage');
442:
443: foreach ($elemPerPage as $value => $option) {
444: $option = new cHTMLOptionElement($option, $value);
445: if ($_REQUEST["elemperpage"] == $value) {
446: $option->setSelected(true);
447: }
448: $selectElementsPerPage->addOptionElement($value, $option);
449: }
450: $selectElementsPerPage->setAttribute('class', 'elemperpage');
451: $submitElementsPerPage = new cHTMLButton('elemperpagesubmit', i18n("Submit"), 'elemperpagesubmit', false, NULL, '', 'image');
452: $submitElementsPerPage->setImageSource($cfg["path"]["contenido_fullhtml"] . $cfg['path']['images'] . 'but_ok.gif');
453:
454: $formElementsPerPage->setContent($labelElementsPerPage->render() . $selectElementsPerPage->render() . $submitElementsPerPage->render());
455:
456:
457: $formSearch = new cHTMLForm('searchfilter');
458: $formSearch->setVar('area', $area);
459: $formSearch->setVar('frame', $frame);
460: $formSearch->setVar("elemperpage", $elemperpage);
461: $formSearch->setVar("sortby", $_REQUEST["sortby"]);
462: $formSearch->setVar("sortmode", $_REQUEST["sortmode"]);
463: foreach ($extraLanguages as $idExtraLang) {
464: $formSearch->setVar('extralang[]', $idExtraLang);
465: }
466: $filterSelect = '<select name="filter">';
467: $filterSelect .= '<option value="-1">' . i18n("-- filter by --") . '</option>';
468: if (is_array($allModules) && count($allModules) > 0) {
469: $filterSelect .= '<optgroup label="' . i18n("Module name") . '">';
470: foreach ($allModules as $idmod => $sModule) {
471: if ($_REQUEST["filter"] == 'module_' . $idmod) {
472: $sSelected = ' selected';
473: } else {
474: $sSelected = '';
475: }
476: $filterSelect .= '<option value="module_' . $idmod . '"' . $sSelected . '>' . $sModule . '</option>';
477: }
478: $filterSelect .= '</optgroup>';
479: }
480: if (is_array($aAllTemplates) && count($aAllTemplates) > 0) {
481: $filterSelect .= '<optgroup label="' . i18n("Template") . '">';
482: foreach ($aAllTemplates as $idtpl => $sTemplate) {
483: if ($_REQUEST["filter"] == 'template_' . $idtpl) {
484: $sSelected = ' selected';
485: } else {
486: $sSelected = '';
487: }
488: $filterSelect .= '<option value="template_' . $idtpl . '"' . $sSelected . '>' . $sTemplate . '</option>';
489: }
490: $filterSelect .= '</optgroup>';
491: }
492: $searchInput = new cHTMLTextbox('search', $search, 20);
493:
494: $searchSubmit = ' <input type="image" name="searchsubmit" class="vAlignTop" value="submit" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg['path']['images'] . 'but_preview.gif">';
495:
496: $formSearch->SetContent($filterSelect . $searchInput->render() . $searchSubmit);
497:
498:
499: $list = new cGuiScrollListAlltranslations();
500:
501: $tableHeaders = array(
502: addSortImages($i, i18n('Module name')),
503: addSortImages($i, i18n('In use by')),
504: addSortImages(0, i18n('Translation ID')),
505: addSortImages(1, i18n('Current language') . ': ' . $langstring)
506: );
507: $i = 4;
508: foreach ($extraLanguages as $idExtraLang) {
509: $tableHeaders[] = '<span class="del" rel="' . $idExtraLang . '"></span> ' . addSortImages($i, i18n('Language') . ': ' . $langNames[$idExtraLang]);
510: $i++;
511: }
512: $tableHeaders[] = i18n('Edit row');
513:
514: call_user_func_array(array(
515: $list,
516: "setHeader"
517: ), $tableHeaders);
518:
519: $iHeaders = count($tableHeaders);
520: for ($i = 0; $i < $iHeaders; $i++) {
521: $list->setSortable($i, true);
522: }
523: $list->setCustom("nextpage", $iNextPage);
524: $list->setCustom("elemperpage", $_REQUEST["elemperpage"]);
525: $list->setCustom("sortby", $_REQUEST["sortby"]);
526: $list->setCustom("sortmode", $_REQUEST["sortmode"]);
527: $list->setCustom("search", $search);
528: $list->setCustom("filter", $filter);
529: foreach ($extraLanguages as $idExtraLang) {
530: $list->setCustom("extralang[]", $idExtraLang);
531: }
532: $list->setResultsPerPage($_REQUEST["elemperpage"]);
533: $list->objHeaderItem->updateAttributes(array(
534: 'width' => 52
535: ));
536: $list->objRow->updateAttributes(array(
537: 'valign' => 'top'
538: ));
539:
540: $submit = ' <input type="image" class="vAlignTop" value="submit" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg['path']['images'] . 'but_ok.gif">';
541:
542: $counter = 0;
543:
544: foreach ($allTranslations as $hash => $translationArray) {
545:
546: if (!$inUse && $perm->have_perm_area_action($area, 'con_translate_edit') && $action == 'con_translate_edit' && ($editstring == 'all' || $editstring == $hash) && ($editlang == 'all' || $editlang == $lang)) {
547: $oTranslation = new cHTMLTextarea('modtrans[' . $translationArray['idmod'] . '][' . $hash . '][' . $lang . ']', conHtmlSpecialChars($translationArray['translations'][$lang]));
548: $oTranslation->setWidth(30);
549: $sTranslationFirstLang = $oTranslation->render();
550: if ($editstring == $hash && $editlang == $lang) {
551: $sTranslationFirstLang = $sTranslationFirstLang . $submit;
552: }
553: } else {
554: if (!$inUse && $perm->have_perm_area_action($area, 'con_translate_edit') && $editstring != 'all') {
555: $linkEdit = new cHTMLLink();
556: $linkEdit->setCLink($area, $frame, "con_translate_edit");
557: $linkEdit->setContent('<img src="' . $cfg["path"]["contenido_fullhtml"] . $cfg['path']['images'] . 'editieren.gif" alt="' . i18n("Edit") . '" title="' . i18n("Edit") . '">');
558: $linkEdit->setCustom("editstring", $hash);
559: $linkEdit->setCustom("editlang", $lang);
560: $linkEdit->setCustom("elemperpage", $_REQUEST["elemperpage"]);
561: $linkEdit->setCustom("page", $_REQUEST["page"]);
562: $linkEdit->setCustom("sortby", $_REQUEST["sortby"]);
563: $linkEdit->setCustom("sortmode", $_REQUEST["sortmode"]);
564: $linkEdit->setCustom("search", $search);
565: $linkEdit->setCustom("filter", $filter);
566:
567: $idExtraLangCount = 0;
568: foreach ($extraLanguages as $idExtraLangTemp) {
569: $linkEdit->setCustom("extralang[$idExtraLangCount]", $idExtraLangTemp);
570: $idExtraLangCount++;
571: }
572:
573: $sLinkEdit = ' ' . $linkEdit->render();
574: } else {
575: $sLinkEdit = '';
576: }
577: $sTranslationFirstLang = trim(conHtmlentities($translationArray['translations'][$lang])) . $sLinkEdit;
578: }
579:
580: $countCurrentModuleInUse = count($modulesInUse[$translationArray['idmod']]);
581: if ($countCurrentModuleInUse == 0) {
582: $inUseString = '';
583: $currentModuleInUse = i18n('No template');
584: } else {
585:
586: $inUseString = i18n("Click for more information about usage");
587: $currentModuleInUse = '<a href="javascript:;" rel="' . $translationArray['idmod'] . '" class="in_used_mod"><img src="' . $cfg['path']['images'] . 'info.gif" border="0" title="' . $inUseString . '" alt="' . $inUseString . '">' . $countCurrentModuleInUse . ' ' . ($countCurrentModuleInUse == 1? i18n('Template') : i18n('Templates')) . ' </a>';
588: }
589: $fields = array(
590: $counter,
591: $allModules[$translationArray['idmod']],
592: $currentModuleInUse,
593: $translationArray['string'],
594: $sTranslationFirstLang
595: );
596: foreach ($extraLanguages as $idExtraLang) {
597: if (!$inUse && $perm->have_perm_area_action($area, 'con_translate_edit') && $action == 'con_translate_edit' && ($editstring == 'all' || $editstring == $hash) && ($editlang == 'all' || $editlang == $idExtraLang)) {
598:
599: $oExtraTranslation = new cHTMLTextarea('modtrans[' . $translationArray['idmod'] . '][' . $hash . '][' . $idExtraLang . ']', conHtmlSpecialChars($translationArray['translations'][$idExtraLang]));
600: $oExtraTranslation->setWidth(30);
601:
602: if ($editstring == $hash && $editlang == $idExtraLang) {
603: $submitTranslation = $submit;
604: } else {
605: $submitTranslation = '';
606: }
607: $fields[] = $oExtraTranslation->render() . $submitTranslation;
608: } else {
609: if (!$inUse && $perm->have_perm_area_action($area, 'con_translate_edit') && $editstring != 'all') {
610: $linkEdit = new cHTMLLink();
611: $linkEdit->setCLink($area, $frame, "con_translate_edit");
612: $linkEdit->setContent('<img src="' . $cfg["path"]["contenido_fullhtml"] . $cfg['path']['images'] . 'editieren.gif" alt="' . i18n("Edit") . '" title="' . i18n("Edit") . '">');
613: $linkEdit->setCustom("editstring", $hash);
614: $linkEdit->setCustom("editlang", $idExtraLang);
615: $linkEdit->setCustom("elemperpage", $_REQUEST["elemperpage"]);
616: $linkEdit->setCustom("page", $_REQUEST["page"]);
617: $linkEdit->setCustom("sortby", $_REQUEST["sortby"]);
618: $linkEdit->setCustom("sortmode", $_REQUEST["sortmode"]);
619: $linkEdit->setCustom("search", $search);
620: $linkEdit->setCustom("filter", $filter);
621:
622: $idExtraLangCount = 0;
623: foreach ($extraLanguages as $idExtraLangTemp) {
624: $linkEdit->setCustom("extralang[$idExtraLangCount]", $idExtraLangTemp);
625: $idExtraLangCount++;
626: }
627:
628: $sLinkEdit = ' ' . $linkEdit->render();
629: } else {
630: $sLinkEdit = '';
631: }
632: $fields[] = trim(conHtmlentities($translationArray['translations'][$idExtraLang])) . $sLinkEdit;
633: }
634: }
635: if ($action == 'con_translate_edit' && $editstring == $hash && $editlang == 'all') {
636: $fields[] = $submit;
637: } else {
638: if (!$inUse && $perm->have_perm_area_action($area, 'con_translate_edit')) {
639: $linkEditRow = new cHTMLLink();
640: $linkEditRow->setCLink($area, $frame, "con_translate_edit");
641: $linkEditRow->setContent('<img src="' . $cfg["path"]["contenido_fullhtml"] . $cfg['path']['images'] . 'editieren.gif" alt="' . i18n("Edit") . '" title="' . i18n("Edit") . '">');
642: $linkEditRow->setCustom("editstring", $hash);
643: $linkEditRow->setCustom("editlang", 'all');
644: $linkEditRow->setCustom("elemperpage", $_REQUEST["elemperpage"]);
645: $linkEditRow->setCustom("page", $_REQUEST["page"]);
646: $linkEditRow->setCustom("sortby", $_REQUEST["sortby"]);
647: $linkEditRow->setCustom("sortmode", $_REQUEST["sortmode"]);
648: $linkEditRow->setCustom("search", $search);
649: $linkEditRow->setCustom("filter", $filter);
650:
651: $idExtraLangCount = 0;
652: foreach ($extraLanguages as $idExtraLangTemp) {
653: $linkEditRow->setCustom("extralang[$idExtraLangCount]", $idExtraLangTemp);
654: $idExtraLangCount++;
655: }
656:
657: $sLinkEditRow = ' ' . $linkEditRow->render();
658: } else {
659: $sLinkEditRow = ' ';
660: }
661: $fields[] = $sLinkEditRow;
662: }
663:
664: call_user_func_array(array(
665: $list,
666: "setData"
667: ), $fields);
668: $counter++;
669: }
670:
671:
672:
673: $counter = count($allTranslations);
674:
675: $list->sort($_REQUEST["sortby"], $_REQUEST["sortmode"]);
676: $list->setListStart($_REQUEST["page"]);
677: $form = new cHTMLForm('all_mod_translations');
678: $form->setVar('area', $area);
679: $form->setVar('action', 'con_translate_edit');
680: $form->setVar('frame', 4);
681: $form->setVar("elemperpage", $_REQUEST["elemperpage"]);
682: $form->setVar("page", $_REQUEST["page"]);
683: $form->setVar("sortby", $_REQUEST["sortby"]);
684: $form->setVar("sortmode", $_REQUEST["sortmode"]);
685: $form->setVar("search", $search);
686: $form->setVar("filter", $filter);
687:
688: $idExtraLangCount = 0;
689: foreach ($extraLanguages as $idExtraLangTemp) {
690: $form->setVar("extralang[$idExtraLangCount]", $idExtraLangTemp);
691: $idExtraLangCount++;
692: }
693:
694: $form->setVar('contenido', $contenido);
695: $form->setContent($list->render());
696:
697:
698: $pagerLink = new cHTMLLink();
699: $pagerl = "pagerlink";
700: $pagerLink->setTargetFrame('right_bottom');
701: $pagerLink->setLink("main.php");
702: $pagerLink->setCustom("elemperpage", $elemperpage);
703: $pagerLink->setCustom("sortby", $_REQUEST["sortby"]);
704: $pagerLink->setCustom("sortmode", $_REQUEST["sortmode"]);
705: $pagerLink->setCustom("search", $search);
706: $pagerLink->setCustom("frame", $frame);
707: $pagerLink->setCustom("area", $area);
708: $pagerLink->setCustom("search", $search);
709: $pagerLink->setCustom("filter", $filter);
710:
711: $idExtraLangCount = 0;
712: foreach ($extraLanguages as $idExtraLangTemp) {
713: $pagerLink->setCustom("extralang[$idExtraLangCount]", $idExtraLangTemp);
714: $idExtraLangCount++;
715: }
716:
717: $pagerLink->setCustom("contenido", $sess->id);
718: $pager = new cGuiObjectPager("02420d6b-a77e-4a97-9395-7f6be480f471", $counter, $_REQUEST["elemperpage"], $_REQUEST["page"], $pagerLink, "page", $pagerl);
719:
720: $delLangLink = new cHTMLLink();
721: $delLangLink->setTargetFrame('right_bottom');
722: $delLangLink->setLink("main.php");
723: $delLangLink->setCustom("elemperpage", $elemperpage);
724: $delLangLink->setCustom("sortby", $_REQUEST["sortby"]);
725: $delLangLink->setCustom("sortmode", $_REQUEST["sortmode"]);
726: $delLangLink->setCustom("search", $search);
727: $delLangLink->setCustom("filter", $filter);
728: $delLangLink->setCustom("frame", $frame);
729: $delLangLink->setCustom("area", $area);
730: $delLangLink->setCustom("contenido", $sess->id);
731:
732: $idExtraLangCount = 0;
733: foreach ($extraLanguages as $idExtraLangTemp) {
734: $delLangLink->setCustom("extralang[$idExtraLangCount]", $idExtraLangTemp);
735: $idExtraLangCount++;
736: }
737:
738: $delLangLink->setCustom("dellang", '');
739: $delLangHref = $delLangLink->getHref();
740:
741: $page->set("s", "NEWLANG", $formExtraLangsString);
742: $page->set("s", "SEARCH", $formSearch->render());
743: $page->set("s", "ELEMPERPAGE", $formElementsPerPage->render());
744: $page->set("s", "FORM", $form->render());
745: $page->set("s", "PAGER", $pager->render(true));
746: $page->set("s", "DELLANGIMG", $cfg["path"]["contenido_fullhtml"] . $cfg['path']['images'] . 'but_cancel.gif');
747: $page->set("s", "DELLANGALT", i18n("Delete"));
748: $page->set("s", "DELLANGHREF", $delLangHref);
749: $page->set("s", "MODULEINUSETEXT", i18n("The module "%s" is used for following templates"));
750: $page->set("s", "INFO", $message . '<p class="notify_general notify_warning">' . i18n("WARNING: Translations have effects on every article that uses the module!") . '</p>');
751: $page->setMarkScript(2);
752: $page->setEncoding($langobj->get('encoding'));
753: $page->render();
754: