Annotation of /mambo/branches/4.6/administrator/components/com_languages/views/templates/editcatalog.tpl.php
Parent Directory
|
Revision Log
Revision 466 - (view) (download)
| 1 : | csouza | 403 | <input type="hidden" name="domain" value="<?php echo $catalog->name ?>" /> |
| 2 : | <input type="hidden" name="textdomain" value="<?php echo $catalog->path ?>" /> | ||
| 3 : | <input type="hidden" name="lang" value="<?php echo $catalog->lang ?>" /> | ||
| 4 : | <?php mosCommonHTML::loadOverlib(); ?> | ||
| 5 : | <script type="text/javascript"> | ||
| 6 : | function update(value, is_plural, nplural) | ||
| 7 : | { | ||
| 8 : | row_id = document.getElementById('row_id'); | ||
| 9 : | if(is_plural) { | ||
| 10 : | trans = document.getElementById('msgstr_'+nplural+'_'+row_id.value); | ||
| 11 : | trans.value = value; | ||
| 12 : | if(nplural == 0) display = value; | ||
| 13 : | } else { | ||
| 14 : | trans = document.getElementById('msgstr_'+row_id.value); | ||
| 15 : | transspan = document.getElementById('msgstr_'+row_id.value+'_span'); | ||
| 16 : | trans.value = value; | ||
| 17 : | display = value; | ||
| 18 : | } | ||
| 19 : | transspan = document.getElementById('msgstr_'+row_id.value+'_span'); | ||
| 20 : | transspan.innerHTML = display; | ||
| 21 : | } | ||
| 22 : | function translate(row, id, is_plural, nplurals){ | ||
| 23 : | singular = document.getElementById('singular'); | ||
| 24 : | plural = document.getElementById('plural'); | ||
| 25 : | row_class = document.getElementById('row_class'); | ||
| 26 : | row_id = document.getElementById('row_id'); | ||
| 27 : | if(is_plural) { | ||
| 28 : | plural.style.display = 'block'; | ||
| 29 : | singular.style.display = 'none'; | ||
| 30 : | msgid = document.getElementById('msgid_'+id); | ||
| 31 : | original = document.getElementById('p_msgid'); | ||
| 32 : | original.value = msgid.value; | ||
| 33 : | msgid_plural = document.getElementById('msgid_plural_'+id); | ||
| 34 : | original_plural = document.getElementById('p_msgid_plural'); | ||
| 35 : | original_plural.value = msgid_plural.value; | ||
| 36 : | for(a = 0; a < nplurals; a++) { | ||
| 37 : | msgstr = document.getElementById('msgstr_'+a+'_'+id); | ||
| 38 : | translation = document.getElementById('p_msgstr_'+a); | ||
| 39 : | translation.value = msgstr.value | ||
| 40 : | } | ||
| 41 : | } else { | ||
| 42 : | plural.style.display = 'none'; | ||
| 43 : | singular.style.display = 'block'; | ||
| 44 : | msgid = document.getElementById('msgid_'+id); | ||
| 45 : | original = document.getElementById('s_msgid'); | ||
| 46 : | original.value = msgid.value; | ||
| 47 : | msgstr = document.getElementById('msgstr_'+id); | ||
| 48 : | translation = document.getElementById('s_msgstr'); | ||
| 49 : | translation.value = msgstr.value; | ||
| 50 : | } | ||
| 51 : | prev_row = document.getElementById('row_'+row_id.value); | ||
| 52 : | if (prev_row) prev_row.className = row_class.value; | ||
| 53 : | row_class.value = row.className; | ||
| 54 : | row_id.value = id; | ||
| 55 : | row.className = 'transhighlight'; | ||
| 56 : | } | ||
| 57 : | csouza | 466 | |
| 58 : | function togglefuzzy(img, checkbox) { | ||
| 59 : | if(checkbox.value == 'false') { | ||
| 60 : | checkbox.value = 'true'; | ||
| 61 : | img.src = 'images/publish_x.png'; | ||
| 62 : | } else if(checkbox.value == 'true') { | ||
| 63 : | checkbox.value = 'false'; | ||
| 64 : | img.src = 'images/tick.png'; | ||
| 65 : | } | ||
| 66 : | alert(checkbox.value); | ||
| 67 : | } | ||
| 68 : | csouza | 403 | </script> |
| 69 : | <style> | ||
| 70 : | table.adminlist th {text-align:left} | ||
| 71 : | legend {font-weight:bold;} | ||
| 72 : | .transhighlight {background-color:#80B5D7;} | ||
| 73 : | div.strings {height:400px;overflow:auto;} | ||
| 74 : | </style> | ||
| 75 : | |||
| 76 : | <table><tr><td style="width:75%;vertical-align:top"> | ||
| 77 : | <?php | ||
| 78 : | $tabs = new mosTabs(1); | ||
| 79 : | $tabs->startPane("catalog"); | ||
| 80 : | $tabs->startTab(T_("Messages"),"messages"); | ||
| 81 : | ?> | ||
| 82 : | <table class="adminlist"> | ||
| 83 : | <tr> | ||
| 84 : | <th style="width:50px"> | ||
| 85 : | csouza | 466 | <?php echo T_('Verified') ?> |
| 86 : | csouza | 403 | </th> |
| 87 : | <th style="width:40%;text-align:center;"> | ||
| 88 : | <?php echo T_('Original') ?> | ||
| 89 : | </th> | ||
| 90 : | <th style="width:40%;text-align:center;"> | ||
| 91 : | <?php echo T_('Translation') ?> | ||
| 92 : | </th> | ||
| 93 : | csouza | 466 | <th style="width:70px;text-align:right;"> |
| 94 : | csouza | 403 | <?php echo T_('Ref') ?> |
| 95 : | </th> | ||
| 96 : | </tr> | ||
| 97 : | </table> | ||
| 98 : | <div class="strings"> | ||
| 99 : | <table class="adminlist"> | ||
| 100 : | <?php $a=0; foreach ($catalog->strings as $id => $message) :?> | ||
| 101 : | <?php | ||
| 102 : | if(is_array($message->comments)) { | ||
| 103 : | $ref = ''; | ||
| 104 : | $tt = ''; | ||
| 105 : | foreach($message->comments as $comment) { | ||
| 106 : | if(strncmp($comment, "#: ",3) == 0) | ||
| 107 : | $ref .= ltrim(trim($comment), '#: ')."\n"; | ||
| 108 : | $tt .= ltrim(trim($comment),'#: ')."<br />"; | ||
| 109 : | } | ||
| 110 : | $tip = mosToolTip( $tt); | ||
| 111 : | } | ||
| 112 : | $is_plural = strlen($message->msgid_plural) > 1 ? 1 : 0; | ||
| 113 : | ?> | ||
| 114 : | |||
| 115 : | csouza | 466 | <tr class="<?php echo "row$a"; ?>" id="row_<?php echo $id ?>"> |
| 116 : | <td style="width:50px" onclick="translate(this.parentNode, <?php echo $id ?>, <?php echo $is_plural ?>, <?php echo $nplurals ?>)"> | ||
| 117 : | <img style="cursor:pointer;" onclick="return togglefuzzy(this, document.forms[0].fuzzy_<?php echo $id ?>)" src="images/<?php echo ( $message->is_fuzzy ) ? 'publish_x.png' : 'tick.png';?>" width="12" height="12" border="0" alt="<?php echo ( $message->is_fuzzy ) ? T_('Verify Translation') : T_('Translation OK');?>" /> | ||
| 118 : | <input type="hidden" name="fuzzy_<?php echo $id ?>" value="<?php echo ( $message->is_fuzzy ) ? 'true' : 'false';?>"/> | ||
| 119 : | csouza | 403 | </td> |
| 120 : | csouza | 466 | <td style="width:40%" onclick="translate(this.parentNode, <?php echo $id ?>, <?php echo $is_plural ?>, <?php echo $nplurals ?>)"> |
| 121 : | csouza | 403 | <textarea style="display:none" readonly="readonly" id="msgid_<?php echo $id ?>" name="msgid_<?php echo $id ?>"><?php echo $message->msgid ?></textarea> |
| 122 : | <?php if ($is_plural): ?> | ||
| 123 : | <textarea style="display:none" readonly="readonly" id="msgid_plural_<?php echo $id ?>" name="msgid_plural_<?php echo $id ?>"><?php echo $message->msgid_plural ?></textarea> | ||
| 124 : | <?php endif; ?> | ||
| 125 : | <?php echo $message->msgid; ?> | ||
| 126 : | </td> | ||
| 127 : | csouza | 466 | <td style="width:40%" onclick="translate(this.parentNode, <?php echo $id ?>, <?php echo $is_plural ?>, <?php echo $nplurals ?>)"> |
| 128 : | csouza | 403 | <?php if ($is_plural): ?> |
| 129 : | <?php for ($b=0; $b < $nplurals; $b++):?> | ||
| 130 : | <textarea style="display:none" readonly="readonly" id="msgstr_<?php echo $b ?>_<?php echo $id ?>" name="msgstr_<?php echo $b ?>_<?php echo $id ?>"><?php echo $message->msgstr[$b] ?></textarea> | ||
| 131 : | <?php endfor; ?> | ||
| 132 : | <?php else : ?> | ||
| 133 : | <textarea style="display:none" readonly="readonly" id="msgstr_<?php echo $id ?>" name="msgstr_<?php echo $id ?>"><?php echo $message->msgstr ?></textarea> | ||
| 134 : | <?php endif; ?> | ||
| 135 : | <span id="msgstr_<?php echo $id ?>_span"><?php echo $is_plural ? $message->msgstr[0] : $message->msgstr;?></span> | ||
| 136 : | </td> | ||
| 137 : | csouza | 466 | <td style="width:50px;text-align:right" onclick="translate(this.parentNode, <?php echo $id ?>, <?php echo $is_plural ?>, <?php echo $nplurals ?>)"> |
| 138 : | csouza | 403 | <?php if ($tip) echo $tip; ?> |
| 139 : | </td> | ||
| 140 : | </tr> | ||
| 141 : | <?php $a=1-$a;endforeach; ?> | ||
| 142 : | </table> | ||
| 143 : | </div> | ||
| 144 : | <?php $tabs->endTab(); $tabs->startTab(T_('Headers'),"headers");?> | ||
| 145 : | <table class="adminform" style="width:250px"> | ||
| 146 : | <tr><td> | ||
| 147 : | <?php | ||
| 148 : | foreach($catalog->headers as $key => $value) { | ||
| 149 : | $disabled = ($key == 'POT-Creation-Date') ? 'readonly="readonly"' : ''; | ||
| 150 : | $str = "<tr>\n\t<td>\n\t<label style=\"font-weight:bold\">$key<br />\n"; | ||
| 151 : | $str .= "<input type=\"text\" size=\"100\" name=\"headers[$key]\" value=\"".str_replace("\\n", "", trim($value))."\" $disabled />"; | ||
| 152 : | $str .= "</label>\n</td>\n\t</tr>\n"; | ||
| 153 : | echo $str; | ||
| 154 : | } | ||
| 155 : | ?> | ||
| 156 : | </td></tr> | ||
| 157 : | </table> | ||
| 158 : | <?php $tabs->endTab(); $tabs->startTab(T_('Comments'),"comments"); ?> | ||
| 159 : | <table class="adminform" style="width:250px"> | ||
| 160 : | <tr><td> | ||
| 161 : | <textarea rows="20" cols="75" name="comments"><?php echo implode("", $catalog->comments) ?></textarea> | ||
| 162 : | </td></tr> | ||
| 163 : | </table> | ||
| 164 : | <?php $tabs->endTab(); $tabs->endPane(); ?> | ||
| 165 : | </td><td style="vertical-align:top;padding-top:20px"> | ||
| 166 : | <input type="hidden" id="row_class" name="row_class" value="" /> | ||
| 167 : | <input type="hidden" id="row_id" name="row_id" value="" /> | ||
| 168 : | <div id="singular" style="position:relative;top:0;left:0;height:250px"> | ||
| 169 : | <table class="adminform"><tr><td> | ||
| 170 : | <fieldset><legend><?php echo T_('Original') ?></legend><textarea id="s_msgid" name="s_msgid" cols="40" rows="11" readonly="readonly"></textarea></fieldset> | ||
| 171 : | </td></tr><tr><td> | ||
| 172 : | <fieldset><legend><?php echo T_('Translation') ?></legend><textarea id="s_msgstr" name="s_msgstr" cols="40" rows="11" onblur="update(this.value, 0, 0)"></textarea></fieldset> | ||
| 173 : | </td></tr></table> | ||
| 174 : | </div> | ||
| 175 : | <div id="plural" style="position:relative;top:0;left:0;height:250px;display:none"> | ||
| 176 : | <table class="adminform"><tr><td> | ||
| 177 : | <fieldset><legend><?php echo T_('Original') ?></legend> | ||
| 178 : | <label><?php echo T_('Singular') ?><textarea id="p_msgid" name="p_msgid" cols="40" rows="4" readonly="readonly"></textarea></label> | ||
| 179 : | <label><?php echo T_('Plural') ?><textarea id="p_msgid_plural" name="p_msgid_plural" cols="40" rows="4" readonly="readonly"></textarea></label></fieldset> | ||
| 180 : | </td></tr><tr><td> | ||
| 181 : | <fieldset><legend><?php echo T_('Translation') ?></legend> | ||
| 182 : | <div id="plurals"> | ||
| 183 : | <script type="text/javascript"> | ||
| 184 : | var pluralPane1 = new WebFXTabPane( document.getElementById( "plurals" ), 0); | ||
| 185 : | </script> | ||
| 186 : | <?php for ($a=0; $a < $nplurals; $a++):?> | ||
| 187 : | <div class="tab-page" id="plural_<?php echo $a ?>"> | ||
| 188 : | <h2 class="tab"><?php echo T_("Plural") ?>[<?php echo $a ?>]</h2> | ||
| 189 : | <script type="text/javascript"> | ||
| 190 : | pluralPane1.addTabPage( document.getElementById( "plural_<?php echo $a ?>" ) ); | ||
| 191 : | </script> | ||
| 192 : | <textarea id="p_msgstr_<?php echo $a ?>" name="p_msgstr_<?php echo $a ?>" cols="38" rows="9" onchange="update(this.value, 1, <?php echo $a ?> )"></textarea> | ||
| 193 : | </div> | ||
| 194 : | <?php endfor; ?> | ||
| 195 : | </div> | ||
| 196 : | </fieldset> | ||
| 197 : | </td></tr></table> | ||
| 198 : | </div> | ||
| 199 : | |||
| 200 : | </td></tr></table> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

