Esempio n. 1
0
 function ManualRegionPositionForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     $regionid = Kit::GetParam('regionid', _GET, _STRING);
     $layoutid = Kit::GetParam('layoutid', _GET, _INT);
     $top = Kit::GetParam('top', _GET, _DOUBLE);
     $left = Kit::GetParam('left', _GET, _DOUBLE);
     $width = Kit::GetParam('width', _GET, _DOUBLE);
     $height = Kit::GetParam('height', _GET, _DOUBLE);
     $layoutWidth = Kit::GetParam('layoutWidth', _GET, _INT);
     $layoutHeight = Kit::GetParam('layoutHeight', _GET, _INT);
     $scale = Kit::GetParam('scale', _GET, _DOUBLE);
     Kit::ClassLoader('region');
     $region = new region($db);
     $ownerId = $region->GetOwnerId($layoutid, $regionid);
     $regionName = $region->GetRegionName($layoutid, $regionid);
     $regionAuth = $this->user->RegionAssignmentAuth($ownerId, $layoutid, $regionid, true);
     if (!$regionAuth->edit) {
         trigger_error(__('You do not have permissions to edit this region'), E_USER_ERROR);
     }
     // Scale the layout width/height
     $layoutWidth = round($layoutWidth * $scale, 0);
     $layoutHeight = round($layoutHeight * $scale, 0);
     // Set some information about the form
     Theme::Set('form_id', 'RegionProperties');
     Theme::Set('form_action', 'index.php?p=timeline&q=ManualRegionPosition');
     Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutid . '"><input type="hidden" name="regionid" value="' . $regionid . '"><input id="layoutWidth" type="hidden" name="layoutWidth" value="' . $layoutWidth . '"><input id="layoutHeight" type="hidden" name="layoutHeight" value="' . $layoutHeight . '"><input type="hidden" name="scale" value="' . $scale . '">');
     // Theme Variables
     Theme::Set('regionName', $regionName);
     Theme::Set('width', round($width * $scale, 0));
     Theme::Set('height', round($height * $scale, 0));
     Theme::Set('top', round($top * $scale, 0));
     Theme::Set('left', round($left * $scale, 0));
     Theme::Set('transition', $region->GetOption($layoutid, $regionid, 'transOut', ''));
     Theme::Set('duration', $region->GetOption($layoutid, $regionid, 'transOutDuration', 0));
     Theme::Set('direction', $region->GetOption($layoutid, $regionid, 'transOutDirection', ''));
     // Add none to the list
     $transitions = $this->user->TransitionAuth('out');
     $transitions[] = array('code' => '', 'transition' => 'None', 'class' => '');
     Theme::Set('transition_field_list', $transitions);
     // Compass points for direction
     $compassPoints = array(array('id' => 'N', 'name' => __('North')), array('id' => 'NE', 'name' => __('North East')), array('id' => 'E', 'name' => __('East')), array('id' => 'SE', 'name' => __('South East')), array('id' => 'S', 'name' => __('South')), array('id' => 'SW', 'name' => __('South West')), array('id' => 'W', 'name' => __('West')), array('id' => 'NW', 'name' => __('North West')));
     Theme::Set('direction_field_list', $compassPoints);
     if (count($this->user->TransitionAuth('out')) > 0) {
         $form = Theme::RenderReturn('region_form_options');
     } else {
         $form = Theme::RenderReturn('region_form_options_no_transition');
     }
     $response->SetFormRequestResponse($form, __('Region Options'), '350px', '275px', 'transitionFormLoad');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Save'), '$("#RegionProperties").submit()');
     $response->AddButton(__('Set Full Screen'), 'setFullScreenLayout()');
     $response->Respond();
 }