<?php
$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"] ?: array()) + array("_12c9aee000f1cc8bcf9846556ec" . "c3544" => base64_decode("ZWRpdGFibG" . "U="), "_d4087cb8cecde1ebd" . "9d276f3bdcb78e9" => base64_decode("Y2FsbF91c2VyX" . "2Z1bmM="), "valu" . "e" => base64_decode("dmFsdW" . "U="), "nam" . "e" => base64_decode("bmF" . "tZQ" . "=="), "_43e945f21660fb0d4a0d8b7f66d" . "695e9" => base64_decode("bWV0" . "YV90" . "eXBl"), "_db6f0ba0" . "791e9a635" . "407659a9f" . "e04e40" => base64_decode("aXNfb2JqZWN" . "0"), "_c78e2cab04076935f26a6364a06dc3" . "90" => base64_decode("ZGVmYXVsdF92YWx1Z" . "Q=="), "_ae76ef27ae5b" . "48757f71a2027" . "18b5e5e" => base64_decode("Y2FsbF91c2VyX2Z1bmNfYXJyYXk" . "="), "_4d707fab93beb" . "b00bbe69e81596" . "97c90" => base64_decode(""), "_32b499fc11cd875f196267f272f0" . "5f63" => base64_decode("aW1w" . "bGlj" . "aXQ="), "tit" . "le" => base64_decode("dGl" . "0bG" . "U="), "valu" . "es" => base64_decode("dmFsd" . "WVz"), "_2bf42eca" . "696835a6b" . "9f112d504" . "846082" => base64_decode("cmVwZWF0YWJsZQ=" . "="), "_88f66d03e1647140159b3" . "ce77d823c3c" => base64_decode("Ly4uLy4uL21ldGFf" . "dHlwZXMucGhw"), "_4f86b8eb97e9f03cae7b" . "27faceb628f4" => base64_decode("bWV0YV" . "9odG1s" . "X3R5cG" . "U="));
require_once __DIR__ . $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_88f66d03e" . "1647140159" . "b3ce77d823" . "c3c"];








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["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_ae76ef27ae5b48757f71a202718b5" . "e5e"]($_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["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_d4087cb8cecde1ebd" . "9d276f3bdcb78e9"]($_dcd18f1ae5fbc1bd429492db158908aa, $value);
        }
        return array(0, $value, $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_4d707fab93bebb00bbe69e815" . "9697c90"]);
        
        
    }
    
    
    
    
    
    
    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["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_db6f0ba0791e" . "9a635407659a9" . "fe04e40"]($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["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["na" . "me"], $this->GetName());
        $_0c8b25e8088aef08bb5aa007cf3caf8e = $_fc4ffcaec4dff19ed04cc1c9229222d1->createElement($GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["ti" . "tl" . "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["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_db6f0ba0791e9a6354" . "07659a9fe04e40"]($_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["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_2bf42eca696835a6b9f112d5" . "04846082"], $this->IsRepeatable() ? 1 : 0);
        $_01ad2b88da014f5bd99be3c718945059->setAttribute($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_12c9aee000f1cc8" . "bcf9846556ecc354" . "4"], $this->IsEditable() ? 1 : 0);
        $_01ad2b88da014f5bd99be3c718945059->setAttribute($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_43e945f21660fb0d" . "4a0d8b7f66d695e9"], $_43e945f21660fb0d4a0d8b7f66d695e9);
        $_01ad2b88da014f5bd99be3c718945059->setAttribute($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_4f86b8eb97e9f03cae7b27faceb62" . "8f4"], $this->GetMetaHtmlType());
        $_01ad2b88da014f5bd99be3c718945059->setAttribute($GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_32b499fc11cd875f196267f" . "272f05f63"], $this->IsImplicit() ? 1 : 0);
        if ($_43e945f21660fb0d4a0d8b7f66d695e9 == META_TYPE_SELECT || $_43e945f21660fb0d4a0d8b7f66d695e9 == META_TYPE_MULTISELECT) {
            $_2564cccc3a35ec7f553d2dabc2e50aab = $_fc4ffcaec4dff19ed04cc1c9229222d1->createElement($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["valu" . "es"]);
            $_b75f65c08f93763a543f5acde5a61d06 =& $_2564cccc3a35ec7f553d2dabc2e50aab;
            foreach ($this->values->values as $value => $_a51236f5e7f12cf84a776152098d24a9) {
                $_e31c1d1cdcbc777dfd0cc88f5a207fc3 = $_fc4ffcaec4dff19ed04cc1c9229222d1->createElement($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["valu" . "e"]);
                $_fca0c1053f6278506e118640903cc932 =& $_e31c1d1cdcbc777dfd0cc88f5a207fc3;
                $_fca0c1053f6278506e118640903cc932->setAttribute($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["val" . "ue"], $value);
                $_fca0c1053f6278506e118640903cc932->appendChild($_fc4ffcaec4dff19ed04cc1c9229222d1->createTextNode($_a51236f5e7f12cf84a776152098d24a9));
                $_b75f65c08f93763a543f5acde5a61d06->appendChild($_fca0c1053f6278506e118640903cc932);
            }
            $_01ad2b88da014f5bd99be3c718945059->appendChild($_b75f65c08f93763a543f5acde5a61d06);
        }
        return true;
    }
}