Example #1
0
 public function __construct()
 {
     parent::__construct();
     $this->StyleSheets[] = new WebStyleSheet("~/StyleSheets/Main.css");
     $this->StyleSheets[] = new WebStyleSheet("http://static.alcehosting.net/dropins/WebFramework/StyleSheets/Professional/Main.css");
     $tenants = Tenant::Get();
     $tenantsNavigationButtons = array();
     foreach ($tenants as $tenant) {
         $tenantsNavigationButtons[] = new NavigationButton("~/tenant/modify/" . $tenant->URL, $tenant->URL, null, null, null);
     }
     $this->HeaderButtons = array();
     $this->SidebarButtons = array(new NavigationSeparator("Quick Start"), new NavigationButton("~/", "Dashboard", "dashboard"), new NavigationSeparator("Management"), new NavigationButton("~/tenant", "Tenants", "th-list", null, null, count($tenants), $tenantsNavigationButtons), new NavigationButton("~/modules", "Modules", "puzzle-piece", null, null, Module::Count()), new NavigationButton("~/data-centers", "Data Centers", "building-o", null, null, DataCenter::Count()), new NavigationButton("~/payment-plans", "Payment Plans", "money", null, null, PaymentPlan::Count()), new NavigationButton("~/organizations", "Organizations", "suitcase", null, null, Organization::Count()), new NavigationButton("~/users", "Users", "users", null, null, User::Count()), new NavigationButton("~/data-types", "Data Types", "sitemap", null, null, DataType::Count()), new NavigationButton("~/tenant-types", "Tenant Types", "tenant-types", null, null, TenantType::Count()), new NavigationSeparator("Help and Support"), new NavigationButton("~/support/documentation", "Documentation", "book"), new NavigationButton("~/support/bugspray", "Report a Bug", "bug"), new NavigationButton("~/system-log", "System Log", "file-text-o"));
     $this->RenderHeader = true;
     $this->RenderSidebar = true;
 }
Example #2
0
 /**
  * Retrieves a single DataType with the given name
  * @param string $name The name used in code to identify this DataType
  * @return NULL|\PhoenixSNS\Objects\DataType The DataType with the given name, or null if no DataType with the given name was found
  */
 public static function GetByName($name)
 {
     global $MySQL;
     $query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "DataTypes WHERE datatype_Name = '" . $MySQL->real_escape_string($name) . "'";
     $result = $MySQL->query($query);
     if ($result === false) {
         return null;
     }
     $count = $result->num_rows;
     if ($count == 0) {
         PhoenixSNS::Log("No data type with the specified name was found.", array("DataType" => $name));
         return null;
     }
     $values = $result->fetch_assoc();
     return DataType::GetByAssoc($values);
 }
Example #3
0
<?php

use PhoenixSNS\Objects\DataType;
use PhoenixSNS\Objects\MultipleInstanceProperty;
use PhoenixSNS\Objects\SingleInstanceProperty;
use PhoenixSNS\Objects\TenantObjectProperty;
use PhoenixSNS\Objects\TenantObjectInstanceProperty;
use PhoenixSNS\Objects\TenantObjectInstancePropertyValue;
use PhoenixSNS\Objects\TenantObjectMethodParameter;
use PhoenixSNS\Objects\TenantStringTableEntry;
$objAvatar2DSlice = $tenant->CreateObject("Avatar2DSlice", array(new TenantStringTableEntry($langEnglish, "Avatar 2D Slice")), array(new TenantStringTableEntry($langEnglish, "A movable portion (also known as a 'bone') of the two-dimensional avatar.")), array(new TenantObjectInstanceProperty("Title", DataType::GetByName("String")), new TenantObjectInstanceProperty("Left", DataType::GetByName("Measurement")), new TenantObjectInstanceProperty("Top", DataType::GetByName("Measurement")), new TenantObjectInstanceProperty("Width", DataType::GetByName("Measurement")), new TenantObjectInstanceProperty("Height", DataType::GetByName("Measurement")), new TenantObjectInstanceProperty("TransformOriginLeft", DataType::GetByName("Measurement")), new TenantObjectInstanceProperty("TransformOriginTop", DataType::GetByName("Measurement")), new TenantObjectInstanceProperty("ZIndex", DataType::GetByName("Number"))));
$objAvatar2DView = $tenant->CreateObject("Avatar2DView", array(new TenantStringTableEntry($langEnglish, "Avatar 2D View")), array(new TenantStringTableEntry($langEnglish, "A particular view of the two-dimensional avatar. Each avatar item should have at least one image that corresponds to at least one view. Therefore if you have a front and side view, you should have at least two images (front and side) for each item, or one image associated with both views.")), array(new TenantObjectInstanceProperty("Title", DataType::GetByName("String")), new TenantObjectInstanceProperty("Width", DataType::GetByName("Measurement")), new TenantObjectInstanceProperty("Height", DataType::GetByName("Measurement")), new TenantObjectInstanceProperty("Slices", DataType::GetByName("MultipleInstance"), new MultipleInstanceProperty(null, array($objAvatar2DSlice)))));
$objAvatar2DBase = $tenant->CreateObject("Avatar2DBase", array(new TenantStringTableEntry($langEnglish, "Avatar 2D Base")), array(new TenantStringTableEntry($langEnglish, "The two-dimensional base upon which all avatar items are overlaid. Bases can have multiple views, which allow different images per view for each item.")), array(new TenantObjectInstanceProperty("Author", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(null, array($tenant->GetObject("User")))), new TenantObjectInstanceProperty("Title", DataType::GetByName("String")), new TenantObjectInstanceProperty("Views", DataType::GetByName("MultipleInstance"), new MultipleInstanceProperty(null, array($objAvatar2DView)))));
$objAvatar2DItemImage = $tenant->CreateObject("Avatar2DItemImage", array(new TenantStringTableEntry($langEnglish, "Avatar 2D Item Image")), array(new TenantStringTableEntry($langEnglish, "An image for an item that can be displayed on a two-dimensional avatar.")), array(new TenantObjectInstanceProperty("Slice", DataType::GetByName("SingleInstance"), new MultipleInstanceProperty(null, array($objAvatar2DSlice)), "The slice to which the item image will be attached."), new TenantObjectInstanceProperty("FileNameExtension", DataType::GetByName("String")), new TenantObjectInstanceProperty("Left", DataType::GetByName("Measurement")), new TenantObjectInstanceProperty("Top", DataType::GetByName("Measurement")), new TenantObjectInstanceProperty("Width", DataType::GetByName("Measurement")), new TenantObjectInstanceProperty("Height", DataType::GetByName("Measurement")), new TenantObjectInstanceProperty("ZIndex", DataType::GetByName("Number"))));
$objAvatar2DItem = $tenant->CreateObject("Avatar2DItem", array(new TenantStringTableEntry($langEnglish, "Avatar 2D Item")), array(new TenantStringTableEntry($langEnglish, "An item that can be displayed on a two-dimensional avatar.")), array(new TenantObjectInstanceProperty("Author", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(null, array($tenant->GetObject("User")))), new TenantObjectInstanceProperty("Title", DataType::GetByName("String")), new TenantObjectInstanceProperty("Images", DataType::GetByName("MultipleInstance"), new MultipleInstanceProperty(null, array($objAvatar2DItemImage)))));
$objAvatar2D = $tenant->CreateObject("Avatar2D", array(new TenantStringTableEntry($langEnglish, "Avatar 2D")), array(new TenantStringTableEntry($langEnglish, "")), array(new TenantObjectInstanceProperty("Base", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(null, array($objAvatar2DBase))), new TenantObjectInstanceProperty("View", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(null, array($objAvatar2DView))), new TenantObjectInstanceProperty("Title"), new TenantObjectInstanceProperty("Content"), new TenantObjectInstanceProperty("PostType"), new TenantObjectInstanceProperty("CreationDate")));
<?php

use PhoenixSNS\Objects\DataType;
use PhoenixSNS\Objects\MultipleInstanceProperty;
use PhoenixSNS\Objects\SingleInstanceProperty;
use PhoenixSNS\Objects\TenantProperty;
use PhoenixSNS\Objects\TenantObjectProperty;
use PhoenixSNS\Objects\TenantObjectInstanceProperty;
use PhoenixSNS\Objects\TenantObjectInstancePropertyValue;
use PhoenixSNS\Objects\TenantObjectMethodParameter;
use PhoenixSNS\Objects\TenantQueryParameter;
use PhoenixSNS\Objects\TenantEnumerationChoice;
// Set up the basic configuration
$tenant->CreateProperty(new TenantProperty("ApplicationTitle", DataType::GetByName("Text"), "The title of the social network. This is displayed in various areas around the site.", "PhoenixSNS"));
$tenant->CreateProperty(new TenantProperty("ApplicationDescription", DataType::GetByName("Text"), "A short description of your social network. This will appear in search results and other areas that use the HTML META description attribute.", "A virtual world social network that anyone can join, powered by PhoenixSNS."));
$tenant->CreateProperty(new TenantProperty("ApplicationSlogan", DataType::GetByName("Text"), "A short attention-grabbing slogan for your social network.", "Connect. Build. Explore."));
// Install the resource bundles
$objResourceBundle = $tenant->GetObject("ResourceBundle");
$instRBCommon = $objResourceBundle->CreateInstance(array(new TenantObjectInstancePropertyValue($objResourceBundle->GetInstanceProperty("Name"), "Common")));
$instRBDefault = $objResourceBundle->CreateInstance(array(new TenantObjectInstancePropertyValue($objResourceBundle->GetInstanceProperty("Name"), "Default")));
$tenant->CreateProperty(new TenantProperty("ResourceBundles", DataType::GetByName("MultipleInstance"), "The resource bundles that are loaded with this tenant.", new MultipleInstanceProperty(array($instRBDefault), array($objResourceBundle))));
 protected function RenderContent()
 {
     $items = DataType::Get();
     $lv = new ListView();
     $lv->Columns = array(new ListViewColumn("chDataTypeName", "Name"), new ListViewColumn("chDataTypeDescription", "Description"));
     foreach ($items as $item) {
         $lv->Items[] = new ListViewItem(array(new ListViewItemColumn("chDataTypeName", "<a href=\"" . System::ExpandRelativePath("~/data-types/modify/" . $item->ID) . "\">" . $item->Name . "</a>"), new ListViewItemColumn("chDataTypeDescription", $item->Description)));
     }
     $lv->Render();
 }
<?php

use PhoenixSNS\Objects\DataType;
use PhoenixSNS\Objects\MultipleInstanceProperty;
use PhoenixSNS\Objects\SingleInstanceProperty;
use PhoenixSNS\Objects\TenantObjectProperty;
use PhoenixSNS\Objects\TenantObjectInstanceProperty;
use PhoenixSNS\Objects\TenantObjectInstancePropertyValue;
use PhoenixSNS\Objects\TenantObjectMethodParameter;
use PhoenixSNS\Objects\TenantEnumerationChoice;
use PhoenixSNS\Objects\TenantStringTableEntry;
$propResourceObjectName = new TenantObjectInstanceProperty("Name", DataType::GetByName("Text"));
$objResourceObject = $tenant->CreateObject("ResourceObject", array(new TenantStringTableEntry($langEnglish, "Resource Object")), array(new TenantStringTableEntry($langEnglish, "Represents a single resource object (StyleSheet, Script, etc.) that is loaded in a ResourceBundle on the PhoenixSNS tenant.")), array($propResourceObjectName), null, null, $propResourceObjectName);
$objStyleSheet = $tenant->CreateObject("StyleSheet", array(new TenantStringTableEntry($langEnglish, "StyleSheet Resource Object")), array(new TenantStringTableEntry($langEnglish, "Represents a style sheet resource object, containing a set of rules that determine how particular elements appear in a page.")), array(), $objResourceObject);
$objScriptResourceObject = $tenant->CreateObject("ScriptResourceObject", array(new TenantStringTableEntry($langEnglish, "Script Resource Object")), array(new TenantStringTableEntry($langEnglish, "Represents a script resource object, containing a single pointer to a ClientScript (executable code that can be run on the client).")), array(new TenantObjectInstanceProperty("ClientScript", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(array(), array($objClientScript)))), $objResourceObject);
$object = $tenant->CreateObject("ResourceBundle", array(new TenantStringTableEntry($langEnglish, "Resource Bundle")), array(new TenantStringTableEntry($langEnglish, "Contains a bundle of resources (StyleSheets, Scripts, etc.) that are loaded in with the PhoenixSNS tenant.")), array(new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")), new TenantObjectInstanceProperty("ResourceObjects", DataType::GetByName("MultipleInstance"), new MultipleInstanceProperty(array(), array($objResourceObject)))));
 /**
  * Creates a new TenantObjectInstanceProperty object based on the given values from the database.
  * @param array $values
  * @return TenantObjectInstanceProperty based on the values of the fields in the given associative array
  */
 public static function GetByAssoc($values)
 {
     $item = new TenantObjectInstanceProperty();
     $item->ID = $values["property_ID"];
     $item->ParentObject = TenantObject::GetByID($values["property_ObjectID"]);
     $item->Name = $values["property_Name"];
     $item->DataType = DataType::GetByID($values["property_DataTypeID"]);
     if ($item->DataType != null) {
         $item->DefaultValue = $item->DataType->Decode($values["property_DefaultValue"]);
     }
     $item->Required = $values["property_IsRequired"] == 1;
     $item->ColumnVisible = $values["property_ColumnVisible"] == 1;
     return $item;
 }
 public static function GetByAssoc($values)
 {
     $item = new TenantProperty();
     $item->ID = $values["property_ID"];
     $item->Tenant = Tenant::GetByID($values["property_TenantID"]);
     $item->Name = $values["property_Name"];
     $item->Description = $values["property_Description"];
     $item->DataType = DataType::GetByID($values["property_DataTypeID"]);
     $item->DefaultValue = $item->DataType->Decode($values["property_DefaultValue"]);
     return $item;
 }
Example #9
0
<?php

use PhoenixSNS\Objects\DataType;
use PhoenixSNS\Objects\MultipleInstanceProperty;
use PhoenixSNS\Objects\SingleInstanceProperty;
use PhoenixSNS\Objects\Tenant;
use PhoenixSNS\Objects\TenantObjectProperty;
use PhoenixSNS\Objects\TenantObjectInstanceProperty;
use PhoenixSNS\Objects\TenantObjectInstancePropertyValue;
use PhoenixSNS\Objects\TenantObjectMethodParameter;
use PhoenixSNS\Objects\TenantStringTableEntry;
use PhoenixSNS\Objects\TenantEnumerationChoice;
$enumUserProfileVisibility = $tenant->CreateEnumeration("UserProfileVisibility", "Specifies the possible values for the ProfileVisibility property on the User object.", array(new TenantEnumerationChoice("Everyone", "Your profile is visible to everyone inside and outside the site."), new TenantEnumerationChoice("Sitewide", "Your profile is visible only to other registered users."), new TenantEnumerationChoice("FriendsExtended", "Your profile is visible to your friends and friends of your friends."), new TenantEnumerationChoice("Friends", "Your profile is visible only to you and your friends."), new TenantEnumerationChoice("Private", "Your profile is visible only to you.")));
$enumUserPresenceStatus = $tenant->CreateEnumeration("UserPresenceStatus", "Specifies the possible values for the ProfileVisibility property on the User object.", array(new TenantEnumerationChoice("Offline", "You are not online."), new TenantEnumerationChoice("Available", "You are available for other people to chat with."), new TenantEnumerationChoice("Away", "You are away from your computer at the moment."), new TenantEnumerationChoice("ExtendedAway", "You are going to be away for an extended period of time."), new TenantEnumerationChoice("Busy", "You are busy and do not want to be bothered."), new TenantEnumerationChoice("Hidden", "Your presence status is hidden.")));
$object = $tenant->CreateObject("User", array(new TenantStringTableEntry($langEnglish, "User")), array(new TenantStringTableEntry($langEnglish, "Contains information about a PhoenixSNS user account.")), array(new TenantObjectInstanceProperty("LoginID", DataType::GetByName("Text")), new TenantObjectInstanceProperty("URL", DataType::GetByName("Text")), new TenantObjectInstanceProperty("DisplayName", DataType::GetByName("Text")), new TenantObjectInstanceProperty("EmailAddress", DataType::GetByName("Text")), new TenantObjectInstanceProperty("EmailConfirmationCode", DataType::GetByName("Text")), new TenantObjectInstanceProperty("BirthDate", DataType::GetByName("DateTime")), new TenantObjectInstanceProperty("RealName", DataType::GetByName("Text")), new TenantObjectInstanceProperty("PasswordHash", DataType::GetByName("Text")), new TenantObjectInstanceProperty("PasswordSalt", DataType::GetByName("Text")), new TenantObjectInstanceProperty("Theme", DataType::GetByName("SingleInstance")), new TenantObjectInstanceProperty("Language", DataType::GetByName("SingleInstance")), new TenantObjectInstanceProperty("ProfileVisibility", DataType::GetByName("SingleInstance")), new TenantObjectInstanceProperty("ConsecutiveLoginCount", DataType::GetByName("Number")), new TenantObjectInstanceProperty("ConsecutiveLoginFailures", DataType::GetByName("Number")), new TenantObjectInstanceProperty("LastLoginTimestamp", DataType::GetByName("DateTime")), new TenantObjectInstanceProperty("PresenceStatus", DataType::GetByName("SingleInstance")), new TenantObjectInstanceProperty("PresenceMessage", DataType::GetByName("Text")), new TenantObjectInstanceProperty("RegistrationTimestamp", DataType::GetByName("DateTime")), new TenantObjectInstanceProperty("RegistrationIPAddress", DataType::GetByName("IPAddress")), new TenantObjectInstanceProperty("StartPage", DataType::GetByName("SingleInstance"))));
$object->CreateMethod("SaltPassword", array(), <<<'EOD'
return \UUID::Generate();
EOD
, "Generates a PhoenixSNS password salt using a Universally Unique Identifier (UUID).");
$object->CreateMethod("HashPassword", array(new TenantObjectMethodParameter("input")), <<<'EOD'
return hash("sha512", $input);
EOD
, "Generates a PhoenixSNS password hash using the SHA-512 algorithm.");
$object->CreateMethod("ValidateCredentials", array(new TenantObjectMethodParameter("username"), new TenantObjectMethodParameter("password")), <<<'EOD'
$tenant = Tenant::GetCurrent();
$inst = $thisObject->GetInstance(array
(
	new TenantQueryParameter("LoginID", $username)
));

// if there is no user with this LoginID, return null
Example #10
0
<?php

use PhoenixSNS\Objects\DataType;
use PhoenixSNS\Objects\MultipleInstanceProperty;
use PhoenixSNS\Objects\SingleInstanceProperty;
use PhoenixSNS\Objects\TenantObjectProperty;
use PhoenixSNS\Objects\TenantObjectInstanceProperty;
use PhoenixSNS\Objects\TenantObjectInstancePropertyValue;
use PhoenixSNS\Objects\TenantObjectMethodParameter;
use PhoenixSNS\Objects\TenantEnumerationChoice;
use PhoenixSNS\Objects\TenantStringTableEntry;
$object = $tenant->CreateObject("Post", array(new TenantStringTableEntry($langEnglish, "Post")), array(new TenantStringTableEntry($langEnglish, "Represents any content posted by a user. This includes official content that appears on the front page of the site if your tenant is configured to show official posts.")), array(new TenantObjectInstanceProperty("Author", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(null, array($tenant->GetObject("User")))), new TenantObjectInstanceProperty("Title"), new TenantObjectInstanceProperty("Content"), new TenantObjectInstanceProperty("PostType"), new TenantObjectInstanceProperty("CreationDate")));
$object->CreateMethod("SetFeedback", array(), <<<'EOD'
echo('Post::SetFeedback - not implemented');
die();
EOD
, "Sets the personal feedback for the current user with respect to this post. Specify the feedback type (i.e. like, dislike, etc.) and optionally a short comment. The post will display the number of users with that type of feedback. You can configure how many feedback options are displayed. If there are more feedback options than this limit, they will appear as a drop-down menu alongside the primary option if the limit is 1, or as a separate 'More' option if the limit is greater than 1.");
$objUserDashboardPost = $tenant->CreateObject("MemberMainPageDashboardPost", array(new TenantStringTableEntry($langEnglish, "Member Main Page Dashboard Post")), array(new TenantStringTableEntry($langEnglish, "A post on the Dashboard for all members.")), array(), $tenant->GetObject("Post"));
$objUserDashboardPost = $tenant->CreateObject("GuestMainPageDashboardPost", array(new TenantStringTableEntry($langEnglish, "Guest Main Page Dashboard Post")), array(new TenantStringTableEntry($langEnglish, "A post on the Dashboard for people who are not logged in.")), array(), $tenant->GetObject("Post"));
$objUserDashboardPost = $tenant->CreateObject("UserDashboardPost", array(new TenantStringTableEntry($langEnglish, "User Dashboard Post")), array(new TenantStringTableEntry($langEnglish, "A post on a user's Dashboard. The post will be visible on the dashboards of all the users in the Receivers.")), array(new TenantObjectInstanceProperty("Receivers", DataType::GetByName("MultipleInstance"), new MultipleInstanceProperty(array(), array($tenant->GetObject("User"))))), $tenant->GetObject("Post"));
Example #11
0
use PhoenixSNS\Objects\DataType;
use PhoenixSNS\Objects\MultipleInstanceProperty;
use PhoenixSNS\Objects\SingleInstanceProperty;
use PhoenixSNS\Objects\TenantObjectProperty;
use PhoenixSNS\Objects\TenantObjectInstanceProperty;
use PhoenixSNS\Objects\TenantObjectInstancePropertyValue;
use PhoenixSNS\Objects\TenantObjectMethodParameter;
use PhoenixSNS\Objects\TenantStringTableEntry;
$objUserAgent = $tenant->CreateObject("UserAgent", array(new TenantStringTableEntry($langEnglish, "User Agent")), array(new TenantStringTableEntry($langEnglish, "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", array(new TenantStringTableEntry($langEnglish, "User Agent Behavior")), array(new TenantStringTableEntry($langEnglish, "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", array(new TenantStringTableEntry($langEnglish, "Page Section")), array(new TenantStringTableEntry($langEnglish, "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", array(new TenantStringTableEntry($langEnglish, "Page")), array(new TenantStringTableEntry($langEnglish, "Represents an individual Page on the tenant. Pages have URLs (such as ~/dashboard or ~/account/login) and host one or more PageSections.")), array(new TenantObjectInstanceProperty("Name"), new TenantObjectInstanceProperty("URL"), new TenantObjectInstanceProperty("Sections", DataType::GetByName("MultipleInstance"), new MultipleInstanceProperty(array(), array($objPageSection)))));
$instSectGuestMainPageDashboardPanel = $objPageSection->CreateInstance(array(new TenantObjectInstancePropertyValue($objPageSection->GetInstanceProperty("Name"), "GuestMainPageDashboardPanel"), new TenantObjectInstancePropertyValue($objPageSection->GetInstanceProperty("Content"), <<<'EOD'
<?php
	use PhoenixSNS\Objects\Tenant;
	
	// get the dashboard posts
	$tenant = Tenant::GetCurrent();
	$objDashboardPost = $tenant->GetObject("GuestMainPageDashboardPost");
	$posts = $objDashboardPost->GetInstances();
	
	if (count($posts) == 0)
	{
?>
<div class="Card">
	<div class="Title">There's nothing here!</div>
	<div class="Content">
 /**
  * Creates a new TenantObjectProperty object based on the given values from the database.
  * @param array $values
  * @return \PhoenixSNS\Objects\TenantObjectProperty based on the values of the fields in the given associative array
  */
 public static function GetByAssoc($values)
 {
     $item = new TenantObjectProperty();
     $item->ID = $values["property_ID"];
     $item->Tenant = Tenant::GetByID($values["property_TenantID"]);
     $item->ParentObject = TenantObject::GetByID($values["property_ObjectID"]);
     $item->Name = $values["property_Name"];
     $item->Description = $values["property_Description"];
     $item->DataType = DataType::GetByID($values["property_DataTypeID"]);
     $item->DefaultValue = $values["property_DefaultValue"];
     $item->Required = $values["property_IsRequired"] == 1;
     $item->Enumeration = TenantEnumeration::GetByID($values["property_EnumerationID"]);
     $item->RequireChoiceFromEnumeration = $values["property_RequireChoiceFromEnumeration"] == 1;
     return $item;
 }
Example #13
0
                     $page = new TenantObjectMethodManagementPage();
                     $page->CurrentTenant = Tenant::GetByURL($path[0]);
                     $page->CurrentObject = TenantObject::GetByID($path[2]);
                     $page->CurrentMethod = TenantObjectInstanceMethod::GetByID($path[5]);
                     $page->Render();
                     break;
             }
             break;
         case "":
             $tenant = Tenant::GetByURL($path[0]);
             $object = TenantObject::GetByID($path[2]);
             if ($_SERVER["REQUEST_METHOD"] == "POST") {
                 $count = $_POST["InstanceProperty_NewPropertyCount"];
                 for ($i = $count; $i > 0; $i--) {
                     $name = $_POST["InstanceProperty_" . $i . "_Name"];
                     $dataType = DataType::GetByID($_POST["InstanceProperty_" . $i . "_DataTypeID"]);
                     $defaultValue = $_POST["InstanceProperty_" . $i . "_DefaultValue"];
                     $object->CreateInstanceProperty(new TenantObjectInstanceProperty($name, $dataType, $defaultValue));
                 }
                 System::Redirect("~/tenant/manage/" . $tenant->URL . "/objects/" . $object->ID);
                 return true;
             } else {
                 $page = new TenantObjectManagementPage();
                 $page->CurrentTenant = $tenant;
                 $page->CurrentObject = $object;
                 $page->Render();
             }
             break;
     }
 }
 break;
Example #14
0
<?php

use PhoenixSNS\Objects\DataType;
use PhoenixSNS\Objects\MultipleInstanceProperty;
use PhoenixSNS\Objects\SingleInstanceProperty;
use PhoenixSNS\Objects\Tenant;
use PhoenixSNS\Objects\TenantObjectProperty;
use PhoenixSNS\Objects\TenantObjectInstanceProperty;
use PhoenixSNS\Objects\TenantObjectInstancePropertyValue;
use PhoenixSNS\Objects\TenantObjectMethodParameter;
use PhoenixSNS\Objects\TenantStringTableEntry;
use PhoenixSNS\Objects\TenantEnumerationChoice;
$tenant = Tenant::GetByID(1);
$objScriptLanguage = $tenant->CreateObject("ScriptLanguage", array(new TenantStringTableEntry($langEnglish, "Script Language")), array(new TenantStringTableEntry($langEnglish, "A programming language used to write scripts.")), array(new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")), new TenantObjectInstanceProperty("ContentType", DataType::GetByName("Text"))));
$objClientScriptLanguage = $tenant->CreateObject("ClientScriptLanguage", array(new TenantStringTableEntry($langEnglish, "Client Script Language")), array(new TenantStringTableEntry($langEnglish, "A programming language used to write scripts to be run on the client.")), array(new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")), new TenantObjectInstanceProperty("ContentType", DataType::GetByName("Text"))), $objScriptLanguage, array(array(new TenantObjectInstancePropertyValue(TenantObjectInstanceProperty::GetByName("Name"), "JavaScript"), new TenantObjectInstancePropertyValue(TenantObjectInstanceProperty::GetByName("ContentType"), "text/javascript")), array(new TenantObjectInstancePropertyValue(TenantObjectInstanceProperty::GetByName("Name"), "VBScript"), new TenantObjectInstancePropertyValue(TenantObjectInstanceProperty::GetByName("ContentType"), "text/vbscript"))));
$objServerScriptLanguage = $tenant->CreateObject("ServerScriptLanguage", array(new TenantStringTableEntry($langEnglish, "Server Script Language")), array(new TenantStringTableEntry($langEnglish, "A programming language used to write scripts to be run on the server.")), array(new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")), new TenantObjectInstanceProperty("ContentType", DataType::GetByName("Text"))), $objScriptLanguage, array(array(new TenantObjectInstancePropertyValue(TenantObjectInstanceProperty::GetByName("Name"), "PHP"), new TenantObjectInstancePropertyValue(TenantObjectInstanceProperty::GetByName("ContentType"), "application/x-php"))));
$objScript = $tenant->CreateObject("Script", array(new TenantStringTableEntry($langEnglish, "Script")), array(new TenantStringTableEntry($langEnglish, "A code blob that can be used in various scriptable areas.")), array(new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")), new TenantObjectInstanceProperty("Description", DataType::GetByName("Text")), new TenantObjectInstanceProperty("Language", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(null, array($objScriptLanguage))), new TenantObjectInstanceProperty("Content", DataType::GetByName("CodeBlob"))));
$objClientScript = $tenant->CreateObject("ClientScript", array(new TenantStringTableEntry($langEnglish, "Client Script")), array(new TenantStringTableEntry($langEnglish, "A code blob that can be used in various scriptable areas on the client.")), array(new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")), new TenantObjectInstanceProperty("Description", DataType::GetByName("Text")), new TenantObjectInstanceProperty("Language", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(null, array($objClientScriptLanguage))), new TenantObjectInstanceProperty("Content", DataType::GetByName("CodeBlob"))), $objScript);
$objServerScript = $tenant->CreateObject("ServerScript", array(new TenantStringTableEntry($langEnglish, "Server Script")), array(new TenantStringTableEntry($langEnglish, "A code blob that can be used in various scriptable areas on the server.")), array(new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")), new TenantObjectInstanceProperty("Description", DataType::GetByName("Text")), new TenantObjectInstanceProperty("Language", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(null, array($objServerScriptLanguage))), new TenantObjectInstanceProperty("Content", DataType::GetByName("CodeBlob"))), $objScript);