diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/002-Attributes.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/002-Attributes.yaml index 71939d0..982c3cd 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/002-Attributes.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/002-Attributes.yaml @@ -65,6 +65,17 @@ - IDA_OpenInNewWindow: '{4a211f11-c5c3-4b58-a7f4-ed62538c5a3d}' - IDA_LongRunning: '{c03aa999-83bc-49db-a27e-70fee477b9fb}' - IDA_SuppressRIHints: '{43328aec-6a5d-4955-8d04-a96dcf98ab02}' + - IDA_ShowSpreadsheetButtonOnSelection: '{0ace468d-6d5d-4efd-b59d-2e587ea9f6cf}' + + - IDA_PasswordRules: '{60c3f4c8-4f94-4c2a-8709-848644b61284}' + - IDA_EmailAddress: '{61113621-77aa-456d-839b-1c53b32f3d84}' + - IDA_NotificationEmailAddress: '{eb84ca5c-b238-4ca4-adcd-6a5076800bb9}' + - IDA_GenerateRandomPassword: '{a6b3a5be-313c-4588-92f8-09da0b195f1d}' + - IDA_NewPassword: '{a52a27c4-8568-4301-8714-b2f01fb38a15}' + - IDA_VerifyNewPassword: '{852e2102-33a0-49e2-bcfd-c126f543248c}' + - IDA_RequireChangePasswordAtNextSignIn: '{a2480234-87b7-4958-a4b9-3781865c636b}' + - IDA_ResetChallengeQuestions: '{4d7554cc-2061-4516-be42-8ccb1b4a0e29}' + - IDA_AccountDisabled: '{0b8f2ca3-f558-4a69-a8b0-de548914dc27}' - IDA_GivenName: '{94a3ab09-3db7-4207-9e66-9526eb738669}' - IDA_FamilyName: '{b84f602d-6bfc-4898-9d44-4d49af44cbb4}' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/007-TaskClasses.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/007-TaskClasses.yaml index f8711cb..15cda14 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/007-TaskClasses.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/007-TaskClasses.yaml @@ -8,4 +8,6 @@ - IDI_Task_ShowDefinitionInCodeEditor: '{4f8a0e8e-e139-4cc6-b8cf-a32e67bd192d}' - IDI_Task_DeleteInstance: '{276c5933-89a9-4a22-8fe3-cd9fda5377a8}' - IDI_Task_ViewIntegrationIDs: '{8a2a0ef3-a145-4026-9c55-4d0133eff929}' - - IDI_SequenceTask_ViewSystemUser: '{5fd32c2b-7169-4db7-9379-6d8cb479c60e}' \ No newline at end of file + - IDI_SequenceTask_ViewSystemUser: '{5fd32c2b-7169-4db7-9379-6d8cb479c60e}' + - IDI_SequenceTask_EditSystemUser: '{4d4536c9-4afb-4f42-b7a6-e0eaef5c93bf}' + - IDI_SequenceTask_ManageSystemUserCredentials: '{2cab9794-397a-4d59-b61d-9b7f97ed297a}' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/013-WorkSets.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/013-WorkSets.yaml index 743e342..a8e5051 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/013-WorkSets.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/013-WorkSets.yaml @@ -1,3 +1,4 @@ - entityDefinitions: - IDI_WorkSet_ClassForEditClassTask: '{b56ac9b9-efce-4a40-8c04-ffdf90174285}' - - IDI_WorkSet_PreferredDisplayName: '{86149123-6d32-4f48-b128-8f773cdb2b0e}' \ No newline at end of file + - IDI_WorkSet_PreferredDisplayName: '{86149123-6d32-4f48-b128-8f773cdb2b0e}' + - IDI_WorkSet_RelatedInstance: '{d9634929-0bb4-482a-85cc-9c8f1251556f}' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00004-TextAttribute.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00004-TextAttribute.yaml index ddad504..2340b4c 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00004-TextAttribute.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00004-TextAttribute.yaml @@ -88,6 +88,24 @@ - textAttribute: '&IDA_CSSValue;' index: 57 + - textAttribute: '&IDA_NewPassword;' + name: 'New Password' + index: 84 + - textAttribute: '&IDA_VerifyNewPassword;' + name: 'Verify New Password' + index: 91 + + - textAttribute: '&IDA_EmailAddress;' + name: 'Email Address' + index: 160 + + - textAttribute: '&IDA_NotificationEmailAddress;' + name: 'Email Address for Notifications' + + - textAttribute: '&IDA_PasswordRules;' + name: 'Password Rules' + value: 'Your new password must not be the same as your current password or user name.' + - textAttribute: '&IDA_GivenName;' name: 'Given Name' - textAttribute: '&IDA_FamilyName;' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00005-BooleanAttribute.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00005-BooleanAttribute.yaml index b148080..55cdecc 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00005-BooleanAttribute.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00005-BooleanAttribute.yaml @@ -6,6 +6,9 @@ inherits: '&IDC_Attribute;' name: Boolean Attribute index: 5 + attributes: + - instance: '&IDA_Name;' + customTagName: 'name' # YAML definition for Instances of Boolean Attribute, 1$5 instances: - instance: '&IDA_Singular;' @@ -77,4 +80,17 @@ - instance: '&IDA_SuppressRIHints;' name: Suppress RI Hints index: 24 - \ No newline at end of file + - instance: '&IDA_ShowSpreadsheetButtonOnSelection;' + index: 27 + - instance: '&IDA_RequireChangePasswordAtNextSignIn;' + name: Require Password Change At Next Sign In + index: 112 + - instance: '&IDA_ResetChallengeQuestions;' + name: Reset Challenge Questions + index: 113 + - instance: '&IDA_AccountDisabled;' + name: Account Disabled + index: 114 + - instance: '&IDA_GenerateRandomPassword;' + name: Generate Random Password + index: 115 \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00015-WorkSet.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00015-WorkSet.yaml index 209c660..540b08e 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00015-WorkSet.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00015-WorkSet.yaml @@ -27,3 +27,6 @@ destinationClassId: '&IDC_WorkSet;' siblingRelationshipId: '&IDR_Work_Set__has_valid__Class;' singular: no + + - workSet: '&IDI_WorkSet_RelatedInstance;' + name: 'Related Instance' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00039-SystemUser.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00039-SystemUser.yaml index f0888b9..2a14d3d 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00039-SystemUser.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00039-SystemUser.yaml @@ -21,6 +21,8 @@ customTagNameCreatesInstanceOf: '&IDC_PersonName;' relatedTasks: - instance: '&IDI_SequenceTask_ViewSystemUser;' + - instance: '&IDI_SequenceTask_EditSystemUser;' + - instance: '&IDI_SequenceTask_ManageSystemUserCredentials;' - class: '&IDC_UserLogin;' name: System Account Signon diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02994-HardcodedTask.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02994-HardcodedTask.yaml index c264fc2..93930cd 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02994-HardcodedTask.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02994-HardcodedTask.yaml @@ -14,6 +14,6 @@ - instance: '&IDR_Task__has__Task_Category;' customTagName: 'taskCategory' - - hardcodedTask: '&IDI_Task_ViewElementContent;' - name: 'View Element Content' - className: 'Mocha\\UI\\Tasks\\ViewElementContent' + # - hardcodedTask: '&IDI_Task_ViewElementContent;' + # name: 'View Element Content' + # className: 'Mocha\\UI\\Tasks\\ViewElementContent' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02997-SequenceTask.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02997-SequenceTask.yaml index dee06ac..49e2ec4 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02997-SequenceTask.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02997-SequenceTask.yaml @@ -20,19 +20,29 @@ relationships: - instance: '&IDR_Task__has_initiating__Element;' - customTagName: initiatingElementId + customTagName: initiatingElement - instance: '&IDR_Task__has__Task_Category;' customTagName: taskCategory + - sequenceTask: '&IDI_Task_ViewElementContent;' + name: 'View Element Content' + schedulable: no + longRunning: no + suppressRIHints: no + stepName: View Element Content + showSpreadsheetButtonOnSelection: no + taskCategory: '&IDI_TaskCategory_Element;' + initiatingElement: '{e68bb6c4-29eb-4c77-908a-1b3793c952bc}' + - sequenceTask: '&IDI_Task_ViewElement;' name: 'View Element' schedulable: no longRunning: no suppressRIHints: no stepName: View Element - showSpreadsheetButonOnSelection: no + showSpreadsheetButtonOnSelection: no taskCategory: '&IDI_TaskCategory_Element;' - initiatingElementId: '&IDE_ElementStart;' + initiatingElement: '&IDE_ElementStart;' - element: '&IDE_ElementStart;' name: 'Element Start' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113800-ElementTests.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113800-ElementTests.yaml index 9709339..023833e 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113800-ElementTests.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113800-ElementTests.yaml @@ -17,11 +17,14 @@ label: 'Edit Class' value: - taskId: '{9dbdb202-e9f8-49ca-bbc2-0b63df651246}' + - instance: '{946f14a7-559f-4f6f-ae47-cbcad1523ad5}' - instance: '{8c69fd8c-28fa-4f3c-a283-5d0006c1027d}' - instance: '{535b1507-68ed-4981-8cd4-e8e843a24916}' - instance: '{d74123b5-9fde-4c2a-bd28-8cd00ce86734}' - instance: '{d5653b81-a5e2-4f77-92f8-bcbae09f0d71}' - - instance: '{946f14a7-559f-4f6f-ae47-cbcad1523ad5}' + + #!FIXME: implement sorting by the Order attribute (on the BEM / BEM Process) + #! : `uses order Executable returning Attribute` => `Element Content`@get Order (GA)*P[ramb] ) - class: '{cce471d6-5fe7-4202-b678-9fcab20fd864}' name: 'Element Tests Testing Class 1' @@ -166,18 +169,18 @@ displayOptions: - instance: '&IDI_DisplayOption_NotEnterable;' - - elementContent: '{d5653b81-a5e2-4f77-92f8-bcbae09f0d71}' + - elementContent: '{946f14a7-559f-4f6f-ae47-cbcad1523ad5}' order: 'e' + label: 'Users On This SUV' + defaultDataType: '&IDE_UserList;' + builtFromBEMProcess: '&IDBEMP_UserList;' + displayOptions: + - instance: '&IDI_DisplayOption_NotEnterable;' + + - elementContent: '{d5653b81-a5e2-4f77-92f8-bcbae09f0d71}' + order: 'f' label: 'Test Horizontal EC with Grid Layout' defaultDataType: '{0f95606c-3653-4e40-af4e-34c501b669af}' builtFromBEMProcess: '{d1326df7-d897-46de-bad1-4d1e6f85b042}' # displayOptions: # - instance: '&IDI_DisplayOption_Required;' - - - elementContent: '{946f14a7-559f-4f6f-ae47-cbcad1523ad5}' - order: 'f' - label: 'Users On This SUV' - defaultDataType: '&IDE_UserList;' - builtFromBEMProcess: '&IDBEMP_UserList;' - displayOptions: - - instance: '&IDI_DisplayOption_NotEnterable;' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/EditSystemUser.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/EditSystemUser.yaml new file mode 100644 index 0000000..dd07dc2 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/EditSystemUser.yaml @@ -0,0 +1,7 @@ +- library: '&IDL_MochaBaseSystem;' + instances: + - sequenceTask: '&IDI_SequenceTask_EditSystemUser;' + name: 'Edit System User' + initiatingElement: '{14e32ff2-1dd7-44d7-ab21-4c96b213a1ca}' + taskCategory: '&IDI_TaskCategory_SystemUser;' + \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ManageSystemUserCredentials.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ManageSystemUserCredentials.yaml new file mode 100644 index 0000000..0c97e66 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ManageSystemUserCredentials.yaml @@ -0,0 +1,45 @@ +- library: '&IDL_MochaBaseSystem;' + instances: + - sequenceTask: '&IDI_SequenceTask_ManageSystemUserCredentials;' + name: 'Manage System User Credentials' + initiatingElement: '{aae999d6-60c4-4357-b1b6-dd0f3375358a}' + taskCategory: '&IDI_TaskCategory_SystemUser;' + + - element: '{aae999d6-60c4-4357-b1b6-dd0f3375358a}' + name: 'manage system account credentials' + elementContents: + - globalIdentifier: '{a1802e75-64f2-4de0-a036-b7069137e3c1}' + defaultDataType: '{9c65b684-ad62-495a-a690-5aa5fc26bebc}' + displayOptions: + - instance: '&IDI_DisplayOption_Singular;' + - instance: '&IDI_DisplayOption_ShowSubelementsVertically;' + + - element: '{9c65b684-ad62-495a-a690-5aa5fc26bebc}' + name: 'manage system account credentials edits' + elementContents: + - globalIdentifier: '{a6360087-3a18-4648-9e3a-e62da002191f}' + defaultDataType: '&IDA_PasswordRules;' + displayOptions: + - instance: '&IDI_DisplayOption_NotEnterable;' + - globalIdentifier: '{da407cd2-e390-489d-90f0-f2a6ab336e0c}' + defaultDataType: '&IDC_User;' + displayOptions: + - instance: '&IDI_DisplayOption_NotEnterable;' + - globalIdentifier: '{15969a7d-4313-4d80-97e2-5335fbc16b2b}' + defaultDataType: '&IDA_EmailAddress;' + - globalIdentifier: '{862b454f-c84a-439e-8a2b-6d841aae158a}' + defaultDataType: '&IDA_GenerateRandomPassword;' + - globalIdentifier: '{65b01825-c4f8-4e48-89ee-be42806b109d}' + defaultDataType: '&IDA_NewPassword;' + displayOptions: + - instance: '&IDI_DisplayOption_ObscuredText;' + - globalIdentifier: '{f68d0b17-6bd7-439d-8fd2-2f7afee73b7f}' + defaultDataType: '&IDA_VerifyNewPassword;' + displayOptions: + - instance: '&IDI_DisplayOption_ObscuredText;' + - globalIdentifier: '{15a23713-2ddc-47d2-8758-cd17e04ad4f9}' + defaultDataType: '&IDA_RequireChangePasswordAtNextSignIn;' + - globalIdentifier: '{bc72543d-c3a1-40ce-b10a-c641d13028f4}' + defaultDataType: '&IDA_ResetChallengeQuestions;' + - globalIdentifier: '{033b8c46-567a-499f-a1bf-c0bdd5709374}' + defaultDataType: '&IDA_AccountDisabled;' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/TestMethodBinding.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/TestMethodBinding.yaml index 8b4af15..c8edcd9 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/TestMethodBinding.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/TestMethodBinding.yaml @@ -4,7 +4,7 @@ index: 312 name: 'Test Method Binding' - initialElement: '{2696449c-a517-48cc-9348-03abca291cf0}' + initiatingElement: '{2696449c-a517-48cc-9348-03abca291cf0}' - element: '{2696449c-a517-48cc-9348-03abca291cf0}' elementContents: diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ViewSystemUser.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ViewSystemUser.yaml index 1c0ac38..04ae6b5 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ViewSystemUser.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ViewSystemUser.yaml @@ -2,7 +2,7 @@ instances: - sequenceTask: '&IDI_SequenceTask_ViewSystemUser;' name: 'View System User' - initialElement: '{14e32ff2-1dd7-44d7-ab21-4c96b213a1ca}' + initiatingElement: '{14e32ff2-1dd7-44d7-ab21-4c96b213a1ca}' taskCategory: '&IDI_TaskCategory_SystemUser;' - element: '{14e32ff2-1dd7-44d7-ab21-4c96b213a1ca}' diff --git a/php/mocha/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php b/php/mocha/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php index 39f3b03..e112f85 100644 --- a/php/mocha/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php +++ b/php/mocha/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php @@ -164,7 +164,10 @@ $parentClass = $oms->getParentClass($task); if ($parentClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::SequenceTask))) { - echo("Sequence Task not done yet!"); + $initiatingElement = $oms->getRelatedInstance($task, KnownRelationshipGuids::Task__has_initiating__Element); + + $DO_Singular = $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Singular); + $this->renderElement($initiatingElement, [ $DO_Singular ]); } else if ($parentClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::HardcodedTask))) { @@ -186,7 +189,8 @@ $pc = $oms->getParentClass($value); if ($pc->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::Element))) { - $this->renderInitialElement($value); + $DO_Singular = $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Singular); + $this->renderElement($value, [ $DO_Singular ]); } } else if (is_string($value)) @@ -203,6 +207,7 @@ { echo ("could not find task executor for task type `" . $oms->getInstanceText($parentClass) . "`, " . $parentClass->InstanceKey . " " . $parentClass->GlobalIdentifier); } + $this->renderEndForm(); $this->renderEndPage(); } @@ -544,7 +549,7 @@ return $str; } - public function renderElementContent(InstanceReference $elementContent, InstanceReference $relatedInstanceParm = null) + public function renderElementContent(InstanceReference $elementContent) { /** * @var MySQLDatabaseOms @@ -640,7 +645,11 @@ // Executable returning Attribute else if ($oms->is_a($ecInst, KnownClassGuids::TextAttribute)) { - $this->renderExecutableReturningAttribute($elementContent, $ecInst, $relatedInstance, $relatedInstanceParm); + $this->renderExecutableReturningAttribute($elementContent, $ecInst, $relatedInstance); + } + else if ($oms->is_a($ecInst, KnownClassGuids::BooleanAttribute)) + { + $this->renderExecutableReturningAttribute($elementContent, $ecInst, $relatedInstance); } // Executable returning Attribute else if ($oms->is_a($ecInst, KnownClassGuids::ReturnAttributeMethodBinding)) @@ -654,13 +663,21 @@ } else if ($oms->is_a($ecInst, KnownClassGuids::Clasz)) { - $targetInstance = $relatedInstanceParm; - if ($targetInstance === null) + $targetInstance = $ecInst; + if ($this->Context !== null) { - $targetInstance = $ecInst; + $targetInstance = $this->Context->getWorkData($ecInst); + } + + if ($targetInstance !== null) + { + $adw = new InstanceBrowser(array($targetInstance)); + $adw->Render(); + } + else + { + echo ("(empty)"); } - $adw = new InstanceBrowser(array($targetInstance)); - $adw->Render(); } else { @@ -674,7 +691,7 @@ } } - public function renderExecutableReturningAttribute(InstanceReference $elementContent, InstanceReference $ecInst, ?InstanceReference $relatedInstance, ?InstanceReference $relatedInstanceParm) + public function renderExecutableReturningAttribute(InstanceReference $elementContent, InstanceReference $ecInst, ?InstanceReference $relatedInstance) { /** * @var MySQLDatabaseOms @@ -685,10 +702,6 @@ // fill in the value from the target instance $targetInstance = $relatedInstance; - if ($relatedInstanceParm !== null) - { - $targetInstance = $relatedInstanceParm; - } if ($targetInstance === null) { $targetInstance = $this->TargetInstance; @@ -720,7 +733,14 @@ } else { - $this->renderTextAttributeEC($elementContent, $ecInst, $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ObscuredText)), $value); + if ($oms->is_a($ecInst, KnownClassGuids::TextAttribute)) + { + $this->renderTextAttributeEC($elementContent, $ecInst, $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ObscuredText)), $value); + } + else if ($oms->is_a($ecInst, KnownClassGuids::BooleanAttribute)) + { + $this->renderBooleanAttributeEC($elementContent, $ecInst, $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ObscuredText)), $value); + } } } @@ -773,6 +793,49 @@ $p->Render(); } + public function renderBooleanAttributeEC(InstanceReference $ec, InstanceReference $inst, $password = false, $value = null) + { + /** + * @var MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + + $displayOptions = $oms->getRelatedInstances($ec, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Element_Content_Display_Option)); + + $ecid = $ec->InstanceKey; + + $p = new \Phast\WebControl(); + $p->TagName = "input"; + $p->ClientID = "ec_" . $ecid; + $p->Attributes[] = new \Phast\WebControlAttribute("name", "ec_" . $ecid); + $p->Attributes[] = new \Phast\WebControlAttribute("data-ecid", $ecid); + $p->Attributes[] = new \Phast\WebControlAttribute("value", $value); + $p->Attributes[] = new \Phast\WebControlAttribute("type", "checkbox"); + + if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Required))) + { + $p->ClassList[] = "uwt-required"; + } + if ($this->IsPostback && $oms->instanceSetContains($this->FailedValidationElements, $ec)) + { + $p->ClassList[] = "uwt-failed-validation"; + } + + $maxLength = $inst->getAttributeValue(KnownAttributeGuids::MaximumLength); + if ($maxLength !== null) + { + $p->Attributes[] = new \Phast\WebControlAttribute("maxlength", $maxLength); + } + $p->HasContent = false; + $attType = new \Phast\WebControlAttribute("type", "text"); + if ($password) + { + $attType->Value = "password"; + } + $p->Attributes[] = $attType; + $p->Render(); + } + public function renderArray(?array $array, string $separator, string $prefix = "", string $suffix = "") { if ($array === null) @@ -874,6 +937,8 @@ MSG_EOF); { $this->renderTopNavigationBar(); } + + echo("
"); } public function renderEndPage() { @@ -935,18 +1000,23 @@ MSG_EOF); } echo(""); } - echo(""); $DO_Singular = $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Singular); $this->renderElement($element, [ $DO_Singular ]); - - echo("
"); - echo ("SubmitButtonText . "\" />"); - echo("
"); + $this->renderEndForm(); $this->renderEndPage(); } + private function renderEndForm() + { + echo("
"); + // echo ("Cancel"); + echo ("Cancel"); + echo ("SubmitButtonText . "\" />"); + echo("
"); + } + public function logRequestSuccess(float $elapsedTime) { echo("\n