Browse Source

Обновление файла.

master
Repellent 8 years ago
parent
commit
c8278a9304
  1. 403
      import/templates/admin_edit.tpl

403
import/templates/admin_edit.tpl

@ -1,274 +1,337 @@
<div class="title"> <script>
<h5>{if $smarty.request.id == ''}{#IMPORT_H_ADD#}{else}{#IMPORT_H_EDIT#}{/if}</h5> var import_id = {$import_id};
</div> </script>
<div class="widget" style="margin-top: 0px;"> <div class="title">
<div class="body"> <h5>{if $import_id}{#import_edit_tit#}{else}{#import_new_tit#}{/if}</h5>
{#IMPORT_INFO_EDIT#}
</div>
</div> </div>
<div class="breadCrumbHolder module"> <div class="breadCrumbHolder module">
<div class="breadCrumb module"> <div class="breadCrumb module">
<ul> <ul>
<li class="firstB"><a href="index.php" title="{#MAIN_PAGE#}">{#MAIN_PAGE#}</a></li> <li class="firstB">
<li><a href="index.php?do=modules&amp;cp={$sess}">{#MODULES_SUB_TITLE#}</a></li> <a href="index.php" title="{#MAIN_PAGE#}">{#MAIN_PAGE#}</a>
<li><a href="index.php?do=modules&action=modedit&mod=import&moduleaction=1&cp={$sess}">{#IMPORT_MODULE_NAME#}</a></li> </li>
<li>{if $smarty.request.id == ''}{#IMPORT_H_ADD#}{else}{#IMPORT_H_EDIT#}{/if}</li> <li>
<li><strong class="code">{if $smarty.request.id == ''}{#IMPORT_H_ADD#}{else}{$import_name|escape}{/if}</strong></li> <a href="index.php?do=modules&amp;cp={$sess}">{#MODULES_SUB_TITLE#}</a>
</li>
<li>
<a href="index.php?do=modules&amp;action=modedit&amp;mod=import&amp;moduleaction=1&amp;cp={$sess}">{#mod_name#}</a>
</li>
<li>
{if $import_id}{#import_edit_tit#}{else}{#import_new_tit#}{/if}
</li>
{if $import_id}
<li>
<strong class="code">{$import.name|escape|stripslashes}</strong>
</li>
{/if}
</ul> </ul>
</div> </div>
</div> </div>
<form method="post" id="import_edit_form" action="index.php?do=modules&action=modedit&mod=import&moduleaction=saveedit&cp={$sess}" class="mainForm"> <form action="index.php?do=modules&amp;action=modedit&amp;mod=import&amp;moduleaction=save&amp;import_id={$import_id}&amp;cp={$sess}" method="post" class="mainForm" id="importSaveForm">
<div class="widget first"> <div class="widget first">
<div class="head{if $smarty.request.id != ''} closed{/if}"> <div class="head {if $import_id}closed{/if}">
<h5 class="iFrames">{#IMPORT_H_EDIT#}</h5> <h5 class="iFrames">{#import_set#}</h5>
</div> </div>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic"> <table cellpadding="0" cellspacing="0" width="100%" class="tableStatic">
<tr class="noborder"> <tr class="noborder">
<td width="250">{#IMPORT_NAME#}</td> <td width="250">{#name#}</td>
<td> <td>
<div class="pr12"> <input name="name" class="mousetrap" type="text" style="width:250px" value="{$import.name|escape|stripslashes}" autocomplete="off" id="importNameInput" />
<input name="import_name" type="text" value="{$import_name|escape}" placeholder="{#CONTACT_FORM_NAME#}" size="50" />
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>{#IMPORT_RUBRICS#}</td> <td>{#rub_name#}</td>
<td> <td>
<select class="mousetrap" style="width: 250px" name="import_rub" {if $smarty.request.id != ''}disabled="disabled"{/if}> {if !$import_id}
<select name="rub_id">
{foreach from=$rubs item=rub} {foreach from=$rubs item=rub}
{if $rub->Id==$import_rub} <option value="{$rub.id}">{$rub.title}</option>
<option value="{$rub->Id}" selected>{$rub->rubric_title}</option>
{else}
<option value="{$rub->Id}">{$rub->rubric_title}</option>
{/if}
{/foreach} {/foreach}
</select> </select>
{else}
{$import.rub_title|escape|stripslashes}
{/if}
</td> </td>
</tr> </tr>
<tr> <tr>
<td>{#IMPORT_PARSER#}</td> <td>{#parser#}</td>
<td> <td>
<select class="mousetrap" name="import_parser" style="width: 250px"> <select name="parser" style="width: 250px;">
{foreach from=$parses item=parse} {foreach from=$parsers item=parser}
{if $parse==$import_parser} <option value="{$parser}" {if $import.parser == $parser}selected="selected"{/if}>{$parser}</option>
<option value="{$parse}" selected>{$parse}</option> {/foreach}
{else}
<option value="{$parse}">{$parse}</option>
{/if}
{/foreach}
</select> </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>{#IMPORT_DELETE_DOCS#}</td> <td>{#docs_disable#}</td>
<td><input class="mousetrap" name="import_delete_docs" type="checkbox" value="1" {if $import_delete_docs==1}checked="checked"{/if}/></td> <td><input class="mousetrap" type="checkbox" name="docs_disable" value="1" {if $import.docs_disable}checked="checked"{/if} /></td>
</tr>
<tr>
<td>{#IMPORT_DOCS_CREATE#}</td>
<td><input class="mousetrap" name="import_docs_create" type="checkbox" value="1" {if $import_docs_create==1}checked="checked"{/if}/></td>
</tr> </tr>
<tr> <tr>
<td>{#IMPORT_FILE#}</td> <td>{#docs_create#}</td>
<td><div class="pr12"> <td><input type="checkbox" name="docs_create" value="1" {if $import.docs_create}checked="checked"{/if} /></td>
<input class="mousetrap" name="import_default_file" type="text" value="{$import_default_file|escape}" size="50" placeholder="{#IMPORT_FILE#}" />
</div></td>
</tr> </tr>
<tr> <tr>
<td>{#IMPORT_CHECK_FILE#}</td> <td>{#monitor#}</td>
<td><input class="mousetrap" name="import_monitor_file" id="import_monitor_file" type="checkbox" value="1" {if $import_monitor_file==1}checked="checked"{/if}/></td> <td><input type="checkbox" name="monitor" value="1" {if $import.monitor}checked="checked"{/if} /></td>
</tr> </tr>
<tr> <tr>
<td colspan="3"> <td>{#file#}</td>
<input type="submit" class="basicBtn" value="{if $smarty.request.id != ''}{#IMPORT_SAVE#}{else}{#IMPORT_CREATE#}{/if}"/> <td>/&nbsp;<input class="mousetrap" type="text" name="file" value="{$import.file|escape|stripslashes}" style="width:300px;" /></td>
{if $smarty.request.id != ''}
<input type="submit" class="blackBtn SaveEdit" value="{#IMPORT_CTRLS#}" />
<input type="submit" class="greenBtn" value="{#IMPORT_REFRESH_TAGS#}" onclick="window.location ='index.php?do=modules&action=modedit&mod=import&moduleaction=tags&id={$id}&cp={$sess}';return false;" />
<input type="submit" class="redBtn" onclick="location.href='index.php?do=modules&action=modedit&mod=import&moduleaction=do&id={$id}&cp={$sess}'; return false;" value="{#IMPORT_DO_HINT#}" style="float: right;">
{/if}
</td>
</tr> </tr>
</table> </table>
<div class="rowElem">
<input type="submit" class="basicBtn" value="{if $import_id}{#save#}{else}{#create#}{/if}" />
{if $import_id}
&nbsp;
<input type="submit" class="blackBtn importSaveContBtn" value="{#save_cont#}" /> &nbsp;
<input type="submit" class="greenBtn" value="{#tags_refresh#}" onClick="location.href='index.php?do=modules&amp;action=modedit&amp;mod=import&amp;moduleaction=tags&amp;import_id={$import.id}&amp;cp={$sess}';return false;" /> &nbsp;
<input type="submit" class="redBtn" onClick="location.href='index.php?do=modules&amp;action=modedit&amp;mod=import&amp;moduleaction=run&amp;import_id={$import_id}&amp;cp={$sess}';return false;" value="{#run_btn#} (Ctrl+O)" />
{/if}
</div>
</div> </div>
{if $import_id}
{if $smarty.request.id != ''}
<div style="position:relative;width:73%;float:left"> <div style="position:relative;width:73%;float:left">
<div class="widget first"> <div class="widget first">
<div class="head closed"> <div class="head {if $import_id}closed{/if}">
<h5 class="iFrames">{#IMPORT_MAIN_FIELDS#}</h5> <h5 class="iFrames">{#fields_main#}</h5>
</div> </div>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic"> <table cellpadding="0" cellspacing="0" width="100%" class="tableStatic">
<colgroup>
<col width="1" />
<col width="1" />
<col width="1" />
<col width="250" />
<col width="1" />
<col width="*" />
</colgroup>
<thead> <thead>
<tr> <tr class="noborder">
<td width="35" align="center"> <td align="center">
<div align="center"> <div align="center">
<a href="javascript:void(0);" class="topDir icon_sprite ico_info" title="{#IMPORT_ACTIVE_INFO#}"></a> <a href="javascript:void(0);" class="topDir icon_sprite ico_info" title="{#check_f_active#}"></a>
</div> </div>
</td> </td>
<td width="35" align="center"> <td align="center">
<div align="center"> <div align="center">
<a href="javascript:void(0);" class="topDir icon_sprite ico_info" title="{#IMPORT_KEYS_INFO#}"></a> <a href="javascript:void(0);" class="topDir icon_sprite ico_info" title="{#check_f_key#}"></a>
</div> </div>
</td> </td>
<td width="35" align="center"> <td align="center">
<div align="center"> <div align="center">
<a href="javascript:void(0);" class="topDir icon_sprite ico_info" title="{#IMPORT_CRITICAL_INFO#}"></a> <a href="javascript:void(0);" class="topDir icon_sprite ico_info" title="{#check_f_oblig#}"></a>
</div> </div>
</td> </td>
<td width="300">{#IMPORT_F#}</td> <td>{#field#}</td>
<td>{#IMPORT_TPL#}</td> <td align="center">
<div align="center">
<a href="javascript:void(0);" class="topDir icon_sprite ico_info" title="{#compare_type#}"></a>
</div>
</td>
<td>{#field_tpl#}</td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{foreach from=$data.fields.header key=k item=v} {foreach from=$import.fields.main key=field_id item=field}
<tr> <tr>
<td> <td>
<input class="mousetrap" name="document[active][header][{$k}]" type="hidden" value="0" /> <input type="checkbox" value="1" name="fields[main][{$field_id}][active]" {if $field.active}checked="checked"{/if}/>
<input class="mousetrap" name="document[active][header][{$k}]" type="checkbox" value="1" {if !$data.active.header.$k==0}checked="checked"{/if} {if $k=='Id'}disabled="disabled"{/if} /> </td>
</td> <td>
<td><input class="mousetrap" name="document[key][header][{$k}]" type="checkbox" value="1" {if $data.key.header.$k==1}checked="checked"{/if}/></td> <input type="checkbox" value="1" name="fields[main][{$field_id}][key]" {if $field.key}checked="checked"{/if}/>
<td><input class="mousetrap" name="document[critical][header][{$k}]" type="checkbox" value="1" {if $data.critical.header.$k==1}checked="checked"{/if}/></td> </td>
<td>{$v[1]}</td> <td>
<td><div class="pr12"><input class="mousetrap" type="text" name="document[fields][header][{$k}]" value="{$v[0]|escape|stripslashes}" size="50" /></div></td> <input type="checkbox" value="1" name="fields[main][{$field_id}][oblig]" {if $field.oblig}checked="checked"{/if}/>
</tr> </td>
<td>{$field.title}</td>
<td>
<select name="fields[main][{$field_id}][comp]" style="width: 80px;">
<option value="">==</option>
<option value="LIKE" {if $field.comp=='LIKE'}selected="selected"{/if}>LIKE</option>
</select>
<td>
<div class="pr12"><textarea class="mousetrap" name="fields[main][{$field_id}][tpl]" style="width:100%; height:24px;">{$field.tpl|escape|stripslashes}</textarea></div>
</td>
</tr>
{/foreach} {/foreach}
</tbody>
</table> </table>
</div> </div>
<div class="widget first"> <div class="widget first">
<div class="head"> <div class="head">
<h5 class="iFrames">{#IMPORT_RUB_FIELDS#}</h5> <h5 class="iFrames">{#fields_body#}</h5>
</div> </div>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic"> <table cellpadding="0" cellspacing="0" width="100%" class="tableStatic">
<colgroup>
<col width="1" />
<col width="1" />
<col width="1" />
<col width="1" />
<col width="250" />
<col width="1" />
<col width="*" />
</colgroup>
<thead> <thead>
<tr> <tr class="noborder">
<td width="35" align="center"> <td align="center">
<div align="center">
<a href="javascript:void(0);" class="topDir icon_sprite ico_info" title="{#check_f_active#}"></a>
</div>
</td>
<td align="center">
<div align="center"> <div align="center">
<a href="javascript:void(0);" class="topDir icon_sprite ico_info" title="{#IMPORT_ACTIVE_INFO#}"></a> <a href="javascript:void(0);" class="topDir icon_sprite ico_info" title="{#check_f_key#}"></a>
</div> </div>
</td> </td>
<td width="35" align="center"> <td align="center">
<div align="center"> <div align="center">
<a href="javascript:void(0);" class="topDir icon_sprite ico_info" title="{#IMPORT_KEYS_INFO#}"></a> <a href="javascript:void(0);" class="topDir icon_sprite ico_info" title="{#check_f_oblig#}"></a>
</div> </div>
</td> </td>
<td width="35" align="center"> <td align="center">
<div align="center"> <div align="center">
<a href="javascript:void(0);" class="topDir icon_sprite ico_info" title="{#IMPORT_CRITICAL_INFO#}"></a> ID
</div> </div>
</td> </td>
<td width="300">{#IMPORT_F#}</td> <td>{#field#}</td>
<td>{#IMPORT_TPL#}</td> <td align="center">
<div align="center">
<a href="javascript:void(0);" class="topDir icon_sprite ico_info" title="{#compare_type#}"></a>
</div>
</td>
<td>{#field_tpl#}</td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{foreach from=$data.fields.body key=k item=v} {foreach from=$import.fields.body key=field_id item=field}
<tr>
<td>
<input class="mousetrap" name="document[active][body][{$k}]" type="hidden" value="0" />
<input class="mousetrap" name="document[active][body][{$k}]" type="checkbox" value="1" {if !$data.active.body.$k==0}checked="checked"{/if}/>
</td>
<td><input class="mousetrap" name="document[key][body][{$k}]" type="checkbox" value="1" {if $data.key.body.$k==1}checked="checked"{/if}/></td>
<td><input class="mousetrap" name="document[critical][body][{$k}]" type="checkbox" value="1" {if $data.critical.body.$k==1}checked="checked"{/if}/></td>
<td>{$v[1]}</td>
<td><div class="pr12"><input class="mousetrap" type="text" name="document[fields][body][{$k}]" value="{$v[0]|escape|stripslashes}" size="50" /></div></td>
</tr>
{/foreach}
<tr> <tr>
<td colspan="5"> <td>
<input type="hidden" name="id" value="{$id}"> <input type="checkbox" value="1" name="fields[body][{$field_id}][active]" {if $field.active}checked="checked"{/if} />
<input type="submit" class="basicBtn" value="{#IMPORT_SAVE#}"/> </td>
<input type="submit" class="blackBtn SaveEdit" value="{#IMPORT_CTRLS#}" /> <td>
<input type="submit" class="greenBtn" value="{#IMPORT_REFRESH_TAGS#}" onclick="window.location ='index.php?do=modules&action=modedit&mod=import&moduleaction=tags&id={$id}&cp={$sess}';return false;" /> <input type="checkbox" value="1" name="fields[body][{$field_id}][key]" {if $field.key}checked="checked"{/if} />
<input type="submit" class="redBtn" onclick="location.href='index.php?do=modules&action=modedit&mod=import&moduleaction=do&id={$id}&cp={$sess}'; return false;" value="{#IMPORT_DO_HINT#}" style="float: right;"> </td>
<td>
<input type="checkbox" value="1" name="fields[body][{$field_id}][oblig]" {if $field.oblig}checked="checked"{/if} />
</td>
<td><strong class="code">{$field_id}</strong></td>
<td>{$field.title}</td>
<td>
<select name="fields[body][{$field_id}][comp]" style="width: 80px;">
<option value="">==</option>
<option value="LIKE" {if $field.comp=='LIKE'}selected="selected"{/if}>LIKE</option>
</select>
<td>
<div class="pr12"><textarea class="mousetrap" name="fields[body][{$field_id}][tpl]" style="width:100%; height:24px;">{$field.tpl|escape|stripslashes}</textarea></div>
</td> </td>
</tr> </tr>
</tbody> {/foreach}
</table> </table>
</div> </div>
</div> </div>
<div class="widget first" style="position:relative;display:block;float:right;clear:none;width:25%"> <div class="widget first" style="position:relative;display:block;float:right;clear:none;width:25%">
<div class="head"> <div class="head">
<h5 class="iFrames">{#IMPORT_TAGS#}</h5> <h5 class="iFrames">{#tags#}</h5>
</div> </div>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic"> <table cellpadding="0" cellspacing="0" width="100%" class="tableStatic">
<tbody>
<tr> <tr>
<td align="center"> <td>
<div class="pr12"> <div class="pr12"><input class="mousetrap topleftDir" readonly style="width:100%" type="text" value="[Y-m-d]" title="{#tag_date#}"></div>
<input class="mousetrap" readonly type="text" value="[Y-m-d]" style="margin-top:5px;" title="{#IMPORT_TAG_DATE#}">
<input class="mousetrap" readonly type="text" value="[row:XXX]" style="margin-top:5px;" title="{#IMPORT_TAG_1#}">
<input class="mousetrap" readonly type="text" value="[row:XXX:YYY:...]" style="margin-top:5px;" title="{#IMPORT_TAG_2#}">
</div>
</td> </td>
</tr> </tr>
{if $data.tags}
<tr> <tr>
<td align="center"> <td>
{#IMPORT_TAGS_TITLE#} <div class="pr12"><input class="mousetrap topleftDir" readonly style="width:100%" type="text" value="[row:XXX]" title="{#tag_one#}"></div>
</td> </td>
</tr> </tr>
<tr>
{foreach from=$data.tags key=k item=v} <td>
<div class="pr12"><input class="mousetrap topleftDir" readonly style="width:100%" type="text" value="[row:XXX:YYY:...]" title="{#tag_many#}"></div>
</td>
</tr>
{if $import.tags}
<tr> <tr>
<td align="center"> <td align="center">
<div class="pr12"><input class="mousetrap" readonly type="text" value="{$v}"></div> {#fields_file#}
</td>
</tr>
{foreach from=$import.tags item=tag}
<tr>
<td>
<div class="pr12"><input class="mousetrap" readonly style="width:100%" type="text" value="{$tag}"></div>
</td> </td>
</tr> </tr>
{/foreach} {/foreach}
<tr>
{/if} {/if}
</table> </table>
</div> </div>
{/if} {/if}
</form> </form>
<script type="text/javascript">
$(function() {ldelim}
Mousetrap.bind(['ctrl+s', 'meta+s'], function(event) {ldelim}
event.preventDefault();
{if $import_id}
saveCont();
{else}
$('#importSaveForm').submit();
{/if}
return false;
{rdelim});
<script language="javascript"> {if $import_id}
var sett_options = {ldelim} Mousetrap.bind(['ctrl+o', 'meta+o'], function(event) {ldelim}
url: 'index.php?do=modules&action=modedit&mod=import&moduleaction=saveedit&cp={$sess}', event.preventDefault();
beforeSubmit: Request, importRun ();
success: Response, return false;
error: Error {rdelim});
{rdelim} {/if}
function Request(){ldelim}
$.alerts._overlay('show');
{rdelim}
function Response(){ldelim}
$.alerts._overlay('hide');
$.jGrowl('{#IMPORT_SAVED#}', {ldelim}theme: 'accept'{rdelim});
{rdelim}
function Error(){ldelim}
$.alerts._overlay('hide');
$.jGrowl('{#IMPORT_FAILED#}', {ldelim}theme: 'error'{rdelim});
{rdelim}
$(document).ready(function(){ldelim}
Mousetrap.bind(['ctrl+s', 'meta+s'], function(e) {ldelim} $('.importSaveContBtn').click(function(event) {ldelim}
if (e.preventDefault) {ldelim} saveCont();
e.preventDefault();
{rdelim} else {ldelim}
// internet explorer
e.returnValue = false;
{rdelim}
$("#import_edit_form").ajaxSubmit(sett_options);
return false; return false;
{rdelim}); {rdelim});
{rdelim});
$(".SaveEdit").click(function(e){ldelim} // функция ajax-сохранения
if (e.preventDefault) {ldelim} function saveCont () {ldelim}
e.preventDefault(); $('#importSaveForm').ajaxSubmit({ldelim}
{rdelim} else {ldelim} dataType: 'json',
// internet explorer beforeSubmit: function () {ldelim} $.alerts._overlay('show');{rdelim},
e.returnValue = false; success: function (data) {ldelim}
$.alerts._overlay('hide');
$.jGrowl(data['message'], {ldelim}
header: data['header'],
theme: data['theme']
{rdelim});
{rdelim} {rdelim}
$("#import_edit_form").ajaxSubmit(sett_options);
return false;
{rdelim}); {rdelim});
return false;
{rdelim}
{rdelim}); // функция запуска импорта
</script> function importRun () {ldelim}
location.href='index.php?do=modules&action=modedit&mod=import&moduleaction=importrun&import_id={$import_id}&cp={$sess}';
/* $.ajax({ldelim}
url: 'index.php?do=modules&action=modedit&mod=import&moduleaction=importrun&import_id={$import_id}&cp={$sess}',
beforeSend: function () {ldelim} $.alerts._overlay('show');{rdelim},
success: function () {ldelim}
$.alerts._overlay('hide');
$.jGrowl('{#imported#}', {ldelim} theme: 'accept'{rdelim});
{rdelim}
{rdelim});*/
{rdelim}
</script>
{if $import_id}
{include file="$codemirror_connect"}
{include conn_id="_1" file="$codemirror_editor" textarea_id='codemirror' ctrls='saveCont();' ctrlo='importRun();' height=200}
{include conn_id="_2" file="$codemirror_editor" textarea_id='codemirror2' ctrls='saveCont();' ctrlo='importRun();' height=200}
{include conn_id="_3" file="$codemirror_editor" textarea_id='codemirror3' ctrls='saveCont();' ctrlo='importRun();' height=200}
{/if}

Loading…
Cancel
Save