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

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

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

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

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

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

_HTML_FORM_PROFILE_;
    }

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

?>
