function rowTranslation($oPage, $bExportDisabled, $bNoticePhp, $bNoticeAcl) { $sTime = Anwi18n::dateTime($oPage->getTime()); $nPageId = $oPage->getId(); $sContentClass = $oPage->getPageGroup()->getContentClass()->getLabel(); if ($oPage->isTranslated()) { $sUntranslated = $this->g_("translation_complete"); $sColor = 'green'; } else { $nTranslatedPercent = $oPage->getTranslatedPercent(); $sUntranslated = $this->g_("translation_progress", array("percent" => $nTranslatedPercent)); if ($nTranslatedPercent < 25) { $sColor = 'red'; } else { $sColor = 'orange'; } } $sDisabled = $bExportDisabled ? ' disabled="disabled"' : ""; $sNoticePhp = $bNoticePhp ? $this->drawNoticeIcon($this->t_("notice_php")) : ""; $sNoticeAcl = $bNoticeAcl ? $this->drawNoticeIcon($this->t_("notice_acl")) : ""; $sImgFlag = Anwi18n::imgFlag($oPage->getLang()); $HTML = <<<EOF \t\t<li> \t\t\t<div class="colpagename"> \t\t\t\t<input type="checkbox" name="exportpages[]" class="chkexport" value="{$this->xQuote($nPageId)}" id="exportpages{$nPageId}"{$sDisabled}/> \t\t\t\t<label for="exportpages{$nPageId}">{$sImgFlag} {$this->xText($oPage->getName())}</label> {$sNoticePhp} {$sNoticeAcl} \t\t\t</div> \t\t\t<div class="colprogress"><span style="color:{$sColor}">{$sUntranslated}</span></div> \t\t\t<div class="colcontentclass">{$sContentClass}</div> \t\t\t<div class="coltime">{$sTime}</div> \t\t</li> EOF; return $HTML; }
function lastchangesLine($sTime, $sType, $sComment, $sInfo, $sUserLogin, $sLnkPage, $sLnkDiff, $sLnkHistory = false, $sLnkRevert, $sPageName, $sPageLang) { static $n = 0; $n = $n % 2 + 1; $sCss = 'line' . $n; $sImgFlag = Anwi18n::imgFlag($sPageLang); $sInfo = $sInfo == "" ? "" : "<div class=\"changeinfo\">" . $sInfo . "</div>"; // info and comment are already escaped $HTML = <<<EOF \t\t<tr class="{$this->xQuote($sCss)}"> \t\t\t<td class="changetime">{$sTime}</td> \t\t\t<td class="changepageoriginal">{$sImgFlag}{$this->xText($sPageName)}</td> \t\t\t<td class="changetype">{$sType}{$sInfo}</td> \t\t\t<td class="changecomment">{$sComment}</td> \t\t\t<td class="changelogin">{$this->xText($sUserLogin)}</td> \t\t\t<td class="changepage">{$sLnkPage}</td> \t\t\t<td class="changediff">{$sLnkDiff}</td> EOF; if ($sLnkHistory) { $HTML .= <<<EOF \t\t\t<td class="changehistory">{$sLnkHistory}</td> EOF; } $HTML .= <<<EOF \t\t\t<td class="changerevert">{$sLnkRevert}</td> \t\t</tr> EOF; return $HTML; }
function newTranslationCreated($sTranslationLang, $sTranslationLink) { $sImgFlag = Anwi18n::imgFlag($sTranslationLang); $HTML = <<<EOF \t<li>{$sTranslationLink}</li> EOF; return $HTML; }
function rowProcessDuplication_failed($sPageName, $sPageLang, $asNotices) { $sNotices = ""; foreach ($asNotices as $sNotice) { $sNotices .= $this->drawNoticeIcon($sNotice) . ' '; } $sImgFlag = Anwi18n::imgFlag($sPageLang); $HTML = <<<EOF \t\t<li>{$sImgFlag}{$this->xText($sPageName)} : <span style="color:red">{$this->t_('process_fail')}</span> {$sNotices}</li> EOF; return $HTML; }
function newTranslationRow($sLang, $sDefaultPageNameValue, $sInputName, $sCheckBoxName) { $sImgFlag = Anwi18n::imgFlag($sLang); $sSrcFlag = Anwi18n::srcFlag($sLang); $HTML = <<<EOF \t\t<input type="checkbox" name="{$this->xQuote($sCheckBoxName)}" value="1" id="{$this->xQuote($sCheckBoxName)}" class="newtranslation_lang" style="float:left"/> \t\t<label for="{$this->xQuote($sCheckBoxName)}" style="width:100px; float:left;"> \t\t\t{$sImgFlag} {$sLang} : \t\t</label> \t\t<input type="text" name="{$this->xQuote($sInputName)}" value="{$this->xQuote($sDefaultPageNameValue)}" class="intext inpagename" style="background-image:url('{$sSrcFlag}')"/><br/> EOF; return $HTML; }
function editForm($formaction, $sContentHtmlDir, $sPagename, $sContentFieldsHtml, $sLang, $sContentClassName, $htmldrafts, $nDraftTime = false, $summary, $bShowCaptcha, $error) { $sFlag = Anwi18n::imgFlag($sLang); $HTML = <<<EOF \t<h1>{$this->t_('title', array('pagename' => '<i>' . $this->xText($sPagename) . '</i>'))} {$sFlag} <span style="font-size:0.7em">{$this->xText($sContentClassName)}</span></h1> \t{$this->errorList($error)} \t<form action="{$this->xQuote($formaction)}" method="post" id="edit_form" class="editcontent"> {$sContentFieldsHtml} \t\t<div style="height:30px"></div> \t\t<input type="hidden" name="posted" value="1" /> EOF; // <input type="hidden" name="draft" value="{$this->xQuote($nDraftTime)}" /> if ($bShowCaptcha) { $HTML .= <<<EOF {$this->showCaptcha()}<br/> EOF; } $sAbortLabel = self::g_("in_abort"); $HTML .= <<<EOF \t\t{$this->g_('in_comment')} <input type="text" name="comment" class="intext incomment" id="comment" size="50" value="{$this->xQuote($summary)}" /> \t\t<input type="submit" name="publish" class="insubmit" value="{$this->xQuote($this->t_("publish"))}" /> \t\t<input type="submit" name="preview" class="inbutton" value="{$this->xQuote($this->t_("preview"))}" /> \t\t<input type="submit" name="abort" value="{$this->xQuote($sAbortLabel)}" class="inabort"/> \t\t<br/> EOF; /* {$this->t_('drafts')} <input type="submit" name="savenewdraft" class="insubmit" value="{$this->t_('savenewdraft')}" /> if ($nDraftTime) { $HTML .= <<<EOF <input type="submit" name="updatedraft" class="insubmit" value="{$this->t_('updatedraft')}" /> <input type="submit" name="discarddraft" class="inabort" value="{$this->t_('discarddraft')}" onclick="return confirm('{$this->t_('discarddraft_alert')}');" /> EOF; }*/ $HTML .= <<<EOF \t</form> \t \t{$htmldrafts} EOF; return $HTML; }
function translationRowCurrent($sLang, $sPageName) { $sImgFlag = Anwi18n::imgFlag($sLang); $sSrcFlag = Anwi18n::srcFlag($sLang); $HTML = <<<EOF \t\t<div class="div_translation"> \t\t\t<input type="checkbox" name="lang_current" id="lang_current" value="null" style="float:left" checked="checked" disabled="disabled"/> \t\t\t<label for="lang_current" style="width:100px; float:left;"> \t\t\t\t{$sImgFlag} {$sLang} : \t\t\t</label> \t\t\t<input type="text" name="pagename_current" value="{$this->xQuote($sPageName)}" class="intext inpagename" style="background-image:url('{$sSrcFlag}')" disabled="disabled"/><br/> \t\t</div> EOF; return $HTML; }
function changeLangForm($sLang, $sComment, $selectlang, $sPagename, $formaction, $sError) { $sFlag = Anwi18n::imgFlag($sLang); $sSubmitLabel = self::g_("in_submit"); $sAbortLabel = self::g_("in_abort"); $HTML = <<<EOF \t<h1>{$this->t_('title', array("pagename" => "<i>" . $this->xText($sPagename) . "</i>"))} {$sFlag}</h1> \t{$this->errorList($sError)} \t<form action="{$this->xQuote($formaction)}" method="post" id="changelang_form"> \t\t{$this->g_('in_pagelang')} {$selectlang}<br/> \t\t{$this->g_('in_comment')} <input type="text" name="comment" id="comment" class="intext incomment" value="{$this->xQuote($sComment)}"/><br/> \t\t<input type="submit" name="changelang" class="insubmit" value="{$this->xQuote($sSubmitLabel)}" /> \t\t<input type="submit" name="abort" class="inabort" value="{$this->xQuote($sAbortLabel)}"/> \t</form> EOF; return $HTML; }
function translateform($sContentHtmlDir, $sCss, $sReferenceHtmlDir, $formaction, $content, $nRev, $langfrom, $langto, $selectPageRef) { $sImgFlagFrom = Anwi18n::imgFlag($langfrom); $sImgFlagTo = Anwi18n::imgFlag($langto); $sAbortLabel = self::g_("in_abort"); $sTranslateSaveLabel = $this->t_("translate_button_save"); $sTranslatePreviousLabel = $this->t_("translate_button_previous"); $sTranslateNextLabel = $this->t_("translate_button_next"); $sTranslateRevertLabel = $this->t_("translate_button_revert"); $sTranslateCloseLabel = $this->t_("translate_button_closepanel"); $sTranslateUndoAllLabel = $this->t_("translate_button_undoneall"); $sTranslateDoneAllLabel = $this->t_("translate_button_doneall"); $sTranslateRefreshLabel = $this->t_("translate_button_refresh"); $HTML = <<<EOF \t<div class="explain"> \t\t{$this->t_('translate_explain')} \t\t<ol> \t\t\t<li>{$this->t_('translate_explain_1', array('selectref' => $selectPageRef))}</li> \t\t\t<li>{$this->t_('translate_explain_2')}</li> \t\t\t<li>{$this->t_('translate_explain_3')}</li> \t\t\t<li>{$this->t_('translate_explain_4')}</li> \t\t</ol> \t\t<input type="button" onclick="oTranslator.save();return false;" class="insubmit" value="{$this->xQuote($sTranslateSaveLabel)}"/> \t\t<input type="button" onclick="window.location=window.location+'&abort=1'" class="inabort" value="{$this->xQuote($sAbortLabel)}"/> \t\t \t</div> \t \t<form action="{$this->xQuote($formaction)}" method="post" id="translateform"> \t\t<input type="hidden" name="save" value="1"/> \t\t<input type="hidden" name="rev" value="{$this->xQuote($nRev)}"/> \t\t<div id="panel"> \t\t\t<fieldset id="panel_current"> \t\t\t\t<legend>{$this->t_('translate_panel_currentarea')}</legend> \t\t\t\t<div style="text-align:center"> \t\t\t\t\t<input type="button" onclick="oTranslator.translatePrevious();return false;" class="inbutton" value="{$this->xQuote($sTranslatePreviousLabel)}"/> \t\t\t\t\t<input type="button" onclick="oTranslator.translateNext();return false;" class="inbutton" value="{$this->xQuote($sTranslateNextLabel)}"/><br/> \t\t\t\t\t<input type="checkbox" id="panel_skiptranslated" checked="checked"/><label for="panel_skiptranslated" title="will move to the next untranslated string">{$this->t_('translate_chk_skiptranslated')}</label> \t\t\t\t</div> \t\t\t\t \t\t\t\t{$sImgFlagFrom} {$this->t_('translate_original_value')}<br/> \t\t\t\t<div id="panel_original" dir="{$this->xQuote($sReferenceHtmlDir)}"></div><br/> \t\t\t\t{$sImgFlagTo} {$this->t_('translate_translated_value')}<br/> \t\t\t\t<textarea id="panel_translate" rows="2" dir="{$this->xQuote($sContentHtmlDir)}"></textarea><br/> \t\t\t\t<input type="checkbox" id="panel_done"/><label for="panel_done">{$this->t_('translate_chk_translated')}</label><br/> \t\t\t\t<div style="display:none"><input type="checkbox" id="panel_apply"/><label for="panel_apply">{$this->t_('translate_chk_apply')}</label><br/></div> \t\t\t\t<input type="checkbox" id="panel_autotranslate"/><label for="panel_autotranslate">{$this->t_('translate_chk_autotranslate')}</label> \t\t\t \t\t\t\t<div class="panel_buttons"> \t\t\t\t\t<input type="button" onclick="oTranslator.revert();return false;" class="inabort" value="{$this->xQuote($sTranslateRevertLabel)}"/> \t\t\t\t\t<input type="button" onclick="oTranslator.save();return false;" class="insubmit" value="{$this->xQuote($sTranslateSaveLabel)}"/> \t\t\t\t\t<input type="button" onclick="window.location=window.location+'&abort=1'" class="inabort" value="{$this->xQuote($sAbortLabel)}"/> \t\t\t\t\t<input type="button" onclick="oTranslator.hidePanel();return false;" class="inbutton" value="{$this->xQuote($sTranslateCloseLabel)}"/> \t\t\t\t</div> \t\t\t</fieldset> \t\t\t<fieldset id="panel_global"> \t\t\t\t<legend>{$this->t_('translate_panel_globalarea')}</legend> \t\t\t\t<div class="panel_buttons"> \t\t\t\t\t<input type="button" onclick="oTranslator.undoneall();return false;" class="inabort" value="{$this->xQuote($sTranslateUndoAllLabel)}"/> \t\t\t\t\t<input type="button" onclick="oTranslator.doneall();return false;" class="insubmit" value="{$this->xQuote($sTranslateDoneAllLabel)}"/> \t\t\t\t\t<input type="button" onclick="window.location=window.location" class="inabort" value="{$this->xQuote($sTranslateRefreshLabel)}"/> \t\t\t\t</div> \t\t\t</fieldset> \t\t\t<fieldset id="panel_shortcuts"> \t\t\t\t<legend>{$this->t_('translate_panel_shortcuts')}</legend> \t\t\t\t<label>CTRL+Enter</label>{$this->t_('translate_shortcut_next')}<br/> \t\t\t\t<label>CTRL+Shift+Enter</label>{$this->t_('translate_shortcut_nextandmark')}<br/> \t\t\t</fieldset> \t\t</div> \t\t<div id="translator"></div> \t</form> \t \t<div class="{$this->xQuote($sCss)}"> \t{$content} \t</div> EOF; return $HTML; }
function rowTranslationProcess_skipped($sPageName, $sPageLang) { $sImgFlag = Anwi18n::imgFlag($sPageLang); $HTML = <<<EOF \t\t<li>{$sImgFlag}{this->xText({$sPageName})} : <span style="color:#CCC">{$this->t_('process_skipped')}</span></li> EOF; return $HTML; }