<?php
$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"] = (@$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"] ?: array()) + array("_d4087cb8cecde1ebd9d276f3bdcb" . "78e9" => base64_decode("Y2FsbF91c2VyX2Z1bm" . "M="), "_43e945f21660fb0d4a0d8b7f66d695e" . "9" => base64_decode("bWV0YV90eX" . "Bl"), "_db6f0ba0791e9a635407659a9fe" . "04e40" => base64_decode("aXNfb2JqZWN" . "0"), "_12c9aee000f1cc8bcf98" . "46556ecc3544" => base64_decode("ZWR" . "pdG" . "Fib" . "GU="), "valu" . "es" => base64_decode("dmFsdW" . "Vz"), "_2bf42eca696" . "835a6b9f112d" . "504846082" => base64_decode("cmVwZWF0YW" . "JsZQ=="), "_4d707fab93bebb00bbe69e81" . "59697c90" => base64_decode(""), "va" . "lu" . "e" => base64_decode("dmFsdWU" . "="), "_88f66d03e1647140159b3ce77" . "d823c3c" => base64_decode("Ly4uLy4uL21ld" . "GFfdHlwZXMucG" . "hw"), "n" . "a" . "m" . "e" => base64_decode("bmFtZQ" . "=="), "_c78e2cab04076935f26a6364a06dc" . "390" => base64_decode("ZGVmYXVsdF92YWx1" . "ZQ=="), "_ae76ef27ae5b48" . "757f71a202718b5" . "e5e" => base64_decode("Y2FsbF91c" . "2VyX2Z1bm" . "NfYXJyYXk" . "="), "titl" . "e" => base64_decode("dGl0b" . "GU="), "_4f86b8eb97e9f03cae7b27faceb6" . "28f4" => base64_decode("bWV0YV9odG1sX3" . "R5cGU="), "_32b499fc11cd875f196267f272f05f" . "63" => base64_decode("aW1w" . "bGlj" . "aXQ="));
require_once __DIR__ . $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_88f66d03e1647140159b3ce77d82" . "3c3c"];








class MetaFieldPrototype extends ErrorHandler
{
    var $name;
    var $title;
    var $editable = true;
    var $default_value;
    var $repeatable = false;
    var $meta_type = META_TYPE_DEFAULT;
    var $meta_html_type = HTML_COMPONENT_TEXTAREA;
    
    
    
    
    var $values = null;
    var $visible = true;
    var $implicit = false;
    var $searchable = false;
    var $mandatory = false;
    var $inheritable = false;
    var $is_system = false;
    public function __construct()
    {
    }
    
    
    
    
    
    
    public function GetName()
    {
        return $this->name;
    }
    
    
    
    
    
    
    public function GetTitle()
    {
        return $this->title;
    }
    
    
    
    
    
    
    
    
    public function UseGetWrapper($values, $type = -1)
    {
        if ($type == -1) {
            $type = $this->GetMetaType();
        }
        global $META_TYPE_CALLBACK;
        $_dcd18f1ae5fbc1bd429492db158908aa = $META_TYPE_CALLBACK[$type][0];
        if ($_dcd18f1ae5fbc1bd429492db158908aa) {
            return $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_ae76ef27ae5b48757f71" . "a202718b5e5e"]($_dcd18f1ae5fbc1bd429492db158908aa, $values);
        }
        return $values[1];
        
        
    }
    
    
    
    
    
    
    
    
    
    public function UseSetWrapper($value, $type = -1)
    {
        if ($type == -1) {
            $type = $this->GetMetaType();
        }
        global $META_TYPE_CALLBACK;
        $_dcd18f1ae5fbc1bd429492db158908aa = $META_TYPE_CALLBACK[$type][1];
        if ($_dcd18f1ae5fbc1bd429492db158908aa) {
            return $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_d4087cb8cecde1ebd9d27" . "6f3bdcb78e9"]($_dcd18f1ae5fbc1bd429492db158908aa, $value);
        }
        return array(0, $value, $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_4d707fab93bebb00bbe69e8159697" . "c90"]);
        
        
    }
    
    
    
    
    
    
    public function GetDefaultValue()
    {
        if ($this->default_value === null) {
            return null;
        }
        return $this->UseGetWrapper(array($this->default_value, $this->default_value, $this->default_value));
    }
    
    
    
    
    
    
    public function GetMetaType()
    {
        return $this->meta_type;
    }
    
    
    
    
    
    
    public function GetMetaHtmlType()
    {
        return $this->meta_html_type;
    }
    
    
    
    
    
    
    public function GetAllValues()
    {
        if ($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_db6f0ba0791e9a635407659a9fe04e" . "40"]($this->values)) {
            return $this->values->GetAllValues();
        } else {
            return array();
        }
    }
    
    
    
    
    
    
    public function GetDBFieldName()
    {
        global $META_TYPE_DB_MAP;
        $_c8b8645bdd969f28aa6dddecbdc4216b = $META_TYPE_DB_MAP[$this->GetMetaType()];
        if (!$_c8b8645bdd969f28aa6dddecbdc4216b) {
            $_c8b8645bdd969f28aa6dddecbdc4216b = $META_TYPE_DB_MAP[META_TYPE_DEFAULT];
        }
        return $_c8b8645bdd969f28aa6dddecbdc4216b;
    }
    
    
    
    
    public function IsRepeatable()
    {
        return $this->repeatable;
    }
    
    
    
    
    public function IsEditable()
    {
        return $this->editable;
    }
    
    
    
    
    public function IsImplicit()
    {
        return $this->implicit;
    }
    
    
    
    
    public function IsVisible()
    {
        return $this->visible;
    }
    
    
    
    
    public function IsInheritable()
    {
        return $this->inheritable;
    }
    
    
    
    
    public function IsMandatory()
    {
        return $this->mandatory;
    }
    
    
    
    
    
    
    
    public function Export(DOMNode $_01ad2b88da014f5bd99be3c718945059)
    {
        $_fc4ffcaec4dff19ed04cc1c9229222d1 = $_01ad2b88da014f5bd99be3c718945059->ownerDocument;
        $_01ad2b88da014f5bd99be3c718945059->setAttribute($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["na" . "me"], $this->GetName());
        $_0c8b25e8088aef08bb5aa007cf3caf8e = $_fc4ffcaec4dff19ed04cc1c9229222d1->createElement($GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["t" . "i" . "t" . "l" . "e"]);
        $_1bbad6caaa460fa8ec8ab085a2181675 =& $_0c8b25e8088aef08bb5aa007cf3caf8e;
        $_18409c82c1e5ec574a895d8b95157b93 = $_fc4ffcaec4dff19ed04cc1c9229222d1->createTextNode($this->GetTitle());
        $_092ec6e95cb26d65001e0947825f715d =& $_18409c82c1e5ec574a895d8b95157b93;
        $_1bbad6caaa460fa8ec8ab085a2181675->appendChild($_092ec6e95cb26d65001e0947825f715d);
        $_01ad2b88da014f5bd99be3c718945059->appendChild($_1bbad6caaa460fa8ec8ab085a2181675);
        $_43e945f21660fb0d4a0d8b7f66d695e9 = $this->GetMetaType();
        $_fd9a001fe52a8a128ed79f490b895f76 = $_fc4ffcaec4dff19ed04cc1c9229222d1->createElement($GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_c78e2cab04076935f26" . "a6364a06dc390"]);
        $_f19b19c1cd042352369bc6920de25b88 =& $_fd9a001fe52a8a128ed79f490b895f76;
        $_43ac024c655665d883645a24a8b20230 = $this->GetDefaultValue();
        if ($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_db6f0ba0791e" . "9a635407659a9" . "fe04e40"]($_43ac024c655665d883645a24a8b20230)) {
            if ($_43e945f21660fb0d4a0d8b7f66d695e9 == META_TYPE_DATETIME) {
                $_43ac024c655665d883645a24a8b20230 = $_43ac024c655665d883645a24a8b20230->getDate(DATE_FORMAT_TIMESTAMP);
            } elseif ($_43e945f21660fb0d4a0d8b7f66d695e9 == META_TYPE_DATE) {
                $_43ac024c655665d883645a24a8b20230 = $_43ac024c655665d883645a24a8b20230->getDate(DATE_FORMAT_DATE_DAY);
            } elseif ($_43e945f21660fb0d4a0d8b7f66d695e9 == META_TYPE_DATE_NO_YEAR) {
                $_43ac024c655665d883645a24a8b20230 = $_43ac024c655665d883645a24a8b20230->getDate(DATE_FORMAT_DATE_DAY);
            }
        }
        $_3ab728f4b2af787f1c72a357e9acc5b9 = $_fc4ffcaec4dff19ed04cc1c9229222d1->createTextNode($_43ac024c655665d883645a24a8b20230);
        $_2db92bb9f1e2909ebdab5ddb423aafe3 =& $_3ab728f4b2af787f1c72a357e9acc5b9;
        $_f19b19c1cd042352369bc6920de25b88->appendChild($_2db92bb9f1e2909ebdab5ddb423aafe3);
        $_01ad2b88da014f5bd99be3c718945059->appendChild($_f19b19c1cd042352369bc6920de25b88);
        $_01ad2b88da014f5bd99be3c718945059->setAttribute($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_2bf42eca6" . "96835a6b9f" . "112d504846" . "082"], $this->IsRepeatable() ? 1 : 0);
        $_01ad2b88da014f5bd99be3c718945059->setAttribute($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_12c9aee000f1c" . "c8bcf9846556ec" . "c3544"], $this->IsEditable() ? 1 : 0);
        $_01ad2b88da014f5bd99be3c718945059->setAttribute($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_43e945f21660fb0d4a" . "0d8b7f66d695e9"], $_43e945f21660fb0d4a0d8b7f66d695e9);
        $_01ad2b88da014f5bd99be3c718945059->setAttribute($GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_4f86b8eb97e9f03c" . "ae7b27faceb628f4"], $this->GetMetaHtmlType());
        $_01ad2b88da014f5bd99be3c718945059->setAttribute($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_32b499fc11cd875f196267f272f0" . "5f63"], $this->IsImplicit() ? 1 : 0);
        if ($_43e945f21660fb0d4a0d8b7f66d695e9 == META_TYPE_SELECT || $_43e945f21660fb0d4a0d8b7f66d695e9 == META_TYPE_MULTISELECT) {
            $_2564cccc3a35ec7f553d2dabc2e50aab = $_fc4ffcaec4dff19ed04cc1c9229222d1->createElement($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["valu" . "es"]);
            $_b75f65c08f93763a543f5acde5a61d06 =& $_2564cccc3a35ec7f553d2dabc2e50aab;
            foreach ($this->values->values as $value => $_a51236f5e7f12cf84a776152098d24a9) {
                $_e31c1d1cdcbc777dfd0cc88f5a207fc3 = $_fc4ffcaec4dff19ed04cc1c9229222d1->createElement($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["valu" . "e"]);
                $_fca0c1053f6278506e118640903cc932 =& $_e31c1d1cdcbc777dfd0cc88f5a207fc3;
                $_fca0c1053f6278506e118640903cc932->setAttribute($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["val" . "ue"], $value);
                $_fca0c1053f6278506e118640903cc932->appendChild($_fc4ffcaec4dff19ed04cc1c9229222d1->createTextNode($_a51236f5e7f12cf84a776152098d24a9));
                $_b75f65c08f93763a543f5acde5a61d06->appendChild($_fca0c1053f6278506e118640903cc932);
            }
            $_01ad2b88da014f5bd99be3c718945059->appendChild($_b75f65c08f93763a543f5acde5a61d06);
        }
        return true;
    }
}