Changeset 12788
- Timestamp:
- 10/12/07 22:47:47 (1 year ago)
- Files:
-
- trunk/midcom/midcom.admin.babel/handler/process.php (modified) (10 diffs)
- trunk/midcom/midcom.admin.babel/locale/default.en.txt (modified) (2 diffs)
- trunk/midcom/midcom.admin.babel/locale/default.pl.txt (modified) (2 diffs)
- trunk/midcom/midcom.admin.babel/static/babel.css (modified) (2 diffs)
- trunk/midcom/midcom.admin.babel/style/midcom_admin_babel_edit.php (modified) (7 diffs)
- trunk/midcom/midcom.admin.babel/style/midcom_admin_babel_permission_denied.php (modified) (1 diff)
- trunk/midcom/midcom.admin.babel/style/midcom_admin_babel_select.php (modified) (2 diffs)
- trunk/midcom/midcom.admin.babel/style/midcom_admin_babel_status_footer.php (modified) (1 diff)
- trunk/midcom/midcom.admin.babel/style/midcom_admin_babel_status_header.php (modified) (1 diff)
- trunk/midcom/midcom.admin.babel/style/midcom_admin_babel_status_section_header.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.admin.babel/handler/process.php
r12786 r12788 3 3 class midcom_admin_babel_handler_process extends midcom_baseclasses_components_handler 4 4 { 5 var $_debug_prefix; 6 7 /** which language is edited */ 8 var $_lang = 'en'; 9 10 /** path of the component to localize */ 11 var $_component_path = null; 12 13 /** data to be saved */ 14 var $_save_new; 15 var $_save_update; 16 17 /** midcom_l10n instance $_component_path */ 18 var $_component_l10n; 5 19 6 20 /** … … 23 37 24 38 $this->_l10n = $_MIDCOM->i18n->get_l10n('midcom.admin.babel'); 39 40 $this->_debug_prefix = "midcom_admin_babel::"; 41 42 $this->_save_new = false; 43 $this->_save_update = false; 44 45 $_MIDCOM->cache->content->no_cache(); 46 47 $_MIDCOM->skip_page_style = true; 48 49 $_MIDCOM->add_link_head 50 ( 51 array 52 ( 53 'rel' => 'stylesheet', 54 'type' => 'text/css', 55 'media' => 'screen', 56 'href' => MIDCOM_STATIC_URL ."/midcom.admin.babel/babel.css" 57 ) 58 ); 25 59 26 60 } … … 109 143 } 110 144 145 function validate_language($lang) 146 { 147 // TODO: Validate via ML instead 148 if (array_key_exists($lang, $this->_l10n->_language_db)) 149 { 150 return true; 151 } 152 else 153 { 154 return false; 155 } 156 } 157 158 111 159 function _handler_select($handler_id, $args, &$data) 112 160 { … … 121 169 midcom_show_style('midcom_admin_babel_select'); 122 170 $this->_asgard_footer(); 123 124 171 } 125 172 … … 128 175 $this->_component_path = $args[0]; 129 176 $this->_lang = $args[1]; 130 if (! midcom_admin_babel_plugin::validate_language($this->_lang))177 if (!$this->validate_language($this->_lang)) 131 178 { 132 179 return false; … … 253 300 { 254 301 $this->_lang = $args[0]; 255 if (! midcom_admin_babel_plugin::validate_language($this->_lang))302 if (!$this->validate_language($this->_lang)) 256 303 { 257 304 return false; … … 304 351 $this->_component_path = $args[0]; 305 352 $this->_lang = $args[1]; 306 if (! midcom_admin_babel_plugin::validate_language($this->_lang))353 if (!$this->validate_language($this->_lang)) 307 354 { 308 355 return false; … … 348 395 function _show_edit($handler_id, &$data) 349 396 { 350 $this->_show_permission_check($handler_id, &$data); 397 351 398 352 399 $this->_request_data['view_component'] = $this->_component_path; … … 379 426 380 427 $this->_asgard_header(); 428 $this->_show_permission_check($handler_id, &$data); 381 429 midcom_show_style('midcom_admin_babel_edit'); 382 430 $this->_asgard_footer(); … … 397 445 $en = "{$path}/default.en.txt"; 398 446 $main = "{$path}/default.{$this->_lang}.txt"; 399 447 400 448 if ( ! is_writable($path) 401 449 || (file_exists($en) && ! is_writable($en)) trunk/midcom/midcom.admin.babel/locale/default.en.txt
r12785 r12788 65 65 ---STRINGEND 66 66 67 ---STRING strings total 68 Strings total 69 ---STRINGEND 70 67 71 ---STRING translated strings 68 72 Translated strings … … 73 77 ---STRINGEND 74 78 75 ---STRING strings total76 Strings total 79 ---STRING new string 80 New string 77 81 ---STRINGEND 78 82 trunk/midcom/midcom.admin.babel/locale/default.pl.txt
r12785 r12788 66 66 ---STRINGEND 67 67 68 ---STRING strings total 69 Wszystkie 70 ---STRINGEND 71 68 72 ---STRING translated strings 69 73 PrzetÅumaczone … … 74 78 ---STRINGEND 75 79 76 ---STRING strings total77 Wszystkie 80 ---STRING new string 81 Dodaj napis 78 82 ---STRINGEND 79 83 trunk/midcom/midcom.admin.babel/static/babel.css
r4488 r12788 1 table.midcom_admin_babel_languages 2 { 3 background-color: #eeeeef; 4 padding: 0.5em; 5 -moz-border-radius: 10px; 6 width: 100%; 7 border-bottom: solid 1px #000; 8 border-right: solid 1px #000; 9 10 } 11 12 table.midcom_admin_babel_languages tr td 13 { 14 text-align: right; 15 } 16 1 17 table.midcom_admin_babel_languages tr.ok 2 18 { … … 14 30 { 15 31 text-align: left; 32 font-weight: bold; 16 33 } 34 35 table.midcom_admin_babel_languages tr.header th 36 { 37 background-color: #dddddf; 38 border-bottom: solid 1px #000; 39 border-right: solid 1px #000; 40 -moz-border-radius: 6px; 41 } 42 43 table.midcom_admin_babel_languages tr.subheader th 44 { 45 background-color: #f8eeff; 46 border-bottom: solid 1px #000; 47 border-right: solid 1px #000; 48 -moz-border-radius: 6px; 49 } 50 51 table.midcom_admin_babel_languages tr td.footer 52 { 53 text-align: right; 54 font-weight: bold; 55 border-top: solid 1px #000; 56 } 57 58 table.midcom_admin_babel_languages tr.newstring td 59 { 60 vertical-align:bottom; 61 text-align: center; 62 color: #fff; 63 font-weight: bold; 64 65 } 66 67 table.midcom_admin_babel_languages tr.newstring 68 { 69 background: #33cc33; 70 -moz-border-radius: 6px; 71 72 } 73 74 75 table.midcom_admin_babel_languages tr.string-even 76 { 77 background: #d3d7cf; 78 -moz-border-radius: 6px; 79 } 80 81 table.midcom_admin_babel_languages tr.string-odd 82 { 83 background: #cccccc; 84 -moz-border-radius: 6px; 85 } 86 87 table.midcom_admin_babel_languages tr.string-even td 88 { 89 width: 33%; 90 } 91 92 table.midcom_admin_babel_languages tr.string-odd td 93 { 94 width: 33%; 95 } 96 97 #content-text h1 98 { 99 padding-left: 0.5em; 100 font-size: 150%; 101 } 102 103 .processing_message 104 { 105 background: #eeeeef; 106 -moz-border-radius: 6px; 107 border: solid 1px red; 108 margin-top: 1em; 109 padding-left: 0.5em; 110 } trunk/midcom/midcom.admin.babel/style/midcom_admin_babel_edit.php
r5048 r12788 1 1 <?php 2 3 //$data =& $_MIDCOM->get_custom_context_data('request_data');4 2 $prefix = $data['plugin_anchorprefix']; 5 3 … … 18 16 ?></h1> 19 17 20 <form method="post" action="&(prefix);save/&(data['view_component']);/&(data['view_lang']);/" class="datamanager ">18 <form method="post" action="&(prefix);save/&(data['view_component']);/&(data['view_lang']);/" class="datamanager2"> 21 19 22 20 <div class="form_toolbar"> … … 24 22 <input type="submit" name="f_cancel" accesskey="c" value="<?php echo $data['l10n_midcom']->get('cancel');?>" class="cancel"> 25 23 </div> 26 27 <table border="1">24 <br /> 25 <table class="midcom_admin_babel_languages"> 28 26 <thead> 29 <tr >27 <tr class="header"> 30 28 <th><?php echo $data['l10n']->get('string-id')?></th> 31 29 <th>&(deflang); (<?php echo $data['l10n']->get('default');?>)</th> … … 44 42 45 43 <tr class="newstring"> 46 <td>< input type="text" name="new_stringid" size="35" /></td>47 <td><textarea type="text" name="new_en" cols=" 40" rows="2" wrap="virtual"></textarea></td>44 <td><?php echo $data['l10n']->get('new string')?><br /><input type="text" name="new_stringid" size="35" /></td> 45 <td><textarea type="text" name="new_en" cols="30" rows="3" wrap="virtual"></textarea></td> 48 46 <?php 49 47 if ($data['view_lang'] != 'en') 50 48 { 51 49 ?> 52 <td><textarea type="text" name="new_loc" cols=" 40" rows="2" wrap="virtual"></textarea></td>50 <td><textarea type="text" name="new_loc" cols="30" rows="3" wrap="virtual"></textarea></td> 53 51 <?php 54 52 } … … 62 60 $en = $str['en']; 63 61 $loc = $str[$data['view_lang']]; 62 $row = ($count/2 == floor($count/2))?"even":"odd"; 64 63 ?> 65 <tr >64 <tr class="string-&(row);"> 66 65 <th>&(id);</th> 67 66 <?php … … 73 72 } 74 73 ?> 75 <td><input type="hidden" name="string_id[&(count);]" value="&(id);" /><textarea name="string_value[&(count);]" cols=" 40" rows="2" wrap="virtual"><?php echo htmlspecialchars($loc); ?></textarea></td>74 <td><input type="hidden" name="string_id[&(count);]" value="&(id);" /><textarea name="string_value[&(count);]" cols="30" rows="3" wrap="virtual"><?php echo htmlspecialchars($loc); ?></textarea></td> 76 75 </tr> 77 76 <?php … … 81 80 </tbody> 82 81 </table> 83 82 <br /> 84 83 <div class="form_toolbar"> 85 84 <input type="submit" name="f_submit" accesskey="s" value="<?php echo $data['l10n_midcom']->get('save');?>" class="save"> trunk/midcom/midcom.admin.babel/style/midcom_admin_babel_permission_denied.php
r5048 r12788 1 1 <?php 2 //$data =& $_MIDCOM->get_custom_context_data('request_data');3 4 2 $text = $data['l10n']->get('perm-denied text'); 5 3 ?> trunk/midcom/midcom.admin.babel/style/midcom_admin_babel_select.php
r12785 r12788 10 10 <table class="midcom_admin_babel_languages"> 11 11 <thead> 12 <tr >12 <tr class="header"> 13 13 <th><?php echo $data['l10n']->get('language','midcom.admin.babel'); ?></th> 14 14 <th><?php echo $data['l10n']->get('core component status'); ?></th> … … 41 41 42 42 echo " <tr class=\"{$status}\">\n"; 43 echo " <t d><a href=\"{$prefix}__mfa/asgard_midcom.admin.babel/status/{$language}/\">{$language_name}</a></td>\n";43 echo " <th class=\"component\"><a href=\"{$prefix}__mfa/asgard_midcom.admin.babel/status/{$language}/\">{$language_name}</a></td>\n"; 44 44 echo " <td title=\"{$state['strings_core']['translated']} / {$state['strings_core']['total']}\">{$percentage}%</td>\n"; 45 45 echo " <td title=\"{$state['strings_other']['translated']} / {$state['strings_other']['total']}\">{$percentage_other}%</td>\n"; trunk/midcom/midcom.admin.babel/style/midcom_admin_babel_status_footer.php
r12785 r12788 7 7 <tr> 8 8 <td></td> 9 <td ><?php echo $data['strings_all']['translated']; ?></td>10 <td ><?php echo $data['strings_all']['total']; ?></td>11 <td ><?php echo round(100 / $data['strings_all']['total'] * $data['strings_all']['translated']); ?>%</td>9 <td class="footer"><?php echo $data['strings_all']['translated']; ?></td> 10 <td class="footer"><?php echo $data['strings_all']['total']; ?></td> 11 <td class="footer"><?php echo round(100 / $data['strings_all']['total'] * $data['strings_all']['translated']); ?>%</td> 12 12 </tr> 13 13 </tfoot> trunk/midcom/midcom.admin.babel/style/midcom_admin_babel_status_header.php
r12785 r12788 7 7 <table class="midcom_admin_babel_languages"> 8 8 <thead> 9 <tr >9 <tr class="header"> 10 10 <th><?php echo $data['l10n']->get('component'); ?></th> 11 11 <th><?php echo $data['l10n']->get('translated strings'); ?></th> trunk/midcom/midcom.admin.babel/style/midcom_admin_babel_status_section_header.php
r5048 r12788 3 3 $prefix = $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX); 4 4 ?> 5 <tr >5 <tr class="subheader"> 6 6 <th colspan="4"> 7 7 <?php
