Пример #1
0
 public function displayPage()
 {
     $db =& $this->db;
     // Default options
     if (Kit::IsFilterPinned('mediamanager', 'Filter')) {
         $filter_pinned = 1;
         $filter_layout_name = Session::Get('mediamanager', 'filter_layout_name');
         $filter_region_name = Session::Get('mediamanager', 'filter_region_name');
         $filter_media_name = Session::Get('mediamanager', 'filter_media_name');
         $filter_type = Session::Get('mediamanager', 'filter_type');
     } else {
         $filter_pinned = 0;
         $filter_layout_name = NULL;
         $filter_region_name = NULL;
         $filter_media_name = NULL;
         $filter_type = 0;
     }
     $id = uniqid();
     Theme::Set('id', $id);
     Theme::Set('filter_id', 'XiboFilterPinned' . uniqid('filter'));
     Theme::Set('pager', ResponseManager::Pager($id));
     Theme::Set('form_meta', '<input type="hidden" name="p" value="mediamanager"><input type="hidden" name="q" value="MediaManagerGrid">');
     $formFields = array();
     $formFields[] = FormManager::AddText('filter_layout_name', __('Layout'), $filter_layout_name, NULL, 'l');
     $formFields[] = FormManager::AddText('filter_region_name', __('Region'), $filter_region_name, NULL, 'r');
     $formFields[] = FormManager::AddText('filter_media_name', __('Media'), $filter_media_name, NULL, 'm');
     $types = $db->GetArray("SELECT moduleid AS moduleid, Name AS module FROM `module` WHERE Enabled = 1 ORDER BY 2");
     array_unshift($types, array('moduleid' => 0, 'module' => 'All'));
     $formFields[] = FormManager::AddCombo('filter_type', __('Type'), $filter_type, $types, 'moduleid', 'module', NULL, 't');
     $formFields[] = FormManager::AddCheckbox('XiboFilterPinned', __('Keep Open'), $filter_pinned, NULL, 'k');
     // Call to render the template
     Theme::Set('header_text', __('Media Manager'));
     Theme::Set('form_fields', $formFields);
     Theme::Render('grid_render');
 }
Пример #2
0
 /**
  * Return the Edit Form as HTML
  * @return
  */
 public function EditForm()
 {
     $this->response = new ResponseManager();
     $db =& $this->db;
     $layoutid = $this->layoutid;
     $regionid = $this->regionid;
     $mediaid = $this->mediaid;
     // Permissions
     if (!$this->auth->edit) {
         $this->response->SetError('You do not have permission to edit this assignment.');
         $this->response->keepOpen = true;
         return $this->response;
     }
     Theme::Set('form_id', 'ModuleForm');
     Theme::Set('form_action', 'index.php?p=module&mod=' . $this->type . '&q=Exec&method=EditMedia');
     Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutid . '"><input type="hidden" id="iRegionId" name="regionid" value="' . $regionid . '"><input type="hidden" name="showRegionOptions" value="' . $this->showRegionOptions . '" /><input type="hidden" id="mediaid" name="mediaid" value="' . $mediaid . '">');
     $formFields = array();
     $formFields[] = FormManager::AddText('uri', __('Video Path'), urldecode($this->GetOption('uri')), __('A local file path or URL to the video. This can be a RTSP stream.'), 'p', 'required');
     $formFields[] = FormManager::AddNumber('duration', __('Duration'), $this->duration, __('The duration in seconds this counter should be displayed'), 'd', 'required', '', $this->auth->modifyPermissions);
     Theme::Set('form_fields', $formFields);
     if ($this->showRegionOptions) {
         $this->response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $layoutid . '&regionid=' . $regionid . '&q=RegionOptions")');
     } else {
         $this->response->AddButton(__('Cancel'), 'XiboDialogClose()');
     }
     $this->response->html = Theme::RenderReturn('form_render');
     $this->response->AddButton(__('Save'), '$("#ModuleForm").submit()');
     $this->response->dialogTitle = __('Edit Local Video');
     $this->response->dialogSize = true;
     $this->response->dialogWidth = '350px';
     $this->response->dialogHeight = '250px';
     return $this->response;
 }
Пример #3
0
 /**
  * Return the Edit Form as HTML
  * @return
  */
 public function EditForm()
 {
     $this->response = new ResponseManager();
     $db =& $this->db;
     $layoutid = $this->layoutid;
     $regionid = $this->regionid;
     $mediaid = $this->mediaid;
     // Permissions
     if (!$this->auth->edit) {
         $this->response->SetError('You do not have permission to edit this assignment.');
         $this->response->keepOpen = true;
         return $this->response;
     }
     Theme::Set('form_id', 'ModuleForm');
     Theme::Set('form_action', 'index.php?p=module&mod=' . $this->type . '&q=Exec&method=EditMedia');
     Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutid . '"><input type="hidden" id="iRegionId" name="regionid" value="' . $regionid . '"><input type="hidden" name="showRegionOptions" value="' . $this->showRegionOptions . '" /><input type="hidden" id="mediaid" name="mediaid" value="' . $mediaid . '">');
     $formFields = array();
     $formFields[] = FormManager::AddText('windowsCommand', __('Windows Command'), htmlentities(urldecode($this->GetOption('windowsCommand'))), __('Enter a Windows Command Line compatible command'), 'w');
     $formFields[] = FormManager::AddText('linuxCommand', __('Android / Linux Command'), htmlentities(urldecode($this->GetOption('linuxCommand'))), __('Enter an Android / Linux Command Line compatible command'), 'l');
     Theme::Set('form_fields', $formFields);
     if ($this->showRegionOptions) {
         $this->response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $layoutid . '&regionid=' . $regionid . '&q=RegionOptions")');
     } else {
         $this->response->AddButton(__('Cancel'), 'XiboDialogClose()');
     }
     $this->response->html = Theme::RenderReturn('form_render');
     $this->response->AddButton(__('Save'), '$("#ModuleForm").submit()');
     $this->response->dialogTitle = __('Edit Shell Command');
     $this->response->dialogSize = true;
     $this->response->dialogWidth = '450px';
     $this->response->dialogHeight = '250px';
     return $this->response;
 }
Пример #4
0
 public function displayPage()
 {
     $db =& $this->db;
     // Configure the theme
     $id = uniqid();
     Theme::Set('id', 'LogGridForRefresh');
     Theme::Set('form_meta', '<input type="hidden" name="p" value="log"><input type="hidden" name="q" value="Grid">');
     Theme::Set('filter_id', 'XiboFilterPinned' . uniqid('filter'));
     Theme::Set('pager', ResponseManager::Pager('LogGridForRefresh'));
     // Construct Filter Form
     if (Kit::IsFilterPinned('log', 'Filter')) {
         $filter_pinned = 1;
         $filter_type = Session::Get('log', 'filter_type');
         $filter_page = Session::Get('log', 'filter_page');
         $filter_function = Session::Get('log', 'filter_function');
         $filter_display = Session::Get('log', 'filter_display');
         $filter_fromdt = Session::Get('log', 'filter_fromdt');
         $filter_seconds = Session::Get('log', 'filter_seconds');
         $filter_intervalTypeId = Session::Get('log', 'filter_intervalTypeId');
     } else {
         $filter_pinned = 0;
         $filter_type = 0;
         $filter_page = NULL;
         $filter_function = NULL;
         $filter_display = 0;
         $filter_fromdt = NULL;
         $filter_seconds = 120;
         $filter_intervalTypeId = 1;
     }
     // Two tabs
     $tabs = array();
     $tabs[] = FormManager::AddTab('general', __('General'));
     $tabs[] = FormManager::AddTab('advanced', __('Advanced'));
     $formFields = array();
     $formFields['general'][] = FormManager::AddCombo('filter_type', __('Type'), $filter_type, array(array('typeid' => 0, 'type' => 'All'), array('typeid' => 2, 'type' => 'Audit'), array('typeid' => 1, 'type' => 'Error')), 'typeid', 'type', NULL, 't');
     $formFields['general'][] = FormManager::AddCombo('filter_intervalTypeId', __('Interval'), $filter_intervalTypeId, array(array('intervalTypeid' => 1, 'intervalType' => __('Seconds')), array('intervalTypeid' => 60, 'intervalType' => __('Minutes')), array('intervalTypeid' => 3600, 'intervalType' => __('Hours'))), 'intervalTypeid', 'intervalType', NULL, 'i');
     $formFields['general'][] = FormManager::AddText('filter_seconds', __('Duration back'), $filter_seconds, NULL, 's');
     $formFields['general'][] = FormManager::AddCheckbox('XiboFilterPinned', __('Keep Open'), $filter_pinned, NULL, 'k');
     // Advanced Tab
     $formFields['advanced'][] = FormManager::AddDatePicker('filter_fromdt', __('From Date'), $filter_fromdt, NULL, 't');
     $formFields['advanced'][] = FormManager::AddText('filter_page', __('Page'), $filter_page, NULL, 'p');
     $formFields['advanced'][] = FormManager::AddText('filter_function', __('Function'), $filter_function, NULL, 'f');
     // Display
     $displays = $this->user->DisplayList();
     array_unshift($displays, array('displayid' => 0, 'display' => 'All'));
     $formFields['advanced'][] = FormManager::AddCombo('filter_display', __('Display'), $filter_display, $displays, 'displayid', 'display', NULL, 't');
     // Call to render the template
     Theme::Set('header_text', __('Logs'));
     Theme::Set('form_tabs', $tabs);
     Theme::Set('form_fields_general', $formFields['general']);
     Theme::Set('form_fields_advanced', $formFields['advanced']);
     Theme::Render('grid_render');
 }
Пример #5
0
 /**
  * Displays the page logic
  */
 function displayPage()
 {
     $db =& $this->db;
     // Default options
     if (Kit::IsFilterPinned('content', 'Filter')) {
         $filter_pinned = 1;
         $filter_name = Session::Get('content', 'filter_name');
         $filterId = Session::Get('content', 'fiterId');
         $filter_type = Session::Get('content', 'filter_type');
         $filter_retired = Session::Get('content', 'filter_retired');
         $filter_owner = Session::Get('content', 'filter_owner');
         $filter_duration_in_seconds = Session::Get('content', 'filter_duration_in_seconds');
         $showTags = Session::Get('content', 'showTags');
         $filter_showThumbnail = Session::Get('content', 'filter_showThumbnail');
     } else {
         $filter_pinned = 0;
         $filter_name = NULL;
         $filterId = NULL;
         $filter_type = NULL;
         $filter_retired = 0;
         $filter_owner = NULL;
         $filter_duration_in_seconds = 0;
         $filter_showThumbnail = 0;
         $showTags = 0;
     }
     $id = uniqid();
     Theme::Set('id', $id);
     Theme::Set('filter_id', 'XiboFilterPinned' . uniqid('filter'));
     Theme::Set('pager', ResponseManager::Pager($id));
     Theme::Set('form_meta', '<input type="hidden" name="p" value="content"><input type="hidden" name="q" value="LibraryGrid">');
     $formFields = array();
     $formFields[] = FormManager::AddText('filter_name', __('Name'), $filter_name, NULL, 'n');
     $formFields[] = FormManager::AddText('filterId', __('ID'), $filterId, NULL, 'i');
     // Users we have permission to see
     $users = $this->user->userList();
     array_unshift($users, array('userid' => '', 'username' => 'All'));
     $formFields[] = FormManager::AddCombo('filter_owner', __('Owner'), $filter_owner, $users, 'userid', 'username', NULL, 'o');
     $types = $db->GetArray("SELECT Module AS moduleid, Name AS module FROM `module` WHERE RegionSpecific = 0 AND Enabled = 1 ORDER BY 2");
     array_unshift($types, array('moduleid' => '', 'module' => 'All'));
     $formFields[] = FormManager::AddCombo('filter_type', __('Type'), $filter_type, $types, 'moduleid', 'module', NULL, 'y');
     $formFields[] = FormManager::AddCombo('filter_retired', __('Retired'), $filter_retired, array(array('retiredid' => 1, 'retired' => 'Yes'), array('retiredid' => 0, 'retired' => 'No')), 'retiredid', 'retired', NULL, 'r');
     $formFields[] = FormManager::AddCheckbox('filter_duration_in_seconds', __('Duration in Seconds'), $filter_duration_in_seconds, NULL, 's');
     $formFields[] = FormManager::AddCheckbox('showTags', __('Show Tags'), $showTags, NULL, 't');
     $formFields[] = FormManager::AddCheckbox('filter_showThumbnail', __('Show Thumbnails'), $filter_showThumbnail, NULL, 't');
     $formFields[] = FormManager::AddCheckbox('XiboFilterPinned', __('Keep Open'), $filter_pinned, NULL, 'k');
     // Call to render the template
     Theme::Set('header_text', __('Library'));
     Theme::Set('form_fields', $formFields);
     Theme::Render('grid_render');
 }
Пример #6
0
 /**
  * Return the Edit Form as HTML
  * @return
  */
 public function EditForm()
 {
     $this->response = new ResponseManager();
     // This is the logged in user and can be used to assess permissions
     $user =& $this->user;
     // The CMS provides the region width and height in case they are needed
     $rWidth = Kit::GetParam('rWidth', _REQUEST, _STRING);
     $rHeight = Kit::GetParam('rHeight', _REQUEST, _STRING);
     // Augment settings with templates
     $this->loadTemplates();
     // All forms should set some meta data about the form.
     // Usually, you would want this meta data to remain the same.
     Theme::Set('form_id', 'ModuleForm');
     Theme::Set('form_action', 'index.php?p=module&mod=' . $this->type . '&q=Exec&method=EditMedia');
     Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $this->layoutid . '"><input type="hidden" id="iRegionId" name="regionid" value="' . $this->regionid . '"><input type="hidden" name="showRegionOptions" value="' . $this->showRegionOptions . '" /><input type="hidden" id="mediaid" name="mediaid" value="' . $this->mediaid . '">');
     $tabs = array();
     $tabs[] = FormManager::AddTab('general', __('General'));
     $tabs[] = FormManager::AddTab('template', __('Appearance'), array(array('name' => 'enlarge', 'value' => true)));
     $tabs[] = FormManager::AddTab('effect', __('Effect'));
     $tabs[] = FormManager::AddTab('advanced', __('Advanced'));
     Theme::Set('form_tabs', $tabs);
     $formFields['general'][] = FormManager::AddText('name', __('Name'), $this->GetOption('name'), __('An optional name for this media'), 'n');
     // Duration
     $formFields['general'][] = FormManager::AddNumber('duration', __('Duration'), $this->duration, __('The duration in seconds this item should be displayed.'), 'd', 'required');
     // Search Term
     $formFields['general'][] = FormManager::AddText('searchTerm', __('Search Term'), $this->GetOption('searchTerm'), __('Search term. You can test your search term in the twitter.com search box first.'), 's', 'required');
     // Type
     $formFields['general'][] = FormManager::AddCombo('resultType', __('Type'), $this->GetOption('resultType'), array(array('typeid' => 'mixed', 'type' => __('Mixed')), array('typeid' => 'recent', 'type' => __('Recent')), array('typeid' => 'popular', 'type' => __('Popular'))), 'typeid', 'type', __('Recent shows only the most recent tweets, Popular the most popular and Mixed includes both popular and recent results.'), 't', 'required');
     // Distance
     $formFields['general'][] = FormManager::AddNumber('tweetDistance', __('Distance'), $this->GetOption('tweetDistance'), __('Distance in miles that the tweets should be returned from. Set to 0 for no restrictions.'), 'd');
     // Distance
     $formFields['general'][] = FormManager::AddNumber('tweetCount', __('Count'), $this->GetOption('tweetCount'), __('The number of Tweets to return.'), 'c');
     // Common fields
     $formFields['effect'][] = FormManager::AddCombo('effect', __('Effect'), $this->GetOption('effect'), array(array('effectid' => 'none', 'effect' => __('None')), array('effectid' => 'fade', 'effect' => __('Fade')), array('effectid' => 'fadeout', 'effect' => __('Fade Out')), array('effectid' => 'scrollHorz', 'effect' => __('Scroll Horizontal')), array('effectid' => 'scrollVert', 'effect' => __('Scroll Vertical')), array('effectid' => 'flipHorz', 'effect' => __('Flip Horizontal')), array('effectid' => 'flipVert', 'effect' => __('Flip Vertical')), array('effectid' => 'shuffle', 'effect' => __('Shuffle')), array('effectid' => 'tileSlide', 'effect' => __('Tile Slide')), array('effectid' => 'tileBlind', 'effect' => __('Tile Blinds')), array('effectid' => 'marqueeLeft', 'effect' => __('Marquee Left')), array('effectid' => 'marqueeRight', 'effect' => __('Marquee Right')), array('effectid' => 'marqueeUp', 'effect' => __('Marquee Up')), array('effectid' => 'marqueeDown', 'effect' => __('Marquee Down'))), 'effectid', 'effect', __('Please select the effect that will be used to transition between items. If all items should be output, select None. Marquee effects are CPU intensive and may not be suitable for lower power displays.'), 'e');
     $formFields['effect'][] = FormManager::AddNumber('speed', __('Speed'), $this->GetOption('speed'), __('The transition speed of the selected effect in milliseconds (normal = 1000) or the Marquee Speed in a low to high scale (normal = 1).'), 's', NULL, 'effect-controls');
     // A list of web safe colours
     $formFields['advanced'][] = FormManager::AddText('backgroundColor', __('Background Colour'), $this->GetOption('backgroundColor'), __('The selected effect works best with a background colour. Optionally add one here.'), 'c', NULL, 'background-color-group');
     // Field empty
     $formFields['advanced'][] = FormManager::AddText('noTweetsMessage', __('No tweets'), $this->GetOption('noTweetsMessage'), __('A message to display when there are no tweets returned by the search query'), 'n');
     $formFields['advanced'][] = FormManager::AddText('dateFormat', __('Date Format'), $this->GetOption('dateFormat'), __('The format to apply to all dates returned by the ticker. In PHP date format: http://uk3.php.net/manual/en/function.date.php'), 'f');
     $formFields['advanced'][] = FormManager::AddCheckbox('removeUrls', __('Remove URLs?'), $this->GetOption('removeUrls', 1), __('Should URLs be removed from the Tweet Text. Most URLs do not compliment digital signage.'), 'u');
     $formFields['advanced'][] = FormManager::AddNumber('updateInterval', __('Update Interval (mins)'), $this->GetOption('updateInterval', 60), __('Please enter the update interval in minutes. This should be kept as high as possible. For example, if the data will only change once per hour this could be set to 60.'), 'n', 'required');
     // Encode up the template
     if (Config::GetSetting('SERVER_MODE') == 'Test' && $this->user->usertypeid == 1) {
         $formFields['advanced'][] = FormManager::AddMessage('<pre>' . htmlentities(json_encode(array('id' => 'ID', 'value' => 'TITLE', 'template' => $this->GetRawNode('template'), 'css' => $this->GetRawNode('styleSheet')))) . '</pre>');
     }
     // Template - for standard stuff
     $formFields['template'][] = FormManager::AddCombo('templateId', __('Template'), $this->GetOption('templateId', 'tweet-only'), $this->settings['templates'], 'id', 'value', __('Select the template you would like to apply. This can be overridden using the check box below.'), 't', 'template-selector-control');
     // Add a field for whether to override the template or not.
     // Default to 1 so that it will work correctly with old items (that didn't have a template selected at all)
     $formFields['template'][] = FormManager::AddCheckbox('overrideTemplate', __('Override the template?'), $this->GetOption('overrideTemplate', 0), __('Tick if you would like to override the template.'), 'o');
     // Add a text template
     $formFields['template'][] = FormManager::AddMultiText('ta_text', NULL, $this->GetRawNode('template'), __('Enter the template. Please note that the background colour has automatically coloured to your layout background colour.'), 't', 10, NULL, 'template-override-controls');
     // Field for the style sheet (optional)
     $formFields['template'][] = FormManager::AddMultiText('ta_css', NULL, $this->GetRawNode('styleSheet'), __('Optional Stylesheet'), 's', 10, NULL, 'template-override-controls');
     // Add some field dependencies
     // When the override template check box is ticked, we want to expose the advanced controls and we want to hide the template selector
     $this->response->AddFieldAction('overrideTemplate', 'init', false, array('.template-override-controls' => array('display' => 'none'), '.template-selector-control' => array('display' => 'block')), 'is:checked');
     $this->response->AddFieldAction('overrideTemplate', 'change', false, array('.template-override-controls' => array('display' => 'none'), '.template-selector-control' => array('display' => 'block')), 'is:checked');
     $this->response->AddFieldAction('overrideTemplate', 'init', true, array('.template-override-controls' => array('display' => 'block'), '.template-selector-control' => array('display' => 'none')), 'is:checked');
     $this->response->AddFieldAction('overrideTemplate', 'change', true, array('.template-override-controls' => array('display' => 'block'), '.template-selector-control' => array('display' => 'none')), 'is:checked');
     // Present an error message if the module has not been configured. Don't prevent further configuration.
     if (!extension_loaded('curl') || $this->GetSetting('apiKey') == '' || $this->GetSetting('apiSecret') == '') {
         $formFields['general'][] = FormManager::AddMessage(__('The Twitter Widget has not been configured yet, please ask your CMS Administrator to look at it for you.'), 'alert alert-danger');
     }
     // Modules should be rendered using the theme engine.
     Theme::Set('form_fields_general', $formFields['general']);
     Theme::Set('form_fields_template', $formFields['template']);
     Theme::Set('form_fields_effect', $formFields['effect']);
     Theme::Set('form_fields_advanced', $formFields['advanced']);
     // Set the field dependencies
     $this->setFieldDepencencies();
     $this->response->html = Theme::RenderReturn('form_render');
     $this->response->dialogTitle = __($this->displayType);
     $this->response->callBack = 'text_callback';
     // The response object outputs the required JSON object to the browser
     // which is then processed by the CMS JavaScript library (xibo-cms.js).
     // Append the templates to the response
     $this->response->extra = $this->settings['templates'];
     $this->response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $this->layoutid . '&regionid=' . $this->regionid . '&q=RegionOptions")');
     $this->response->AddButton(__('Apply'), 'XiboDialogApply("#ModuleForm")');
     $this->response->AddButton(__('Save'), '$("#ModuleForm").submit()');
     // The response must be returned.
     return $this->response;
 }
Пример #7
0
 /**
  * Return the Edit Form as HTML
  * @return
  */
 public function EditForm()
 {
     $this->response = new ResponseManager();
     $db =& $this->db;
     $user =& $this->user;
     // Would like to get the regions width / height
     $layoutid = $this->layoutid;
     $regionid = $this->regionid;
     $mediaid = $this->mediaid;
     // Permissions
     if (!$this->auth->edit) {
         $this->response->SetError('You do not have permission to edit this assignment.');
         $this->response->keepOpen = true;
         return $this->response;
     }
     $dataSetId = $this->GetOption('datasetid');
     Theme::Set('form_id', 'ModuleForm');
     Theme::Set('form_action', 'index.php?p=module&mod=' . $this->type . '&q=Exec&method=EditMedia');
     Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutid . '"><input type="hidden" id="iRegionId" name="regionid" value="' . $regionid . '"><input type="hidden" name="showRegionOptions" value="' . $this->showRegionOptions . '" /><input type="hidden" name="datasetid" value="' . $dataSetId . '"><input type="hidden" id="mediaid" name="mediaid" value="' . $mediaid . '">');
     // We want 2 tabs
     $tabs = array();
     $tabs[] = FormManager::AddTab('general', __('General'));
     $tabs[] = FormManager::AddTab('advanced', __('Advanced'));
     Theme::Set('form_tabs', $tabs);
     $formFields = array();
     $formFields[] = FormManager::AddNumber('duration', __('Duration'), $this->duration, __('The duration in seconds this item should be displayed'), 'd', 'required', '', $this->auth->modifyPermissions);
     $formFields[] = FormManager::AddText('ordering', __('Order'), $this->GetOption('ordering'), __('Please enter a SQL clause for how this dataset should be ordered'), 'o');
     $formFields[] = FormManager::AddText('filter', __('Filter'), $this->GetOption('filter'), __('Please enter a SQL clause to filter this DataSet.'), 'f');
     $formFields[] = FormManager::AddCheckbox('showHeadings', __('Show the table headings?'), $this->GetOption('showHeadings'), __('Should the Table headings be shown?'), 'h');
     // Handle the columns
     $columns = $this->GetOption('columns');
     if ($columns != '') {
         // Query for more info about the selected and available columns
         $notColumns = $db->GetArray(sprintf("SELECT DataSetColumnID, Heading FROM datasetcolumn WHERE DataSetID = %d AND DataSetColumnID NOT IN (%s)", $dataSetId, $columns));
         // These columns need to be in order
         $columnIds = explode(',', $columns);
         $headings = array();
         foreach ($columnIds as $col) {
             $heading = $db->GetSingleRow(sprintf('SELECT DataSetColumnID, Heading FROM datasetcolumn WHERE DataSetColumnID = %d', $col), 'Heading', _STRING);
             $headings[] = $heading;
         }
         $columns = $headings;
     } else {
         $columns = array();
         $notColumns = $db->GetArray(sprintf("SELECT DataSetColumnID, Heading FROM datasetcolumn WHERE DataSetID = %d ", $dataSetId));
     }
     // Build the two lists
     $columnsSelected = '<ul id="columnsIn" class="connectedSortable">';
     $columnsNotSelected = '<ul id="columnsOut" class="connectedSortable">';
     foreach ($columns as $col) {
         $columnsSelected .= '<li id="DataSetColumnId_' . $col['DataSetColumnID'] . '" class="li-sortable">' . $col['Heading'] . '</li>';
     }
     $columnsSelected .= '</ul>';
     foreach ($notColumns as $notCol) {
         $columnsNotSelected .= '<li id="DataSetColumnId_' . $notCol['DataSetColumnID'] . '" class="li-sortable">' . $notCol['Heading'] . '</li>';
     }
     $columnsNotSelected .= '</ul>';
     Theme::Set('columns_selected_list', $columnsSelected);
     Theme::Set('columns_available_list', $columnsNotSelected);
     // Add the columns in as a RAW message
     $formFields[] = FormManager::AddRaw(Theme::RenderReturn('media_form_datasetview_edit'));
     Theme::Set('form_fields_general', $formFields);
     // Advanced Tab
     $formFields = array();
     $formFields[] = FormManager::AddNumber('lowerLimit', __('Lower Row Limit'), $this->GetOption('lowerLimit'), __('Please enter the Lower Row Limit for this DataSet (enter 0 for no limit)'), 'l');
     $formFields[] = FormManager::AddNumber('upperLimit', __('Upper Row Limit'), $this->GetOption('upperLimit'), __('Please enter the Upper Row Limit for this DataSet (enter 0 for no limit)'), 'u');
     $formFields[] = FormManager::AddNumber('updateInterval', __('Update Interval (mins)'), $this->GetOption('updateInterval', 5), __('Please enter the update interval in minutes. This should be kept as high as possible. For example, if the data will only change once per day this could be set to 60.'), 'n', 'required');
     $formFields[] = FormManager::AddNumber('rowsPerPage', __('Rows per page'), $this->GetOption('rowsPerPage'), __('Please enter the number of rows per page. 0 for no pages.'), 'u');
     // Get the embedded HTML out of RAW
     $rawXml = new DOMDocument();
     $rawXml->loadXML($this->GetRaw());
     $rawNodes = $rawXml->getElementsByTagName('styleSheet');
     if ($rawNodes->length != 0) {
         $rawNode = $rawNodes->item(0);
     }
     $formFields[] = FormManager::AddMultiText('styleSheet', NULL, $rawNodes->length == 0 ? $this->DefaultStyleSheet() : $rawNode->nodeValue, __('Enter a style sheet for the table'), 's', 10);
     Theme::Set('form_fields_advanced', $formFields);
     $this->response->SetFormRequestResponse(NULL, 'Edit DataSet View for DataSet', '650px', '575px');
     // Cancel button
     if ($this->showRegionOptions) {
         $this->response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $layoutid . '&regionid=' . $regionid . '&q=RegionOptions")');
     } else {
         $this->response->AddButton(__('Cancel'), 'XiboDialogClose()');
     }
     $this->response->AddButton(__('Save'), 'DataSetViewSubmit()');
     $this->response->callBack = 'datasetview_callback';
     return $this->response;
 }
Пример #8
0
 public function ScheduleNowForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     $date = time();
     // We might have a layout id, or a display id
     $campaignId = Kit::GetParam('CampaignID', _GET, _INT, 0);
     $displayGroupIds = Kit::GetParam('displayGroupId', _GET, _ARRAY);
     Theme::Set('form_id', 'ScheduleNowForm');
     Theme::Set('form_action', 'index.php?p=schedule&q=ScheduleNow');
     $formFields = array();
     // Generate a list of layouts.
     $layouts = $user->CampaignList(NULL, false, false);
     $optionGroups = array(array('id' => 'campaign', 'label' => __('Campaigns')), array('id' => 'layout', 'label' => __('Layouts')));
     $layoutOptions = array();
     $campaignOptions = array();
     foreach ($layouts as $layout) {
         if ($layout['islayoutspecific'] == 1) {
             $layoutOptions[] = array('id' => $layout['campaignid'], 'value' => $layout['campaign']);
         } else {
             $campaignOptions[] = array('id' => $layout['campaignid'], 'value' => $layout['campaign']);
         }
     }
     $formFields[] = FormManager::AddCombo('CampaignID', __('Layout'), $campaignId, array('campaign' => $campaignOptions, 'layout' => $layoutOptions), 'id', 'value', __('Please select a Layout or Campaign for this Event to show'), 'l', '', true, '', '', '', $optionGroups);
     $formFields[] = FormManager::AddText('hours', __('Hours'), NULL, __('Hours this event should be scheduled for'), 'h', '');
     $formFields[] = FormManager::AddText('minutes', __('Minutes'), NULL, __('Minutes this event should be scheduled for'), 'h', '');
     $formFields[] = FormManager::AddText('seconds', __('Seconds'), NULL, __('Seconds this event should be scheduled for'), 'h', '');
     // List of Display Groups
     $optionGroups = array(array('id' => 'group', 'label' => __('Groups')), array('id' => 'display', 'label' => __('Displays')));
     $groups = array();
     $displays = array();
     $scheduleWithView = Config::GetSetting('SCHEDULE_WITH_VIEW_PERMISSION') == 'Yes';
     foreach ($this->user->DisplayGroupList(-1) as $display) {
         // Can schedule with view, but no view permissions
         if ($scheduleWithView && $display['view'] != 1) {
             continue;
         }
         // Can't schedule with view, but no edit permissions
         if (!$scheduleWithView && $display['edit'] != 1) {
             continue;
         }
         $display['checked_text'] = in_array($display['displaygroupid'], $displayGroupIds) ? ' selected' : '';
         if ($display['isdisplayspecific'] == 1) {
             $displays[] = $display;
         } else {
             $groups[] = $display;
         }
     }
     $formFields[] = FormManager::AddMultiCombo('DisplayGroupIDs[]', __('Display'), $displayGroupIds, array('group' => $groups, 'display' => $displays), 'displaygroupid', 'displaygroup', __('Please select one or more displays / groups for this event to be shown on.'), 'd', '', true, '', '', '', $optionGroups, array(array('name' => 'data-live-search', 'value' => "true"), array('name' => 'data-selected-text-format', 'value' => "count > 4")));
     $formFields[] = FormManager::AddNumber('DisplayOrder', __('Display Order'), 0, __('Should this event have an order?'), 'o', '');
     $formFields[] = FormManager::AddCheckbox('is_priority', __('Priority?'), NULL, __('Sets whether or not this event has priority. If set the event will be show in preference to other events.'), 'p');
     Theme::Set('form_fields', $formFields);
     $response->SetFormRequestResponse(NULL, __('Schedule Now'), '700px', '400px');
     $response->callBack = 'setupScheduleNowForm';
     $response->AddButton(__('Help'), "XiboHelpRender('index.php?p=help&q=Display&Topic=Schedule&Category=ScheduleNow')");
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Save'), '$("#ScheduleNowForm").submit()');
     $response->Respond();
 }
Пример #9
0
 /**
  * Resolution Edit Form
  */
 function EditForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     $resolutionID = Kit::GetParam('resolutionid', _GET, _INT);
     $SQL = sprintf("SELECT resolution, width, height, intended_width, intended_height, enabled FROM resolution WHERE resolutionID = %d", $resolutionID);
     if (!($result = $db->query($SQL))) {
         trigger_error($db->error());
         trigger_error(__('Unable to edit this resolution'), E_USER_ERROR);
     }
     if ($db->num_rows($result) == 0) {
         trigger_error(__('Incorrect resolution id'), E_USER_ERROR);
     }
     $row = $db->get_assoc_row($result);
     $formFields = array();
     $formFields[] = FormManager::AddText('resolution', __('Resolution'), Kit::ValidateParam($row['resolution'], _STRING), __('A name for this Resolution'), 'r', 'required');
     $formFields[] = FormManager::AddNumber('width', __('Width'), Kit::ValidateParam($row['intended_width'], _INT), __('The Width for this Resolution'), 'w', 'required');
     $formFields[] = FormManager::AddNumber('height', __('Height'), Kit::ValidateParam($row['intended_height'], _INT), __('The Height for this Resolution'), 'h', 'required');
     $formFields[] = FormManager::AddCheckbox('enabled', __('Enable?'), Kit::ValidateParam($row['enabled'], _INT), __('Is the Resolution enabled for use?'), 'e');
     Theme::Set('form_fields', $formFields);
     Theme::Set('form_id', 'ResolutionForm');
     Theme::Set('form_action', 'index.php?p=resolution&q=Edit');
     Theme::Set('form_meta', '<input type="hidden" name="resolutionid" value="' . $resolutionID . '" >');
     $response->SetFormRequestResponse(NULL, __('Edit Resolution'), '350px', '250px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Template', 'Add') . '")');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Save'), '$("#ResolutionForm").submit()');
     $response->Respond();
 }
Пример #10
0
 public function EditForm()
 {
     // Create a form out of the config object.
     $displayProfile = new DisplayProfile();
     $displayProfile->displayProfileId = Kit::GetParam('displayprofileid', _GET, _INT);
     if (!$displayProfile->Load()) {
         trigger_error($displayProfile->GetErrorMessage(), E_USER_ERROR);
     }
     if ($this->user->usertypeid != 1 && $this->user->userid != $displayProfile->userId) {
         trigger_error(__('You do not have permission to edit this profile'), E_USER_ERROR);
     }
     if (empty($displayProfile->type)) {
         trigger_error(__('Unknown Client Type'), E_USER_ERROR);
     }
     // Capture and validate the posted form parameters in accordance with the display config object.
     include 'config/client.config.php';
     if (!isset($CLIENT_CONFIG[$displayProfile->type])) {
         trigger_error(__('CMS Config not supported for ' . $displayProfile->type . ' displays.'), E_USER_ERROR);
     }
     // Set some information about the form
     Theme::Set('form_id', 'DisplayConfigForm');
     Theme::Set('form_action', 'index.php?p=displayprofile&q=Edit');
     Theme::Set('form_meta', '<input type="hidden" name="displayprofileid" value="' . $displayProfile->displayProfileId . '" />');
     $formFields = array();
     $formTabs = array();
     // Tabs?
     foreach ($CLIENT_CONFIG[$displayProfile->type]['tabs'] as $tab) {
         // Create an empty array of form fields for this tab.
         $formFields[$tab['id']] = array();
         // Also add the tab
         $formTabs[] = FormManager::AddTab($tab['id'], $tab['name']);
     }
     // Go through each setting and output a form control to the theme.
     $formFields['general'][] = FormManager::AddText('name', __('Name'), $displayProfile->name, __('The Name of the Profile - (1 - 50 characters)'), 'n', 'maxlength="50" required');
     $formFields['general'][] = FormManager::AddCheckbox('isdefault', __('Default Profile?'), $displayProfile->isDefault, __('Is this the default profile for all Displays of this type? Only 1 profile can be the default.'), 'd');
     foreach ($CLIENT_CONFIG[$displayProfile->type]['settings'] as $setting) {
         // Check to see if we have a value for this setting as yet, if so we use that.
         // TODO: there must be a way to improve this?
         foreach ($displayProfile->config as $set) {
             if ($set['name'] == $setting['name']) {
                 $setting['value'] = $set['value'];
             }
         }
         if ($setting['type'] == 'checkbox' && isset($setting['value'])) {
             $validated = $setting['value'];
         } else {
             if ($setting['fieldType'] == 'timePicker') {
                 // Check if we are 0, if so then set to 00:00
                 if ($setting['value'] == 0) {
                     $validated = '00:00';
                 } else {
                     $validated = DateManager::getLocalDate($setting['value'] / 1000, 'H:i');
                 }
             } else {
                 if (isset($setting['value'])) {
                     $validated = Kit::ValidateParam($setting['value'], $setting['type']);
                 } else {
                     $validated = $setting['default'];
                 }
             }
         }
         //Debug::LogEntry('audit', 'Validated ' . $setting['name'] . '. [' . $setting['value'] . '] as [' . $validated . ']. With type ' . $setting['type']);
         // Each field needs to have a type, a name and a default
         $formFields[$setting['tabId']][] = array('name' => $setting['name'], 'fieldType' => $setting['fieldType'], 'helpText' => $setting['helpText'], 'title' => $setting['title'], 'options' => isset($setting['options']) ? $setting['options'] : array(), 'optionId' => 'id', 'optionValue' => 'value', 'validation' => isset($setting['validation']) ? $setting['validation'] : '', 'value' => $validated, 'enabled' => $setting['enabled'], 'groupClass' => NULL, 'accesskey' => '');
     }
     Theme::Set('form_tabs', $formTabs);
     foreach ($CLIENT_CONFIG[$displayProfile->type]['tabs'] as $tab) {
         Theme::Set('form_fields_' . $tab['id'], $formFields[$tab['id']]);
     }
     $response = new ResponseManager();
     $response->SetFormRequestResponse(NULL, __('Edit Profile'), '650px', '350px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('DisplayProfile', 'Edit') . '")');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Save'), '$("#DisplayConfigForm").submit()');
     $response->Respond();
 }
Пример #11
0
 /**
  * Category Edit Form
  */
 function EditForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     $categoryID = Kit::GetParam('categoryid', _GET, _INT);
     $SQL = sprintf("SELECT category FROM category WHERE categoryID = %d", $categoryID);
     if (!($result = $db->query($SQL))) {
         trigger_error($db->error());
         trigger_error(__('Unable to edit this category'), E_USER_ERROR);
     }
     if ($db->num_rows($result) == 0) {
         trigger_error(__('Incorrect category id'), E_USER_ERROR);
     }
     $row = $db->get_assoc_row($result);
     $formFields = array();
     $formFields[] = FormManager::AddText('category', __('Category'), Kit::ValidateParam($row['category'], _STRING), __('A name for this Category'), 'r', 'required');
     Theme::Set('form_fields', $formFields);
     Theme::Set('form_id', 'CategoryForm');
     Theme::Set('form_action', 'index.php?p=category&q=Edit');
     Theme::Set('form_meta', '<input type="hidden" name="categoryid" value="' . $categoryID . '" >');
     $response->SetFormRequestResponse(NULL, __('Edit Category'), '350px', '250px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Template', 'Add') . '")');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Save'), '$("#CategoryForm").submit()');
     $response->Respond();
 }
Пример #12
0
 public function ImportForm()
 {
     global $session;
     $db =& $this->db;
     $response = new ResponseManager();
     // Set the Session / Security information
     $sessionId = session_id();
     $securityToken = CreateFormToken();
     $session->setSecurityToken($securityToken);
     // Find the max file size
     $maxFileSizeBytes = convertBytes(ini_get('upload_max_filesize'));
     // Set some information about the form
     Theme::Set('form_id', 'LayoutImportForm');
     Theme::Set('form_action', 'index.php?p=layout&q=Import');
     Theme::Set('form_meta', '<input type="hidden" id="txtFileName" name="txtFileName" readonly="true" /><input type="hidden" name="hidFileID" id="hidFileID" value="" /><input type="hidden" name="template" value="' . Kit::GetParam('template', _GET, _STRING, 'false') . '" />');
     Theme::Set('form_upload_id', 'file_upload');
     Theme::Set('form_upload_action', 'index.php?p=content&q=FileUpload');
     Theme::Set('form_upload_meta', '<input type="hidden" id="PHPSESSID" value="' . $sessionId . '" /><input type="hidden" id="SecurityToken" value="' . $securityToken . '" /><input type="hidden" name="MAX_FILE_SIZE" value="' . $maxFileSizeBytes . '" />');
     Theme::Set('prepend', Theme::RenderReturn('form_file_upload_single'));
     $formFields = array();
     $formFields[] = FormManager::AddText('layout', __('Name'), NULL, __('The Name of the Layout - (1 - 50 characters). Leave blank to use the name from the import.'), 'n');
     $formFields[] = FormManager::AddCheckbox('replaceExisting', __('Replace Existing Media?'), NULL, __('If the import finds existing media with the same name, should it be replaced in the Layout or should the Layout use that media.'), 'r');
     if (Kit::GetParam('template', _GET, _STRING, 'false') != 'true') {
         $formFields[] = FormManager::AddCheckbox('importTags', __('Import Tags?'), NULL, __('Would you like to import any tags contained on the layout.'), 't');
     }
     Theme::Set('form_fields', $formFields);
     $response->SetFormRequestResponse(NULL, __('Import Layout'), '350px', '200px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('DataSet', 'ImportCsv') . '")');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Import'), '$("#LayoutImportForm").submit()');
     $response->Respond();
 }
Пример #13
0
 protected function EditFormForLibraryMedia($extraFormFields = NULL)
 {
     global $session;
     $db =& $this->db;
     $user =& $this->user;
     if ($this->response == null) {
         $this->response = new ResponseManager();
     }
     // Would like to get the regions width / height
     $layoutid = $this->layoutid;
     $regionid = $this->regionid;
     $mediaid = $this->mediaid;
     $lkid = $this->lkid;
     $userid = $this->user->userid;
     // Delete Old Version Checkbox Setting
     $deleteOldVersionChecked = Config::GetSetting('LIBRARY_MEDIA_DELETEOLDVER_CHECKB') == 'Checked' ? 1 : 0;
     // Can this user delete?
     if (!$this->auth->edit) {
         $this->response->SetError('You do not have permission to edit this media.');
         $this->response->keepOpen = false;
         return $this->response;
     }
     // Set the Session / Security information
     $sessionId = session_id();
     $securityToken = CreateFormToken();
     $session->setSecurityToken($securityToken);
     // Load what we know about this media into the object
     $SQL = "SELECT name, originalFilename, userID, retired, storedAs, isEdited, editedMediaID FROM media WHERE mediaID = {$mediaid} ";
     if (!($row = $db->GetSingleRow($SQL))) {
         // log the error
         trigger_error($db->error());
         trigger_error(__('Error querying for the Media information'), E_USER_ERROR);
     }
     $name = $row['name'];
     $originalFilename = $row['originalFilename'];
     $userid = $row['userID'];
     $retired = $row['retired'];
     $storedAs = $row['storedAs'];
     $isEdited = $row['isEdited'];
     $editedMediaID = $row['editedMediaID'];
     $ext = strtolower(substr(strrchr($originalFilename, '.'), 1));
     // Save button is different depending on if we are on a region or not
     if ($regionid != '' && $this->showRegionOptions) {
         setSession('content', 'mediatype', $this->type);
         $this->response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $layoutid . '&regionid=' . $regionid . '&q=RegionOptions")');
     } elseif ($regionid != '' && !$this->showRegionOptions) {
         $this->response->AddButton(__('Cancel'), 'XiboDialogClose()');
     } else {
         $this->response->AddButton(__('Cancel'), 'XiboDialogClose()');
     }
     $this->response->AddButton(__('Save'), '$("#EditLibraryBasedMedia").submit()');
     // Setup the theme
     Theme::Set('form_id', 'EditLibraryBasedMedia');
     Theme::Set('form_action', 'index.php?p=module&mod=' . $this->type . '&q=Exec&method=EditMedia');
     Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutid . '"><input type="hidden" name="regionid" value="' . $regionid . '"><input type="hidden" name="mediaid" value="' . $mediaid . '"><input type="hidden" name="lkid" value="' . $lkid . '"><input type="hidden" name="showRegionOptions" value="' . $this->showRegionOptions . '" /><input type="hidden" id="txtFileName" name="txtFileName" readonly="true" /><input type="hidden" name="hidFileID" id="hidFileID" value="" />');
     Theme::Set('form_upload_id', 'file_upload');
     Theme::Set('form_upload_action', 'index.php?p=content&q=FileUpload');
     Theme::Set('form_upload_meta', '<input type="hidden" id="PHPSESSID" value="' . $sessionId . '" /><input type="hidden" id="SecurityToken" value="' . $securityToken . '" /><input type="hidden" name="MAX_FILE_SIZE" value="' . $this->maxFileSizeBytes . '" />');
     Theme::Set('prepend', Theme::RenderReturn('form_file_upload_single'));
     $formFields = array();
     $formFields[] = FormManager::AddMessage(sprintf(__('This form accepts: %s files up to a maximum size of %s'), $this->validExtensionsText, $this->maxFileSize));
     $formFields[] = FormManager::AddText('name', __('Name'), $name, __('The Name of this item - Leave blank to use the file name'), 'n');
     $formFields[] = FormManager::AddNumber('duration', __('Duration'), $this->duration, __('The duration in seconds this item should be displayed'), 'd', 'required', '', $this->auth->modifyPermissions);
     $formFields[] = FormManager::AddText('tags', __('Tags'), $this->tags, __('Tag this media. Comma Separated.'), 'n');
     if ($this->assignable) {
         $formFields[] = FormManager::AddCheckbox('replaceInLayouts', __('Update this media in all layouts it is assigned to?'), Config::GetSetting('LIBRARY_MEDIA_UPDATEINALL_CHECKB') == 'Checked' ? 1 : 0, __('Note: It will only be replaced in layouts you have permission to edit.'), 'r');
     }
     $formFields[] = FormManager::AddCheckbox('deleteOldVersion', __('Delete the old version?'), $deleteOldVersionChecked, __('Completely remove the old version of this media item if a new file is being uploaded.'), 'c');
     // Add in any extra form fields we might have provided by the super-class
     if ($extraFormFields != NULL && is_array($extraFormFields)) {
         foreach ($extraFormFields as $field) {
             $formFields[] = $field;
         }
     }
     Theme::Set('form_fields', $formFields);
     $this->response->html = Theme::RenderReturn('form_render');
     $this->response->dialogTitle = 'Edit ' . $this->displayType;
     $this->response->dialogSize = true;
     $this->response->dialogWidth = '450px';
     $this->response->dialogHeight = '280px';
     return $this->response;
 }
Пример #14
0
 function EditForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     $layoutId = Kit::GetParam('layoutid', _GET, _INT);
     // Get the layout
     $layout = $user->LayoutList(NULL, array('layoutId' => Kit::GetParam('layoutid', _GET, _INT), 'excludeTemplates' => 0));
     if (count($layout) <= 0) {
         trigger_error(__('Unable to find Template'), E_USER_ERROR);
     }
     $layout = $layout[0];
     Theme::Set('form_id', 'TemplateEditForm');
     // Two tabs
     $tabs = array();
     $tabs[] = FormManager::AddTab('general', __('General'));
     $tabs[] = FormManager::AddTab('description', __('Description'));
     Theme::Set('form_tabs', $tabs);
     $formFields = array();
     $formFields['general'][] = FormManager::AddText('layout', __('Name'), $layout['layout'], __('The Name of the Layout - (1 - 50 characters)'), 'n', 'required');
     $formFields['description'][] = FormManager::AddMultiText('description', __('Description'), $layout['description'], __('An optional description of the Layout. (1 - 250 characters)'), 'd', 5, 'maxlength="250"');
     // We are editing
     Theme::Set('form_action', 'index.php?p=template&q=Edit');
     Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutId . '">');
     $formFields['general'][] = FormManager::AddCombo('retired', __('Retired'), $layout['retired'], array(array('retiredid' => '1', 'retired' => 'Yes'), array('retiredid' => '0', 'retired' => 'No')), 'retiredid', 'retired', __('Retire this template or not? It will no longer be visible in lists'), 'r');
     Theme::Set('form_fields_general', $formFields['general']);
     Theme::Set('form_fields_description', $formFields['description']);
     // Initialise the template and capture the output
     $form = Theme::RenderReturn('form_render');
     $response->SetFormRequestResponse($form, __('Edit Template'), '350px', '275px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Template', 'Edit') . '")');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Save'), '$("#TemplateEditForm").submit()');
     $response->Respond();
 }
Пример #15
0
 private function createQuestions($step, $questions)
 {
     // Takes a multi-dimensional array eg:
     // $q[0]['question'] = "May we collect anonymous usage statistics?";
     // $q[0]['type'] = _CHECKBOX;
     // $q[0]['default'] = true;
     $formFields = array();
     foreach ($questions as $qnum => $question) {
         $title = $step < 80 ? __('Question %d of Step %s', $qnum + 1, $step) : $question['title'];
         if ($question['type'] == _INPUTBOX) {
             $formFields[] = FormManager::AddText($step . '-' . $qnum, $title, $question['default'], $question['question'], 'q');
         } elseif ($question['type'] == _PASSWORD) {
             $formFields[] = FormManager::AddPassword($step . '-' . $qnum, $title, $question['default'], $question['question'], 'q');
         } elseif ($question['type'] == _CHECKBOX) {
             $formFields[] = FormManager::AddCheckbox($step . '-' . $qnum, $title, $question['default'] ? 1 : 0, $question['question'], 'q');
         }
     }
     return $formFields;
 }
Пример #16
0
 /**
  * Help Edit form
  */
 public function EditForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     $helpId = Kit::GetParam('HelpID', _REQUEST, _INT);
     // Pull the currently known info from the DB
     $SQL = "SELECT HelpID, Topic, Category, Link FROM `help` WHERE HelpID = %d ";
     $SQL = sprintf($SQL, $helpId);
     if (!($row = $db->GetSingleRow($SQL))) {
         trigger_error($db->error());
         trigger_error(__('Error getting Help Link'));
     }
     // Set some information about the form
     Theme::Set('form_id', 'HelpEditForm');
     Theme::Set('form_action', 'index.php?p=help&q=Edit');
     Theme::Set('form_meta', '<input type="hidden" name="HelpID" value="' . $helpId . '" />');
     $formFields = array();
     $formFields[] = FormManager::AddText('Topic', __('Topic'), Kit::ValidateParam($row['Topic'], _STRING), __('The Topic for this Help Link'), 't', 'maxlength="254" required');
     $formFields[] = FormManager::AddText('Category', __('Category'), Kit::ValidateParam($row['Category'], _STRING), __('The Category for this Help Link'), 'c', 'maxlength="254" required');
     $formFields[] = FormManager::AddText('Link', __('Link'), Kit::ValidateParam($row['Link'], _STRING), __('The Link to open for this help topic and category'), 'c', 'maxlength="254" required');
     Theme::Set('form_fields', $formFields);
     $response->SetFormRequestResponse(NULL, __('Edit Help Link'), '350px', '325px');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Save'), '$("#HelpEditForm").submit()');
     $response->Respond();
 }
Пример #17
0
 public function EditDataSetColumnForm()
 {
     $db =& $this->db;
     $response = new ResponseManager();
     $helpManager = new HelpManager($db, $this->user);
     $dataSetId = Kit::GetParam('datasetid', _GET, _INT);
     $dataSetColumnId = Kit::GetParam('datasetcolumnid', _GET, _INT);
     $dataSet = Kit::GetParam('dataset', _GET, _STRING);
     $auth = $this->user->DataSetAuth($dataSetId, true);
     if (!$auth->edit) {
         trigger_error(__('Access Denied'));
     }
     // Set some information about the form
     Theme::Set('form_id', 'DataSetColumnEditForm');
     Theme::Set('form_action', 'index.php?p=dataset&q=EditDataSetColumn');
     Theme::Set('form_meta', '<input type="hidden" name="dataset" value="' . $dataSet . '" /><input type="hidden" name="datasetid" value="' . $dataSetId . '" /><input type="hidden" name="datasetcolumnid" value="' . $dataSetColumnId . '" />');
     // Get some information about this data set column
     $SQL = sprintf("SELECT Heading, ListContent, ColumnOrder, DataTypeID, DataSetColumnTypeID, Formula FROM datasetcolumn WHERE DataSetColumnID = %d", $dataSetColumnId);
     if (!($row = $db->GetSingleRow($SQL))) {
         trigger_error(__('Unabled to get Data Column information'), E_USER_ERROR);
     }
     // Dropdown list for DataType and DataColumnType
     Theme::Set('datatype_field_list', $db->GetArray('SELECT datatypeid, datatype FROM datatype'));
     Theme::Set('datasetcolumntype_field_list', $db->GetArray('SELECT datasetcolumntypeid, datasetcolumntype FROM datasetcolumntype'));
     $formFields = array();
     $formFields[] = FormManager::AddText('heading', __('Heading'), Kit::ValidateParam($row['Heading'], _STRING), __('The heading for this Column'), 'h', 'required');
     $formFields[] = FormManager::AddCombo('datasetcolumntypeid', __('Column Type'), Kit::ValidateParam($row['DataSetColumnTypeID'], _INT), $db->GetArray('SELECT datasetcolumntypeid, datasetcolumntype FROM datasetcolumntype'), 'datasetcolumntypeid', 'datasetcolumntype', __('Whether this column is a value or a formula'), 't');
     $formFields[] = FormManager::AddCombo('datatypeid', __('Data Type'), Kit::ValidateParam($row['DataTypeID'], _INT), $db->GetArray('SELECT datatypeid, datatype FROM datatype'), 'datatypeid', 'datatype', __('The DataType of the Intended Data'), 'd');
     $formFields[] = FormManager::AddText('listcontent', __('List Content'), Kit::ValidateParam($row['ListContent'], _STRING), __('A comma separated list of items to present in a combo box'), 'l', '');
     $formFields[] = FormManager::AddNumber('columnorder', __('Column Order'), Kit::ValidateParam($row['ColumnOrder'], _INT), __('The order this column should be displayed in when entering data'), 'o', '');
     $formFields[] = FormManager::AddText('formula', __('Formula'), Kit::ValidateParam($row['Formula'], _STRING), __('A formula to use as a calculation for formula column types'), 'f', '');
     Theme::Set('form_fields', $formFields);
     $response->SetFormRequestResponse(NULL, __('Edit Column'), '350px', '200px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . $helpManager->Link('DataSet', 'EditColumn') . '")');
     $response->AddButton(__('Cancel'), 'XiboFormRender("index.php?p=dataset&q=DataSetColumnsForm&datasetid=' . $dataSetId . '&dataset=' . $dataSet . '")');
     $response->AddButton(__('Save'), '$("#DataSetColumnEditForm").submit()');
     $response->Respond();
 }
Пример #18
0
 public function OutputCsvForm()
 {
     $response = new ResponseManager();
     Theme::Set('form_id', 'OutputCsvForm');
     Theme::Set('form_action', 'index.php?p=stats&q=OutputCSV');
     $formFields = array();
     $formFields[] = FormManager::AddText('fromdt', __('From Date'), DateManager::getLocalDate(time() - 86400 * 35, 'Y-m-d'), NULL, 'f');
     $formFields[] = FormManager::AddText('todt', __('To Date'), DateManager::getLocalDate(null, 'Y-m-d'), NULL, 't');
     // List of Displays this user has permission for
     $displays = $this->user->DisplayGroupList(1);
     array_unshift($displays, array('displayid' => 0, 'displaygroup' => 'All'));
     $formFields[] = FormManager::AddCombo('displayid', __('Display'), NULL, $displays, 'displayid', 'displaygroup', NULL, 'd');
     Theme::Set('header_text', __('Bandwidth'));
     Theme::Set('form_fields', $formFields);
     Theme::Set('form_class', 'XiboManualSubmit');
     $response->SetFormRequestResponse(NULL, __('Export Statistics'), '550px', '275px');
     $response->AddButton(__('Export'), '$("#OutputCsvForm").submit()');
     $response->AddButton(__('Close'), 'XiboDialogClose()');
     $response->Respond();
 }
Пример #19
0
 function ManualRegionPositionForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     $regionid = Kit::GetParam('regionid', _GET, _STRING);
     $layoutid = Kit::GetParam('layoutid', _GET, _INT);
     $scale = Kit::GetParam('scale', _GET, _DOUBLE);
     $zoom = Kit::GetParam('zoom', _GET, _DOUBLE);
     // Load the region and get the dimensions, applying the scale factor if necessary (only v1 layouts will have a scale factor != 1)
     $region = new region($db);
     $regionNode = $region->getRegion($layoutid, $regionid);
     $top = round($regionNode->getAttribute('top') * $scale, 0);
     $left = round($regionNode->getAttribute('left') * $scale, 0);
     $width = round($regionNode->getAttribute('width') * $scale, 0);
     $height = round($regionNode->getAttribute('height') * $scale, 0);
     $zindex = $regionNode->getAttribute('zindex');
     $ownerId = $region->GetOwnerId($layoutid, $regionid);
     $regionName = $regionNode->getAttribute('name');
     $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);
     }
     // 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 type="hidden" name="scale" value="' . $scale . '"><input type="hidden" name="zoom" value="' . $zoom . '">');
     $formFields = array();
     $formFields[] = FormManager::AddText('name', __('Name'), $regionName, __('Name of the Region'), 'n', 'maxlength="50"');
     $formFields[] = FormManager::AddNumber('top', __('Top'), $top, __('Offset from the Top Corner'), 't');
     $formFields[] = FormManager::AddNumber('left', __('Left'), $left, __('Offset from the Left Corner'), 'l');
     $formFields[] = FormManager::AddNumber('width', __('Width'), $width, __('Width of the Region'), 'w');
     $formFields[] = FormManager::AddNumber('height', __('Height'), $height, __('Height of the Region'), 'h');
     // Transitions
     if (count($this->user->TransitionAuth('out')) > 0) {
         // Add none to the list
         $transitions = $this->user->TransitionAuth('out');
         $transitions[] = array('code' => '', 'transition' => 'None', 'class' => '');
         $formFields[] = FormManager::AddCombo('transitionType', __('Exit Transition'), $region->GetOption($layoutid, $regionid, 'transOut', ''), $transitions, 'code', 'transition', __('What transition should be applied when this region is finished?'), 't');
         $formFields[] = FormManager::AddNumber('transitionDuration', __('Duration'), $region->GetOption($layoutid, $regionid, 'transOutDuration', 0), __('The duration for this transition, in milliseconds.'), 'l', '', 'transition-group');
         // 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')));
         $formFields[] = FormManager::AddCombo('transitionDirection', __('Direction'), $region->GetOption($layoutid, $regionid, 'transOutDirection', ''), $compassPoints, 'id', 'name', __('The direction for this transition. Only appropriate for transitions that move, such as Fly.'), 'd', 'transition-group transition-direction');
         // Add some dependencies
         $response->AddFieldAction('transitionType', 'init', '', array('.transition-group' => array('display' => 'none')));
         $response->AddFieldAction('transitionType', 'init', '', array('.transition-group' => array('display' => 'block')), 'not');
         $response->AddFieldAction('transitionType', 'change', '', array('.transition-group' => array('display' => 'none')));
         $response->AddFieldAction('transitionType', 'change', '', array('.transition-group' => array('display' => 'block')), 'not');
     }
     $formFields[] = FormManager::AddCheckbox('loop', __('Loop?'), $region->GetOption($layoutid, $regionid, 'loop', 0), __('If there is only one item in this region should it loop? Not currently available for Windows Players.'), 'l');
     $formFields[] = FormManager::AddNumber('zindex', __('Layer'), $zindex == 0 ? NULL : $zindex, __('The layering order of this region (z-index). Advanced use only. '), 'z');
     Theme::Set('form_fields', $formFields);
     // Add some information about the whole layout to this request.
     $layout = new Layout();
     $layoutInformation = $layout->LayoutInformation($layoutid);
     $response->extra['layoutInformation'] = array('width' => $layoutInformation['width'], 'height' => $layoutInformation['height']);
     $response->SetFormRequestResponse(NULL, __('Region Options'), '350px', '275px');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Save'), '$("#RegionProperties").submit()');
     $response->AddButton(__('Set Full Screen'), 'setFullScreenLayout()');
     $response->Respond();
 }
Пример #20
0
 /**
  * Shows an edit form for a display group
  */
 public function EditForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     $helpManager = new HelpManager($db, $user);
     $displayGroupID = Kit::GetParam('DisplayGroupID', _REQUEST, _INT);
     // Auth
     $auth = $this->user->DisplayGroupAuth($displayGroupID, true);
     if (!$auth->edit) {
         trigger_error(__('You do not have permission to edit this display group'), E_USER_ERROR);
     }
     // Pull the currently known info from the DB
     $SQL = "SELECT DisplayGroupID, DisplayGroup, Description FROM displaygroup WHERE DisplayGroupID = %d AND IsDisplaySpecific = 0";
     $SQL = sprintf($SQL, $displayGroupID);
     if (!($row = $db->GetSingleRow($SQL))) {
         trigger_error($db->error());
         trigger_error(__('Error getting Display Group'), E_USER_ERROR);
     }
     // Pull out these columns
     if (count($row) <= 0) {
         trigger_error(__('No display group found.'), E_USER_ERROR);
     }
     // Set some information about the form
     Theme::Set('form_id', 'DisplayGroupEditForm');
     Theme::Set('form_action', 'index.php?p=displaygroup&q=Edit');
     Theme::Set('form_meta', '<input type="hidden" name="DisplayGroupID" value="' . $displayGroupID . '" />');
     $formFields[] = FormManager::AddText('group', __('Name'), Kit::ValidateParam($row['DisplayGroup'], _STRING), __('The Name for this Group'), 'n', 'required');
     $formFields[] = FormManager::AddText('desc', __('Description'), Kit::ValidateParam($row['Description'], _STRING), __('A short description of this Group'), 'd', 'maxlength="254"');
     Theme::Set('form_fields', $formFields);
     $response->SetFormRequestResponse(NULL, __('Edit Display Group'), '350px', '275px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('DisplayGroup', 'Edit') . '")');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Save'), '$("#DisplayGroupEditForm").submit()');
     $response->Respond();
 }
Пример #21
0
 /**
  * Edit Form
  */
 public function EditForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     $helpManager = new HelpManager($db, $user);
     // Can we edit?
     if (Config::GetSetting('MODULE_CONFIG_LOCKED_CHECKB') == 'Checked') {
         trigger_error(__('Module Config Locked'), E_USER_ERROR);
     }
     $moduleId = Kit::GetParam('ModuleID', _GET, _INT);
     // Pull the currently known info from the DB
     $SQL = '';
     $SQL .= 'SELECT ModuleID, ';
     $SQL .= '   Module, ';
     $SQL .= '   Name, ';
     $SQL .= '   Enabled, ';
     $SQL .= '   Description, ';
     $SQL .= '   RegionSpecific, ';
     $SQL .= '   ValidExtensions, ';
     $SQL .= '   ImageUri, ';
     $SQL .= '   PreviewEnabled ';
     $SQL .= '  FROM `module` ';
     $SQL .= ' WHERE ModuleID = %d ';
     $SQL = sprintf($SQL, $moduleId);
     if (!($row = $db->GetSingleRow($SQL))) {
         trigger_error($db->error());
         trigger_error(__('Error getting Module'));
     }
     $type = Kit::ValidateParam($row['Module'], _WORD);
     // Set some information about the form
     Theme::Set('form_id', 'ModuleEditForm');
     Theme::Set('form_action', 'index.php?p=module&q=Edit');
     Theme::Set('form_meta', '<input type="hidden" name="ModuleID" value="' . $moduleId . '" /><input type="hidden" name="type" value="' . $type . '" />');
     $formFields = array();
     $formFields[] = FormManager::AddText('ValidExtensions', __('Valid Extensions'), Kit::ValidateParam($row['ValidExtensions'], _STRING), __('The Extensions allowed on files uploaded using this module. Comma Separated.'), 'e', '');
     $formFields[] = FormManager::AddText('ImageUri', __('Image Uri'), Kit::ValidateParam($row['ImageUri'], _STRING), __('The Image to display for this module. This should be a path relative to the root of the installation.'), 'i', '');
     $formFields[] = FormManager::AddCheckbox('PreviewEnabled', __('Preview Enabled?'), Kit::ValidateParam($row['PreviewEnabled'], _INT), __('When PreviewEnabled users will be able to see a preview in the layout designer'), 'p');
     $formFields[] = FormManager::AddCheckbox('Enabled', __('Enabled?'), Kit::ValidateParam($row['Enabled'], _INT), __('When Enabled users will be able to add media using this module'), 'b');
     // Set any module specific form fields
     $module = ModuleFactory::create($type, $this->db, $this->user);
     // Merge in the fields from the settings
     foreach ($module->ModuleSettingsForm() as $field) {
         $formFields[] = $field;
     }
     Theme::Set('form_fields', $formFields);
     $response->SetFormRequestResponse(NULL, __('Edit Module'), '350px', '325px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . $helpManager->Link('Module', 'Edit') . '")');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Save'), '$("#ModuleEditForm").submit()');
     $response->Respond();
 }
Пример #22
0
 /**
  * Return the Edit Form as HTML
  * @return 
  */
 public function EditForm()
 {
     $this->response = new ResponseManager();
     $db =& $this->db;
     $layoutid = $this->layoutid;
     $regionid = $this->regionid;
     $mediaid = $this->mediaid;
     // Permissions
     if (!$this->auth->edit) {
         $this->response->SetError('You do not have permission to edit this assignment.');
         $this->response->keepOpen = true;
         return $this->response;
     }
     // Augment settings with templates
     $this->loadTemplates();
     Theme::Set('form_id', 'ModuleForm');
     Theme::Set('form_action', 'index.php?p=module&mod=' . $this->type . '&q=Exec&method=EditMedia');
     Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutid . '"><input type="hidden" id="iRegionId" name="regionid" value="' . $regionid . '"><input type="hidden" name="showRegionOptions" value="' . $this->showRegionOptions . '" /><input type="hidden" id="mediaid" name="mediaid" value="' . $mediaid . '">');
     $formFields = array();
     // What is the source for this ticker?
     $sourceId = $this->GetOption('sourceId');
     $dataSetId = $this->GetOption('datasetid');
     $tabs = array();
     $tabs[] = FormManager::AddTab('general', __('General'));
     $tabs[] = FormManager::AddTab('template', __('Appearance'), array(array('name' => 'enlarge', 'value' => true)));
     $tabs[] = FormManager::AddTab('format', __('Format'));
     $tabs[] = FormManager::AddTab('advanced', __('Advanced'));
     Theme::Set('form_tabs', $tabs);
     $field_name = FormManager::AddText('name', __('Name'), $this->GetOption('name'), __('An optional name for this media'), 'n');
     $field_duration = FormManager::AddNumber('duration', __('Duration'), $this->duration, __('The duration in seconds this item should be displayed'), 'd', 'required', '', $this->auth->modifyPermissions);
     // Common fields
     $oldDirection = $this->GetOption('direction');
     if ($oldDirection == 'single') {
         $oldDirection = 'fade';
     } else {
         if ($oldDirection != 'none') {
             $oldDirection = 'marquee' . ucfirst($oldDirection);
         }
     }
     $fieldFx = FormManager::AddCombo('effect', __('Effect'), $this->GetOption('effect', $oldDirection), array(array('effectid' => 'none', 'effect' => __('None')), array('effectid' => 'fade', 'effect' => __('Fade')), array('effectid' => 'fadeout', 'effect' => __('Fade Out')), array('effectid' => 'scrollHorz', 'effect' => __('Scroll Horizontal')), array('effectid' => 'scrollVert', 'effect' => __('Scroll Vertical')), array('effectid' => 'flipHorz', 'effect' => __('Flip Horizontal')), array('effectid' => 'flipVert', 'effect' => __('Flip Vertical')), array('effectid' => 'shuffle', 'effect' => __('Shuffle')), array('effectid' => 'tileSlide', 'effect' => __('Tile Slide')), array('effectid' => 'tileBlind', 'effect' => __('Tile Blinds')), array('effectid' => 'marqueeLeft', 'effect' => __('Marquee Left')), array('effectid' => 'marqueeRight', 'effect' => __('Marquee Right')), array('effectid' => 'marqueeUp', 'effect' => __('Marquee Up')), array('effectid' => 'marqueeDown', 'effect' => __('Marquee Down'))), 'effectid', 'effect', __('Please select the effect that will be used to transition between items. If all items should be output, select None. Marquee effects are CPU intensive and may not be suitable for lower power displays.'), 'e');
     $fieldScrollSpeed = FormManager::AddNumber('speed', __('Speed'), $this->GetOption('speed', $this->GetOption('scrollSpeed')), __('The transition speed of the selected effect in milliseconds (normal = 1000) or the Marquee Speed in a low to high scale (normal = 1).'), 's', NULL, 'effect-controls');
     $fieldBackgroundColor = FormManager::AddText('backgroundColor', __('Background Colour'), $this->GetOption('backgroundColor'), __('The selected effect works best with a background colour. Optionally add one here.'), 'c', NULL, 'background-color-group');
     $field_itemsPerPage = FormManager::AddNumber('itemsPerPage', __('Items per page'), $this->GetOption('itemsPerPage'), __('When in single mode how many items per page should be shown.'), 'p');
     $field_updateInterval = FormManager::AddNumber('updateInterval', __('Update Interval (mins)'), $this->GetOption('updateInterval', 5), __('Please enter the update interval in minutes. This should be kept as high as possible. For example, if the data will only change once per hour this could be set to 60.'), 'n', 'required');
     $field_durationIsPerItem = FormManager::AddCheckbox('durationIsPerItem', __('Duration is per item'), $this->GetOption('durationIsPerItem'), __('The duration specified is per item otherwise it is per feed.'), 'i');
     $field_itemsSideBySide = FormManager::AddCheckbox('itemsSideBySide', __('Show items side by side?'), $this->GetOption('itemsSideBySide'), __('Should items be shown side by side?'), 's');
     // Data Set Source
     if ($sourceId == 2) {
         $formFields['general'][] = $field_name;
         $formFields['general'][] = $field_duration;
         $formFields['general'][] = $fieldFx;
         $formFields['general'][] = $fieldScrollSpeed;
         $formFields['advanced'][] = $fieldBackgroundColor;
         $formFields['advanced'][] = $field_durationIsPerItem;
         $formFields['advanced'][] = $field_updateInterval;
         // Extra Fields for the DataSet
         $formFields['general'][] = FormManager::AddText('ordering', __('Order'), $this->GetOption('ordering'), __('Please enter a SQL clause for how this dataset should be ordered'), 'o');
         $formFields['general'][] = FormManager::AddText('filter', __('Filter'), $this->GetOption('filter'), __('Please enter a SQL clause to filter this DataSet.'), 'f');
         $formFields['advanced'][] = FormManager::AddNumber('lowerLimit', __('Lower Row Limit'), $this->GetOption('lowerLimit'), __('Please enter the Lower Row Limit for this DataSet (enter 0 for no limit)'), 'l');
         $formFields['advanced'][] = FormManager::AddNumber('upperLimit', __('Upper Row Limit'), $this->GetOption('upperLimit'), __('Please enter the Upper Row Limit for this DataSet (enter 0 for no limit)'), 'u');
         $formFields['format'][] = $field_itemsPerPage;
         $formFields['format'][] = $field_itemsSideBySide;
         Theme::Set('columns', $db->GetArray(sprintf("SELECT DataSetColumnID, Heading FROM datasetcolumn WHERE DataSetID = %d ", $dataSetId)));
         $formFields['template'][] = FormManager::AddRaw(Theme::RenderReturn('media_form_ticker_dataset_edit'));
     } else {
         // Extra Fields for the Ticker
         $formFields['general'][] = FormManager::AddText('uri', __('Feed URL'), urldecode($this->GetOption('uri')), __('The Link for the RSS feed'), 'f');
         $formFields['general'][] = $field_name;
         $formFields['general'][] = $field_duration;
         $formFields['general'][] = $fieldFx;
         $formFields['format'][] = $fieldScrollSpeed;
         // Add a field for RTL tickers
         $formFields['format'][] = FormManager::AddCombo('textDirection', __('Text direction'), $this->GetOption('textDirection'), array(array('textdirectionid' => 'ltr', 'textdirection' => __('Left to Right (LTR)')), array('textdirectionid' => 'rtl', 'textdirection' => __('Right to Left (RTL)'))), 'textdirectionid', 'textdirection', __('Which direction does the text in the feed use? (left to right or right to left)'), 'd');
         $formFields['advanced'][] = $fieldBackgroundColor;
         $formFields['format'][] = FormManager::AddNumber('numItems', __('Number of Items'), $this->GetOption('numItems'), __('The Number of RSS items you want to display'), 'o');
         $formFields['format'][] = $field_itemsPerPage;
         $formFields['advanced'][] = FormManager::AddText('copyright', __('Copyright'), $this->GetOption('copyright'), __('Copyright information to display as the last item in this feed. This can be styled with the #copyright CSS selector.'), 'f');
         $formFields['advanced'][] = $field_updateInterval;
         $formFields['format'][] = FormManager::AddCombo('takeItemsFrom', __('Take items from the '), $this->GetOption('takeItemsFrom'), array(array('takeitemsfromid' => 'start', 'takeitemsfrom' => __('Start of the Feed')), array('takeitemsfromid' => 'end', 'takeitemsfrom' => __('End of the Feed'))), 'takeitemsfromid', 'takeitemsfrom', __('Take the items from the beginning or the end of the list'), 't');
         $formFields['format'][] = $field_durationIsPerItem;
         $formFields['advanced'][] = $field_itemsSideBySide;
         $formFields['advanced'][] = FormManager::AddText('dateFormat', __('Date Format'), $this->GetOption('dateFormat'), __('The format to apply to all dates returned by the ticker. In PHP date format: http://uk3.php.net/manual/en/function.date.php'), 'f');
         $subs = array(array('Substitute' => 'Name'), array('Substitute' => 'Title'), array('Substitute' => 'Description'), array('Substitute' => 'Date'), array('Substitute' => 'Content'), array('Substitute' => 'Copyright'), array('Substitute' => 'Link'), array('Substitute' => 'PermaLink'), array('Substitute' => 'Tag|Namespace'));
         Theme::Set('substitutions', $subs);
         $formFieldSubs = FormManager::AddRaw(Theme::RenderReturn('media_form_ticker_edit'));
         $formFields['advanced'][] = FormManager::AddText('allowedAttributes', __('Allowable Attributes'), $this->GetOption('allowedAttributes'), __('A comma separated list of attributes that should not be stripped from the incoming feed.'), '');
         $formFields['advanced'][] = FormManager::AddText('stripTags', __('Strip Tags'), $this->GetOption('stripTags'), __('A comma separated list of HTML tags that should be stripped from the feed in addition to the default ones.'), '');
         $formFields['advanced'][] = FormManager::AddCheckbox('disableDateSort', __('Disable Date Sort'), $this->GetOption('disableDateSort'), __('Should the date sort applied to the feed be disabled?'), '');
         // Encode up the template
         //$formFields['advanced'][] = FormManager::AddMessage('<pre>' . htmlentities(json_encode(array('id' => 'media-rss-with-title', 'value' => 'Image overlaid with the Title', 'template' => '<div class="image">[Link|image]<div class="cycle-overlay"><p style="font-family: Arial, Verdana, sans-serif; font-size:48px;">[Title]</p></div></div>', 'css' => '.image img { width:100%;}.cycle-overlay {color: white;background: black;opacity: .6;filter: alpha(opacity=60);position: absolute;bottom: 0;width: 100%;padding: 15px;text-align:center;}'))) . '</pre>');
     }
     // Get the CSS node
     $formFields['template'][] = FormManager::AddMultiText('ta_css', NULL, $this->GetRawNode('css'), __('Optional Style sheet'), 's', 10, NULL, 'template-override-controls');
     // Get the Text Node out of this
     $formFields['template'][] = FormManager::AddMultiText('ta_text', NULL, $this->GetRawNode('template'), __('Enter the template. Please note that the background colour has automatically coloured to your layout background colour.'), 't', 10, NULL, 'template-override-controls');
     // RSS
     if ($this->GetOption('sourceId') == 1) {
         // Append the templates to the response
         $this->response->extra = $this->settings['templates'];
         $formFields['template'][] = $formFieldSubs;
         // Add a field for whether to override the template or not.
         // Default to 1 so that it will work correctly with old items (that didn't have a template selected at all)
         $formFields['template'][] = FormManager::AddCheckbox('overrideTemplate', __('Override the template?'), $this->GetOption('overrideTemplate', 1), __('Tick if you would like to override the template.'), 'o');
         // Template - for standard stuff
         $formFields['template'][] = FormManager::AddCombo('templateId', __('Template'), $this->GetOption('templateId', 'title-only'), $this->settings['templates'], 'id', 'value', __('Select the template you would like to apply. This can be overridden using the check box below.'), 't', 'template-selector-control');
         // Add some field dependencies
         // When the override template check box is ticked, we want to expose the advanced controls and we want to hide the template selector
         $this->response->AddFieldAction('overrideTemplate', 'init', false, array('.template-override-controls' => array('display' => 'none'), '.template-selector-control' => array('display' => 'block')), 'is:checked');
         $this->response->AddFieldAction('overrideTemplate', 'change', false, array('.template-override-controls' => array('display' => 'none'), '.template-selector-control' => array('display' => 'block')), 'is:checked');
         $this->response->AddFieldAction('overrideTemplate', 'init', true, array('.template-override-controls' => array('display' => 'block'), '.template-selector-control' => array('display' => 'none')), 'is:checked');
         $this->response->AddFieldAction('overrideTemplate', 'change', true, array('.template-override-controls' => array('display' => 'block'), '.template-selector-control' => array('display' => 'none')), 'is:checked');
     }
     Theme::Set('form_fields_general', $formFields['general']);
     Theme::Set('form_fields_template', array_reverse($formFields['template']));
     Theme::Set('form_fields_format', $formFields['format']);
     Theme::Set('form_fields_advanced', $formFields['advanced']);
     // Generate the Response
     $this->response->html = Theme::RenderReturn('form_render');
     $this->response->callBack = 'text_callback';
     $this->response->dialogTitle = __('Edit Ticker');
     if ($this->showRegionOptions) {
         $this->response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $layoutid . '&regionid=' . $regionid . '&q=RegionOptions")');
     } else {
         $this->response->AddButton(__('Cancel'), 'XiboDialogClose()');
     }
     $this->response->AddButton(__('Apply'), 'XiboDialogApply("#ModuleForm")');
     $this->response->AddButton(__('Save'), '$("#ModuleForm").submit()');
     return $this->response;
 }
Пример #23
0
 public function Step6()
 {
     // Form to collect the library location and server key
     $formFields = array();
     $formFields[] = FormManager::AddHidden('step', 7);
     $formFields[] = FormManager::AddText('library_location', __('Library Location'), NULL, sprintf(__('%s needs somewhere to store the things you upload to be shown. Ideally, this should be somewhere outside the root of your web server - that is such that is not accessible by a web browser. Please input the full path to this folder. If the folder does not already exist, we will attempt to create it for you.'), Theme::GetConfig('app_name')), 'n');
     $formFields[] = FormManager::AddText('server_key', __('Server Key'), Install::gen_secret(6), sprintf(__('%s needs you to choose a "key". This will be required each time you set-up a new client. It should be complicated, and hard to remember. It is visible in the CMS interface, so it need not be written down separately.'), Theme::GetConfig('app_name')), 'n');
     $formFields[] = FormManager::AddCheckbox('stats', __('Statistics'), 1, sprintf(__('We\'d love to know you\'re running %s. If you\'re happy for us to collect anonymous statistics (version number, number of displays) then please leave the box ticked. Please un tick the box if your server does not have direct access to the internet.'), Theme::GetConfig('app_name')), 'n');
     // Put up an error message if one has been set (and then unset it)
     if ($this->errorMessage != '') {
         Theme::Set('message', $this->errorMessage);
         Theme::Set('prepend', Theme::RenderReturn('message_box'));
         $this->errorMessage == '';
     }
     // Return a rendered form
     Theme::Set('form_action', 'install.php');
     Theme::Set('form_fields', $formFields);
     Theme::Set('form_buttons', array(FormManager::AddButton(__('Next'))));
     return Theme::RenderReturn('form_render');
 }
Пример #24
0
 /**
  * Return the Edit Form as HTML
  * @return ResponseManager
  */
 public function EditForm()
 {
     $this->response = new ResponseManager();
     $layoutid = $this->layoutid;
     $regionid = $this->regionid;
     $mediaid = $this->mediaid;
     // Can this user edit?
     if (!$this->auth->edit) {
         $this->response->SetError('You do not have permission to edit this media.');
         $this->response->keepOpen = false;
         return $this->response;
     }
     Theme::Set('form_id', 'ModuleForm');
     Theme::Set('form_action', 'index.php?p=module&mod=' . $this->type . '&q=Exec&method=EditMedia');
     Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutid . '"><input type="hidden" id="iRegionId" name="regionid" value="' . $regionid . '"><input type="hidden" name="showRegionOptions" value="' . $this->showRegionOptions . '" /><input type="hidden" id="mediaid" name="mediaid" value="' . $mediaid . '">');
     // Get the embedded HTML out of RAW
     $rawXml = new DOMDocument();
     $rawXml->loadXML($this->GetRaw());
     //Debug::LogEntry('audit', 'Raw XML returned: ' . $this->GetRaw());
     $formFields = array();
     $formFields[] = FormManager::AddText('name', __('Name'), $this->GetOption('name'), __('An optional name for this media'), 'n');
     $formFields[] = FormManager::AddNumber('duration', __('Duration'), $this->duration, __('The duration in seconds this item should be displayed'), 'd', 'required', '', $this->auth->modifyPermissions);
     $formFields[] = FormManager::AddCheckbox('transparency', __('Background transparent?'), $this->GetOption('transparency'), __('Should the HTML be shown with a transparent background. Not current available on the Windows Display Client.'), 't');
     $formFields[] = FormManager::AddCheckbox('scaleContent', __('Scale Content?'), $this->GetOption('scaleContent'), __('Should the embedded content be scaled along with the layout?'), 's');
     $formFields[] = FormManager::AddMultiText('embedHtml', NULL, $this->GetRawNode('embedHtml'), __('HTML to Embed'), 'h', 10);
     $formFields[] = FormManager::AddMultiText('embedStyle', NULL, $this->GetRawNode('embedStyle'), __('Custom Style Sheets'), 'h', 10);
     $formFields[] = FormManager::AddMultiText('embedScript', NULL, $this->GetRawNode('embedScript'), __('HEAD content to Embed (including script tags)'), 'h', 10);
     Theme::Set('form_fields', $formFields);
     if ($this->showRegionOptions) {
         $this->response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $layoutid . '&regionid=' . $regionid . '&q=RegionOptions")');
     } else {
         $this->response->AddButton(__('Cancel'), 'XiboDialogClose()');
     }
     $this->response->html = Theme::RenderReturn('form_render');
     $this->response->dialogTitle = __('Edit Embedded HTML');
     $this->response->dialogSize = true;
     $this->response->dialogWidth = '650px';
     $this->response->dialogHeight = '450px';
     $this->response->AddButton(__('Apply'), 'XiboDialogApply("#ModuleForm")');
     $this->response->AddButton(__('Save'), '$("#ModuleForm").submit()');
     return $this->response;
 }
Пример #25
0
 /**
  * Return the Edit Form as HTML
  * @return
  */
 public function EditForm()
 {
     $this->response = new ResponseManager();
     $db =& $this->db;
     $user =& $this->user;
     $layoutid = $this->layoutid;
     $regionid = $this->regionid;
     $mediaid = $this->mediaid;
     // Permissions
     if (!$this->auth->edit) {
         $this->response->SetError('You do not have permission to edit this assignment.');
         $this->response->keepOpen = true;
         return $this->response;
     }
     Theme::Set('form_id', 'ModuleForm');
     Theme::Set('form_action', 'index.php?p=module&mod=' . $this->type . '&q=Exec&method=EditMedia');
     Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutid . '"><input type="hidden" id="iRegionId" name="regionid" value="' . $regionid . '"><input type="hidden" name="showRegionOptions" value="' . $this->showRegionOptions . '" /><input type="hidden" id="mediaid" name="mediaid" value="' . $mediaid . '">');
     // Two tabs
     $tabs = array();
     $tabs[] = FormManager::AddTab('general', __('General'), array(array('name' => 'enlarge', 'value' => true)));
     $tabs[] = FormManager::AddTab('options', __('Options'));
     Theme::Set('form_tabs', $tabs);
     $formFields = array();
     // Handle older layouts that have a direction node but no effect node
     $oldDirection = $this->GetOption('direction', 'none');
     if ($oldDirection != 'none') {
         $oldDirection = 'marquee' . ucfirst($oldDirection);
     }
     $formFields['options'][] = FormManager::AddText('name', __('Name'), $this->GetOption('name'), __('An optional name for this media'), 'n');
     $formFields['options'][] = FormManager::AddCombo('effect', __('Effect'), $this->GetOption('effect', $oldDirection), array(array('effectid' => 'none', 'effect' => __('None')), array('effectid' => 'fade', 'effect' => __('Fade')), array('effectid' => 'fadeout', 'effect' => __('Fade Out')), array('effectid' => 'scrollHorz', 'effect' => __('Scroll Horizontal')), array('effectid' => 'scrollVert', 'effect' => __('Scroll Vertical')), array('effectid' => 'flipHorz', 'effect' => __('Flip Horizontal')), array('effectid' => 'flipVert', 'effect' => __('Flip Vertical')), array('effectid' => 'shuffle', 'effect' => __('Shuffle')), array('effectid' => 'tileSlide', 'effect' => __('Tile Slide')), array('effectid' => 'tileBlind', 'effect' => __('Tile Blinds')), array('effectid' => 'marqueeLeft', 'effect' => __('Marquee Left')), array('effectid' => 'marqueeRight', 'effect' => __('Marquee Right')), array('effectid' => 'marqueeUp', 'effect' => __('Marquee Up')), array('effectid' => 'marqueeDown', 'effect' => __('Marquee Down'))), 'effectid', 'effect', __('Please select the effect that will be used to transition between items. If all items should be output, select None. Marquee effects are CPU intensive and may not be suitable for lower power displays.'), 'e');
     $formFields['options'][] = FormManager::AddNumber('speed', __('Speed'), $this->GetOption('speed'), __('The transition speed of the selected effect in milliseconds (normal = 1000) or the Marquee Speed in a low to high scale (normal = 1).'), 's', NULL, 'effect-controls');
     // A list of web safe colours
     $formFields['options'][] = FormManager::AddText('backgroundColor', __('Background Colour'), $this->GetOption('backgroundColor'), __('The selected effect works best with a background colour. Optionally add one here.'), 'c', NULL, 'effect-controls');
     $formFields['options'][] = FormManager::AddNumber('duration', __('Duration'), $this->duration, __('The duration in seconds this counter should be displayed'), 'd', 'required', '', $this->auth->modifyPermissions);
     // Handle the substitutions as RAW items
     $subs = array(array('Substitute' => 'Clock'), array('Substitute' => 'Clock|HH:mm'), array('Substitute' => 'Date'), array('Substitute' => 'Clock|DD/MM/YYYY'));
     Theme::Set('substitutions', $subs);
     // Get the text out of RAW
     $rawXml = new DOMDocument();
     $rawXml->loadXML($this->GetRaw());
     // Get the Text Node out of this
     $textNodes = $rawXml->getElementsByTagName('text');
     $textNode = $textNodes->item(0);
     $formFields['general'][] = FormManager::AddMultiText('ta_text', NULL, $textNode->nodeValue, __('Enter the text to display. Please note that the background colour has automatically coloured to your layout background colour.'), 't', 10);
     $formFields['general'][] = FormManager::AddRaw(Theme::RenderReturn('media_form_text_edit'));
     Theme::Set('form_fields_general', $formFields['general']);
     Theme::Set('form_fields_options', $formFields['options']);
     // Add a dependency
     $this->response->AddFieldAction('effect', 'init', 'none', array('.effect-controls' => array('display' => 'none')));
     $this->response->AddFieldAction('effect', 'change', 'none', array('.effect-controls' => array('display' => 'none')));
     $this->response->AddFieldAction('effect', 'init', 'none', array('.effect-controls' => array('display' => 'block')), 'not');
     $this->response->AddFieldAction('effect', 'change', 'none', array('.effect-controls' => array('display' => 'block')), 'not');
     $this->response->html = Theme::RenderReturn('form_render');
     $this->response->callBack = 'text_callback';
     $this->response->dialogSize = 'large';
     $this->response->dialogTitle = __('Edit Text');
     if ($this->showRegionOptions) {
         $this->response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $layoutid . '&regionid=' . $regionid . '&q=RegionOptions")');
     } else {
         $this->response->AddButton(__('Cancel'), 'XiboDialogClose()');
     }
     $this->response->AddButton(__('Apply'), 'XiboDialogApply("#ModuleForm")');
     $this->response->AddButton(__('Save'), '$("#ModuleForm").submit()');
     return $this->response;
 }
Пример #26
0
 /**
  * Form to register a new application.
  */
 public function RegisterForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     Theme::Set('form_id', 'RegisterOAuth');
     Theme::Set('form_action', 'index.php?p=oauth&q=Register');
     $formFields = array();
     $formFields[] = FormManager::AddText('requester_name', __('Full Name'), NULL, __('The name of the person or organization that authored this application.'), 'n', 'required');
     $formFields[] = FormManager::AddEmail('requester_email', __('Email Address'), NULL, __('The email address of the person or organization that authored this application.'), 'e', 'required');
     $formFields[] = FormManager::AddText('application_uri', __('Application Homepage'), NULL, __('The URL of your application homepage'), 'h', '');
     $formFields[] = FormManager::AddText('callback_uri', __('Application Homepage'), NULL, __('The call back URL for requests'), 'c', '');
     Theme::Set('form_fields', $formFields);
     $response->SetFormRequestResponse(NULL, __('Registration for Consumer Information'), '550px', '475px');
     $response->AddButton(__('Help'), "XiboHelpRender('index.php?p=help&q=Display&Topic=Services&Category=Register')");
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Register'), '$("#RegisterOAuth").submit()');
     $response->Respond();
 }
Пример #27
0
 /**
  * Modify Display form
  */
 function displayForm()
 {
     $response = new ResponseManager();
     // Get the display Id
     $displayObject = new Display();
     $displayObject->displayId = Kit::GetParam('displayid', _GET, _INT);
     $auth = $this->user->DisplayGroupAuth($this->GetDisplayGroupId($displayObject->displayId), true);
     if (!$auth->edit) {
         trigger_error(__('You do not have permission to edit this display'), E_USER_ERROR);
     }
     // Load this display
     if (!$displayObject->Load()) {
         trigger_error($displayObject->GetErrorMessage(), E_USER_ERROR);
     }
     // Set some information about the form
     Theme::Set('form_id', 'DisplayEditForm');
     Theme::Set('form_action', 'index.php?p=display&q=modify');
     Theme::Set('form_meta', '<input type="hidden" name="displayid" value="' . $displayObject->displayId . '" />');
     // Column 1
     $formFields = array();
     $formFields[] = FormManager::AddText('display', __('Display'), $displayObject->display, __('The Name of the Display - (1 - 50 characters).'), 'd', 'required');
     $formFields[] = FormManager::AddText('hardwareKey', __('Display\'s Hardware Key'), $displayObject->license, __('A unique identifier for this display.'), 'h', 'required', NULL, false);
     $formFields[] = FormManager::AddText('description', __('Description'), $displayObject->description, __('A description - (1 - 254 characters).'), 'p', 'maxlength="50"');
     $formFields[] = FormManager::AddCombo('licensed', __('Licence Display?'), $displayObject->licensed, array(array('licensedid' => '1', 'licensed' => 'Yes'), array('licensedid' => '0', 'licensed' => 'No')), 'licensedid', 'licensed', __('Use one of the available licenses for this display?'), 'l');
     $formFields[] = FormManager::AddCombo('defaultlayoutid', __('Default Layout'), $displayObject->defaultLayoutId, $this->user->LayoutList(), 'layoutid', 'layout', __('The Default Layout to Display where there is no other content.'), 't');
     Theme::Set('form_fields_general', $formFields);
     // Maintenance
     $formFields = array();
     $formFields[] = FormManager::AddCombo('email_alert', __('Email Alerts'), $displayObject->emailAlert, array(array('id' => '1', 'value' => 'Yes'), array('id' => '0', 'value' => 'No')), 'id', 'value', __('Do you want to be notified by email if there is a problem with this display?'), 'a');
     $formFields[] = FormManager::AddCheckbox('alert_timeout', __('Use the Global Timeout?'), $displayObject->alertTimeout, __('Should this display be tested against the global time out or the client collection interval?'), 'o');
     Theme::Set('form_fields_maintenance', $formFields);
     // Location
     $formFields = array();
     $formFields[] = FormManager::AddNumber('latitude', __('Latitude'), $displayObject->latitude, __('The Latitude of this display'), 'g');
     $formFields[] = FormManager::AddNumber('longitude', __('Longitude'), $displayObject->longitude, __('The Longitude of this Display'), 'g');
     Theme::Set('form_fields_location', $formFields);
     // Wake on LAN
     $formFields = array();
     $formFields[] = FormManager::AddCheckbox('wakeOnLanEnabled', __('Enable Wake on LAN'), $displayObject->wakeOnLanEnabled, __('Wake on Lan requires the correct network configuration to route the magic packet to the display PC'), 'w');
     $formFields[] = FormManager::AddText('broadCastAddress', __('BroadCast Address'), $displayObject->broadCastAddress == '' ? $displayObject->clientAddress : $displayObject->broadCastAddress, __('The IP address of the remote host\'s broadcast address (or gateway)'), 'b');
     $formFields[] = FormManager::AddText('secureOn', __('Wake on LAN SecureOn'), $displayObject->secureOn, __('Enter a hexadecimal password of a SecureOn enabled Network Interface Card (NIC) of the remote host. Enter a value in this pattern: \'xx-xx-xx-xx-xx-xx\'. Leave the following field empty, if SecureOn is not used (for example, because the NIC of the remote host does not support SecureOn).'), 's');
     $formFields[] = FormManager::AddText('wakeOnLanTime', __('Wake on LAN Time'), $displayObject->wakeOnLanTime, __('The time this display should receive the WOL command, using the 24hr clock - e.g. 19:00. Maintenance must be enabled.'), 't');
     $formFields[] = FormManager::AddText('cidr', __('Wake on LAN CIDR'), $displayObject->cidr, __('Enter a number within the range of 0 to 32 in the following field. Leave the following field empty, if no subnet mask should be used (CIDR = 0). If the remote host\'s broadcast address is unknown: Enter the host name or IP address of the remote host in Broad Cast Address and enter the CIDR subnet mask of the remote host in this field.'), 'c');
     Theme::Set('form_fields_wol', $formFields);
     // Advanced
     $formFields = array();
     $displayProfileList = $this->user->DisplayProfileList(NULL, array('type' => $displayObject->clientType));
     array_unshift($displayProfileList, array('displayprofileid' => 0, 'name' => ''));
     $formFields[] = FormManager::AddCombo('displayprofileid', __('Settings Profile?'), $displayObject->displayProfileId, $displayProfileList, 'displayprofileid', 'name', __('What display profile should this display use?'), 'p');
     $formFields[] = FormManager::AddCombo('inc_schedule', __('Interleave Default'), $displayObject->incSchedule, array(array('id' => '1', 'value' => 'Yes'), array('id' => '0', 'value' => 'No')), 'id', 'value', __('Whether to always put the default layout into the cycle.'), 'i');
     $formFields[] = FormManager::AddCombo('auditing', __('Auditing'), $displayObject->isAuditing, array(array('id' => '1', 'value' => 'Yes'), array('id' => '0', 'value' => 'No')), 'id', 'value', __('Collect auditing from this client. Should only be used if there is a problem with the display.'), 'a');
     // Show the resolved settings for this display.
     $formFields[] = FormManager::AddMessage(__('The settings for this display are shown below. They are taken from the active Display Profile for this Display, which can be changed in Display Settings. If you have altered the Settings Profile above, you will need to save and re-show the form.'));
     // Build a table for the settings to be shown in
     $cols = array(array('name' => 'title', 'title' => __('Setting')), array('name' => 'valueString', 'title' => __('Value')));
     // Get the settings from the profile
     $profile = $displayObject->getSettingsProfile();
     // Go through each one, and see if it is a drop down
     for ($i = 0; $i < count($profile); $i++) {
         // Always update the value string with the source value
         $profile[$i]['valueString'] = $profile[$i]['value'];
         // Overwrite the value string when we are dealing with dropdowns
         if ($profile[$i]['fieldType'] == 'dropdown') {
             // Update our value
             foreach ($profile[$i]['options'] as $option) {
                 if ($option['id'] == $profile[$i]['value']) {
                     $profile[$i]['valueString'] = $option['value'];
                 }
             }
         } else {
             if ($profile[$i]['fieldType'] == 'timePicker') {
                 $profile[$i]['valueString'] = DateManager::getLocalDate($profile[$i]['value'] / 1000, 'H:i');
             }
         }
     }
     Theme::Set('table_cols', $cols);
     Theme::Set('table_rows', $profile);
     $formFields[] = FormManager::AddRaw(Theme::RenderReturn('table_render'));
     Theme::Set('form_fields_advanced', $formFields);
     // Two tabs
     $tabs = array();
     $tabs[] = FormManager::AddTab('general', __('General'));
     $tabs[] = FormManager::AddTab('location', __('Location'));
     $tabs[] = FormManager::AddTab('maintenance', __('Maintenance'));
     $tabs[] = FormManager::AddTab('wol', __('Wake on LAN'));
     $tabs[] = FormManager::AddTab('advanced', __('Advanced'));
     Theme::Set('form_tabs', $tabs);
     $response->SetFormRequestResponse(NULL, __('Edit a Display'), '650px', '350px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Display', 'Edit') . '")');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Save'), '$("#DisplayEditForm").submit()');
     $response->Respond();
 }
Пример #28
0
 /**
  * Return the Edit Form as HTML
  * @return
  */
 public function EditForm()
 {
     $this->response = new ResponseManager();
     // Edit calls are the same as add calls, except you will to check the user has permissions to do the edit
     if (!$this->auth->edit) {
         $this->response->SetError('You do not have permission to edit this assignment.');
         $this->response->keepOpen = false;
         return $this->response;
     }
     // All forms should set some meta data about the form.
     // Usually, you would want this meta data to remain the same.
     Theme::Set('form_id', 'ModuleForm');
     Theme::Set('form_action', 'index.php?p=module&mod=' . $this->type . '&q=Exec&method=EditMedia');
     Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $this->layoutid . '"><input type="hidden" id="iRegionId" name="regionid" value="' . $this->regionid . '"><input type="hidden" name="showRegionOptions" value="' . $this->showRegionOptions . '" /><input type="hidden" id="mediaid" name="mediaid" value="' . $this->mediaid . '">');
     // Augment settings with templates
     $this->loadTemplates();
     // Two tabs
     $tabs = array();
     $tabs[] = FormManager::AddTab('general', __('General'));
     $tabs[] = FormManager::AddTab('advanced', __('Appearance'));
     $tabs[] = FormManager::AddTab('forecast', __('Forecast'));
     Theme::Set('form_tabs', $tabs);
     $formFields['general'][] = FormManager::AddText('name', __('Name'), $this->GetOption('name'), __('An optional name for this media'), 'n');
     $formFields['general'][] = FormManager::AddNumber('duration', __('Duration'), $this->duration, __('The duration in seconds this item should be displayed.'), 'd', 'required');
     $formFields['general'][] = FormManager::AddCheckbox('useDisplayLocation', __('Use the Display Location'), $this->GetOption('useDisplayLocation'), __('Use the location configured on the display'), 'd');
     // Any values for the form fields should be added to the theme here.
     $formFields['general'][] = FormManager::AddNumber('latitude', __('Latitude'), $this->GetOption('latitude'), __('The Latitude for this weather module'), 'l', '', 'locationControls');
     $formFields['general'][] = FormManager::AddNumber('longitude', __('Longitude'), $this->GetOption('longitude'), __('The Longitude for this weather module'), 'g', '', 'locationControls');
     $formFields['advanced'][] = FormManager::AddCombo('templateId', __('Weather Template'), $this->GetOption('templateId'), $this->settings['templates'], 'id', 'value', __('Select the template you would like to apply. This can be overridden using the check box below.'), 't', 'template-selector-control');
     $formFields['advanced'][] = FormManager::AddCombo('icons', __('Icons'), $this->GetOption('icons'), $this->iconsAvailable(), 'id', 'value', __('Select the icon set you would like to use.'), 't', 'icon-controls');
     $formFields['advanced'][] = FormManager::AddNumber('size', __('Size'), $this->GetOption('size', 1), __('Set the size. Start at 1 and work up until the widget fits your region appropriately.'), 's', 'number', 'template-selector-control');
     $formFields['advanced'][] = FormManager::AddCombo('units', __('Units'), $this->GetOption('units'), $this->unitsAvailable(), 'id', 'value', __('Select the units you would like to use.'), 'u');
     $formFields['advanced'][] = FormManager::AddCombo('lang', __('Language'), $this->GetOption('lang', TranslationEngine::GetLocale(2)), $this->supportedLanguages(), 'id', 'value', __('Select the language you would like to use.'), 'l');
     $formFields['advanced'][] = FormManager::AddNumber('updateInterval', __('Update Interval (mins)'), $this->GetOption('updateInterval', 60), __('Please enter the update interval in minutes. This should be kept as high as possible. For example, if the data will only change once per hour this could be set to 60.'), 'n', 'required');
     $formFields['advanced'][] = FormManager::AddCheckbox('dayConditionsOnly', __('Only show Daytime weather conditions'), $this->GetOption('dayConditionsOnly', 1), __('Tick if you would like to only show the Daytime weather conditions.'), 'd');
     $formFields['general'][] = FormManager::AddText('color', __('Colour'), $this->GetOption('color', '000'), __('Please select a colour for the foreground text.'), 'c', 'required');
     $formFields['advanced'][] = FormManager::AddCheckbox('overrideTemplate', __('Override the template?'), $this->GetOption('overrideTemplate'), __('Tick if you would like to override the template.'), 'o');
     $formFields['advanced'][] = FormManager::AddMultiText('currentTemplate', __('Template for Current Forecast'), $this->GetRawNode('currentTemplate'), __('Enter the template for the current forecast. For a list of substitutions click "Request Forecast" below.'), 't', 10, 'required', 'template-override-controls');
     $formFields['advanced'][] = FormManager::AddMultiText('dailyTemplate', __('Template for Daily Forecast'), $this->GetRawNode('dailyTemplate'), __('Enter the template for the current forecast. Replaces [dailyForecast] in main template.'), 't', 10, NULL, 'template-override-controls');
     $formFields['advanced'][] = FormManager::AddMultiText('styleSheet', __('CSS Style Sheet'), $this->GetRawNode('styleSheet'), __('Enter a CSS style sheet to style the weather widget'), 'c', 10, 'required', 'template-override-controls');
     $formFields['forecast'][] = FormManager::AddMessage(__('Please press Request Forecast to show the current forecast and all available substitutions.'));
     // Encode up the template
     if (Config::GetSetting('SERVER_MODE') == 'Test' && $this->user->usertypeid == 1) {
         $formFields['forecast'][] = FormManager::AddMessage('<pre>' . htmlentities(json_encode(array('id' => 'ID', 'value' => 'TITLE', 'main' => $this->GetRawNode('currentTemplate'), 'daily' => $this->GetRawNode('dailyTemplate'), 'css' => $this->GetRawNode('styleSheet')))) . '</pre>');
     }
     // Configure the field dependencies
     $this->SetFieldDepencencies();
     // Append the Templates to the response
     $this->response->extra = $this->settings['templates'];
     // Modules should be rendered using the theme engine.
     Theme::Set('form_fields_general', $formFields['general']);
     Theme::Set('form_fields_advanced', $formFields['advanced']);
     Theme::Set('form_fields_forecast', $formFields['forecast']);
     $this->response->html = Theme::RenderReturn('form_render');
     $this->response->dialogTitle = __('Forecast IO');
     $this->response->callBack = 'forecastIoFormSetup';
     // The response object outputs the required JSON object to the browser
     // which is then processed by the CMS JavaScript library (xibo-cms.js).
     $this->response->AddButton(__('Request Forecast'), 'requestTab("forecast", "index.php?p=module&q=exec&mod=' . $this->type . '&method=requestTab&layoutid=' . $this->layoutid . '&regionid=' . $this->regionid . '&mediaid=' . $this->mediaid . '")');
     $this->response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $this->layoutid . '&regionid=' . $this->regionid . '&q=RegionOptions")');
     $this->response->AddButton(__('Apply'), 'XiboDialogApply("#ModuleForm")');
     $this->response->AddButton(__('Save'), '$("#ModuleForm").submit()');
     // The response must be returned.
     return $this->response;
 }
Пример #29
0
 /**
  * Displays the Library Assign form
  * @return
  */
 function LayoutAssignForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     // Input vars
     $campaignId = Kit::GetParam('CampaignID', _GET, _INT);
     $id = uniqid();
     Theme::Set('id', $id);
     Theme::Set('form_meta', '<input type="hidden" name="p" value="campaign"><input type="hidden" name="q" value="LayoutAssignView">');
     Theme::Set('pager', ResponseManager::Pager($id, 'grid_pager'));
     // Get the currently assigned layouts and put them in the "well"
     $layoutsAssigned = Layout::Entries(array('lkcl.DisplayOrder'), array('campaignId' => $campaignId));
     if (!is_array($layoutsAssigned)) {
         trigger_error($db->error());
         trigger_error(__('Error getting Layouts'), E_USER_ERROR);
     }
     Debug::LogEntry('audit', count($layoutsAssigned) . ' layouts assigned already');
     $formFields = array();
     $formFields[] = FormManager::AddText('filter_name', __('Name'), NULL, NULL, 'l');
     $formFields[] = FormManager::AddText('filter_tags', __('Tags'), NULL, NULL, 't');
     Theme::Set('form_fields', $formFields);
     // Set the layouts assigned
     Theme::Set('layouts_assigned', $layoutsAssigned);
     Theme::Set('append', Theme::RenderReturn('campaign_form_layout_assign'));
     // Call to render the template
     Theme::Set('header_text', __('Choose Layouts'));
     $output = Theme::RenderReturn('grid_render');
     // Construct the Response
     $response->html = $output;
     $response->success = true;
     $response->dialogSize = true;
     $response->dialogWidth = '780px';
     $response->dialogHeight = '580px';
     $response->dialogTitle = __('Layouts on Campaign');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Campaign', 'Layouts') . '")');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Save'), 'LayoutsSubmit("' . $campaignId . '")');
     $response->Respond();
 }
Пример #30
0
 /**
  * Output CSV Form
  */
 public function outputCsvForm()
 {
     $response = new ResponseManager();
     Theme::Set('form_id', 'OutputCsvForm');
     Theme::Set('form_action', 'index.php?p=auditlog&q=OutputCSV');
     $formFields = array();
     $formFields[] = FormManager::AddText('filterFromDt', __('From Date'), DateManager::getLocalDate(time() - 86400 * 35, 'Y-m-d'), NULL, 'f');
     $formFields[] = FormManager::AddText('filterToDt', __('To Date'), DateManager::getLocalDate(null, 'Y-m-d'), NULL, 't');
     Theme::Set('header_text', __('Audit Trail'));
     Theme::Set('form_fields', $formFields);
     Theme::Set('form_class', 'XiboManualSubmit');
     $response->SetFormRequestResponse(NULL, __('Output Audit Trail as CSV'), '550px', '275px');
     $response->AddButton(__('Export'), '$("#OutputCsvForm").submit()');
     $response->AddButton(__('Close'), 'XiboDialogClose()');
     $response->Respond();
 }