<?php

class namespace extends cData {

	public $pluginName, $pluginMenuTitle, $tables, $joins, $order, 
		$perPage, $insertText, $urlLink, $moduleType, $childClass;

	function __construct($oDb, $oUrl, $oSession, $action) {
		$this->pluginName = "";
		$this->pluginMenuTitle = "";
		$this->tables = Array (
			Array(
				"name" => "namespace"
			)
		);
		$this->order = "namespace.namespace ASC";
		$this->perPage = 30;
		$this->insertText = "Add namespace";
		$this->urlLink = "";
		$this->moduleType = "class";
		$this->childClass = __CLASS__;
		parent::__construct($oDb, $oUrl, $oSession, $action);
		// $this->searchDb[] = 'namespace NOT LIKE "User:%"';
	}
	
	final function validateData($array) {
		try {
		} catch (Exception $e) {
			$this->errorMsg($e->getMessage());
			return FALSE;
		}
		parent::validateData($array);
		return TRUE;	
	}
	
	final function beforeSubmit($postData) {
		return parent::beforeSubmit($postData);
	}
	
	final function printList() {
		$ret = "";
		$ret = "";
		$ret .= $this->tableHead("List of namespaces",Array(
			"ID","Namespace","Rights"
		));
		while ($bR = $this->oDb->get($this->query)) {
			$ID = $this->pp($bR,$this->primaryKey);
			$pageID = $this->oMenu->getID("namespace");
			$button = '<form method="post" action="'.$this->oUrl->page("permissions").'">
	<input type="submit" class="submit input_permissions" value="Perms" />
	<input type="hidden" name="submit" value="Back" />
	<input type="hidden" name="table" value="user_rights" />
	<input type="hidden" name="page_id" value="'.$pageID.'" />
	<input type="hidden" name="page_name" value="'.$this->pp($bR, "namespace").'" />
	<input type="hidden" name="i_id" value="'.$ID.'" />
</form>';
			$ret .= $this->inTable(Array(
				$ID,
				$this->pp($bR, "namespace"),
				$button
			), $ID);
		}
		$ret .= $this->tableEnd();
		return parent::printList($ret);
	}
	
	final function printForm($action, $id) {
		$ret = "";
		$ret .= $this->oForm->inputBox("Namespace", "namespace", 64, $this->pp($this->row, "namespace"));
		return parent::printForm($action, $id, $ret);
	}
	
	final function printDetail() {
		$ret = "";
		return parent::printDetail($ret);
	}
	
}

?>
