<?php /* Smarty version 2.6.25, created on 2012-07-19 11:01:48
         compiled from DefaultAdmin/article_list_dt.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('block', 'escapejs', 'DefaultAdmin/article_list_dt.tpl', 41, false),array('modifier', 'escape', 'DefaultAdmin/article_list_dt.tpl', 284, false),array('modifier', 'trim', 'DefaultAdmin/article_list_dt.tpl', 284, false),array('modifier', 'cat', 'DefaultAdmin/article_list_dt.tpl', 294, 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 echo '
<script type="text/javascript">
var oTable;
jQuery(function($) {
	$(document).ready(function() {
		$("#multiple_controls input").click(function() {
			ctrl_name = $(this).attr(\'name\');
			if (ctrl_name != \'check_all\' && ctrl_name != \'uncheck_all\')
				multiple_action(ctrl_name);
		});
		$("#check_all").click(function() {
			$("#example tbody tr").each(function(n,element){
				var chbox = \'#categ_\' + $(element).attr(\'id\');
				$(element).addClass(\'row_selected\');
				$(chbox).attr(\'checked\', true);
			});
		});
		$("#uncheck_all").click(function() {
			$("#example tbody tr").each(function(n,element){
				var chbox = \'#categ_\' + $(element).attr(\'id\');
				$(element).removeClass(\'row_selected\');
				$(chbox).attr(\'checked\', false);
			});
		});
		$("#status_active").live("click", function () {
			var id = $(this).parent().parent().parent().attr(\'id\');
			single_action(\'active\', id);
		});
		$("#status_pending").live("click", function () {
			var id = $(this).parent().parent().parent().attr(\'id\');
			single_action(\'pending\', id);
		});
		$("#status_inactive").live("click", function () {
			var id = $(this).parent().parent().parent().attr(\'id\');
			single_action(\'inactive\', id);
		});
                $("#action_del").live("click", function() {
                   return link_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(); ?>Are you sure you want to remove this article?\nNote: articles 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 '\');
                });

		function multiple_action(action) {
                    hash = dt_get_selected();
                                $.ajax({
  					url: "'; ?>
<?php echo @DOC_ROOT; ?>
<?php echo '/dir_articles_action_ajax.php",
  					type: "post",
  					data: ({
  								submitAction: action,
  								category_id: function() { return $("#CATEGORY_ID").val(); },
  								multiselect_articles: hash
  					}),
  					cache: false,
 					success: function(response){
 						if (response == \'1\')
 							oTable.fnDraw();
 						else
 							alert(\''; ?>
<?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(); ?>An errror occured while saving.<?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 '\');
  					}
			});
		}
		
		function single_action(action, id) {
                                $.ajax({
  					url: "'; ?>
<?php echo @DOC_ROOT; ?>
<?php echo '/dir_articles_action_ajax.php",
  					type: "post",
  					data: ({
  								submitAction: action,
  								category_id: function() { return $("#CATEGORY_ID").val(); },
  								multiselect_articles: id
  					}),
  					cache: false,
 					success: function(response){
 						if (response == \'1\')
 							oTable.fnDraw();
 						else
 							alert(\''; ?>
<?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(); ?>An errror occured while saving.<?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 '\');
  					}
			});
		}

		$(\'#example tbody tr\').live("click", function () {
			var chbox = \'#categ_\' + $(this).attr(\'id\');
			if ($(this).hasClass(\'row_selected\')) {
				$(this).removeClass(\'row_selected\');
				$(chbox).attr(\'checked\', false);
			} else {
				$(this).addClass(\'row_selected\');
				$(chbox).attr(\'checked\', true);
			}
		});
		
		function dt_get_selected() {
			var hash = \'\';
			var trs = oTable.fnGetNodes();
			for (var i=0 ; i<trs.length ; i++) {
				if ( $(trs[i]).hasClass(\'row_selected\'))
					hash += trs[i].getAttribute("id") + \',\';
			}
			hash = hash.slice(0, - 1);
			return hash;
		}
	
		oTable = $(\'#example\').dataTable( {
			"bProcessing": true,
			"bServerSide": true,
			"bJQueryUI": true,
			"bSort": true,
                        "iDisplayLength": 20,
			"sPaginationType": "full_numbers",
			"oSearch": { "sSearch": "'; ?>
<?php echo $this->_tpl_vars['search']; ?>
<?php echo '" },
			"sAjaxSource": "'; ?>
article_list_ajax.php?category=<?php echo $this->_tpl_vars['category']; ?>
&expired=<?php echo $this->_tpl_vars['expired']; ?>
&status=<?php echo $this->_tpl_vars['status']; ?>
&f=<?php echo $this->_tpl_vars['featured']; ?>
&owner_id=<?php echo $this->_tpl_vars['owner_id']; ?>
<?php echo '",
			
			"fnDrawCallback": function() {
			
				$(\'#example tbody tr td:nth-child(2) span\').editable(\''; ?>
<?php echo @DOC_ROOT; ?>
<?php echo '/dir_articles_action_ajax.php\', {
					"height": "14px",
					submitdata : {
						submitAction: "title"
					},
					callback: function(value, settings) {
						oTable.fnDraw();
					}
				});
				
				$(\'#example tbody tr td:nth-child(6)\').editable(\''; ?>
<?php echo @DOC_ROOT; ?>
<?php echo '/dir_articles_action_ajax.php\', {
					"height": "14px",
					submitdata : {
						submitAction: "pr"
					},
					callback: function(value, settings) {
						oTable.fnDraw();
					}
				});
				
				$(\'#example tbody tr td:nth-child(7)\').editable(\''; ?>
<?php echo @DOC_ROOT; ?>
<?php echo '/dir_articles_action_ajax.php\', {
					"height": "14px",
					submitdata : {
						submitAction: "hits"
					},
					callback: function(value, settings) {
						oTable.fnDraw();
					}
				});

			},

			"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
				var id = aData[0];
				$(nRow).attr("id",id);
				$(nRow).find("td").attr("id",id);

				$(\'td:eq(0)\', nRow).html(\'<input type="checkbox" name="categ_\' + aData[0] + \'" id="categ_\' + aData[0] + \'"> \' + aData[0]);
				
				$(\'td:eq(1)\', nRow).html(\'<span id="\' + aData[0] + \'">\' + aData[1] + \'</span>'; ?>
<a href="<?php echo @DOC_ROOT; ?>
/article_details.php?id=' + aData[0] + '" title="<?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(); ?>View full info of this item<?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); ?>" id="more-info-' + aData[0] + '" class="more-info-article" onclick="return false;"><span><?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(); ?>More info<?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); ?></span></a>'<?php echo ');
				
				$(\'td:eq(1) #more-info-\' + aData[0], nRow).click(function() {
					ajaxArticleDetailsRequest(aData[0]);
				});
				if (aData[2].length >= 50)
					url_title = aData[2].slice(0, 50) + \'...\';
				else
					url_title = aData[2];
				
				$(\'td:eq(2)\', nRow).html(url_title);
				var stats = \'\';
				'; ?>

				if (aData[4] != 'Inactive')
					stats += '<a href="" id="status_inactive" onclick="return false;" style="float:right;"><img src="<?php echo @TEMPLATE_ROOT; ?>
/images/tag_red.png" border="0"/></a>';
				if (aData[4] != 'Pending')
					stats += '<a href="" id="status_pending" onclick="return false;" style="float:right;"><img src="<?php echo @TEMPLATE_ROOT; ?>
/images/tag_yellow.png" border="0"/></a>';
				if (aData[4] != 'Active')
					stats += '<a href="" id="status_active" onclick="return false;" style="float:right;"><img src="<?php echo @TEMPLATE_ROOT; ?>
/images/tag_green.png" border="0"/></a>';			

				$('td:eq(4)', nRow).html('<div style="width: 100px;"><span style="float: left;">'+aData[4] + '</span>' + '<span style="float: right;">'+stats+ '</span></div>');
				<?php echo '
				
				var action_edit = \'\';
				var action_del = \'\';
				'; ?>

				<?php if ($this->_tpl_vars['rights']['editArt'] == 0 && $this->_tpl_vars['rights']['delArt'] == 0): ?>
					action_edit = '<b><?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(); ?>None allowed<?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); ?></b>';
				<?php elseif ($this->_tpl_vars['rights']['editArt'] == 1): ?>
					action_edit = '<a href="<?php echo @DOC_ROOT; ?>
/article_edit.php?action=E:' + aData[0] + '" title="<?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(); ?>Edit Article<?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); ?>: ' + aData[1] + '"><img src="<?php echo @TEMPLATE_ROOT; ?>
/images/pencil.png" border="0"/></a>';
				<?php endif; ?>
				<?php if ($this->_tpl_vars['rights']['delArt'] == 1): ?>
					action_del = '<a id="action_del" href="<?php echo @DOC_ROOT; ?>
/article_edit.php?action=D:' + aData[0] + '" title="<?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(); ?>Remove Article<?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); ?>: ' + aData[1] + '"><img src="<?php echo @TEMPLATE_ROOT; ?>
/images/cross.png" border="0"/></a>';
				<?php endif; ?>
				<?php echo '
				
				$(\'td:eq(7)\', nRow).html(action_edit + \'&nbsp;\' + action_del);
				
				'; ?>

				if (aData[7] == '-1')
					categ_html = '<span class="orphan"><?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(); ?>Orphan<?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); ?></span>';
				else
					categ_html = '<a id="category-' + aData[7] + '" href="<?php echo @DOC_ROOT; ?>
/article_list.php?category=' + aData[7] + '" title="<?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(); ?>Browse articles of category<?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); ?>: ' + aData[3] + '" class="category-link" onclick="return false;">' + aData[3] + '</a><a href="<?php echo @DOC_ROOT; ?>
/categ_details.php?id=' + aData[7] + '" title="<?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(); ?>View full info of this item<?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); ?>" id="more-info-categ-' + aData[7] + '" class="more-info-categ" onclick="return false;"><span><?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(); ?>More info<?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); ?></span></a>';
				<?php echo '
				
				$(\'td:eq(3)\', nRow).html(categ_html);
				
				$(\'td:eq(3) #category-\' + aData[7], nRow).click(function() {
					ajaxCategArticleRequest(aData[7]);
				});
				
				$(\'td:eq(3) #more-info-categ-\' + aData[7], nRow).click(function() {
					ajaxCategDetailsRequest(aData[7]);
				});
				
				return nRow;
			},
			
			"aoColumns": [
				null, 
				null,
				{ "sType": "html" },
				null,
				null,
				null,
				null,
				{ "bSortable": false }
			]


		});
		oTable.fnSetColumnVis(8, false);
	});
	
});
</script>
'; ?>



<?php echo '<div class="block"><!-- Action Links --><ul class="page-action-list">'; ?><?php if ($this->_tpl_vars['rights']['addArt'] == 1): ?><?php echo '<li><a href="'; ?><?php echo @DOC_ROOT; ?><?php echo '/article_edit.php?action=N'; ?><?php if ($this->_tpl_vars['featured']): ?><?php echo '&amp;f=1'; ?><?php endif; ?><?php echo '" title="Create new article" class="button"><span class="new-link">New Article</span></a></li>'; ?><?php endif; ?><?php echo ''; ?><?php if ($this->_tpl_vars['HaveExpiredRecpr'] > 0): ?><?php echo '<li><a href="'; ?><?php echo @DOC_ROOT; ?><?php echo '/article.php?expired=1'; ?><?php if ($this->_tpl_vars['feat_link']): ?><?php echo '&amp;f=1'; ?><?php endif; ?><?php echo ''; ?><?php if ($this->_tpl_vars['categ'] > 0): ?><?php echo '&amp;category='; ?><?php echo $this->_tpl_vars['categ']; ?><?php echo ''; ?><?php endif; ?><?php echo '" title="Browser listings with expired reciprocal URL" class="button"><span class="expired-link">Expired Reciprocal</span></a></li>'; ?><?php endif; ?><?php echo ''; ?><?php if ($this->_tpl_vars['rights']['delArt'] == 1): ?><?php echo ''; ?><?php if ($this->_tpl_vars['HaveExpiredEmail'] > 0): ?><?php echo '<li><a href="'; ?><?php echo @DOC_ROOT; ?><?php echo '/article_list.php?action=del_expired_emails" title="Delete articles with unconfirmed emails older than '; ?><?php echo @WAIT_FOR_EMAIL_CONF; ?><?php echo ' days" class="button" onclick="return link_rm_confirm(\'Are you sure you want to remove '; ?><?php echo $this->_tpl_vars['HaveExpiredEmail']; ?><?php echo ' articles?\\nNote: articles can not be restored after removal!\');"><span class="expired-link">Delete Expired</span></a></li>'; ?><?php endif; ?><?php echo ''; ?><?php endif; ?><?php echo '</ul><!-- /Action Links --></div>'; ?><?php if ($this->_tpl_vars['error']): ?><?php echo '<div class="block"><!-- Error --><div class="error"><h2>Error</h2><p>'; ?><?php echo $this->_tpl_vars['error']; ?><?php echo ' error(s) occured while processing.</p>'; ?><?php if (! empty ( $this->_tpl_vars['sql_error'] )): ?><?php echo '<p>The database server returned the following message:</p><p class="sql_error">'; ?><?php echo $this->_tpl_vars['sql_error']; ?><?php echo '</p>'; ?><?php endif; ?><?php echo '</div><!-- /Error --></div>'; ?><?php endif; ?><?php echo '<br /><br /><style type="text/css" media="screen">@import "'; ?><?php echo @TEMPLATE_ROOT; ?><?php echo '/themes/smoothness/datatable_jui.css";@import "'; ?><?php echo @TEMPLATE_ROOT; ?><?php echo '/themes/smoothness/jquery-ui-1.7.2.custom.css";</style><div class="block"><form action="'; ?><?php echo @DOC_ROOT; ?><?php echo '/article_list.php" method="post" id="multiselect_list" name="multiselect_list"><input type="hidden" name="submitAction" id="submitAction" value="" class="hidden" /><table cellpadding="0" cellspacing="0" border="0" style="width: 100%;" id="example" class="display"><thead><tr>'; ?><?php $_from = $this->_tpl_vars['columns']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['col'] => $this->_tpl_vars['name']):
?><?php echo '<th>'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo '</th>'; ?><?php endforeach; endif; unset($_from); ?><?php echo '</tr></thead><tbody><tr><td colspan="9" class="dataTables_empty">Loading data from server</td></tr></tbody></table>'; ?><?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, "/article_action_ajax.tpl") : smarty_modifier_cat($_tmp, "/article_action_ajax.tpl")), 'smarty_include_vars' => array('linkTypeButtons' => '1')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?><?php echo '</form></div>'; ?>