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