Removing PHP User Interface in favor of StudioAnywhere

This commit is contained in:
Michael Becker 2015-04-17 13:03:52 -04:00
parent 6c3e3eaf5e
commit 817dec2f96
48 changed files with 0 additions and 5153 deletions

View File

@ -1,10 +0,0 @@
RewriteEngine On
# Do not remove this line, otherwise mod_rewrite rules will stop working
RewriteBase /
RewriteRule ^StyleSheets/(.*)\.css$ lessc.php?filename=$1 [PT,L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?virtualpath=$1 [PT,L,QSA]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

View File

@ -1,23 +0,0 @@
<?php
namespace Objectify\Tenant\MasterPages;
use WebFX\WebStyleSheet;
use WebFX\System;
class WebPage extends \WebFX\WebPage
{
public function __construct()
{
parent::__construct();
$this->StyleSheets[] = new WebStyleSheet("http://static.alcehosting.net/dropins/WebFramework/StyleSheets/Workday/Main.css");
}
protected function BeforeContent()
{
?>
<div style="text-align: right;"><a href="<?php echo(System::ExpandRelativePath("~/account/logout.page")); ?>">Log Out</a></div>
<?php
}
}
?>

View File

@ -1,665 +0,0 @@
<?php
use WebFX\System;
use WebFX\Module;
use WebFX\ModulePage;
use WebFX\Controls\ButtonGroup;
use WebFX\Controls\ButtonGroupButton;
use Objectify\Tenant\MasterPages\WebPage;
use Objectify\Tenant\Pages\LoginPage;
use Objectify\Tenant\Pages\MainPage;
use Objectify\Tenant\Pages\ModuleMainPage;
use Objectify\Tenant\Pages\ModuleManagementPage;
use Objectify\Tenant\Pages\TenantPropertiesPage;
use Objectify\Tenant\Pages\TenantManagementPage;
use Objectify\Tenant\Pages\TenantModuleManagementPage;
use Objectify\Tenant\Pages\TenantObjectManagementPage;
use Objectify\Tenant\Pages\TenantObjectInstanceBrowsePage;
use Objectify\Tenant\Pages\DataCenterMainPage;
use Objectify\Tenant\Pages\DataCenterManagementPage;
use Objectify\Tenant\Pages\TenantObjectMethodManagementPage;
use Objectify\Tenant\Pages\ConfirmOperationPage;
use Objectify\Objects\DataCenter;
use Objectify\Objects\DataType;
use Objectify\Objects\PaymentPlan;
use Objectify\Objects\Tenant;
use Objectify\Objects\TenantObject;
use Objectify\Objects\TenantObjectMethod;
use Objectify\Objects\TenantObjectInstanceMethod;
use Objectify\Objects\TenantObjectInstanceProperty;
use Objectify\Objects\TenantStatus;
use Objectify\Objects\TenantType;
use Objectify\Objects\TenantObjectMethodParameterValue;
function IsConfigured()
{
if (!(
isset(System::$Configuration["Database.ServerName"]) &&
isset(System::$Configuration["Database.DatabaseName"]) &&
isset(System::$Configuration["Database.UserName"]) &&
isset(System::$Configuration["Database.Password"]) &&
isset(System::$Configuration["Database.TablePrefix"])
))
{
return false;
}
global $MySQL;
$query = "SHOW TABLES LIKE '" . System::$Configuration["Database.TablePrefix"] . "Tenants'";
$result = $MySQL->query($query);
if ($result->num_rows < 1) return false;
return true;
}
function CheckCredentials($admun, $admpw)
{
return ($admun == System::GetConfigurationValue("Administration.UserName") && $admpw == System::GetConfigurationValue("Administration.Password"));
}
function IsAdministrator()
{
if (!isset($_SESSION["admun"]) || !isset($_SESSION["admpw"])) return false;
$admun = $_SESSION["admun"];
$admpw = $_SESSION["admpw"];
return CheckCredentials($admun, $admpw);
}
System::$BeforeLaunchEventHandler = function($path)
{
if (!IsConfigured() && (!($path[0] == "setup")))
{
System::Redirect("~/setup");
return true;
}
if (!IsAdministrator() && (!($path[0] == "account" && $path[1] == "login.page")) && (!($path[0] == "setup")) && (!($path[0] == "favicon.ico")))
{
$path1 = implode("/", $path);
$_SESSION["LoginRedirectURL"] = "~/" . $path1;
System::Redirect("~/account/login.page");
return true;
}
return true;
};
System::$Modules[] = new Module("net.Objectify.TenantManager.Default", array
(
new ModulePage("", function($path)
{
$page = new WebPage();
$page->BeginContent();
$btng = new ButtonGroup("btng1");
$btng->Items[] = new ButtonGroupButton("btnDataCenters", "Data Centers", null, "~/Images/Buttons/DataCenters.png", "~/datacenter");
$btng->Items[] = new ButtonGroupButton("btnDataTypes", "Data Types", null, "~/Images/Buttons/DataTypes.png", "~/datatype");
$btng->Items[] = new ButtonGroupButton("btnTenantTypes", "Tenant Types", null, "~/Images/Buttons/TenantTypes.png", "~/tenanttype");
$btng->Items[] = new ButtonGroupButton("btnTenants", "Tenants", null, "~/Images/Buttons/Tenants.png", "~/tenant");
$btng->Items[] = new ButtonGroupButton("btnModules", "Modules", null, "~/Images/Buttons/Modules.png", "~/module");
$btng->Render();
$page->EndContent();
}),
new ModulePage("debug", function($path)
{
global $MySQL;
$page = new WebPage();
$page->BeginContent();
if (is_numeric($path[0]))
{
if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "delete")
{
$query = "DELETE FROM " . System::GetConfigurationValue("Database.TablePrefix") . "DebugMessages WHERE message_ID = " . $path[0];
$result = $MySQL->query($query);
System::Redirect("~/debug");
}
else
{
$query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "DebugMessages WHERE message_ID = " . $path[0];
$result = $MySQL->query($query);
$values = $result->fetch_assoc();
echo("<h1>Error Details</h1>");
echo("<p>" . $values["message_Content"] . "</p>");
echo("<h2>Parameters</h2>");
echo("<table class=\"ListView\">");
$query1 = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "DebugMessageParameters WHERE mp_MessageID = " . $values["message_ID"];
$result1 = $MySQL->query($query1);
$count1 = $result1->num_rows;
echo("<tr>");
echo("<th>Name</th>");
echo("<th>Value</th>");
echo("</tr>");
for ($j = 0; $j < $count1; $j++)
{
$values1 = $result1->fetch_assoc();
echo("<tr>");
echo("<td>");
echo($values1["mp_Name"]);
echo("</td>");
echo("<td>");
echo($values1["mp_Value"]);
echo("</td>");
echo("</tr>");
}
echo("</table>");
echo("<h2>Backtrace</h2>");
echo("<table class=\"ListView\">");
$query1 = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "DebugMessageBacktraces WHERE bt_MessageID = " . $values["message_ID"];
$result1 = $MySQL->query($query1);
$count1 = $result1->num_rows;
echo("<tr>");
echo("<th>File name</th>");
echo("<th>Line number</th>");
echo("</tr>");
for ($j = 0; $j < $count1; $j++)
{
$values1 = $result1->fetch_assoc();
echo("<tr>");
echo("<td>");
echo($values1["bt_FileName"]);
echo("</td>");
echo("<td>");
echo($values1["bt_LineNumber"]);
echo("</td>");
echo("</tr>");
}
echo("</table>");
echo("<div class=\"Buttons\">");
echo("<form method=\"post\">");
echo("<input type=\"hidden\" name=\"action\" value=\"delete\" />");
echo("<input type=\"submit\" value=\"Delete Message\" />");
echo("<a class=\"Button\" href=\"" . System::ExpandRelativePath("~/debug") . "\">Back to Messages</a>");
echo("</form>");
echo("</div>");
}
}
else
{
if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "delete")
{
$query = "DELETE FROM " . System::GetConfigurationValue("Database.TablePrefix") . "DebugMessages";
$result = $MySQL->query($query);
System::Redirect("~/debug");
}
else
{
echo("<form method=\"post\">");
echo("<input type=\"hidden\" name=\"action\" value=\"delete\" />");
echo("<input type=\"submit\" value=\"Clear Messages\" />");
echo("</form>");
echo("<table class=\"ListView\">");
echo("<tr>");
echo("<th>Tenant</th>");
echo("<th>Severity</th>");
echo("<th>Message</th>");
echo("<th>Timestamp</th>");
echo("<th>IP Address</th>");
echo("</tr>");
$query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "DebugMessages";
$result = $MySQL->query($query);
$count = $result->num_rows;
for ($i = 0; $i < $count; $i++)
{
$values = $result->fetch_assoc();
echo("<tr>");
echo("<td>");
$tenant = Tenant::GetByID($values["message_TenantID"]);
if ($tenant != null)
{
echo("<a href=\"" . System::ExpandRelativePath("~/tenant/manage/" . $tenant->URL . "/") . "\">" . $tenant->URL . "</a>");
}
echo("</td>");
echo("<td>");
switch ($values["message_SeverityID"])
{
}
echo("</td>");
echo("<td>");
echo("<a href=\"" . System::ExpandRelativePath("~/debug/" . $values["message_ID"]) . "\">");
echo($values["message_Content"]);
echo("</a>");
echo("</td>");
echo("<td>");
echo($values["message_Timestamp"]);
echo("</td>");
echo("<td>");
echo($values["message_IPAddress"]);
echo("</td>");
echo("</tr>");
}
echo("</table>");
}
}
$page->EndContent();
return true;
}),
new ModulePage("account", array
(
new ModulePage("login.page", function($path)
{
$page = new LoginPage();
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
if (isset($_POST["user_LoginID"]) && isset($_POST["user_Password"]))
{
$admun = $_POST["user_LoginID"];
$admpw = $_POST["user_Password"];
if (CheckCredentials($admun, $admpw))
{
$_SESSION["admun"] = $admun;
$_SESSION["admpw"] = $admpw;
if (isset($_SESSION["LoginRedirectURL"]))
{
System::Redirect($_SESSION["LoginRedirectURL"]);
}
else
{
System::Redirect("~/");
}
return true;
}
else
{
$page->InvalidCredentials = true;
}
}
}
$page->Render();
return true;
}),
new ModulePage("logout.page", function($path)
{
$_SESSION["admun"] = null;
$_SESSION["admpw"] = null;
System::Redirect("~/");
return true;
})
)),
new ModulePage("tenant", array
(
new ModulePage("", function($path)
{
$page = new MainPage();
$page->Render();
return true;
}),
new ModulePage("create", function($path)
{
if ($_SERVER["REQUEST_METHOD"] === "POST")
{
$tenant_URL = $_POST["tenant_URL"];
$tenant_Description = $_POST["tenant_Description"];
$tenant_DataCenters = array();
foreach ($_POST as $key => $value)
{
if (substr($key, 0, strlen("tenant_DataCenter_")) == "tenant_DataCenter_")
{
$id = substr($key, strlen("tenant_DataCenter_") + 1);
$tenant_DataCenters[] = DataCenter::GetByID($id);
}
}
$tenant_Status = ($_POST["tenant_Status"] == 1 ? TenantStatus::Enabled : TenantStatus::Disabled);
$tenant_Type = TenantType::GetByID($_POST["tenant_TypeID"]);
$tenant_PaymentPlan = PaymentPlan::GetByID($_POST["tenant_PaymentPlanID"]);
$tenant_BeginTimestamp = ($_POST["tenant_BeginTimestampValid"] == "1" ? null : $_POST["tenant_BeginTimestamp"]);
$tenant_EndTimestamp = ($_POST["tenant_EndTimestampValid"] == "1" ? null : $_POST["tenant_EndTimestamp"]);
$retval = Tenant::Create($tenant_URL, $tenant_Description, $tenant_Status, $tenant_Type, $tenant_PaymentPlan, $tenant_BeginTimestamp, $tenant_EndTimestamp, $tenant_DataCenters);
if ($retval == null)
{
global $MySQL;
echo($MySQL->error . " (" . $MySQL->errno . ")");
}
else
{
System::Redirect("~/tenant");
}
}
else
{
$page = new TenantPropertiesPage();
$page->Render();
return true;
}
}),
new ModulePage("modify", function($path)
{
if ($_SERVER["REQUEST_METHOD"] === "POST")
{
$tenant_URL = $_POST["tenant_URL"];
$tenant = Tenant::GetByURL($path[0]);
$tenant->URL = $_POST["tenant_URL"];
$tenant->Description = $_POST["tenant_Description"];
$tenant->Status = ($_POST["tenant_Status"] == 1 ? TenantStatus::Enabled : TenantStatus::Disabled);
$tenant->Type = TenantType::GetByID($_POST["tenant_TypeID"]);
$tenant->PaymentPlan = PaymentPlan::GetByID($_POST["tenant_PaymentPlanID"]);
$tenant->BeginTimestamp = ($_POST["tenant_BeginTimestampValid"] == "1" ? null : $_POST["tenant_BeginTimestamp"]);
$tenant->EndTimestamp = ($_POST["tenant_EndTimestampValid"] == "1" ? null : $_POST["tenant_EndTimestamp"]);
$retval = $tenant->Update();
if (!$retval)
{
global $MySQL;
echo($MySQL->error . " (" . $MySQL->errno . ")");
}
else
{
System::Redirect("~/tenant");
}
return true;
}
else
{
$page = new TenantPropertiesPage();
$page->Tenant = Tenant::GetByURL($path[0]);
$page->Render();
return true;
}
}),
new ModulePage("clone", function($path)
{
if ($_SERVER["REQUEST_METHOD"] === "POST")
{
$tenant_URL = $_POST["tenant_URL"];
$tenant_Description = $_POST["tenant_Description"];
$tenant_Status = ($_POST["tenant_Status"] == 1 ? TenantStatus::Enabled : TenantStatus::Disabled);
$tenant_Type = TenantType::GetByID($_POST["tenant_TypeID"]);
$tenant_PaymentPlan = PaymentPlan::GetByID($_POST["tenant_PaymentPlanID"]);
$tenant_BeginTimestamp = ($_POST["tenant_BeginTimestampValid"] == "1" ? null : $_POST["tenant_BeginTimestamp"]);
$tenant_EndTimestamp = ($_POST["tenant_EndTimestampValid"] == "1" ? null : $_POST["tenant_EndTimestamp"]);
$retval = Tenant::Create($tenant_URL, $tenant_Description, $tenant_Status, $tenant_Type, $tenant_PaymentPlan, $tenant_BeginTimestamp, $tenant_EndTimestamp);
if ($retval == null)
{
global $MySQL;
echo($MySQL->error . " (" . $MySQL->errno . ")");
}
else
{
System::Redirect("~/tenant");
}
}
else
{
$page = new TenantPropertiesPage();
$page->Tenant = Tenant::GetByURL($path[0]);
$page->Render();
return true;
}
}),
new ModulePage("delete", function($path)
{
if ($_SERVER["REQUEST_METHOD"] === "POST")
{
if ($_POST["Confirm"] == "1")
{
$tenant = Tenant::GetByURL($path[0]);
if ($tenant->Delete())
{
System::Redirect("~/tenant");
}
else
{
global $MySQL;
echo($MySQL->error . " (" . $MySQL->errno . ")");
}
}
}
else
{
$page = new ConfirmOperationPage();
$page->ReturnButtonURL = "~/tenant";
$page->Message = "Are you sure you want to delete the tenant '" . $path[0] . "'? This action cannot be undone, and will destroy any and all data associated with that tenant.";
$page->Render();
return true;
}
}),
new ModulePage("manage", function($path)
{
if ($path[1] == "")
{
$tenant = Tenant::GetByURL($path[0]);
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$properties = $tenant->GetProperties();
foreach ($properties as $property)
{
$tenant->SetPropertyValue($property, $_POST["Property_" . $property->ID]);
}
System::Redirect("~/tenant/manage/" . $path[0]);
return true;
}
else
{
$page = new TenantManagementPage();
$page->Tenant = $tenant;
$page->Render();
return true;
}
}
else
{
switch ($path[1])
{
case "modules":
{
$page = new TenantModuleManagementPage();
$page->Tenant = Tenant::GetByURL($path[0]);
$page->Module = \Objectify\Objects\Module::GetByID($path[2]);
$page->Render();
break;
}
case "objects":
{
if ($path[2] == "")
{
// $page = new TenantObjectBrowsePage();
// $page->CurrentTenant = Tenant::GetByURL($path[0]);
// $page->Render();
}
else
{
switch ($path[3])
{
case "instances":
{
switch ($path[4])
{
case "":
{
$tenant = Tenant::GetByURL($path[0]);
$object = TenantObject::GetByID($path[2]);
$page = new TenantObjectInstanceBrowsePage();
$page->CurrentTenant = $tenant;
$page->CurrentObject = $object;
$page->Render();
break;
}
}
}
case "methods":
{
switch ($path[4])
{
case "static":
{
$tenant = Tenant::GetByURL($path[0]);
$object = TenantObject::GetByID($path[2]);
$method = TenantObjectMethod::GetByID($path[5]);
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$method->CodeBlob = $_POST["method_CodeBlob"];
$method->Update();
System::Redirect("~/tenant/manage/" . $tenant->URL . "/objects/" . $object->ID);
return true;
}
$page = new TenantObjectMethodManagementPage();
$page->CurrentTenant = $tenant;
$page->CurrentObject = $object;
$page->CurrentMethod = $method;
$page->Render();
break;
}
case "instance":
{
$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;
}
}
}
return true;
}),
new ModulePage("launch", function($path)
{
$tenant = Tenant::GetByURL($path[0]);
header("Location: http://" . $tenant->DataCenters->Items[0]->HostName . "/" . $tenant->URL);
})
)),
new ModulePage("module", array
(
new ModulePage("", function($path)
{
$page = new ModuleMainPage();
$page->Render();
return true;
}),
new ModulePage("modify", function($path)
{
$module = \Objectify\Objects\Module::GetByID($path[0], true);
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$module->Title = $_POST["module_Title"];
$module->Description = $_POST["module_Description"];
$module->Update();
System::Redirect("~/module/modify/" . $path[0]);
}
else
{
$page = new ModuleManagementPage();
$page->Module = $module;
$page->Render();
}
return true;
})
)),
new ModulePage("datacenter", array
(
new ModulePage("", function($path)
{
$page = new DataCenterMainPage();
$page->Render();
return true;
}),
new ModulePage("create", function($path)
{
$datacenter = new DataCenter();
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$datacenter->Title = $_POST["datacenter_Title"];
$datacenter->Description = $_POST["datacenter_Description"];
$datacenter->HostName = $_POST["datacenter_HostName"];
$datacenter->Update();
System::Redirect("~/datacenter");
}
else
{
$page = new DataCenterManagementPage();
$page->DataCenter = null;
$page->Render();
}
return true;
}),
new ModulePage("modify", function($path)
{
$datacenter = DataCenter::GetByID($path[0]);
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$datacenter->Title = $_POST["datacenter_Title"];
$datacenter->Description = $_POST["datacenter_Description"];
$datacenter->HostName = $_POST["datacenter_HostName"];
$datacenter->Update();
System::Redirect("~/datacenter/modify/" . $path[0]);
}
else
{
$page = new DataCenterManagementPage();
$page->DataCenter = $datacenter;
$page->Render();
}
return true;
})
))
));
?>

View File

@ -1,41 +0,0 @@
<?php
use Objectify\Objects\DataType;
use Objectify\Objects\MultipleInstanceProperty;
use Objectify\Objects\SingleInstanceProperty;
use Objectify\Objects\TenantProperty;
use Objectify\Objects\TenantObjectProperty;
use Objectify\Objects\TenantObjectInstanceProperty;
use Objectify\Objects\TenantObjectInstancePropertyValue;
use Objectify\Objects\TenantObjectMethodParameter;
use Objectify\Objects\TenantQueryParameter;
use Objectify\Objects\TenantEnumerationChoice;
// Set up the basic configuration
$tenant->CreateProperty(new TenantProperty("ApplicationTitle", DataType::GetByName("Text"), "The title of your application. This is displayed in various areas around the site.", "My Application"));
$tenant->CreateProperty(new TenantProperty("ApplicationDescription", DataType::GetByName("Text"), "A short description of your application. This will appear in search results and other areas that use the HTML META description attribute.", "A versatile, modern, data-driven Web application powered by Objectify."));
// Install the resource bundles
$objResourceBundle = $tenant->GetObject("ResourceBundle");
$instRBCommon = $objResourceBundle->CreateInstance(array
(
new TenantObjectInstancePropertyValue("Name", "Common")
));
$instRBDefault = $objResourceBundle->CreateInstance(array
(
new TenantObjectInstancePropertyValue("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)
)
));
?>

View File

@ -1,351 +0,0 @@
<?php
namespace Objectify\Modules;
use WebFX\Controls\ButtonGroup;
use WebFX\Controls\ButtonGroupButton;
use WebFX\Controls\ButtonGroupButtonAlignment;
use WebFX\Controls\Panel;
use Objectify\Objects\Tenant;
use Objectify\Objects\User;
use Objectify\Objects\UserProfileVisibility;
use Objectify\Objects\UserPresenceStatus;
use WebFX\System;
use WebFX\Module;
use WebFX\ModulePage;
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
use WebFX\WebPage;
use Objectify\Pages\ErrorPage;
System::$Modules[] = new Module("net.objectify.Setup", array
(
new ModulePage("setup", function($path)
{
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
function Success($taskname)
{
?>
<tr>
<td style="background-color: #AAFFAA;"><?php echo($taskname); ?></td>
</tr>
<?php
}
function Message($taskname)
{
?>
<tr>
<td style="background-color: #AACCFF;"><?php echo($taskname); ?></td>
</tr>
<?php
}
function Failure($taskname)
{
?>
<tr>
<td style="background-color: #FFAAAA;"><?php echo($taskname); ?></td>
</tr>
<?php
}
function VariableToString($value)
{
if (is_string($value))
{
return "\"" . $value . "\"";
}
return $value;
}
function SaveConfiguration()
{
global $RootPath;
$FileName = $RootPath . "/Include/Configuration.inc.php";
$f = fopen($FileName, "w");
Message("Configuration file path is<br />" . $FileName);
if ($f === false) return false;
fwrite($f, "<?php\n");
fwrite($f, "\tuse WebFX\\System;\n");
fwrite($f, "\n");
fwrite($f, "\t// Whether we should enable users to run the setup application\n");
fwrite($f, "\tSystem::\$Configuration[\"Setup.Enabled\"] = false;\n");
fwrite($f, "\n");
fwrite($f, "\t// The base path of the Web site\n");
fwrite($f, "\tSystem::\$Configuration[\"Application.BasePath\"] = \"" . System::$Configuration["Application.BasePath"] . "\";\n");
fwrite($f, "\n");
fwrite($f, "\t// The default tenant for the Web site\n");
fwrite($f, "\tSystem::\$Configuration[\"Application.DefaultTenant\"] = \"" . $_POST["Application_DefaultTenant"] . "\";\n");
fwrite($f, "\n");
fwrite($f, "\t// Administration credentials for Tenant Manager\n");
fwrite($f, "\tSystem::\$Configuration[\"Administration.UserName\"] = \"" . $_POST["TenantManager_UserName"] . "\";\n");
fwrite($f, "\tSystem::\$Configuration[\"Administration.Password\"] = \"" . $_POST["TenantManager_Password"] . "\";\n");
fwrite($f, "\n");
fwrite($f, "\t// The location of static WebFramework-related files (scripts, stylesheets, etc.)\n");
fwrite($f, "\tSystem::\$Configuration[\"WebFramework.StaticPath\"] = \"" . System::$Configuration["WebFramework.StaticPath"] . "\";\n");
fwrite($f, "\n");
fwrite($f, "\n");
fwrite($f, "\t// *** GENERATED BY " . System::$Configuration["Application.Name"] . " SETUP APPLICATION - DO NOT EDIT BELOW THIS LINE ***\n");
$preinstalledKeys = array("Setup.Enabled", "Application.BasePath", "WebFramework.StaticPath", "Account.LoginPath", "Account.RegisterPath", "Account.ResetPasswordPath", "Application.DefaultTenant", "AdministratorUserName", "AdministratorPassword");
foreach (System::$Configuration as $key => $value)
{
$skip = false;
foreach ($preinstalledKeys as $pikey)
{
if ($key == $pikey)
{
$skip = true;
break;
}
}
if ($skip) continue;
fwrite($f, "\tSystem::\$Configuration[\"" . $key . "\"] = " . VariableToString($value) . ";\n");
}
fwrite($f, "?>\n");
fclose($f);
return true;
}
?>
<div style="text-align: center;">
<img src="<?php echo(System::ExpandRelativePath("~/Images/Logo.png")); ?>" style="height: 200px;" />
</div>
<p style="text-align: center;">
<?php echo(System::$Configuration["Application.Name"]); ?> is configuring your initial instance. This would be a good time for a coffee break...
</p>
<table style="width: 600px; margin-left: auto; margin-right: auto;" border="1">
<?php
Message("Writing configuration file");
// set the database configuration
System::$Configuration["Database.ServerName"] = $_POST["database_servername"];
System::$Configuration["Database.DatabaseName"] = $_POST["database_databasename"];
System::$Configuration["Database.UserName"] = $_POST["database_username"];
System::$Configuration["Database.Password"] = $_POST["database_password"];
System::$Configuration["Database.TablePrefix"] = $_POST["database_tableprefix"];
$retval = SaveConfiguration();
if ($retval)
{
Success("Configuration file wrote successfully");
}
else
{
Failure("Could not write the configuration file!");
return true;
}
$retval = DataFX::Initialize();
if ($retval)
{
Success("Initialized DataFX library");
}
else
{
Failure("Could not initialize DataFX library with the new configuration!");
Message("Database returned error " . DataFX::$Errors->Items[0]->Code . ": " . DataFX::$Errors->Items[0]->Message);
Message(DataFX::$Errors->Items[0]->Query);
return true;
}
// create the Users table
/*
$tables = array
(
new Table("MarketResourceBankDetails", "bankdetail_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ResourceTypeID", "INT", null, null, false),
new Column("Name", "VARCHAR", 50, null, false),
new Column("TitleSingular", "VARCHAR", 100, null, false),
new Column("TitlePlural", "VARCHAR", 100, null, false)
)),
new Table("Tasks", "task_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("TenantID", "INT", null, null, false),
new Column("Title", "VARCHAR", 100, null, false),
new Column("URL", "LONGTEXT", null, null, false)
)),
new Table("Themes", "theme_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("TenantID", "INT", null, null, false),
new Column("Name", "VARCHAR", 100, null, false),
new Column("Title", "VARCHAR", 100, null, false),
new Column("CreationUserID", "INT", null, null, false),
new Column("CreationTimestamp", "DATETIME", null, null, false)
)),
new Table("UserEquippedItems", "equippeditem_", array
(
new Column("UserID", "INT", null, null, false),
new Column("ItemID", "INT", null, null, false)
)),
new Table("UserInventoryFolders", "inventoryitem_", array
(
new Column("ID", "INT", null, null, false),
new Column("Title", "VARCHAR", 100, null, false),
new Column("ParentFolderID", "INT", null, null, true)
)),
new Table("UserInventoryItems", "inventoryitem_", array
(
new Column("UserID", "INT", null, null, false),
new Column("ItemID", "INT", null, null, false),
new Column("ParentFolderID", "INT", null, null, true)
)),
new Table("UserProfileContents", "content_", array
(
// posts by the user on their profile. can be scrolled back and forth like a journal. supports HTML!
new Column("ID", "INT", null, null, false, true, true),
new Column("TenantID", "INT", null, null, false),
new Column("CreationUserID", "INT", null, null, false),
new Column("CreationTimestamp", "DATETIME", null, null, false),
new Column("Content", "LONGTEXT", null, null, false)
)),
new Table("UserProfileContentFeedbacks", "feedback_", array
(
// likes and dislikes for user profile contents
new Column("ContentID", "INT", null, null, false),
new Column("FeedbackTypeID", "INT", null, null, false),
new Column("Comments", "VARCHAR", 200, null, false),
new Column("CreationUserID", "INT", null, null, false),
new Column("CreationTimestamp", "DATETIME", null, null, false)
))
);
*/
$tables = array();
$tablefilepath = dirname(__FILE__) . "/Tables/*.inc.php";
$tablefiles = glob($tablefilepath);
foreach ($tablefiles as $tablefile)
{
require($tablefile);
}
foreach ($tables as $table)
{
if ($table->Exists())
{
Message("Table '" . $table->Name . "' already exists, skipping creation");
}
else
{
$retval = $table->Create();
if ($retval)
{
Success("Created table '" . $table->Name . "'");
}
else
{
Failure("Could not create table '" . $table->Name . "'");
Message("Database returned error " . DataFX::$Errors->Items[0]->Code . ": " . DataFX::$Errors->Items[0]->Message);
Message(DataFX::$Errors->Items[0]->Query);
}
}
}
$tenant = Tenant::Create($_POST["Application_DefaultTenant"], "The default tenant for " . System::$Configuration["Application.Name"] . ".");
$tablefilepath = dirname(__FILE__) . "/TenantObjects/*.inc.php";
$tablefiles = glob($tablefilepath);
foreach ($tablefiles as $tablefile)
{
require($tablefile);
}
require(dirname(__FILE__) . "/DefaultTenant.inc.php");
?>
</table>
<?php
return true;
}
$page = new WebPage();
$page->BeginContent();
?>
<div style="text-align: center;">
<img src="<?php echo(System::ExpandRelativePath("~/Images/Logo.png")); ?>" style="height: 200px;" />
</div>
<p style="text-align: center;">
Please provide some information about your server to create the initial <?php echo(System::$Configuration["Application.Name"]); ?> tenant. Other
tenants may be created and removed at any time by entering the Administrator Control Panel.
</p>
<form method="POST">
<table style="width: 400px; margin-left: auto; margin-right: auto;">
<tr>
<td style="width: 128px;"><label for="txtServerName">Server name:</label></td>
<td><input type="text" id="txtServerName" name="database_servername" style="width: 100%;" value="<?php echo(System::GetConfigurationValue("Database.ServerName", "localhost")); ?>" />
</tr>
<tr>
<td><label for="txtDatabaseName">Database name:</label></td>
<td><input type="text" id="txtDatabaseName" name="database_databasename" style="width: 100%;" value="<?php echo(System::GetConfigurationValue("Database.DatabaseName", "Objectify")); ?>" /></td>
</tr>
<tr>
<td><label for="txtUserName">User name:</label></td>
<td><input type="text" id="txtUserName" name="database_username" style="width: 100%;" value="<?php echo(System::GetConfigurationValue("Database.UserName", "Objectify")); ?>" /></td>
</tr>
<tr>
<td><label for="txtPassword">Password:</label></td>
<td><input type="password" id="txtPassword" name="database_password" value="" style="width: 100%;" /></td>
</tr>
<tr>
<td><label for="txtTablePrefix">Table prefix:</label></td>
<td><input type="text" id="txtTablePrefix" name="database_tableprefix" value="<?php echo(System::GetConfigurationValue("Database.TablePrefix", "phoenix_")); ?>" style="width: 100%;" /></td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td><label for="txtAdministratorUserName">Administrator user name:</label></td>
<td><input type="text" id="txtAdministratorUserName" name="TenantManager_UserName" /></td>
</tr>
<tr>
<td><label for="txtAdministratorPassword">Administrator password:</label></td>
<td><input type="password" id="txtAdministratorPassword" name="TenantManager_Password" /></td>
</tr>
<tr>
<td><label for="txtDefaultTenant">Initial tenant:</label></td>
<td><input type="text" id="txtDefaultTenant" name="Application_DefaultTenant" value="default" /></td>
</tr>
<tr>
<td colspan="2" style="text-align: center;"><input type="submit" value="Continue" /></td>
</tr>
</table>
</form>
<?php
$page->EndContent();
return true;
},
function($path)
{
$enabled = false;
if (isset(System::$Configuration["Setup.Enabled"]))
{
$enabled = (System::$Configuration["Setup.Enabled"] == "true");
}
if (!$enabled)
{
$page = new \WebFX\WebPage();
$page->Title = "Configuration Error";
$page->BeginContent();
echo("<div style=\"text-align: center;\"><img style=\"height: 120px;\" src=\"" . System::ExpandRelativePath("~/Images/ObjectifyLogo.png") . "\" /></div><div>This Objectify installation has not been configured. Please contact the server administrator.</div>");
$page->EndContent();
return false;
}
})
));
?>

View File

@ -1,324 +0,0 @@
<?php
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
$tblDataTypes = new Table("DataTypes", "datatype_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("Name", "VARCHAR", 256, null, true),
new Column("Description", "LONGTEXT", null, null, true),
new Column("EncoderCodeBlob", "LONGBLOB", null, ColumnValue::Undefined, true),
new Column("DecoderCodeBlob", "LONGBLOB", null, ColumnValue::Undefined, true),
new Column("ColumnRendererCodeBlob", "LONGBLOB", null, ColumnValue::Undefined, true),
new Column("EditorRendererCodeBlob", "LONGBLOB", null, ColumnValue::Undefined, true)
),
array
(
new Record(array
(
new RecordColumn("Name", "Text"),
new RecordColumn("Description", "Allows you to enter a single line of text."),
new RecordColumn("EncoderCodeBlob", ColumnValue::Undefined),
new RecordColumn("DecoderCodeBlob", ColumnValue::Undefined),
new RecordColumn("ColumnRendererCodeBlob", ColumnValue::Undefined),
new RecordColumn("EditorRendererCodeBlob", ColumnValue::Undefined)
)),
new Record(array
(
new RecordColumn("Name", "Memo"),
new RecordColumn("Description", "Allows you to enter large amounts of text."),
new RecordColumn("EncoderCodeBlob", ColumnValue::Undefined),
new RecordColumn("DecoderCodeBlob", ColumnValue::Undefined),
new RecordColumn("ColumnRendererCodeBlob", <<<'EOD'
echo("<div style=\"width: 100%; overflow: scroll; overflow-x: hidden;\">" . $input . "</div>");
EOD
),
new RecordColumn("EditorRendererCodeBlob", <<<'EOD'
echo("<textarea id=\"" . $name . "\" name=\"" . $name . "\">" . $input . "</textarea>");
EOD
)
)),
new Record(array
(
new RecordColumn("Name", "CodeBlob"),
new RecordColumn("Description", "Allows you to enter script code with a special text editor."),
new RecordColumn("EncoderCodeBlob", null),
new RecordColumn("DecoderCodeBlob", null),
new RecordColumn("ColumnRendererCodeBlob", <<<'EOD'
echo("<div style=\"width: 100%; overflow: scroll; overflow-x: hidden;\">" . $input . "</div>");
EOD
),
new RecordColumn("EditorRendererCodeBlob", <<<'EOD'
echo("<textarea id=\"" . $name . "\" name=\"" . $name . "\">" . $input . "</textarea>");
EOD
)
)),
new Record(array
(
new RecordColumn("Name", "Number"),
new RecordColumn("Description", "Stores numeric data."),
new RecordColumn("EncoderCodeBlob", null),
new RecordColumn("DecoderCodeBlob", null),
new RecordColumn("ColumnRendererCodeBlob", null),
new RecordColumn("EditorRendererCodeBlob", null)
)),
new Record(array
(
new RecordColumn("Name", "Boolean"),
new RecordColumn("Description", "Stores a true/false or yes/no value."),
new RecordColumn("EncoderCodeBlob", null),
new RecordColumn("DecoderCodeBlob", null),
new RecordColumn("ColumnRendererCodeBlob", <<<'EOD'
echo("<input type=\"checkbox\" disabled=\"disabled\" />");
EOD
),
new RecordColumn("EditorRendererCodeBlob", <<<'EOD'
echo("<input type=\"checkbox\" id=\"" . $name . "\" name=\"" . $name . "\" />");
EOD
)
)),
new Record(array
(
new RecordColumn("Name", "Measurement"),
new RecordColumn("Description", "Stores measurement data, which is a double-precision floating-point number followed by a unit of measurement."),
new RecordColumn("EncoderCodeBlob", null),
new RecordColumn("DecoderCodeBlob", null),
new RecordColumn("ColumnRendererCodeBlob", null),
new RecordColumn("EditorRendererCodeBlob", <<<'EOD'
echo("<input type=\"text\" id=\"Measurement_" . $name . "_Value\" /> <select id=\"Measurement_" . $name . "_Unit\">");
echo("<option value=\"px\" selected=\"selected\">px</option>");
echo("<option value=\"pt\" selected=\"selected\">pt</option>");
echo("<option value=\"em\" selected=\"selected\">em</option>");
echo("<option value=\"%\" selected=\"selected\">%</option>");
echo("</select>");
EOD
)
)),
new Record(array
(
new RecordColumn("Name", "DateTime"),
new RecordColumn("Description", "Stores a date and time value."),
new RecordColumn("EncoderCodeBlob", null),
new RecordColumn("DecoderCodeBlob", null),
new RecordColumn("ColumnRendererCodeBlob", null),
new RecordColumn("EditorRendererCodeBlob", null)
)),
new Record(array
(
new RecordColumn("Name", "SingleInstance"),
new RecordColumn("Description", "Represents a property that returns a single TenantObjectInstance object."),
new RecordColumn("EncoderCodeBlob", <<<'EOD'
// $input should be a TenantObjectInstance
if ($input == null)
{
$bt = debug_backtrace();
trigger_error("SingleInstance::Encoder - input is null, did you mean to pass in a blank SingleInstanceProperty?, in " . $bt["file"] . "::" . $bt["function"] . " on line " . $bt["line"] . "; ", E_USER_WARNING);
return "";
}
// encode the property by simply storing the instance ID in the property value.
$output = "";
$count = count($input->ValidObjects);
for ($i = 0; $i < $count; $i++)
{
$output .= $input->ValidObjects[$i]->ID;
if ($i < $count - 1) $output .= ",";
}
$output .= ":";
if ($input != null)
{
if ($input->GetInstance() != null) $output .= $input->GetInstance()->ID;
}
return $output;
EOD
),
new RecordColumn("DecoderCodeBlob", <<<'EOD'
// $input should be a String in the format t0,t1,t2:i0,i1,i2,i3... where tx is an ID of a TenantObject that is valid in the property and ix is an ID of a TenantObjectInstance
// encode the property by simply storing the instance ID of each instance, separated by commas, in the property value.
$dcb = explode(":", $input);
$validObjects = explode(",", $dcb[0]);
$instance = $dcb[1];
$output = new SingleInstanceProperty();
// loop through all the valid objects and add them to the MultipleInstanceProperty
$count = count($validObjects);
for ($i = 0; $i < $count; $i++)
{
$output->ValidObjects[] = TenantObject::GetByID($validObjects[$i]);
}
// assign the instance
$output->Instance = TenantObjectInstance::GetByID($instance);
return $output;
EOD
),
new RecordColumn("ColumnRendererCodeBlob", <<<'EOD'
$inst = $input->Instance;
echo("<div class=\"InstanceEditor SingleInstance ReadOnly\">");
echo("<input type=\"hidden\" id=\"" . $name . "_Instances\" name=\"" . $name . "_Instances\" />");
echo("<div class=\"InstanceList\">");
if ($inst != null)
{
echo ("<a href=\"#\">" . $inst->ToString() . "</a>");
}
echo("</div>");
echo("</div>");
EOD
),
new RecordColumn("EditorRendererCodeBlob", <<<'EOD'
$inst = $input->Instance;
echo("<div class=\"InstanceEditor SingleInstance\">");
$insts_text = $inst->ID;
echo("<input type=\"hidden\" id=\"" . $name . "_Instances\" name=\"" . $name . "_Instances\" value=\"" . $insts_text . "\" />");
echo("<input type=\"text\" id=\"" . $name . "_CurrentInstance\" name=\"" . $name . "_CurrentInstance\" />");
echo("<div class=\"InstanceList\">");
if ($inst != null)
{
echo ("<a href=\"#\">" . $inst->ToString() . "</a>");
}
echo("</div>");
echo("<script type=\"text/javascript\">");
echo("var t = document.getElementById('" . $name . "_CurrentInstance');");
echo("t.onkeydown = function(e) { ");
echo("alert(e.keyCode);");
echo("};");
echo("</script>");
echo("</div>");
EOD
)
)),
new Record(array
(
new RecordColumn("Name", "MultipleInstance"),
new RecordColumn("Description", "Represents a property that returns an array of TenantObjectInstance objects."),
new RecordColumn("EncoderCodeBlob", <<<'EOD'
// $input should be an array of TenantObjectInstance objects
// encode the property by simply storing the instance ID of each instance, separated by commas, in the property value. the list of valid
// object types is stored in the first part of the property, separated by a colon.
if ($input == null)
{
PhoenixSNS::Log("MultipleInstance::Encoder input is null - did you mean to pass in a blank MultipleInstanceProperty?");
return "";
}
$output = "";
$count = count($input->ValidObjects);
for ($i = 0; $i < $count; $i++)
{
$output .= $input->ValidObjects[$i]->ID;
if ($i < $count - 1) $output .= ",";
}
$output .= ":";
$insts = $input->GetInstances();
$i = 0;
$count = count($insts);
foreach ($insts as $inst)
{
$output .= $inst->ID;
if ($i < $count - 1) $output .= ",";
$i++;
}
return $output;
EOD
),
new RecordColumn("DecoderCodeBlob", <<<'EOD'
// $input should be a String in the format t0,t1,t2:i0,i1,i2,i3... where tx is an ID of a TenantObject that is valid in the property and ix is an ID of a TenantObjectInstance
// encode the property by simply storing the instance ID of each instance, separated by commas, in the property value.
if ($input == "")
{
$bt = debug_backtrace();
trigger_error("MultipleInstance::Decoder - input is null, did you mean to pass in a blank MultipleInstanceProperty?, in " . $bt["file"] . "::" . $bt["function"] . " on line " . $bt["line"] . "; ", E_USER_WARNING);
return null;
}
$dcb = explode(":", $input);
$validObjects = explode(",", $dcb[0]);
$instances = explode(",", $dcb[1]);
$output = new MultipleInstanceProperty();
// loop through all the valid objects and add them to the MultipleInstanceProperty
$count = count($validObjects);
for ($i = 0; $i < $count; $i++)
{
$output->ValidObjects[] = TenantObject::GetByID($validObjects[$i]);
}
// loop through all of the instances and add them to the MultipleInstanceProperty
$count = count($instances);
for ($i = 0; $i < $count; $i++)
{
$output->AddInstance(TenantObjectInstance::GetByID($instances[$i]));
}
return $output;
EOD
),
new RecordColumn("ColumnRendererCodeBlob", <<<'EOD'
if ($input == null) return;
if (!is_object($input) || (get_class($input) != "PhoenixSNS\\Objects\\MultipleInstanceProperty"))
{
$bt = debug_backtrace();
trigger_error("Expected MultipleInstanceProperty, got something else in " . $bt[1]["file"] . "::" . $bt[1]["function"] . " at line " . $bt[1]["line"], E_USER_WARNING);
return;
}
$insts = $input->GetInstances();
echo("<div class=\"InstanceEditor MultipleInstance ReadOnly\">");
echo("<input type=\"hidden\" id=\"" . $name . "_Instances\" name=\"" . $name . "_Instances\" />");
echo("<input type=\"text\" id=\"" . $name . "_CurrentInstance\" name=\"" . $name . "_CurrentInstance\" />");
echo("<div class=\"InstanceList\">");
foreach ($insts as $inst)
{
if ($inst != null)
{
echo ("<a href=\"#\">" . $inst->ToString() . "</a>");
}
}
echo("</div>");
echo("</div>");
EOD
),
new RecordColumn("EditorRendererCodeBlob", <<<'EOD'
if ($input == null) return;
if (!is_object($input) || (get_class($input) != "PhoenixSNS\\Objects\\MultipleInstanceProperty"))
{
$bt = debug_backtrace();
trigger_error("Expected MultipleInstanceProperty, got something else in " . $bt[1]["file"] . "::" . $bt[1]["function"] . " at line " . $bt[1]["line"], E_USER_WARNING);
return;
}
$insts = $input->GetInstances();
echo("<div class=\"InstanceEditor MultipleInstance\">");
$insts_text = "";
$count = count($insts);
for ($i = 0; $i < $count; $i++)
{
$inst = $insts[$i];
$insts_text .= $inst->ID;
if ($i < $count - 1) $insts_text .= ", ";
}
echo("<input type=\"hidden\" id=\"" . $name . "_Instances\" name=\"" . $name . "_Instances\" value=\"" . $insts_text . "\" />");
echo("<input type=\"text\" id=\"" . $name . "_CurrentInstance\" name=\"" . $name . "_CurrentInstance\" />");
echo("<div class=\"InstanceList\">");
foreach ($insts as $inst)
{
if ($inst != null)
{
echo ("<a href=\"#\">" . $inst->ToString() . "</a>");
}
}
echo("</div>");
echo("<script type=\"text/javascript\">");
echo("var t = document.getElementById('" . $name . "_CurrentInstance');");
echo("t.onkeydown = function(e) { ");
echo("alert(e.keyCode);");
echo("};");
echo("</script>");
echo("</div>");
EOD
)
))
));
$tables[] = $tblDataTypes;
?>

View File

@ -1,20 +0,0 @@
<?php
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
use DataFX\TableKey;
use DataFX\TableKeyColumn;
use DataFX\TableForeignKey;
use DataFX\TableForeignKeyColumn;
$tblLanguages = new Table("Languages", "language_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("Name", "VARCHAR", 64, null, false)
));
$tables[] = $tblLanguages;
?>

View File

@ -1,168 +0,0 @@
<?php
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
use DataFX\TableForeignKey;
use DataFX\TableForeignKeyColumn;
$tblModules = new Table("Modules", "module_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("Title", "VARCHAR", 256, null, true),
new Column("Description", "LONGTEXT", null, null, true),
new Column("Enabled", "INT", null, 1, false)
),
array
(
// Discussions (V2) provides all the functionality of V1 Pages, Groups, and Forums
new Record(array
(
new RecordColumn("Title", "Discussions"),
new RecordColumn("Description", "Provides various types of discussion boards, pages, groups, and forums that allow your users to connect and communicate about specific topics.")
)),
new Record(array
(
new RecordColumn("Title", "Market"),
new RecordColumn("Description", "Provides a virtual market system that allows users to buy and sell virtual items, create their own brands and stores, and item trading.")
)),
new Record(array
(
new RecordColumn("Title", "Brands"),
new RecordColumn("Description", "Allows users to create their own brands and stores to sell their own virtual items.")
)),
new Record(array
(
new RecordColumn("Title", "Trading"),
new RecordColumn("Description", "Allows users to trade items with each other. Items can be set to not be tradable, or only be tradable under certain conditions.")
)),
new Record(array
(
new RecordColumn("Title", "World"),
new RecordColumn("Description", "Provides a virtual world that is divided into Places. Users can have one or more personal Places, and complete access control is allowed.")
)),
new Record(array
(
new RecordColumn("Title", "Partners"),
new RecordColumn("Description", "Allows you to promote other organizations and display advertisements on your social network.")
)),
new Record(array
(
new RecordColumn("Title", "Arcade"),
new RecordColumn("Description", "Enables the hosting of games inside the social network, with integrated redemption rewards and leaderboard statistics tracking.")
))
));
$tables[] = $tblModules;
$tblModuleMenuItems = new Table("ModuleMenuItems", "menuitem_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("ModuleID", "INT", null, null, false),
new Column("Title", "VARCHAR", 256, null, false),
new Column("Description", "LONGTEXT", null, null, true),
new Column("TargetURL", "LONGTEXT", null, null, true),
new Column("TargetScript", "LONGTEXT", null, null, true)
),
array
(
new Record(array
(
new RecordColumn("ModuleID", 2),
new RecordColumn("Title", "Market"),
new RecordColumn("Description", "Buy, sell, and trade resources and items, and play Chance to win mystery rewards"),
new RecordColumn("TargetURL", "~/market"),
new RecordColumn("TargetScript", ColumnValue::Undefined)
)),
new Record(array
(
new RecordColumn("ModuleID", 5),
new RecordColumn("Title", "World"),
new RecordColumn("Description", "Explore a virtual world with your very own animated avatar"),
new RecordColumn("TargetURL", "~/world"),
new RecordColumn("TargetScript", ColumnValue::Undefined)
)),
new Record(array
(
new RecordColumn("ModuleID", 6),
new RecordColumn("Title", "Partners"),
new RecordColumn("Description", "See who we've partnered with to bring you even more awesome experiences, and learn about becoming a partner yourself"),
new RecordColumn("TargetURL", "~/partners"),
new RecordColumn("TargetScript", ColumnValue::Undefined)
)),
new Record(array
(
new RecordColumn("ModuleID", 7),
new RecordColumn("Title", "Arcade"),
new RecordColumn("Description", "Play games and make friends in the Arcade."),
new RecordColumn("TargetURL", "~/arcade"),
new RecordColumn("TargetScript", ColumnValue::Undefined)
))
));
$tblModuleMenuItems->ForeignKeys = array
(
new TableForeignKey("ModuleID", new TableForeignKeyColumn($tblModules, $tblModules->GetColumnByName("ID")))
);
$tables[] = $tblModuleMenuItems;
$tblModuleObjects = new Table("ModuleObjects", "object_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("ModuleID", "INT", null, null, true),
new Column("ParentObjectID", "INT", null, null, true),
new Column("Title", "VARCHAR", 256, null, true),
new Column("Description", "LONGTEXT", null, null, true)
),
array
(
new Record(array
(
new RecordColumn("ModuleID", 7),
new RecordColumn("Title", "Game")
))
));
$tblModuleObjects->ForeignKeys = array
(
new TableForeignKey("ModuleID", new TableForeignKeyColumn($tblModules, $tblModules->GetColumnByName("ID"))),
new TableForeignKey("ParentObjectID", new TableForeignKeyColumn($tblModuleObjects, $tblModuleObjects->GetColumnByName("ID")))
);
$tables[] = $tblModuleObjects;
$tblModulePages = new Table("ModulePages", "modulepage_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("ModuleID", "INT", null, null, true),
new Column("ParentPageID", "INT", null, null, true),
new Column("URL", "VARCHAR", 1024, null, true),
new Column("Content", "LONGTEXT", null, null, true)
),
array
(
new Record(array
(
new RecordColumn("ModuleID", 1),
new RecordColumn("URL", "groups")
)),
new Record(array
(
new RecordColumn("ModuleID", 1),
new RecordColumn("URL", "pages")
)),
new Record(array
(
new RecordColumn("ModuleID", 1),
new RecordColumn("URL", "forums")
))
));
$tblModulePages->ForeignKeys = array
(
new TableForeignKey("ModuleID", new TableForeignKeyColumn($tblModules, $tblModules->GetColumnByName("ID"))),
new TableForeignKey("ParentPageID", new TableForeignKeyColumn($tblModulePages, $tblModulePages->GetColumnByName("ID")))
);
$tables[] = $tblModulePages;
?>

View File

@ -1,78 +0,0 @@
<?php
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
use DataFX\TableKey;
use DataFX\TableKeyColumn;
use DataFX\TableForeignKey;
use DataFX\TableForeignKeyColumn;
$tblTenants = new Table("Tenants", "tenant_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("URL", "VARCHAR", 30, null, true),
new Column("Description", "LONGTEXT", null, null, false),
new Column("Status", "INT", null, null, true),
new Column("TypeID", "INT", null, null, true),
new Column("PaymentPlanID", "INT", null, null, true),
new Column("BeginTimestamp", "DATETIME", null, null, true),
new Column("EndTimestamp", "DATETIME", null, null, true)
),
array
(
));
$tblTenants->UniqueKeys = array
(
new TableKey(array
(
new TableKeyColumn("URL")
))
);
$tables[] = $tblTenants;
$tblTenantProperties = new Table("TenantProperties", "property_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("TenantID", "INT", null, null, true),
new Column("Name", "VARCHAR", 256, null, false),
new Column("Description", "LONGTEXT", null, null, true),
new Column("DataTypeID", "INT", null, null, false),
new Column("DefaultValue", "LONGBLOB", null, null, true)
));
$tblTenantProperties->ForeignKeys = array
(
new TableForeignKey("TenantID", new TableForeignKeyColumn($tblTenants, "ID")),
new TableForeignKey("DataTypeID", new TableForeignKeyColumn($tblDataTypes, "ID"))
);
$tables[] = $tblTenantProperties;
$tblTenantPropertyValues = new Table("TenantPropertyValues", "propval_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("PropertyID", "INT", null, null, false, true, true),
new Column("Value", "LONGTEXT", null, null, true)
));
$tblTenantPropertyValues->ForeignKeys = array
(
new TableForeignKey("PropertyID", new TableForeignKeyColumn($tblTenantProperties, "ID"))
);
$tables[] = $tblTenantPropertyValues;
$tblTenantModules = new Table("TenantModules", "tenantmodule_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("TenantID", "INT", null, null, false),
new Column("ModuleID", "INT", null, null, false)
));
$tblTenantModules->ForeignKeys = array
(
new TableForeignKey("TenantID", new TableForeignKeyColumn($tblTenants, "ID"))
);
$tables[] = $tblTenantModules;
?>

View File

@ -1,197 +0,0 @@
<?php
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
use DataFX\TableKey;
use DataFX\TableKeyColumn;
use DataFX\TableForeignKey;
use DataFX\TableForeignKeyColumn;
$tblTenantObjects = new Table("TenantObjects", "object_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("TenantID", "INT", null, null, true), // if set, object is only visible/referencable within specified tenant
new Column("ModuleID", "INT", null, null, true), // if set, object is only visible/referencable when specified module is enabled
new Column("ParentObjectID", "INT", null, null, true), // if set, object inherits its permissions, properties, and other attributes from given object
new Column("Name", "VARCHAR", 256, null, false)
));
$tblTenantObjects->ForeignKeys = array
(
new TableForeignKey("TenantID", new TableForeignKeyColumn($tblTenants, $tblTenants->GetColumnByName("ID"))),
new TableForeignKey("ModuleID", new TableForeignKeyColumn($tblModules, $tblModules->GetColumnByName("ID"))),
new TableForeignKey("ParentObjectID", new TableForeignKeyColumn($tblTenantObjects, $tblTenantObjects->GetColumnByName("ID")))
);
$tables[] = $tblTenantObjects;
$tblTenantObjectTitles = new Table("TenantObjectTitles", "entry_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("ObjectID", "INT", null, null, false),
new Column("LanguageID", "INT", null, null, false),
new Column("Value", "LONGTEXT", null, null, false)
));
$tblTenantObjectTitles->ForeignKeys = array
(
new TableForeignKey("ObjectID", new TableForeignKeyColumn($tblTenantObjects, $tblTenantObjects->GetColumnByName("ID"))),
new TableForeignKey("LanguageID", new TableForeignKeyColumn($tblLanguages, $tblLanguages->GetColumnByName("ID")))
);
$tables[] = $tblTenantObjectTitles;
$tblTenantObjectDescriptions = new Table("TenantObjectDescriptions", "entry_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("ObjectID", "INT", null, null, false),
new Column("LanguageID", "INT", null, null, false),
new Column("Value", "LONGTEXT", null, null, false)
));
$tblTenantObjectDescriptions->ForeignKeys = array
(
new TableForeignKey("ObjectID", new TableForeignKeyColumn($tblTenantObjects, $tblTenantObjects->GetColumnByName("ID"))),
new TableForeignKey("LanguageID", new TableForeignKeyColumn($tblLanguages, $tblLanguages->GetColumnByName("ID")))
);
$tables[] = $tblTenantObjectDescriptions;
// Available static properties for the objects.
$tblTenantObjectProperties = new Table("TenantObjectProperties", "property_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("ObjectID", "INT", null, null, false),
new Column("Name", "VARCHAR", 256, null, true),
new Column("DataTypeID", "INT", null, null, true),
new Column("DefaultValue", "LONGBLOB", null, null, true),
new Column("IsRequired", "INT", null, 0, false),
new Column("EnumerationID", "INT", null, null, true),
new Column("RequireChoiceFromEnumeration", "INT", null, 0, false),
new Column("ColumnVisible", "INT", null, 0, false)
));
$tblTenantObjectProperties->ForeignKeys = array
(
new TableForeignKey("ObjectID", new TableForeignKeyColumn($tblTenantObjects, "ID")),
new TableForeignKey("DataTypeID", new TableForeignKeyColumn($tblDataTypes, "ID"))
);
$tables[] = $tblTenantObjectProperties;
// Values for static properties of objects.
$tblTenantObjectPropertyValues = new Table("TenantObjectPropertyValues", "propval_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("PropertyID", "INT", null, null, false),
new Column("Value", "LONGBLOB", null, null, true)
));
$tblTenantObjectPropertyValues->ForeignKeys = array
(
new TableForeignKey("PropertyID", new TableForeignKeyColumn($tblTenantObjectProperties, "ID"))
);
$tables[] = $tblTenantObjectPropertyValues;
// Instances of the objects.
$tblTenantObjectInstances = new Table("TenantObjectInstances", "instance_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("ObjectID", "INT", null, null, false)
));
$tblTenantObjectInstances->ForeignKeys = array
(
new TableForeignKey("ObjectID", new TableForeignKeyColumn($tblTenantObjects, "ID"))
);
$tables[] = $tblTenantObjectInstances;
// Properties of the object instances.
$tblTenantObjectInstanceProperties = new Table("TenantObjectInstanceProperties", "property_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("ObjectID", "INT", null, null, false),
new Column("Name", "VARCHAR", 256, null, true),
new Column("DataTypeID", "INT", null, null, true),
new Column("DefaultValue", "LONGBLOB", null, null, true),
new Column("IsRequired", "INT", null, 0, false),
new Column("EnumerationID", "INT", null, null, true),
new Column("RequireChoiceFromEnumeration", "INT", null, 0, false),
new Column("ColumnVisible", "INT", null, 0, false)
));
$tblTenantObjectInstanceProperties->ForeignKeys = array
(
new TableForeignKey("ObjectID", new TableForeignKeyColumn($tblTenantObjects, "ID")),
new TableForeignKey("DataTypeID", new TableForeignKeyColumn($tblDataTypes, "ID"))
);
$tables[] = $tblTenantObjectInstanceProperties;
// Values of the object instance properties.
$tblTenantObjectInstancePropertyValues = new Table("TenantObjectInstancePropertyValues", "propval_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("InstanceID", "INT", null, null, false),
new Column("PropertyID", "INT", null, null, false),
new Column("Value", "LONGBLOB", null, null, false)
));
$tblTenantObjectInstancePropertyValues->PrimaryKey = new TableKey(array
(
new TableKeyColumn("InstanceID"),
new TableKeyColumn("PropertyID")
));
$tblTenantObjectInstancePropertyValues->ForeignKeys = array
(
new TableForeignKey("InstanceID", new TableForeignKeyColumn($tblTenantObjectInstances, "ID")),
new TableForeignKey("PropertyID", new TableForeignKeyColumn($tblTenantObjectInstanceProperties, "ID"))
);
$tables[] = $tblTenantObjectInstancePropertyValues;
// Object static methods.
$tblTenantObjectMethods = new Table("TenantObjectMethods", "method_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("ObjectID", "INT", null, null, false),
new Column("Name", "VARCHAR", 256, null, false),
new Column("CodeBlob", "LONGBLOB", null, null, false)
));
$tblTenantObjectMethods->ForeignKeys = array
(
new TableForeignKey("ObjectID", new TableForeignKeyColumn($tblTenantObjects, "ID"))
);
$tables[] = $tblTenantObjectMethods;
// Object static method namespace references.
$tblTenantObjectMethodNamespaceReferences = new Table("TenantObjectMethodNamespaceReferences", "ns_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("MethodID", "INT", null, null, false),
new Column("Value", "VARCHAR", 256, null, false)
));
$tblTenantObjectMethodNamespaceReferences->ForeignKeys = array
(
new TableForeignKey("MethodID", new TableForeignKeyColumn($tblTenantObjectMethods, "ID"))
);
$tables[] = $tblTenantObjectMethodNamespaceReferences;
// Object instance methods.
$tblTenantObjectInstanceMethods = new Table("TenantObjectInstanceMethods", "method_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("ObjectID", "INT", null, null, false),
new Column("Name", "VARCHAR", 256, null, false),
new Column("CodeBlob", "LONGBLOB", null, null, false)
));
$tables[] = $tblTenantObjectInstanceMethods;
// Object static method namespace references.
$tblTenantObjectInstanceMethodNamespaceReferences = new Table("TenantObjectInstanceMethodNamespaceReferences", "ns_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("MethodID", "INT", null, null, false),
new Column("Value", "VARCHAR", 256, null, false)
));
$tables[] = $tblTenantObjectInstanceMethodNamespaceReferences;
?>

View File

@ -1,26 +0,0 @@
<?php
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
$tables[] = new Table("DataCenters", "datacenter_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("Title", "VARCHAR", 256, null, true),
new Column("Description", "LONGTEXT", null, null, true),
new Column("HostName", "VARCHAR", 256, null, true)
),
array
(
new Record(array
(
new RecordColumn("Title", "Default"),
new RecordColumn("Description", "The initial data center configured for PhoenixSNS tenanted hosting."),
new RecordColumn("HostName", "www.yourdomain.com")
))
));
?>

View File

@ -1,51 +0,0 @@
<?php
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
use DataFX\TableForeignKey;
use DataFX\TableForeignKeyColumn;
use DataFX\TableForeignKeyReferenceOption;
$tblDebugMessages = new Table("DebugMessages", "message_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("TenantID", "INT", null, null, true),
new Column("Content", "LONGTEXT", null, null, false),
new Column("SeverityID", "INT", null, 0, false),
new Column("Timestamp", "DATETIME", null, null, false),
new Column("IPAddress", "VARCHAR", 40, "", false)
));
$tables[] = $tblDebugMessages;
$tblDebugMessageBacktraces = new Table("DebugMessageBacktraces", "bt_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("MessageID", "INT", null, null, false),
new Column("FileName", "LONGTEXT", null, null, false),
new Column("LineNumber", "INT", null, null, true)
));
$tblDebugMessageBacktraces->ForeignKeys = array
(
new TableForeignKey("MessageID", new TableForeignKeyColumn($tblDebugMessages, "ID"), TableForeignKeyReferenceOption::Cascade)
);
$tables[] = $tblDebugMessageBacktraces;
$tblDebugMessageParameters = new Table("DebugMessageParameters", "mp_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("MessageID", "INT", null, null, false),
new Column("Name", "LONGTEXT", null, null, false),
new Column("Value", "LONGTEXT", null, null, true)
));
$tblDebugMessageParameters->ForeignKeys = array
(
new TableForeignKey("MessageID", new TableForeignKeyColumn($tblDebugMessages, "ID"), TableForeignKeyReferenceOption::Cascade)
);
$tables[] = $tblDebugMessageParameters;
?>

View File

@ -1,213 +0,0 @@
<?php
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
$tables[] = new Table("Languages", "language_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("TenantID", "INT", null, null, false),
new Column("Name", "VARCHAR", 5, null, false),
new Column("Title", "VARCHAR", 50, null, false)
),
array
(
new Record(array
(
new RecordColumn("Name", "en-US"),
new RecordColumn("Title", "English (United States)")
))
));
$tables[] = new Table("LanguageStrings", "languagestring_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("TenantID", "INT", null, null, false),
new Column("LanguageID", "INT", null, null, false),
new Column("StringName", "VARCHAR", 50, null, false),
new Column("StringValue", "LONGTEXT", null, null, false)
),
array
(
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "like"),
new RecordColumn("StringValue", "Like")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "comment"),
new RecordColumn("StringValue", "Comment")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "download"),
new RecordColumn("StringValue", "Download")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "share"),
new RecordColumn("StringValue", "Share")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "groups"),
new RecordColumn("StringValue", "Groups")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "friends"),
new RecordColumn("StringValue", "Friends")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "nogroups"),
new RecordColumn("StringValue", "This user is not a member of any groups.")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "nofriends"),
new RecordColumn("StringValue", "This user does not have any friends. <a href=\"#\" onclick=\"AddFriendDialog.ShowDialog(); return false;\">Introduce yourself!</a>")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "invitegroup"),
new RecordColumn("StringValue", "Invite this user to join a group")
)),
// === account/settings
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "personal"),
new RecordColumn("StringValue", "Personal Information")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "realname_label"),
new RecordColumn("StringValue", "What's your real name?")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "realname_example"),
new RecordColumn("StringValue", "Johnny Test")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "birthdate_label"),
new RecordColumn("StringValue", "When were you born?")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "birthdate_example"),
new RecordColumn("StringValue", "1994-03-25")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "email_label"),
new RecordColumn("StringValue", "What's your e-mail address?")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "email_example"),
new RecordColumn("StringValue", "somebody@phoenixsns.net")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "appearance"),
new RecordColumn("StringValue", "Appearance and Personalization")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "longname_label"),
new RecordColumn("StringValue", "What do you want to be called?")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "longname_example"),
new RecordColumn("StringValue", "Phenix the Great")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "startpage_label"),
new RecordColumn("StringValue", "When I log in, take me to:")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "shortname_label"),
new RecordColumn("StringValue", "Your site URL name:")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "shortname_example"),
new RecordColumn("StringValue", "phenix")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "language_label"),
new RecordColumn("StringValue", "Default language:")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "security"),
new RecordColumn("StringValue", "Security and Authentication")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "profile_visibility_label"),
new RecordColumn("StringValue", "Who can see my profile?")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "deactivate_account"),
new RecordColumn("StringValue", "Deactivate Account")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "use_with_caution"),
new RecordColumn("StringValue", "Please exercise great care when considering this option. Once done, it cannot be un-done.")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "deactivate_account_warning"),
new RecordColumn("StringValue", "Would you like to deactivate your account and lose all your items, resources, conversation history, friends, group memberships, and other site features? If so, click the link.")
)),
new Record(array
(
new RecordColumn("LanguageID", 1),
new RecordColumn("StringName", "deactivate_account_button"),
new RecordColumn("StringValue", "Yes, please deactivate my account now.")
))
));
?>

View File

@ -1,24 +0,0 @@
<?php
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
$tables[] = new Table("PaymentPlans", "paymentplan_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("Title", "VARCHAR", 256, null, true),
new Column("Description", "LONGTEXT", null, null, true)
),
array
(
new Record(array
(
new RecordColumn("Title", "Unpaid"),
new RecordColumn("Description", "The owner is not paying for the provisioning of this tenant.")
))
));
?>

View File

@ -1,126 +0,0 @@
<?php
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
use PhoenixSNS\Objects\UserPresenceStatus;
use PhoenixSNS\Objects\UserProfileVisibility;
$tables[] = new Table("SecurityPermissions", "permission_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("TenantID", "INT", null, null, false),
new Column("Name", "VARCHAR", 50, null, false),
new Column("Title", "LONGTEXT", null, null, false)
), array
(
// 1
new Record(array
(
new RecordColumn("Name", "GroupCreate"),
new RecordColumn("Title", "Create a group")
)),
new Record(array
(
new RecordColumn("Name", "GroupModify"),
new RecordColumn("Title", "Modify groups created by others")
)),
new Record(array
(
new RecordColumn("Name", "GroupDelete"),
new RecordColumn("Title", "Delete groups created by others")
)),
new Record(array
(
new RecordColumn("Name", "UserBan"),
new RecordColumn("Title", "Ban a user from the network")
)),
// 5
new Record(array
(
new RecordColumn("Name", "PlaceCreate"),
new RecordColumn("Title", "Create a Place as a normal user")
)),
new Record(array
(
new RecordColumn("Name", "PlaceCreateOfficial"),
new RecordColumn("Title", "Create a Place as the official administrative user")
)),
new Record(array
(
new RecordColumn("Name", "PersonalDefaultPageModify"),
new RecordColumn("Title", "Modify your own Default Page")
))
));
$tables[] = new Table("SecurityGroups", "group_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("Title", "VARCHAR", 50, null, false),
new Column("ParentGroupID", "INT", null, null, true)
), array
(
new Record(array
(
new RecordColumn("Title", "Administrator"),
new RecordColumn("ParentGroupID", ColumnValue::Undefined)
)),
new Record(array
(
new RecordColumn("Title", "Moderator"),
new RecordColumn("ParentGroupID", 3)
)),
new Record(array
(
new RecordColumn("Title", "Member")
))
));
$tables[] = new Table("SecurityGroupPermissions", "grouppermission_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("GroupID", "INT", null, null, false),
new Column("PermissionID", "INT", null, null, false)
), array
(
new Record(array
(
new RecordColumn("GroupID", 1), // Administrator
new RecordColumn("PermissionID", 6) // (all moderator permissions) + PlaceCreateOfficial
)),
// MODERATOR PERMISSIONS
new Record(array
(
new RecordColumn("GroupID", 2), // moderator
new RecordColumn("PermissionID", 2) // (all member permissions) + GroupModify
)),
new Record(array
(
new RecordColumn("GroupID", 2), // moderator
new RecordColumn("PermissionID", 4) // (all member permissions) + UserBan
)),
// MEMBER PERMISSIONS
new Record(array
(
new RecordColumn("GroupID", 3), // member
new RecordColumn("PermissionID", 1) // GroupCreate
)),
new Record(array
(
new RecordColumn("GroupID", 3), // member
new RecordColumn("PermissionID", 5) // PlaceCreate
)),
new Record(array
(
new RecordColumn("GroupID", 3), // member
new RecordColumn("PermissionID", 7) // PersonalDefaultPageModify
))
));
?>

View File

@ -1,23 +0,0 @@
<?php
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
$tables[] = new Table("TenantDataCenters", "tdc_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("TenantID", "INT", null, null, true),
new Column("DataCenterID", "INT", null, null, true)
),
array
(
new Record(array
(
new RecordColumn("TenantID", 1),
new RecordColumn("DataCenterID", 1)
))
));
?>

View File

@ -1,29 +0,0 @@
<?php
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
$tables[] = new Table("TenantTypes", "tenanttype_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, true),
new Column("Title", "VARCHAR", 256, null, true),
new Column("Description", "LONGTEXT", null, null, true)
),
array
(
new Record(array
(
new RecordColumn("Title", "Production"),
new RecordColumn("Description", "The production tenant type. Usually the only tenant type visible to regular users. Add more (such as production, development, sandbox, sandbox preview, implementation preview, implementation) as needed.")
)),
new Record(array
(
new RecordColumn("Title", "Development"),
new RecordColumn("Description", "The development tenant type. Usually used to create new features and modules before pushing them to production. Add more (such as production, development, sandbox, sandbox preview, implementation preview, implementation) as needed.")
))
));
?>

View File

@ -1,17 +0,0 @@
<?php
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
$tables[] = new Table("Users", "user_", array
(
// $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement
new Column("ID", "INT", null, null, false, true, true),
new Column("LoginID", "VARCHAR", 50, null, false),
new Column("PasswordHash", "VARCHAR", 256, null, false),
new Column("PasswordSalt", "VARCHAR", 32, null, false)
));
?>

View File

@ -1,125 +0,0 @@
<?php
use Objectify\Objects\DataType;
use Objectify\Objects\MultipleInstanceProperty;
use Objectify\Objects\SingleInstanceProperty;
use Objectify\Objects\TenantObjectProperty;
use Objectify\Objects\TenantObjectInstanceProperty;
use Objectify\Objects\TenantObjectInstancePropertyValue;
use Objectify\Objects\TenantObjectMethodParameter;
use Objectify\Objects\TenantStringTableEntry;
use Objectify\Objects\TenantEnumerationChoice;
$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
(
// property name, data type, default value, value required?, enumeration, require choice from enumeration?
new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")),
new TenantObjectInstanceProperty("ContentType", DataType::GetByName("Text"))
), $objScriptLanguage,
array
(
array
(
new TenantObjectInstancePropertyValue("Name", "JavaScript"),
new TenantObjectInstancePropertyValue("ContentType", "text/javascript")
),
array
(
new TenantObjectInstancePropertyValue("Name", "VBScript"),
new TenantObjectInstancePropertyValue("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
(
// property name, data type, default value, value required?, enumeration, require choice from enumeration?
new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")),
new TenantObjectInstanceProperty("ContentType", DataType::GetByName("Text"))
), $objScriptLanguage, array
(
array
(
new TenantObjectInstancePropertyValue("Name", "PHP"),
new TenantObjectInstancePropertyValue("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
(
// property name, data type, default value, value required?, enumeration, require choice from enumeration?
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
(
// property name, data type, default value, value required?, enumeration, require choice from enumeration?
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", "A code blob that can be used in various scriptable areas on the server.", array
(
// property name, data type, default value, value required?, enumeration, require choice from enumeration?
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);
?>

View File

@ -1,155 +0,0 @@
<?php
use Objectify\Objects\TenantObjectProperty;
use Objectify\Objects\TenantObjectInstanceProperty;
use Objectify\Objects\TenantObjectMethodParameter;
use Objectify\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", "Contains information about a Objectify user account.", array
(
// property name, data type, default value, value required?, enumeration, require choice from enumeration?
new TenantObjectInstanceProperty("LoginID"),
new TenantObjectInstanceProperty("URL"),
new TenantObjectInstanceProperty("DisplayName"),
new TenantObjectInstanceProperty("EmailAddress"),
new TenantObjectInstanceProperty("EmailConfirmationCode"),
new TenantObjectInstanceProperty("BirthDate"),
new TenantObjectInstanceProperty("RealName"),
new TenantObjectInstanceProperty("PasswordHash"),
new TenantObjectInstanceProperty("PasswordSalt"),
new TenantObjectInstanceProperty("Theme"),
new TenantObjectInstanceProperty("Language"),
new TenantObjectInstanceProperty("ProfileVisibility", null, null, true, $enumUserProfileVisibility, true),
new TenantObjectInstanceProperty("ConsecutiveLoginCount"),
new TenantObjectInstanceProperty("ConsecutiveLoginFailures"),
new TenantObjectInstanceProperty("LastLoginTimestamp"),
new TenantObjectInstanceProperty("PresenceStatus", null, null, true, $enumUserPresenceStatus, true),
new TenantObjectInstanceProperty("PresenceMessage"),
new TenantObjectInstanceProperty("RegistrationTimestamp"),
new TenantObjectInstanceProperty("RegistrationIPAddress"),
new TenantObjectInstanceProperty("StartPage")
));
$object->CreateMethod("SaltPassword", array(),
// code goes here... you cannot "use" namespaces here; please put them in NamespaceReferences!!!
<<<'EOD'
return \UUID::Generate();
EOD
, "Generates a Objectify password salt using a Universally Unique Identifier (UUID).");
$object->CreateMethod("HashPassword", array
(
new TenantObjectMethodParameter("input")
),
// code goes here... you cannot "use" namespaces here; please put them in NamespaceReferences!!!
<<<'EOD'
return hash("sha512", $input);
EOD
, "Generates a Objectify password hash using the SHA-512 algorithm.");
$object->CreateMethod("ValidateCredentials", array
(
new TenantObjectMethodParameter("username"),
new TenantObjectMethodParameter("password")
),
// code goes here... you cannot "use" namespaces here; please put them in NamespaceReferences!!!
<<<'EOD'
$tenant = Tenant::GetCurrent();
$inst = $thisObject->GetInstance(array
(
new TenantQueryParameter("LoginID", $username)
));
// if there is no user with this LoginID, return null
if ($inst == null) return null;
// get the password salt used in the creation of this instance
$salt = $inst->GetPropertyValue($thisObject->GetInstanceProperty("PasswordSalt"));
// generate the salted password hash by concatenating the salt and the password
$pwhash = hash("sha512", $salt . $password);
// try to get an instance with the specified login ID and password hash
$user = $thisObject->GetInstance(array
(
new TenantQueryParameter("LoginID", $username),
new TenantQueryParameter("PasswordHash", $pwhash)
));
return $user;
EOD
, "Validates the given user name and password against the database and returns an instance of the User if the validation is successful.", array
(
'Objectify\Objects\Tenant',
'Objectify\Objects\TenantObjectMethodParameterValue',
'Objectify\Objects\TenantQueryParameter'
));
$object->CreateMethod("GetCurrentUser", array(),
// code goes here... you cannot "use" namespaces here; please put them in NamespaceReferences!!!
<<<'EOD'
$tenant = Tenant::GetCurrent();
if (!((isset($_SESSION["CurrentUserName[" . $tenant->ID . "]"])) && (isset($_SESSION["CurrentPassword[" . $tenant->ID . "]"]))))
{
return null;
}
$username = $_SESSION["CurrentUserName[" . $tenant->ID . "]"];
$password = $_SESSION["CurrentPassword[" . $tenant->ID . "]"];
$inst = $thisObject->GetInstance(array
(
new TenantQueryParameter("LoginID", $username)
));
// if there is no user with this LoginID, return null
if ($inst == null) return null;
// get the password salt used in the creation of this instance
$salt = $inst->GetPropertyValue($thisObject->GetInstanceProperty("PasswordSalt"));
// generate the salted password hash by concatenating the salt and the password
$pwhash = hash("sha512", $salt . $password);
// try to get an instance with the specified login ID and password hash
$user = $thisObject->GetInstance(array
(
new TenantQueryParameter("LoginID", $username),
new TenantQueryParameter("PasswordHash", $pwhash)
));
return $user;
EOD
, "Gets the user that is currently logged into Objectify.", array
(
// using statements go here
'Objectify\Objects\Tenant',
'Objectify\Objects\TenantQueryParameter'
));
?>

View File

@ -1,35 +0,0 @@
<?php
use Objectify\Objects\DataType;
use Objectify\Objects\MultipleInstanceProperty;
use Objectify\Objects\SingleInstanceProperty;
use Objectify\Objects\TenantObjectProperty;
use Objectify\Objects\TenantObjectInstanceProperty;
use Objectify\Objects\TenantObjectInstancePropertyValue;
use Objectify\Objects\TenantObjectMethodParameter;
use Objectify\Objects\TenantEnumerationChoice;
$objResourceObject = $tenant->CreateObject("ResourceObject", "Represents a single resource object (StyleSheet, Script, etc.) that is loaded in a ResourceBundle on the Objectify tenant.", array
(
// property name, data type, default value, value required?, enumeration, require choice from enumeration?
new TenantObjectInstanceProperty("Name", DataType::GetByName("Text"))
));
$objStyleSheet = $tenant->CreateObject("StyleSheet", "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", "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", "Contains a bundle of resources (StyleSheets, Scripts, etc.) that are loaded in with the Objectify tenant.", array
(
// property name, data type, default value, value required?, enumeration, require choice from enumeration?
new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")),
new TenantObjectInstanceProperty("ResourceObjects", DataType::GetByName("MultipleInstance"), new MultipleInstanceProperty(array(), array($objResourceObject)))
));
?>

View File

@ -1,231 +0,0 @@
<?php
use Objectify\Objects\DataType;
use Objectify\Objects\MultipleInstanceProperty;
use Objectify\Objects\SingleInstanceProperty;
use Objectify\Objects\TenantObjectProperty;
use Objectify\Objects\TenantObjectInstanceProperty;
use Objectify\Objects\TenantObjectInstancePropertyValue;
use Objectify\Objects\TenantObjectMethodParameter;
$objUserAgent = $tenant->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'
<?php
use Objectify\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">
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.
</div>
</div>
<?php
}
else
{
foreach ($posts as $post)
{
print_r($post);
echo("\n\n");
}
?>
<?php
}
?>
EOD
)
));
$instSectGuestMainPageRegisterPanel = $objPageSection->CreateInstance(array
(
new TenantObjectInstancePropertyValue("Name", "GuestMainPageRegisterPanel"),
new TenantObjectInstancePropertyValue("Content", <<<'EOD'
<?php
use WebFX\System;
?>
<div class="Card">
<form id="frmRegisterDefault" action="<?php echo(System::ExpandRelativePath("~/account/register.page")); ?>" method="POST" style="width: 100%;">
<div class="Title">Don't have an account yet?</div>
<div class="Content">
<h1>Sign up for free right now!</h1>
<div class="Form">
<?php
// Fields required by Objectify (login ID, password, display name, and URL name) come first. After the user
// provides the initial required information, you may follow up with custom Objectify sign-up pages.
?>
<div class="FormItemGroup" style="display: table-row">
<?php
if (System::GetConfigurationValue("Security.Credentials.UserLoginIDIsEmailAddress") == "true")
{
?>
<div class="FormItem" style="display: table-cell">
<div class="FormItemTitle"><label for="txtEmailAddress">E-mail address:</label></div>
<div class="FormItemEntry"><input type="text" id="txtEmailAddress" placeholder="phenix@example.com" /></div>
</div>
<?php
}
else
{
?>
<div class="FormItem" style="display: table-cell">
<div class="FormItemTitle"><label for="txtUserName">Private login ID:</label></div>
<div class="FormItemEntry"><input type="text" id="txtUserName" name="un" placeholder="ph3n1xxx" /></div>
</div>
<?php
}
?>
</div>
<div class="FormItemGroup" style="display: table-row">
<div class="FormItem" style="display: table-cell">
<div class="FormItemTitle"><label for="txtPassword">Private password:</label></div>
<div class="FormItemEntry"><input type="password" id="txtPassword" name="pw" placeholder="S0me*Sup3r/SecRET_passWord!" /></div>
</div>
<div class="FormItem" style="display: table-cell">
<div class="FormItemTitle"><label for="txtPasswordConfirm">Confirm password:</label></div>
<div class="FormItemEntry"><input type="password" id="txtPasswordConfirm" name="pwc" placeholder="" /></div>
</div>
</div>
<div class="FormItemGroup" style="display: table-row">
<div class="FormItem" style="display: table-cell">
<div class="FormItemTitle"><label for="txtDisplayName">Display name:</label></div>
<div class="FormItemEntry"><input type="text" id="txtDisplayName" name="ln" placeholder="Phenix the Great" /></div>
</div>
</div>
<div class="FormItemGroup" style="display: table-row">
<div class="FormItem" style="display: table-cell">
<div class="FormItemTitle"><label for="txtShortURLName">Short URL name:</label></div>
<div class="FormItemEntry"><input type="text" id="txtShortURLName" name="sn" placeholder="phenix" /></div>
</div>
</div>
</div>
</div>
<div class="Actions Horizontal">
<a href="#" onclick="document.getElementById('frmRegisterDefault').submit(); return false;">Register my account</a>
</div>
</form>
</div>
EOD
)
));
$instSectGuestMainPageLoginPanel = $objPageSection->CreateInstance(array
(
new TenantObjectInstancePropertyValue("Name", "GuestMainPageLoginPanel"),
new TenantObjectInstancePropertyValue("Content", <<<'EOD'
<?php
use WebFX\System;
?>
<form id="frmLoginDefault" action="<?php echo(System::ExpandRelativePath("~/account/login.page")); ?>" method="POST" style="width: 100%;">
<div class="Card">
<div class="Title">Already have an account?</div>
<div class="Content">
<div class="FormItemGroup" style="display: table-row">
<?php
if (System::GetConfigurationValue("Security.Credentials.UserLoginIDIsEmailAddress") == "true")
{
?>
<div class="FormItem" style="display: table-cell">
<div class="FormItemEntry"><input type="text" name="member_email" id="txtLoginEmailAddress" placeholder="E-mail address" /></div>
</div>
<?php
}
else
{
?>
<div class="FormItem" style="display: table-cell">
<div class="FormItemEntry"><input type="text" name="member_username" id="txtLoginUserName" placeholder="Private login ID" /></div>
</div>
<?php
}
?>
</div>
<div class="FormItemGroup" style="display: table-row">
<div class="FormItem" style="display: table-cell">
<div class="FormItemEntry"><input type="password" name="member_password" id="txtLoginPassword" placeholder="Password" /></div>
</div>
</div>
</div>
<div class="Actions Horizontal">
<a href="#" onclick="document.getElementById('frmLoginDefault').submit(); return false;">Log In</a>
</div>
</div>
</form>
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"
));
?>

View File

@ -1,28 +0,0 @@
<?php
use Objectify\Objects\DataType;
use Objectify\Objects\MultipleInstanceProperty;
use Objectify\Objects\SingleInstanceProperty;
use Objectify\Objects\TenantObjectProperty;
use Objectify\Objects\TenantObjectInstanceProperty;
use Objectify\Objects\TenantObjectInstancePropertyValue;
use Objectify\Objects\TenantObjectMethodParameter;
use Objectify\Objects\TenantStringTableEntry;
use Objectify\Objects\TenantEnumerationChoice;
$tenant->CreateObject("DataFormat",
array
(
new TenantStringTableEntry($langEnglish, "Data Format")
),
array
(
new TenantStringTableEntry($langEnglish, "A format used to serialize and deserialize documents.")
),
array
(
new TenantObjectInstanceProperty("Name", DataType::GetByName("Text"))
));
?>

View File

@ -1,28 +0,0 @@
<?php
use Objectify\Objects\DataType;
use Objectify\Objects\MultipleInstanceProperty;
use Objectify\Objects\SingleInstanceProperty;
use Objectify\Objects\TenantObjectProperty;
use Objectify\Objects\TenantObjectInstanceProperty;
use Objectify\Objects\TenantObjectInstancePropertyValue;
use Objectify\Objects\TenantObjectMethodParameter;
use Objectify\Objects\TenantStringTableEntry;
use Objectify\Objects\TenantEnumerationChoice;
$tenant->CreateObject("ObjectModel",
array
(
new TenantStringTableEntry($langEnglish, "Object Model")
),
array
(
new TenantStringTableEntry($langEnglish, "A model that provides the in-memory, DataFormat-agnostic representation of document data.")
),
array
(
new TenantObjectInstanceProperty("Name", DataType::GetByName("Text"))
));
?>

View File

@ -1,48 +0,0 @@
<?php
namespace Objectify\Tenant\Pages;
use WebFX\System;
use Objectify\Tenant\MasterPages\WebPage;
use Objectify\Objects\Tenant;
class LoginPage extends WebPage
{
public $InvalidCredentials;
protected function RenderContent()
{
?>
<h1>Authentication Required</h1>
<p>You must log in to view this page.</p>
<form method="POST">
<table style="margin-left: auto; margin-right: auto;" class="Borderless">
<tr>
<td><label for="txtUserName">User <u>N</u>ame</label></td>
<td><input type="text" name="user_LoginID" id="txtUserName" /></td>
</tr>
<tr>
<td><label for="txtPassword"><u>P</u>assword</label></td>
<td><input type="password" name="user_Password" id="txtPassword" /></td>
</tr>
<tr>
<td colspan="2" style="color: #FF0000; text-align: center;">
<?php
if ($this->InvalidCredentials)
{
?>Incorrect user name/password combination.<?php
}
?>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: right;">
<input type="submit" value="Continue" />
</td>
</tr>
</table>
</form>
<?php
}
}
?>

View File

@ -1,116 +0,0 @@
<?php
namespace Objectify\Tenant\Pages;
use WebFX\System;
use Objectify\Tenant\MasterPages\WebPage;
use Objectify\Objects\Tenant;
class MainPage extends WebPage
{
protected function RenderContent()
{
$tenants = Tenant::Get();
?>
<h1>Tenant Management</h1>
<p>There are <?php echo(count($tenants)); ?> tenants in total.</p>
<div class="Toolbar">
<a class="Button" href="<?php echo(System::ExpandRelativePath("~/tenant/create")); ?>">Create New Tenant</a>
</div>
<?php
$countActive = 0;
$countExpired = 0;
foreach ($tenants as $tenant)
{
if ($tenant->IsExpired())
{
$countExpired++;
}
else
{
$countActive++;
}
}
?>
<h2>Active Tenants (<?php echo($countActive); ?>)</h2>
<table class="ListView" style="width: 100%;" border="1">
<tr>
<th>Tenant Name</th>
<th>Tenant Type</th>
<th>Data Centers</th>
<th>Payment Plan</th>
<th>Activation Date</th>
<th>Termination Date</th>
<th>Description</th>
<th>Actions</th>
</tr>
<?php
foreach ($tenants as $tenant)
{
if ($tenant->IsExpired()) continue;
?>
<tr>
<td><a href="<?php echo(System::ExpandRelativePath("~/tenant/launch/" . $tenant->URL)); ?>" target="_blank"><?php echo($tenant->URL); ?></a></td>
<td><?php echo($tenant->Type->Title); ?></td>
<td><?php
foreach ($tenant->DataCenters->Items as $item)
{
echo("<a href=\"http://" . $item->HostName . "/" . $tenant->URL . "\">" . $item->Title . " (" . $item->HostName . ")</a><br />");
}
?></td>
<td><?php echo($tenant->PaymentPlan->Title); ?></td>
<td><?php echo($tenant->BeginTimestamp == null ? "(indefinite)" : $tenant->BeginTimestamp); ?></td>
<td><?php echo($tenant->EndTimestamp == null ? "(indefinite)" : $tenant->EndTimestamp); ?></td>
<td><?php echo($tenant->Description); ?></td>
<td style="text-align: center;">
<a href="<?php echo(System::ExpandRelativePath("~/tenant/manage/" . $tenant->URL)); ?>">Manage</a> |
<a href="<?php echo(System::ExpandRelativePath("~/tenant/modify/" . $tenant->URL)); ?>">Edit</a> |
<a href="<?php echo(System::ExpandRelativePath("~/tenant/clone/" . $tenant->URL)); ?>">Clone</a> |
<a href="<?php echo(System::ExpandRelativePath("~/tenant/delete/" . $tenant->URL)); ?>">Delete</a>
</td>
</tr>
<?php
}
?>
</table>
<h2>Inactive Tenants (<?php echo($countExpired); ?>)</h2>
<table class="ListView" style="width: 100%;" border="1">
<tr>
<th>Tenant Name</th>
<th>Tenant Type</th>
<th>Data Centers</th>
<th>Payment Plan</th>
<th>Activation Date</th>
<th>Termination Date</th>
<th>Description</th>
<th>Actions</th>
</tr>
<?php
foreach ($tenants as $tenant)
{
if (!$tenant->IsExpired()) continue;
?>
<tr>
<td><a href="<?php echo(System::ExpandRelativePath("~/tenant/launch/" . $tenant->URL)); ?>" target="_blank"><?php echo($tenant->URL); ?></a></td>
<td><?php echo($tenant->Type->Title); ?></td>
<td><?php echo($tenant->DataCenter->Title); ?></td>
<td><?php echo($tenant->PaymentPlan->Title); ?></td>
<td><?php echo($tenant->BeginTimestamp == null ? "(indefinite)" : $tenant->BeginTimestamp); ?></td>
<td><?php echo($tenant->EndTimestamp == null ? "(indefinite)" : $tenant->EndTimestamp); ?></td>
<td><?php echo($tenant->Description); ?></td>
<td style="text-align: center;">
<a href="<?php echo(System::ExpandRelativePath("~/tenant/manage/" . $tenant->URL)); ?>">Manage</a> |
<a href="<?php echo(System::ExpandRelativePath("~/tenant/modify/" . $tenant->URL)); ?>">Edit</a> |
<a href="<?php echo(System::ExpandRelativePath("~/tenant/clone/" . $tenant->URL)); ?>">Clone</a> |
<a href="<?php echo(System::ExpandRelativePath("~/tenant/delete/" . $tenant->URL)); ?>">Delete</a>
</td>
</tr>
<?php
}
?>
</table>
<?php
}
}
?>

View File

@ -1,104 +0,0 @@
<?php
namespace Objectify\Tenant\Pages;
use WebFX\System;
use Objectify\Tenant\MasterPages\WebPage;
use Objectify\Objects\DataCenter;
use Objectify\Objects\PaymentPlan;
use Objectify\Objects\Tenant;
use Objectify\Objects\TenantStatus;
use Objectify\Objects\TenantType;
class TenantPropertiesPage extends WebPage
{
public $Tenant;
protected function Initialize()
{
if ($this->Tenant != null)
{
$this->Title = "Edit Tenant Configuration: " . $this->Tenant->URL;
}
else
{
$this->Title = "Create New Tenant";
}
}
protected function RenderContent()
{
?>
<h1>Edit Tenant Configuration</h1>
<form method="POST">
<table style="margin-left: auto; margin-right: auto; width: 500px;">
<tr>
<td style="width: 160px;"><label for="txtTenantURL">Name:</label></td>
<td colspan="2"><input type="text" style="width: 100%;" id="txtTenantURL" name="tenant_URL" value="<?php if ($this->Tenant != null) echo($this->Tenant->URL); ?>" /></td>
</tr>
<tr>
<td><label for="cboTenantType">Type:</label></td>
<td colspan="2">
<select id="cboTenantType" name="tenant_TypeID">
<?php
$tenanttypes = TenantType::Get();
foreach ($tenanttypes as $tenanttype)
{
?><option<?php if ($this->Tenant != null && $this->Tenant->Type != null && $tenanttype->ID == $this->Tenant->Type->ID) { echo(" selected=\"selected\""); } ?> value="<?php echo($tenanttype->ID); ?>"><?php echo($tenanttype->Title); ?></option><?php
}
?>
</select>
</td>
</tr>
<tr>
<td><label for="cboDataCenter">Data center:</label></td>
<td colspan="2">
<?php
$datacenters = DataCenter::Get();
foreach ($datacenters as $datacenter)
{
?><div><input type="checkbox" value="1" <?php if ($this->Tenant != null && $this->Tenant->DataCenters->Contains($datacenter)) { echo(" checked=\"checked\""); } ?> name="tenant_DataCenter_<?php echo($datacenter->ID); ?>" id="txtTenantDataCenter_<?php echo($datacenter->ID); ?>" /><label for="txtTenantDataCenter_<?php echo($datacenter->ID); ?>"><?php echo($datacenter->Title); ?></label><?php
}
?>
</select>
</td>
</tr>
<tr>
<td><label for="cboPaymentPlan">Payment plan:</label></td>
<td colspan="2">
<select id="cboPaymentPlan" name="tenant_PaymentPlanID">
<?php
$paymentplans = PaymentPlan::Get();
foreach ($paymentplans as $paymentplan)
{
?><option<?php if ($this->Tenant != null && $this->Tenant->PaymentPlan != null && $paymentplan->ID == $this->Tenant->PaymentPlan->ID) { echo(" selected=\"selected\""); } ?> value="<?php echo($paymentplan->ID); ?>"><?php echo($paymentplan->Title); ?></option><?php
}
?>
</select>
</td>
</tr>
<tr>
<td><label for="txtActivationDate">Activation date:</label></td>
<td><input type="text" style="width: 100%;" id="txtActivationDate" name="tenant_BeginTimestamp" value="<?php if ($this->Tenant != null) echo($this->Tenant->BeginTimestamp); ?>" /></td>
<td style="width: 96px"><input type="checkbox" id="chkActivationDateValid" name="tenant_BeginTimestampValid" value="1" /><label for="chkActivationDateValid">Indefinite</label></td>
</tr>
<tr>
<td><label for="txtTerminationDate">Termination date:</label></td>
<td><input type="text" style="width: 100%;" id="txtTerminationDate" name="tenant_EndTimestamp" value="<?php if ($this->Tenant != null) echo($this->Tenant->EndTimestamp); ?>" /></td>
<td style="width: 96px"><input type="checkbox" id="chkTerminationDateValid" name="tenant_EndTimestampValid" value="1" /><label for="chkTerminationDateValid">Indefinite</label></td>
</tr>
<tr>
<td style="vertical-align: top;"><label for="txtDescription">Description:</label></td>
<td colspan="2"><textarea style="width: 100%;" rows="5" id="txtDescription" name="tenant_Description"><?php if ($this->Tenant != null) echo($this->Tenant->Description); ?></textarea></td>
</tr>
</table>
<div class="Buttons">
<input type="submit" value="Save Changes" />
<a class="Button" href="<?php echo(System::ExpandRelativePath("~/tenant")); ?>">Cancel</a>
</div>
</form>
<?php
}
}
?>

View File

@ -1,39 +0,0 @@
<?php
namespace Objectify\Tenant\Pages;
use WebFX\System;
use Objectify\Tenant\MasterPages\WebPage;
// use Objectify\Objects\DataCenter;
use Objectify\Objects\PaymentPlan;
use Objectify\Objects\Tenant;
use Objectify\Objects\TenantStatus;
use Objectify\Objects\TenantType;
class ConfirmOperationPage extends WebPage
{
public $Message;
public $ReturnButtonURL;
public function __construct()
{
parent::__construct();
$this->ReturnButtonURL = "~/";
}
protected function RenderContent()
{
?>
<h1>Confirm Operation</h1>
<p><?php echo($this->Message); ?></p>
<form method="POST">
<input type="hidden" name="Confirm" value="1" />
<input type="submit" value="Continue" />
<a class="Button" href="<?php echo(System::ExpandRelativePath($this->ReturnButtonURL)); ?>">Cancel</a>
</form>
<?php
}
}
?>

View File

@ -1,125 +0,0 @@
<?php
namespace Objectify\Tenant\Pages;
use WebFX\System;
use WebFX\Controls\TabContainer;
use WebFX\Controls\TabPage;
use Objectify\Tenant\MasterPages\WebPage;
use Objectify\Objects\Module;
use Objectify\Objects\PaymentPlan;
use Objectify\Objects\Tenant;
use Objectify\Objects\TenantObject;
use Objectify\Objects\TenantProperty;
use Objectify\Objects\TenantPropertyValue;
use Objectify\Objects\TenantStatus;
use Objectify\Objects\TenantType;
class TenantManagementPage extends WebPage
{
public $Tenant;
protected function Initialize()
{
$this->Title = "Manage Tenant: " . $this->Tenant->URL;
}
protected function RenderContent()
{
?>
<h1>Tenant: <?php echo($this->Tenant->URL); ?></h1>
<form method="POST">
<?php
$tbs = new TabContainer("tbsTabs");
$tbs->TabPages[] = new TabPage("tabCustomProperties", "Custom Properties", null, null, null, function()
{
?>
<table class="ListView" style="width: 100%;">
<tr id="Property_Header">
<th style="width: 32px;"><a href="#" onclick="AddPropertyBelow('Header');" title="Add Below">[+]</a></th>
<th style="width: 256px;">Property</th>
<th>Description</th>
<th style="width: 256px;">Value</th>
</tr>
<?php
$properties = $this->Tenant->GetProperties();
foreach ($properties as $property)
{
?>
<tr id="Property_<?php echo($property->ID); ?>">
<td style="width: 32px;"><a href="#" onclick="AddPropertyBelow('<?php echo($property->ID); ?>');" title="Add Below">[+]</a></td>
<td><?php echo($property->Name); ?></td>
<td><?php echo($property->Description); ?></td>
<td><?php $property->RenderEditor($this->Tenant->GetPropertyValue($property)); ?></td>
</tr>
<?php
}
?>
</table>
<?php
});
$tbs->TabPages[] = new TabPage("tabEnabledModules", "Enabled Modules", null, null, null, function()
{
?>
<p>Click on a module name to configure the module on this tenant.</p>
<table class="ListView" style="width: 100%;">
<tr>
<th style="width: 128px;">Module</th>
<th>Description</th>
</tr>
<?php
$modules = Module::Get(null, $this->Tenant);
foreach ($modules as $module)
{
?>
<tr>
<td><input id="chkModule_<?php echo($module->ID); ?>" type="checkbox"<?php if ($module->Enabled) { echo(" checked=\"checked\""); } ?> /> <a href="<?php echo(System::ExpandRelativePath("~/tenant/manage/" . $this->Tenant->URL . "/modules/" . $module->ID)); ?>"><?php echo($module->Title); ?></a></td>
<td><?php echo($module->Description); ?></td>
</tr>
<?php
}
?>
</table>
<?php
});
$tbs->TabPages[] = new TabPage("tabGlobalObjects", "Global Objects", null, null, null, function()
{
?>
<p>Lists all of the objects that are available on this tenant that are not associated with a particular Module.</p>
<table class="ListView" style="width: 100%;">
<tr>
<th style="width: 128px;">Object</th>
<th>Description</th>
<th>Instances</th>
</tr>
<?php
$objects = TenantObject::Get(null, $this->Tenant);
foreach ($objects as $object)
{
?>
<tr>
<td><a href="<?php echo(System::ExpandRelativePath("~/tenant/manage/" . $this->Tenant->URL . "/objects/" . $object->ID)); ?>"><?php echo($object->Name); ?></a></td>
<td><?php echo($object->Description); ?></td>
<td><a href="<?php echo(System::ExpandRelativePath("~/tenant/manage/" . $this->Tenant->URL . "/objects/" . $object->ID . "/instances")); ?>"><?php echo($object->CountInstances()); ?></a></td>
</tr>
<?php
}
?>
</table>
<?php
});
$tbs->Render();
?>
<div class="Buttons">
<input type="submit" value="Save Changes" />
<a class="Button" href="<?php echo(System::ExpandRelativePath("~/tenant")); ?>">Cancel</a>
</div>
</form>
<?php
}
}
?>

View File

@ -1,95 +0,0 @@
<?php
namespace Objectify\Tenant\Pages;
use WebFX\System;
use Objectify\Tenant\MasterPages\WebPage;
// use Objectify\Objects\DataCenter;
use Objectify\Objects\Module;
use Objectify\Objects\PaymentPlan;
use Objectify\Objects\Tenant;
use Objectify\Objects\TenantProperty;
use Objectify\Objects\TenantPropertyValue;
use Objectify\Objects\TenantStatus;
use Objectify\Objects\TenantType;
class TenantModuleManagementPage extends WebPage
{
public $Tenant;
public $Module;
protected function Initialize()
{
if ($this->Module != null)
{
$this->Title = "Manage Tenant Module: " . $this->Module->Title . " on " . $this->Tenant->URL;
}
else
{
$this->Title = "Manage Tenant Modules: " . $this->Tenant->URL;
}
}
protected function RenderContent()
{
if ($this->Module != null)
{
?>
<h1>Module: <?php echo($this->Module->Title); ?> on <?php echo($this->Tenant->URL); ?></h1>
<h2>Module Configurable Properties</h2>
<table style="width: 100%;">
<tr id="Property_Header">
<th style="width: 32px;"><a href="#" onclick="AddPropertyBelow('Header');" title="Add Below">[+]</a></th>
<th style="width: 256px;">Property</th>
<th>Value</th>
</tr>
<?php
/*
$properties = $this->Module->GetProperties();
foreach ($properties as $property)
{
?>
<tr id="Property_<?php echo($property->ID); ?>">
<td style="width: 32px;"><a href="#" onclick="AddPropertyBelow('<?php echo($property->ID); ?>');" title="Add Below">[+]</a></td>
<td><?php echo($property->Title); ?></td>
<td><input style="width: 100%;" type="text" id="txtProperty_<?php echo($property->ID); ?>" name="Property_<?php echo($property->ID); ?>" value="<?php echo($this->Tenant->GetPropertyValue($property)); ?>" /></td>
</tr>
<?php
}
*/
?>
</table>
<?php
}
else
{
?>
<h1>Tenant: <?php echo($this->Tenant->URL); ?></h1>
<?php
}
?>
<h2>Tenant Enabled Modules</h2>
<p>Click on a module name to configure it</p>
<table style="width: 100%;">
<tr>
<th style="width: 128px;">Module</th>
<th>Description</th>
</tr>
<?php
$modules = Module::Get(null, $this->Tenant);
foreach ($modules as $module)
{
?>
<tr>
<td><input id="chkModule_<?php echo($module->ID); ?>" type="checkbox"<?php if ($module->Enabled) { echo(" checked=\"checked\""); } ?> /> <a href="<?php echo(System::ExpandRelativePath("~/tenant/manage/" . $this->Tenant->URL . "/modules/" . $module->ID)); ?>"><?php echo($module->Title); ?></a></td>
<td><?php echo($module->Description); ?></td>
</tr>
<?php
}
?>
</table>
<?php
}
}
?>

View File

@ -1,41 +0,0 @@
<?php
namespace Objectify\Tenant\Pages;
use WebFX\System;
use Objectify\Tenant\MasterPages\WebPage;
use Objectify\Objects\Module;
class ModuleMainPage extends WebPage
{
protected function RenderContent()
{
$modules = Module::Get();
?>
<h1>Module Management</h1>
<p>There are <?php echo(count($modules)); ?> modules in total. Click a module name to configure that module.</p>
<div class="Toolbar">
<a class="Button" href="<?php echo(System::ExpandRelativePath("~/module/create")); ?>">Create New Module</a>
</div>
<table style="width: 100%;" border="1">
<tr>
<th>Module</th>
<th>Description</th>
</tr>
<?php
foreach ($modules as $module)
{
?>
<tr>
<td><a href="<?php echo(System::ExpandRelativePath("~/module/modify/" . $module->ID)); ?>"><?php echo($module->Title); ?></a></td>
<td><?php echo($module->Description); ?></td>
</tr>
<?php
}
?>
</table>
<?php
}
}
?>

View File

@ -1,84 +0,0 @@
<?php
namespace Objectify\Tenant\Pages;
use WebFX\System;
use Objectify\Tenant\MasterPages\WebPage;
use Objectify\Objects\Module;
class ModuleManagementPage extends WebPage
{
public $Module;
protected function Initialize()
{
$this->Title = "Manage Module: " . $this->Module->Title;
}
protected function RenderContent()
{
?>
<h1>Module Management</h1>
<h2><?php echo($this->Module->Title); ?></h2>
<form method="POST">
<h3>Information</h3>
<table style="width: 100%;" border="1">
<tr>
<td style="width: 100px;">Title: </td>
<td><input name="module_Title" type="text" value="<?php echo($this->Module->Title); ?>" /></td>
</tr>
<tr>
<td style="vertical-align: top;">Description: </td>
<td><textarea name="module_Description" style="width: 100%;" rows="5"><?php echo($this->Module->Description); ?></textarea></td>
</tr>
</table>
<h3>Application Menu Items</h3>
<table>
<tr>
<th>Title</th>
<th>Description</th>
<th>Target</th>
</tr>
<?php
$menuitems = $this->Module->GetMainMenuItems();
foreach ($menuitems as $menuitem)
{
?>
<tr>
<td><?php echo($menuitem->Title); ?></td>
<td><?php echo($menuitem->Description); ?></td>
<td><?php echo($menuitem->TargetURL); ?></td>
</tr>
<?php
}
?>
</table>
<h3>Module Pages</h3>
<table>
<tr>
<th>URL</th>
</tr>
<?php
/*
foreach ($modules as $module)
{
?>
<tr>
<td><a href="<?php echo(System::ExpandRelativePath("~/module/modify/" . $module->ID)); ?>"><?php echo($module->Title); ?></a></td>
</tr>
<?php
}
*/
?>
</table>
<div class="Buttons" style="text-align: right;">
<input type="submit" value="Save Changes" /> <a href="<?php echo(System::ExpandRelativePath("~/module")); ?>">Back to Modules</a>
</div>
</form>
<?php
}
}
?>

View File

@ -1,43 +0,0 @@
<?php
namespace Objectify\Tenant\Pages;
use WebFX\System;
use Objectify\Tenant\MasterPages\WebPage;
use Objectify\Objects\DataCenter;
class DataCenterMainPage extends WebPage
{
protected function RenderContent()
{
$datacenters = DataCenter::Get();
?>
<h1>Data Center Management</h1>
<p>There are <?php echo(count($datacenters)); ?> data centers in total. Click a data center name to configure that data center.</p>
<div class="Toolbar">
<a class="Button" href="<?php echo(System::ExpandRelativePath("~/datacenter/create")); ?>">Create New Data Center</a>
</div>
<table class="ListView" style="width: 100%;">
<tr>
<th>Data Center</th>
<th>Description</th>
<th>Hostname</th>
</tr>
<?php
foreach ($datacenters as $datacenter)
{
?>
<tr>
<td><a href="<?php echo(System::ExpandRelativePath("~/datacenter/modify/" . $datacenter->ID)); ?>"><?php echo($datacenter->Title); ?></a></td>
<td><?php echo($datacenter->Description); ?></td>
<td><a href="http://<?php echo($datacenter->HostName); ?>"><?php echo($datacenter->HostName); ?></a></td>
</tr>
<?php
}
?>
</table>
<?php
}
}
?>

View File

@ -1,48 +0,0 @@
<?php
namespace Objectify\Tenant\Pages;
use WebFX\System;
use Objectify\Tenant\MasterPages\WebPage;
use Objectify\Objects\DataCenter;
class DataCenterManagementPage extends WebPage
{
public $DataCenter;
protected function Initialize()
{
$this->Title = "Manage Data Center: " . $this->DataCenter->Title;
}
protected function RenderContent()
{
?>
<h1>Data Center Management</h1>
<h2><?php echo($this->DataCenter->Title); ?></h2>
<form method="POST">
<h3>Information</h3>
<table style="width: 100%;" border="1">
<tr>
<td style="width: 100px;">Title: </td>
<td><input name="datacenter_Title" type="text" value="<?php echo($this->DataCenter->Title); ?>" /></td>
</tr>
<tr>
<td style="vertical-align: top;">Description: </td>
<td><textarea name="datacenter_Description" style="width: 100%;" rows="5"><?php echo($this->DataCenter->Description); ?></textarea></td>
</tr>
<tr>
<td style="vertical-align: top;">Hostname: </td>
<td><input name="datacenter_HostName" type="text" value="<?php echo($this->DataCenter->HostName); ?>" /></td>
</tr>
</table>
<div class="Buttons" style="text-align: right;">
<input type="submit" value="Save Changes" /> <a href="<?php echo(System::ExpandRelativePath("~/datacenter")); ?>">Back to Data Centers</a>
</div>
</form>
<?php
}
}
?>

View File

@ -1,224 +0,0 @@
<?php
namespace Objectify\Tenant\Pages;
use WebFX\System;
use WebFX\Controls\TabContainer;
use WebFX\Controls\TabPage;
use Objectify\Tenant\MasterPages\WebPage;
// use Objectify\Objects\DataCenter;
use Objectify\Objects\Module;
use Objectify\Objects\PaymentPlan;
use Objectify\Objects\Tenant;
use Objectify\Objects\TenantObject;
use Objectify\Objects\TenantProperty;
use Objectify\Objects\TenantPropertyValue;
use Objectify\Objects\TenantStatus;
use Objectify\Objects\TenantType;
class TenantObjectManagementPage extends WebPage
{
public $CurrentTenant;
public $CurrentObject;
protected function Initialize()
{
if ($this->CurrentObject != null)
{
$this->Title = "Manage Tenant Object: " . $this->CurrentObject->Name . " on " . $this->CurrentTenant->URL;
}
else
{
$this->Title = "Manage Tenant Objects: " . $this->CurrentTenant->URL;
}
}
protected function RenderContent()
{
if ($this->CurrentObject != null)
{
?>
<h1>Object: <?php echo($this->CurrentObject->Name); ?> on <?php echo($this->CurrentTenant->URL); ?></h1>
<form method="POST">
<?php
$tbs = new TabContainer("tbsObject");
// ID title imageurl targeturl script contentfunc
$tbs->TabPages[] = new TabPage("tabStaticProperties", "Static Properties", null, null, null, function()
{
?>
<table class="ListView" style="width: 100%;">
<tr id="Property_Header">
<th style="width: 32px;"><a href="#" onclick="AddPropertyBelow('Header');" title="Add Below">[+]</a></th>
<th style="width: 256px;">Property</th>
<th style="width: 128px;">Data Type</th>
<th>Default Value</th>
</tr>
<?php
$properties = $this->CurrentObject->GetProperties();
foreach ($properties as $property)
{
?>
<tr id="StaticProperty_<?php echo($property->ID); ?>">
<td style="width: 32px;"><a href="#" onclick="AddStaticPropertyBelow('<?php echo($property->ID); ?>');" title="Add Below">[+]</a></td>
<td><?php echo($property->Name); ?></td>
<td><?php echo($property->DataType == null ? "(undefined)" : "<a href=\"" . System::ExpandRelativePath("~/datatype/modify/" . $property->DataType->ID) . "\">" . $property->DataType->Name . "</a>"); ?></td>
<td>
<?php
if ($property->DataType == null || $property->DataType->ColumnRendererCodeBlob == null)
{
?>
<input style="width: 100%;" type="text" id="txtStaticProperty_<?php echo($property->ID); ?>" name="StaticProperty_<?php echo($property->ID); ?>" value="<?php echo($property->DefaultValue); ?>" />
<?php
}
else
{
call_user_func($property->DataType->ColumnRendererCodeBlob, $property->Value);
}
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
});
$tbs->TabPages[] = new TabPage("tabInstanceProperties", "Instance Properties", null, null, null, function()
{
?>
<script type="text/javascript">
function AddInstancePropertyBelow(id)
{
var hdnNewPropertyCount = document.getElementById("hdnNewPropertyCount");
hdnNewPropertyCount.value = parseInt(hdnNewPropertyCount.value) + 1;
var parentRow = document.getElementById("InstanceProperty_" + id);
var table = parentRow.parentElement;
var tr = table.insertRow(parentRow.sectionRowIndex + 1);
var tdAdd = tr.insertCell(-1);
tdAdd.innerHTML = "<a href=\"#\" onclick=\"AddInstancePropertyBelow('');\" title=\"Add Below\">[+]</a>";
var tdProperty = tr.insertCell(-1);
tdProperty.innerHTML = "<input type=\"text\" name=\"InstanceProperty_" + hdnNewPropertyCount.value + "_Name\" />";
var tdDataType = tr.insertCell(-1);
tdDataType.innerHTML = "<input type=\"text\" name=\"InstanceProperty_" + hdnNewPropertyCount.value + "_DataTypeID\" />";
var tdDefaultValue = tr.insertCell(-1);
tdDefaultValue.innerHTML = "<input type=\"text\" name=\"InstanceProperty_" + hdnNewPropertyCount.value + "_DefaultValue\" />";
}
</script>
<input type="hidden" id="hdnNewPropertyCount" name="InstanceProperty_NewPropertyCount" value="0" />
<table class="ListView" style="width: 100%;">
<tr id="InstanceProperty_Header">
<th style="width: 32px;"><a href="#" onclick="AddInstancePropertyBelow('Header'); return false;" title="Add Below">[+]</a></th>
<th style="width: 256px;">Property</th>
<th style="width: 128px;">Data Type</th>
<th>Default Value</th>
</tr>
<?php
$properties = $this->CurrentObject->GetInstanceProperties();
foreach ($properties as $property)
{
?>
<tr id="InstanceProperty_<?php echo($property->ID); ?>">
<td style="width: 32px;"><a href="#" onclick="AddInstancePropertyBelow('<?php echo($property->ID); ?>'); return false;" title="Add Below">[+]</a></td>
<td><?php echo($property->Name); ?></td>
<td><?php echo($property->DataType == null ? "(undefined)" : "<a href=\"" . System::ExpandRelativePath("~/datatype/modify/" . $property->DataType->ID) . "\">" . $property->DataType->Name . "</a>"); ?></td>
<td>
<?php
$property->RenderColumn();
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
});
$tbs->TabPages[] = new TabPage("tabStaticMethods", "Static Methods", null, null, null, function()
{
?>
<table class="ListView" style="width: 100%;">
<tr id="StaticMethod_Header">
<th style="width: 32px;"><a href="#" onclick="AddStaticMethodBelow('Header');" title="Add Below">[+]</a></th>
<th style="width: 256px;">Method</th>
<th>Description</th>
<th style="width: 128px;">Return Data Type</th>
</tr>
<?php
$methods = $this->CurrentObject->GetMethods();
foreach ($methods as $method)
{
?>
<tr id="StaticMethod_<?php echo($method->ID); ?>">
<td style="width: 32px;"><a href="#" onclick="AddStaticMethodBelow('<?php echo($method->ID); ?>');" title="Add Below">[+]</a></td>
<td><a href="<?php echo(System::ExpandRelativePath("~/tenant/manage/" . $this->CurrentTenant->URL . "/objects/" . $this->CurrentObject->ID . "/methods/static/" . $method->ID)); ?>"><?php echo($method->Name); ?></a></td>
<td><?php echo($method->Description); ?></td>
<td><?php /* echo($method->DataType == null ? "(undefined)" : "<a href=\"#\">" . $method->DataType->Name . "</a>"); */ ?></td>
</tr>
<?php
}
?>
</table>
<?php
});
$tbs->TabPages[] = new TabPage("tabInstances", "Instances", null, null, null, function()
{
?>
<table style="width: 100%;">
<tr id="Property_Header">
<?php
$properties = $this->CurrentObject->GetInstanceProperties();
foreach ($properties as $property)
{
if ($property->ColumnVisible)
{
echo("<th>" . $property->Name . "</th>");
}
}
?>
</tr>
<?php
$instances = $this->CurrentObject->GetInstances();
foreach ($instances as $instance)
{
?>
<tr id="Property_<?php echo($property->ID); ?>">
<?php
foreach ($properties as $property)
{
if ($property->ColumnVisible)
{
echo("<td>");
$value = $instance->GetPropertyValue($property);
$property->RenderColumn($value);
echo("</td>");
}
}
?>
</tr>
<?php
}
?>
</table>
<?php
});
$tbs->Render();
?>
<div class="Buttons">
<input type="submit" value="Save Changes" />
<a class="Button" href="<?php echo(System::ExpandRelativePath("~/tenant/manage/" . $this->CurrentTenant->URL)); ?>">Cancel</a>
</div>
</form>
<?php
}
}
}
?>

View File

@ -1,96 +0,0 @@
<?php
namespace Objectify\Tenant\Pages;
use WebFX\System;
use WebFX\WebScript;
use WebFX\WebStyleSheet;
use Objectify\Tenant\MasterPages\WebPage;
// use Objectify\Objects\DataCenter;
use Objectify\Objects\Module;
use Objectify\Objects\PaymentPlan;
use Objectify\Objects\Tenant;
use Objectify\Objects\TenantObject;
use Objectify\Objects\TenantProperty;
use Objectify\Objects\TenantPropertyValue;
use Objectify\Objects\TenantStatus;
use Objectify\Objects\TenantType;
class TenantObjectMethodManagementPage extends WebPage
{
public $CurrentMethod;
public $CurrentTenant;
public $CurrentObject;
public function __construct()
{
parent::__construct();
$this->StyleSheets[] = new WebStyleSheet("http://static.alcehosting.net/dropins/CodeMirror/StyleSheets/CodeMirror.css");
$this->Scripts[] = new WebScript("http://static.alcehosting.net/dropins/CodeMirror/Scripts/Addons/Edit/MatchBrackets.js");
$this->Scripts[] = new WebScript("http://static.alcehosting.net/dropins/CodeMirror/Scripts/Modes/clike/clike.js");
$this->Scripts[] = new WebScript("http://static.alcehosting.net/dropins/CodeMirror/Scripts/Modes/php/php.js");
}
protected function Initialize()
{
if ($this->CurrentMethod != null)
{
$this->Title = "Manage Method: " . $this->CurrentMethod->Name . " on " . $this->CurrentObject->Name . "@" . $this->CurrentTenant->URL;
}
else
{
$this->Title = "Manage Methods for Object: " . $this->CurrentObject->Name . " on " . $this->CurrentTenant->URL;
}
}
protected function RenderContent()
{
if ($this->CurrentObject != null)
{
?>
<h1>Method: <?php echo($this->CurrentMethod->Name); ?> on <?php echo($this->CurrentObject->Name); ?>@<?php echo($this->CurrentTenant->URL); ?></h1>
<table class="FormView">
<tr class="Required">
<td><label for="txtMethodName">Method Name</label></td>
<td><input type="text" id="txtMethodName" name="method_Name" value="<?php echo($this->CurrentMethod->Name); ?>" /></td>
</tr>
</table>
<h2>Code Blob</h2>
<form method="POST">
<textarea id="txtCodeBlob" name="method_CodeBlob" style="width: 100%;" rows="40"><?php echo($this->CurrentMethod->CodeBlob); ?></textarea>
<style type="text/css">
.CodeMirror
{
border: dotted 1px #AAAAAA;
line-height: 18px;
}
.CodeMirror .CodeMirror-linenumbers
{
width: 48px;
}
</style>
<script type="text/javascript">
var txtCodeBlob = document.getElementById("txtCodeBlob");
var editor = CodeMirror.fromTextArea(txtCodeBlob,
{
lineNumbers: true,
matchBrackets: true,
mode: "text/x-php",
indentUnit: 4,
indentWithTabs: true
});
</script>
<div class="Buttons">
<input type="submit" value="Save Changes" />
<a class="Button" href="<?php echo(System::ExpandRelativePath("~/tenant/manage/" . $this->CurrentTenant->URL . "/objects/" . $this->CurrentObject->ID)); ?>">Discard Changes</a>
</div>
</form>
<?php
}
}
}
?>

View File

@ -1,75 +0,0 @@
<?php
namespace Objectify\Tenant\Pages;
use WebFX\System;
use Objectify\Tenant\MasterPages\WebPage;
// use Objectify\Objects\DataCenter;
use Objectify\Objects\Module;
use Objectify\Objects\PaymentPlan;
use Objectify\Objects\Tenant;
use Objectify\Objects\TenantObject;
use Objectify\Objects\TenantProperty;
use Objectify\Objects\TenantPropertyValue;
use Objectify\Objects\TenantStatus;
use Objectify\Objects\TenantType;
class TenantObjectInstanceBrowsePage extends WebPage
{
public $CurrentTenant;
public $CurrentObject;
protected function Initialize()
{
$this->Title = "Browse Instances of Tenant Object: " . $this->CurrentObject->Name . " on " . $this->CurrentTenant->URL;
}
protected function RenderContent()
{
if ($this->CurrentObject != null)
{
?>
<h1>Object: <?php echo($this->CurrentObject->Name); ?> on <?php echo($this->CurrentTenant->URL); ?></h1>
<h2>Object Instances</h2>
<table style="width: 100%;">
<tr id="Property_Header">
<?php
$properties = $this->CurrentObject->GetInstanceProperties();
foreach ($properties as $property)
{
if ($property->ColumnVisible)
{
echo("<th>" . $property->Name . "</th>");
}
}
?>
</tr>
<?php
$instances = $this->CurrentObject->GetInstances();
foreach ($instances as $instance)
{
?>
<tr id="Property_<?php echo($property->ID); ?>">
<?php
foreach ($properties as $property)
{
if ($property->ColumnVisible)
{
echo("<td>");
$value = $instance->GetPropertyValue($property);
$property->RenderColumn($value);
echo("</td>");
}
}
?>
</tr>
<?php
}
?>
</table>
<?php
}
}
}
?>

View File

@ -1,252 +0,0 @@
<?php
namespace Objectify\Tenant\Pages;
use WebFX\ModulePage;
use WebFX\System;
use WebFX\WebScript;
use WebFX\WebStyleSheet;
use WebFX\Controls\FormView;
use WebFX\Controls\FormViewItem;
use WebFX\Controls\FormViewItemText;
use WebFX\Controls\FormViewItemMemo;
use WebFX\Controls\TabContainer;
use WebFX\Controls\TabPage;
use Objectify\Tenant\MasterPages\WebPage;
use Objectify\Objects\DataType;
use Objectify\Objects\Module;
use Objectify\Objects\PaymentPlan;
use Objectify\Objects\Tenant;
use Objectify\Objects\TenantObject;
use Objectify\Objects\TenantProperty;
use Objectify\Objects\TenantPropertyValue;
use Objectify\Objects\TenantStatus;
use Objectify\Objects\TenantType;
class DataTypeModifyPage extends WebPage
{
public $CurrentDataType;
public function __construct()
{
parent::__construct();
$this->StyleSheets[] = new WebStyleSheet("http://static.alcehosting.net/dropins/CodeMirror/StyleSheets/CodeMirror.css");
$this->Scripts[] = new WebScript("http://static.alcehosting.net/dropins/CodeMirror/Scripts/Addons/Edit/MatchBrackets.js");
$this->Scripts[] = new WebScript("http://static.alcehosting.net/dropins/CodeMirror/Scripts/Modes/clike/clike.js");
$this->Scripts[] = new WebScript("http://static.alcehosting.net/dropins/CodeMirror/Scripts/Modes/php/php.js");
}
protected function Initialize()
{
if ($this->CurrentDataType != null)
{
$this->Title = "Manage Data Type: " . $this->CurrentDataType->Name;
}
else
{
$this->Title = "Manage Data Types";
}
}
protected function RenderContent()
{
if ($this->CurrentDataType != null)
{
?>
<h1>Modify Data Type: <?php echo($this->CurrentDataType->Name); ?></h1>
<?php
}
else
{
?><h1>Create Data Type</h1><?php
}
?>
<style type="text/css">
.CodeMirror
{
border: dotted 1px #AAAAAA;
line-height: 18px;
}
.CodeMirror .CodeMirror-linenumbers
{
width: 48px;
}
</style>
<script type="text/javascript">
var CodeMirrorDefaultParameters =
{
lineNumbers: true,
matchBrackets: true,
mode: "text/x-php",
indentUnit: 4,
indentWithTabs: true
};
function InitializeCodeMirror(id)
{
var txt = document.getElementById(id);
if (txt.CodeMirrorInitialized) return;
var edt = CodeMirror.fromTextArea(txt, CodeMirrorDefaultParameters);
txt.CodeMirrorInitialized = true;
}
function tbs_OnClientTabChanged()
{
switch (tbs.SelectedTabID)
{
case "tabEncoder":
{
InitializeCodeMirror("txtEncoderCodeBlob");
break;
}
case "tabDecoder":
{
InitializeCodeMirror("txtDecoderCodeBlob");
break;
}
case "tabColumnRenderer":
{
InitializeCodeMirror("txtColumnRendererCodeBlob");
break;
}
case "tabEditorRenderer":
{
InitializeCodeMirror("txtEditorRendererCodeBlob");
break;
}
}
}
</script>
<form method="POST">
<?php
if ($this->CurrentDataType != null)
{
echo("<input type=\"hidden\" name=\"datatype_ID\" value=\"" . $this->CurrentDataType->ID . "\" />");
}
$fv = new FormView("fv");
$fv->Items[] = new FormViewItemText("txtDataTypeName", "datatype_Name", "Name", $this->CurrentDataType->Name);
$fv->Items[0]->Required = true;
$fv->Items[] = new FormViewItemMemo("txtDataTypeDescription", "datatype_Description", "Description", $this->CurrentDataType->Description);
$fv->Render();
?>
<?php
$tbs = new TabContainer("tbs");
$tbs->OnClientTabChanged = "tbs_OnClientTabChanged();";
$tbs->TabPages[] = new TabPage("tabEncoder", "Encoder", null, null, null, function()
{
?>
<textarea id="txtEncoderCodeBlob" name="datatype_EncoderCodeBlob" style="width: 100%;" rows="20"><?php echo($this->CurrentDataType->EncoderCodeBlob); ?></textarea>
<?php
});
$tbs->TabPages[] = new TabPage("tabDecoder", "Decoder", null, null, null, function()
{
?>
<textarea id="txtDecoderCodeBlob" name="datatype_DecoderCodeBlob" style="width: 100%;" rows="20"><?php echo($this->CurrentDataType->DecoderCodeBlob); ?></textarea>
<?php
});
$tbs->TabPages[] = new TabPage("tabColumnRenderer", "Column Renderer", null, null, null, function()
{
?>
<textarea id="txtColumnRendererCodeBlob" name="datatype_ColumnRendererCodeBlob" style="width: 100%;" rows="20"><?php echo($this->CurrentDataType->ColumnRendererCodeBlob); ?></textarea>
<?php
});
$tbs->TabPages[] = new TabPage("tabEditorRenderer", "Editor Renderer", null, null, null, function()
{
?>
<textarea id="txtEditorRendererCodeBlob" name="datatype_EditorRendererCodeBlob" style="width: 100%;" rows="20"><?php echo($this->CurrentDataType->EditorRendererCodeBlob); ?></textarea>
<?php
});
$tbs->Render();
?>
<div class="Buttons">
<input type="submit" value="Save Changes" />
<a class="Button" href="<?php echo(System::ExpandRelativePath("~/datatype")); ?>">Cancel</a>
</div>
</form>
<?php
}
}
class DataTypeBrowsePage extends WebPage
{
protected function RenderContent()
{
$items = DataType::Get();
?>
<table class="ListView">
<tr>
<th>Name</th>
<th>Description</th>
</tr>
<?php
foreach ($items as $item)
{
?>
<tr>
<td><a href="<?php echo(System::ExpandRelativePath("~/datatype/modify/" . $item->ID)); ?>"><?php echo($item->Name); ?></a></td>
<td><?php echo($item->Description); ?></td>
</tr>
<?php
}
?>
</table>
<div class="Buttons">
<a class="Button Emphasis" href="<?php echo(System::ExpandRelativePath("~/datatype/modify")); ?>">Create New Data Type</a>
<a class="Button" href="<?php echo(System::ExpandRelativePath("~/")); ?>">Exit</a>
</div>
<?php
}
}
System::$Modules[] = new \WebFX\Module("net.Objectify.TenantManager.DataType", array
(
new ModulePage("datatype", array
(
new ModulePage("", function($path)
{
$page = new DataTypeBrowsePage();
$page->Render();
return true;
}),
new ModulePage("modify", function($path)
{
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
if (isset($_POST["datatype_ID"]))
{
$datatype = DataType::GetByID($_POST["datatype_ID"]);
}
else
{
$datatype = new DataType();
}
$datatype->Name = $_POST["datatype_Name"];
$datatype->Description = $_POST["datatype_Description"];
$datatype->EncoderCodeBlob = $_POST["datatype_EncoderCodeBlob"];
$datatype->DecoderCodeBlob = $_POST["datatype_DecoderCodeBlob"];
$datatype->ColumnRendererCodeBlob = $_POST["datatype_ColumnRendererCodeBlob"];
$datatype->EditorRendererCodeBlob = $_POST["datatype_EditorRendererCodeBlob"];
$datatype->Update();
System::Redirect("~/datatype");
}
else
{
$page = new DataTypeModifyPage();
$page->CurrentDataType = DataType::GetByID($path[0]);
$page->Render();
}
return true;
})
))
));
?>

View File

@ -1,81 +0,0 @@
<?php
class UUID
{
protected $urand;
public function __construct() {
$this->urand = @fopen ( '/dev/urandom', 'rb' );
}
public static function Generate()
{
$uuid = new UUID();
return $uuid->get();
}
/**
* @brief Generates a Universally Unique IDentifier, version 4.
*
* This function generates a truly random UUID. The built in CakePHP String::uuid() function
* is not cryptographically secure. You should uses this function instead.
*
* @see http://tools.ietf.org/html/rfc4122#section-4.4
* @see http://en.wikipedia.org/wiki/UUID
* @return string A UUID, made up of 32 hex digits and 4 hyphens.
*/
function get() {
$pr_bits = false;
if (is_a ( $this, 'uuid' )) {
if (is_resource ( $this->urand )) {
$pr_bits .= @fread ( $this->urand, 16 );
}
}
if (! $pr_bits) {
$fp = @fopen ( '/dev/urandom', 'rb' );
if ($fp !== false) {
$pr_bits .= @fread ( $fp, 16 );
@fclose ( $fp );
} else {
// If /dev/urandom isn't available (eg: in non-unix systems), use mt_rand().
$pr_bits = "";
for($cnt = 0; $cnt < 16; $cnt ++) {
$pr_bits .= chr ( mt_rand ( 0, 255 ) );
}
}
}
$time_low = bin2hex ( substr ( $pr_bits, 0, 4 ) );
$time_mid = bin2hex ( substr ( $pr_bits, 4, 2 ) );
$time_hi_and_version = bin2hex ( substr ( $pr_bits, 6, 2 ) );
$clock_seq_hi_and_reserved = bin2hex ( substr ( $pr_bits, 8, 2 ) );
$node = bin2hex ( substr ( $pr_bits, 10, 6 ) );
/**
* Set the four most significant bits (bits 12 through 15) of the
* time_hi_and_version field to the 4-bit version number from
* Section 4.1.3.
* @see http://tools.ietf.org/html/rfc4122#section-4.1.3
*/
$time_hi_and_version = hexdec ( $time_hi_and_version );
$time_hi_and_version = $time_hi_and_version >> 4;
$time_hi_and_version = $time_hi_and_version | 0x4000;
/**
* Set the two most significant bits (bits 6 and 7) of the
* clock_seq_hi_and_reserved to zero and one, respectively.
*/
$clock_seq_hi_and_reserved = hexdec ( $clock_seq_hi_and_reserved );
$clock_seq_hi_and_reserved = $clock_seq_hi_and_reserved >> 2;
$clock_seq_hi_and_reserved = $clock_seq_hi_and_reserved | 0x8000;
return strtoupper( sprintf ( '%08s%04s%04x%04x%012s', $time_low, $time_mid, $time_hi_and_version, $clock_seq_hi_and_reserved, $node ) );
}
public static function format($input)
{
$output = $input;
$output = substr($output, 0, 8) . "-" . substr($output, 8, 4) . "-" . substr($output, 12, 4) . "-" . substr($output, 16, 4) . "-" . substr($output, 20);
return "{" . $output . "}";
}
}
?>

View File

@ -1,41 +0,0 @@
<?php
// =============================================================================
// WebFX bootstrapper - loads the application modules and executes WebFX
// Copyright (C) 2013-2014 Mike Becker
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// =============================================================================
// We need to get the root path of the Web site. It's usually something like
// /var/www/yourdomain.com.
global $RootPath;
$RootPath = dirname(__FILE__);
// Now that we have defined the root path, load the WebFX content (which also
// include_once's the modules and other WebFX-specific stuff)
require_once("WebFX/WebFX.inc.php");
require_once("Include/UUID.inc.php");
// Bring in the WebFX\System and WebFX\IncludeFile classes so we can simply refer
// to them (in this file only) as "System" and "IncludeFile", respectively, from
// now on
use WebFX\System;
use WebFX\IncludeFile;
// Tell WebFX that we are ready to launch the application. This cycles through
// all of the modules (usually you will define your main application content in
// 000-Default) and executes the first module page that corresponds to the path
// the user is GETting.
System::Launch();
?>

View File

@ -1,29 +0,0 @@
<?php
require("lessc.inc.php");
header("Content-Type: text/css");
$filename = "StyleSheets/" . $_GET["filename"];
if ((isset($_GET["compile"]) && $_GET["compile"] == "false") || file_exists($filename . ".css"))
{
readfile($filename . ".css");
}
else
{
try
{
$less = new lessc();
$less->formatterName = "compressed";
$v = $less->compileFile($filename . ".less");
echo("/* compiled with lessphp v0.4.0 - GPLv3/MIT - http://leafo.net/lessphp */\n");
echo("/* for human-readable source of this file, replace .css with .less in the file name */\n");
echo($v);
}
catch (Exception $e)
{
echo "/* " . $e->getMessage() . " */\n";
}
}
?>

View File

@ -1,10 +0,0 @@
RewriteEngine On
# Do not remove this line, otherwise mod_rewrite rules will stop working
RewriteBase /
RewriteRule ^StyleSheets/(.*)\.css$ lessc.php?filename=$1 [PT,L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?virtualpath=$1 [PT,L,QSA]

View File

@ -1,347 +0,0 @@
<?php
namespace Objectify\Modules;
use WebFX\Controls\ButtonGroup;
use WebFX\Controls\ButtonGroupButton;
use WebFX\Controls\ButtonGroupButtonAlignment;
use WebFX\Controls\Panel;
use Objectify\ResourceBundle;
use Objectify\Pages\DashboardPage;
use Objectify\Pages\MainPage;
use Objectify\Pages\ErrorPage;
use Objectify\Pages\LoginPage;
use Objectify\Objects\Tenant;
use Objectify\Objects\TenantObjectMethodParameterValue;
use Objectify\Objects\User;
use Objectify\Objects\UserProfileVisibility;
use WebFX\System;
use WebFX\Module;
use WebFX\ModulePage;
require_once("lessc.inc.php");
require_once("JShrink.inc.php");
require_once("ResourceBundle.inc.php");
function IsConfigured()
{
if (!(
isset(System::$Configuration["Database.ServerName"]) &&
isset(System::$Configuration["Database.DatabaseName"]) &&
isset(System::$Configuration["Database.UserName"]) &&
isset(System::$Configuration["Database.Password"]) &&
isset(System::$Configuration["Database.TablePrefix"])
))
{
return false;
}
global $MySQL;
$query = "SHOW TABLES LIKE '" . System::$Configuration["Database.TablePrefix"] . "Users'";
$result = $MySQL->query($query);
if ($result->num_rows < 1) return false;
return true;
}
function GetResourceBundles()
{
$ResourceBundles = array
(
new ResourceBundle("Common")
);
$tenant = Tenant::GetCurrent();
// References to ResourceBundle objects are stored in a MultipleInstanceProperty called "ResourceBundles" on the tenant
$bundles = $tenant->GetPropertyValue("ResourceBundles")->GetInstances();
foreach ($bundles as $bundle)
{
$ResourceBundles[] = new ResourceBundle($bundle->GetPropertyValue("Name"));
}
return $ResourceBundles;
}
function CompileStyleSheets($compile = true)
{
global $RootPath;
$ResourceBundles = GetResourceBundles();
$FilePaths = array();
$lesstext = "";
foreach ($ResourceBundles as $bundle)
{
$lesstext .= $bundle->CompileStyleSheets();
}
if ($compile)
{
try
{
$less = new \lessc();
$less->setFormatter("compressed");
$csstext = $less->compile($lesstext);
echo("/* compiled with lessphp v0.4.0 - GPLv3/MIT - http://leafo.net/lessphp */\n");
echo("/* for human-readable source of this file, append ?compile=false to the file name */\n");
echo($csstext);
}
catch (\Exception $e)
{
echo "/* " . $e->getMessage() . " */\n";
}
}
else
{
echo($lesstext);
}
}
function CompileScripts($compile = true)
{
global $RootPath;
$ResourceBundles = GetResourceBundles();
$FilePaths = array();
$lesstext = "";
foreach ($ResourceBundles as $bundle)
{
$lesstext .= $bundle->CompileScripts();
}
if ($compile)
{
try
{
$jstext = \JShrink\Minifier::minify($lesstext, array('flaggedComments' => false));
echo("/* compiled with JShrink v0.5.2 - BSD 3-clause - https://github.com/tedivm/JShrink */\n");
echo("/* for human-readable source of this file, append ?compile=false to the file name */\n");
echo($jstext);
}
catch (\Exception $e)
{
echo "/* " . $e->getMessage() . " */\n";
}
}
else
{
echo($lesstext);
}
}
function IsValidUserOrGuest()
{
$CurrentTenant = Tenant::GetCurrent();
if (!isset($_SESSION["CurrentUserName[" . $CurrentTenant->ID . "]"]) && !isset($_SESSION["CurrentPassword[" . $CurrentTenant->ID . "]"])) return true;
$user = User::GetByLoginID($_SESSION["CurrentUserName[" . $CurrentTenant->ID . "]"]);
if ($user == null) return true;
return IsAuthenticated();
}
function IsAuthenticated()
{
$CurrentTenant = Tenant::GetCurrent();
if (isset($_SESSION["CurrentUserName[" . $CurrentTenant->ID . "]"]) && isset($_SESSION["CurrentPassword[" . $CurrentTenant->ID . "]"]))
{
$user = $CurrentTenant->GetObject("User")->GetMethod("ValidateCredentials")->Execute(array
(
new TenantObjectMethodParameterValue("username", $_SESSION["CurrentUserName[" . $CurrentTenant->ID . "]"]),
new TenantObjectMethodParameterValue("password", $_SESSION["CurrentPassword[" . $CurrentTenant->ID . "]"])
));
return ($user != null);
}
return false;
}
function IsModuleAuthenticationRequired($path)
{
switch ($path)
{
case "dashboard":
case "world":
{
return true;
}
}
return false;
}
System::$BeforeLaunchEventHandler = function($path)
{
if ($path[0] == "images" || $path[0] == "StyleSheet.css" || $path[0] == "Script.js" || ($path[0] == "account" && ($path[1] == "login.page" || $path[1] == "register.page"))) return true;
// ensure our tenant has not expired yet
$tenant = Tenant::GetByURL(System::$TenantName);
if ($tenant == null || $tenant->IsExpired())
{
$page = new ErrorPage();
$page->Message = "The specified tenant does not exist. Please contact the site administrator to resolve this problem.";
$page->Render();
return false;
}
if (!IsConfigured() && $path[0] != "setup")
{
System::Redirect("~/setup");
return false;
}
if (!IsValidUserOrGuest())
{
System::Redirect("~/account/login.page");
return false;
}
if (!IsAuthenticated() && IsModuleAuthenticationRequired($path[0]))
{
System::Redirect("~/account/login.page");
return false;
}
return true;
};
System::$Modules[] = new Module("net.Objectify.Default", array
(
new ModulePage("", function($path)
{
if (IsAuthenticated())
{
$tenant = Tenant::GetCurrent();
$tobjUser = $tenant->GetObject("User");
$instUser = $tobjUser->GetMethod("GetCurrentUser")->Execute();
$propStartPage = $tobjUser->GetInstanceProperty("StartPage");
$startPageSet = $instUser->HasPropertyValue($propStartPage);
$startPage = $instUser->GetPropertyValue($propStartPage);
if ($startPageSet)
{
/*
$spi = $startPage->Instance;
$spio = $startPage->Instance->ParentObject;
$startPage = $spi->GetPropertyValue($spio->GetProperty("Value"));
*/
System::Redirect($startPage);
}
else
{
System::Redirect("~/dashboard");
}
return true;
}
$page = new MainPage();
$page->Render();
return true;
}),
new ModulePage("dashboard", function($path)
{
$page = new DashboardPage();
$page->Render();
return true;
}),
new ModulePage("account", array
(
new ModulePage("login.page", function($path)
{
$CurrentTenant = Tenant::GetCurrent();
if ($CurrentTenant == null) return false;
$page = new LoginPage();
if (isset($_POST["member_username"]) && isset($_POST["member_password"]))
{
$object = $CurrentTenant->GetObject("User");
$inst = $object->GetMethod("ValidateCredentials")->Execute(array
(
new TenantObjectMethodParameterValue("username", $_POST["member_username"]),
new TenantObjectMethodParameterValue("password", $_POST["member_password"])
));
if ($inst != null)
{
$_SESSION["CurrentUserName[" . $CurrentTenant->ID . "]"] = $_POST["member_username"];
$_SESSION["CurrentPassword[" . $CurrentTenant->ID . "]"] = $_POST["member_password"];
if (isset($_SESSION["LoginRedirectURL"]))
{
System::Redirect($_SESSION["LoginRedirectURL"]);
}
else
{
System::Redirect("~/");
}
return true;
}
else
{
$page->InvalidCredentials = true;
}
}
$page->Render();
return true;
}),
new ModulePage("logout.page", function($path)
{
$CurrentTenant = Tenant::GetCurrent();
$_SESSION["CurrentUserName[" . $CurrentTenant->ID . "]"] = null;
$_SESSION["CurrentPassword[" . $CurrentTenant->ID . "]"] = null;
System::Redirect("~/");
})
)),
new ModulePage("images", function($path)
{
// load images from resources object
global $RootPath;
$bundle = "Common";
$filename = implode("/", $path);
if (isset($path[1]))
{
if ($path[1] != "")
{
$bundle = $path[0];
array_shift($path);
$filename = implode("/", $path);
}
}
$imagePath = $RootPath . "/Resources/" . $bundle . "/Images/" . implode("/", $path);
if (file_exists($imagePath))
{
header("Content-Type: " . mime_content_type($imagePath));
readfile($imagePath);
return true;
}
else
{
header("HTTP/1.1 404 Not Found");
echo("The specified resource file was not found on this server.");
return false;
}
}),
new ModulePage("StyleSheet.css", function($path)
{
header("Content-Type: text/css");
$compile = true;
if (isset($_GET["compile"])) $compile = ($_GET["compile"] != "false");
$lesstext = CompileStyleSheets($compile);
echo($lesstext);
return true;
}),
new ModulePage("Script.js", function($path)
{
// load style sheet from resources object
header("Content-Type: text/javascript");
$compile = true;
if (isset($_GET["compile"])) $compile = ($_GET["compile"] != "false");
$lesstext = CompileScripts($compile);
echo($lesstext);
return true;
})
));
?>

View File

@ -1,192 +0,0 @@
<?php
namespace Objectify;
class ResourceBundle
{
public $Name;
public function __construct($name)
{
$this->Name = $name;
}
public function MakeRelativePath($filename)
{
global $RootPath;
if (substr($filename, 0, strlen($RootPath)) == $RootPath)
{
return "~/" . substr($filename, strlen($RootPath) + 1);
}
return $filename;
}
// BEGIN: function from Sven Arduwie (http://us2.php.net/manual/en/function.realpath.php#84012)
public function get_absolute_path($path)
{
$path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);
$parts = explode(DIRECTORY_SEPARATOR, $path);
$absolutes = array();
foreach ($parts as $part)
{
if ('.' == $part) continue;
if ('..' == $part)
{
array_pop($absolutes);
}
else
{
$absolutes[] = $part;
}
}
return implode(DIRECTORY_SEPARATOR, $absolutes);
}
// END: function from Sven Arduwie (http://us2.php.net/manual/en/function.realpath.php#84012)
public function MakeAbsolutePath($filename, $relativeTo = null)
{
global $RootPath;
if (strlen($filename) > 3 && substr($filename, 0, 3) == "../")
{
if ($relativeTo != null)
{
$path = $relativeTo . "/" . $filename;
return $this->get_absolute_path($path);
}
return $this->get_absolute_path($filename);
}
else if (strlen($filename) > 1 && substr($filename, 0, 1) == "/")
{
return $filename;
}
if ($relativeTo != null)
{
return $relativeTo . "/" . $filename;
}
return $RootPath . "/" . $filename;
}
public function CompileImportableFile($filename, $importedFileName = null, $preprocessorToken = "#")
{
global $RootPath;
$filename = $this->MakeAbsolutePath($filename, dirname($importedFileName));
$importedFileTitle = $this->MakeRelativePath($importedFileName);
$lesstext = "";
$filetitle = $this->MakeRelativePath($filename);
$lesstext .= "/* BEGIN FILE: " . $filetitle;
if ($importedFileTitle != null)
{
$lesstext .= " - IMPORTED FROM " . $importedFileTitle;
}
$lesstext .= " */\n";
if (file_exists($filename))
{
$tmp = file_get_contents($filename);
if ($tmp === false)
{
$lesstext .= "/* ERROR: " . $filename . " */";
}
else
{
$lesstext .= $tmp;
}
}
else
{
$lesstext .= "/*\n\tERROR: file does not exist\n\tFile name: \"" . $filename . "\"";
if ($importedFileTitle != null)
{
$lesstext .= "\n\tImported from: \"" . $importedFileTitle . "\"";
}
$lesstext .= "\n*/\n";
}
$lesstext .= "\n";
$lesslines = explode("\n", $lesstext);
$lesstext = "";
$j = strlen($preprocessorToken . "import ");
foreach ($lesslines as $lessline)
{
if (substr(trim($lessline), 0, $j) == $preprocessorToken . "import ")
{
$importfilename = trim(substr($lessline, $j));
$importfilename = substr($importfilename, 1, strlen($importfilename) - 3); // removes " and ";
$lesstext .= $this->CompileImportableFile($importfilename, $filename, $preprocessorToken);
}
else
{
$lesstext .= $lessline . "\n";
}
}
$lesstext .= "/* END FILE: " . $filetitle;
if ($importedFileTitle != null)
{
$lesstext .= " - IMPORTED FROM " . $importedFileTitle;
}
$lesstext .= " */\n\n";
return $lesstext;
}
public function CompileStyleSheets()
{
global $RootPath;
$StyleSheetPath = $RootPath . "/Resources/" . $this->Name . "/StyleSheets";
$lesstext = "";
$lesstext .= "/* BEGIN BUNDLE: " . $this->Name . " */\n";
$lesstext .= "/* include path: " . $StyleSheetPath . " - ";
$lessFiles = glob($StyleSheetPath . "/*.less");
$lesstext .= count($lessFiles) . " *.less files, ";
$cssFiles = glob($StyleSheetPath . "/*.css");
$lesstext .= count($cssFiles) . " *.css files";
$lesstext .= " */\n\n";
foreach ($lessFiles as $filename)
{
$lesstext .= $this->CompileImportableFile($filename, null, "@");
}
foreach ($cssFiles as $filename)
{
$lesstext .= $this->CompileImportableFile($filename, null, "@");
}
$lesstext .= "/* END BUNDLE: " . $this->Name . " */\n\n";
return $lesstext;
}
public function CompileScripts()
{
global $RootPath;
$ContentPaths = array
(
"",
"Controls",
"Objects"
);
$BasePath = $RootPath . "/Resources/" . $this->Name . "/Scripts";
$lesstext = "";
$lesstext .= "/* BEGIN BUNDLE: " . $this->Name . " */\n";
foreach ($ContentPaths as $ContentPath)
{
$truepath = $BasePath . "/" . $ContentPath;
$lesstext .= "/* include path: " . $truepath . " - ";
$jsfiles = glob($truepath . "/*.js");
$lesstext .= count($jsfiles) . " *.js files";
$lesstext .= " */\n\n";
foreach ($jsfiles as $filename)
{
$lesstext .= $this->CompileImportableFile($filename, null, "@");
}
}
$lesstext .= "/* END BUNDLE: " . $this->Name . " */\n\n";
return $lesstext;
}
}
?>

View File

@ -1,46 +0,0 @@
<?php
// =============================================================================
// WebFX bootstrapper - loads the application modules and executes WebFX
// Copyright (C) 2013-2014 Mike Becker
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// =============================================================================
// We need to get the root path of the Web site. It's usually something like
// /var/www/yourdomain.com.
global $RootPath;
$RootPath = dirname(__FILE__);
// Now that we have defined the root path, load the WebFX content (which also
// include_once's the modules and other WebFX-specific stuff)
require_once("WebFX/WebFX.inc.php");
require_once("Include/UUID.inc.php");
// Bring in the WebFX\System and WebFX\IncludeFile classes so we can simply refer
// to them (in this file only) as "System" and "IncludeFile", respectively, from
// now on
use WebFX\System;
use WebFX\IncludeFile;
// Tell WebFX that this is a tenanted hosting application. This will allow us to
// control much of the application through Tenant Manager rather than having to
// continually push out code updates.
System::$EnableTenantedHosting = true;
// Tell WebFX that we are ready to launch the application. This cycles through
// all of the modules (usually you will define your main application content in
// 000-Default) and executes the first module page that corresponds to the path
// the user is GETting.
System::Launch();
?>

View File

@ -1,29 +0,0 @@
<?php
require("lessc.inc.php");
header("Content-Type: text/css");
$filename = "StyleSheets/" . $_GET["filename"];
if ((isset($_GET["compile"]) && $_GET["compile"] == "false") || file_exists($filename . ".css"))
{
readfile($filename . ".css");
}
else
{
try
{
$less = new lessc();
$less->formatterName = "compressed";
$v = $less->compileFile($filename . ".less");
echo("/* compiled with lessphp v0.4.0 - GPLv3/MIT - http://leafo.net/lessphp */\n");
echo("/* for human-readable source of this file, replace .css with .less in the file name */\n");
echo($v);
}
catch (Exception $e)
{
echo "/* " . $e->getMessage() . " */\n";
}
}
?>