CreateObject("UserAgent", "A User Agent that can determine what browser or client the guest is using to access the Web site.", array ( new TenantObjectInstanceProperty("Name"), new TenantObjectInstanceProperty("Value") )); $objUserAgentBehavior = $tenant->CreateObject("UserAgentBehavior", "The behavior to use when determining whether a list of user agents is allowed (whitelist) or denied (blacklist).", array ( new TenantObjectInstanceProperty("Name") )); $propUserAgents = new TenantObjectInstanceProperty("UserAgents", DataType::GetByName("MultipleInstance"), new MultipleInstanceProperty(array(), array($objUserAgent))); $propUserAgents->Description = "If one or more UserAgents are specified in this property, depending on the UserAgentBehavior this PageSection will display ONLY on these UserAgents."; $propUserAgentBehavior = new TenantObjectInstanceProperty("UserAgentBehavior", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(array(), array($objUserAgentBehavior))); $objPageSection = $tenant->CreateObject("PageSection", "Represents a section of a Page on the tenant. Sections can be assigned to one or more Pages, and can be duplicated within the same Page.", array ( new TenantObjectInstanceProperty("Name"), new TenantObjectInstanceProperty("Content"), $propUserAgents, $propUserAgentBehavior )); $object = $tenant->CreateObject("Page", "Represents an individual Page on the tenant. Pages have URLs (such as ~/dashboard or ~/account/login) and host one or more PageSections.", array ( // property name, data type, default value, value required?, enumeration, require choice from enumeration? new TenantObjectInstanceProperty("Name"), new TenantObjectInstanceProperty("URL"), new TenantObjectInstanceProperty("Sections", DataType::GetByName("MultipleInstance"), new MultipleInstanceProperty(array(), array($objPageSection))) )); $instSectGuestMainPageDashboardPanel = $objPageSection->CreateInstance(array ( new TenantObjectInstancePropertyValue("Name", "GuestMainPageDashboardPanel"), new TenantObjectInstancePropertyValue("Content", <<<'EOD' GetObject("GuestMainPageDashboardPost"); $posts = $objDashboardPost->GetInstances(); if (count($posts) == 0) { ?>
There's nothing here!
If you are the site administrator, please make sure you have configured your Objectify installation correctly. Log in to your Administrator Control Panel to set up your installation and add content.
EOD ) )); $instSectGuestMainPageRegisterPanel = $objPageSection->CreateInstance(array ( new TenantObjectInstancePropertyValue("Name", "GuestMainPageRegisterPanel"), new TenantObjectInstancePropertyValue("Content", <<<'EOD'
" method="POST" style="width: 100%;">
Don't have an account yet?

Sign up for free right now!

EOD ) )); $instSectGuestMainPageLoginPanel = $objPageSection->CreateInstance(array ( new TenantObjectInstancePropertyValue("Name", "GuestMainPageLoginPanel"), new TenantObjectInstancePropertyValue("Content", <<<'EOD'
" method="POST" style="width: 100%;">
Already have an account?
EOD ) )); $instGuestMainPage = $object->CreateInstance(array ( new TenantObjectInstancePropertyValue("Name", "GuestMainPage"), new TenantObjectInstancePropertyValue("Sections", new MultipleInstanceProperty ( array ( $instSectGuestMainPageDashboardPanel, $instSectGuestMainPageLoginPanel, $instSectGuestMainPageRegisterPanel ), array($objPageSection) )) )); $object->CreateInstanceMethod("GetSections", array(), // code goes here... you cannot "use" namespaces here; please put them in NamespaceReferences!!! <<<'EOD' $thisTenant = Tenant::GetCurrent(); $objPageSection = $thisTenant->GetObject("PageSection"); $insts = $objPageSection->GetInstances(array ( new TenantQueryParameter("Page", $thisInstance) )); EOD , "Gets all of the PageSections associated with the current Page.", array( "Tenant", "TenantQueryParameter" )); ?>