Модуль Публикатор документов v1.26.6
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

401 lines
17 KiB

<div class="title">
<h5>{#EDITDOC_INSERT_H#}</h5>
</div>
<div class="widget" style="margin-top: 0px;">
<div class="body">
{#EDITDOC_INSERT#}
</div>
</div>
<div class="breadCrumbHolder module">
<div class="breadCrumb module">
<ul>
<li class="firstB"><a href="index.php" title="{#MAIN_PAGE#}">{#MAIN_PAGE#}</a></li>
<li><a href="index.php?do=modules&amp;cp={$sess}">{#MODULES_SUB_TITLE#}</a></li>
<li><a href="index.php?do=modules&action=modedit&mod=editdoc&moduleaction=1&cp={$sess}">{#EDITDOC_LIST_LINK#}</a></li>
<li><strong class="code">{if $smarty.request.id != ''}{$editdoc_name|escape}{else}{$smarty.request.editdoc_name}{/if}</strong></li>
</ul>
</div>
</div>
{if $template != true}
<ul class="messages first">
<li class="highlight red">
<strong>{#EDITDOC_NOT_TEMPLATE#}</strong>
</li>
</ul>
{/if}
<form id="save_editdoc" action="index.php?do=modules&action=modedit&mod=editdoc&moduleaction=saveedit&cp={$sess}" method="post" class="mainForm">
{if $smarty.request.id != ''}
{include file="$codemirror_connect"}
<div class="widget first">
<div class="head">
<h5 class="iFrames">{if $smarty.request.id != ''}{#EDITDOC_EDIT_H#}{else}{#EDITDOC_INSERT_H#}{/if}</h5>
</div>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic mainForm">
<tr>
<td>{#EDITDOC_NAME#}</td>
<td>
<div class="pr12">
<input name="editdoc_name" class="mousetrap" type="text" value="{$editdoc_name|escape}" size="200" />
</div>
</td>
</tr>
<tr>
<td>{#EDITDOC_RUBRICS#}</td>
<td>
<select name="editdoc_rub" {if $smarty.request.id != ''}disabled="disabled"{/if} size="4">
{foreach from=$rubs item=rub}
{if $rub->Id == $editdoc_rub}
<option value="{$rub->Id}" selected>{$rub->rubric_title}</option>
{else}
<option value="{$rub->Id}">{$rub->rubric_title}</option>
{/if}
{/foreach}
</select>
</td>
</tr>
<tr>
<td>{#EDITDOC_USE_CODE#}</td>
<td>
<div class="pr12">
<input type="checkbox" value="1" name="editdoc_use_rubric_code" class="float" {if $editdoc_use_rubric_code}checked="checked"{/if} />
</div>
</td>
</tr>
<tr>
<td>{#EDITDOC_USE_REVISIONS#}</td>
<td>
<div class="pr12">
<input type="checkbox" value="1" name="editdoc_use_revisions" class="float" {if $editdoc_use_revisions}checked="checked"{/if} />
</div>
</td>
</tr>
</table>
</div>
<div class="widget first">
<div class="head">
<h5 class="iFrames">{#EDITDOC_HEADER_FORM#}</h5>
</div>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic mainForm">
<thead>
<tr>
<td>{#EDITDOC_HEADER_PHP#}</td>
</tr>
</thead>
<tbody>
<tr>
<td>
|&nbsp;
<a href="javascript:void(0);" class="topDir" title="{#EDITDOC_TAG_HEADER#}" onclick="textSelection('[header:', ']');"><strong>[header:XXX]</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class="topDir" title="{#EDITDOC_TAG_BODY#}" onclick="textSelection('[body:', ']');"><strong>[body:XXX]</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class="topDir" title="{#EDITDOC_TAG_TITLE#}" onclick="textSelection('[title:', ']');"><strong>[title:XXX]</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class="topDir" title="{#EDITDOC_TAG_TYPE#}" onclick="textSelection('[type:', ']');"><strong>[type:XXX]</strong></a>&nbsp;|
</td>
</tr>
<tr>
<td>
<textarea class="mousetrap" {$read_only} name="editdoc_template" id="editdoc_template" wrap="off" style="width:100%; height:340px">{$editdoc_template|default:$prefab|escape:html}</textarea>
</td>
</tr>
<tr>
<td>
|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<ol>', '</ol>');"><strong>OL</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<ul>', '</ul>');"><strong>UL</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<li>', '</li>');"><strong>LI</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<p class=&quot;&quot;>', '</p>');"><strong>P</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<strong>', '</strong>');"><strong>B</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<em>', '</em>');"><strong>I</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<h1>', '</h1>');"><strong>H1</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<h2>', '</h2>');"><strong>H2</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<h3>', '</h3>');"><strong>H3</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<h4>', '</h4>');"><strong>H4</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<h5>', '</h5>');"><strong>H5</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<div class=&quot;&quot; id=&quot;&quot;>', '</div>');"><strong>DIV</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<a href=&quot;&quot; title=&quot;&quot;>', '</a>');"><strong>A</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<img src=&quot;&quot; alt=&quot;&quot; />', '');"><strong>IMG</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<span>', '</span>');"><strong>SPAN</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<pre>', '</pre>');"><strong>PRE</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('<br />', '');"><strong>BR</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection('\t', '');"><strong>TAB</strong></a>&nbsp;|
</td>
</tr>
</tbody>
</table>
</div>
<div class="widget first">
<div class="head">
<h5 class="iFrames">{#EDITDOC_HEADER_HEAD#}</h5>
</div>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic mainForm">
<col width="16%" />
<col width="42%" />
<col width="42%" />
<thead>
<tr>
<td>&nbsp;</td>
<td>{#EDITDOC_HEADER_CORE#}</td>
<td>{#EDITDOC_HEADER_INSTR#}</td>
</tr>
</thead>
<tbody>
{foreach from=$data.header key=k item=v}
<tr>
<td>
<strong>$data['header']['{$k}']</strong>
</td>
<td>
<div class="pr12"><textarea class="mousetrap" name="document[header][{$k}]" id="document_header_{$k}" cols="60" rows="7">{$v[0]|default:$prefab|escape:html}</textarea></div>
{include file="$codemirror_editor" ctrls='$("#save_editdoc").ajaxSubmit(sett_options);' conn_id="document_header_$k" textarea_id="document_header_$k" height=100}
</td>
<td>
<div class="pr12"><textarea class="mousetrap" name="document[template][{$k}]" id="document_template_{$k}" cols="60" rows="7">{$v[1]|default:$prefab|escape:html}</textarea></div>
{include file="$codemirror_editor" ctrls='$("#save_editdoc").ajaxSubmit(sett_options);' conn_id="document_template_$k" textarea_id="document_template_$k" height=100}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
<div class="widget first">
<div class="head">
<h5 class="iFrames">{#EDITDOC_HEADER_BODY#}</h5>
</div>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic mainForm">
<col width="16%" />
<col width="42%" />
<col width="42%" />
<thead>
<tr>
<td>&nbsp;</td>
<td>{#EDITDOC_HEADER_CORE#}</td>
<td>{#EDITDOC_HEADER_INSTR#}</td>
</tr>
</thead>
<tbody>
{foreach from=$data.body key=k item=v}
<tr>
<td>
<strong>{$v[0]}</strong><br>
$data['body']['{$k}']
</td>
<td>
<div class="pr12">
<textarea class="mousetrap" name="document[body][{$k}]" id="document_body_{$k}">{$v[1]|default:$prefab|escape:html}</textarea>
</div>
{include file="$codemirror_editor" ctrls='$("#save_editdoc").ajaxSubmit(sett_options);' conn_id="document_body_$k" textarea_id="document_body_$k" height=120}
</td>
<td>
<div class="pr12">
<textarea class="mousetrap" name="document[template][{$k}]" id="document_body_template_{$k}">{$v[2]|default:$prefab|escape:html}</textarea>
</div>
{include file="$codemirror_editor" ctrls='$("#save_editdoc").ajaxSubmit(sett_options);' conn_id="document_body_template_$k" textarea_id="document_body_template_$k" height=120}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
<div class="widget first">
<div class="head">
<h5 class="iFrames">{#EDITDOC_HEADER_BEFORE#}</h5>
</div>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic mainForm">
<thead>
<tr>
<td>{#EDITDOC_HEADER_PHP#}</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<textarea {$read_only} name="editdoc_before_edit" id="editdoc_before_edit" wrap="off" style="width:100%; height:340px">{$editdoc_before_edit|default:$prefab|escape:html}</textarea>
</td>
</tr>
<tr>
<td>
|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<ol>', '</ol>');"><strong>OL</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<ul>', '</ul>');"><strong>UL</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<li>', '</li>');"><strong>LI</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<p class=&quot;&quot;>', '</p>');"><strong>P</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<strong>', '</strong>');"><strong>B</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<em>', '</em>');"><strong>I</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<h1>', '</h1>');"><strong>H1</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<h2>', '</h2>');"><strong>H2</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<h3>', '</h3>');"><strong>H3</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<h4>', '</h4>');"><strong>H4</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<h5>', '</h5>');"><strong>H5</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<div class=&quot;&quot; id=&quot;&quot;>', '</div>');"><strong>DIV</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<a href=&quot;&quot; title=&quot;&quot;>', '</a>');"><strong>A</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<img src=&quot;&quot; alt=&quot;&quot; />', '');"><strong>IMG</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<span>', '</span>');"><strong>SPAN</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<pre>', '</pre>');"><strong>PRE</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('<br />', '');"><strong>BR</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection2('\t', '');"><strong>TAB</strong></a>&nbsp;|
</td>
</tr>
</tbody>
</table>
</div>
<div class="widget first">
<div class="head">
<h5 class="iFrames">{#EDITDOC_HEADER_AFTER#}</h5>
</div>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic mainForm">
<thead>
<tr>
<td>{#EDITDOC_HEADER_PHP#}</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<textarea {$read_only} name="editdoc_after_edit" id="editdoc_after_edit" wrap="off" style="width:100%; height:340px">{$editdoc_after_edit|default:$prefab|escape:html}</textarea>
</td>
</tr>
<tr>
<td>
|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<ol>', '</ol>');"><strong>OL</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<ul>', '</ul>');"><strong>UL</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<li>', '</li>');"><strong>LI</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<p class=&quot;&quot;>', '</p>');"><strong>P</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<strong>', '</strong>');"><strong>B</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<em>', '</em>');"><strong>I</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<h1>', '</h1>');"><strong>H1</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<h2>', '</h2>');"><strong>H2</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<h3>', '</h3>');"><strong>H3</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<h4>', '</h4>');"><strong>H4</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<h5>', '</h5>');"><strong>H5</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<div class=&quot;&quot; id=&quot;&quot;>', '</div>');"><strong>DIV</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<a href=&quot;&quot; title=&quot;&quot;>', '</a>');"><strong>A</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<img src=&quot;&quot; alt=&quot;&quot; />', '');"><strong>IMG</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<span>', '</span>');"><strong>SPAN</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<pre>', '</pre>');"><strong>PRE</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('<br />', '');"><strong>BR</strong></a>&nbsp;|&nbsp;
<a href="javascript:void(0);" onclick="textSelection3('\t', '');"><strong>TAB</strong></a>&nbsp;|
</td>
</tr>
</tbody>
</table>
<div class="rowElem" id="saveBtn">
<div class="saveBtn">
<input type="hidden" name="id" value="{$id}">
<input type="submit" class="basicBtn" value="{#EDITDOC_SAVEDIT#}" />
&nbsp;
<input type="submit" class="blackBtn SaveEdit" name="next_edit" value="{#EDITDOC_SAVEDIT_NEXT#}" />
</div>
</div>
</div>
{include file="$codemirror_editor" conn_id="" textarea_id='editdoc_template' ctrls='$("#save_editdoc").ajaxSubmit(sett_options);' height=420}
{include file="$codemirror_editor" conn_id="2" textarea_id='editdoc_before_edit' ctrls='$("#save_editdoc").ajaxSubmit(sett_options);' height=440}
{include file="$codemirror_editor" conn_id="3" textarea_id='editdoc_after_edit' ctrls='$("#save_editdoc").ajaxSubmit(sett_options);' height=440}
<script language="javascript">
var sett_options = {ldelim}
url: 'index.php?do=modules&action=modedit&mod=editdoc&moduleaction=saveedit&cp={$sess}',
beforeSubmit: Request,
success: Response
{rdelim}
function Request(){ldelim}
$.alerts._overlay('show');
{rdelim}
function Response(){ldelim}
$.alerts._overlay('hide');
$.jGrowl('{#EDITDOC_SAVED#}', {ldelim}theme: 'accept'{rdelim});
{rdelim}
$(document).ready(function(){ldelim}
Mousetrap.bind(['ctrl+s', 'meta+s'], function(e) {ldelim}
if (e.preventDefault) {ldelim}
e.preventDefault();
{rdelim} else {ldelim}
// internet explorer
e.returnValue = false;
{rdelim}
$("#save_editdoc").ajaxSubmit(sett_options);
return false;
{rdelim});
$(".SaveEdit").click(function(e){ldelim}
if (e.preventDefault) {ldelim}
e.preventDefault();
{rdelim} else {ldelim}
// internet explorer
e.returnValue = false;
{rdelim}
$("#save_editdoc").ajaxSubmit(sett_options);
return false;
{rdelim});
{rdelim});
</script>
{else}
<div class="widget first">
<div class="head">
<h5 class="iFrames">{if $smarty.request.id != ''}{#EDITDOC_EDIT_H#}{else}{#EDITDOC_INSERT_H#}{/if}</h5>
</div>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic mainForm">
<tr>
<td>{#EDITDOC_NAME#}</td>
<td><div class="pr12"><input name="editdoc_name" class="mousetrap" type="text" value="{if $smarty.request.id != ''}{$editdoc_name|escape}{else}{$smarty.request.editdoc_name}{/if}" size="80" /></div></td>
</tr>
<tr>
<td>{#EDITDOC_RUBRICS#}</td>
<td>
<select name="editdoc_rub" {if $smarty.request.id != ''}disabled="disabled"{/if}>
{foreach from=$rubs item=rub}
{if $rub->Id==$editdoc_rub}
<option value="{$rub->Id}" selected>{$rub->rubric_title}</option>
{else}
<option value="{$rub->Id}">{$rub->rubric_title}</option>
{/if}
{/foreach}
</select>
</td>
</tr>
<tr>
<td colspan="2">
<input name="submit" type="submit" class="basicBtn" value="{#EDITDOC_SAVE#}" />
</td>
</tr>
</table>
</div>
{/if}
</form>
<br /><br /><br /><br /><br />