Location: PHPKode > scripts > awfDialog Wizard > awfdialog-wizard/awfDialog/examples/SimplePlain/index.php
<?php
	//Version 1.2 (final)
   include('../../lib/awfDialog.php');
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>awfDialog Class :: Simple Example</title>
		<link rel="stylesheet" href="../style.css" type="text/css" media="screen" />
	</head>
	<body>
		<div class="header">
			<img src="../../docs/images/testlab2.jpg" align=right><img src="../../docs/images/testlabhead.jpg">
		</div>
		<div class="content">
			<table width="100%" cellpadding="2" cellspacing="1" border="0">
				<tr>
					<td width="100%" valign="top" id="MainBody">
						<font size="1">awfDialog :: AJAX Enabled Dynamic Dialog Wizard Class :: Simple Example</font>
                        <center>
						<div id="container">
<?php
    
    
    $str1="<b>Welcome to the Simple Dialog Example.</b><br><br>Exaples on this page show the bare minimum code needed to generate an awfDialog with default behaviors and no Ajax enabled. Several examples down the page shows different settings and how you might use an awfDialog on your website or in your web applications. Beneath each example is the code used to generate it.";
    
    $m1 = new awfDialog('S1','Simple Dialogs',$str1, ICON_NONE,false,575);
    $m1->SetImagePath("../../lib/images/");
	$m1->SetVAlign(BODY_MIDDLE);
    $m1->SetHAlign(BODY_CENTER);
    $m1->SetIconType(ICON_INFO);
    $m1->SetIconSize(ICON_SIZE_LG);
    $m1->SetGradient('224e15','c3f60a');
    $m1->SetImagePHPURL('../../lib/image2.php');
    $m1->SetWizMode(true);
    $m1->SetBodyBGColor('#efffca');
    $m1->UseHelp(true);
    $m1->SetCSS("Title","color:#fff;font-weight:bold;");
    $m1->SetCSS("MasterDiv","margin-top:10px;");
    $m1->Render();
    $m1->Clear();
?>

                    </div>
					<!--<div id='error'><textarea id="raw" cols=75 rows=10 class="color"></textarea><br><input type=text class="color"></div>-->
					</center>
                    <h2>Example 1:</h2>
<?php
    $simple1 = new awfDialog("simple1", "Test", "This is a simple dialog.");
    $simple1->Render();
?>
<textarea id="raw1" cols=85 rows=3>
    $simple1 = new awfDialog("simple1", "Test", "This is a simple dialog.");
    $simple1->Render();</textarea><br><br>
    Notice this simple example is pretty plain and has virtually no fancy display elements, although it is rendered using the awfDialog class just like the dialog at the top of this page. Also notice that we've left out some optional arguments we'll explore in Example 2. The first argument, ID, is the only required arument to instantiate a new awfDialog.
    <h2>Example 2:</h2>
    In the prior example, we set the dialog's CSS id, Title string, and Message string. By default, an awfDialog is non-modal, meaning it can be closed. However, since $simple1 did not know where to find it's dependent images the exit button did not render. Let's fix that:<br>
    
<?php
    $simple2 = new awfDialog("simple2", "Test", "This is a simple dialog.");
    $simple2->SetImagePath("../../lib/images/");
    $simple2->Render();
?>    
    <textarea id="raw2" cols=85 rows=3>
    $simple2 = new awfDialog("simple2", "Test", "This is a simple dialog.");
    $simple2->SetImagePath("../../lib/images/");    
    $simple2->Render();</textarea><br><br>

    <h2>Example 3:</h2>
    Next, let's extend our example by using the remaining three optional arguments: $icontype, $modal, and $width.<br>
    
<?php
    $simple3 = new awfDialog("simple3", "Test", "This is a simple dialog.", ICON_CONFIG, true, "350");
    $simple3->SetImagePath("../../lib/images/");
    $simple3->Render();
?>    
    <textarea id="raw3" cols=85 rows=5>
    $simple3 = new awfDialog("simple3", "Test", "This is a simple dialog.", ICON_CONFIG, true, "350");
    $simple3->SetImagePath("../../lib/images/");
    $simple3->Render();
    </textarea><br><br>

    <h2>Example 4:</h2>
    As you can see, while Example 3 is a functional dialog box it doesn't exactly look amazing. That doesn't mean it can't be. Look at the last example for an idea on the methods the awfDialog class makes available to better manipulate display control, even of simple dialogs.<br>
    
<?php
    $simple4 = new awfDialog("simple4", "Now THIS is a dialog!", "This was originally a simple dialog. ", ICON_USER, false, "350");
    $simple4->SetImagePath("../../lib/images/");
    $simple4->SetImagePHPURL('../../lib/image2.php');
    $simple4->SetGradient("000000","0000cc");
    $simple4->SetCSS("Title", "color:#ffcc00;font-weight:bold;font-size:12pt;padding:2px;");
    $simple4->SetCSS("BodyPane", "padding:10px;");
    $simple4->SetCSS("MasterDiv", "margin:15px;");
    $simple4->AddOutput("But by manipulating a few extra properties and firing a few events, we've now turned it into something special.<br><br>");
    $simple4->AddOutput("What are you waiting for? Spend some time reading the Usage Guide, the CSS Reference, and playing with the other examples, then get busy trying it out!");
    $simple4->Render();
?>    
    <textarea id="raw3" cols=85 rows=10>
    $simple4 = new awfDialog("simple4", "Now THIS is a dialog!", "This was originally a simple dialog.", ICON_USER, false, "350");
    $simple4->SetImagePath("../../lib/images/");
    $simple4->SetImagePHPURL('../../lib/image2.php');
    $simple4->SetGradient("000000","0000cc");
    $simple4->SetCSS("Title", "color:#ffcc00;font-weight:bold;font-size:12pt;padding:2px;");
    $simple4->SetCSS("BodyPane", "padding:10px;");
    $simple4->SetCSS("MasterDiv", "margin:15px;");
    $simple4->AddOutput("But by manipulating a few extra properties and firing a few events, we've now turned it into something special.<br><br>");
    $simple4->AddOutput("What are you waiting for? Spend some time reading the Usage Guide, the CSS Reference, and playing with the other examples, then get busy trying it out!");
    $simple4->Render();
    </textarea><br><br>


					</td>
					<td width="120px" bgcolor="#efffca" valign="top" class="quick">
						<?php include('../examplemenu.php');?>
					</td>
				</tr>
			</table>
		</div>		
		<div class="footer">
			<img src="../../docs/images/KLNminilogo.jpg"><br><font color="white">
			TestLab is an internal-use only production of <a href="http://knowledgelinknetwork.net">Knowledge Link Network</a></font><br>
		</div>
	</body>
</html>

Return current item: awfDialog Wizard