2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2010 */
\r
6 /* Inclusive Design Institute */
\r
8 /* This program is free software. You can redistribute it and/or */
\r
9 /* modify it under the terms of the GNU General Public License */
\r
10 /* as published by the Free Software Foundation. */
\r
11 /************************************************************************/
\r
13 global $_custom_css;
\r
14 $_custom_css = TR_BASE_HREF."include/jscripts/infusion/components/inlineEdit/css/InlineEdit.css";
\r
16 include(TR_INCLUDE_PATH.'header.inc.php');
\r
18 <div class="input-form">
\r
20 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form1">
\r
21 <fieldset class="group_form"><legend class="group_form"><?php echo _AT("language"); ?></legend>
\r
23 <table class="data" rules="rows" id="editable_table">
\r
26 <th scope="col"> </th>
\r
27 <th scope="col"><?php echo _AT('name_in_translated');?></th>
\r
28 <th scope="col"><?php echo _AT('name_in_english');?></th>
\r
29 <th scope="col"><?php echo _AT('lang_code');?></th>
\r
30 <th scope="col"><?php echo _AT('charset');?></th>
\r
31 <th scope="col"><?php echo _AT('status');?></th>
\r
38 <input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" />
\r
39 <input type="submit" name="export" value="<?php echo _AT('export'); ?>" />
\r
40 <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>" />
\r
46 <?php foreach ($this->rows as $row) {?>
\r
47 <tr onmousedown="document.form1['m<?php echo $row["language_code"]."_".$row["charset"]; ?>'].checked = true; trans.utility.rowselect(this);"
\r
48 onkeydown="document.form1['m<?php echo $row["language_code"]."_".$row["charset"]; ?>'].checked = true; trans.utility.rowselect(this);"
\r
49 id="r_<?php echo $row["language_code"]."_".$row["charset"]; ?>">
\r
50 <td><input type="radio" name="id" value="<?php echo $row["language_code"]."_".$row["charset"]; ?>" id="m<?php echo $row['language_code']."_".$row["charset"]; ?>"
\r
51 onmouseup="this.checked=!this.checked" onkeyup="this.checked=!this.checked" /></td>
\r
52 <td><label for="m<?php echo $row["language_code"]."_".$row["charset"]; ?>"><span class="inlineEdits" id="<?php echo "native_name:".$row["language_code"].":".$row["charset"]; ?>"><?php echo $row["native_name"]; ?></span></label></td>
\r
53 <td><span class="inlineEdits" id="<?php echo "english_name:".$row["language_code"].":".$row["charset"]; ?>"><?php echo $row['english_name']; ?></span></td>
\r
54 <td><?php echo $row['language_code']; ?></td>
\r
55 <td><?php echo $row['charset']; ?></td>
\r
58 if ($row['status'] == TR_STATUS_ENABLED) echo _AT('enabled');
\r
59 else if ($row['status'] == TR_STATUS_DISABLED) echo _AT('disabled');
\r
60 else echo _AT('unknown');
\r
68 <small class="data-table-tip"><?php echo _AT('inline_editor_tip'); ?></small>
\r
74 <form name="import_form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data">
\r
75 <fieldset class="group_form"><legend class="group_form"><?php echo _AT("import_a_new_lang"); ?></legend>
\r
76 <div id="container">
\r
77 <input type="file" name="file" id="file" size="50"/>
\r
78 <input type="submit" name="import" value="<?php echo _AT('import'); ?>" onclick="javascript: return validate_filename(); " />
\r
82 </div> <!-- end input-form duv -->
\r
83 <script type="text/javascript">
\r
86 String.prototype.trim = function() {
\r
87 return this.replace(/^\s+|\s+$/g,"");
\r
90 // This function validates if and only if a zip file is given
\r
91 function validate_filename() {
\r
93 var file = document.import_form.file.value;
\r
94 if (!file || file.trim()=='') {
\r
95 alert('Please select a language pack zip file.');
\r
99 if(file.slice(file.lastIndexOf(".")).toLowerCase() != '.zip') {
\r
100 alert('Please upload ZIP file only!');
\r
105 jQuery(document).ready(function () {
\r
106 var tableEdit = fluid.inlineEdits("#editable_table", {
\r
109 editables : "td:has(span.inlineEdits)"
\r
111 defaultViewText: "",
\r
114 afterFinishEdit : function (newValue, oldValue, editNode, viewNode) {
\r
115 if (newValue != oldValue)
\r
116 rtn = jQuery.post("<?php echo TR_BASE_HREF; ?>language/index_inline_editor_submit.php", { "field":viewNode.id, "value":newValue },
\r
117 function(data) {handleAjaxResponse(data, viewNode, oldValue); }, "json");
\r
129 include(TR_INCLUDE_PATH.'footer.inc.php');
\r