Top  Branding  Banner 
blank.gif
blank.gif
triangle.gif Du er her: /  Forsiden  /  Kildekoden  /  Db-login  /  Viewlogin   Login nu   Login
blank.gif
««« Se kilde koden
blank.gif
tl.gif Cms tr.gif tl.gif Component tr.gif tl.gif Db tr.gif tl.gif Db-basket tr.gif tls.gif     Db-login  trs.gif tl.gif Db-customer tr.gif tl.gif Db-select tr.gif tl.gif Jquery tr.gif tl.gif Form-elements tr.gif tl.gif Menu-fisheye tr.gif tl.gif Template tr.gif tl.gif Tree-node tr.gif tl.gif Validator tr.gif
blank.gif
blank.gif
arrow-headline.gif Index
MenuLink  MenuLeft  
Tilbage

Skjul: Navn

ViewLogin.php


Vis: Sample code, tutorial

ViewLogin, Sample code, tutorial

Sådan benyttes komponenten ViewLogin klassen

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

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

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

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

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

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

Skjul: Sådan vises komponenten

ViewLogin, Sådan vises komponenten

Sådan vises komponenten ViewLogin klassen

arrow-headline.gif Login (1)
No help





Vis: PHP source code

ViewLogin, PHP source code

Den fulde PHP kildekode for ViewLogin klassen

<?php
/**
 * @package db-login
 * @see HTML_DB_LOGIN_VIEW_PATH.'/ViewLogin.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_VIEW_PATH.'/ViewForm.php');
require_once(
HTML_UTIL_COMPONENT_PATH.'/Server.php');
if (
defined('HTML_LOG_UTIL_PATH')) {
    require_once(
HTML_LOG_UTIL_PATH.'/Log.php');
}

/**
 * Generates the html for a View Login Form
 * <code>
 * Usage:
 *   $view = new ViewLogin($datareader, $text, $width, $class, $border, $cellpadding, $cellspacing, $summary, $caption, $method);
 *   print $view->getHtml();
 * Or
 *   ViewLogin::display($datareader, $text, $width, $class, $border, $cellpadding, $cellspacing, $summary, $caption, $method);
 *
 * Generates a complete View Form interface
 * +---------------+
 * | Text header   |
 * +----------------
 * | Label         | 
 * | Text field    |
 * +---------------
 * | Buttons       |
 * +---------------+
 * </code>
 * @package db-login
 */

class ViewLogin extends ViewForm {
    
/**
     * Constructor
     * @param DataReader / array $datareader The Data Reader object OR an array
     * @param String $text    The text header for the table
     * @param String $width   The Width for the table
     * @param String $class   The Class
     * @param String $border  The Border
     * @param String $cellpadding The CellSpacing
     * @param String $cellspacing The CellPadding
     * @param String $summary The Summary
     * @param String $caption The Caption 
     * @param String $method  The form submission metod [ post | get ] default is 'post' 
     */
    
function __construct($datareader=null$text=''$width=''$class=''$border=''$cellpadding=''$cellspacing=''$summary=''$caption=''$method='') {
        
$theText        $text != '' $text : @TEXT_TABLE_LOGIN;

        
// Global table characteristics
        
$theWidth       $width  != '' $width  FORM_VIEW_WIDTH;
        
$theClass       $class  != '' $class  FORM_VIEW_CLASS;
        
$theBorder      $border != '' $border FORM_VIEW_BORDER;
        
$theCellPadding $cellpadding != '' $cellpadding FORM_VIEW_CELLPADDING;
        
$theCellSpacing $cellspacing != '' $cellspacing FORM_VIEW_CELLSPACING;
        
parent::__construct($datareader$theText$theWidth$theClass$theBorder$theCellPadding$theCellSpacing$summary$caption$method);
    }

    
/**
     * You may override this methode in order to create your own hiddens
     * If no request parameters are supplied, then popup the login form
     * Return the Hiddens as an object
     * @abstract
     * @param  String $default The default value to use for yhe REQUEST_COMMAND
     * @return Object The Hiddens as an Object 
     */
    
function newHiddens($default='') {
        
$keyValue = array();
        
$keyValue[REQUEST_COMMAND] = Request::get(REQUEST_COMMANDVIEW_LOGIN_FORM__FILE____LINE__true);
        
$keyValue[REQUEST_REFERER] = Server::getReferer();
        return new 
Hiddens($keyValueVIEW_LOGIN_FORM$this->getClassName()); // VIEW_LOGIN_FORM
    
}

    
/**
     * Display html
     * <code>
     * Usage:
     *    ViewLogin::display($datareader, $text, $width, $class, $border, $cellpadding, $cellspacing, $summary, $caption, $method); 
     * </code>
     * @static
     * @param DataReader / array $datareader The Data Reader object OR an array
     * @param String $text    The text header for the table
     * @param String $width   The width of the table
     * @param String $class   The class of the table
     * @param String $border  The border of the table
     * @param String $cellpadding The CellSpacing
     * @param String $cellspacing The CellPadding
     * @param String $summary The Summary
     * @param String $caption The Caption 
     * @param String $method  The form submission metod [ post | get ] default is 'post' 
     */
    
public static function display($datareader=null$text=''$width=''$class=''$border=''$cellpadding=''$cellspacing=''$summary=''$caption=''$method='') {
        
$html = new ViewLogin($datareader$text$width$class$border$cellpadding$cellspacing$summary$caption$method);
        
$html->addHtml();
    }
}
?>

Vis: HTML source code

ViewLogin, HTML source code

Den fulde HTML kildekode for ViewLogin klassen

<?
<!-- 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/db-login/ViewLogin/index.php" title="Klik her for at Minimere ...  TableHeader"><!-- DEBUGImages -->
<
img src="http://web-expert.dk/images/arrow-headline.gif" width="4" height="7" alt="arrow-headline.gif" />
</
a>
</
td>
  <
th class="baseColorHeader" valign="top" align="left">Login (1)
</
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 (!
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/db-login/ViewLogin/index.php" method="post" name="ViewLogin" id="Form3" 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)" />


<!-- 



 -->

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

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



<!-- 



 -->

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

<!-- DEBUG: Text -->
<input type="text" id="Label2" class="formXLARGE baseBorder baseBody" value="" title="&#013;&#013;&#013;&#013;" tabindex="2" /><br />




<!-- DEBUG: Buttons -->
<p><div class="baseAlignCenter">


<!-- BUTTON_LOGIN_TEXT -->

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




</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>

?>

Vis: Class methods

ViewLogin, Class methods

Her er 'klasse metoderne' for ViewLogin klassen:

  • __construct
  • newHiddens
  • display
  • isValid
  • getRow
  • newRows
  • newContent
  • getHtml
  • setStriphttp
  • setStriptags
  • setEncode
  • setMultipleEditColumns
  • setTable
  • newButtons
  • newData
  • getCssClass
  • newColumn
  • isActive
  • isActiveTab
  • isActiveIndex
  • newColumns
  • adjustColumns
  • newCorner
  • getColumns
  • newTextRow
  • getTableHeader
  • getStart
  • getEnd
  • start
  • end
  • 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

ViewLogin, Object vars

Her er 'objekt variable' for ViewLogin 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