本文整理汇总了PHP中MetaModel::GetClassIcon方法的典型用法代码示例。如果您正苦于以下问题:PHP MetaModel::GetClassIcon方法的具体用法?PHP MetaModel::GetClassIcon怎么用?PHP MetaModel::GetClassIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MetaModel
的用法示例。
在下文中一共展示了MetaModel::GetClassIcon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetIcon
public function GetIcon($bImgTag = true, $sMoreStyles = '')
{
if ($this->Get('url_icon') == '') {
return MetaModel::GetClassIcon(get_class($this), $bImgTag);
}
if ($bImgTag) {
return "<img src=\"" . $this->Get('url_icon') . "\" style=\"vertical-align:middle;{$sMoreStyles}\"/>";
}
return $this->Get('url_icon');
}
示例2: GetIcon
/**
* Get the icon representing this object
* @param boolean $bImgTag If true the result is a full IMG tag (or an emtpy string if no icon is defined)
* @return string Either the full IMG tag ($bImgTag == true) or just the path to the icon file
*/
public function GetIcon($bImgTag = true)
{
return MetaModel::GetClassIcon(get_class($this), $bImgTag);
}
示例3: GetIcon
/**
* Get the icon representing this object
* @param boolean $bImgTag If true the result is a full IMG tag (or an emtpy string if no icon is defined)
* @return string Either the full IMG tag ($bImgTag == true) or just the path to the icon file
*/
public function GetIcon($bImgTag = true)
{
$sStatus = $this->Get('status');
switch ($this->GetState()) {
case 'approved':
case 'implemented':
case 'monitored':
$sIcon = self::MakeIconFromName('change-approved.png');
break;
case 'rejected':
case 'notapproved':
$sIcon = self::MakeIconFromName('change-rejected.png');
break;
case 'closed':
$sIcon = self::MakeIconFromName('change-closed.png');
break;
default:
$sIcon = MetaModel::GetClassIcon(get_class($this), $bImgTag);
}
return $sIcon;
}
示例4: foreach
$sHtml .= "</div>\n";
$oPage->add($sHtml);
cmdbAbstractObject::DisplaySet($oPage, $oSet);
$oPage->p('');
// Some space
}
// Then the content of the groups (one table per group)
if (count($aGroups) > 0) {
$oPage->get_tcpdf()->AddPage();
$oPage->add('<div class="page_header"><h1>' . Dict::S('UI:RelationGroups') . '</h1></div>');
foreach ($aGroups as $idx => $aObjects) {
set_time_limit($iLoopTimeLimit);
$sListClass = get_class(current($aObjects));
$oSet = CMDBObjectSet::FromArray($sListClass, $aObjects);
$sHtml = "<div class=\"page_header\">\n";
$sHtml .= "<table class=\"section\"><tr><td>" . MetaModel::GetClassIcon($sListClass, true, 'width: 24px; height: 24px;') . " " . Dict::Format('UI:RelationGroupNumber_N', 1 + $idx) . "</td></tr></table>\n";
$sHtml .= "</div>\n";
$oPage->add($sHtml);
cmdbAbstractObject::DisplaySet($oPage, $oSet);
$oPage->p('');
// Some space
}
}
}
if ($operation == 'relation_attachment') {
$sObjClass = utils::ReadParam('obj_class', '', false, 'class');
$iObjKey = (int) utils::ReadParam('obj_key', 0, false, 'integer');
// Save the generated PDF as an attachment
$sPDF = $oPage->get_pdf();
$oPage = new ajax_page('');
$oAttachment = new Attachment();
示例5: Display
/**
* Display the graph inside the given page, with the "filter" drawer above it
* @param WebPage $oP
* @param hash $aResults
* @param string $sRelation
* @param ApplicationContext $oAppContext
* @param array $aExcludedObjects
*/
function Display(WebPage $oP, $aResults, $sRelation, ApplicationContext $oAppContext, $aExcludedObjects = array(), $sObjClass = null, $iObjKey = null, $sContextKey, $aContextParams = array())
{
$aContextDefs = static::GetContextDefinitions($sContextKey, true, $aContextParams);
$aExcludedByClass = array();
foreach ($aExcludedObjects as $oObj) {
if (!array_key_exists(get_class($oObj), $aExcludedByClass)) {
$aExcludedByClass[get_class($oObj)] = array();
}
$aExcludedByClass[get_class($oObj)][] = $oObj->GetKey();
}
$oP->add("<div class=\"not-printable\">\n");
$oP->add("<div id=\"ds_flash\" class=\"SearchDrawer\" style=\"display:none;\">\n");
if (!$oP->IsPrintableVersion()) {
$oP->add_ready_script(<<<EOF
\t\$( "#tabbedContent_0" ).tabs({ heightStyle: "fill" });
EOF
);
}
$oP->add_ready_script(<<<EOF
\t\$("#dh_flash").click( function() {
\t\t\$("#ds_flash").slideToggle('normal', function() { \$("#ds_flash").parent().resize(); \$("#dh_flash").trigger('toggle_complete'); } );
\t\t\$("#dh_flash").toggleClass('open');
\t});
\$('#ReloadMovieBtn').button().button('disable');
EOF
);
$aSortedElements = array();
foreach ($aResults as $sClassIdx => $aObjects) {
foreach ($aObjects as $oCurrObj) {
$sSubClass = get_class($oCurrObj);
$aSortedElements[$sSubClass] = MetaModel::GetName($sSubClass);
}
}
asort($aSortedElements);
$idx = 0;
foreach ($aSortedElements as $sSubClass => $sClassName) {
$oP->add("<span style=\"padding-right:2em; white-space:nowrap;\"><input type=\"checkbox\" id=\"exclude_{$idx}\" name=\"excluded[]\" value=\"{$sSubClass}\" checked onChange=\"\$('#ReloadMovieBtn').button('enable')\"><label for=\"exclude_{$idx}\"> " . MetaModel::GetClassIcon($sSubClass) . " {$sClassName}</label></span> ");
$idx++;
}
$oP->add("<p style=\"text-align:right\"><button type=\"button\" id=\"ReloadMovieBtn\" onClick=\"DoReload()\">" . Dict::S('UI:Button:Refresh') . "</button></p>");
$oP->add("</div>\n");
$oP->add("<div class=\"HRDrawer\"></div>\n");
$oP->add("<div id=\"dh_flash\" class=\"DrawerHandle\">" . Dict::S('UI:ElementsDisplayed') . "</div>\n");
$oP->add("</div>\n");
// class="not-printable"
$aAdditionalContexts = array();
foreach ($aContextDefs as $sKey => $aDefinition) {
$aAdditionalContexts[] = array('key' => $sKey, 'label' => Dict::S($aDefinition['dict']), 'oql' => $aDefinition['oql'], 'default' => array_key_exists('default', $aDefinition) && $aDefinition['default'] == 'yes');
}
$sDirection = utils::ReadParam('d', 'horizontal');
$iGroupingThreshold = utils::ReadParam('g', 5);
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'js/fraphael.js');
$oP->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot() . 'css/jquery.contextMenu.css');
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'js/jquery.contextMenu.js');
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'js/simple_graph.js');
try {
$this->InitFromGraphviz();
$sExportAsPdfURL = '';
$sExportAsPdfURL = utils::GetAbsoluteUrlAppRoot() . 'pages/ajax.render.php?operation=relation_pdf&relation=' . $sRelation . '&direction=' . ($this->bDirectionDown ? 'down' : 'up');
$oAppcontext = new ApplicationContext();
$sContext = $oAppContext->GetForLink();
$sDrillDownURL = utils::GetAbsoluteUrlAppRoot() . 'pages/UI.php?operation=details&class=%1$s&id=%2$s&' . $sContext;
$sExportAsDocumentURL = utils::GetAbsoluteUrlAppRoot() . 'pages/ajax.render.php?operation=relation_attachment&relation=' . $sRelation . '&direction=' . ($this->bDirectionDown ? 'down' : 'up');
$sLoadFromURL = utils::GetAbsoluteUrlAppRoot() . 'pages/ajax.render.php?operation=relation_json&relation=' . $sRelation . '&direction=' . ($this->bDirectionDown ? 'down' : 'up');
$sAttachmentExportTitle = '';
if ($sObjClass != null && $iObjKey != null) {
$oTargetObj = MetaModel::GetObject($sObjClass, $iObjKey, false);
if ($oTargetObj) {
$sAttachmentExportTitle = Dict::Format('UI:Relation:AttachmentExportOptions_Name', $oTargetObj->GetName());
}
}
$sId = 'graph';
$sStyle = '';
if ($oP->IsPrintableVersion()) {
// Optimize for printing on A4/Letter vertically
$sStyle = 'margin-left:auto; margin-right:auto;';
$oP->add_ready_script("\$('.simple-graph').width(18/2.54*96).resizable({ stop: function() { \$(window).trigger('resized'); }});");
// Default width about 18 cm, since most browsers assume 96 dpi
}
$oP->add('<div id="' . $sId . '" class="simple-graph" style="' . $sStyle . '"></div>');
$aParams = array('source_url' => $sLoadFromURL, 'sources' => $this->bDirectionDown ? $this->aSourceObjects : $this->aSinkObjects, 'excluded' => $aExcludedByClass, 'grouping_threshold' => $iGroupingThreshold, 'export_as_pdf' => array('url' => $sExportAsPdfURL, 'label' => Dict::S('UI:Relation:ExportAsPDF')), 'export_as_attachment' => array('url' => $sExportAsDocumentURL, 'label' => Dict::S('UI:Relation:ExportAsAttachment'), 'obj_class' => $sObjClass, 'obj_key' => $iObjKey), 'drill_down' => array('url' => $sDrillDownURL, 'label' => Dict::S('UI:Relation:DrillDown')), 'labels' => array('export_pdf_title' => Dict::S('UI:Relation:PDFExportOptions'), 'export_as_attachment_title' => $sAttachmentExportTitle, 'export' => Dict::S('UI:Button:Export'), 'cancel' => Dict::S('UI:Button:Cancel'), 'title' => Dict::S('UI:RelationOption:Title'), 'untitled' => Dict::S('UI:RelationOption:Untitled'), 'include_list' => Dict::S('UI:RelationOption:IncludeList'), 'comments' => Dict::S('UI:RelationOption:Comments'), 'grouping_threshold' => Dict::S('UI:RelationOption:GroupingThreshold'), 'refresh' => Dict::S('UI:Button:Refresh'), 'check_all' => Dict::S('UI:SearchValue:CheckAll'), 'uncheck_all' => Dict::S('UI:SearchValue:UncheckAll'), 'none_selected' => Dict::S('UI:Relation:NoneSelected'), 'nb_selected' => Dict::S('UI:SearchValue:NbSelected'), 'additional_context_info' => Dict::S('UI:Relation:AdditionalContextInfo'), 'zoom' => Dict::S('UI:Relation:Zoom'), 'loading' => Dict::S('UI:Loading')), 'page_format' => array('label' => Dict::S('UI:Relation:PDFExportPageFormat'), 'values' => array('A3' => Dict::S('UI:PageFormat_A3'), 'A4' => Dict::S('UI:PageFormat_A4'), 'Letter' => Dict::S('UI:PageFormat_Letter'))), 'page_orientation' => array('label' => Dict::S('UI:Relation:PDFExportPageOrientation'), 'values' => array('P' => Dict::S('UI:PageOrientation_Portrait'), 'L' => Dict::S('UI:PageOrientation_Landscape'))), 'additional_contexts' => $aAdditionalContexts, 'context_key' => $sContextKey);
if (!extension_loaded('gd')) {
// PDF export requires GD
unset($aParams['export_as_pdf']);
}
if (!extension_loaded('gd') || is_null($sObjClass) || is_null($iObjKey)) {
// Export as Attachment requires GD (for building the PDF) AND a valid objclass/objkey couple
unset($aParams['export_as_attachment']);
}
$oP->add_ready_script("\$('#{$sId}').simple_graph(" . json_encode($aParams) . ");");
} catch (Exception $e) {
$oP->add('<div>' . $e->getMessage() . '</div>');
//.........这里部分代码省略.........
示例6: trim
$sClass = trim(utils::ReadParam('class', ''));
$iTune = utils::ReadParam('tune', 0);
if (preg_match('/^"(.*)"$/', $sFullText, $aMatches)) {
// The text is surrounded by double-quotes, remove the quotes and treat it as one single expression
$aFullTextNeedles = array($aMatches[1]);
} else {
// Split the text on the blanks and treat this as a search for <word1> AND <word2> AND <word3>
$aFullTextNeedles = explode(' ', $sFullText);
}
$oFilter = new DBObjectSearch($sClass);
foreach ($aFullTextNeedles as $sSearchText) {
$oFilter->AddCondition_FullText($sSearchText);
}
$oSet = new DBObjectSet($oFilter);
$oPage->add("<div class=\"page_header\">\n");
$oPage->add("<h2>" . MetaModel::GetClassIcon($sClass) . " <span class=\"hilite\">" . Dict::Format('UI:Search:Count_ObjectsOf_Class_Found', $oSet->Count(), Metamodel::GetName($sClass)) . "</h2>\n");
$oPage->add("</div>\n");
if ($oSet->Count() > 0) {
$aLeafs = array();
while ($oObj = $oSet->Fetch()) {
if (get_class($oObj) == $sClass) {
$aLeafs[] = $oObj->GetKey();
}
}
$oLeafsFilter = new DBObjectSearch($sClass);
if (count($aLeafs) > 0) {
$oLeafsFilter->AddCondition('id', $aLeafs, 'IN');
$oBlock = new DisplayBlock($oLeafsFilter, 'list', false);
$sBlockId = 'global_search_' . $sClass;
$oPage->add('<div id="' . $sBlockId . '">');
$oBlock->RenderContent($oPage, array('table_id' => $sBlockId, 'currentId' => $sBlockId));
示例7: GetClassIcon
public function GetClassIcon($sClass, $bImgTag = true)
{
return MetaModel::GetClassIcon($sClass, $bImgTag);
}
示例8: MakeDictionaryTemplate
}
}
echo "</select>\n";
echo "<input type=\"button\" value=\" Refresh \" onclick=\"CheckDictionary(true);\"/>\n";
echo "<textarea style=\"width:100%;height:400px;\">";
echo MakeDictionaryTemplate($sModules, $sDefaultCode);
echo "</textarea>\n";
break;
case 'check_db_schema':
InitDataModel(ITOP_TOOLKIT_CONFIG_FILE, false);
$aAnalysis = CheckDBSchema();
$aSQLFixesTables = array();
$aSQLFixesAll = array();
foreach ($aAnalysis as $sClass => $aData) {
if (isset($aData['table_issues'])) {
echo "<h2>" . MetaModel::GetClassIcon($sClass) . " Class {$sClass}</h2>\n";
echo "<ul>\n";
foreach ($aData['table_issues'] as $sAttCode => $aIssues) {
foreach ($aIssues as $sText) {
echo "<li>{$sText}</li>";
}
}
echo "</ul>\n";
}
if (isset($aData['table_fixes'])) {
echo "<p class=\"fixes\">\n";
foreach ($aData['table_fixes'] as $sAttCode => $aIssues) {
foreach ($aIssues as $sSQL) {
$sSQLEscaped = htmlentities($sSQL, ENT_QUOTES, 'UTF-8');
echo "<p class=\"fix-sql\">{$sSQLEscaped}</p>\n";
}
示例9: GetDefaultValue
public function GetDefaultValue($sClass = 'Contact')
{
$sIconPath = MetaModel::GetClassIcon($sClass, false);
$sIcon = str_replace(utils::GetAbsoluteUrlModulesRoot(), '', $sIconPath);
return $sIcon;
}
示例10: GetIcon
/**
* Get the icon representing this object
* @param boolean $bImgTag If true the result is a full IMG tag (or an emtpy string if no icon is defined)
* @return string Either the full IMG tag ($bImgTag == true) or just the URL to the icon file
*/
public function GetIcon($bImgTag = true)
{
$sCode = $this->ComputeHighlightCode();
if ($sCode != '') {
$aHighlightScale = MetaModel::GetHighlightScale(get_class($this));
if (array_key_exists($sCode, $aHighlightScale)) {
$sIconUrl = $aHighlightScale[$sCode]['icon'];
if ($bImgTag) {
return "<img src=\"{$sIconUrl}\" style=\"vertical-align:middle\"/>";
} else {
return $sIconUrl;
}
}
}
return MetaModel::GetClassIcon(get_class($this), $bImgTag);
}
示例11: GetObjectCreationDlg
public function GetObjectCreationDlg(WebPage $oPage, $sProposedRealClass = '')
{
// For security reasons: check that the "proposed" class is actually a subclass of the linked class
// and that the current user is allowed to create objects of this class
$sRealClass = '';
$oPage->add('<div class="wizContainer" style="vertical-align:top;"><div>');
$aSubClasses = MetaModel::EnumChildClasses($this->sLinkedClass, ENUM_CHILD_CLASSES_ALL);
// Including the specified class itself
$aPossibleClasses = array();
foreach ($aSubClasses as $sCandidateClass) {
if (!MetaModel::IsAbstract($sCandidateClass) && UserRights::IsActionAllowed($sCandidateClass, UR_ACTION_MODIFY) == UR_ALLOWED_YES) {
if ($sCandidateClass == $sProposedRealClass) {
$sRealClass = $sProposedRealClass;
}
$aPossibleClasses[$sCandidateClass] = MetaModel::GetName($sCandidateClass);
}
}
// Only one of the subclasses can be instantiated...
if (count($aPossibleClasses) == 1) {
$aKeys = array_keys($aPossibleClasses);
$sRealClass = $aKeys[0];
}
if ($sRealClass != '') {
$oPage->add("<h1>" . MetaModel::GetClassIcon($sRealClass) . " " . Dict::Format('UI:CreationTitle_Class', MetaModel::GetName($sRealClass)) . "</h1>\n");
$oLinksetDef = MetaModel::GetAttributeDef($this->sClass, $this->sAttCode);
$sExtKeyToMe = $oLinksetDef->GetExtKeyToMe();
$aFieldFlags = array($sExtKeyToMe => OPT_ATT_HIDDEN);
cmdbAbstractObject::DisplayCreationForm($oPage, $sRealClass, null, array(), array('formPrefix' => $this->sInputid, 'noRelations' => true, 'fieldsFlags' => $aFieldFlags));
} else {
$sClassLabel = MetaModel::GetName($this->sLinkedClass);
$oPage->add('<p>' . Dict::Format('UI:SelectTheTypeOf_Class_ToCreate', $sClassLabel));
$oPage->add('<nobr><select name="class">');
asort($aPossibleClasses);
foreach ($aPossibleClasses as $sClassName => $sClassLabel) {
$oPage->add("<option value=\"{$sClassName}\">{$sClassLabel}</option>");
}
$oPage->add('</select>');
$oPage->add(' <button type="button" onclick="$(\'#' . $this->sInputid . '\').directlinks(\'subclassSelected\');">' . Dict::S('UI:Button:Apply') . '</button><span class="indicator" style="display:inline-block;width:16px"></span></nobr></p>');
}
$oPage->add('</div></div>');
}
示例12: foreach
$oGraph->UpdatePositions($aPositions);
}
$oPage->add($oGraph->GetAsJSON($sContextKey));
$oPage->SetContentType('application/json');
break;
case 'relation_groups':
$aGroups = utils::ReadParam('groups');
$iBlock = 1;
// Zero is not a valid blockid
foreach ($aGroups as $idx => $aDefinition) {
$sListClass = $aDefinition['class'];
$oSearch = new DBObjectSearch($sListClass);
$oSearch->AddCondition('id', $aDefinition['keys'], 'IN');
$oPage->add("<h1>" . Dict::Format('UI:RelationGroupNumber_N', 1 + $idx) . "</h1>\n");
$oPage->add("<div id=\"relation_group_{$idx}\" class=\"page_header\">\n");
$oPage->add("<h2>" . MetaModel::GetClassIcon($sListClass) . " <span class=\"hilite\">" . Dict::Format('UI:Search:Count_ObjectsOf_Class_Found', count($aDefinition['keys']), Metamodel::GetName($sListClass)) . "</h2>\n");
$oPage->add("</div>\n");
$oBlock = new DisplayBlock($oSearch, 'list');
$oBlock->Display($oPage, 'group_' . $iBlock++);
$oPage->p(' ');
// Some space ?
}
break;
case 'ticket_impact':
require_once APPROOT . 'core/simplegraph.class.inc.php';
require_once APPROOT . 'core/relationgraph.class.inc.php';
require_once APPROOT . 'core/displayablegraph.class.inc.php';
$sRelation = utils::ReadParam('relation', 'impacts');
$sDirection = utils::ReadParam('direction', 'down');
$iGroupingThreshold = utils::ReadParam('g', 5);
$sClass = utils::ReadParam('class', '', false, 'class');
示例13: DisplayNavigatorGroupTab
function DisplayNavigatorGroupTab($oP, $aGroups, $sRelation, $oObj)
{
if (count($aGroups) > 0) {
$oP->SetCurrentTab(Dict::S('UI:RelationGroups'));
$oP->add("<div id=\"impacted_groupss\" style=\"width:100%;background-color:#fff;padding:10px;\">");
$iBlock = 1;
// Zero is not a valid blockid
foreach ($aGroups as $idx => $aObjects) {
$sListClass = get_class(current($aObjects));
$oSet = CMDBObjectSet::FromArray($sListClass, $aObjects);
$oP->add("<h1>" . Dict::Format('UI:RelationGroupNumber_N', 1 + $idx) . "</h1>\n");
$oP->add("<div id=\"relation_group_{$idx}\" class=\"page_header\">\n");
$oP->add("<h2>" . MetaModel::GetClassIcon($sListClass) . " <span class=\"hilite\">" . Dict::Format('UI:Search:Count_ObjectsOf_Class_Found', count($aObjects), Metamodel::GetName($sListClass)) . "</h2>\n");
$oP->add("</div>\n");
$oBlock = DisplayBlock::FromObjectSet($oSet, 'list');
$oBlock->Display($oP, 'group_' . $iBlock++);
$oP->p(' ');
// Some space ?
}
$oP->add("</div>");
}
}
示例14: ApplicationException
$iId = utils::ReadParam('id', null);
if ($iId == null) {
throw new ApplicationException(Dict::Format('UI:Error:1ParametersMissing', 'id'));
}
$oReplica = MetaModel::GetObject('SynchroReplica', $iId);
$oReplica->DisplayDetails($oP);
break;
case 'oql':
$sOQL = utils::ReadParam('oql', null, false, 'raw_data');
if ($sOQL == null) {
throw new ApplicationException(Dict::Format('UI:Error:1ParametersMissing', 'oql'));
}
$oFilter = DBObjectSearch::FromOQL($sOQL);
$oBlock1 = new DisplayBlock($oFilter, 'search', false, array('menu' => false));
$oBlock1->Display($oP, 0);
$oP->add('<p class="page-header">' . MetaModel::GetClassIcon('SynchroReplica') . Dict::S('Core:SynchroReplica:ListOfReplicas') . '</p>');
$iSourceId = utils::ReadParam('datasource', null);
if ($iSourceId != null) {
$oSource = MetaModel::GetObject('SynchroDataSource', $iSourceId);
$oP->p(Dict::Format('Core:SynchroReplica:BackToDataSource', $oSource->GetHyperlink()) . '</a>');
}
$oBlock = new DisplayBlock($oFilter, 'list', false, array('menu' => false));
$oBlock->Display($oP, 1);
break;
}
} catch (CoreException $e) {
$oP->p('<b>An error occured while running the query:</b>');
$oP->p($e->getHtmlDesc());
} catch (Exception $e) {
$oP->p('<b>An error occured while running the query:</b>');
$oP->p($e->getMessage());
示例15: GetObjectCreationForm
/**
* Get the form to create a new object of the 'target' class
*/
public function GetObjectCreationForm(WebPage $oPage, $oCurrObject)
{
// Set all the default values in an object and clone this "default" object
$oNewObj = MetaModel::NewObject($this->sTargetClass);
// 1st - set context values
$oAppContext = new ApplicationContext();
$oAppContext->InitObjectFromContext($oNewObj);
// 2nd set the default values from the constraint on the external key... if any
if ($oCurrObject != null && $this->sAttCode != '') {
$oAttDef = MetaModel::GetAttributeDef(get_class($oCurrObject), $this->sAttCode);
$aParams = array('this' => $oCurrObject);
$oSet = $oAttDef->GetAllowedValuesAsObjectSet($aParams);
$aConsts = $oSet->ListConstantFields();
$sClassAlias = $oSet->GetFilter()->GetClassAlias();
if (isset($aConsts[$sClassAlias])) {
foreach ($aConsts[$sClassAlias] as $sAttCode => $value) {
$oNewObj->Set($sAttCode, $value);
}
}
}
// 3rd - set values from the page argument 'default'
$oNewObj->UpdateObjectFromArg('default');
$sDialogTitle = '';
$oPage->add('<div id="ac_create_' . $this->iId . '"><div class="wizContainer" style="vertical-align:top;"><div id="dcr_' . $this->iId . '">');
$oPage->add("<h1>" . MetaModel::GetClassIcon($this->sTargetClass) . " " . Dict::Format('UI:CreationTitle_Class', MetaModel::GetName($this->sTargetClass)) . "</h1>\n");
cmdbAbstractObject::DisplayCreationForm($oPage, $this->sTargetClass, $oNewObj, array(), array('formPrefix' => $this->iId, 'noRelations' => true));
$oPage->add('</div></div></div>');
// $oPage->add_ready_script("\$('#ac_create_$this->iId').dialog({ width: $(window).width()*0.8, height: 'auto', autoOpen: false, modal: true, title: '$sDialogTitle'});\n");
$oPage->add_ready_script("\$('#ac_create_{$this->iId}').dialog({ width: 'auto', height: 'auto', maxHeight: \$(window).height() - 50, autoOpen: false, modal: true, title: '{$sDialogTitle}'});\n");
$oPage->add_ready_script("\$('#dcr_{$this->iId} form').removeAttr('onsubmit');");
$oPage->add_ready_script("\$('#dcr_{$this->iId} form').bind('submit.uilinksWizard', oACWidget_{$this->iId}.DoCreateObject);");
}