function displayPage() { // Set some information about the form Theme::Set('form_id', 'SettingsForm'); Theme::Set('form_action', 'index.php?p=group&q=Delete'); Theme::Set('settings_help_button_url', HelpManager::Link('Content', 'Config')); Theme::Set('settings_form', $this->display_settings()); // Render the Theme and output Theme::Render('settings_page'); }
public function Grid() { $db =& $this->db; $user =& $this->user; $response = new ResponseManager(); //display the display table $SQL = <<<SQL SELECT HelpID, Topic, Category, Link FROM `help` ORDER BY Topic, Category SQL; // Load results into an array $helplinks = $db->GetArray($SQL); if (!is_array($helplinks)) { trigger_error($db->error()); trigger_error(__('Error getting list of helplinks'), E_USER_ERROR); } $cols = array(array('name' => 'topic', 'title' => __('Topic')), array('name' => 'category', 'title' => __('Category')), array('name' => 'link', 'title' => __('Link'))); Theme::Set('table_cols', $cols); $rows = array(); foreach ($helplinks as $row) { $row['helpid'] = Kit::ValidateParam($row['HelpID'], _INT); $row['topic'] = Kit::ValidateParam($row['Topic'], _STRING); $row['category'] = Kit::ValidateParam($row['Category'], _STRING); $row['link'] = Kit::ValidateParam($row['Link'], _STRING); $row['buttons'] = array(); // we only want to show certain buttons, depending on the user logged in if ($user->usertypeid == 1) { // Edit $row['buttons'][] = array('id' => 'help_button_edit', 'url' => 'index.php?p=help&q=EditForm&HelpID=' . $row['helpid'], 'text' => __('Edit')); // Delete $row['buttons'][] = array('id' => 'help_button_delete', 'url' => 'index.php?p=help&q=DeleteForm&HelpID=' . $row['helpid'], 'text' => __('Delete')); // Test $row['buttons'][] = array('id' => 'help_button_test', 'url' => HelpManager::Link($row['topic'], $row['category']), 'text' => __('Test')); } $rows[] = $row; } Theme::Set('table_rows', $rows); $output = Theme::RenderReturn('table_render'); $response->SetGridResponse($output); $response->Respond(); }
/** * Shows the Members of a Group */ public function MembersForm() { $db =& $this->db; $response = new ResponseManager(); $groupID = Kit::GetParam('groupid', _REQUEST, _INT); // There needs to be two lists here. // Set some information about the form Theme::Set('users_assigned_id', 'usersIn'); Theme::Set('users_available_id', 'usersOut'); Theme::Set('users_assigned_url', 'index.php?p=group&q=SetMembers&GroupID=' . $groupID); // Users in group $SQL = ""; $SQL .= "SELECT user.UserID, "; $SQL .= " user.UserName, "; $SQL .= " CONCAT('UserID_', user.userID) AS list_id "; $SQL .= "FROM `user` "; $SQL .= " INNER JOIN lkusergroup "; $SQL .= " ON lkusergroup.UserID = user.UserID "; $SQL .= sprintf("WHERE lkusergroup.GroupID = %d", $groupID); $usersAssigned = $db->GetArray($SQL); if (!is_array($usersAssigned)) { trigger_error($db->error()); trigger_error(__('Error getting users'), E_USER_ERROR); } Theme::Set('users_assigned', $usersAssigned); // Users not in group $SQL = ""; $SQL .= "SELECT user.UserID, "; $SQL .= " user.UserName, "; $SQL .= " CONCAT('UserID_', user.userID) AS list_id "; $SQL .= "FROM `user` "; $SQL .= " WHERE user.UserID NOT IN ( "; $SQL .= " SELECT user.UserID "; $SQL .= " FROM `user` "; $SQL .= " INNER JOIN lkusergroup "; $SQL .= " ON lkusergroup.UserID = user.UserID "; $SQL .= sprintf("WHERE lkusergroup.GroupID = %d", $groupID); $SQL .= " )"; $usersAvailable = $db->GetArray($SQL); if (!is_array($usersAvailable)) { trigger_error($db->error()); trigger_error(__('Error getting users'), E_USER_ERROR); } Theme::Set('users_available', $usersAvailable); $form = Theme::RenderReturn('usergroup_form_user_assign'); $response->SetFormRequestResponse($form, __('Manage Membership'), '400', '375', 'ManageMembersCallBack'); $response->AddButton(__('Help'), "XiboHelpRender('" . HelpManager::Link('UserGroup', 'Members') . "')"); $response->AddButton(__('Cancel'), 'XiboDialogClose()'); $response->AddButton(__('Save'), 'MembersSubmit()'); $response->Respond(); }
/** * 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(); }
/** * Permissions form */ public function PermissionsForm() { $db =& $this->db; $user =& $this->user; $response = new ResponseManager(); $helpManager = new HelpManager($db, $user); if (!$this->auth->modifyPermissions) { trigger_error(__('You do not have permissions to edit this media'), E_USER_ERROR); } // List of all Groups with a view / edit / delete check box $permissions = new UserGroup(); if ($this->assignedMedia) { if (!($result = $permissions->GetPermissionsForObject('lklayoutmediagroup', NULL, NULL, sprintf(" AND lklayoutmediagroup.MediaID = '%s' AND lklayoutmediagroup.RegionID = '%s' AND lklayoutmediagroup.LayoutID = %d ", $this->mediaid, $this->regionid, $this->layoutid)))) { trigger_error($permissions->GetErrorMessage(), E_USER_ERROR); } } else { if (!($result = $permissions->GetPermissionsForObject('lkmediagroup', 'MediaID', $this->mediaid))) { trigger_error($permissions->GetErrorMessage(), E_USER_ERROR); } } if (count($result) <= 0) { trigger_error(__('Unable to get permissions'), E_USER_ERROR); } $checkboxes = array(); foreach ($result as $row) { $groupId = $row['groupid']; $rowClass = $row['isuserspecific'] == 0 ? 'strong_text' : ''; $checkbox = array('id' => $groupId, 'name' => Kit::ValidateParam($row['group'], _STRING), 'class' => $rowClass, 'value_view' => $groupId . '_view', 'value_view_checked' => $row['view'] == 1 ? 'checked' : '', 'value_edit' => $groupId . '_edit', 'value_edit_checked' => $row['edit'] == 1 ? 'checked' : '', 'value_del' => $groupId . '_del', 'value_del_checked' => $row['del'] == 1 ? 'checked' : ''); $checkboxes[] = $checkbox; } $formFields = array(); $formFields[] = FormManager::AddPermissions('groupids[]', $checkboxes); Theme::Set('form_fields', $formFields); // Set some information about the form Theme::Set('form_id', 'LayoutPermissionsForm'); Theme::Set('form_action', 'index.php?p=module&mod=' . $this->type . '&q=Exec&method=Permissions'); Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $this->layoutid . '" /><input type="hidden" name="regionid" value="' . $this->regionid . '" /><input type="hidden" name="mediaid" value="' . $this->mediaid . '" />'); $response->SetFormRequestResponse(NULL, __('Permissions'), '350px', '500px'); $response->AddButton(__('Help'), 'XiboHelpRender("' . ($this->layoutid != 0 ? $helpManager->Link('LayoutMedia', 'Permissions') : $helpManager->Link('Media', 'Permissions')) . '")'); if ($this->assignedMedia) { $response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $this->layoutid . '®ionid=' . $this->regionid . '&q=RegionOptions")'); } else { $response->AddButton(__('Cancel'), 'XiboDialogClose()'); } $response->AddButton(__('Save'), '$("#LayoutPermissionsForm").submit()'); return $response; }
/** * 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 .= ' 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')); } Theme::Set('validextensions', Kit::ValidateParam($row['ValidExtensions'], _STRING)); Theme::Set('imageuri', Kit::ValidateParam($row['ImageUri'], _STRING)); Theme::Set('isregionspecific', Kit::ValidateParam($row['RegionSpecific'], _INT)); Theme::Set('enabled_checked', Kit::ValidateParam($row['Enabled'], _INT) ? 'checked' : ''); Theme::Set('preview_enabled_checked', Kit::ValidateParam($row['PreviewEnabled'], _INT) ? 'checked' : ''); // 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 . '" />'); $form = Theme::RenderReturn('module_form_edit'); $response->SetFormRequestResponse($form, __('Edit Module'), '350px', '325px'); $response->AddButton(__('Help'), 'XiboHelpRender("' . $helpManager->Link('Module', 'Edit') . '")'); $response->AddButton(__('Cancel'), 'XiboDialogClose()'); $response->AddButton(__('Save'), '$("#ModuleEditForm").submit()'); $response->Respond(); }
/** * Permissions form */ public function PermissionsForm() { $db =& $this->db; $user =& $this->user; $response = new ResponseManager(); $helpManager = new HelpManager($db, $user); $templateId = Kit::GetParam('templateid', _GET, _INT); if ($templateId == 0) { trigger_error(__('No template selected'), E_USER_ERROR); } // Is this user allowed to delete this template? $auth = $this->user->TemplateAuth($templateId, true); // Set some information about the form Theme::Set('form_id', 'TemplatePermissionsForm'); Theme::Set('form_action', 'index.php?p=template&q=Permissions'); Theme::Set('form_meta', '<input type="hidden" name="templateid" value="' . $templateId . '" />'); // List of all Groups with a view/edit/delete checkbox $SQL = ''; $SQL .= 'SELECT `group`.GroupID, `group`.`Group`, View, Edit, Del, `group`.IsUserSpecific '; $SQL .= ' FROM `group` '; $SQL .= ' LEFT OUTER JOIN lktemplategroup '; $SQL .= ' ON lktemplategroup.GroupID = group.GroupID '; $SQL .= ' AND lktemplategroup.TemplateID = %d '; $SQL .= ' WHERE `group`.GroupID <> %d '; $SQL .= 'ORDER BY `group`.IsEveryone DESC, `group`.IsUserSpecific, `group`.`Group` '; $SQL = sprintf($SQL, $templateId, $user->getGroupFromId($user->userid, true)); if (!($results = $db->query($SQL))) { trigger_error($db->error()); trigger_error(__('Unable to get permissions for this template'), E_USER_ERROR); } $checkboxes = array(); while ($row = $db->get_assoc_row($results)) { $groupId = $row['GroupID']; $rowClass = $row['IsUserSpecific'] == 0 ? 'strong_text' : ''; $checkbox = array('id' => $groupId, 'name' => Kit::ValidateParam($row['Group'], _STRING), 'class' => $rowClass, 'value_view' => $groupId . '_view', 'value_view_checked' => $row['View'] == 1 ? 'checked' : '', 'value_edit' => $groupId . '_edit', 'value_edit_checked' => $row['Edit'] == 1 ? 'checked' : '', 'value_del' => $groupId . '_del', 'value_del_checked' => $row['Del'] == 1 ? 'checked' : ''); $checkboxes[] = $checkbox; } Theme::Set('form_rows', $checkboxes); $form = Theme::RenderReturn('campaign_form_permissions'); $response->SetFormRequestResponse($form, __('Permissions'), '350px', '500px'); $response->AddButton(__('Help'), 'XiboHelpRender("' . $helpManager->Link('Template', 'Permissions') . '")'); $response->AddButton(__('Cancel'), 'XiboDialogClose()'); $response->AddButton(__('Save'), '$("#TemplatePermissionsForm").submit()'); $response->Respond(); }
/** * 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(); }
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(); }
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(); }
public function ImportCsvForm() { global $session; $db =& $this->db; $response = new ResponseManager(); $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'), E_USER_ERROR); } // 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', 'DataSetImportCsvForm'); Theme::Set('form_action', 'index.php?p=dataset&q=ImportCsv'); Theme::Set('form_meta', '<input type="hidden" name="dataset" value="' . $dataSet . '" /><input type="hidden" name="datasetid" value="' . $dataSetId . '" /><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="' . $maxFileSizeBytes . '" />'); // Enumerate over the columns in the DataSet and offer a column mapping for each one (from the file) $SQL = ""; $SQL .= "SELECT DataSetColumnID, Heading "; $SQL .= " FROM datasetcolumn "; $SQL .= sprintf(" WHERE DataSetID = %d ", $dataSetId); $SQL .= " AND DataSetColumnTypeID = 1 "; $SQL .= "ORDER BY ColumnOrder "; // Load results into an array $dataSetColumns = $db->GetArray($SQL); if (!is_array($dataSetColumns)) { trigger_error($db->error()); trigger_error(__('Error getting list of dataSetColumns'), E_USER_ERROR); } $rows = array(); $i = 0; foreach ($dataSetColumns as $row) { $i++; $row['heading'] = Kit::ValidateParam($row['Heading'], _STRING); $row['formfieldid'] = 'csvImport_' . Kit::ValidateParam($row['DataSetColumnID'], _INT); $row['auto_column_number'] = $i; $rows[] = $row; } Theme::Set('fields', $rows); $form = Theme::RenderReturn('dataset_form_csv_import'); $response->SetFormRequestResponse($form, __('CSV Import'), '350px', '200px'); $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('DataSet', 'ImportCsv') . '")'); $response->AddButton(__('Cancel'), 'XiboDialogClose()'); $response->AddButton(__('Import'), '$("#DataSetImportCsvForm").submit()'); $response->Respond(); }
public function FileAssociations() { $displayGroupId = Kit::GetParam('DisplayGroupID', _GET, _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); } $id = uniqid(); Theme::Set('id', $id); Theme::Set('form_meta', '<input type="hidden" name="p" value="displaygroup"><input type="hidden" name="q" value="FileAssociationsView"><input type="hidden" name="displaygroupid" value="' . $displayGroupId . '">'); Theme::Set('pager', ResponseManager::Pager($id)); // Module types filter $modules = $this->user->ModuleAuth(0, '', -1); $types = array(); foreach ($modules as $module) { $type['moduleid'] = $module['Module']; $type['module'] = $module['Name']; $types[] = $type; } array_unshift($types, array('moduleid' => '', 'module' => 'All')); Theme::Set('module_field_list', $types); // Get the currently associated media items and put them in the top bar $existing = array(); try { $dbh = PDOConnect::init(); $sth = $dbh->prepare(' SELECT media.MediaID, media.Name FROM `media` INNER JOIN `lkmediadisplaygroup` ON lkmediadisplaygroup.mediaid = media.mediaid WHERE lkmediadisplaygroup.displaygroupid = :displaygroupid '); $sth->execute(array('displaygroupid' => $displayGroupId)); $existing = $sth->fetchAll(); } catch (Exception $e) { Debug::LogEntry('error', $e->getMessage(), get_class(), __FUNCTION__); trigger_error(__('Unable to get existing assignments.'), E_USER_ERROR); } Theme::Set('existing_associations', $existing); // Call to render the template $output = Theme::RenderReturn('displaygroup_fileassociations_form_assign'); // Construct the Response $response = new ResponseManager(); $response->html = $output; $response->success = true; $response->dialogSize = true; $response->dialogClass = 'modal-big'; $response->dialogWidth = '780px'; $response->dialogHeight = '580px'; $response->dialogTitle = __('Associate an item from the Library'); $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('DisplayGroup', 'FileAssociations') . '")'); $response->AddButton(__('Cancel'), 'XiboDialogClose()'); $response->AddButton(__('Assign'), 'FileAssociationsSubmit(' . $displayGroupId . ')'); $response->Respond(); }
/** * Shows the TimeLine */ public function Timeline() { $db =& $this->db; $user =& $this->user; $response = new ResponseManager(); $response->html = ''; $layoutId = Kit::GetParam('layoutid', _GET, _INT); $regionId = Kit::GetParam('regionid', _REQUEST, _STRING); // Make sure we have permission to edit this region Kit::ClassLoader('region'); $region = new region($db); $ownerId = $region->GetOwnerId($layoutId, $regionId); $regionAuth = $this->user->RegionAssignmentAuth($ownerId, $layoutId, $regionId, true); if (!$regionAuth->edit) { trigger_error(__('You do not have permissions to edit this region'), E_USER_ERROR); } // Library location $libraryLocation = Config::GetSetting('LIBRARY_LOCATION'); // Present a canvas with 2 columns, left column for the media icons $buttons = array(); // Always output a Library assignment button $buttons[] = array('id' => 'media_button_library', 'url' => 'index.php?p=content&q=LibraryAssignForm&layoutid=' . $layoutId . '®ionid=' . $regionId, 'text' => __('Library')); // Get a list of the enabled modules and then create buttons for them if (!($enabledModules = new ModuleManager($db, $user))) { trigger_error($enabledModules->message, E_USER_ERROR); } // Loop through the buttons we have and output each one while ($modulesItem = $enabledModules->GetNextModule()) { $mod = Kit::ValidateParam($modulesItem['Module'], _STRING); $caption = Kit::ValidateParam($modulesItem['Name'], _STRING); $mod = strtolower($mod); $title = Kit::ValidateParam($modulesItem['Description'], _STRING); $img = Kit::ValidateParam($modulesItem['ImageUri'], _STRING); $buttons[] = array('id' => 'media_button_' . $mod, 'url' => 'index.php?p=module&q=Exec&mod=' . $mod . '&method=AddForm&layoutid=' . $layoutId . '®ionid=' . $regionId, 'text' => __($caption)); } Theme::Set('media_buttons', $buttons); $response->html .= '<div class="container-fluid">'; $response->html .= '<div class="row-fluid">'; $response->html .= Theme::RenderReturn('layout_designer_form_timeline'); // Load the XML for this layout and region, we need to get the media nodes. // These form the timeline and go in the right column // Generate an ID for the list (this is passed into the reorder function) $timeListMediaListId = uniqid('timelineMediaList_'); $response->html .= '<div class="span10">'; $response->html .= '<div id="timelineControl" class="timelineColumn" layoutid="' . $layoutId . '" regionid="' . $regionId . '">'; $response->html .= ' <div class="timelineMediaVerticalList">'; $response->html .= ' <ul id="' . $timeListMediaListId . '" class="timelineSortableListOfMedia">'; // How are we going to colour the bars, my media type or my permissions $timeBarColouring = Config::GetSetting('REGION_OPTIONS_COLOURING'); // Create a layout object $region = new Region($db); foreach ($region->GetMediaNodeList($layoutId, $regionId) as $mediaNode) { // Put this node vertically in the region timeline $mediaId = $mediaNode->getAttribute('id'); $lkId = $mediaNode->getAttribute('lkid'); $mediaType = $mediaNode->getAttribute('type'); $mediaDuration = $mediaNode->getAttribute('duration'); $ownerId = $mediaNode->getAttribute('userId'); // Permissions for this assignment $auth = $user->MediaAssignmentAuth($ownerId, $layoutId, $regionId, $mediaId, true); // Skip over media assignments that we do not have permission to see if (!$auth->view) { continue; } Debug::LogEntry('audit', sprintf('Permission Granted to View MediaID: %s', $mediaId), 'layout', 'TimeLine'); // Create a media module to handle all the complex stuff require_once "modules/{$mediaType}.module.php"; $tmpModule = new $mediaType($db, $user, $mediaId, $layoutId, $regionId, $lkId); $mediaName = $tmpModule->GetName(); $transitionIn = $tmpModule->GetTransition('in'); $transitionOut = $tmpModule->GetTransition('out'); // Colouring for the media block if ($timeBarColouring == 'Permissions') { $mediaBlockColouringClass = 'timelineMediaItemColouring_' . ($auth->edit ? 'enabled' : 'disabled'); } else { $mediaBlockColouringClass = 'timelineMediaItemColouring_' . $mediaType; } // Create the list item $response->html .= '<li class="timelineMediaListItem" mediaid="' . $mediaId . '" lkid="' . $lkId . '">'; // In transition $response->html .= ' <div class="timelineMediaInTransition">'; if ($transitionIn != 'None') { $response->html .= '<span>' . $transitionIn . '</span>'; } $response->html .= ' </div>'; // Media Bar $response->html .= ' <div class="timelineMediaItem">'; $response->html .= ' <ul class="timelineMediaItemLinks">'; // Create some links if ($auth->edit) { $response->html .= '<li><a class="XiboFormButton timelineMediaBarLink" href="index.php?p=module&mod=' . $mediaType . '&q=Exec&method=EditForm&layoutid=' . $layoutId . '®ionid=' . $regionId . '&mediaid=' . $mediaId . '&lkid=' . $lkId . '" title="' . __('Click to edit this media') . '">' . __('Edit') . '</a></li>'; } if ($auth->del) { $response->html .= '<li><a class="XiboFormButton timelineMediaBarLink" href="index.php?p=module&mod=' . $mediaType . '&q=Exec&method=DeleteForm&layoutid=' . $layoutId . '®ionid=' . $regionId . '&mediaid=' . $mediaId . '&lkid=' . $lkId . '" title="' . __('Click to delete this media') . '">' . __('Delete') . '</a></li>'; } if ($auth->modifyPermissions) { $response->html .= '<li><a class="XiboFormButton timelineMediaBarLink" href="index.php?p=module&mod=' . $mediaType . '&q=Exec&method=PermissionsForm&layoutid=' . $layoutId . '®ionid=' . $regionId . '&mediaid=' . $mediaId . '&lkid=' . $lkId . '" title="Click to change permissions for this media">' . __('Permissions') . '</a></li>'; } if (count($this->user->TransitionAuth('in')) > 0) { $response->html .= '<li><a class="XiboFormButton timelineMediaBarLink" href="index.php?p=module&mod=' . $mediaType . '&q=Exec&method=TransitionEditForm&type=in&layoutid=' . $layoutId . '®ionid=' . $regionId . '&mediaid=' . $mediaId . '&lkid=' . $lkId . '" title="' . __('Click to edit this transition') . '">' . __('In Transition') . '</a></li>'; } if (count($this->user->TransitionAuth('out')) > 0) { $response->html .= '<li><a class="XiboFormButton timelineMediaBarLink" href="index.php?p=module&mod=' . $mediaType . '&q=Exec&method=TransitionEditForm&type=out&layoutid=' . $layoutId . '®ionid=' . $regionId . '&mediaid=' . $mediaId . '&lkid=' . $lkId . '" title="' . __('Click to edit this transition') . '">' . __('Out Transition') . '</a></li>'; } $response->html .= ' </ul>'; // Put the media name in $response->html .= ' <div class="timelineMediaDetails ' . $mediaBlockColouringClass . '">'; $response->html .= ' <h3>' . ($mediaName == '' ? $tmpModule->displayType : $mediaName) . ' (' . $mediaDuration . ' seconds)</h3>'; $response->html .= ' </div>'; // Put the media hover preview in $mediaHoverPreview = $tmpModule->HoverPreview(); $response->html .= ' <div class="timelineMediaPreview">' . $mediaHoverPreview . '</div>'; // End the time line media item $response->html .= ' </div>'; // Out transition $response->html .= ' <div class="timelineMediaOutTransition">'; if ($transitionOut != 'None') { $response->html .= '<span>' . $transitionOut . '</span>'; } $response->html .= ' </div>'; // End of this media item $response->html .= '</li>'; } $response->html .= ' </ul>'; $response->html .= ' </div>'; // Output a div to contain the preview for this media item $response->html .= ' <div id="timelinePreview"></div>'; $response->html .= ' </div>'; $response->html .= '</div>'; $response->html .= '</div>'; $response->html .= '</div>'; // Finish constructing the response $response->callBack = 'LoadTimeLineCallback'; $response->dialogClass = 'modal-big'; $response->dialogTitle = __('Region Timeline'); $response->dialogSize = true; $response->dialogWidth = '1000px'; $response->dialogHeight = '550px'; $response->focusInFirstInput = false; // Add some buttons $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Layout', 'RegionOptions') . '")'); $response->AddButton(__('Close'), 'XiboDialogClose()'); $response->AddButton(__('Save Order'), 'XiboTimelineSaveOrder("' . $timeListMediaListId . '","' . $layoutId . '","' . $regionId . '")'); $response->Respond(); }
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(); }
/** * Shows the Authorised applications this user has */ public function UserTokens() { $db =& $this->db; $user =& $this->user; $response = new ResponseManager(); $store = OAuthStore::instance(); try { $list = $store->listConsumerTokens(Kit::GetParam('userID', _GET, _INT)); } catch (OAuthException $e) { trigger_error($e->getMessage()); trigger_error(__('Error listing Log.'), E_USER_ERROR); } $rows = array(); foreach ($list as $app) { $app['application_title'] = Kit::ValidateParam($app['application_title'], _STRING); $app['enabled'] = Kit::ValidateParam($app['enabled'], _STRING); $app['status'] = Kit::ValidateParam($app['status'], _STRING); $rows[] = $app; } Theme::Set('table_rows', $rows); $output = Theme::RenderReturn('application_form_user_applications'); $response->SetFormRequestResponse($output, __('Authorized applications for user'), '650', '450'); $response->AddButton(__('Help'), "XiboHelpRender('" . HelpManager::Link('User', 'Applications') . "')"); $response->AddButton(__('Close'), 'XiboDialogClose()'); $response->Respond(); }
/** * Copy layout form */ public function CopyForm() { $db =& $this->db; $user =& $this->user; $response = new ResponseManager(); $layoutid = Kit::GetParam('layoutid', _REQUEST, _INT); $oldLayout = Kit::GetParam('oldlayout', _REQUEST, _STRING); $copyMediaChecked = Config::GetSetting('LAYOUT_COPY_MEDIA_CHECKB') == 'Checked' ? 'checked' : ''; Theme::Set('form_id', 'LayoutCopyForm'); Theme::Set('form_action', 'index.php?p=layout&q=Copy'); Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutid . '">'); Theme::Set('copy_media_checked', $copyMediaChecked); Theme::Set('new_layout_default', $oldLayout . ' 2'); $form = Theme::RenderReturn('layout_form_copy'); $response->SetFormRequestResponse($form, __('Copy a Layout.'), '350px', '275px'); $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Layout', 'Copy') . '")'); $response->AddButton(__('Cancel'), 'XiboDialogClose()'); $response->AddButton(__('Copy'), '$("#LayoutCopyForm").submit()'); $response->Respond(); }
/** * 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(); }
/** * Permissions form */ public function PermissionsForm() { $db =& $this->db; $user =& $this->user; $response = $this->response; $helpManager = new HelpManager($db, $user); if (!$this->auth->modifyPermissions) { trigger_error(__('You do not have permissions to edit this media'), E_USER_ERROR); } // Form content $form = '<form id="LayoutPermissionsForm" class="XiboForm" method="post" action="index.php?p=module&mod=' . $this->type . '&q=Exec&method=Permissions">'; $form .= '<input type="hidden" name="layoutid" value="' . $this->layoutid . '" />'; $form .= '<input type="hidden" name="regionid" value="' . $this->regionid . '" />'; $form .= '<input type="hidden" name="mediaid" value="' . $this->mediaid . '" />'; $form .= ' <table class="table table-bordered">'; $form .= ' <tr>'; $form .= ' <th>' . __('Group') . '</th>'; $form .= ' <th>' . __('View') . '</th>'; $form .= ' <th>' . __('Edit') . '</th>'; $form .= ' <th>' . __('Delete') . '</th>'; $form .= ' </tr>'; // List of all Groups with a view/edit/delete checkbox $SQL = ''; $SQL .= 'SELECT `group`.GroupID, `group`.`Group`, View, Edit, Del, `group`.IsUserSpecific '; $SQL .= ' FROM `group` '; if ($this->assignedMedia) { $SQL .= ' LEFT OUTER JOIN lklayoutmediagroup '; $SQL .= ' ON lklayoutmediagroup.GroupID = group.GroupID '; $SQL .= sprintf(" AND lklayoutmediagroup.MediaID = '%s' AND lklayoutmediagroup.RegionID = '%s' AND lklayoutmediagroup.LayoutID = %d ", $this->mediaid, $this->regionid, $this->layoutid); } else { $SQL .= ' LEFT OUTER JOIN lkmediagroup '; $SQL .= ' ON lkmediagroup.GroupID = group.GroupID '; $SQL .= sprintf(' AND lkmediagroup.MediaID = %d ', $this->mediaid); } $SQL .= ' WHERE `group`.GroupID <> %d '; $SQL .= 'ORDER BY `group`.IsEveryone DESC, `group`.IsUserSpecific, `group`.`Group` '; $SQL = sprintf($SQL, $user->getGroupFromId($user->userid, true)); Debug::LogEntry('audit', $SQL, 'module', 'PermissionsForm'); if (!($results = $db->query($SQL))) { trigger_error($db->error()); trigger_error(__('Unable to get permissions for this layout'), E_USER_ERROR); } while ($row = $db->get_assoc_row($results)) { $groupId = $row['GroupID']; $group = $row['IsUserSpecific'] == 0 ? '<strong>' . $row['Group'] . '</strong>' : $row['Group']; $form .= '<tr>'; $form .= ' <td>' . $group . '</td>'; $form .= ' <td><input type="checkbox" name="groupids[]" value="' . $groupId . '_view" ' . ($row['View'] == 1 ? 'checked' : '') . '></td>'; $form .= ' <td><input type="checkbox" name="groupids[]" value="' . $groupId . '_edit" ' . ($row['Edit'] == 1 ? 'checked' : '') . '></td>'; $form .= ' <td><input type="checkbox" name="groupids[]" value="' . $groupId . '_del" ' . ($row['Del'] == 1 ? 'checked' : '') . '></td>'; $form .= '</tr>'; } $form .= '</table>'; $form .= '</form>'; $response->SetFormRequestResponse($form, __('Permissions'), '350px', '500px'); $response->AddButton(__('Help'), 'XiboHelpRender("' . ($this->layoutid != 0 ? $helpManager->Link('LayoutMedia', 'Permissions') : $helpManager->Link('Media', 'Permissions')) . '")'); if ($this->assignedMedia) { $response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $this->layoutid . '®ionid=' . $this->regionid . '&q=RegionOptions")'); } else { $response->AddButton(__('Cancel'), 'XiboDialogClose()'); } $response->AddButton(__('Save'), '$("#LayoutPermissionsForm").submit()'); return $response; }
<div class="carousel-caption"> <h3><?php echo Theme::Translate('Schedule'); ?> </h3> <p><?php echo Theme::Translate('Send something down to your display and watch %s come alive! Create events on Displays / Groups for Layouts / Campaigns, create repeat events and much more.', Theme::GetConfig('app_name')); ?> </p> <div class="btn-group"> <a class="btn btn-primary btn-lg" role="button" href="index.php?p=schedule"><?php echo Theme::Translate('Schedule Event'); ?> </a> <a class="btn btn-default btn-lg" role="button" href="<?php echo HelpManager::Link('Schedule', 'General'); ?> " target="_blank"><?php echo Theme::Translate('Read more'); ?> </a> </div> </div> </div> </div> <!-- Controls --> <a class="left carousel-control" href="#new-user-welcome-carousel" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control" href="#new-user-welcome-carousel" role="button" data-slide="next">
/** * 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)); // Get the currently assigned layouts and put them in the "well" // // Layouts in group $SQL = "SELECT layout.Layoutid, "; $SQL .= " layout.layout, "; $SQL .= " CONCAT('LayoutID_', layout.LayoutID) AS list_id "; $SQL .= "FROM layout "; $SQL .= " INNER JOIN lkcampaignlayout "; $SQL .= " ON lkcampaignlayout.LayoutID = layout.LayoutID "; $SQL .= sprintf("WHERE lkcampaignlayout.CampaignID = %d", $campaignId); $SQL .= " ORDER BY lkcampaignlayout.DisplayOrder "; $layoutsAssigned = $db->GetArray($SQL); if (!is_array($layoutsAssigned)) { trigger_error($db->error()); trigger_error(__('Error getting Layouts'), E_USER_ERROR); } Debug::LogEntry('audit', count($layoutsAssigned) . ' layouts assigned already'); // Set the layouts assigned Theme::Set('layouts_assigned', $layoutsAssigned); // Call to render the template $output = Theme::RenderReturn('campaign_form_layout_assign'); // 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(); }
/** * 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(); }
/** * 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 . '®ionid=' . $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; }
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(); }
public static function GetPageHelpLink() { return HelpManager::Link(); }
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(); }
/** * 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(); }
/** * Member of Display Groups Form */ public function MemberOfForm() { $db =& $this->db; $response = new ResponseManager(); $displayID = Kit::GetParam('DisplayID', _REQUEST, _INT); // Auth $auth = $this->user->DisplayGroupAuth($this->GetDisplayGroupId($displayID), true); if (!$auth->modifyPermissions) { trigger_error(__('You do not have permission to change Display Groups on this display'), E_USER_ERROR); } // There needs to be two lists here. // - DisplayGroups this Display is already assigned to // - DisplayGroups this Display could be assigned to // Set some information about the form Theme::Set('displaygroups_assigned_id', 'displaysIn'); Theme::Set('displaygroups_available_id', 'displaysOut'); Theme::Set('displaygroups_assigned_url', 'index.php?p=display&q=SetMemberOf&DisplayID=' . $displayID); // Display Groups Assigned $SQL = ""; $SQL .= "SELECT displaygroup.DisplayGroupID, "; $SQL .= " displaygroup.DisplayGroup, "; $SQL .= " CONCAT('DisplayGroupID_', displaygroup.DisplayGroupID) AS list_id "; $SQL .= "FROM displaygroup "; $SQL .= " INNER JOIN lkdisplaydg ON lkdisplaydg.DisplayGroupID = displaygroup.DisplayGroupID "; $SQL .= sprintf("WHERE lkdisplaydg.DisplayID = %d ", $displayID); $SQL .= " AND displaygroup.IsDisplaySpecific = 0 "; $SQL .= " ORDER BY displaygroup.DisplayGroup "; $displaygroupsAssigned = $db->GetArray($SQL); if (!is_array($displaygroupsAssigned)) { trigger_error($db->error()); trigger_error(__('Error getting Display Groups'), E_USER_ERROR); } Theme::Set('displaygroups_assigned', $displaygroupsAssigned); // Display Groups not assigned $SQL = ""; $SQL .= "SELECT displaygroup.DisplayGroupID, "; $SQL .= " displaygroup.DisplayGroup, "; $SQL .= " CONCAT('DisplayGroupID_', displaygroup.DisplayGroupID) AS list_id "; $SQL .= " FROM displaygroup "; $SQL .= " WHERE displaygroup.IsDisplaySpecific = 0 "; $SQL .= " AND displaygroup.DisplayGroupID NOT IN "; $SQL .= " (SELECT lkdisplaydg.DisplayGroupID "; $SQL .= " FROM lkdisplaydg "; $SQL .= sprintf(" WHERE lkdisplaydg.DisplayID = %d ", $displayID); $SQL .= " )"; $SQL .= " ORDER BY displaygroup.DisplayGroup "; Debug::LogEntry('audit', $SQL); $displaygroups_available = $db->GetArray($SQL); if (!is_array($displaygroups_available)) { trigger_error($db->error()); trigger_error(__('Error getting Display Groups'), E_USER_ERROR); } Theme::Set('displaygroups_available', $displaygroups_available); // Render the theme $form = Theme::RenderReturn('display_form_group_assign'); $response->SetFormRequestResponse($form, __('Manage Membership'), '400', '375', 'DisplayGroupManageMembersCallBack'); $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('DisplayGroup', 'Members') . '")'); $response->AddButton(__('Cancel'), 'XiboDialogClose()'); $response->AddButton(__('Save'), 'DisplayGroupMembersSubmit()'); $response->Respond(); }
/** * Displays the Library Assign form * @return */ function LibraryAssignForm() { $db =& $this->db; $user =& $this->user; $response = new ResponseManager(); $id = uniqid(); Theme::Set('id', $id); Theme::Set('form_meta', '<input type="hidden" name="p" value="content"><input type="hidden" name="q" value="LibraryAssignView">'); Theme::Set('pager', ResponseManager::Pager($id)); // Module types filter $modules = $this->user->ModuleAuth(0, '', 1); $types = array(); foreach ($modules as $module) { $type['moduleid'] = $module['Module']; $type['module'] = $module['Name']; $types[] = $type; } array_unshift($types, array('moduleid' => '', 'module' => 'All')); Theme::Set('module_field_list', $types); // Call to render the template $output = Theme::RenderReturn('library_form_assign'); // Input vars $layoutId = Kit::GetParam('layoutid', _REQUEST, _INT); $regionId = Kit::GetParam('regionid', _REQUEST, _STRING); // Construct the Response $response->html = $output; $response->success = true; $response->dialogSize = true; $response->dialogClass = 'modal-big'; $response->dialogWidth = '780px'; $response->dialogHeight = '580px'; $response->dialogTitle = __('Assign an item from the Library'); $response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('Library', 'Assign') . '")'); $response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $layoutId . '®ionid=' . $regionId . '&q=RegionOptions")'); $response->AddButton(__('Assign'), 'LibraryAssignSubmit("' . $layoutId . '","' . $regionId . '")'); $response->Respond(); }
/** * 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(); }
public function EditForm() { $db =& $this->db; $user =& $this->user; $response = new ResponseManager(); $helpManager = new HelpManager($db, $user); // Can we edit? if (Config::GetSetting('TRANSITION_CONFIG_LOCKED_CHECKB') == 'Checked') { trigger_error(__('Transition Config Locked'), E_USER_ERROR); } $transitionId = Kit::GetParam('TransitionID', _GET, _INT); // Pull the currently known info from the DB $SQL = ''; $SQL .= 'SELECT Transition, '; $SQL .= ' AvailableAsIn, '; $SQL .= ' AvailableAsOut '; $SQL .= ' FROM `transition` '; $SQL .= ' WHERE TransitionID = %d '; $SQL = sprintf($SQL, $transitionId); if (!($row = $db->GetSingleRow($SQL))) { trigger_error($db->error()); trigger_error(__('Error getting Transition')); } $name = Kit::ValidateParam($row['Transition'], _STRING); Theme::Set('enabledforin_checked', Kit::ValidateParam($row['AvailableAsIn'], _INT) == 1 ? 'Checked' : ''); Theme::Set('enabledforout_checked', Kit::ValidateParam($row['AvailableAsOut'], _INT) == 1 ? 'Checked' : ''); // Set some information about the form Theme::Set('form_id', 'TransitionEditForm'); Theme::Set('form_action', 'index.php?p=transition&q=Edit'); Theme::Set('form_meta', '<input type="hidden" name="TransitionID" value="' . $transitionId . '" />'); $form = Theme::RenderReturn('transition_form_edit'); $response->SetFormRequestResponse($form, sprintf(__('Edit %s'), $name), '350px', '325px'); $response->AddButton(__('Help'), 'XiboHelpRender("' . $helpManager->Link('Transition', 'Edit') . '")'); $response->AddButton(__('Cancel'), 'XiboDialogClose()'); $response->AddButton(__('Save'), '$("#TransitionEditForm").submit()'); $response->Respond(); }