public function history($path)
 {
     if ($path['type'] == 'location') {
         $facility = DataCenterDB::getLocation($path['id']);
     } elseif ($path['type'] == 'space') {
         $facility = DataCenterDB::getSpace($path['id']);
     } else {
         return null;
     }
     return DataCenterUI::renderLayout('columns', array(DataCenterUI::renderLayout('rows', array(DataCenterUI::renderWidget('heading', array('message' => 'history-type', 'subject' => DataCenterUI::message('type', $path['type']))), DataCenterUI::renderWidget('history', array('component' => $facility))))));
 }
 public static function render(array $parameters)
 {
     global $wgUser;
     // Gets current path
     $path = DataCenterPage::getPath();
     // Sets Defaults
     $parameters = array_merge(self::$defaultParameters, $parameters);
     // Begins widget
     $xmlOutput = parent::begin($parameters['class']);
     // Adds result type menu
     $currentTarget = null;
     $currentNum = null;
     $menuItems = array();
     foreach (self::$targets as $target) {
         $numMatches = DataCenterDB::numMatches($target['category'], $target['type'], $target['fields'], $parameters['query']);
         if ($numMatches == 0) {
             continue;
         }
         $fusedType = $target['category'] . '.' . $target['type'];
         if (!$path['type']) {
             $path['type'] = $fusedType;
         }
         if ($path['type'] == $fusedType) {
             $currentTarget = $target;
             $currentNum = $numMatches;
             $state = 'current';
         } else {
             $state = 'normal';
         }
         $typePath = array_merge($path, array('type' => $target['category'] . '.' . $target['type']));
         $menuItems[] = DataCenterXml::div(array('class' => 'type-' . $state), DataCenterXml::link(DataCenterUI::message('results', $target['category'] . '-' . $target['type'], $numMatches), $typePath));
     }
     $resultItems = array();
     if (!$currentTarget) {
         $xmlOutput .= DataCenterUI::renderWidget('body', array('message' => 'notice-no-results', 'style' => 'notice'));
     } else {
         $joins = array();
         if ($currentTarget['class'] == 'DataCenterDBAsset') {
             $joins = array_merge_recursive(DataCenterDB::buildJoin('model', $currentTarget['type'], 'id', 'asset', $currentTarget['type'], 'model', array('name', 'manufacturer')), DataCenterDB::buildJoin('facility', 'location', 'id', 'asset', $currentTarget['type'], 'location', array('name' => 'location_name')));
         }
         // Gets search results
         $results = DataCenterDB::getMatches($currentTarget['class'], $currentTarget['category'], $currentTarget['type'], $currentTarget['fields'], $parameters['query'], array_merge_recursive($joins, DataCenterDB::buildRange($path)));
         // Adds types
         $xmlOutput .= DataCenterXml::div(array('class' => 'types'), implode($menuItems));
         // Adds results
         $xmlOutput .= DataCenterXml::div(array('class' => 'results'), DataCenterUI::renderWidget('table', array_merge($currentTarget['table'], array('rows' => $results, 'num' => $currentNum))));
     }
     // Ends widget
     $xmlOutput .= parent::end();
     // Returns results
     return $xmlOutput;
 }
 public function configure($path)
 {
     // Detects mode
     if (!$path['id']) {
         // Creates new component
         $field = DataCenterDBMetaField::newFromValues();
         // Sets 'do' specific parameters
         $formParameters = array('label' => 'add', 'success' => array('page' => 'settings', 'type' => 'field'));
         $rows = array(DataCenterUI::renderWidget('heading', array('message' => 'adding-type', 'type' => 'field')));
     } else {
         // Gets component from database
         $field = DataCenterDB::getMetaField($path['id']);
         // Sets 'do' specific parameters
         $formParameters = array('label' => 'save', 'hidden' => array('id'), 'success' => array('page' => 'settings', 'type' => 'field', 'action' => 'view', 'id' => $path['id']));
         $rows = array(DataCenterUI::renderWidget('heading', array('message' => 'configuring-type', 'type' => 'field')), DataCenterUI::renderWidget('body', array('message' => 'important-configuring-field', 'style' => 'important')));
     }
     // Returns 2 columm layout with a form and a scene
     return DataCenterUI::renderLayout('columns', array(DataCenterUI::renderLayout('rows', array_merge($rows, array(DataCenterUI::renderWidget('form', array_merge($formParameters, array('do' => 'save', 'failure' => $path, 'action' => array('page' => 'settings', 'type' => 'field'), 'row' => $field, 'fields' => array('name' => array('type' => 'string'), 'format' => array('type' => 'list', 'enum' => array('category' => 'meta', 'type' => 'field', 'field' => 'format'))))))))), ' '));
 }
 public function edit($path)
 {
     // Checks if...
     if (!$path['id'] && is_array($path['parameter']) && count($path['parameter'] >= 2) && $path['parameter'][0] == 'location') {
         // Creates new facility with default parameters
         $space = DataCenterDBSpace::newFromValues(array('location' => $path['parameter'][1], 'tense' => 'present', 'name' => DataCenterUI::message('default', 'new-type', DataCenterUI::message('type', 'space'))));
         // Sets 'do' specific parameters
         $formParameters = array('label' => 'add', 'hidden' => array($path['parameter'][0]), 'success' => array('page' => 'facilities', 'type' => $path['parameter'][0], 'action' => 'view', 'id' => $path['parameter'][1]), 'type' => 'add');
         $headingParameters = array('message' => 'adding-type', 'subject' => DataCenterUI::message('type', $path['type']));
     } else {
         // Gets facility from database
         $space = DataCenterDB::getSpace($path['id']);
         // Sets 'do' specific parameters
         $formParameters = array('label' => 'save', 'hidden' => array('location', 'id'), 'success' => array('page' => 'facilities', 'type' => 'space', 'action' => 'view', 'id' => $path['id']), 'type' => 'edit');
         $headingParameters = array('message' => 'editing-type', 'subject' => DataCenterUI::message('type', $path['type']));
     }
     // Builds JavaScript to access renderable facility
     $jsTarget = DataCenterJs::chain(array("dataCenter.renderer.getTarget" => DataCenterJs::toScalar('space'), 'getModule'), false);
     // Complete form parameters
     $formParameters = array_merge($formParameters, array('do' => 'save', 'failure' => $path, 'action' => array('page' => 'facilities', 'type' => 'space'), 'row' => $space, 'fields' => array('tense' => array('type' => 'tense', 'disable' => array('past')), 'name' => array('type' => 'string'), 'width' => array('type' => 'number', 'effect' => $jsTarget . '.setWidth( {this}.value, true );'), 'height' => array('type' => 'number', 'effect' => $jsTarget . '.setHeight( {this}.value, true );'), 'depth' => array('type' => 'number', 'effect' => $jsTarget . '.setDepth( {this}.value, true );'), 'power' => array('type' => 'number', 'min' => 0, 'max' => 100000, 'step' => 100))));
     // Returns 2 columm layout with a form and a scene
     return DataCenterUI::renderLayout('columns', array(DataCenterUI::renderLayout('rows', array(DataCenterUI::renderWidget('heading', $headingParameters), DataCenterUI::renderWidget('form', $formParameters))), DataCenterUI::renderWidget('space', array('space' => $space))));
 }
 public function edit($path)
 {
     // Detects mode
     if (!$path['id']) {
         // Creates a new facility location
         $location = DataCenterDBLocation::newFromValues(array('tense' => 'present', 'name' => DataCenterUI::message('default', 'new-type', DataCenterUI::message('type', 'location'))));
         // Sets 'do' specific parameters
         $formParameters = array('label' => 'add', 'success' => array('page' => 'facilities', 'type' => 'location'), 'type' => 'add');
         $headingParameters = array('message' => 'adding-type', 'subject' => DataCenterUI::message('type', $path['type']));
     } else {
         // Gets facility location from database
         $location = DataCenterDB::getLocation($path['id']);
         // Sets 'do' specific parameters
         $formParameters = array('label' => 'save', 'hidden' => array('id'), 'success' => array('page' => 'facilities', 'type' => 'location', 'action' => 'view', 'id' => $path['id']), 'type' => 'edit');
         $headingParameters = array('message' => 'editing-type', 'subject' => DataCenterUI::message('type', $path['type']));
     }
     // Builds JavaScript that hooks the button into the geocoder
     $jsForm = 'document.form_save';
     $jsOut = DataCenterJs::callFunction('addHandler', array("{$jsForm}.field_button_0", DataCenterJs::toScalar('click'), DataCenterJs::buildFunction(null, DataCenterJs::chain(array('dataCenter.renderer.getTarget' => DataCenterJs::toScalar('map'), 'showAddress' => array('document.form_save.field_region.value', DataCenterJs::toObject(array('latField' => "'{$jsForm}.field_latitude'", 'lngField' => "'{$jsForm}.field_longitude'"))))))));
     // Complete form parameters
     $formParameters = array_merge($formParameters, array('do' => 'save', 'failure' => $path, 'action' => array('page' => 'facilities', 'type' => 'location'), 'row' => $location, 'fields' => array('tense' => array('type' => 'tense', 'disable' => !$path['id'] ? array('past') : array()), 'name' => array('type' => 'string'), 'region' => array('type' => 'string'), array('type' => 'button', 'label' => 'lookup'), 'latitude' => array('type' => 'string'), 'longitude' => array('type' => 'string'))));
     // Returns 2 columm layout with a form and a map widget
     return DataCenterUI::renderLayout('columns', array(DataCenterUI::renderLayout('rows', array(DataCenterUI::renderWidget('heading', $headingParameters), DataCenterUI::renderWidget('form', $formParameters))), DataCenterUI::renderWidget('map', !$path['id'] ? array() : array('location' => $location)))) . DataCenterXml::script($jsOut);
 }
 public function configure($path)
 {
     // Detects mode
     if (!$path['id']) {
         if (is_array($path['parameter']) && count($path['parameter']) >= 2 && $path['parameter'][0] == 'space') {
             // Gets space from database
             $space = DataCenterDB::getSpace($path['parameter'][1]);
             // Creates new component
             $plan = DataCenterDBPlan::newFromValues(array('space' => $path['parameter'][1], 'tense' => 'present', 'name' => $space->get('name')));
             // Sets 'do' specific parameters
             $formParameters = array('label' => 'create', 'hidden' => array('space'), 'success' => array('page' => 'plans'));
             $headingParameters = array('message' => 'adding-type', 'type' => 'plan');
         } else {
             throw new MWException('Invalid parameters. space,# expected.');
         }
     } else {
         // Gets component from database
         $plan = DataCenterDB::getPlan($path['id']);
         // Sets 'do' specific parameters
         $formParameters = array('label' => 'save', 'hidden' => array('id'), 'success' => array('page' => 'plans', 'type' => 'plan', 'action' => 'view', 'id' => $path['id']));
         $headingParameters = array('message' => 'configuring-type', 'type' => 'plan');
     }
     // Returns 2 columm layout with a form and a scene
     return DataCenterUI::renderLayout('columns', array(DataCenterUI::renderLayout('rows', array(DataCenterUI::renderWidget('heading', $headingParameters), DataCenterUI::renderWidget('form', array_merge($formParameters, array('do' => 'save', 'failure' => $path, 'action' => array('page' => 'plans', 'type' => 'plan'), 'row' => $plan, 'fields' => array('tense' => array('type' => 'tense', 'disable' => !$path['id'] ? array('past') : array()), 'name' => array('type' => 'string'), 'note' => array('type' => 'text'))))))), DataCenterUI::renderWidget('plan', array('plan' => $plan))));
 }
 public function configure($path)
 {
     // Checks if...
     if (!$path['id'] && is_array($path['parameter']) && count($path['parameter']) >= 3 && $path['parameter'][0] == 'rack') {
         $object = DataCenterDB::getAsset('object', $path['parameter'][2]);
         $model = $object->getModel();
         $rackLink = DataCenterDB::getAssetLink($path['parameter'][1]);
         $rack = $rackLink->getAsset();
         $plan = DataCenterDB::getPlan($rackLink->get('plan'));
         $objectLink = DataCenterDBAssetLink::newFromValues(array('name' => $model->get('kind'), 'plan' => $plan->getId(), 'parent_link' => $rackLink->getId(), 'asset_type' => 'object', 'asset_id' => $object->getId(), 'z' => 1, 'orientation' => 0));
         // Sets action specific parameters
         $formParameters = array('label' => 'attach', 'hidden' => array('plan', 'parent_link', 'asset_type', 'asset_id'), 'success' => array('page' => 'plans', 'type' => $path['parameter'][0], 'action' => 'view', 'id' => $path['parameter'][1]));
         $headingParameters = array('message' => 'attaching-type', 'type' => 'object');
     } else {
         // Gets asset from database
         $objectLink = DataCenterDB::getAssetLink($path['id']);
         // Gets object that object link links to
         $object = $objectLink->getAsset();
         // Gets plan from database
         $plan = DataCenterDB::getPlan($objectLink->get('plan'));
         // Gets rack link object is linked to
         $rackLink = DataCenterDB::getAssetLink($objectLink->get('parent_link'));
         // Extracts rack from rack link
         $rack = $rackLink->getAsset();
         // Sets action specific parameters
         $formParameters = array('label' => 'save', 'hidden' => array('id'), 'success' => array('page' => 'plans', 'type' => 'object', 'action' => 'view', 'id' => $path['id']));
         $headingParameters = array('message' => 'configuring-type', 'type' => 'object');
     }
     // Builds javascript that references the renderable asset
     $target = array('dataCenter.renderer.getTarget' => array(DataCenterJs::toScalar('plan')), 'getModule');
     $rackId = $rack->getId();
     $rackModel = $rack->getModel();
     $objectModel = $object->getModel();
     $objectId = $object->getId();
     $maxZ = $rackModel->get('units') - $objectModel->get('units') + 1;
     // Builds form parameters
     $formFields = array('name' => array('type' => 'string'), 'position' => array('type' => 'number', 'field' => 'z', 'min' => 1, 'max' => $maxZ, 'effect' => DataCenterJs::chain(array_merge($target, array('setObjectPosition' => array(DataCenterJs::toScalar($rackId), DataCenterJs::toScalar($objectId), '{this}.value', DataCenterJs::toScalar(true)))), false)), 'orientation' => array('type' => 'number', 'min' => 0, 'max' => 1, 'effect' => DataCenterJs::chain(array_merge($target, array('setObjectOrientation' => array(DataCenterJs::toScalar($rackId), DataCenterJs::toScalar($objectId), '{this}.value', DataCenterJs::toScalar(true)))), false)));
     // Returns 2 columm layout with a form and a scene
     return DataCenterUI::renderLayout('columns', array(DataCenterUI::renderLayout('rows', array(DataCenterUI::renderWidget('heading', $headingParameters), DataCenterUI::renderWidget('form', array_merge($formParameters, array('do' => 'save', 'failure' => $path, 'action' => array('page' => 'plans', 'type' => 'object'), 'row' => $objectLink, 'fields' => $formFields))))), DataCenterUI::renderWidget('plan', array('plan' => $plan, 'current-rack' => $rack->getId(), 'look-at-rack' => $rack->getId(), 'current-object' => $object->getId(), 'include' => !$path['id'] ? $objectLink : null))));
 }
 public function main($path)
 {
     $plans = DataCenterDB::getPlans(DataCenterDB::buildSort('meta', 'plan', array('space', 'tense DESC')));
     $numPlans = DataCenterDB::numPlans();
     return DataCenterUI::renderLayout('columns', array(DataCenterUI::renderLayout('rows', array(DataCenterUI::renderWidget('heading', array('message' => 'plans')), DataCenterUI::renderWidget('table', array('rows' => $plans, 'num' => $numPlans, 'fields' => array('name', 'space' => array('field' => 'space_name'), 'tense' => array('format' => 'option')), 'link' => array('page' => 'plans', 'action' => 'view', 'type' => 'plan', 'id' => '#id')))))));
 }
 public function main($path)
 {
     return DataCenterUI::renderLayout('columns', array(DataCenterUI::renderLayout('rows', array(DataCenterUI::renderWidget('heading', array('message' => 'overview')), DataCenterUI::renderWidget('body', array('message' => 'important-welcome', 'style' => 'important'))))));
 }
 public function manage($path)
 {
     // Checks if...
     if (!$path['id'] && is_scalar($path['parameter'])) {
         // Creates new asset with default parameters
         $asset = DataCenterDBAsset::newFromType($path['type'], array('model' => $path['parameter'], 'tense' => 'present'));
         // Sets action specific parameters
         $formParameters = array('label' => 'deploy', 'hidden' => array('model'), 'success' => array('page' => 'assets', 'type' => $path['type']), 'type' => 'deploy');
         $headingParameters = array('message' => 'deploying-asset-type', 'subject' => DataCenterUI::message('type', $path['type']));
     } else {
         // Gets asset from database
         $asset = DataCenterDB::getAsset($path['type'], $path['id']);
         // Sets 'do' specific parameters
         $formParameters = array('label' => 'save', 'hidden' => array('id'), 'success' => array('page' => 'assets', 'type' => $path['type'], 'action' => 'view', 'id' => $path['id']), 'type' => 'manage');
         $headingParameters = array('message' => 'managing-asset-type', 'subject' => DataCenterUI::message('type', $path['type']));
     }
     // Gets model from database
     $model = $asset->getModel();
     // Gets list of locations
     $locations = DataCenterDB::getLocations();
     // Completes form parameters
     $formParameters = array_merge($formParameters, array('do' => 'save', 'failure' => $path, 'action' => array('page' => 'assets', 'type' => $path['type']), 'row' => $asset, 'fields' => array('tense' => array('type' => 'tense', 'disable' => !$path['id'] ? array('past') : array()), 'location' => array('type' => 'list', 'rows' => $locations, 'labels' => array('name', 'region'), 'glue' => ' / '), 'serial' => array('type' => 'string'), 'asset' => array('type' => 'string'))));
     // Returns 2 columm layout with a form and a scene
     return DataCenterUI::renderLayout('columns', array(DataCenterUI::renderLayout('rows', array(DataCenterUI::renderWidget('heading', $headingParameters), DataCenterUI::renderWidget('form', $formParameters))), DataCenterUI::renderLayout('rows', array(DataCenterUI::renderWidget('heading', array('message' => 'model-type', 'type' => $path['type'])), DataCenterUI::renderWidget('details', array_merge(self::$options[$path['type']]['details'], array('row' => $model)))))));
 }
 public function results($path)
 {
     return DataCenterUI::renderLayout('columns', array(DataCenterUI::renderLayout('rows', array(DataCenterUI::renderWidget('heading', array('message' => 'search-results')), DataCenterUI::renderWidget('searchresults', array('query' => $path['parameter']))))));
 }
 /**
  * Builds and stores menus in output cache
  * @param	pages			Array of pages for main menu, with keys as page
  * 							names
  * @param	controller		DataCenterController of the current page's
  * 							controller
  * @param	path			Array of link parameters of current path
  */
 public static function setDestinations(array $pages, DataCenterController $controller, array $path)
 {
     global $wgUser;
     // Adds main menu
     self::$output['menu'] .= DataCenterXml::open('div', array('class' => 'menu'));
     foreach ($pages as $page => $classes) {
         if ($classes['display']) {
             $state = $page == $path['page'] ? 'current' : 'normal';
             self::$output['menu'] .= DataCenterXml::div(array('class' => 'item-' . $state), DataCenterXml::link(self::message('page', $page), array('page' => $page)));
         }
     }
     self::$output['menu'] .= DataCenterXml::close('div');
     // Adds search
     self::$output['menu'] .= DataCenterUI::renderWidget('search', array());
     // Adds sub menu
     self::$output['menu'] .= DataCenterXml::open('div', array('class' => 'toolbar'));
     // Type tabs
     if (count($controller->types) > 0) {
         self::$output['menu'] .= DataCenterXml::div(array('class' => 'type-label'), self::message('label', 'browse-by'));
         foreach ($controller->types as $label => $type) {
             $state = $label == $path['type'] ? 'current' : 'normal';
             self::$output['menu'] .= DataCenterXml::div(array('class' => 'type-' . $state), DataCenterXml::link(self::message('type', $label), $type));
         }
     }
     // Trail steps
     $count = 1;
     foreach ($controller->trail as $label => $step) {
         $end = $count == count($controller->trail) ? '-end' : '';
         self::$output['menu'] .= DataCenterXml::div(array('class' => 'breadcrumb' . $end), DataCenterXml::link($label, $step));
         $count++;
     }
     // Action tabs
     foreach ($controller->actions as $label => $action) {
         $state = $label == $path['action'] ? 'current' : 'normal';
         self::$output['menu'] .= DataCenterXml::div(array('class' => 'action-' . $state), DataCenterXml::link(self::message('action', $label), $action));
     }
     self::$output['menu'] .= DataCenterXml::close('div');
 }
 public function modify($path)
 {
     // Checks if the type is supported
     if (!isset(self::$options[$path['type']]['gallery'])) {
         // Returns error message
         return wfMsg('datacenter-error-invalid-data');
     }
     // Detects mode
     if (!$path['id']) {
         // Creates new component
         $model = DataCenterDBModel::newFromType($path['type']);
         // Sets 'do' specific parameters
         $formParameters = array('label' => 'create', 'success' => array('page' => 'models', 'type' => $path['type']), 'type' => 'create');
         $headingParameters = array('message' => 'creating-model-type', 'subject' => DataCenterUI::message('type', $path['type']));
     } else {
         // Gets component from database
         $model = DataCenterDB::getModel($path['type'], $path['id']);
         // Sets 'do' specific parameters
         $formParameters = array('label' => 'save', 'hidden' => array('id'), 'success' => array('page' => 'models', 'type' => $path['type'], 'action' => 'view', 'id' => $path['id']), 'type' => 'modify');
         $headingParameters = array('message' => 'modifying-model-type', 'subject' => DataCenterUI::message('type', $path['type']));
     }
     // Returns 2 columm layout with a form and a scene
     return DataCenterUI::renderLayout('columns', array(DataCenterUI::renderLayout('rows', array(DataCenterUI::renderWidget('heading', $headingParameters), DataCenterUI::renderWidget('form', array_merge($formParameters, self::$options[$path['type']]['form'], array('do' => 'save', 'failure' => $path, 'action' => array('page' => 'models', 'type' => $path['type']), 'row' => $model))))), '[MODEL VIEWER]'));
 }
Exemple #14
0
 public function configure($path)
 {
     // Checks if...
     if (!$path['id'] && is_array($path['parameter']) && count($path['parameter']) >= 3 && $path['parameter'][0] == 'plan') {
         // Gets plan from database
         $plan = DataCenterDB::getPlan($path['parameter'][1]);
         // Creates new asset with default parameters
         $rack = DataCenterDB::getAsset('rack', $path['parameter'][2]);
         // Creates new asset link
         $rackLink = DataCenterDBAssetLink::newFromValues(array('name' => DataCenterUI::message('type', 'rack'), 'plan' => $plan->getId(), 'asset_type' => 'rack', 'asset_id' => $rack->getId(), 'x' => 1, 'y' => 1, 'orientation' => 0));
         // Sets action specific parameters
         $formParameters = array('label' => 'attach', 'hidden' => array('plan', 'asset_type', 'asset_id'), 'success' => array('page' => 'plans', 'type' => 'plan', 'action' => 'view', 'id' => $path['parameter'][1]));
         $headingParameters = array('message' => 'attaching-type', 'type' => 'rack');
     } else {
         // Gets asset from database
         $rackLink = DataCenterDB::getAssetLink($path['id']);
         // Gets rack that rack link links to
         $rack = $rackLink->getAsset();
         // Gets plan from database
         $plan = DataCenterDB::getPlan($rackLink->get('plan'));
         // Sets action specific parameters
         $formParameters = array('label' => 'save', 'hidden' => array('id'), 'success' => array('page' => 'plans', 'type' => 'rack', 'action' => 'view', 'id' => $path['id']));
         $headingParameters = array('message' => 'configuring-type', 'type' => 'rack');
     }
     // Gets parent asset from database
     $space = $plan->getSpace();
     // Builds javascript that references the renderable asset
     $target = array('dataCenter.renderer.getTarget' => array(DataCenterJs::toScalar('plan')), 'getModule');
     $objectId = $rack->getId();
     // Builds form parameters
     $formParameters = array_merge($formParameters, array('do' => 'save', 'failure' => $path, 'action' => array('page' => 'plans', 'type' => 'rack'), 'row' => $rackLink, 'fields' => array('name' => array('type' => 'string'), 'position' => array('fields' => array('x' => array('field' => 'x', 'min' => 1, 'max' => $space->get('width')), 'y' => array('field' => 'y', 'min' => 1, 'max' => $space->get('depth'))), 'type' => 'position', 'effect' => DataCenterJs::chain(array_merge($target, array('setRackPosition' => array(DataCenterJs::toScalar($objectId), '{this.x}.value', '{this.y}.value', DataCenterJs::toScalar(true)))), false), 'mode' => 'iso'), 'orientation' => array('type' => 'number', 'min' => 0, 'max' => 3, 'effect' => DataCenterJs::chain(array_merge($target, array('setRackOrientation' => array(DataCenterJs::toScalar($objectId), '{this}.value', DataCenterJs::toScalar(true)))), false)))));
     // Returns 2 columm layout with a form and a scene
     return DataCenterUI::renderLayout('columns', array(DataCenterUI::renderLayout('rows', array(DataCenterUI::renderWidget('heading', $headingParameters), DataCenterUI::renderWidget('form', $formParameters))), DataCenterUI::renderWidget('plan', array('plan' => $plan, 'zoom-from-rack' => $rack->getIdOrZero(), 'current-rack' => $rack->getId(), 'include' => $rackLink))));
 }