<?php
/*
/**
* CHRONOFORMS version 1.0 stable
* Copyright (c) 2006 Chrono_Man, ChronoEngine.com. All rights reserved.
* Author: Chrono_Man (ChronoEngine.com)
* See readme.html.
* Visit http://www.ChronoEngine.com for regular update and information.
**/

/* ensure that this file is called from another file */
defined( '_VALID_MOS' ) or die( 'Direct access to this file is prohibited.' );
class menuChronoContact {
	function MENU_Default() {
		mosMenuBar::startTable();
		mosMenuBar::publishList();
		mosMenuBar::unpublishList();
		mosMenuBar::divider();
		mosMenuBar::addNew();
		mosMenuBar::custom($task = 'copy', $icon = 'copy_f2.png', $iconOver = 'copy_f2.png', $alt = 'Copy form', $listSelect = true) ;
		mosMenuBar::editList();
		mosMenuBar::deleteList();
		mosMenuBar::spacer();
		mosMenuBar::spacer();
		mosMenuBar::spacer();
		mosMenuBar::spacer();
		mosMenuBar::custom($task = 'show', $icon = 'query.png', $iconOver = 'query.png', $alt = 'Show Data', $listSelect = true) ;
		mosMenuBar::custom($task = 'createtable', $icon = 'properties_f2.png', $iconOver = 'properties_f2.png', $alt = 'Create table', $listSelect = true) ;
		mosMenuBar::deleteList('','deletetable','Remove Table');
		mosMenuBar::spacer();
		mosMenuBar::spacer();
		mosMenuBar::custom($task = 'backup', $icon = 'backup.png', $iconOver = 'backup.png', $alt = 'Backup Form', $listSelect = true) ;
		mosMenuBar::custom($task = 'restore1', $icon = 'forward_f2.png', $iconOver = 'forward_f2.png', $alt = 'Restore Form', $listSelect = false) ;
		mosMenuBar::endTable();
	}
	function MENU_Edit() {
		mosMenuBar::startTable();
		mosMenuBar::save();
		mosMenuBar::apply('applychanges', "Apply");
		mosMenuBar::cancel();
		mosMenuBar::spacer();
		mosMenuBar::endTable();
	}
	function MENU_Show() {
		mosMenuBar::startTable();
		mosMenuBar::cancel('cancelview', "Cancel");
		mosMenuBar::endTable();
	}
	function MENU_Show2() {
		mosMenuBar::startTable();
		mosMenuBar::cancel('cancelconfig', "Cancel");
		mosMenuBar::deleteList('','deleterecord','Delete');
		mosMenuBar::spacer();
		mosMenuBar::spacer();
		mosMenuBar::custom($task = 'backexcel', $icon = 'backup.png', $iconOver = 'backup.png', $alt = 'Backup to Excel', $listSelect = false) ;
		mosMenuBar::custom($task = 'backcsv', $icon = 'backup.png', $iconOver = 'backup.png', $alt = 'Backup to CSV', $listSelect = false) ;
		mosMenuBar::endTable();
	}
	function CONFIG_MENU() {
		mosMenuBar::startTable();
		mosMenuBar::save('saveconfig', "Save");
		mosMenuBar::spacer();
		mosMenuBar::cancel('cancelconfig', "Cancel");
		mosMenuBar::endTable();
	}
	function MENU_Cancel() {
		mosMenuBar::startTable();
		mosMenuBar::cancel();
		mosMenuBar::spacer();
		mosMenuBar::endTable();
	}
	function CREATE_MENU() {
		mosMenuBar::startTable();
		mosMenuBar::save('menu_save', "Create");
		mosMenuBar::endTable();
	}
	function MENU_Plugins_2() {
		mosMenuBar::startTable();
		mosMenuBar::save('save_conf', "Save");
		mosMenuBar::spacer();
		mosMenuBar::cancel();
		mosMenuBar::spacer();
		mosMenuBar::endTable();
	}
	function MENU_Plugins() {
	global $mosConfig_absolute_path;
		mosMenuBar::startTable();
		$directory = $mosConfig_absolute_path.'/components/com_chronocontact/plugins/';
		$results = array();
		$handler = opendir($directory);
		while ($file = readdir($handler)) {
			if ( $file != '.' && $file != '..' && substr($file, -4) == '.php' )
				$results[] = str_replace(".php","", $file);
		}
		closedir($handler);
		foreach($results as $result){
			require_once($mosConfig_absolute_path."/components/com_chronocontact/plugins/".$result.".php");
			${$result} = new $result();
			mosMenuBar::custom($task = 'plugin_'.$result, $icon = 'query.png', $iconOver = 'query.png', $alt = ${$result}->result_TITLE, $listSelect = true) ;
			mosMenuBar::spacer();
		}
		mosMenuBar::endTable();
	}
}
?>

