Beispiel #1
0
 function CKEditorTest()
 {
     parent::WebPage('CKEditor Example');
     //Instantiate first CKEditor
     $editor1 = new CKEditor('', 10, 40);
     //Instantiate second CKEditor
     $editor2 = new CKEditor('Text that is already entered', $editor1->Right + 10, 40, 300);
     //Set the second CKEditor's Skin to Office theme
     //		$editor2->Skin = CKEditor::Office;
     //Instantiate third CKEditor
     $editor3 = new CKEditor('Text that is already entered', $editor2->Right + 50, 40);
     //Set the third CKEditor's Skin to V2 theme
     //		$editor3->Skin = CKEditor::V2;
     //Adds the 3 Editors to the WebPage
     $this->Controls->AddRange($editor1, $editor2, $editor3);
     /*For each of the above 3 editors we're going to add a ComboBox above
     		the editor that allows you to change the theme and a button that will switch
     		the CKEditor to the Basic/Advanced Toolbar*/
     foreach ($this->Controls as $control) {
         if ($control instanceof CKEditor) {
             $this->Controls->Add($skins = new ComboBox($control->Left, 5, 150));
             $skins->Items->AddRange(new Item('-- Select Theme --', null), CKEditor::Kama, CKEditor::Office, CKEditor::V2);
             $skins->Change = new ServerEvent($this, 'ChangeSkin', $skins, $control);
             //Button to switch to Basic Toolbar
             $this->Controls->Add($basic = new Button('Basic', $skins->Right + 15, 5))->Click = new ServerEvent($control, 'SetToolbar', CKEditor::Basic);
             //Button to switch to Advanced Toolbar
             $this->Controls->Add(new Button('Advanced', $basic->Right + 10, 5))->Click = new ServerEvent($control, 'SetToolbar', CKEditor::Full);
             $this->Controls->Add($ta = new TextArea('', $control->Left, $control->Bottom + 10, $control->Width))->Click = new ServerEvent($this, 'ShowText', $control, $ta);
         }
     }
 }
Beispiel #2
0
	function __construct()
	{
		parent::WebPage('Basic TinyMCE Example 1');
		$this->Controls->Add($editor = new TinyMCE('Testing'));
		$this->Controls->Add($button = new Button('Click Me', $editor->Right + 10))
			->Click = new ServerEvent($this, 'SomeFunc', $editor);
	}
	function __construct()
	{
		parent::WebPage('StackOverflow 5672167');
		$nav = new Panel(0, 0, 600, 30);
		$chat = new Panel(0, $nav->Bottom, 200, 500);
		$content = new MarkupRegion('', $chat->Right, $chat->Top, 400, 350);
		$rooms = new Panel($content->Left, $content->Bottom, 400, 150);
		$footer = new Panel(0, $chat->Bottom, 600, 50);
		
		$chat->BackColor = Color::LightGreen;
		$content->BackColor = Color::Yellow;
		$rooms->BackColor = Color::Orange;
		$footer->BackColor = Color::Gray;
		
		$this->Controls->AddRange($nav, $chat, $content, $rooms, $footer);
		
		$sections = array('HOME', 'ABOUT', 'CONTACT', 'LOGIN');
			
		foreach($sections as $section)
			$nav->Controls->Add(new Link(null, $section, 0, 5))
				->Click = new ServerEvent($this, 'LoadSection', $content, $section);
				
		$nav->Controls->AllCSSMarginRight = '5px';
		$nav->Controls->AllLayout = Layout::Relative;
		$nav->CSSTextAlign = 'right';
		//Comet (Listener), Bind to Yahoo Flickr API through YQL
		$this->Controls->Add($listener = new Listener(
			'http://query.yahooapis.com/v1/public/yql?q=select%20source%20from%20flickr.photos.sizes%20WHERE%20photo_id%20in%20(select%20id%20from%20flickr.photos.recent)%20and%20label%3D%22Thumbnail%22',
			new ServerEvent($this, 'LoadImage', $chat)));
			
		//Default Section
		$this->LoadSection($content, URL::GetToken('section', 'HOME'));
	}
Beispiel #4
0
	function __construct()
	{
		parent::WebPage('Basic TinyMCE Example 3');
		$content = new MarkupRegion('content.txt', 0, 0, 400, null);
		$this->Controls->AddRange($content, new BlogComment());
		$this->Controls->AllLayout = Layout::Relative;
	}
Beispiel #5
0
 function HighlighterTest()
 {
     parent::WebPage('Syntax Highlighter Example');
     /*Instantiate new SyntaxHighlighter pointing to file code.txt, 
     		using PHP, with  a location of 0, 0, and a Size of null, null*/
     $highlighter = new SyntaxHighlighter('code.txt', SyntaxHighlighter::PHP, 0, 0, null, null);
     //Add SyntaxHighlighter to the WebPage
     $this->Controls->Add($highlighter);
 }
Beispiel #6
0
 /**
  * Constructor
  */
 function ClickCounter()
 {
     parent::WebPage('Classic Click Counter');
     //Instantiate Button with left and top of 100
     $button = new Button('Click Me', 100, 100, null, null);
     //Set Click Event of $button. Triggers CountClick with $button as param
     $button->Click = new ServerEvent($this, 'CountClick', $button);
     //Adds the button to show
     $this->Controls->Add($button);
 }
Beispiel #7
0
 function Events()
 {
     /* Calls the WebPage's constructor. This must be done to
        ensure that WebPage is properly instantiated. The 
        parameter specifies a string to be displayed in the
        browser's title bar. */
     parent::WebPage('Demonstrating basic Events');
     // Calls the CreateButton function, which is defined below
     $this->CreateButton();
 }
Beispiel #8
0
 function EmailExample3()
 {
     parent::WebPage('EmailHelper Example 3');
     //Basic Example
     EmailHelper::Email('*****@*****.**', '*****@*****.**', 'EmailHelper Basic', 'Some Test Message');
     //Message
     //Advanced Example
     EmailHelper::Email(array('*****@*****.**', '*****@*****.**'), array('*****@*****.**', '*****@*****.**', '*****@*****.**'), 'EmailHelper Advanced', array('Some Message', '<b>Some Message</b>'));
     //RichMessage
 }
Beispiel #9
0
 function __construct()
 {
     parent::WebPage('FullCalendar Example 1');
     $this->Controls->Add($calendar = new FullCalendar(array(FullCalendar::Month, FullCalendar::AgendaDay), 100, 100));
     // Create Button to Add Events
     $this->Controls->Add(new Button('Add'))->Click = new ServerEvent($this, 'AddEventFunc', $calendar);
     // Setting Events on the Calendar
     $calendar->DayClick = new ServerEvent($this, "DayFunc");
     $calendar->EventClick = new ServerEvent($this, "EventFunc");
 }
Beispiel #10
0
 function NavHandlerTest()
 {
     parent::WebPage('Welcome to NavHandler Test');
     $this->BackColor = '#999999';
     /*Group for groupable items, used in this example as the
       navigation triggers*/
     $group = new Group();
     //RolloverLabels to be used as navigation elements
     $rollover1 = new RolloverLabel('red');
     $rollover2 = new RolloverLabel('green');
     $rollover3 = new RolloverLabel('blue');
     //Set Layout to Relative for our Rollovers for lazy alignment
     $rollover1->Layout = $rollover2->Layout = $rollover3->Layout = Layout::Relative;
     //Add RolloverLabels to our group
     $group->AddRange($rollover1, $rollover2, $rollover3);
     /*Our content panel which will be used to display the various
       sections triggered by the navigation elements and NavHandler*/
     $contentPanel = new Panel(10, 100, 500, 500);
     $contentPanel->Border = 1;
     /* Our NavHandler object, note that this must be stored
      * in a variable of some object to ensure it does not get
      * cleaned up by garbage collection
      * 
      * The first parameter of the constructor takes in a ContentPanel
      * where your sections will display.
      * 
      * The second parameter takes in an event which will be called to
      * create a section.
      * 
      * The optional third parameter "group" takes in a Group object to be used in conjuction
      * with the NavHandlers token for BookmarkFriendly.
      * 
      * The optional fourth parameter, not listed in the line below
      * allows for a token name, the default is 'section' to be used to
      * generate a url token in conjuction with bookmark friendly. If set
      * to false, then the NavHandler will not create tokens or be bookmarkable. 
      * */
     $this->Nav1 = new NavHandler($contentPanel, new ServerEvent($this, 'CreateSection'), $group);
     /*We now set the Select of each of our RolloverLabels to trigger the NavHandler
       LaunchSection function. LaunchSection takes in the section as the first parameter
       and also has an optional second parameter reCreate, not used here which will always
       call your NavHandler function even if the previous object associated with that section
       is already in use. Also note that if a group is passed in the SelectedValue of
       the group will be used.*/
     $rollover1->Select = new ServerEvent($this->Nav1, 'LaunchSection', 'red');
     $rollover2->Select = new ServerEvent($this->Nav1, 'LaunchSection', 'green');
     $rollover3->Select = new ServerEvent($this->Nav1, 'LaunchSection', 'blue');
     /*Alternative use of NavHandler, using our group. Since the section would now correspond
       to the SelectedValue of the Group.*/
     //$group->Change = new ServerEvent($this->Nav1, 'LaunchSection', $group);
     //Add the group, and contentPanel to the Controls of the WebPage
     $this->Controls->AddRange($group, $contentPanel);
 }
Beispiel #11
0
 function EmailExample2()
 {
     parent::WebPage('EmailHelper Example 2');
     //Basic Example
     $emailHelper1 = new EmailHelper('*****@*****.**', '*****@*****.**', 'EmailHelper Basic', 'Some Test Message');
     //Message
     $emailHelper1->Send();
     //Advanced Example
     $emailHelper2 = new EmailHelper(array('*****@*****.**', '*****@*****.**'), array('*****@*****.**', '*****@*****.**', '*****@*****.**'), 'EmailHelper Advanced', array('Some Message', '<b>Some Message</b>'));
     //RichMessage
     //From
     $emailHelper2->Send();
 }
Beispiel #12
0
 function Index()
 {
     parent::WebPage('The Classic Game of HangMan -- programmed in NOLOH');
     /*Add NOLOH logo and text label here so they are persistent throughout
     		the application*/
     $this->Controls->Add(new Image('Images/NOLOHLogo.gif', 15, 15));
     $this->Controls->Add($title = new Label('HangMan', 17, 60, 200, 50));
     /* Sets the font via the CSS_ syntactical sugar. Any property available 
     		in CSS can be set on a NOLOH Control by prepending it with CSS.*/
     $title->CSSFont = '30px verdana';
     //Instantiate and Add a new instance of Hangman
     $this->Controls->Add(new HangMan(0, 80, 850, 750));
 }
Beispiel #13
0
	function __construct()
	{
		/* Calls the WebPage's constructor. This is done to ensure
		   the WebPage is properly instantiated. The paramater
		   specifies a string to be displayed in the title bar */
		parent::WebPage('Hello World in NOLOH');
		/* Creates an instance of NOLOH's Label object, giving it
		   the Text 'Hello World' and Left and Top coordinates
		   of 100 pixels. The Label object is stored to a local
		   variable named $label. */
		$label = new Label('Hello World', 100, 100);
		/* Adds the Label object to the WebPage's Controls ArrayList.
		   Without this line, a Label is merely created, but will
		   not be displayed. */
		$this->Controls->Add($label);
	}
Beispiel #14
0
 function BadgeTest()
 {
     parent::WebPage('Welcome to BadgeTest');
     /* The default behavior of NOLOHBadge is to display
      * an image next to the NOLOH version number.*/
     $badge1 = new NOLOHBadge(100, 100);
     /* However, you can decide to display a text-only version
      * by passing in true to the textOnly parameter.
      * an image next to the NOLOH version number.*/
     $badge2 = new NOLOHBadge(100, 200, true);
     /* Futhermore, you can decide to turn off the version
      * number by passing in false to the showVersion parameter*/
     $badge3 = new NOLOHBadge(100, 300, true, false);
     /* Futhermore, you can decide to turn off the version
      * number while keeping the image*/
     $badge4 = new NOLOHBadge(100, 400, false, false);
     $this->Controls->AddRange($badge1, $badge2, $badge3, $badge4);
 }
Beispiel #15
0
	function ContentSliderExample()
	{
		parent::WebPage('ContentSlider Example 1');
		//Define Images 1
	/*	$images = array(
			'Images/1.jpg',
			'Images/2.jpg',
			'Images/3.jpg');*/
		//Define Images 2
		$images = array(
			array('Path' => 'Images/1.jpg', 'URL'  => 'http://www.noloh.com'),
			array('Path' => 'Images/2.jpg', 'URL'  => 'http://www.google.com'),
			array('Path' => 'Images/3.jpg', 'URL'  => 'http://www.facebook.com'));
		//Randomize
		shuffle($images);
		//Create ContentSlider
		$contentSlider = new ContentSlider($images, 0, 0, 300, 200);
		$this->Controls->Add($contentSlider);
	}
Beispiel #16
0
 function Paginator1()
 {
     parent::WebPage('Basic Usage of Paginator');
     //Create Data::$Link to Demo databases
     Data::$Links->DB1 = new DataConnection(Data::Postgres, 'demo_1', 'demo_1');
     //object where our paginated results will show
     $resultsPanel = new Panel(10, 50, 200, 300);
     $resultsPanel->BackColor = Color::Bisque;
     //Then we construct our Paginator and pass in $resultsPanel
     $pages = new Paginator($resultsPanel, 10, 30);
     //Create the DataCommand we want to page through
     $command = Data::$Links->DB1->CreateCommand(Data::SQL, 'SELECT * FROM persons');
     /*we then Bind the Paginator to the newly created $command
      * and set the callback for each row of data. We also set
      * a limit of 8 results per page*/
     $pages->Bind($command, new ServerEvent($this, 'CreatePerson'), 8);
     //Add Controls to the WebPage's Controls. Shows the Controls.
     $this->Controls->AddRange($pages, $resultsPanel);
 }
Beispiel #17
0
	function __construct()
	{
		parent::WebPage('Basic TinyMCE Example 2');
		$this->Controls->Add($editor = new TinyMCE('Testing'));
		$this->Controls->Add($button = new Button('Click Me', $editor->Right + 10))
			->Click = new ServerEvent($this, 'SomeFunc', $editor);
		//Toolbar and Theme Modifications
		$editor->Theme = TinyMCE::Advanced;
		$editor->Skin = TinyMCE::O2K7Black;
		$editor->Toolbar->Orientation = 'top';
		$editor->Toolbar->Alignment = 'left';
		//Add Strips
		$editor->Strips->Add(array(
			TinyMCE::Bold, TinyMCE::Underline, TinyMCE::Strike, TinyMCE::Seperator,
			TinyMCE::Font, TinyMCE::FontSize, TinyMCE::Styles, TinyMCE::Seperator));
				//Add Strips
		$editor->Strips->Add(array(
			TinyMCE::Undo, TinyMCE::Redo, TinyMCE::Search, TinyMCE::Replace, TinyMCE::Seperator,
			TinyMCE::CharMap, TinyMCE::Cut, TinyMCE::Copy, TinyMCE::Paste));
	}
Beispiel #18
0
 function EmailExample1()
 {
     parent::WebPage('EmailHelper Example 1');
     //Create EmailHelper
     $emailHelper1 = new EmailHelper();
     //From
     $emailHelper1->From = '*****@*****.**';
     //Reply-To - Not Required
     $emailHelper1->ReplyTo = '*****@*****.**';
     /*
      * All To, CC, and BCC can be set directly or via ArrayList
      * methods such as Add, AddRange, Insert, etc.
      * 
      * $emailHelper1->To = '*****@*****.**';
      * or
      * $emailHelper1->To = array('*****@*****.**', '*****@*****.**');
      * or
      * $emailHelper1->To->Add('*****@*****.**');
      * or
      * $emailHelper1->To->AddRange('*****@*****.**', '*****@*****.**');
      */
     //To
     $emailHelper1->To->Add('*****@*****.**');
     //CC - Not Required
     $emailHelper1->CC->Add('*****@*****.**');
     //BCC - Not Required
     $emailHelper1->BCC->Add('*****@*****.**');
     //Subject
     $emailHelper1->Subject = 'ExampleHelper Test';
     /*Message: Only one is required. If only RichMessage is set, then
     	 a Text version of Message will automatically be
     	 created for you.*/
     $emailHelper1->Message = 'Some Test Message';
     $emailHelper1->RichMessage = '<b>Some Test Message</b>';
     //Sending EmailHelper1
     $emailHelper1->Send();
 }
Beispiel #19
0
	function __construct()
	{
		parent::WebPage('Basic Highchart, config from array');
		$config = array(
			'chart' => array(
			 'defaultSeriesType' => 'line',
			 'marginRight' => 130,
			 'marginBottom' => 25
			),
			'credits' => array('enabled' => false),
			'title' => array(
			 text => 'Monthly Average Temperature',
			 x => -20 //center
			),
			'subtitle' => array(
			 'text' => 'Source : WorldClimate.com',
			 'x' => -20
			),
			'xAxis' => array(
			 'categories' => array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 
				'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')
			),
			'yAxis' => array(
			 'title' => array(
				'text' => 'Temperature (°C)'
			 ),
			 'plotLines' => array(
			 	array(
				'value' => 0,
				'width' => 1,
				'color' => '#808080')
			 )
			),
			'tooltip' => array(
			 'formatter' => new ClientEvent("return '<b>'+ this.series.name +'</b><br/>'+
				   this.x +' : '+ this.y +'°C';")
			),
			'legend' => array(
			 'layout' => 'vertical',
			 'align' => 'right',
			 'verticalAlign' => 'top',
			 'x' => -10,
			 'y' => 100,
			 'borderWidth' => 0
			),
			'series' => array(
				array(
				 'name' => 'Tokyo',
				 'data' => array(7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6)
				), 
				array(
				 'name' => 'New York',
				 'data' => array(-0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5)
				), 
				array(
				 'name' => 'Berlin',
				 'data' => array(-0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0)
				), 
				array(
				 'name' => 'London',
				 'data' => array(3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8)
				))
			);
		$this->Controls->Add($chart = new Highcharts());
		$chart->SetConfig($config);
//		$chart->Exportable = true;
	}
Beispiel #20
0
 function ImageViewer()
 {
     parent::WebPage('Image Viewer');
     $this->Init();
 }
Beispiel #21
0
	function __construct()
	{
		parent::WebPage('Highchart Example 1');
		$this->Controls->Add($chart = new Highcharts());
	}
Beispiel #22
0
 function GoogleTest()
 {
     parent::WebPage('Google Analytics Test');
     //Enter Your Google Anlytics Code
     GoogleAnalytics::Track('UA-XXXXXX-X');
 }