<?php /* Smarty version 2.6.25, created on 2012-07-15 10:54:08
         compiled from DefaultAdmin/dir_categs_edit.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'cat', 'DefaultAdmin/dir_categs_edit.tpl', 4, false),array('modifier', 'escape', 'DefaultAdmin/dir_categs_edit.tpl', 112, false),array('modifier', 'trim', 'DefaultAdmin/dir_categs_edit.tpl', 147, false),array('function', 'formtool_count_chars', 'DefaultAdmin/dir_categs_edit.tpl', 202, false),array('function', 'html_options', 'DefaultAdmin/dir_categs_edit.tpl', 247, false),array('block', 'escapejs', 'DefaultAdmin/dir_categs_edit.tpl', 358, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "messages.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=@ADMIN_TEMPLATE)) ? $this->_run_mod_handler('cat', true, $_tmp, "/validation.tpl") : smarty_modifier_cat($_tmp, "/validation.tpl")), 'smarty_include_vars' => array('form_id' => 'edit_categ_form','validators' => $this->_tpl_vars['validators'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<?php echo '
<script type="text/javascript">

Array.prototype.in_array = function(p_val) {
	for(var i = 0, l = this.length; i < l; i++) {
		if(this[i] == p_val) {
			return true;
		}
	}
	return false;
}

function plusFile()
{
	var div = $(\'file\');
	var newDiv = div.cloneNode(true);
	newDiv.id = \'\'
	//newDiv.style.display = \'none\';

	//newDiv.find(\'*.smallText\').val("");

	var delLink = $(\'fileDelLink\');
	var a = delLink.cloneNode(true);
	a.id = \'\';
	a.style.display = "inline";
	newDiv.appendChild(a);
	delLink.parentNode.insertBefore(newDiv, delLink);

}

function removeFile(elem)
{
	elem.parentNode.remove(elem.previousSibling);
}

function removeSize(elem)
{
	elem.parentNode.parentNode.removeChild(elem.parentNode);
}


function plusCateg()
{
	var div = $(\'categ\');
	var newDiv = div.cloneNode(true);
	newDiv.id = \'\'
	newDiv.style.display = \'block\';

	//newDiv.find(\'*.smallText\').val("");

	var delLink = $(\'fileDelCateg\');
	var a = delLink.cloneNode(true);
	a.id = \'\';
	a.style.display = "inline";
	newDiv.appendChild(a);
	delLink.parentNode.insertBefore(newDiv, delLink);

}

function removeCateg(elem)
{
	elem.parentNode.remove(elem.previousSibling);

}

function removeSize(elem)
{
	elem.parentNode.parentNode.removeChild(elem.parentNode);
}

</script>
'; ?>



<?php if ($this->_tpl_vars['symbolic'] == 1): ?>
    <?php echo '
    <script type="text/javascript">
    jQuery(function($) {
        $(document).ready(function(){
            $(\'#PARENT_ID\').change(function() {
               valid_obj.edit_categ_form.rules.SYMBOLIC_ID.remote.data.PARENT_ID = $(\'#PARENT_ID\').val();
            });
        });
    });
    </script>
    '; ?>

<?php else: ?>
    <?php echo '
    <script type="text/javascript">
    jQuery(function($) {
        $(document).ready(function(){
            $(\'#PARENT_ID\').change(function() {
               valid_obj.edit_categ_form.rules.TITLE.remote.data.PARENT_ID = $(\'#PARENT_ID\').val();
            });
        });
    });
    </script>
    '; ?>

<?php endif; ?>

<?php echo ''; ?><?php if (( isset ( $this->_tpl_vars['error'] ) && $this->_tpl_vars['error'] > 0 ) || ! empty ( $this->_tpl_vars['sql_error'] )): ?><?php echo '<div class="error block"><h2>Error</h2><p>An error occured while saving.</p>'; ?><?php if (! empty ( $this->_tpl_vars['errorMsg'] )): ?><?php echo '<p>'; ?><?php echo ((is_array($_tmp=$this->_tpl_vars['errorMsg'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?><?php echo '</p>'; ?><?php endif; ?><?php echo ''; ?><?php if (! empty ( $this->_tpl_vars['sql_error'] )): ?><?php echo '<p>The database server returned the following message:</p><p>'; ?><?php echo ((is_array($_tmp=$this->_tpl_vars['sql_error'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?><?php echo '</p>'; ?><?php endif; ?><?php echo '</div>'; ?><?php endif; ?><?php echo ''; ?><?php if (! $this->_tpl_vars['id']): ?><?php echo ''; ?><?php if ($this->_tpl_vars['posted']): ?><?php echo '<div class="success block">Category saved.</div>'; ?><?php elseif (isset ( $this->_tpl_vars['quickAdded'] ) && $this->_tpl_vars['quickAdded'] > 0): ?><?php echo '<div class="success block">'; ?><?php echo $this->_tpl_vars['quickAdded']; ?><?php echo ' subcategories saved!</div>'; ?><?php endif; ?><?php echo '<div class="block"><form method="post" action="" id="edit_categ_form"><table class="formPage">'; ?><?php if (isset ( $this->_tpl_vars['action'] ) && ( $this->_tpl_vars['action'] == 'N' || $this->_tpl_vars['action'] == 'E' || $this->_tpl_vars['action'] == 'M' )): ?><?php echo '<thead><tr><th colspan="2">'; ?><?php if ($this->_tpl_vars['action'] == 'N'): ?><?php echo ''; ?><?php if ($this->_tpl_vars['symbolic'] == 1): ?><?php echo 'Create new symbolic category'; ?><?php else: ?><?php echo 'Create new'; ?><?php if ($this->_tpl_vars['symbolic'] == 1): ?><?php echo ' symbolic'; ?><?php endif; ?><?php echo ' category'; ?><?php endif; ?><?php echo ''; ?><?php elseif ($this->_tpl_vars['action'] == 'E'): ?><?php echo 'Edit Category'; ?><?php elseif ($this->_tpl_vars['action'] == 'M'): ?><?php echo 'Add Subcategories to: '; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['currentCategory']['TITLE'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo ''; ?><?php endif; ?><?php echo '</th></tr></thead>'; ?><?php endif; ?><?php echo '<tbody>'; ?><?php if ($this->_tpl_vars['action'] == 'M'): ?><?php echo '<tr><td class="label"><label for="multicategs">Title:</label></td><td class="smallDesc"><textarea name="multicategs" id="multicategs" rows="10" cols="50" class="text">'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['multicategs'])) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?><?php echo '</textarea><p class="info">Place a line break between each category title.</p><p class="info">Duplicate entries are auto skipped.</p></td></tr>'; ?><?php else: ?><?php echo '<tr><td class="label'; ?><?php if ($this->_tpl_vars['symbolic'] != 1): ?><?php echo ' required'; ?><?php endif; ?><?php echo '"><label for="TITLE">Title:</label></td><td class="smallDesc"><input type="text" id="TITLE" name="TITLE" value="'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['TITLE'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo '" maxlength="'; ?><?php echo @CAT_TITLE_MAX_LENGTH; ?><?php echo '" class="text" />'; ?><?php if ($this->_tpl_vars['symbolic'] == 1): ?><?php echo '<p class="notice msg">Leave blank to follow the title of the category that you\'re creating a symbolic link for.</p>'; ?><?php endif; ?><?php echo '</td></tr>'; ?><?php if ($this->_tpl_vars['ENABLE_REWRITE'] && $this->_tpl_vars['symbolic'] != 1): ?><?php echo '<tr><td class="label required"><label for="TITLE_URL">URL Title:</label></td><td class="smallDesc"><input type="text" id="TITLE_URL" name="TITLE_URL" value="'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['TITLE_URL'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo '" maxlength="255" class="text" /></td></tr>'; ?><?php endif; ?><?php echo '<tr><td class="label required"><label for="URL">URL:</label></td><td class="smallDesc"><input type="text" id="URL" name="URL" value="'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['URL'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo '" class="text" /><p class="limitDesc">Fill this if you want to make this category link to be just a link on some URL</p></td></tr><tr><td class="label required"><label for="NEW_WINDOW">Open in new window:</label></td><td class="smallDesc"><input type="hidden" name="NEW_WINDOW" value="0"/><input type="checkbox" id="NEW_WINDOW" name="NEW_WINDOW" value="1" '; ?><?php if ($this->_tpl_vars['NEW_WINDOW'] == 1): ?><?php echo 'checked="checked"'; ?><?php endif; ?><?php echo '/><p class="limitDesc">If checked category page or custom url page will be opened in a new window</p></td>'; ?><?php if ($this->_tpl_vars['symbolic'] != 1): ?><?php echo '<tr><td class="label"><label for="DESCRIPTION">Description:</label></td><td class="smallDesc"><textarea name="DESCRIPTION" id="DESCRIPTION" rows="6" cols="50" class="text" '; ?><?php echo smarty_function_formtool_count_chars(array('name' => 'DESCRIPTION','limit' => @CAT_DESCRIPTION_MAX_LENGTH,'alert' => true), $this);?><?php echo '>'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['DESCRIPTION'])) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?><?php echo '</textarea><p class="limitDesc">Limit: <input type="text" name="DESCRIPTION_limit" class="limit_field" readonly="readonly" value="'; ?><?php echo $this->_tpl_vars['DescriptionLimit']; ?><?php echo '" /></p></td></tr>'; ?><?php endif; ?><?php echo '<tr><td class="label required"><label for="PARENT_ID">Parent:</label></td><td class="smallDesc">'; ?><?php echo ''; ?><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=@ADMIN_TEMPLATE)) ? $this->_run_mod_handler('cat', true, $_tmp, "/admin_category_select.tpl") : smarty_modifier_cat($_tmp, "/admin_category_select.tpl")), 'smarty_include_vars' => array('parent' => '1')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?><?php echo '</td></tr><tr><td class="label required"><label for="SORT_ORDER">Sort Order:</label></td><td class="smallDesc"><input type="text" id="SORT_ORDER" name="SORT_ORDER" value="'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['SORT_ORDER'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo '" maxlength="255" class="text" /></td></tr><tr><td class="label"><label for="RSS_URL">RSS feed:</label></td><td class="smallDesc"><input type="text" id="RSS_URL" name="RSS_URL" value="'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['RSS_URL'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo '" maxlength="255" class="text" /><p class="limitDesc">For an automatic update from the RSS feed set <strong>rss_import_feeds.php</strong> to run as a cron job.</p></td></tr>'; ?><?php if ($this->_tpl_vars['symbolic'] == 1): ?><?php echo '<tr><td class="label required"><label for="SYMBOLIC_ID">Symbolic category for:</label></td><td class="smallDesc">'; ?><?php echo ''; ?><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=@ADMIN_TEMPLATE)) ? $this->_run_mod_handler('cat', true, $_tmp, "/admin_category_select_symbolic.tpl") : smarty_modifier_cat($_tmp, "/admin_category_select_symbolic.tpl")), 'smarty_include_vars' => array('parent' => '1')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?><?php echo '</td></tr>'; ?><?php endif; ?><?php echo '<tr><td class="label required"><label for="STATUS">Link Type:</label></td><td class="smallDesc">'; ?><?php echo ''; ?><?php echo ''; ?><?php $_from = $this->_tpl_vars['LINK_TYPES']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['additional'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['additional']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['link_type']):
        $this->_foreach['additional']['iteration']++;
?><?php echo '<div>'; ?><?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['link_types'],'selected' => $this->_tpl_vars['link_type']['LINK_TYPE'],'name' => "LINK_TYPES[]",'id' => "LINK_TYPES[]"), $this);?><?php echo '&nbsp;'; ?><?php echo '<a href="#" onclick="removeCateg(this); return false;">remove</a><div style="float: none; clear: both; height: 8px;"></div></div>'; ?><?php endforeach; else: ?><?php echo '<div>'; ?><?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['link_types'],'name' => "LINK_TYPES[]",'id' => "LINK_TYPES[]"), $this);?><?php echo '&nbsp;</div>'; ?><?php endif; unset($_from); ?><?php echo '<div id="categ" style="display: none;"><br />'; ?><?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['link_types'],'name' => "LINK_TYPES[]",'id' => "LINK_TYPES[]"), $this);?><?php echo '&nbsp;</div><a href="" class="formDelCateg" id="fileDelCateg" onclick="removeCateg(this); return false;" style="display: none">remove</a><div class="clear"></div><br /><a onclick="plusCateg();return false;" href="" id="plusCategLink" class="formSmall" style="border-width: 0;">+ additional link type</a><p class="limitDesc">By default all link types are allowed for the category, by setting a link type it will then becomes only link types you set here.</p></td></tr><tr><td class="label required"><label for="STATUS">Status:</label></td><td class="smallDesc">'; ?><?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['stats'],'selected' => $this->_tpl_vars['STATUS'],'name' => 'STATUS','id' => 'STATUS'), $this);?><?php echo '</td></tr>'; ?><?php if ($this->_tpl_vars['symbolic'] != 1 && @ENABLE_META_TAGS == 1): ?><?php echo '<tr class="thead"><th colspan="2">META tags</th></tr><tr><th class="msg notice info" colspan="2">Define custom META tags. Leave blank to use default tags defined for your directory.</th></tr><tr><td class="label"><label for="META_KEYWORDS">META Keywords:</label></td><td class="smallDesc"><input type="text" id="META_KEYWORDS" name="META_KEYWORDS" value="'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['META_KEYWORDS'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo '" class="text" /><p class="msg notice info">Separate keywords by comma.</p></td></tr><tr><td class="label"><label for="META_DESCRIPTION">META Description:</label></td><td class="smallDesc"><textarea name="META_DESCRIPTION" id="META_DESCRIPTION" rows="3" cols="30" class="text" '; ?><?php echo smarty_function_formtool_count_chars(array('name' => 'META_DESCRIPTION','limit' => @META_DESCRIPTION_MAX_LENGTH,'alert' => true), $this);?><?php echo '>'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['META_DESCRIPTION'])) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?><?php echo '</textarea><p class="limitDesc">Limit: <input type="text" name="META_DESCRIPTION_limit" class="limit_field" readonly="readonly" value="'; ?><?php echo $this->_tpl_vars['MetaDescriptionLimit']; ?><?php echo '" /></p></td></tr>'; ?><?php endif; ?><?php echo ''; ?><?php if ($this->_tpl_vars['symbolic'] != 1): ?><?php echo '<tr><td class="label"><label for="TDESCRIPTION">Page Title:</label></td><td class="smallDesc"><textarea name="TDESCRIPTION" id="TDESCRIPTION" rows="6" cols="50" class="text" >'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['TDESCRIPTION'])) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?><?php echo '</textarea></td></tr>'; ?><?php endif; ?><?php echo ''; ?><?php if ($this->_tpl_vars['symbolic'] != 1): ?><?php echo '<tr><td class="label"><label for="CATCONTENT">Main area Content for the Category:</label></td><td class="smallDesc">'; ?><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=@ADMIN_TEMPLATE)) ? $this->_run_mod_handler('cat', true, $_tmp, "/rte.tpl") : smarty_modifier_cat($_tmp, "/rte.tpl")), 'smarty_include_vars' => array('NAME' => 'CATCONTENT','VALUE' => $this->_tpl_vars['CATCONTENT'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?><?php echo '</td></tr>'; ?><?php endif; ?><?php echo ''; ?><?php endif; ?><?php echo '</tbody><tfoot><tr><td><input type="reset" id="reset-categ-submit" name="reset" value="Reset" alt="Reset form" title="Reset form" class="button" /></td><td><input type="submit" id="send-categ-submit" name="save" value="Save" alt="Save form" title="Save category" class="button" /></td></tr></tfoot></table><input type="hidden" name="id" class="hidden" value="'; ?><?php echo $this->_tpl_vars['ID']; ?><?php echo '" /><input type="hidden" name="formSubmitted" value="1" /><input type="hidden" name="submit_session" value="'; ?><?php echo $this->_tpl_vars['submit_session']; ?><?php echo '" /></form></div>'; ?><?php else: ?><?php echo '<div class="block"><form method="post" action="" name="delete"><input type="hidden" name="action" class="hidden" value="D:'; ?><?php echo $this->_tpl_vars['id']; ?><?php echo '" /><input type="hidden" name="id" class="hidden" value="'; ?><?php echo $this->_tpl_vars['id']; ?><?php echo '" /><table class="formPage"><tbody><tr><td colspan="2">The category contains '; ?><?php echo $this->_tpl_vars['count_categs']; ?><?php echo ' subcategorie(s) '; ?><?php echo $this->_tpl_vars['count_links']; ?><?php echo ' link(s) and '; ?><?php echo $this->_tpl_vars['count_articles']; ?><?php echo ' article(s).<br />Cannot proceed with delete until further action is taken:</td></tr><tr><td class="label"><label for="do-categ-select">Move all to</label> <input type="radio" id="do-categ-select" name="do" value="move"'; ?><?php if ($this->_tpl_vars['do'] == 'move'): ?><?php echo ' checked="checked"'; ?><?php endif; ?><?php echo ' /></td><td class="smallDesc">'; ?><?php echo ''; ?><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=@ADMIN_TEMPLATE)) ? $this->_run_mod_handler('cat', true, $_tmp, "/admin_category_select.tpl") : smarty_modifier_cat($_tmp, "/admin_category_select.tpl")), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?><?php echo ''; ?><?php if ($this->_tpl_vars['error']): ?><?php echo '<span class="errForm">Please select another category.</span>'; ?><?php endif; ?><?php echo '</td></tr><tr><td class="label" colspan="2"><label for="do-delete-all">Delete all</label> <input type="radio" id="do-delete-all" name="do" value="delete"'; ?><?php if ($this->_tpl_vars['do'] == 'delete'): ?><?php echo ' checked="1"'; ?><?php endif; ?><?php echo ' /></td></tr></tbody><tfoot><tr><td><input type="submit" name="delete" value="Delete" onclick="return categ_rm_confirm(\''; ?><?php $this->_tag_stack[] = array('escapejs', array()); $_block_repeat=true;smarty_block_escapejs($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><?php echo 'Are you sure you want to remove this category?\\nNote: categories can not be restored after removal!'; ?><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_escapejs($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?><?php echo '\');" title="Remove Category" class="action delete button" /></td><td><input type="submit" name="cancel" value="Cancel" title="Cancel category removal" class="button" /></td></tr></tfoot></table></form></div>'; ?><?php endif; ?><?php echo ''; ?>