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

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

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

        if (strtolower($attribs['TEXT']) != "homepage") return;
        if (!isset($GLOBALS['profile_load'])) return;

        $id    = $attribs['ID'];
        $value = $attribs['VALUE'];

        $GLOBALS['profile_load']->add_attrib(
                            "homepage", array( 'homepage'  => $value ), $id);
    }

    function get_help($type) {
        if ($type == 'long')
            return "Enter your homepage.";

        if ($type == 'short')
            return "Homepage: <i>e.g. http://james.seng.cc/</i>";

        return get_class($this);
    }

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

?>
