diff --git a/pages/schema.php b/pages/schema.php
index 780f058ca..f76ff23f8 100644
--- a/pages/schema.php
+++ b/pages/schema.php
@@ -32,7 +32,9 @@ ApplicationMenu::CheckMenuIdEnabled('DataModelMenu');
*/
function MakeClassHLink($sClass, $sContext)
{
- return "".MetaModel::GetName($sClass)." (" .$sClass.")";
+ return "".MetaModel::GetName($sClass)." (".$sClass.")";
}
/**
@@ -41,6 +43,7 @@ function MakeClassHLink($sClass, $sContext)
function MakeRelationHLink($sRelCode, $sContext)
{
$sDesc = MetaModel::GetRelationDescription($sRelCode);
+
return "".$sRelCode."";
}
@@ -54,24 +57,24 @@ function DisplaySubclasses($oPage, $sClass, $sContext)
{
$oPage->add("
\n");
$aOrderedClasses = array();
- foreach($aChildClasses as $sClassName)
+ foreach ($aChildClasses as $sClassName)
{
// Skip indirect childs, they will be handled somewhere else
if (MetaModel::GetParentPersistentClass($sClassName) == $sClass)
{
- $aOrderedClasses[$sClassName] = MetaModel::GetName($sClassName);
+ $aOrderedClasses[$sClassName] = MetaModel::GetName($sClassName);
}
}
// Sort on the display name
asort($aOrderedClasses);
- foreach($aOrderedClasses as $sClassName => $sDisplayName)
+ foreach ($aOrderedClasses as $sClassName => $sDisplayName)
{
// Skip indirect childs, they will be handled somewhere else
if (MetaModel::GetParentPersistentClass($sClassName) == $sClass)
{
- $oPage->add("- ".MakeClassHLink($sClassName, $sContext)."\n");
- DisplaySubclasses($oPage, $sClassName, $sContext);
- $oPage->add("
\n");
+ $oPage->add("- ".MakeClassHLink($sClassName, $sContext)."\n");
+ DisplaySubclasses($oPage, $sClassName, $sContext);
+ $oPage->add("
\n");
}
}
$oPage->add("
\n");
@@ -122,7 +125,7 @@ EOF
$sStateDescription = MetaModel::GetStateDescription($sClass, $sStateCode);
$oPage->add("$sStateLabel ($sStateCode) $sStateDescription\n");
$oPage->add("\n");
- foreach(MetaModel::EnumTransitions($sClass, $sStateCode) as $sStimulusCode => $aTransitionDef)
+ foreach (MetaModel::EnumTransitions($sClass, $sStateCode) as $sStimulusCode => $aTransitionDef)
{
$sStimulusLabel = $aStimuli[$sStimulusCode]->GetLabel();
$sTargetState = $aTransitionDef['target_state'];
@@ -167,21 +170,36 @@ EOF
{
$sStateLabel = MetaModel::GetStateLabel($sClass, $sStateCode);
$sStateDescription = MetaModel::GetStateDescription($sClass, $sStateCode);
- $oPage->add("- $sStateLabel ($sStateCode) $sStateDescription\n");
+ $oPage->add("
- $sStateLabel ($sStateCode) $sStateDescription\n");
if (count($aStates[$sStateCode]['attribute_list']) > 0)
{
$oPage->add("
\n");
- foreach($aStates[$sStateCode]['attribute_list'] as $sAttCode => $iOptions)
+ foreach ($aStates[$sStateCode]['attribute_list'] as $sAttCode => $iOptions)
{
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
$sAttLabel = $oAttDef->GetLabel();
-
+
$aOptions = array();
- if ($iOptions & OPT_ATT_HIDDEN) $aOptions[] = Dict::S('UI:Schema:LifeCycleHiddenAttribute');
- if ($iOptions & OPT_ATT_READONLY) $aOptions[] = Dict::S('UI:Schema:LifeCycleReadOnlyAttribute');
- if ($iOptions & OPT_ATT_MANDATORY) $aOptions[] = Dict::S('UI:Schema:LifeCycleMandatoryAttribute');
- if ($iOptions & OPT_ATT_MUSTCHANGE) $aOptions[] = Dict::S('UI:Schema:LifeCycleAttributeMustChange');
- if ($iOptions & OPT_ATT_MUSTPROMPT) $aOptions[] = Dict::S('UI:Schema:LifeCycleAttributeMustPrompt');
+ if ($iOptions & OPT_ATT_HIDDEN)
+ {
+ $aOptions[] = Dict::S('UI:Schema:LifeCycleHiddenAttribute');
+ }
+ if ($iOptions & OPT_ATT_READONLY)
+ {
+ $aOptions[] = Dict::S('UI:Schema:LifeCycleReadOnlyAttribute');
+ }
+ if ($iOptions & OPT_ATT_MANDATORY)
+ {
+ $aOptions[] = Dict::S('UI:Schema:LifeCycleMandatoryAttribute');
+ }
+ if ($iOptions & OPT_ATT_MUSTCHANGE)
+ {
+ $aOptions[] = Dict::S('UI:Schema:LifeCycleAttributeMustChange');
+ }
+ if ($iOptions & OPT_ATT_MUSTPROMPT)
+ {
+ $aOptions[] = Dict::S('UI:Schema:LifeCycleAttributeMustPrompt');
+ }
if (count($aOptions))
{
$sOptions = implode(', ', $aOptions);
@@ -190,7 +208,7 @@ EOF
{
$sOptions = "";
}
-
+
$oPage->add("- $sAttLabel $sOptions
\n");
}
$oPage->add("
\n");
@@ -201,9 +219,9 @@ EOF
}
}
$oPage->add("
\n");
- $oPage->add_ready_script('$("#LifeCycleList").treeview({collapsed: true,});');
- $oPage->add_ready_script('$("#LifeCycleAttrOptList").treeview({collapsed: true,});');
- }
+ $oPage->add_ready_script('$("#LifeCycleList").treeview({collapsed: true,});');
+ $oPage->add_ready_script('$("#LifeCycleAttrOptList").treeview({collapsed: true,});');
+ }
}
@@ -225,8 +243,8 @@ function DisplayClassesList($oPage, $sContext)
{
$oPage->add("".Dict::S('UI:Schema:Title')."
\n");
- $oPage->add("
");
- $oPage->add("
");
+ $oPage->add("
");
+ $oPage->add("
");
$oPage->add("\n");
$oPage->add_ready_script(
<<add_script(
- <<add_script(
+ << $sDisplayName)
+ foreach ($aRootClasses as $sClassName => $sDisplayName)
{
if (MetaModel::IsRootClass($sClassName))
{
@@ -325,173 +343,190 @@ EOF
*/
function DisplayRelatedClassesGraph($oPage, $sClass)
{
- try
- {
- $bOnTheLeft = true;
- $bSkipLinkingClasses = false;
+ try
+ {
+ $bOnTheLeft = true;
+ $bSkipLinkingClasses = false;
// 1) Fetching referencing classes data
- //
- $aData = array();
- $aOrigins = array('_' => true);
- $aRefs = MetaModel::EnumReferencingClasses($sClass, $bSkipLinkingClasses);
- $sSelfReference = "false";
- if (count($aRefs) != 0)
- {
- foreach ($aRefs as $sRemoteClass => $aRemoteKeys)
- {
- foreach ($aRemoteKeys as $sExtKeyAttCode => $oExtKeyAttDef)
- {
- if($sRemoteClass != $sClass)
+ //
+ $aData = array();
+ $aOrigins = array('_' => true);
+ $aRefs = MetaModel::EnumReferencingClasses($sClass, $bSkipLinkingClasses);
+ $sSelfReference = "false";
+ if (count($aRefs) != 0)
+ {
+ foreach ($aRefs as $sRemoteClass => $aRemoteKeys)
+ {
+ foreach ($aRemoteKeys as $sExtKeyAttCode => $oExtKeyAttDef)
+ {
+ if ($sRemoteClass != $sClass)
{
// ref_prefix to avoid collision between attributes labels that refer to this class and local attributes label that references other classes
- $aAttribute = array('label' => 'ref_'.$sExtKeyAttCode);
- // Test if a distant attribut exists and if it uses a link class
- if(!($oExtKeyAttDef->GetMirrorLinkAttribute() == null ? false : $oExtKeyAttDef->GetMirrorLinkAttribute() instanceof AttributeLinkedSetIndirect))
- {
- $aAttribute['related'] = $sRemoteClass;
- $aAttribute['related_icon'] = MetaModel::GetClassIcon($aAttribute['related'], false);
- $aAttribute['related_position'] = $bOnTheLeft ? -1 : 1;
- $aAttribute['relation_type'] = 0;
- $bOnTheLeft = !$bOnTheLeft; // Toggle the side
- $sOrigin = MetaModel::GetAttributeOrigin($sRemoteClass, $sExtKeyAttCode);
- $aAttribute['origin'] = $sOrigin;
- $aOrigins[$sOrigin] = true;
- $aData[$sExtKeyAttCode . $sRemoteClass] = $aAttribute;
- }
- }
- }
- }
- }
+ $aAttribute = array('label' => 'ref_'.$sExtKeyAttCode);
+ // Test if a distant attribut exists and if it uses a link class
+ if (!($oExtKeyAttDef->GetMirrorLinkAttribute() == null ? false : $oExtKeyAttDef->GetMirrorLinkAttribute() instanceof AttributeLinkedSetIndirect))
+ {
+ $aAttribute['related'] = $sRemoteClass;
+ $aAttribute['related_icon'] = MetaModel::GetClassIcon($aAttribute['related'], false);
+ $aAttribute['related_position'] = $bOnTheLeft ? -1 : 1;
+ $aAttribute['relation_type'] = 0;
+ $bOnTheLeft = !$bOnTheLeft; // Toggle the side
+ $sOrigin = MetaModel::GetAttributeOrigin($sRemoteClass, $sExtKeyAttCode);
+ $aAttribute['origin'] = $sOrigin;
+ $aOrigins[$sOrigin] = true;
+ $aData[$sExtKeyAttCode.$sRemoteClass] = $aAttribute;
+ }
+ }
+ }
+ }
+ }
- // 2) Fetching referenced classes data
- //
- $aDataRef = array(array('label' => $sClass, 'icon' => MetaModel::GetClassIcon($sClass, false), 'origin_index' => 0, 'alphabetical_index' => 0, 'origin' => '_'));
- $bOnTheLeft = true;
- $aOriginsRef = array('_' => true);
- foreach(MetaModel::ListAttributeDefs($sClass) as $sAttCode => $oAttDef)
- {
- $aAttribute = array('label' => $sAttCode);
- if ($oAttDef->IsLinkSet())
- {
- if ($oAttDef->IsIndirect())
- {
- $sRemoteAttDef = $oAttDef->GetExtKeyToRemote();
- $aAttribute['related'] = MetaModel::GetAttributeDef($oAttDef->GetLinkedClass(), $sRemoteAttDef)->GetTargetClass();
- $aAttribute['related_icon'] = MetaModel::GetClassIcon($aAttribute['related'], false);
- $aAttribute['related_position'] = $bOnTheLeft ? 1 : -1;
- $aAttribute['relation_type'] = 0; //
- $aAttribute['tooltip_data']['class'] = $oAttDef->GetLinkedClass();
- $aAttribute['tooltip_data']['to_remote'] = $sRemoteAttDef;
- $aAttribute['tooltip_data']['to_me'] = $oAttDef->GetExtKeyToMe();
+ // 2) Fetching referenced classes data
+ //
+ $aDataRef = array(
+ array(
+ 'label' => $sClass,
+ 'icon' => MetaModel::GetClassIcon($sClass, false),
+ 'origin_index' => 0,
+ 'alphabetical_index' => 0,
+ 'origin' => '_',
+ ),
+ );
+ $bOnTheLeft = true;
+ $aOriginsRef = array('_' => true);
+ foreach (MetaModel::ListAttributeDefs($sClass) as $sAttCode => $oAttDef)
+ {
+ $aAttribute = array('label' => $sAttCode);
+ if ($oAttDef->IsLinkSet())
+ {
+ if ($oAttDef->IsIndirect())
+ {
+ $sRemoteAttDef = $oAttDef->GetExtKeyToRemote();
+ $aAttribute['related'] = MetaModel::GetAttributeDef($oAttDef->GetLinkedClass(), $sRemoteAttDef)->GetTargetClass();
+ $aAttribute['related_icon'] = MetaModel::GetClassIcon($aAttribute['related'], false);
+ $aAttribute['related_position'] = $bOnTheLeft ? 1 : -1;
+ $aAttribute['relation_type'] = 0; //
+ $aAttribute['tooltip_data']['class'] = $oAttDef->GetLinkedClass();
+ $aAttribute['tooltip_data']['to_remote'] = $sRemoteAttDef;
+ $aAttribute['tooltip_data']['to_me'] = $oAttDef->GetExtKeyToMe();
- $bOnTheLeft = !$bOnTheLeft; // Toggle the side
- }
- else
- {
- $aAttribute['related'] = $oAttDef->GetLinkedClass();
- $aAttribute['related_icon'] = MetaModel::GetClassIcon($aAttribute['related'], false);
- $aAttribute['related_position'] = $bOnTheLeft ? 1 : -1;
- $aAttribute['relation_type'] = 1;
- $bOnTheLeft = !$bOnTheLeft; // Toggle the side
- }
+ $bOnTheLeft = !$bOnTheLeft; // Toggle the side
+ }
+ else
+ {
+ $aAttribute['related'] = $oAttDef->GetLinkedClass();
+ $aAttribute['related_icon'] = MetaModel::GetClassIcon($aAttribute['related'], false);
+ $aAttribute['related_position'] = $bOnTheLeft ? 1 : -1;
+ $aAttribute['relation_type'] = 1;
+ $bOnTheLeft = !$bOnTheLeft; // Toggle the side
+ }
- }
- else if ($oAttDef->IsHierarchicalKey())
- {
- $aAttribute['related'] = $sClass;
- $aAttribute['related_icon'] = MetaModel::GetClassIcon($aAttribute['related'], false);
- $aAttribute['related_position'] = $bOnTheLeft ? 1 : -1;
- $aAttribute['relation_type'] = 2;
- $bOnTheLeft = !$bOnTheLeft; // Toggle the side
- $sSelfReference = "true";
- }
- else if ($oAttDef->IsExternalKey())
- {
- $aAttribute['related'] = $oAttDef->GetTargetClass();
- $aAttribute['related_icon'] = MetaModel::GetClassIcon($aAttribute['related'], false);
- $aAttribute['related_position'] = $bOnTheLeft ? 1 : -1;
- $aAttribute['relation_type'] = 3;
+ }
+ else
+ {
+ if ($oAttDef->IsHierarchicalKey())
+ {
+ $aAttribute['related'] = $sClass;
+ $aAttribute['related_icon'] = MetaModel::GetClassIcon($aAttribute['related'], false);
+ $aAttribute['related_position'] = $bOnTheLeft ? 1 : -1;
+ $aAttribute['relation_type'] = 2;
+ $bOnTheLeft = !$bOnTheLeft; // Toggle the side
+ $sSelfReference = "true";
+ }
+ else
+ {
+ if ($oAttDef->IsExternalKey())
+ {
+ $aAttribute['related'] = $oAttDef->GetTargetClass();
+ $aAttribute['related_icon'] = MetaModel::GetClassIcon($aAttribute['related'], false);
+ $aAttribute['related_position'] = $bOnTheLeft ? 1 : -1;
+ $aAttribute['relation_type'] = 3;
- $bOnTheLeft = !$bOnTheLeft; // Toggle the side
- }
- if ($oAttDef->IsLinkSet() || $oAttDef->IsHierarchicalKey() || $oAttDef->IsExternalKey()){
- $sOrigin = MetaModel::GetAttributeOrigin($sClass, $sAttCode);
+ $bOnTheLeft = !$bOnTheLeft; // Toggle the side
+ }
+ }
+ }
+ if ($oAttDef->IsLinkSet() || $oAttDef->IsHierarchicalKey() || $oAttDef->IsExternalKey())
+ {
+ $sOrigin = MetaModel::GetAttributeOrigin($sClass, $sAttCode);
$aAttribute['origin'] = $sOrigin;
- $aOriginsRef[$sOrigin] = true;
- $aDataRef[$sAttCode] = $aAttribute;
+ $aOriginsRef[$sOrigin] = true;
+ $aDataRef[$sAttCode] = $aAttribute;
}
- }
+ }
- //sort referencing data
+ //sort referencing data
- $aOrigins = array_keys($aOrigins);
- $idx = 0;
+ $aOrigins = array_keys($aOrigins);
+ $idx = 0;
$bOnTheLeft = true;
- foreach($aData as $sAttCode => $aAttribute)
- {
- $is_also_referenced = false;
- foreach($aDataRef as $sAttCodeRef => $aAttributeRef)
- {
- if(!empty($aDataRef[$sAttCodeRef]['related']) && ($aData[$sAttCode]['related'] == $aDataRef[$sAttCodeRef]['related']))
- $is_also_referenced = true;
- }
- if(!$is_also_referenced)
- {
- $aData[$sAttCode]['related_position'] = ($bOnTheLeft) ? -1 : 1;
- $bOnTheLeft = !$bOnTheLeft;
- $aData[$sAttCode]['origin_index'] = ($aData[$sAttCode]['related_position'] == -1) ? ++$idx : $idx;
- }
- else
- {
- unset($aData[$sAttCode]);
- }
- }
- ksort($aData);
- $idx = 0;
- $aFinalDataReferencing = array();
- foreach($aData as $sAttCode => $aAttribute)
- {
- $aData[$sAttCode]['alphabetical_index'] = $aAttribute['related_position'] == 1 ? ++$idx : $idx;
- $aFinalDataReferencing[] = $aData[$sAttCode];
- }
- $sDataReferencing = json_encode($aFinalDataReferencing);
- $sOriginsReferencing = json_encode(array_keys($aOrigins));
+ foreach ($aData as $sAttCode => $aAttribute)
+ {
+ $is_also_referenced = false;
+ foreach ($aDataRef as $sAttCodeRef => $aAttributeRef)
+ {
+ if (!empty($aDataRef[$sAttCodeRef]['related']) && ($aData[$sAttCode]['related'] == $aDataRef[$sAttCodeRef]['related']))
+ {
+ $is_also_referenced = true;
+ }
+ }
+ if (!$is_also_referenced)
+ {
+ $aData[$sAttCode]['related_position'] = ($bOnTheLeft) ? -1 : 1;
+ $bOnTheLeft = !$bOnTheLeft;
+ $aData[$sAttCode]['origin_index'] = ($aData[$sAttCode]['related_position'] == -1) ? ++$idx : $idx;
+ }
+ else
+ {
+ unset($aData[$sAttCode]);
+ }
+ }
+ ksort($aData);
+ $idx = 0;
+ $aFinalDataReferencing = array();
+ foreach ($aData as $sAttCode => $aAttribute)
+ {
+ $aData[$sAttCode]['alphabetical_index'] = $aAttribute['related_position'] == 1 ? ++$idx : $idx;
+ $aFinalDataReferencing[] = $aData[$sAttCode];
+ }
+ $sDataReferencing = json_encode($aFinalDataReferencing);
+ $sOriginsReferencing = json_encode(array_keys($aOrigins));
- //sort referenced data
+ //sort referenced data
- $idx = 1;
- foreach($aDataRef as $sAttCode => $aAttribute)
- {
- $aDataRef[$sAttCode]['origin_index'] = $idx++;
- }
+ $idx = 1;
+ foreach ($aDataRef as $sAttCode => $aAttribute)
+ {
+ $aDataRef[$sAttCode]['origin_index'] = $idx++;
+ }
- $idx = 1;
- $aFinalData = array();
- foreach($aDataRef as $sAttCode => $aAttribute)
- {
- $aDataRef[$sAttCode]['alphabetical_index'] = $idx++;
- $aFinalData[] = $aDataRef[$sAttCode];
- }
+ $idx = 1;
+ $aFinalData = array();
+ foreach ($aDataRef as $sAttCode => $aAttribute)
+ {
+ $aDataRef[$sAttCode]['alphabetical_index'] = $idx++;
+ $aFinalData[] = $aDataRef[$sAttCode];
+ }
- $sData = json_encode($aFinalData);
+ $sData = json_encode($aFinalData);
- // 3) Processing data and building graph
- //
- $oPage->add(
- <<add(
+ <<
EOF
- );
- $oPage->add_ready_script(
- <<add_ready_script(
+ <<p(''.Dict::Format('UI:RunQuery:Error', $e->getMessage()).'');
- }
+ );
+ }
+ catch (Exception $e)
+ {
+ $oPage->p(''.Dict::Format('UI:RunQuery:Error', $e->getMessage()).'');
+ }
}
/**
@@ -775,7 +810,7 @@ function DisplayClassDetails($oPage, $sClass, $sContext)
{
DisplayClassHeader($oPage, $sClass);
$aParentClasses = array();
- foreach(MetaModel::EnumParentClasses($sClass) as $sParentClass)
+ foreach (MetaModel::EnumParentClasses($sClass) as $sParentClass)
{
$aParentClasses[] = MakeClassHLink($sParentClass, $sContext);
}
@@ -793,10 +828,10 @@ function DisplayClassDetails($oPage, $sClass, $sContext)
{
$oPage->add("");
$oPage->add("- ".$sClass."\n");
- DisplaySubclasses($oPage, $sClass,$sContext);
+ DisplaySubclasses($oPage, $sClass, $sContext);
$oPage->add("
\n");
$oPage->add("
\n");
- $oPage->add_ready_script('$("#ClassHierarchy").treeview();');
+ $oPage->add_ready_script('$("#ClassHierarchy").treeview();');
}
$oPage->p('');
$oPage->add("");
@@ -808,11 +843,11 @@ function DisplayClassDetails($oPage, $sClass, $sContext)
$aDetails = array();
$aOrigins = array();
- foreach(MetaModel::ListAttributeDefs($sClass) as $sAttCode=>$oAttDef)
+ foreach (MetaModel::ListAttributeDefs($sClass) as $sAttCode => $oAttDef)
{
if ($oAttDef->IsExternalKey())
{
- $sValue = Dict::Format('UI:Schema:ExternalKey_To',MakeClassHLink($oAttDef->GetTargetClass(), $sContext));
+ $sValue = Dict::Format('UI:Schema:ExternalKey_To', MakeClassHLink($oAttDef->GetTargetClass(), $sContext));
if (array_key_exists($sAttCode, $aForwardChangeTracking))
{
$oLinkSet = $aForwardChangeTracking[$sAttCode];
@@ -826,19 +861,19 @@ function DisplayClassDetails($oPage, $sClass, $sContext)
}
else
{
- $sValue = $oAttDef->GetDescription();
+ $sValue = $oAttDef->GetDescription();
}
$sType = get_class($oAttDef);
$sTypeDict = $oAttDef->GetType();
- $sTypeDesc = $oAttDef->GetTypeDesc();
+ $sTypeDesc = $oAttDef->GetTypeDesc();
- $sOrigin = MetaModel::GetAttributeOrigin($sClass, $sAttCode);
- $aOrigins[$sOrigin] = true;
- $sAllowedValues = "";
+ $sOrigin = MetaModel::GetAttributeOrigin($sClass, $sAttCode);
+ $aOrigins[$sOrigin] = true;
+ $sAllowedValues = "";
$sMoreInfo = "";
$sDefaultNullValue = '""';
$aCols = array();
- foreach($oAttDef->GetSQLColumns() as $sCol => $sFieldDesc)
+ foreach ($oAttDef->GetSQLColumns() as $sCol => $sFieldDesc)
{
$aCols[] = "$sCol: $sFieldDesc";
}
@@ -846,24 +881,25 @@ function DisplayClassDetails($oPage, $sClass, $sContext)
{
$aMoreInfo = array();
- if($oAttDef->IsNullAllowed())
+ if ($oAttDef->IsNullAllowed())
{
$aMoreInfo[] = Dict::S('UI:Schema:NullAllowed');
- $sDefaultNullValue = (!is_null($oAttDef->GetNullValue()) ? $oAttDef->GetNullValue() : null );
- if(!is_null($sDefaultNullValue) && !is_string($sDefaultNullValue))
+ $sDefaultNullValue = (!is_null($oAttDef->GetNullValue()) ? $oAttDef->GetNullValue() : null);
+ if (!is_null($sDefaultNullValue) && !is_string($sDefaultNullValue))
{
$sDefaultNullValue = json_encode($sDefaultNullValue);
}
- $sDefaultNullValue = (!is_null($sDefaultNullValue) ? json_encode(Dict::Format('UI:Schema:DefaultNullValue', $sDefaultNullValue)) : '""' );
+ $sDefaultNullValue = (!is_null($sDefaultNullValue) ? json_encode(Dict::Format('UI:Schema:DefaultNullValue',
+ $sDefaultNullValue)) : '""');
}
else
{
$aMoreInfo[] = Dict::S('UI:Schema:NullNotAllowed');
}
- if($oAttDef->GetDefaultValue())
+ if ($oAttDef->GetDefaultValue())
{
$sDefaultValue = $oAttDef->GetDefaultValue();
- if(!is_string($sDefaultValue))
+ if (!is_string($sDefaultValue))
{
$sDefaultValue = json_encode($sDefaultValue);
}
@@ -871,29 +907,29 @@ function DisplayClassDetails($oPage, $sClass, $sContext)
}
$sMoreInfo .= implode(', ', $aMoreInfo);
}
- $sAttrCode = $oAttDef->GetCode();
- $sIsEnumValues = 'false';
- $sAllowedValuesEscpd = '""';
+ $sAttrCode = $oAttDef->GetCode();
+ $sIsEnumValues = 'false';
+ $sAllowedValuesEscpd = '""';
if ($oAttDef instanceof AttributeEnum)
{
// Display localized values for the enum (which depend on the localization provided by the class)
$aLocalizedValues = MetaModel::GetAllowedValues_att($sClass, $sAttCode, array());
$aDescription = array();
- foreach($aLocalizedValues as $val => $sDisplay)
+ foreach ($aLocalizedValues as $val => $sDisplay)
{
- $aDescription[] = "". $sDisplay ." (" . $val . ")";
+ $aDescription[] = "".$sDisplay." (".$val.")";
}
$sAllowedValues = implode(', ', $aDescription);
- $sIsEnumValues = 'true';
+ $sIsEnumValues = 'true';
}
elseif (is_object($oAllowedValuesDef = $oAttDef->GetValuesDef()))
{
$sAllowedValues = str_replace("Filter: ", "", $oAllowedValuesDef->GetValuesDescription());
- $sAllowedValuesEscpd = json_encode($sAllowedValues);
+ $sAllowedValuesEscpd = json_encode($sAllowedValues);
- $sFilterURL = urlencode($sAllowedValues);
- $sAllowedValues = "⚵" . Dict::S('UI:Schema:Attribute/Filter') . "";
- }
+ $sFilterURL = urlencode($sAllowedValues);
+ $sAllowedValues = "⚵".Dict::S('UI:Schema:Attribute/Filter')."";
+ }
else
{
$sAllowedValues = '';
@@ -902,15 +938,17 @@ function DisplayClassDetails($oPage, $sClass, $sContext)
$sAttrTypeDescEscpd = json_encode($sTypeDesc);
$sAttrOriginEscpd = json_encode($sOrigin);
- $aDetails[] = array('code' => "". $oAttDef->GetLabel() ." (" . $oAttDef->GetCode() .")",
- 'type' => "". $sTypeDict ." (" . $sType .")",
- 'origincolor' => "",
- 'origin' => "$sOrigin",
- 'values' => $sAllowedValues,
- 'moreinfo' => " $sMoreInfo");
+ $aDetails[] = array(
+ 'code' => "".$oAttDef->GetLabel()." (".$oAttDef->GetCode().")",
+ 'type' => "".$sTypeDict." (".$sType.")",
+ 'origincolor' => "",
+ 'origin' => "$sOrigin",
+ 'values' => $sAllowedValues,
+ 'moreinfo' => " $sMoreInfo",
+ );
//tooltip construction
- $oPage->add_ready_script(
- <<add_ready_script(
+ <<SetCurrentTab('UI:Schema:Attributes');
- $aConfig = array( 'origincolor' => array('label' => "", 'description' => ""),
- 'code' => array('label' => Dict::S('UI:Schema:AttributeCode'), 'description' => Dict::S('UI:Schema:AttributeCode+')),
- 'type' => array('label' => Dict::S('UI:Schema:Type'), 'description' => Dict::S('UI:Schema:Type+')),
- 'values' => array('label' => Dict::S('UI:Schema:AllowedValues'), 'description' => Dict::S('UI:Schema:AllowedValues+')),
- 'moreinfo' => array('label' => Dict::S('UI:Schema:MoreInfo'), 'description' => Dict::S('UI:Schema:MoreInfo+')),
- 'origin' => array('label' => Dict::S('UI:Schema:Origin'), 'description' => Dict::S('UI:Schema:Origin+')),
+ $aConfig = array(
+ 'origincolor' => array('label' => "", 'description' => ""),
+ 'code' => array('label' => Dict::S('UI:Schema:AttributeCode'), 'description' => Dict::S('UI:Schema:AttributeCode+')),
+ 'type' => array('label' => Dict::S('UI:Schema:Type'), 'description' => Dict::S('UI:Schema:Type+')),
+ 'values' => array('label' => Dict::S('UI:Schema:AllowedValues'), 'description' => Dict::S('UI:Schema:AllowedValues+')),
+ 'moreinfo' => array('label' => Dict::S('UI:Schema:MoreInfo'), 'description' => Dict::S('UI:Schema:MoreInfo+')),
+ 'origin' => array('label' => Dict::S('UI:Schema:Origin'), 'description' => Dict::S('UI:Schema:Origin+')),
);
$oPage->table($aConfig, $aDetails);
- $sOrigins = json_encode(array_keys($aOrigins));
+ $sOrigins = json_encode(array_keys($aOrigins));
- //color calculation in order to keep 1 color for 1 extended class. Colors are interpolated and will be used for
+ //color calculation in order to keep 1 color for 1 extended class. Colors are interpolated and will be used for
// graph scheme color too
- $oPage->add_ready_script(
- <<< EOF
+ $oPage->add_ready_script(
+ <<< EOF
var aOrigins = $sOrigins;
var aColors = d3.scale.linear().domain([1,aOrigins.length])
.interpolate(d3.interpolateHcl)
@@ -959,15 +998,15 @@ EOF
});
EOF
- );
+ );
- $oPage->SetCurrentTab('UI:Schema:RelatedClasses');
- DisplayRelatedClassesGraph($oPage, $sClass);
- $oPage->SetCurrentTab('UI:Schema:ChildClasses');
+ $oPage->SetCurrentTab('UI:Schema:RelatedClasses');
+ DisplayRelatedClassesGraph($oPage, $sClass);
+ $oPage->SetCurrentTab('UI:Schema:ChildClasses');
- DisplaySubclasses($oPage, $sClass, $sContext);
+ DisplaySubclasses($oPage, $sClass, $sContext);
- $oPage->SetCurrentTab('UI:Schema:LifeCycle');
+ $oPage->SetCurrentTab('UI:Schema:LifeCycle');
DisplayLifecycle($oPage, $sClass);
$oPage->SetCurrentTab('UI:Schema:Triggers');
@@ -981,17 +1020,19 @@ EOF
/**
* Display the dropdown that allow to select the attributes/class display granularity
*/
-function DisplayGranularityDisplayer($oPage){
+function DisplayGranularityDisplayer($oPage)
+{
$oPage->add("
-