Top  Branding  Banner 
blank.gif
blank.gif
triangle.gif Du er her: /  Forsiden  /  Kildekoden  /  Mvc  /  Engine   Login nu   Login
blank.gif
««« Se kilde koden
blank.gif
tl.gif Base tr.gif tl.gif Basic tr.gif tl.gif Dto tr.gif tl.gif Form tr.gif tl.gif Language tr.gif tl.gif Layout tr.gif tl.gif Menu tr.gif tls.gif     Mvc  trs.gif tl.gif Netbank.eksperter.dk tr.gif tl.gif Tab tr.gif tl.gif Table tr.gif tl.gif Util tr.gif
blank.gif
blank.gif
arrow-headline.gif Index
MenuLink  MenuLeft  
Tilbage

Skjul: Navn

Engine.php


Vis: Sample code, tutorial

Engine, Sample code, tutorial

Sådan benyttes komponenten Engine klassen

Først skal du inkludere den fil der beskriver komponenten, som en klasse fil

  • <?
    require_once(HTML_PACKAGE_PATH.'/Engine.php');
    ?>

Dernæst kan du enten benytte komponenten som et taglib (statiske metoder):

  • <?
    Engine
    ::display($param1$param2$param3, ...);
    ?>

eller du kan lave en instance af komponenten og benytte metoderne direkte:

  • <?
    $object 
    = new Engine($param1$param2$param3, ...);
    print 
    $object->getHtml();
    ?>

Skjul: Sådan vises komponenten

Engine, Sådan vises komponenten

Sådan vises komponenten Engine klassen

arrow-headline.gif EngineLogin (0)
No help








Vis: PHP source code

Engine, PHP source code

Den fulde PHP kildekode for Engine klassen

<?php
/**
 * @package mvc
 * @see HTML_MVC_CONTROLLER_PATH.'/Engine.php'
 * @copyright (c) http://Finn-Rasmussen.com
 * @license http://Finn-Rasmussen.com/license/ myPHP License conditions
 * @author http://Finn-Rasmussen.com
 * @version 1.11
 * @since 27-nov-2009
 */

/**
 * The required files
 */
require_once(HTML_MVC_CONTROLLER_PATH.'/EngineObject.php');
require_once(
HTML_DB_LOGIN_QUERY_PATH.'/QueryLogin.php');

/**
 * The Engine is the controller for other EngineXyz objects
 * This is the controller for a List View  or Form View
 * where the user may Insert, Update or delete records 
 * <code>
 * Usage:
 *   $table      = DATABASE_PREFIX.TABLE_NAME_LOGIN;
 *   $query      = new QueryLogin($table);
 *   $name       = ENGINE_NAME_LOGIN;
 *   $view       = GRID_LAYOUT_VIEW_LOGIN;
 *   $sort       = true;
 *   $validators = "";
 *   
 *   $engine = new Engine($table, $query, $name, $view, $sort, $validators);
 *   print $engine->getHtml();
 * Or
 *   Engine::display($table, $query, $name, $view, $sort, $validators);
 * </code>
 * @package mvc
 */

class Engine extends EngineObject {
    
/**
     * Constructor
     * @param String  $table The table to use
     * @param Query   $query The Query Object to use
     * @param String  $name  The Engine Name to use
     * @param String  $view  The View to use
     * @param boolean $sort  The DataReader object may be sorted
     * @param array   $validators The validators to use
     */
    
function __construct($table=''$query=''$name=''$view=''$sort=''$validators='') {
        
$theTable  $table != '' $table DATABASE_PREFIX.TABLE_NAME_LOGIN;
        
$theQuery  $query != '' $query : new QueryLogin($theTable);
        
$theName   $name  != '' $name  ENGINE_NAME_LOGIN;
        
$theView   $view  != '' $view  GRID_LAYOUT_VIEW_LOGIN;
        
$theSort   $sort  != '' $sort  true;
        
$theValidators $validators  != '' $validators "";
        
parent::__construct($theTable$theQuery$theName$theView$theSort$theValidators);
    }

    
/**
     * Display html
     * <code>
     * Usage:
     *    Engine::display($table, $query, $name, $view, $sort, $validators);
     * </code>
     * @static
     * @param String  $table The table to use
     * @param Query   $query The Query Object to use
     * @param String  $name  The Engine Name to use
     * @param String  $view  The View to use
     * @param boolean $sort  The DataReader object may be sorted
     * @param array   $validators The validators to use
     */
    
public static function display($table=''$query=''$name=''$view=''$sort=''$validators='') {
        
$html = new Engine($table$query$name$view$sort$validators);
        
$html->addHtml();
    }
}
?>

Vis: HTML source code

Engine, HTML source code

Den fulde HTML kildekode for Engine klassen

<?
<!-- DEBUGEngine -->
<!-- 
DEBUGViewLimit -->
<!-- 
ViewLimit->getHtml(), (numRows:0) (rows/max:0) (max:400)  -->
<!-- 
DEBUGViewLogin -->
<!-- 
DEBUGTableHeader -->

<
table width="323" class="formView baseBorder" border="0" cellpadding="2" cellspacing="0">
 <
tr>
    <
td class="baseArrowHeader" valign="middle"><!-- DEBUGLink -->
<
class="baseLinkColor" href="/source-code/mvc/Engine/index.php" title="Klik her for at Minimere ...  TableHeader"><!-- DEBUGImages -->
<
img src="http://myrer.info/images/arrow-headline.gif" width="4" height="7" alt="arrow-headline.gif" />
</
a>
</
td>
  <
th class="baseColorHeader" valign="top" align="left">EngineLogin (0)
</
th>

 </
tr>

</
table>

<
table id="ViewLoginId" width="323" class="formView baseBorder" border="0" cellpadding="10" cellspacing="0">
 <
tr>
    <
td valign="top"><!-- DEBUGScript -->
<
script type="text/javascript">
//<![CDATA[
function onSubmitViewLogin(theForm) {
    var 
isValid  true;
    var 
messages '';
    var 
focusMe  '';

    if (
typeof theForm.username == 'object' && theForm.username.value == '') {
        
isValid false;
        if (
focusMe === '') {
            
focusMe theForm.username.name;
        }
        
messages += "Brugernavn eller Nr.\r\n";
    }
    if (
typeof theForm.password == 'object' && theForm.password.value == '') {
        
isValid false;
        if (
focusMe === '') {
            
focusMe theForm.password.name;
        }
        
messages += "Adgangskode\r\n";
    }
    if (
typeof theForm.email == 'object' && theForm.email.value == '') {
        
isValid false;
        if (
focusMe === '') {
            
focusMe theForm.email.name;
        }
        
messages += "Email\r\n";
    }
    if (
typeof theForm.isOnline == 'object' && theForm.isOnline.value == '') {
        
isValid false;
        if (
focusMe === '') {
            
focusMe theForm.isOnline.name;
        }
        
messages += "isOnline\r\n";
    }
    if (!
isValid) {
        var 
msg "Udfyld felterne:\r\n";
        
msg += '===================\r\n';
        
msg += messages;
        
alert(msg);
    } else {
        var 
submitId document.getElementById('submitButtonViewLoginId');
        
submitId.value     '   ...';
        
submitId.disabled  true;
        
submitId.className 'formButton baseBorder baseBody formXXSmall formButtonBee';
    }
    if (!
isValid && focusMe !== '') {
        
theForm[focusMe].focus();
    }
    return 
isValid;
}


//]]>
</script>

<!-- DEBUG: Form -->
<form action="/source-code/mvc/Engine/index.php" method="post" name="ViewLogin" id="Form5" onsubmit="return onSubmitViewLogin(this);">
<div class="baseAlignRight" align="right">No help</div>

<!-- DEBUG: Hiddens -->
<!-- Hiddens ViewLogin -->
<!-- DEBUG: Hidden -->
<input type="hidden" name="baseCOMMAND" value="85d3993b942fa1ea46c94653aac9400f" title="85d3993b942fa1ea46c94653aac9400f (ViewLogin)" />


<!-- username
100
string
demo_login
not_null
 -->

<!-- DEBUG: Label -->
<label for="Label1" accesskey="B" title="Accelerator key, use (Alt + B)">
    <b><span class="baseColorDark">B</span>rugernavn&nbsp;eller&nbsp;Nr.&nbsp;(Skal&nbsp;udfyldes)</b>&nbsp; (Alt + B) </label><br />

<!-- DEBUG: Text -->
<input type="text" name="username" id="Label1" class="formXLARGE baseBorder baseBody" maxlength="100" value="" title="username&#013;100&#013;string&#013;demo_login&#013;not_null&#013;" tabindex="1" /><br />



<!-- password
100
string
demo_login
not_null
 -->

<!-- DEBUG: Label -->
<label for="Label2" accesskey="A" title="Accelerator key, use (Alt + A)">
    <b><span class="baseColorDark">A</span>dgangskode&nbsp;(Skal&nbsp;udfyldes)</b>&nbsp; (Alt + A) </label><br />

<!-- DEBUG: Password -->
<input type="password" name="password" id="Label2" class="formXLARGE baseBorder baseBody" maxlength="100" value="" title="password&#013;100&#013;string&#013;demo_login&#013;not_null&#013;" tabindex="2" /><br />



<!-- email
100
string
demo_login
not_null
 -->

<!-- DEBUG: Label -->
<label for="Label3" accesskey="E" title="Accelerator key, use (Alt + E)">
    <b><span class="baseColorDark">E</span>mail&nbsp;(Skal&nbsp;udfyldes)</b>&nbsp; (Alt + E) </label><br />

<!-- DEBUG: Text -->
<input type="text" name="email" id="Label3" class="formXLARGE baseBorder baseBody" maxlength="100" value="" title="email&#013;100&#013;string&#013;demo_login&#013;not_null&#013;" tabindex="3" /><br />



<!-- isOnline
1
string
demo_login
not_null
enum
 -->

<!-- DEBUG: Checkbox -->
<input type="checkbox" id="Checkbox4" onclick="if(this.checked){this.form.elements['isOnline'].value='Y';}else{this.form.elements['isOnline'].value='N';}" class="baseBody" checked="checked" value="Y" title="isOnline&#013;1&#013;string&#013;demo_login&#013;not_null&#013;enum&#013;" tabindex="4" />

<!-- DEBUG: Label -->
<label for="Checkbox4" accesskey="I" title="Accelerator key, use (Alt + I)">
    <b><span class="baseColorDark">I</span>sOnline&nbsp;(Skal&nbsp;udfyldes)</b>&nbsp; (Alt + I) </label><br />

<!-- DEBUG: Hidden -->
<input type="hidden" name="isOnline" value="Y" />




<!-- DEBUG: Buttons -->
<p><div class="baseAlignCenter"><!-- DEBUG: CancelButton -->
<input type="button" class="formButton baseBorder baseBody formXXSmall"
     onclick="history.back();" value="Fortryd" title="Fortryd" tabindex="5" />

<!-- DEBUG: ResetButton -->
<input type="reset" class="formButton baseBorder baseBody formXXSmall"
     value="Nulstil" title="Nulstil (Alt + Z)" tabindex="6" accesskey="Z" />

<!-- BUTTON_SUBMIT_TEXT -->

<!-- DEBUG: SubmitButton -->
<input type="submit" id="submitButtonViewLoginId" class="formButton baseBorder baseBody formXXSmall"
     value="Go" title="Go (Alt + G)" tabindex="7" accesskey="G" />





</div>

</p>


</form>

<!-- DEBUG: Focus -->
<script type="text/javascript">
//<![CDATA[
function setFocus_ViewLoginusername() {
    if (typeof document.ViewLogin == 'object') {
        if (typeof document.ViewLogin.username == 'object') {
            document.ViewLogin.username.focus();
            document.ViewLogin.username.select();
        }
    }
}
if (typeof focusIsDefined == 'undefined') {
function onload1Body() {
    var onloadCurrent = window.onload;
    if (typeof onloadCurrent !== 'function') {
        window.onload = setFocus_ViewLoginusername;
    } else {
        window.onload = function() {
            onloadCurrent();
            setFocus_ViewLoginusername();
        }
    }
}
onload1Body();
    focusIsDefined = true;
}

//]]>
</script>


</td>
 </tr>

</table>
<!-- DEBUG: ViewLimit -->
<!-- ViewLimit->getHtml(), (numRows:0) (rows/max:0) (max:400)  -->

?>

Vis: Class methods

Engine, Class methods

Her er 'klasse metoderne' for Engine klassen:

  • __construct
  • display
  • setStriphttp
  • setStriptags
  • getView
  • doGet
  • dogetView
  • logout
  • doPost
  • loginForm
  • getNextView
  • execute
  • getHtml
  • setObject
  • set
  • get
  • getAttribute
  • getTag
  • add
  • getSizeof
  • getElement
  • getElements
  • getToogle
  • getMaximize
  • getMinimize
  • newTriangle
  • getStartHtml
  • getEndHtml
  • showsource
  • getClassName
  • getMsg
  • addHtml
  • __toString
  • getCacheFileName
  • save
  • content

Vis: Object vars

Engine, Object vars

Her er 'objekt variable' for Engine klassen:

  • html =>
  • sql =>

MenuRight 
triangle.gif

Dansk

Deutch

English (UK)

France

Italy

Norsk

Svensk

English (USA)


 
blank.gif
MenuBottom 
triangle.gif Copyright @ 1999-2010 www.Finn-Rasmussen.com Powered by myPHP Version (5.3.3-7+squeeze3) 1.11
blank.gif