Top  Branding  Banner 
blank.gif
blank.gif
triangle.gif Du er her: /  Forsiden  /  Kildekoden  /  Base  /  Emaillink   Login nu   Login
blank.gif
««« Se kilde koden
blank.gif
tls.gif     Base  trs.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 tl.gif Mvc tr.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

EmailLink.php


Vis: Sample code, tutorial

EmailLink, Sample code, tutorial

Sådan benyttes komponenten EmailLink klassen

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

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

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

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

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

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

Skjul: Sådan vises komponenten

EmailLink, Sådan vises komponenten

Sådan vises komponenten EmailLink klassen

Report spam

Vis: PHP source code

EmailLink, PHP source code

Den fulde PHP kildekode for EmailLink klassen

<?php
/**
 * @package base
 * @see HTML_BASE_UTIL_PATH.'/EmailLink.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_BASE_COMMON_PATH.'/Html.php');
require_once(
HTML_BASE_UTIL_PATH.'/Link.php');

/**
 * Returns a complete Email Link as HTML
 * The link may be terminated by a <br /> or surronded by <li> tags
 * as specified by the $aux parameter
 *
 * <code>
 *    <a href="mailto:$href" title="$title" class="$class">$text</a>
 * Usage:
 *    $text      = "text to show";
 *    $href      = "where@2mail.to";
 *    $class     = "cssClassName";
 *    $title     = "title to show"
 *    $aux       = LINK_LAYOUT_LI;
 *    $target    = "blank"; // Opens in a new window
 *    $name      = "TheNameOfLocalHrefs#";
 *    $tabindex  = "3";
 *    $onclick   = "alert('Hello')";
 *    $accesskey = "A";
 *   
 *   $link = new EmailLink($text, $href, $class, $title, $aux, $target, $name, $tabindex, $onclick, $accesskey);
 *   print $link->getHtml();
 * Or 
 *   EmailLink::display($text, $href, $class, $title, $aux, $target, $name, $tabindex, $onclick, $accesskey);
 * </code>
 * @package base
 */

class EmailLink extends Link {
   
/**
    * Constructor
    * @param String $text      The text for the link
    * @param String $href      The url for the link
    * @param String $class     The class of the link
    * @param String $title     The tool tip of the link
    * @param String $aux       Add 'br' or 'li' html tags, if required
    * @param String $target    The target for the link I.e. _BLANK
    * @param String $name      The name for the link
    * @param String $tabindex  The name of the tab index
    * @param String $onclick   The javascript onclick function name
    * @param String $accesskey The access key
    */
    
function __construct($text=''$href=''$class=''$title=''$aux=''$target=''$name=''$tabindex=''$onclick=''$accesskey='') {
        
$mailto 'mailto:';
        
$strHttp  'http:/'.'/';
        
$strHttps 'https:/'.'/';
        if (
strpos($href$strHttp) !==false || strpos($href$strHttps) !== false) {
            
$mailto ''
        }
        if (
$text == "") {
            
$text $href;
        }
        
parent::__construct($text$mailto.$href$class$title$aux$target$name$tabindex$onclick$accesskey);
    }

   
/**
    * Display an email link
    * <code>
    * Usage:
    *    EmailLink::display($text, $href, $class, $title, $aux, $target, $name, $tabindex, $onclick, $accesskey);
    * </code>
    * @static
    * @param String $text      The text for the link
    * @param String $href      The url for the link
    * @param String $class     The css class of the link
    * @param String $title     The tool tip of the link
    * @param String $aux       Add 'br' or 'li' html tags, if required
    * @param String $target    The target for the link. I.e. _BLANK
    * @param String $name      The name for the link
    * @param String $tabindex  The name of the tab index
    * @param String $onclick   The javascript onclick function name
    * @param String $accesskey The access key
    */
    
public static function display($text=''$href=''$class=''$title=''$aux=''$target=''$name=''$tabindex=''$onclick=''$accesskey='') {
        
$html = new EmailLink($text$href$class$title$aux$target$name$tabindex$onclick$accesskey);
        
$html->addHtml();
    }
}
?>

Vis: HTML source code

EmailLink, HTML source code

Den fulde HTML kildekode for EmailLink klassen

<?
<!-- DEBUGEmailLink -->
<!-- 
Report spam --><class="baseLinkColor" href="mailto:int@spamklage.dk" title="Report spam">Report&nbsp;spam</a>
?>

Vis: Class methods

EmailLink, Class methods

Her er 'klasse metoderne' for EmailLink klassen:

  • __construct
  • display
  • getParams
  • getHtml
  • getValue
  • setId
  • setOnfocus
  • setOnblur
  • id
  • 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

EmailLink, Object vars

Her er 'objekt variable' for EmailLink 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.2.6-1+lenny8) 1.11
blank.gif