ACC SHELL

Path : /srv/www/vhosts/tsisystem/app/views/articles/
File Upload :
Current File : //srv/www/vhosts/tsisystem/app/views/articles/admin_edit.thtml

<?php echo $html->css('jscalendar/calendar-blue'); ?>
<?php echo $javascript->link('jscalendar/calendar'); ?>
<?php echo $javascript->link('jscalendar/lang/calendar-cs-lat2'); ?>
<?php echo $javascript->link('jscalendar/calendar-setup'); ?>

<?php echo $javascript->link('tiny_mce/tiny_mce_gzip.php'); ?>
<?php $javascript->link('tiny_mce/tiny_mce'); ?>

<script type="text/javascript"><!--

if (<?php echo empty($_SESSION['tinymce_disabled']) ? 1 : 0; ?>)

tinyMCE.init({
	mode : "exact",
	elements : "article_content,article_perex",
	theme : "advanced",

	theme_advanced_buttons1 : "link,bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,sub,sup,separator,forecolor,image,separator,undo,redo",
	theme_advanced_buttons2 : "fontselect,fontsizeselect,removeformat,cleanup",
    theme_advanced_buttons3 : "charmap,emotions,iespell,media,advhr",

	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "bottom",
    theme_advanced_resizing : true,
	
	entities : "nbsp,amp,quot,cent,euro,pound,yen,copy,reg,trade,permil,micro,middot,bull,hellip,prime,Prime,sect,para,szlig,lsaquo,rsaquo,laquo,raquo,lsquo,rsquo,ldquo,rdquo,sbquo,bdquo,lt,gt,le,ge,ndash,mdash,macr,oline,curren,brvbar,uml,iexcl,iquest,circ,tilde,deg,minus,plusmn,divide,frasl,times,sup1,sup2,sup3,frac14,frac12,frac34,fnof,int,sum,infin,radic,sim,cong,asymp,ne,equiv,isin,notin,ni,prod,and,or,not,cap,cup,part,forall,exist,empty,nabla,lowast,prop,ang,cedil,ordf,ordm,dagger,Dagger,AElig,Ccedil,ETH,Oslash,OElig,THORN,aelig,ccedil,eth,oslash,oelig,thorn,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,alefsym,piv,real,thetasym,upsih,weierp,image,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,there4,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,shy",
	theme_advanced_styles : "Na střed=st-center;Vlevo=st-left;Vpravo=st-right"
});

var galleryW = null;
function selectIcon()
{
    galleryW = window.open("../../../../admin/gallery", "Title", "menubar=no,scrollbars=yes");
/*
	galleryW = window.open(
        '../../../admin/gallery',
		'Image gallery',
		'width=800,height=600,location=no,directories=no,scrollbars=yes');
*/
}

function selectImage(url)
{
    var html = "<a href=\"javascript: selectIcon()\"><img src=\"" + url + "\" alt=\"\" width=\"100\" height=\"100\" /></a>"
	    + "<input type=\"hidden\" name=\"data[Article][icon]\" value=\"" + url + "\" />&nbsp;<input type=\"button\" value=\"...\" onclick=\"selectIcon()\" />&nbsp;<input type=\"button\" value=\"&nbsp;X&nbsp;\" onclick=\"dropIcon()\" />";

	document.getElementById("icon").innerHTML = html;
	setTimeout("galleryW.close();", 500);
}

function dropIcon()
{
    var html = "<input type=\"hidden\" name=\"data[Article][icon]\" value=\"\" />&nbsp;<input type=\"button\" value=\"...\" onclick=\"selectIcon()\" />";
	document.getElementById("icon").innerHTML = html;
}

function typeChange(v)
{
    for (i = 0; i < 3; i++) {
        if (obj = document.getElementById("type-" + i)) {
            obj.style.display = "none";
        }
    }
	if (obj = document.getElementById("type-" + v)) {
		obj.style.display = "";
	}

}

var tinyMCEmode = true;

function toggleEditorMode() {
    try {
        if(tinyMCEmode) {
            tinyMCE.removeMCEControl(tinyMCE.getEditorId('article_content'));
            tinyMCE.removeMCEControl(tinyMCE.getEditorId('article_perex'));
            tinyMCEmode = false;
        } else {
            tinyMCE.addMCEControl(document.getElementById('article_content'), 'article_content');
            tinyMCE.addMCEControl(document.getElementById('article_perex'), 'article_perex');
            tinyMCEmode = true;
        }
    } catch(e) {
        //error handling
    }
}
// --></script>

<div id="main">
<div style="padding: 0.5em">

<h1>Upravit zprávu</h1>

<form action="<?php echo $html->url('/admin/articles/edit/'.$articles['Article']['id'].''); ?>" method="post">
  <table class="edit">
	<tr>
	  <td style="width: 140px"><label for="article_title">Titulek</label></td>
	  <td>
		<?php echo $html->input('Article/title', array('id' => 'article_title', 'value' => h($articles['Article']['title']), 'size' => 60)) ?>
		<?php $msg = empty($articles['Article']['title']) ? 'Nadpis nesmí být prázdný' : 'Nadpis musí být UNIKÁTNÍ, tento je již použit!'; ?>
		<?php echo $html->tagErrorMsg('Article/title', $msg); ?>
	  </td>

	  <td rowspan="3" width="35%">
		<div style="float: left">Ikona:&nbsp;</div>
		<div id="icon">
		  <?php if ($articles['Article']['icon']) : ?>
		  <a href="javascript: selectIcon()"><img src="<?php echo $articles['Article']['icon']; ?>" alt="" width="100" height="100" /></a>
		  <?php endif; ?>&nbsp;<input type="button" value="..." onclick="selectIcon()" />&nbsp;<input type="button" value="&nbsp;X&nbsp;" onclick="dropIcon()" />
		  <input type="hidden" name="data[Article][icon]" value="<?php echo $articles['Article']['icon']; ?>" />
		</div>
	  </td>
	</tr>

	<tr>
	  <td><label for="article_published">Zobrazit?</label></td>
	  <td>
		<?php echo $html->checkbox('Article/published', '', array('id' => 'article_published', 'value' => 1)); ?>
		&nbsp;&nbsp;
		<label for="article_publish_from">od data</label>
		<?php echo $html->input('Article/publish_from', array('value' => toDate($articles['Article']['publish_from'], 1), 'size' => 10, 'id' => 'article_publish_from')); ?>
		<input type="button" value=" ... " id="cal1_tg" />
		&nbsp;&nbsp;&nbsp;
		<label for="article_publish_to">do data</label>
	<?php echo $html->input('Article/publish_to', array('value' => toDate($articles['Article']['publish_to'], 1), 'size' => 10, 'id' => 'article_publish_to')); ?>
		<input type="button" value=" ... " id="cal2_tg" />
	  </td>
	</tr>

	<tr id="type-0" <?php if (0 != $articles['Article']['article_type']) echo ' style="display: none" '; ?>>
	  <td><label for="article_news">V&nbsp;aktualitách?</label></td>
	  <td>
		<?php echo $html->checkbox('Article/news_1', '', array('id' => 'article_news', 'value' => 1)); ?>
	  </td>
	</tr>

	<tr id="type-1" <?php if (1 != $articles['Article']['article_type']) echo ' style="display: none" '; ?>>
	  <td><label for="article_news">V&nbsp;aktualitách?</label></td>
	  <td>
		<?php echo $html->checkbox('Article/news_2', '', array('id' => 'article_news', 'value' => 1)); ?>
	  </td>
	</tr>

	<tr id="type-2" <?php if (2 != $articles['Article']['article_type']) echo ' style="display: none" '; ?>>
	  <td><label for="article_created_d">Datum?</label></td>
	  <td>
		<?php echo $html->input('Article/created_d', array('id' => 'article_created_d', 'size' => 10, 'value' => toDate($articles['Article']['created_d']))); ?>
		<input type="button" value=" ... " id="cal3_tg" />
	  </td>
	</tr>


	<tr>
	  <td>Typ zprávy</td>
	  <td>
		<?php echo $html->selecttag('Article/article_type', array(
0 => 'Novinka',
1 => 'Výstavy..',
2 => 'Publikace..',

), $articles['Article']['article_type'], array('onchange' => 'typeChange(this.value)'), NULL, 0

) ?></td>
	</tr>


	<tr>
	  <td><label for="article_content">Perex</label></td>
	  <td colspan="2">
 		<?php echo $html->textarea('Article/perex', array('id' => 'article_perex', 'cols' => '80', 'rows' => '10', 'value' => h($articles['Article']['perex']), )) ?>
		<?php echo $html->tagErrorMsg('Article/perex', 'Perex nesmí být prázdný') ?>
		<br /><a href="javascript: toggleEditorMode()">#</a>
	  </td>
	</tr>
	<tr>
	  <td><label for="article_content">Text</label></td>
	  <td colspan="2">
 		<?php echo $html->textarea('Article/content', array('id' => 'article_content', 'cols' => '80', 'rows' => '25', 'value' => h($articles['Article']['content']), )) ?>
		<?php echo $html->tagErrorMsg('Article/content', 'Obsah nesmí být prázdný') ?>
		<br /><a href="javascript: toggleEditorMode()">#</a>
	  </td>
	</tr>

	<tr>
	  <td rowspan="5">Soubory</td>

<?php
   $i = 0;
   foreach ($files as $file) :
   if ($i++) echo '<tr>';
?>
	  <td colspan="2">
		<input type="text" size="40" name="files[]" value="<?php echo $file['id'] ? "files/view/" . $file['id'] : "" ?>" />
		<?php if ($file['id'])
			  echo $file['name'], ' (', round($file['size'] / 1024, 1), 'kB)';
	    ?>
	  </td>
	</tr>
<?php endforeach; ?>

	<tr>
	  <td colspan="2">
		<?php echo $html->hidden('Article/id', array('value' => $articles['Article']['id']))?><div class="submit"><input type="submit" value="Uložit" /></div>
	  </td>
	</tr>
  </table>
</form>

<script type="text/javascript"><!--
  Calendar.setup(
    {
      inputField  : "article_publish_from",         // ID of the input field
      ifFormat    : "%d.%m.%Y",    // the date format
      button      : "cal1_tg"        // ID of the button
    }
  );
  Calendar.setup(
    {
      inputField  : "article_publish_to",         // ID of the input field
      ifFormat    : "%d.%m.%Y",    // the date format
      button      : "cal2_tg"       // ID of the button
    }
  );
  Calendar.setup(
    {
      inputField  : "article_created_d",         // ID of the input field
      ifFormat    : "%d.%m.%Y",    // the date format
      button      : "cal3_tg"       // ID of the button
    }
  );
// --></script>

<p />
<?php echo $html->link('Zpět na seznam', '/admin/articles/index')?>

</div>
</div>

ACC SHELL 2018