예제 #1
0
    function rowTranslation($sChkName, $sInputPageName, $sInputPageLang, $sOriginalPageName, $sPageName, $sPageLang, $nPageTime, $bImportDisabled, $asNotices)
    {
        $sDisabled = $bImportDisabled ? ' disabled="disabled"' : "";
        $sNotices = "";
        foreach ($asNotices as $sNotice) {
            $sNotices .= $this->drawNoticeIcon($sNotice) . ' ';
        }
        $sPageTime = Anwi18n::dateTime($nPageTime);
        $sImgFlag = Anwi18n::imgFlag($sPageLang);
        $sSrcFlag = Anwi18n::srcFlag($sPageLang);
        $HTML = <<<EOF

\t\t<li>
\t\t\t<input type="checkbox" name="{$this->xQuote($sChkName)}[]" class="chkimport" id="{$this->xQuote($sOriginalPageName)}" value="{$this->xQuote($sOriginalPageName)}"{$sDisabled}/> 
\t\t\t<label for="{$this->xQuote($sOriginalPageName)}">{$sImgFlag}{$this->xText($sPageName)} ({$sPageTime}) {$sNotices}</label>
EOF;
        if (!$bImportDisabled) {
            $sSelectLang = $this->selectLang(null, $sPageLang);
            $HTML .= <<<EOF
\t\t<input type="text" class="intext inpagename" style="background-image:url('{$sSrcFlag}')" name="{$this->xQuote($sInputPageName)}" value="{$this->xQuote($sPageName)}"/>
\t\t<select class="languages" name="{$this->xQuote($sInputPageLang)}">{$sSelectLang}</select> 
EOF;
        }
        $HTML .= <<<EOF
\t\t</li>
EOF;
        return $HTML;
    }
예제 #2
0
 function availableTranslationsRow($oPage)
 {
     $sName = $oPage->getName();
     $sUrl = AnwUtils::link($oPage);
     $sStyle = "background:url('" . Anwi18n::srcFlag($oPage->getLang()) . "') no-repeat left;";
     $HTML = "<a href=\"" . $this->xQuote($sUrl) . "\" style=\"{$sStyle}\">" . $this->xText($sName) . "</a>";
     return $HTML;
 }
예제 #3
0
    function duplicateRow($sTranslationLang, $sTranslationPageName, $sInputName, $sCheckBoxName)
    {
        $sImgFlag = Anwi18n::imgFlag($sTranslationLang);
        $sSrcFlag = Anwi18n::srcFlag($sTranslationLang);
        $HTML = <<<EOF

\t\t<input type="checkbox" name="{$this->xQuote($sCheckBoxName)}" value="1" id="{$this->xQuote($sCheckBoxName)}" class="duplicate_lang" style="float:left"/>
\t\t<label for="{$this->xQuote($sCheckBoxName)}" style="width:100px; float:left;">
\t\t\t{$sImgFlag} {$sTranslationLang} :
\t\t</label>
\t\t<input type="text" name="{$this->xQuote($sInputName)}" value="{$this->xQuote($sTranslationPageName)}" class="intext inpagename" style="background-image:url('{$sSrcFlag}')"/><br/>
EOF;
        return $HTML;
    }
예제 #4
0
    function renameForm($sNewPageName, $sLang, $sComment, $sPagename, $formaction, $aoPageGroupsLinked, $sError)
    {
        $sSrcFlagTr = Anwi18n::srcFlag($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>'))}</h1>
\t{$this->errorList($sError)}
\t<form action="{$this->xQuote($formaction)}" method="post" id="rename_form">
\t\t{$this->g_('in_pagename')} <input type="text" name="newname" class="intext inpagename" id="newname" style="background-image:url('{$sSrcFlagTr}')" value="{$this->xQuote($sNewPageName)}"/><br/> 
\t\t{$this->g_('in_comment')} <input type="text" name="comment" class="intext incomment" id="comment" value="{$this->xQuote($sComment)}"/><br/>
\t\t
\t\t
\t\t<input type="submit" name="rename" class="insubmit" value="{$this->xQuote($sSubmitLabel)}" />
\t\t<input type="submit" name="abort" class="inabort" value="{$this->xQuote($sAbortLabel)}" />
EOF;
        if (count($aoPageGroupsLinked) > 0) {
            $HTML .= <<<EOF

\t\t<br/><input type="checkbox" name="updatelinks" value="1" checked="checked" id="updatelinks"/><label for="updatelinks">{$this->t_('rename_updatelinks')}</label><br/>
EOF;
        }
        $HTML .= <<<EOF
\t</form>
EOF;
        if (count($aoPageGroupsLinked) > 0) {
            $HTML .= <<<EOF

\t\t<p>{$this->t_('rename_links')}</p>
\t\t<ul>
EOF;
            foreach ($aoPageGroupsLinked as $oPageGroupLinked) {
                $aoPagesLinked = $oPageGroupLinked->getPages();
                foreach ($aoPagesLinked as $oPageLinked) {
                    $HTML .= <<<EOF

\t\t\t<li>{$oPageLinked->link()}</li>
EOF;
                }
            }
            $HTML .= <<<EOF

\t\t</ul>
EOF;
        }
        return $HTML;
    }
예제 #5
0
    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 newTranslationRow($sRefLang, $sRefName, $nPageRefId, $sTrLang, $sTrNameDefault, $sInputRef, $sInputName, $sCheckBoxName)
    {
        $sImgFlagRef = Anwi18n::imgFlag($sRefLang);
        $sSrcFlagTr = Anwi18n::srcFlag($sTrLang);
        $HTML = <<<EOF

\t<input type="checkbox" name="{$this->xQuote($sCheckBoxName)}" value="1" id="{$this->xQuote($sCheckBoxName)}" class="newtranslation_lang" style="float:left"/>
\t<input type="hidden" name="{$this->xQuote($sInputRef)}" value="{$this->xQuote($nPageRefId)}"/>
\t<label for="{$this->xQuote($sCheckBoxName)}" style="width:500px; float:left; border-bottom:1px dotted #CCCCCC;">
\t\t{$sImgFlagRef} {$sRefName} :
\t</label>
\t<input type="text" name="{$this->xQuote($sInputName)}" id="pagename" value="{$this->xQuote($sTrNameDefault)}" class="intext inpagename" style="background-image:url('{$sSrcFlagTr}')"/><br/>
\t<div style="clear:both"></div>
EOF;
        return $HTML;
    }
예제 #7
0
 function selectLang($langs = null, $selectedlang = null)
 {
     $HTML = '';
     if (!$langs) {
         $langs = AnwComponent::globalCfgLangs();
     }
     if (!$selectedlang) {
         $selectedlang = AnwCurrentSession::getLang();
     }
     foreach ($langs as $lang) {
         $selected = $lang == $selectedlang ? ' selected="selected"' : "";
         $sSrcFlag = Anwi18n::srcFlag($lang);
         $HTML .= "<option value=\"" . $this->xQuote($lang) . "\"{$selected} style=\"background-image:url('{$sSrcFlag}');\">{$this->g_('lang_' . $lang)}</option>";
     }
     return $HTML;
 }
예제 #8
0
 function link($action = 'view')
 {
     $sSrcFlag = Anwi18n::srcFlag($this->getLang());
     if ($action) {
         $sLink = AnwUtils::link($this, $action);
         $HTML = "<a href=\"" . AnwUtils::xQuote($sLink) . "\" style=\"background:url('{$sSrcFlag}') no-repeat left;padding-left:18px;\">" . AnwUtils::xText($this->getName()) . "</a>";
     } else {
         $HTML = "<span style=\"background:url('{$sSrcFlag}') no-repeat left;padding-left:18px;\">" . AnwUtils::xText($this->getName()) . "</span>";
     }
     return $HTML;
 }