Пример #1
0
 public function tidyLibraryForm()
 {
     $response = new ResponseManager();
     Theme::Set('form_id', 'TidyLibraryForm');
     Theme::Set('form_action', 'index.php?p=content&q=tidyLibrary');
     $formFields = array();
     $formFields[] = FormManager::AddMessage(__('Tidying your Library will delete any media that is not currently in use.'));
     // Work out how many files there are
     $media = Media::entriesUnusedForUser($this->user->userid);
     $formFields[] = FormManager::AddMessage(sprintf(__('There is %s of data stored in %d files . Are you sure you want to proceed?', Kit::formatBytes(array_sum(array_map(function ($element) {
         return $element['fileSize'];
     }, $media))), count($media))));
     Theme::Set('form_fields', $formFields);
     $response->SetFormRequestResponse(NULL, __('Tidy Library'), '350px', '275px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Content', 'TidyLibrary') . '")');
     $response->AddButton(__('No'), 'XiboDialogClose()');
     $response->AddButton(__('Yes'), '$("#TidyLibraryForm").submit()');
     $response->Respond();
 }
Пример #2
0
 /**
  * Delete User form
  * @return 
  */
 function DeleteForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     $userid = Kit::GetParam('userID', _GET, _INT);
     // Set some information about the form
     Theme::Set('form_id', 'UserDeleteForm');
     Theme::Set('form_action', 'index.php?p=user&q=DeleteUser');
     Theme::Set('form_meta', '<input type="hidden" name="userid" value="' . $userid . '" />');
     $formFields = array(FormManager::AddMessage(__('Are you sure you want to delete? You may not be able to delete this user if they have associated content. You can retire users by using the Edit Button.')));
     $formFields[] = FormManager::AddCheckbox('deleteAllItems', __('Delete all items owned by this User?'), 0, __('Check to delete all items owned by this user, including Layouts, Media, Schedules, etc.'), 'd');
     Theme::Set('form_fields', $formFields);
     $response->SetFormRequestResponse(NULL, __('Delete this User?'), '430px', '200px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('User', 'Delete') . '")');
     $response->AddButton(__('No'), 'XiboDialogClose()');
     $response->AddButton(__('Yes'), '$("#UserDeleteForm").submit()');
     $response->Respond();
 }
Пример #3
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;
     }
     // Other properties
     $popupNotification = $this->GetOption('popupNotification');
     // Get the text out of RAW
     $rawXml = new DOMDocument();
     $rawXml->loadXML($this->GetRaw());
     Debug::LogEntry('audit', 'Raw XML returned: ' . $this->GetRaw());
     // Get the Text Node out of this
     $textNodes = $rawXml->getElementsByTagName('template');
     $textNode = $textNodes->item(0);
     $text = $textNode->nodeValue;
     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="mediaid" value="' . $mediaid . '"><input type="hidden" name="showRegionOptions" value="' . $this->showRegionOptions . '" />');
     $formFields = array();
     $formFields[] = FormManager::AddMessage(__('Ubuntu Client Only'));
     $formFields[] = FormManager::AddNumber('duration', __('Duration'), $this->duration, __('The duration in seconds this counter should be displayed'), 'd', 'required', '', $this->auth->modifyPermissions);
     $formFields[] = FormManager::AddCheckbox('popupNotification', __('Pop-up Notification?'), $popupNotification, __('Popup a notification when the counter changes?'), 'n');
     $formFields[] = FormManager::AddMultiText('ta_text', NULL, $text, __('Enter a format that should be applied to the counter when it is show.'), 't', 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->callBack = 'text_callback';
     $this->response->dialogTitle = __('Edit Counter');
     $this->response->AddButton(__('Save'), '$("#ModuleForm").submit()');
     return $this->response;
 }
Пример #4
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;
 }
Пример #5
0
 /**
  * Shows the Delete Group Form
  */
 function DeleteForm()
 {
     $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);
     }
     // Set some information about the form
     Theme::Set('form_id', 'DisplayProfileDeleteForm');
     Theme::Set('form_action', 'index.php?p=displayprofile&q=Delete');
     Theme::Set('form_meta', '<input type="hidden" name="displayprofileid" value="' . $displayProfile->displayProfileId . '" />');
     Theme::Set('form_fields', array(FormManager::AddMessage(__('Are you sure you want to delete?'))));
     $response = new ResponseManager();
     $response->SetFormRequestResponse(NULL, __('Delete Display Profile'), '350px', '175px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('DisplayProfile', 'Delete') . '")');
     $response->AddButton(__('No'), 'XiboDialogClose()');
     $response->AddButton(__('Yes'), '$("#DisplayProfileDeleteForm").submit()');
     $response->Respond();
 }
Пример #6
0
 public function Step4()
 {
     // Form to collect an admin user account and password.
     $formFields = array();
     $formFields[] = FormManager::AddHidden('step', 5);
     $formFields[] = FormManager::AddMessage(sprintf(__("%s needs an administrator user account to be the first user account that has access to the CMS. Please enter your chosen details below."), Theme::GetConfig('app_name')));
     // User name and password
     $formFields[] = FormManager::AddText('admin_username', __('Admin Username'), NULL, __('Please enter a user name for the first administrator account.'), 'n');
     $formFields[] = FormManager::AddPassword('admin_password', __('Admin Password'), NULL, __('Please enter a password for this user. This user will have full access to the system'), 'p');
     // 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');
 }
Пример #7
0
 /**
  * Return the Edit Form as HTML
  * @return
  */
 public function EditForm()
 {
     $formFields = array();
     $formFields[] = FormManager::AddMessage(__('Renaming a font will cause existing layouts that use the font to break. Please be cautious.'));
     return $this->EditFormForLibraryMedia($formFields);
 }
Пример #8
0
 /**
  * Delete Help Link Form
  */
 public function DeleteForm()
 {
     $db =& $this->db;
     $response = new ResponseManager();
     $helpId = Kit::GetParam('HelpID', _REQUEST, _INT);
     // Set some information about the form
     Theme::Set('form_id', 'HelpDeleteForm');
     Theme::Set('form_action', 'index.php?p=help&q=Delete');
     Theme::Set('form_meta', '<input type="hidden" name="HelpID" value="' . $helpId . '" />');
     Theme::Set('form_fields', array(FormManager::AddMessage(__('Are you sure you want to delete?'))));
     $response->SetFormRequestResponse(NULL, __('Delete Help Link'), '350px', '175px');
     $response->AddButton(__('No'), 'XiboDialogClose()');
     $response->AddButton(__('Yes'), '$("#HelpDeleteForm").submit()');
     $response->Respond();
 }
Пример #9
0
 public function TidyLibraryForm()
 {
     $response = new ResponseManager();
     Theme::Set('form_id', 'TidyLibraryForm');
     Theme::Set('form_action', 'index.php?p=admin&q=TidyLibrary');
     $formFields = array();
     $formFields[] = FormManager::AddMessage(__('Tidying the Library will delete any temporary files. Are you sure you want to proceed?'));
     // Check box to also delete un-used media that has been revised.
     $formFields[] = FormManager::AddCheckbox('tidyOldRevisions', __('Remove old revisions'), 0, __('Cleaning up old revisions of media will result in any unused media revisions being permanently deleted.'), '');
     // Check box to tidy up un-used files
     $formFields[] = FormManager::AddCheckbox('cleanUnusedFiles', __('Remove all media not currently in use?'), 0, __('Selecting this option will remove any media that is not currently being used in Layouts or linked to Displays. This process cannot be reversed.'), '');
     Theme::Set('form_fields', $formFields);
     $response->SetFormRequestResponse(NULL, __('Tidy Library'), '350px', '275px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Settings', 'TidyLibrary') . '")');
     $response->AddButton(__('No'), 'XiboDialogClose()');
     $response->AddButton(__('Yes'), '$("#TidyLibraryForm").submit()');
     $response->Respond();
 }
Пример #10
0
 public function TruncateForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     if ($this->user->usertypeid != 1) {
         trigger_error(__('Only Administrator Users can truncate the log'), E_USER_ERROR);
     }
     // Set some information about the form
     Theme::Set('form_id', 'TruncateForm');
     Theme::Set('form_action', 'index.php?p=log&q=Truncate');
     Theme::Set('form_fields', array(FormManager::AddMessage(__('Are you sure you want to truncate?'))));
     $response->SetFormRequestResponse(NULL, __('Truncate Log'), '430px', '200px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Log', 'Truncate') . '")');
     $response->AddButton(__('No'), 'XiboDialogClose()');
     $response->AddButton(__('Yes'), '$("#TruncateForm").submit()');
     $response->Respond();
 }
Пример #11
0
 public function DeleteDataSetColumnForm()
 {
     $db =& $this->db;
     $response = new ResponseManager();
     $helpManager = new HelpManager($db, $this->user);
     $dataSetId = Kit::GetParam('datasetid', _GET, _INT);
     $dataSet = Kit::GetParam('dataset', _GET, _STRING);
     $auth = $this->user->DataSetAuth($dataSetId, true);
     if (!$auth->edit) {
         trigger_error(__('Access Denied'));
     }
     $dataSetColumnId = Kit::GetParam('datasetcolumnid', _GET, _INT);
     // Set some information about the form
     Theme::Set('form_id', 'DataSetColumnDeleteForm');
     Theme::Set('form_action', 'index.php?p=dataset&q=DeleteDataSetColumn');
     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 . '" />');
     Theme::Set('form_fields', array(FormManager::AddMessage(__('Are you sure you want to delete?'))));
     $response->SetFormRequestResponse(NULL, __('Delete this Column?'), '350px', '200px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . $helpManager->Link('DataSet', 'DeleteColumn') . '")');
     $response->AddButton(__('Cancel'), 'XiboFormRender("index.php?p=dataset&q=DataSetColumnsForm&datasetid=' . $dataSetId . '&dataset=' . $dataSet . '")');
     $response->AddButton(__('Delete'), '$("#DataSetColumnDeleteForm").submit()');
     $response->Respond();
 }
Пример #12
0
 /**
  * Shows the Delete Group Form
  */
 function DeleteForm()
 {
     $db =& $this->db;
     $response = new ResponseManager();
     $displayGroupID = Kit::GetParam('DisplayGroupID', _REQUEST, _INT);
     // Auth
     $auth = $this->user->DisplayGroupAuth($displayGroupID, true);
     if (!$auth->del) {
         trigger_error(__('You do not have permission to edit this display group'), E_USER_ERROR);
     }
     // Set some information about the form
     Theme::Set('form_id', 'DisplayGroupDeleteForm');
     Theme::Set('form_action', 'index.php?p=displaygroup&q=Delete');
     Theme::Set('form_meta', '<input type="hidden" name="DisplayGroupID" value="' . $displayGroupID . '" />');
     Theme::Set('form_fields', array(FormManager::AddMessage(__('Are you sure you want to delete this display? This cannot be undone.'))));
     $response->SetFormRequestResponse(NULL, __('Delete Display Group'), '350px', '175px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('DisplayGroup', 'Delete') . '")');
     $response->AddButton(__('No'), 'XiboDialogClose()');
     $response->AddButton(__('Yes'), '$("#DisplayGroupDeleteForm").submit()');
     $response->Respond();
 }
Пример #13
0
 /**
  * Return the Delete Form as HTML
  * @return
  */
 public function DeleteRegionForm()
 {
     $db =& $this->db;
     $response = new ResponseManager();
     $helpManager = new HelpManager($db, $this->user);
     $layoutid = Kit::GetParam('layoutid', _REQUEST, _INT, 0);
     $regionid = Kit::GetParam('regionid', _REQUEST, _STRING);
     Kit::ClassLoader('region');
     $region = new region($db);
     $ownerId = $region->GetOwnerId($layoutid, $regionid);
     $regionAuth = $this->user->RegionAssignmentAuth($ownerId, $layoutid, $regionid, true);
     if (!$regionAuth->del) {
         trigger_error(__('You do not have permissions to delete this region'), E_USER_ERROR);
     }
     // Set some information about the form
     Theme::Set('form_id', 'RegionDeleteForm');
     Theme::Set('form_action', 'index.php?p=timeline&q=DeleteRegion');
     Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutid . '" /><input type="hidden" name="regionid" value="' . $regionid . '" />');
     Theme::Set('form_fields', array(FormManager::AddMessage(__('Are you sure you want to remove this region? All media files will be unassigned and any context saved to the region itself (such as Text, Tickers) will be lost permanently.'))));
     $response->SetFormRequestResponse(NULL, __('Delete this region?'), '350px', '200px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . $helpManager->Link('Region', 'Delete') . '")');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Delete'), '$("#RegionDeleteForm").submit()');
     $response->Respond();
 }
Пример #14
0
 public function Step3()
 {
     Kit::ClassLoader('install');
     set_time_limit(0);
     $fault = false;
     $fault_string = '';
     foreach ($_POST as $key => $post) {
         // $key should be like 1-2, 1-3 etc
         // Split $key on - character.
         $parts = explode('-', $key);
         if (count($parts) == 2) {
             $step_num = 'Step' . $parts[0];
             include_once 'install/database/' . $parts[0] . '.php';
             $response = $_SESSION[$step_num]->ValidateQuestion($parts[1], $post);
             if (!$response == true) {
                 // The upgrade routine for this step wasn't happy.
                 $fault = true;
                 $fault_string .= $response . "<br />\n";
             }
         }
     }
     if ($fault) {
         throw new Exception($fault_string);
     }
     $doBackup = Kit::GetParam('doBackup', $_POST, _CHECKBOX);
     if ($doBackup == 0) {
         throw new Exception(__('You MUST have a valid database backup to continue. Please take and verify a backup and upgrade again.'));
     }
     $sql_file = '';
     $sql = '';
     $i = 0;
     // Now loop over the entire upgrade. Run the SQLs and PHP interleaved.
     try {
         $dbh = PDOConnect::init();
         //$dbh->beginTransaction();
         for ($i = $_SESSION['upgradeFrom'] + 1; $i <= $_SESSION['upgradeTo']; $i++) {
             if (file_exists('install/database/' . $i . '.sql')) {
                 $delimiter = ';';
                 $sql_file = @file_get_contents('install/database/' . $i . '.sql');
                 $sql_file = Install::remove_remarks($sql_file);
                 $sql_file = Install::split_sql_file($sql_file, $delimiter);
                 foreach ($sql_file as $sql) {
                     $dbh->exec($sql);
                 }
             }
             if (file_exists('install/database/' . $i . '.php')) {
                 $stepName = 'Step' . $i;
                 if (!$_SESSION[$stepName]->Boot()) {
                     throw new Exception(__('Failed with %s', $stepName));
                 }
             }
         }
         //$dbh->commit();
     } catch (Exception $e) {
         //$dbh->rollBack();
         throw new Exception(sprintf(__('An error occurred running the upgrade. Please take a screen shot of this page and seek help. Statement number: %d. Error Message = [%s]. File = [%s]. SQL = [%s].'), $i, $e->getMessage(), $sql_file, $sql));
     }
     // Install files
     Media::installAllModuleFiles();
     // Delete install
     if (!unlink('install.php')) {
         $formFields[] = FormManager::AddMessage(__("Unable to delete install.php. Please ensure the webserver has permission to unlink this file and retry"));
     }
     $formFields[] = FormManager::AddMessage(__('The upgrade was a success!'));
     // Return a rendered form
     Theme::Set('form_fields', $formFields);
     return Theme::RenderReturn('form_render');
 }
Пример #15
0
 /**
  * Shows the form to delete a template
  */
 public function DeleteTemplateForm()
 {
     $response = new ResponseManager();
     $templateId = Kit::GetParam('layoutid', _GET, _INT);
     $auth = $this->user->TemplateAuth($templateId, true);
     if (!$auth->del) {
         trigger_error(__('You do not have permissions to delete this template'), E_USER_ERROR);
     }
     Theme::Set('form_id', 'DeleteForm');
     Theme::Set('form_action', 'index.php?p=template&q=DeleteTemplate');
     Theme::Set('form_meta', '<input type="hidden" name="templateId" value="' . $templateId . '">');
     Theme::Set('form_fields', array(FormManager::AddMessage(__('Are you sure you want to delete this template?'))));
     $form = Theme::RenderReturn('form_render');
     $response->SetFormRequestResponse($form, __('Delete Template'), '300px', '200px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Template', 'Delete') . '")');
     $response->AddButton(__('No'), 'XiboDialogClose()');
     $response->AddButton(__('Yes'), '$("#DeleteForm").submit()');
     $response->Respond();
 }
Пример #16
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 . '">');
     // Extract the format from the raw node in the XLF
     $rawXml = new DOMDocument();
     $rawXml->loadXML($this->GetRaw());
     $formatNodes = $rawXml->getElementsByTagName('format');
     $formatNode = $formatNodes->item(0);
     $formFields = array();
     // Offer a choice of clock type
     $formFields[] = FormManager::AddCombo('clockTypeId', __('Clock Type'), $this->GetOption('clockTypeId'), array(array('clockTypeId' => '1', 'clockType' => 'Analogue'), array('clockTypeId' => '2', 'clockType' => 'Digital'), array('clockTypeId' => '3', 'clockType' => 'Flip Clock')), 'clockTypeId', 'clockType', __('Please select the type of clock to display.'), 'c');
     $formFields[] = FormManager::AddNumber('duration', __('Duration'), $this->duration, __('The duration in seconds this item should be displayed'), 'd', 'required');
     $formFields[] = FormManager::AddNumber('offset', __('Offset'), $this->GetOption('offset'), __('The offset in minutes that should be applied to the current time.'), 'o', NULL, 'offset-control-group');
     // Offer a choice of theme
     $formFields[] = FormManager::AddCombo('themeid', __('Theme'), $this->GetOption('theme'), array(array('themeid' => '1', 'theme' => 'Light'), array('themeid' => '2', 'theme' => 'Dark')), 'themeid', 'theme', __('Please select a theme for the clock.'), 't', 'analogue-control-group');
     $formFields[] = FormManager::AddMessage(sprintf(__('Enter a format for the Digital Clock below. e.g. [HH:mm] or [DD/MM/YYYY]. See the <a href="%s" target="_blank">format guide</a> for more information.'), HelpManager::Link('Widget', 'ClockFormat')), 'digital-control-group');
     $formFields[] = FormManager::AddMultiText('ta_text', NULL, $formatNode != NULL ? $formatNode->nodeValue : '', __('Enter a format for the clock'), 'f', 10, '', 'digital-control-group');
     Theme::Set('form_fields', $formFields);
     // Dependencies (some fields should be shown / hidden)
     $this->SetFieldDependencies();
     // Modules should be rendered using the theme engine.
     $this->response->html = Theme::RenderReturn('form_render');
     $this->response->dialogTitle = __('Edit Clock');
     $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).
     if ($this->showRegionOptions) {
         $this->response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $this->layoutid . '&regionid=' . $this->regionid . '&q=RegionOptions")');
     } else {
         $this->response->AddButton(__('Cancel'), 'XiboDialogClose()');
     }
     $this->response->AddButton(__('Apply'), 'XiboDialogApply("#ModuleForm")');
     $this->response->AddButton(__('Save'), '$("#ModuleForm").submit()');
     // The response must be returned.
     return $this->response;
 }
Пример #17
0
 /**
  * Edit Form
  */
 public function VerifyForm()
 {
     $user =& $this->user;
     $response = new ResponseManager();
     $helpManager = new HelpManager(NULL, $user);
     // Set some information about the form
     Theme::Set('form_id', 'VerifyForm');
     Theme::Set('form_action', 'index.php?p=module&q=Verify');
     $formFields = array();
     $formFields[] = FormManager::AddMessage(__('Verify all modules have been installed correctly by reinstalling any module related files'));
     Theme::Set('form_fields', $formFields);
     $response->SetFormRequestResponse(NULL, __('Verify'), '350px', '325px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . $helpManager->Link('Module', 'Edit') . '")');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Verify'), '$("#VerifyForm").submit()');
     $response->Respond();
 }
Пример #18
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;
 }
Пример #19
0
 public function RetireForm()
 {
     $response = new ResponseManager();
     $layoutid = $this->layoutid;
     if (!$this->auth->edit) {
         trigger_error(__('You do not have permissions to retire this layout'), E_USER_ERROR);
     }
     Theme::Set('form_id', 'RetireForm');
     Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutid . '">');
     // Retire the layout
     Theme::Set('form_action', 'index.php?p=layout&q=Retire');
     Theme::Set('form_fields', array(FormManager::AddMessage(__('Are you sure you want to retire this layout ?'))));
     $form = Theme::RenderReturn('form_render');
     $response->SetFormRequestResponse($form, __('Retire Layout'), '300px', '200px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Layout', 'Retire') . '")');
     $response->AddButton(__('Delete'), 'XiboSwapDialog("index.php?p=layout&q=DeleteLayoutForm&layoutid=' . $layoutid . '")');
     $response->AddButton(__('No'), 'XiboDialogClose()');
     $response->AddButton(__('Yes'), '$("#RetireForm").submit()');
     $response->Respond();
 }
Пример #20
0
 /**
  * Shows the DeleteEvent form
  * @return 
  */
 function DeleteForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     $eventID = Kit::GetParam('EventID', _GET, _INT, 0);
     if ($eventID == 0) {
         trigger_error(__('No event selected.'), E_USER_ERROR);
     }
     Theme::Set('form_id', 'DeleteEventForm');
     Theme::Set('form_action', 'index.php?p=schedule&q=DeleteEvent');
     Theme::Set('form_meta', '<input type="hidden" name="EventID" value="' . $eventID . '" />');
     Theme::Set('form_fields', array(FormManager::AddMessage(__('Are you sure you want to delete this event from <b>all</b> displays? If you only want to delete this item from certain displays, please deselect the displays in the edit dialogue and click Save.'))));
     $response->SetFormRequestResponse(NULL, __('Delete Event.'), '480px', '240px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Schedule', 'Delete') . '")');
     $response->AddButton(__('No'), 'XiboDialogClose()');
     $response->AddButton(__('Yes'), '$("#DeleteEventForm").submit()');
     $response->Respond();
 }
Пример #21
0
 function ConfirmLogout()
 {
     $db =& $this->db;
     $response = new ResponseManager();
     $userid = Kit::GetParam('userid', _GET, _INT);
     // Set some information about the form
     Theme::Set('form_id', 'SessionsLogoutForm');
     Theme::Set('form_action', 'index.php?p=sessions&q=LogoutUser');
     Theme::Set('form_meta', '<input type="hidden" name="userid" value="' . $userid . '" />');
     Theme::Set('form_fields', array(FormManager::AddMessage(__('Are you sure you want to logout this user?'))));
     $response->SetFormRequestResponse(NULL, __('Logout User'), '430px', '200px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Sessions', 'Logout') . '")');
     $response->AddButton(__('No'), 'XiboDialogClose()');
     $response->AddButton(__('Yes'), '$("#SessionsLogoutForm").submit()');
     $response->Respond();
 }
Пример #22
0
 /**
  * Resolution Delete Form
  */
 function DeleteForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     $resolutionid = Kit::GetParam('resolutionid', _GET, _INT);
     // Set some information about the form
     Theme::Set('form_id', 'DeleteForm');
     Theme::Set('form_action', 'index.php?p=resolution&q=Delete');
     Theme::Set('form_meta', '<input type="hidden" name="resolutionid" value="' . $resolutionid . '" />');
     Theme::Set('form_fields', array(FormManager::AddMessage(__('Are you sure you want to delete?'))));
     $response->SetFormRequestResponse(Theme::RenderReturn('form_render'), __('Delete Resolution'), '250px', '150px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Campaign', 'Delete') . '")');
     $response->AddButton(__('No'), 'XiboDialogClose()');
     $response->AddButton(__('Yes'), '$("#DeleteForm").submit()');
     $response->Respond();
 }
Пример #23
0
 public function RequestScreenShotForm()
 {
     $db =& $this->db;
     $response = new ResponseManager();
     $displayId = Kit::GetParam('displayId', _GET, _INT);
     // Set some information about the form
     Theme::Set('form_id', 'RequestScreenShotForm');
     Theme::Set('form_action', 'index.php?p=display&q=RequestScreenShot');
     Theme::Set('form_meta', '<input type="hidden" name="displayId" value="' . $displayId . '">');
     Theme::Set('form_fields', array(FormManager::AddMessage(__('Are you sure you want to request a screen shot? The next time the client connects to the CMS the screen shot will be sent.'))));
     $response->SetFormRequestResponse(NULL, __('Request Screen Shot'), '300px', '250px');
     $response->AddButton(__('Cancel'), 'XiboDialogClose()');
     $response->AddButton(__('Request'), '$("#RequestScreenShotForm").submit()');
     $response->Respond();
 }
Пример #24
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;
 }
Пример #25
0
 /**
  * Shows the Delete Group Form
  * @return
  */
 function DeleteForm()
 {
     $db =& $this->db;
     $user =& $this->user;
     $response = new ResponseManager();
     $helpManager = new HelpManager($db, $user);
     $campaignId = Kit::GetParam('CampaignID', _GET, _INT);
     // Authenticate this user
     $auth = $this->user->CampaignAuth($campaignId, true);
     if (!$auth->del) {
         trigger_error(__('You do not have permission to delete this campaign'), E_USER_ERROR);
     }
     // Set some information about the form
     Theme::Set('form_id', 'CampaignDeleteForm');
     Theme::Set('form_action', 'index.php?p=campaign&q=Delete');
     Theme::Set('form_meta', '<input type="hidden" name="CampaignID" value="' . $campaignId . '" />');
     Theme::Set('form_fields', array(FormManager::AddMessage(__('Are you sure you want to delete?'))));
     $response->SetFormRequestResponse(Theme::RenderReturn('form_render'), __('Delete Campaign'), '350px', '175px');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Campaign', 'Delete') . '")');
     $response->AddButton(__('No'), 'XiboDialogClose()');
     $response->AddButton(__('Yes'), '$("#CampaignDeleteForm").submit()');
     $response->Respond();
 }
Пример #26
0
 /**
  * Shows the Delete Group Form
  */
 function DeleteForm()
 {
     $groupId = $this->groupid;
     $response = new ResponseManager();
     // Get the group name
     $group = __('Unknown');
     try {
         $dbh = PDOConnect::init();
         $sth = $dbh->prepare('SELECT `group` FROM `group` WHERE groupId = :groupId');
         $sth->execute(array('groupId' => $groupId));
         if ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
             $group = Kit::ValidateParam($row['group'], _STRING);
         }
     } catch (Exception $e) {
         Debug::Error($e->getMessage());
     }
     // Set some information about the form
     Theme::Set('form_id', 'UserGroupDeleteForm');
     Theme::Set('form_action', 'index.php?p=group&q=Delete');
     Theme::Set('form_meta', '<input type="hidden" name="groupid" value="' . $groupId . '">');
     Theme::Set('form_fields', array(FormManager::AddMessage(sprintf(__('Are you sure you want to delete %s?'), $group))));
     // Construct the Response
     $response->SetFormRequestResponse(NULL, sprintf(__('Delete %s'), $group), '400', '180');
     $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('UserGroup', 'Delete') . '")');
     $response->AddButton(__('No'), 'XiboDialogClose()');
     $response->AddButton(__('Yes'), '$("#UserGroupDeleteForm").submit()');
     $response->Respond();
     return true;
 }