<?php
/* ====================
[BEGIN_COT_EXT]
Hooks=moderation.page.mnotfind
[END_COT_EXT]
==================== */

defined('COT_CODE') or die('Wrong URL');

if(in_array('projects', $moderauth)) {
  require_once cot_incfile('projects', 'module');

  $publicprojects = $db->query("SELECT COUNT(*) FROM $db_projects WHERE item_state='0'");
  $publicprojects = $publicprojects->fetchColumn();

  $hiddenprojects = $db->query("SELECT COUNT(*) FROM $db_projects WHERE item_state='1'");
  $hiddenprojects = $hiddenprojects->fetchColumn();

  $projectsqueued = $db->query("SELECT COUNT(*) FROM $db_projects WHERE item_state='2'");
  $projectsqueued = $projectsqueued->fetchColumn();

  $t->assign(array(
  	'ADMIN_HOME_PROJECTS_QUEUED_URL' => cot_url('moderation', 'm=projects&state=2'),
  	'ADMIN_HOME_PROJECTS_PUBLIC_URL' => cot_url('moderation', 'm=projects&state=0'),
  	'ADMIN_HOME_PROJECTS_HIDDEN_URL' => cot_url('moderation', 'm=projects&state=1'),
  	'ADMIN_HOME_PROJECTS_QUEUED' => $projectsqueued,
  	'ADMIN_HOME_PROJECTS_PUBLIC' => $publicprojects,
  	'ADMIN_HOME_PROJECTS_HIDDEN' => $hiddenprojects,
  ));

  $t->parse('MAIN.LINE_PROJECTS');
}