File: 0.00.1a/plugins/patriot/patriot.php (View as HTML)

  1: <?php 
  2: /* -------------------------------------------------------------
  3: This file is part of FreeDESK
  4: 
  5: FreeDESK is (C) Copyright 2012 David Cutting
  6: 
  7: FreeDESK is free software: you can redistribute it and/or modify
  8: it under the terms of the GNU General Public License as published by
  9: the Free Software Foundation, either version 3 of the License, or
 10: (at your option) any later version.
 11: 
 12: FreeDESK is distributed in the hope that it will be useful,
 13: but WITHOUT ANY WARRANTY; without even the implied warranty of
 14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 15: GNU General Public License for more details.
 16: 
 17: You should have received a copy of the GNU General Public License
 18: along with FreeDESK.  If not, see www.gnu.org/licenses
 19: 
 20: For more information see www.purplepixie.org/freedesk/
 21: -------------------------------------------------------------- */
 22: 
 23: class patriot extends FreeDESK_PIM
 24: {
 25: 
 26: 	function Start()
 27: 	{
 28: 		$this->DESK->PluginManager->RegisterPIMPage("simplereporting", $this->ID);
 29: 		$this->DESK->PluginManager->Register(new Plugin(
 30: 			"Patriot Plugin", "0.01", "Visual" ));
 31: 		$csspath = $this->webpath . "patriot.css";
 32: 		$this->DESK->PluginManager->RegisterCSS($csspath);
 33: 		$jspath = $this->webpath . "patriot.js";
 34: 		$this->DESK->PluginManager->RegisterScript($jspath);
 35: 	}
 36: 	
 37: 	function BuildMenu()
 38: 	{	
 39: 		$pmenu = new MenuItem();
 40: 		$pmenu->tag = "patriot";
 41: 		$pmenu->display = "Patriot";
 42: 		$this->DESK->ContextManager->AddMenuItem("patriot", $pmenu);
 43: 		
 44: 		$col = new MenuItem();
 45: 		$col->tag="red";
 46: 		$col->display="Red";
 47: 		$col->onclick="Patriot.Set(1);";
 48: 		$this->DESK->ContextManager->AddMenuItem("patriot",$col);
 49: 		
 50: 		$col = new MenuItem();
 51: 		$col->tag="white";
 52: 		$col->display="White";
 53: 		$col->onclick="Patriot.Set(2);";
 54: 		$this->DESK->ContextManager->AddMenuItem("patriot",$col);
 55: 		
 56: 		$col = new MenuItem();
 57: 		$col->tag="blue";
 58: 		$col->display="Blue";
 59: 		$col->onclick="Patriot.Set(3);";
 60: 		$this->DESK->ContextManager->AddMenuItem("patriot",$col);
 61: 		
 62: 		$col = new MenuItem();
 63: 		$col->tag="autostart";
 64: 		$col->display="Auto Start";
 65: 		$col->onclick="Patriot.Start();";
 66: 		$this->DESK->ContextManager->AddMenuItem("patriot",$col);
 67: 		
 68: 		$col = new MenuItem();
 69: 		$col->tag="autostop";
 70: 		$col->display="Auto Stop";
 71: 		$col->onclick="Patriot.Stop();";
 72: 		$this->DESK->ContextManager->AddMenuItem("patriot",$col);
 73: 		
 74: 		$col = new MenuItem();
 75: 		$col->tag="reset";
 76: 		$col->display="Reset";
 77: 		$col->onclick="Patriot.Set(0);";
 78: 		$this->DESK->ContextManager->AddMenuItem("patriot",$col);
 79: 	
 80: 
 81: 	}
 82: 	
 83: 	
 84: 	
 85: 
 86: }
 87: ?>
 88: