<?php
/*
	+-----------------------------------------------------------------------------+
	| ILIAS open source                                                           |
	+-----------------------------------------------------------------------------+
	| Copyright (c) 1998-2008 ILIAS open source, University of Cologne            |
	|                                                                             |
	| This program is free software; you can redistribute it and/or               |
	| modify it under the terms of the GNU General Public License                 |
	| as published by the Free Software Foundation; either version 2              |
	| of the License, or (at your option) any later version.                      |
	|                                                                             |
	| This program is distributed in the hope that it will be useful,             |
	| but WITHOUT ANY WARRANTY; without even the implied warranty of              |
	| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
	| GNU General Public License for more details.                                |
	|                                                                             |
	| You should have received a copy of the GNU General Public License           |
	| along with this program; if not, write to the Free Software                 |
	| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
	+-----------------------------------------------------------------------------+
*/

include_once("Services/Table/classes/class.ilTable2GUI.php");

/**
* TableGUI class for recent changes in wiki
*
* @author Alex Killing <alex.killing@gmx.de>
* @version $Id$
*
* @ingroup ModulesWiki
*/
class ilWikiSearchResultsTableGUI extends ilTable2GUI
{

	function ilWikiSearchResultsTableGUI($a_parent_obj, $a_parent_cmd = "",
		$a_wiki_id, $a_results)
	{
		global $ilCtrl, $lng;
		
		parent::__construct($a_parent_obj, $a_parent_cmd);
		$this->wiki_id = $a_wiki_id;
		
		$this->addColumn($lng->txt("wiki_page"), "", "100%");
		$this->setEnableHeader(true);
		$this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
		$this->setRowTemplate("tpl.search_result.html",
			"Modules/Wiki");
			
		$this->setData($a_results);
		$this->setLimit(0);
		
		$this->setTitle($lng->txt("wiki_search_results"));
	}
	
	/**
	* Standard Version of Fill Row. Most likely to
	* be overwritten by derived class.
	*/
	protected function fillRow($a_set)
	{
		global $lng, $ilCtrl;

		include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
		$title = ilWikiPage::lookupTitle($a_set);
		$this->tpl->setVariable("TXT_PAGE_TITLE", $title);
		$ilCtrl->setParameterByClass("ilwikipagegui", "page",
			ilWikiUtil::makeUrlTitle($title));
		$this->tpl->setVariable("HREF_PAGE",
			$ilCtrl->getLinkTargetByClass("ilwikipagegui", "preview"));
	}

}
?>
