/**
  * Get the HTML fragment corresponding to the HTML editor widget
  * @param WebPage $oP The web page used for all the output
  * @param Hash $aArgs Extra context arguments
  * @return string The HTML fragment to be inserted into the page
  */
 public function Display(WebPage $oPage, $aArgs = array())
 {
     $iId = $this->m_iId;
     $sCode = $this->m_sAttCode . $this->m_sNameSuffix;
     $sValue = $this->m_sValue;
     $sHelpText = $this->m_sHelpText;
     $sValidationField = $this->m_sValidationField;
     $sHtmlValue = "<table><tr><td><textarea class=\"htmlEditor\" title=\"{$sHelpText}\" name=\"attr_{$this->m_sFieldPrefix}{$sCode}\" rows=\"10\" cols=\"10\" id=\"{$iId}\">{$sValue}</textarea></td><td>{$sValidationField}</td></tr></table>";
     // Replace the text area with CKEditor
     // To change the default settings of the editor,
     // a) edit the file /js/ckeditor/config.js
     // b) or override some of the configuration settings, using the second parameter of ckeditor()
     $sLanguage = strtolower(trim(UserRights::GetUserLanguage()));
     $oPage->add_ready_script("\$('#{$iId}').ckeditor(function() { /* callback code */ }, { language : '{$sLanguage}' , contentsLanguage : '{$sLanguage}', extraPlugins: 'disabler' });");
     // Transform $iId into a CKEdit
     // Please read...
     // ValidateCKEditField triggers a timer... calling itself indefinitely
     // This design was the quickest way to achieve the field validation (only checking if the field is blank)
     // because the ckeditor does not fire events like "change" or "keyup", etc.
     // See http://dev.ckeditor.com/ticket/900 => won't fix
     // The most relevant solution would be to implement a plugin to CKEdit, and handle the internal events like: setData, insertHtml, insertElement, loadSnapshot, key, afterUndo, afterRedo
     // Could also be bound to 'instanceReady.ckeditor'
     $oPage->add_ready_script("\$('#{$iId}').bind('validate', function(evt, sFormId) { return ValidateCKEditField('{$iId}', '', {$this->m_sMandatory}, sFormId, '') } );\n");
     $oPage->add_ready_script("\$('#{$iId}').bind('update', function() { BlockField('cke_{$iId}', \$('#{$iId}').attr('disabled')); } );\n");
     return $sHtmlValue;
 }
Example #2
0
/**
 * Displays a popup welcome message, once per session at maximum
 * until the user unchecks the "Display welcome at startup"
 * @param WebPage $oP The current web page for the display
 * @return void
 */
function DisplayWelcomePopup(WebPage $oP)
{
    if (!isset($_SESSION['welcome'])) {
        // Check, only once per session, if the popup should be displayed...
        // If the user did not already ask for hiding it forever
        $bPopup = appUserPreferences::GetPref('welcome_popup', true);
        if ($bPopup) {
            $sTemplate = @file_get_contents('../application/templates/welcome_popup.html');
            if ($sTemplate !== false) {
                $oTemplate = new DisplayTemplate($sTemplate);
                $oP->add("<div id=\"welcome_popup\">");
                $oTemplate->Render($oP, array());
                $oP->add("<p style=\"float:left\"><input type=\"checkbox\" checked id=\"display_welcome_popup\"/><label for=\"display_welcome_popup\">&nbsp;" . Dict::S('UI:DisplayThisMessageAtStartup') . "</label></p>\n");
                $oP->add("<p style=\"float:right\"><input type=\"button\" value=\"" . Dict::S('UI:Button:Ok') . "\" onClick=\"\$('#welcome_popup').dialog('close');\"/>\n");
                $oP->add("</div>\n");
                $sTitle = addslashes(Dict::S('UI:WelcomeMenu:Title'));
                $oP->add_ready_script(<<<EOF
\t\$('#welcome_popup').dialog( { width:'80%', height: 'auto', title: '{$sTitle}', autoOpen: true, modal:true,
\t\t\t\t\t\t\t\t  close: function() {
\t\t\t\t\t\t\t\t  \tvar bDisplay = \$('#display_welcome_popup:checked').length;
\t\t\t\t\t\t\t\t  \tSetUserPreference('welcome_popup', bDisplay, true); 
\t\t\t\t\t\t\t\t  }
\t\t\t\t\t\t\t\t  });
\tif (\$('#welcome_popup').height() > (\$(window).height()-70))
\t{
\t\t\$('#welcome_popup').height(\$(window).height()-70);
\t}
EOF
);
                $_SESSION['welcome'] = 'ok';
            }
        }
    }
}
Example #3
0
 /**
  * @test
  */
 public function create()
 {
     $model = new WebPage();
     $model->attributes = array('title' => 'test', 'name' => "test", 'description' => "description test", 'keywords' => "test");
     $this->assertTrue($model->save());
     $model = new WebPage();
     $model->attributes = array('title' => 'testa', 'name' => "test");
     $this->assertFalse($model->save());
     $this->assertInstanceOf('WebPage', WebPage::model());
 }
Example #4
0
 public function test_should_find_by_id_string()
 {
     $attributes = array('title' => 'UserMinds.com');
     $UserMinds = $this->WebPage->create($attributes);
     $FoundUserMinds = new WebPage((string) $UserMinds->getId());
     $this->assertFalse($FoundUserMinds->isNewRecord());
     $this->assertEqual($FoundUserMinds->getId(), $UserMinds->getId());
     $FoundUserMinds = $UserMinds->find((string) $UserMinds->getId());
     $this->assertFalse($FoundUserMinds->isNewRecord());
     $this->assertEqual($FoundUserMinds->getId(), $UserMinds->getId());
 }
 /**
  * @param string $url
  * @param string $tmpDir
  * @param string $viewportSize
  * @param int $zoomFactor
  * @param int $timeout
  * @param int $delay
  * @throws \Exception
  */
 public function __construct($url, $tmpDir = '/tmp', $viewportSize = WebPage::SIZE_NETBOOK_15, $zoomFactor = 1, $timeout = 0, $delay = 0)
 {
     if (!is_dir($tmpDir) || !is_writable($tmpDir)) {
         throw new \Exception("Destination dir '{$tmpDir}' must exist and be writable");
     }
     do {
         $tmpFile = $tmpDir . '/' . uniqid() . '.png';
     } while (file_exists($tmpFile));
     $webPage = new WebPage($url);
     $webPage->getShot($tmpFile, $viewportSize, $zoomFactor, $timeout, $delay);
     $this->image = imagecreatefrompng($tmpFile);
     unlink($tmpFile);
     $this->sourceWidth = imagesx($this->image);
     $this->sourceHeight = imagesy($this->image);
 }
 function __construct($s_title)
 {
     parent::__construct($s_title);
     $this->add_header("Content-type: text/plain; charset=utf-8");
     $this->add_header("Cache-control: no-cache");
     //$this->add_header("Content-Transfer-Encoding: binary");
 }
	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'));
	}
Example #8
0
function basePageHref($basePageCode, $image)
{
    $basePage = WebPage::inst($basePageCode);
    $sprites = CssSpritesManager::getDirSprite(CssSpritesManager::DIR_HEADER, $image, true);
    $href = $basePage->getHref($sprites . $basePage->getName());
    echo PsHtml::html2('li', array('class' => WebPages::getCurPage()->isMyBasePage($basePage) ? 'current' : null), $href);
}
Example #9
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);
	}
Example #10
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);
         }
     }
 }
 public function __construct(Identifier $page)
 {
     if (!$page->of(WebPage::getIdentifier())) {
         throw new \InvalidArgumentException(sprintf('RestartRequestOnPageException expects a web page identifier, %s given.', $page->getFullyQualifiedName()));
     }
     $this->page = $page;
     parent::__construct('RestartRequestOnPageException');
 }
 public function SetHttpHeaders(WebPage $oPage)
 {
     // Integration within MS-Excel web queries + HTTPS + IIS:
     // MS-IIS set these header values with no-cache... while Excel fails to do the job if using HTTPS
     // Then the fix is to force the reset of header values Pragma and Cache-control
     $oPage->add_header("Pragma:", true);
     $oPage->add_header("Cache-control:", true);
 }
 public function __construct(Identifier $pageIdentifier, Identifier $loginPage)
 {
     Args::identifierOf($pageIdentifier, WebPage::getIdentifier(), 'pageIdentifier');
     Args::identifierOf($loginPage, WebPage::getIdentifier(), 'loginPage');
     $this->pageAuthIdentifier = $pageIdentifier;
     $this->loginPageIdentifier = $loginPage;
     PiconApplication::get()->getSecuritySettings()->setComponentNotAuthorisedListener(new DirectToPageComponentNotAuthorisedListener($loginPage));
 }
Example #14
0
 public function __construct($title, $showCover = true, $hrefOrPageCode = null, array $smartyParams = array(), $jsParams = null)
 {
     $this->title = $title;
     $this->cover = !!$showCover;
     $this->href = is_numeric($hrefOrPageCode) ? WebPage::inst($hrefOrPageCode)->getUrl() : $hrefOrPageCode;
     $this->smartyParams = $smartyParams;
     $this->jsParams = $jsParams;
 }
Example #15
0
	function Save($editor)
	{
		$comment = $editor->Text;
		$editor->Leave();
		$this->Controls->Clear();
		$this->Controls->Add(new MarkupRegion($comment, 0, 0, '100%', '100%'));
		WebPage::That()->Controls->Add(new BlogComment())	
			->Layout = Layout::Relative;
	}
Example #16
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);
 }
Example #17
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);
 }
Example #18
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();
 }
Example #19
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");
 }
Example #20
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
 }
Example #21
0
 protected function doProcess(PageContext $ctxt, RequestArrayAdapter $requestParams, ArrayAdapter $buildParams)
 {
     $this->PPM = PopupPagesManager::inst();
     //Проверим, что в случае открытия popup страницы все параметры переданы корректно
     if (!$this->PPM->isValidPageRequested()) {
         WebPage::inst(PAGE_POPUP)->redirectHere();
     }
     $this->popupPage = $this->PPM->getCurPage();
     $this->popupPage->checkAccess();
     $this->popupPage->doProcess($requestParams);
 }
Example #22
0
 /**
  * Begins tracking this page, that is, reporting to Google servers activity associated with a particular account.
  * @param string $accountNumber This is a number given to you by Google that uniquely associates you with your account.
  */
 static function Track($accountNumber)
 {
     // URL to download Google Analytics API JavaScripts. Note that there is a http and a https version.
     $url = (isset($_SERVER['HTTPS']) ? 'https://ssl.' : 'http://www.') . 'google-analytics.com/ga.js';
     // Add those scripts.
     ClientScript::AddSource($url, false);
     // The code to report this use of the page to Google servers.
     ClientScript::RaceQueue(WebPage::That(), '_gat', "pageTracker = _gat._getTracker('{$accountNumber}');pageTracker._trackPageview();");
     // Report back to Google servers every time tokens are changed too.
     URL::SetTracker(new RaceClientEvent('pageTracker', 'pageTracker._trackPageview', URL::Tokens));
 }
 public function DisplayFormPart(WebPage $oP, $sPartId)
 {
     switch ($sPartId) {
         case 'xml_options':
             $sChecked = utils::ReadParam('no_localize', 0) == 1 ? ' checked ' : '';
             $oP->add('<fieldset><legend>' . Dict::S('Core:BulkExport:XMLOptions') . '</legend>');
             $oP->add('<table>');
             $oP->add('<tr>');
             $oP->add('<td><input type="checkbox" id="xml_no_localize" name="no_localize" value="1"' . $sChecked . '><label for="xml_no_localize"> ' . Dict::S('Core:BulkExport:OptionNoLocalize') . '</label></td>');
             $oP->add('</tr>');
             $oP->add('</table>');
             $oP->add('</fieldset>');
             break;
         default:
             return parent::DisplayFormPart($oP, $sPartId);
     }
 }
Example #24
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);
 }
Example #25
0
 /**
  * run the web application
  *
  * @param array $web_options
  *
  * @return void
  */
 public static function run($web_options)
 {
     if (!is_array($web_options['action_modules'])) {
         throw new Exception('action_modules not setted in $options', Errno::PARAM_INVALID);
     }
     //get route module & action
     $route_options = self::get_route_options();
     $module_name = empty($route_options['module']) ? 'index' : strtolower($route_options['module']);
     $action_name = empty($route_options['action']) ? 'index' : strtolower($route_options['action']);
     //module not found
     if (!in_array($module_name, $web_options['action_modules'])) {
         $web = new WebPage();
         $web->header_notfound();
         echo "Action module not found.\n";
         return;
     }
     //execute
     $class_name = "App\\Action\\{$module_name}";
     self::$instance = new $class_name($module_name, $web_options);
     self::$instance->execute($action_name);
 }
 /**
  * Get the HTML fragment corresponding to the linkset editing widget
  * @param WebPage $oP The web page used for all the output
  * @param Hash $aArgs Extra context arguments
  * @return string The HTML fragment to be inserted into the page
  */
 public function Display(WebPage $oPage, $aArgs = array())
 {
     $sCode = $this->sAttCode . $this->sNameSuffix;
     $iWidgetIndex = self::$iWidgetIndex;
     $aPasswordValues = utils::ReadPostedParam("attr_{$sCode}", null, 'raw_data');
     $sPasswordValue = $aPasswordValues ? $aPasswordValues['value'] : '*****';
     $sConfirmPasswordValue = $aPasswordValues ? $aPasswordValues['confirm'] : '*****';
     $sChangedValue = $sPasswordValue != '*****' || $sConfirmPasswordValue != '*****' ? 1 : 0;
     $sHtmlValue = '';
     $sHtmlValue = '<input type="password" maxlength="255" name="attr_' . $sCode . '[value]" id="' . $this->iId . '" value="' . htmlentities($sPasswordValue, ENT_QUOTES, 'UTF-8') . '"/>&nbsp;<span class="form_validation" id="v_' . $this->iId . '"></span><br/>';
     $sHtmlValue .= '<input type="password" maxlength="255" id="' . $this->iId . '_confirm" value="' . htmlentities($sConfirmPasswordValue, ENT_QUOTES, 'UTF-8') . '" name="attr_' . $sCode . '[confirm]"/> ' . Dict::S('UI:PasswordConfirm') . ' <input id="' . $this->iId . '_reset" type="button" value="' . Dict::S('UI:Button:ResetPassword') . '" onClick="ResetPwd(\'' . $this->iId . '\');">';
     $sHtmlValue .= '<input type="hidden" id="' . $this->iId . '_changed" name="attr_' . $sCode . '[changed]" value="' . $sChangedValue . '"/>';
     $oPage->add_ready_script("\$('#{$this->iId}').bind('keyup change', function(evt) { return PasswordFieldChanged('{$this->iId}') } );");
     // Bind to a custom event: validate
     $oPage->add_ready_script("\$('#{$this->iId}').bind('keyup change validate', function(evt, sFormId) { return ValidatePasswordField('{$this->iId}', sFormId) } );");
     // Bind to a custom event: validate
     $oPage->add_ready_script("\$('#{$this->iId}_confirm').bind('keyup change', function(evt, sFormId) { return ValidatePasswordField('{$this->iId}', sFormId) } );");
     // Bind to a custom event: validate
     $oPage->add_ready_script("\$('#{$this->iId}').bind('update', function(evt, sFormId)\n\t\t\t{\n\t\t\t\tif (\$(this).attr('disabled'))\n\t\t\t\t{\n\t\t\t\t\t\$('#{$this->iId}_confirm').attr('disabled', 'disabled');\n\t\t\t\t\t\$('#{$this->iId}_changed').attr('disabled', 'disabled');\n\t\t\t\t\t\$('#{$this->iId}_reset').attr('disabled', 'disabled');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\$('#{$this->iId}_confirm').removeAttr('disabled');\n\t\t\t\t\t\$('#{$this->iId}_changed').removeAttr('disabled');\n\t\t\t\t\t\$('#{$this->iId}_reset').removeAttr('disabled');\n\t\t\t\t}\n\t\t\t}\n\t\t);");
     // Bind to a custom event: update to handle enabling/disabling
     return $sHtmlValue;
 }
Example #27
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();
 }
Example #28
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));
 }
Example #29
0
	function ContentSlider($content=null, $left, $top, $width, $height)
	{
		parent::Panel($left, $top, $width, $height);
		WebPage::That()->CSSFiles->Add(GetRelativePath(getcwd(), dirname(__FILE__)) . '/Styles/default.css');
		$this->CSSClasses->Add('ContentSlider');
		$this->SlideHolder = new Panel(0, 0, '100%', '100%');
		$this->Slides = new Group();
		$this->Slides->Change = new ServerEvent($this, 'SlideContent');
		$this->SlideHolder->Controls->Add($this->Slides);
		if($content)
			$this->SetContent($content);
		$this->Controls->Add($this->SlideHolder);
		$this->SetPrevious();
		$this->SetNext();
	}
Example #30
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);
	}