<?php
#
# Copyright 2003 James Seng. See LICENSE for the Software License.
#

class lastname extends attrib_base {
    function save($fh,$indent) {
        fwrite($fh,$this->opml_outline_profile("lastname",$indent));
        fwrite($fh,$this->opml_outline_end("lastname",$indent));
    }

    function element_start($parser,$name,$attribs) {
        global $profile_name;

        if (strtolower($attribs['TEXT']) != "lastname") return;
        if (!isset($GLOBALS['profile_name'])) return;
        if (!isset($profile_name->submod)) return;
        if (!isset($profile_name->submod['lastname'])) return;

        $profile_name->submod['lastname']->set($attribs['VALUE']);
    }

    function html_form_profile() {
        $get = $this->get();
        $id = $this->getid();
        return <<<_HTML_FORM_PROFILE_
    <font class="title">Last</font>
    <input class="customize" name="lastname$id" value="$get" size="11">

_HTML_FORM_PROFILE_;
    }

    function foaf_profile($fn) {
        $givename = $this->get();
        fwrite($fn,"  <foaf:givename>$givename</foaf:givename>\n");
    }
}

?>
