[ Index ]

PHP Cross Reference of Mambo 4.6.5

[ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/administrator/components/com_languages/views/templates/ -> editcatalog.tpl.php (source)

   1  <?php
   2  /**
   3  * @package Mambo
   4  * @subpackage Languages
   5  * @author Mambo Foundation Inc see README.php
   6  * @copyright (C) 2000 - 2009 Mambo Foundation Inc.
   7  * See COPYRIGHT.php for copyright notices and details.
   8  * @license GNU/GPL Version 2, see LICENSE.php
   9  *
  10  * Redistributions of files must retain the above copyright notice.
  11  *
  12  * Mambo is free software; you can redistribute it and/or
  13  * modify it under the terms of the GNU General Public License
  14  * as published by the Free Software Foundation; version 2 of the License.
  15  */
  16  
  17   defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); ?>
  18  <input type="hidden" name="domain" value="<?php echo $catalog->name ?>" />
  19  <input type="hidden" name="textdomain" value="<?php echo $catalog->path ?>" />
  20  <input type="hidden" name="lang" value="<?php echo $catalog->lang ?>" />
  21  <?php mosCommonHTML::loadOverlib();?>
  22  <script type="text/javascript" src="<?php echo mamboCore::get('mosConfig_live_site');?>/administrator/components/com_languages/languages.js"></script>
  23  <style>
  24  table.adminlist th {text-align:left}
  25  legend {font-weight:bold;} 
  26  div.strings {height:400px;overflow:auto;}
  27  </style>
  28  
  29  
  30  <table><tr><td style="width:75%;vertical-align:top">
  31  <?php 
  32  $tabs = new mosTabs(1);
  33  $tabs->startPane("catalog");
  34  $tabs->startTab(T_("Messages"),"messages");
  35  $language_plurals = ($nplurals > 1);
  36  ?>
  37  <table class="adminlist">
  38  <tr>
  39      <th style="width:50px">
  40      <?php echo T_('Verified') ?>
  41      </th>
  42      <th style="width:40%;text-align:center;">
  43      <?php echo T_('Original') ?>
  44      </th>
  45      <th style="width:40%;text-align:center;">
  46      <?php echo T_('Translation') ?>
  47      </th>
  48      <th style="width:70px;text-align:right;">
  49      <?php echo T_('Ref') ?>
  50      </th>
  51  </tr>    
  52  </table>
  53  <div class="strings">
  54  <table class="adminlist" id="catalog_editor">
  55  <tbody>      
  56  <?php $a=0; foreach ($catalog->strings as $id => $message) :?>
  57          <?php
  58          if(is_array($message->comments)) {
  59              $ref = '';
  60              $tt  = '';
  61              foreach($message->comments as $comment) {
  62                  if(strncmp($comment, "#: ",3) == 0)
  63                  $ref .= ltrim(trim($comment), '#: ')."\n";
  64                  $tt  .= addslashes(htmlspecialchars(ltrim(trim($comment),'#: ,#. ,#  ')))."<br />";
  65              }
  66              $tip = mosToolTip( $tt);
  67          }
  68          $is_plural = strlen($message->msgid_plural) > 1 ? 1 : 0;
  69          ?>  
  70      <tr class="<?php echo "row$a"; ?>" id="row_<?php echo $id ?>" onclick="translate(<?php echo $id ?>, <?php echo ($is_plural && $language_plurals) ? 1 : 0; ?>, <?php echo $nplurals ?>)">            
  71          <td style="width:50px">
  72          <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');?>" />
  73          <input type="hidden" name="fuzzy_<?php echo $id ?>" value="<?php echo ( $message->is_fuzzy ) ? 'true' : 'false';?>"/>
  74          </td>
  75          <td style="width:40%">
  76          <textarea style="display:none" readonly="readonly" id="msgid_<?php echo $id ?>" name="msgid_<?php echo $id ?>"><?php echo $message->msgid ?></textarea>
  77          <?php if ($is_plural && $language_plurals): ?>
  78          <textarea style="display:none" readonly="readonly" id="msgid_plural_<?php echo $id ?>" name="msgid_plural_<?php echo $id ?>"><?php echo $message->msgid_plural ?></textarea>
  79          <?php endif; ?>
  80          <?php echo $message->msgid; ?>
  81          </td>
  82          <td style="width:40%">
  83          <?php if ($is_plural && $language_plurals): ?>
  84          <?php for ($b=0; $b < $nplurals; $b++):?>
  85          <textarea style="display:none" readonly="readonly" id="msgstr_<?php echo $b ?>_<?php echo $id ?>" name="msgstr_<?php echo $b ?>_<?php echo $id ?>"><?php if (isset($message->msgstr[$b])) echo $message->msgstr[$b]; ?></textarea>
  86          <?php endfor; ?>
  87          <?php else : ?>
  88          <textarea style="display:none" readonly="readonly" id="msgstr_<?php echo $id ?>" name="msgstr_<?php echo $id ?>"><?php echo $is_plural ? $message->msgstr[0] : $message->msgstr; ?></textarea>
  89          <?php endif; ?>
  90          <span id="msgstr_<?php echo $id ?>_span"><?php echo $is_plural ? $message->msgstr[0] : $message->msgstr;?></span>
  91          </td>
  92          <td style="width:50px;text-align:right">
  93          <?php if ($tip) echo $tip; ?>
  94          </td>
  95      </tr>
  96  <?php $a=1-$a;endforeach; ?>
  97  </tbody>
  98  </table>
  99  <script type="text/javascript">
 100  table = new Table('catalog_editor');  
 101  </script>
 102  </div>
 103  <?php $tabs->endTab(); $tabs->startTab(T_('Headers'),"headers");?>
 104  <table class="adminform" style="width:250px">
 105  <tr><td>
 106  <?php  
 107  foreach($catalog->headers as $key => $value) {
 108      $disabled = ($key == 'POT-Creation-Date') ? 'readonly="readonly"' : '';
 109      $str = "<tr>\n\t<td>\n\t<label style=\"font-weight:bold\">$key<br />\n";
 110      $str .= "<input type=\"text\" size=\"100\" name=\"headers[$key]\" value=\"".str_replace("\\n", "", trim($value))."\" $disabled />";
 111      $str .= "</label>\n</td>\n\t</tr>\n";
 112      echo $str;
 113  }
 114  ?>    
 115  </td></tr>
 116  </table>
 117  <?php $tabs->endTab(); $tabs->startTab(T_('Comments'),"comments"); ?>
 118  <table class="adminform" style="width:250px">
 119  <tr><td>
 120  <textarea rows="20" cols="75" name="comments"><?php echo implode("", $catalog->comments) ?></textarea>
 121  </td></tr>
 122  </table>
 123  <?php $tabs->endTab(); $tabs->endPane(); ?>
 124  </td><td style="vertical-align:top;padding-top:20px">
 125  <input type="hidden" id="row_class" name="row_class" value="" />
 126  <input type="hidden" id="row_id" name="row_id" value="" />
 127  
 128  
 129  <div id="singular" style="position:relative;top:0;left:0;height:250px">
 130  <table class="adminform"><tr><td>
 131  <fieldset><legend><?php echo T_('Original') ?></legend><textarea id="s_msgid" name="s_msgid" cols="40" rows="11" readonly="readonly"></textarea></fieldset>
 132  </td></tr><tr><td>
 133  <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>
 134  </td></tr></table>
 135  </div>
 136  <div id="plural" style="position:relative;top:0;left:0;height:250px;display:none">
 137  <table class="adminform"><tr><td>
 138  <fieldset><legend><?php echo T_('Original') ?></legend>
 139  <label><?php echo T_('Singular') ?><textarea id="p_msgid" name="p_msgid" cols="40" rows="4" readonly="readonly"></textarea></label>
 140  <label><?php echo T_('Plural') ?><textarea id="p_msgid_plural" name="p_msgid_plural" cols="40" rows="4" readonly="readonly"></textarea></label></fieldset>
 141  </td></tr><tr><td>
 142  <fieldset><legend><?php echo T_('Translation') ?></legend>
 143  <div id="plurals">      
 144  <script type="text/javascript">
 145  var pluralPane1 = new WebFXTabPane( document.getElementById( "plurals" ), 0);
 146  </script>
 147  <?php for ($a=0; $a < $nplurals; $a++):?>
 148  <div class="tab-page" id="plural_<?php echo $a ?>">
 149  <h2 class="tab"><?php echo T_("Plural") ?>[<?php echo $a ?>]</h2>
 150  <script type="text/javascript">
 151  pluralPane1.addTabPage( document.getElementById( "plural_<?php echo $a ?>" ) );
 152  </script>            
 153  <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>
 154  </div>
 155  <?php endfor; ?>
 156  </div> 
 157  </fieldset>
 158  </td></tr></table>
 159  </div>
 160  
 161  </td></tr></table>