本文整理汇总了PHP中Theme::Set方法的典型用法代码示例。如果您正苦于以下问题:PHP Theme::Set方法的具体用法?PHP Theme::Set怎么用?PHP Theme::Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Theme
的用法示例。
在下文中一共展示了Theme::Set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: EditForm
/**
* Return the Edit Form as HTML
* @return
*/
public function EditForm()
{
$this->response = new ResponseManager();
$db =& $this->db;
$layoutid = $this->layoutid;
$regionid = $this->regionid;
$mediaid = $this->mediaid;
// Permissions
if (!$this->auth->edit) {
$this->response->SetError('You do not have permission to edit this assignment.');
$this->response->keepOpen = true;
return $this->response;
}
Theme::Set('form_id', 'ModuleForm');
Theme::Set('form_action', 'index.php?p=module&mod=' . $this->type . '&q=Exec&method=EditMedia');
Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutid . '"><input type="hidden" id="iRegionId" name="regionid" value="' . $regionid . '"><input type="hidden" name="showRegionOptions" value="' . $this->showRegionOptions . '" /><input type="hidden" id="mediaid" name="mediaid" value="' . $mediaid . '">');
$formFields = array();
$formFields[] = FormManager::AddText('windowsCommand', __('Windows Command'), htmlentities(urldecode($this->GetOption('windowsCommand'))), __('Enter a Windows Command Line compatible command'), 'w');
$formFields[] = FormManager::AddText('linuxCommand', __('Android / Linux Command'), htmlentities(urldecode($this->GetOption('linuxCommand'))), __('Enter an Android / Linux Command Line compatible command'), 'l');
Theme::Set('form_fields', $formFields);
if ($this->showRegionOptions) {
$this->response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $layoutid . '®ionid=' . $regionid . '&q=RegionOptions")');
} else {
$this->response->AddButton(__('Cancel'), 'XiboDialogClose()');
}
$this->response->html = Theme::RenderReturn('form_render');
$this->response->AddButton(__('Save'), '$("#ModuleForm").submit()');
$this->response->dialogTitle = __('Edit Shell Command');
$this->response->dialogSize = true;
$this->response->dialogWidth = '450px';
$this->response->dialogHeight = '250px';
return $this->response;
}
示例2: DisplayList
/**
* Shows a list of displays
*/
public function DisplayList()
{
$user =& $this->user;
$response = new ResponseManager();
$displayGroupIDs = Kit::GetParam('DisplayGroupIDs', _SESSION, _ARRAY);
$filter_name = Kit::GetParam('filter_name', _POST, _STRING);
// Build 2 lists
$groups = array();
$displays = array();
foreach ($user->DisplayGroupList(0, $filter_name) as $display) {
$display['checked_text'] = in_array($display['displaygroupid'], $displayGroupIDs) ? 'checked' : '';
if ($display['isdisplayspecific'] == 1) {
$displays[] = $display;
} else {
$groups[] = $display;
}
}
Theme::Set('id', 'DisplayList');
Theme::Set('group_list_items', $groups);
Theme::Set('display_list_items', $displays);
$output = Theme::RenderReturn('schedule_page_display_list');
$response->SetGridResponse($output);
$response->callBack = 'DisplayListRender';
$response->Respond();
}
示例3: displayPage
function displayPage()
{
Theme::Set('version', VERSION);
Theme::Set('text', Theme::RenderReturn('about_text'));
// Render the Theme and output
Theme::Render('about_page');
}
示例4: displayPage
function displayPage()
{
$db =& $this->db;
$user =& $this->user;
$error = Kit::GetParam('ErrorMessage', _SESSION, _HTMLSTRING, __('Unknown Error'));
Theme::Set('ErrorMessage', $error);
Theme::Render('error');
}
示例5: displayPage
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');
}
示例6: displayPage
function displayPage()
{
$db =& $this->db;
$user =& $this->user;
$config = new Config();
// Configure the theme
Theme::Set('environment_check', $config->CheckEnvironment());
Theme::Set('collect_data_url', 'index.php?p=fault&q=CollectData');
// Render the Theme and output
Theme::Render('fault_page');
}
示例7: attempt_login
/**
* Validate the User is Logged In
* @param $ajax Object[optional] Indicates if this request came from an AJAX call or otherwise
*/
function attempt_login($ajax = false)
{
$db =& $this->db;
$userid = Kit::GetParam('userid', _SESSION, _INT);
// Referring Page is anything after the ?
$requestUri = rawurlencode(Kit::GetCurrentPage());
if (!$this->checkforUserid()) {
// Log out the user
if ($userid != 0) {
$db->query(sprintf("UPDATE user SET loggedin = 0 WHERE userid = %d ", $userid));
}
// AJAX calls that fail the login test cause a page redirect
if ($ajax) {
//create the AJAX request object
$response = new ResponseManager();
$response->Login();
$response->Respond();
} else {
Theme::Set('form_meta', '<input type="hidden" name="token" value="' . CreateFormToken() . '" />');
Theme::Set('form_action', 'index.php?q=login&referingPage=' . $requestUri);
Theme::Set('about_url', 'index.php?p=index&q=About');
Theme::Set('source_url', 'https://launchpad.net/xibo/1.6');
// Message (either from the URL or the session)
$message = Kit::GetParam('message', _GET, _STRING, Kit::GetParam('message', _SESSION, _STRING, ''));
Theme::Set('login_message', $message);
Theme::Render('login_page');
// Clear the session message
$_SESSION['message'] = '';
exit;
}
return false;
} else {
//write out to the db that the logged in user has accessed the page still
$SQL = sprintf("UPDATE user SET lastaccessed = '" . date("Y-m-d H:i:s") . "', loggedin = 1 WHERE userid = %d ", $userid);
$results = $db->query($SQL) or trigger_error("Can not write last accessed info.", E_USER_ERROR);
// Load the information about this user
$this->LoginServices($userid);
return true;
}
}
示例8: StatsGrid
/**
* Shows the stats grid
*/
public function StatsGrid()
{
$db =& $this->db;
$user =& $this->user;
$response = new ResponseManager();
$fromDt = Kit::GetParam('fromdt', _POST, _STRING);
$toDt = Kit::GetParam('todt', _POST, _STRING);
$displayId = Kit::GetParam('displayid', _POST, _INT);
$mediaId = Kit::GetParam('mediaid', _POST, _INT);
// What if the fromdt and todt are exactly the same?
// in this case assume an entire day from midnight on the fromdt to midnight on the todt (i.e. add a day to the todt)
if ($fromDt == $toDt) {
$toDt = date("Y-m-d", strtotime($toDt) + 86399);
}
Theme::Set('form_action', '');
Theme::Set('form_meta', '<input type="hidden" name="p" value="stats"/><input type="hidden" name="q" value="OutputCSV"/><input type="hidden" name="displayid" value="' . $displayId . '" /><input type="hidden" name="fromdt" value="' . $fromDt . '" /><input type="hidden" name="todt" value="' . $toDt . '" />');
// Get an array of display id this user has access to.
$displays = $this->user->DisplayList();
$display_ids = array();
foreach ($displays as $display) {
$display_ids[] = $display['displayid'];
}
if (count($display_ids) <= 0) {
trigger_error(__('No displays with View permissions'), E_USER_ERROR);
}
// 3 grids showing different stats.
// Layouts Ran
$SQL = 'SELECT display.Display, layout.Layout, COUNT(StatID) AS NumberPlays, SUM(TIME_TO_SEC(TIMEDIFF(end, start))) AS Duration, MIN(start) AS MinStart, MAX(end) AS MaxEnd ';
$SQL .= ' FROM stat ';
$SQL .= ' INNER JOIN layout ON layout.LayoutID = stat.LayoutID ';
$SQL .= ' INNER JOIN display ON stat.DisplayID = display.DisplayID ';
$SQL .= " WHERE stat.type = 'layout' ";
$SQL .= sprintf(" AND stat.end > '%s' ", $fromDt);
$SQL .= sprintf(" AND stat.start <= '%s' ", $toDt);
$SQL .= ' AND stat.displayID IN (' . implode(',', $display_ids) . ') ';
if ($displayId != 0) {
$SQL .= sprintf(" AND stat.displayID = %d ", $displayId);
}
$SQL .= 'GROUP BY display.Display, layout.Layout ';
$SQL .= 'ORDER BY display.Display, layout.Layout';
if (!($results = $this->db->query($SQL))) {
trigger_error($db->error());
trigger_error(__('Unable to get Layouts Shown'), E_USER_ERROR);
}
$rows = array();
while ($row = $db->get_assoc_row($results)) {
$row['Display'] = Kit::ValidateParam($row['Display'], _STRING);
$row['Layout'] = Kit::ValidateParam($row['Layout'], _STRING);
$row['NumberPlays'] = Kit::ValidateParam($row['NumberPlays'], _INT);
$row['DurationSec'] = Kit::ValidateParam($row['Duration'], _INT);
$row['Duration'] = sec2hms(Kit::ValidateParam($row['Duration'], _INT));
$row['MinStart'] = Kit::ValidateParam($row['MinStart'], _STRING);
$row['MaxEnd'] = Kit::ValidateParam($row['MaxEnd'], _STRING);
$rows[] = $row;
}
Theme::Set('table_layouts_shown', $rows);
// Media Ran
$SQL = 'SELECT display.Display, media.Name, COUNT(StatID) AS NumberPlays, SUM(TIME_TO_SEC(TIMEDIFF(end, start))) AS Duration, MIN(start) AS MinStart, MAX(end) AS MaxEnd ';
$SQL .= ' FROM stat ';
$SQL .= ' INNER JOIN display ON stat.DisplayID = display.DisplayID ';
$SQL .= ' INNER JOIN media ON media.MediaID = stat.MediaID ';
$SQL .= " WHERE stat.type = 'media' ";
$SQL .= sprintf(" AND stat.end > '%s' ", $fromDt);
$SQL .= sprintf(" AND stat.start <= '%s' ", $toDt);
$SQL .= ' AND stat.displayID IN (' . implode(',', $display_ids) . ') ';
if ($mediaId != 0) {
$SQL .= sprintf(" AND media.MediaID = %d ", $mediaId);
}
if ($displayId != 0) {
$SQL .= sprintf(" AND stat.displayID = %d ", $displayId);
}
$SQL .= 'GROUP BY display.Display, media.Name ';
$SQL .= 'ORDER BY display.Display, media.Name';
if (!($results = $this->db->query($SQL))) {
trigger_error($db->error());
trigger_error(__('Unable to get Library Media Ran'), E_USER_ERROR);
}
$rows = array();
while ($row = $db->get_assoc_row($results)) {
$row['Display'] = Kit::ValidateParam($row['Display'], _STRING);
$row['Media'] = Kit::ValidateParam($row['Name'], _STRING);
$row['NumberPlays'] = Kit::ValidateParam($row['NumberPlays'], _INT);
$row['DurationSec'] = Kit::ValidateParam($row['Duration'], _INT);
$row['Duration'] = sec2hms(Kit::ValidateParam($row['Duration'], _INT));
$row['MinStart'] = Kit::ValidateParam($row['MinStart'], _STRING);
$row['MaxEnd'] = Kit::ValidateParam($row['MaxEnd'], _STRING);
$rows[] = $row;
}
Theme::Set('table_media_shown', $rows);
// Media on Layouts Ran
$SQL = "SELECT display.Display, layout.Layout, IFNULL(media.Name, 'Text/Rss/Webpage') AS Name, COUNT(StatID) AS NumberPlays, SUM(TIME_TO_SEC(TIMEDIFF(end, start))) AS Duration, MIN(start) AS MinStart, MAX(end) AS MaxEnd ";
$SQL .= ' FROM stat ';
$SQL .= ' INNER JOIN display ON stat.DisplayID = display.DisplayID ';
$SQL .= ' INNER JOIN layout ON layout.LayoutID = stat.LayoutID ';
$SQL .= ' LEFT OUTER JOIN media ON media.MediaID = stat.MediaID ';
$SQL .= " WHERE stat.type = 'media' ";
$SQL .= sprintf(" AND stat.end > '%s' ", $fromDt);
//.........这里部分代码省略.........
示例9: About
/**
* Shows information about Xibo
* @return
*/
function About()
{
$response = new ResponseManager();
Theme::Set('version', VERSION);
// Render the Theme and output
$output = Theme::RenderReturn('about_text');
$response->SetFormRequestResponse($output, __('About'), '500', '500');
$response->AddButton(__('Close'), 'XiboDialogClose()');
$response->Respond();
}
示例10: ImportForm
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();
}
示例11: PermissionsForm
/**
* 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();
}
示例12: LibraryAssignView
/**
* Show the library
* @return
*/
function LibraryAssignView()
{
$db =& $this->db;
$user =& $this->user;
$response = new ResponseManager();
//Input vars
$mediatype = Kit::GetParam('filter_type', _POST, _STRING);
$name = Kit::GetParam('filter_name', _POST, _STRING);
// Get a list of media
$mediaList = $user->MediaList($mediatype, $name);
$rows = array();
// Add some extra information
foreach ($mediaList as $row) {
$row['duration_text'] = sec2hms($row['duration']);
$row['list_id'] = 'MediaID_' . $row['mediaid'];
$rows[] = $row;
}
Theme::Set('table_rows', $rows);
// Render the Theme
$response->SetGridResponse(Theme::RenderReturn('library_form_assign_list'));
$response->callBack = 'LibraryAssignCallback';
$response->pageSize = 5;
$response->Respond();
}
示例13: DeleteForm
/**
* 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 . '" />');
$form = Theme::RenderReturn('help_form_delete');
$response->SetFormRequestResponse($form, __('Delete Help Link'), '350px', '175px');
$response->AddButton(__('No'), 'XiboDialogClose()');
$response->AddButton(__('Yes'), '$("#HelpDeleteForm").submit()');
$response->Respond();
}
示例14: tidyLibraryForm
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();
}
示例15: EditForm
/**
* Return the Edit Form as HTML
* @return
*/
public function EditForm()
{
$db =& $this->db;
$layoutid = $this->layoutid;
$regionid = $this->regionid;
$mediaid = $this->mediaid;
// Can this user edit?
if (!$this->auth->edit) {
$this->response->SetError('You do not have permission to edit this media.');
$this->response->keepOpen = false;
return $this->response;
}
Theme::Set('form_id', 'ModuleForm');
Theme::Set('form_action', 'index.php?p=module&mod=' . $this->type . '&q=Exec&method=EditMedia');
Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutid . '"><input type="hidden" id="iRegionId" name="regionid" value="' . $regionid . '"><input type="hidden" name="showRegionOptions" value="' . $this->showRegionOptions . '" /><input type="hidden" id="mediaid" name="mediaid" value="' . $mediaid . '">');
// Get the embedded HTML out of RAW
$rawXml = new DOMDocument();
$rawXml->loadXML($this->GetRaw());
Debug::LogEntry('audit', 'Raw XML returned: ' . $this->GetRaw());
// Get the HTML Node out of this
$textNodes = $rawXml->getElementsByTagName('embedHtml');
$textNode = $textNodes->item(0);
Theme::Set('embedHtml', $textNode->nodeValue);
$textNodes = $rawXml->getElementsByTagName('embedScript');
$textNode = $textNodes->item(0);
Theme::Set('embedScript', $textNode->nodeValue);
Theme::Set('duration', $this->duration);
Theme::Set('durationFieldEnabled', $this->auth->modifyPermissions ? '' : ' readonly');
// Is the transparency option set?
if ($this->GetOption('transparency')) {
Theme::Set('transparency_checked', 'checked');
}
//Output the form
$form = Theme::RenderReturn('media_form_embedded_edit');
if ($this->showRegionOptions) {
$this->response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $layoutid . '®ionid=' . $regionid . '&q=RegionOptions")');
} else {
$this->response->AddButton(__('Cancel'), 'XiboDialogClose()');
}
$this->response->html = $form;
$this->response->dialogTitle = 'Edit Embedded HTML';
$this->response->dialogSize = true;
$this->response->dialogWidth = '650px';
$this->response->dialogHeight = '450px';
$this->response->AddButton(__('Save'), '$("#ModuleForm").submit()');
return $this->response;
}