function displayForm() { global $userID, $userName, $videoID, $authorizedUsers, $classes, $classID; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>User Interface Configuration</title> <script type="text/javascript" src="kaltura-html5player-widget/jquery-1.4.2.min.js"></script> <script type="text/javascript"> function jumpBoxClass(list) { var url = "configure_ui.php?class_id=" + $('#class').val(); //alert(list.options[list.selectedIndex].value); console.log("jumpBoxClass " + url); location.href = url; } $(document).ready(function() { $('#update-conversion-status').click(function() { //alert('Handler for .click() called.'); window.location.reload() }); }); function updateN(id) { var trendlineID = '#' + id + '_trendline_visibility'; console.log("target " + trendlineID); console.log( $(trendlineID).val()); var numberID = '#' + id + '_number'; if ("by-default" == $(trendlineID).val()) { // if option value is BY_DEFAULT then set text input to zero and readonly console.log("target match"); $(numberID).attr('readonly', 'readonly'); $(numberID).attr('value', 0); } else { $(numberID).attr('readonly', ''); } } </script> <link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="admin-page.css" /> </head> <body> <div id="wrapper"> <?php printAdminBar(false, $userName); ?> <div style="clear:both"></div> <strong>User Interface Configuration</strong> <br /> <br /> <label style="font-size:100%">select class <select name="class" id="class" onchange="jumpBoxClass()"> <?php //print "classID: $classID"; foreach ($classes as $class) { //print_r($class); $ID = $class['ID']; $name = $class['name']; $classID == $ID ? $selected = "selected=\"selected\"" : ($selected = ""); print "\t<option value=\"{$ID}\" {$selected}>{$name}</option>\n"; } ?> </select> </label> <form id="form1" name="form1" method="post" action="" > <table style="width:800px;height:auto;"> <thead> <tr style="border-bottom:1px solid black"> <th>user name</th> <th>annotation mode</th> <th>annotations enabled</th> <th>group annotations visible</th> <th>N days</th> </tr> </thead> <tbody> <?php $users = getClassList($classID); //print_r($users); foreach ($users as $user) { //print_r($user); // if the userName is not initialized " " == $user['name'] ? $userName = "******" : ($userName = $user['name']); $userID = $user['ID']; // $email = $user['Email']; $userUI = getUI($userID); print '<div style="width:900px;"></div>'; //print_r($userUI); print "<br />"; // (in_array($userID, $authorizedUsers)) ? $selected="selected=\"selected\"" : $selected=""; $annotationMode = array("annotation", "PSYC"); $annotationsEnabled = array("yes", "no"); $trendlineVisSettings = array("by-default", "after-n-days"); ?> <tr style="border-bottom:1px solid black"> <td><?php echo "{$userName}"; ?> </td> <td> <select name="<?php echo $userID; ?> _annotation_mode" size="1" id="<?php echo $userID; ?> _annotation_mode"> <?php foreach ($annotationMode as $mode) { //print "mode: {$userUI['annotation_mode']}<br />"; $mode == $userUI['annotation_mode'] ? $selected = " selected " : ($selected = ""); ?> <option value="<?php echo $mode; ?> "<?php echo $selected; ?> ><?php echo $mode; ?> </option> <?php } ?> </select> </td> <td> <select name="<?php echo $userID; ?> _annotations_enabled" size="1" id="<?php echo $userID; ?> _annotations_enabled"> <?php foreach ($annotationsEnabled as $enabled) { //print "enabled: {$userUI['annotations_enabled']}<br />"; $enabled == $userUI['annotations_enabled'] ? $selected = " selected " : ($selected = ""); ?> <option value="<?php echo $enabled; ?> "<?php echo $selected; ?> ><?php echo $enabled; ?> </option> <?php } ?> </select> </td> <td> <select name="<?php echo $userID; ?> _trendline_visibility" size="1" id="<?php echo $userID; ?> _trendline_visibility" onChange="updateN(<?php echo $userID; ?> )" > <?php foreach ($trendlineVisSettings as $setting) { $setting == $userUI['trendline_visibility'] ? $selected = " selected " : ($selected = ""); BY_DEFAULT == $userUI['trendline_visibility'] ? $readonly = "readonly" : ($readonly = ""); ?> <option value="<?php echo $setting; ?> "<?php echo $selected; ?> ><?php echo $setting; ?> </option> <?php } ?> </select> </td> <td> <input name="<?php echo $userID; ?> _number" type="text" id="<?php echo $userID; ?> _number" value="<?php echo $userUI['n']; ?> " size="2" <?php echo $readonly; ?> /> </td> </tr> <?php } ?> <br /> </tbody> </table> <input type="submit" name="submit" id="submit" style="margin-left:720px;margin-top:10px;" value="update" /> </form> </div> <!-- wrapper for centering --> <div id="univbranding"><img src="icons/UBClogodarkgrey.jpg"></img></div> </body> </html> <?php }
<li><a href="#alien-abductions">Alien Abductions</a></li> <li><a href="#business-casual">Business Casual</a></li> <li><a href="#robots">Robots</a></li> <li><a href="#fireworks">Fireworks</a></li> </ul> </div> </div> </div><!-- /well --> <div class="well"> <h4>Side Widget Well</h4> <p>Bootstrap's default well's work great for side widgets! What is a widget anyways...?</p> </div><!-- /well --> </div> </div> </div><!-- /.container --> <div class="container"> <?php getUI('footer.php'); ?> </div><!-- /.container --> <!-- JavaScript --> <script src="js/jquery-1.10.2.js"></script> <script src="js/bootstrap.js"></script> <script src="js/modern-business.js"></script> </body> </html>
$httpsUrl = $host . $_SERVER['REQUEST_URI']; header('Location: ' . $httpsUrl); exit; } } $users = getUsers(); $currentUserInfo = getCurrentUserInfo($users); // Cache buster $git = __DIR__ . '/.git'; $cacheBuster = Directus\Util\Git::getCloneHash($git); $tableSchema = TableSchema::getAllSchemas($currentUserInfo['group']['id'], $cacheBuster); // $tabPrivileges = getTabPrivileges(($currentUserInfo['group']['id'])); $groupId = $currentUserInfo['group']['id']; $groups = getGroups(); $currentUserGroup = array(); if (isset($groups['rows']) && count($groups['rows'] > 0)) { foreach ($groups['rows'] as $group) { if ($group['id'] === $groupId) { $currentUserGroup = $group; break; } } } $statusMapping = array('active_num' => STATUS_ACTIVE_NUM, 'deleted_num' => STATUS_DELETED_NUM, 'status_name' => STATUS_COLUMN_NAME); $statusMapping['mapping'] = $config['statusMapping']; $data = array('cacheBuster' => $cacheBuster, 'nonces' => getNonces(), 'storage_adapters' => getStorageAdapters(), 'path' => DIRECTUS_PATH, 'page' => '#tables', 'tables' => parseTables($tableSchema), 'preferences' => parsePreferences($tableSchema), 'users' => $users, 'groups' => $groups, 'settings' => getSettings(), 'active_files' => getActiveFiles(), 'authenticatedUser' => $authenticatedUser, 'extensions' => getExtensions($currentUserGroup), 'privileges' => getPrivileges($groupId), 'ui' => getUI(), 'listViews' => getListViews(), 'messages' => getInbox(), 'bookmarks' => getBookmarks(), 'extendedUserColumns' => getExtendedUserColumns($tableSchema), 'statusMapping' => $statusMapping); $templateVars = array('cacheBuster' => $cacheBuster, 'data' => json_encode($data), 'path' => DIRECTUS_PATH, 'customFooterHTML' => getCusomFooterHTML(), 'cssFilePath' => getCSSFilePath(), 'cms_color' => '#89c33d'); if (isset($data['settings']) && isset($data['settings'][0]) && isset($data['settings'][0]['cms_color'])) { $templateVars['cms_color'] = $data['settings'][0]['cms_color']; } echo template(file_get_contents('main.html'), $templateVars);
// @NOTE: if the user doesn't have permission to view users // it should be log out // see: https://github.com/directus/directus/issues/1268 if (!$users) { AuthProvider::logout(); $_SESSION['error_message'] = 'Your user doesn\'t have permission to log in'; header('Location: ' . DIRECTUS_PATH . 'login.php'); exit; } $currentUserInfo = getCurrentUserInfo($users); // Cache buster $git = __DIR__ . '/.git'; $cacheBuster = Directus\Util\Git::getCloneHash($git); $tableSchema = TableSchema::getAllSchemas($currentUserInfo['group']['id'], $cacheBuster); // $tabPrivileges = getTabPrivileges(($currentUserInfo['group']['id'])); $groupId = $currentUserInfo['group']['id']; $groups = getGroups(); $currentUserGroup = []; if (isset($groups['rows']) && count($groups['rows'] > 0)) { foreach ($groups['rows'] as $group) { if ($group['id'] === $groupId) { $currentUserGroup = $group; break; } } } $statusMapping = ['active_num' => STATUS_ACTIVE_NUM, 'deleted_num' => STATUS_DELETED_NUM, 'status_name' => STATUS_COLUMN_NAME]; $statusMapping['mapping'] = $config['statusMapping']; $data = ['cacheBuster' => $cacheBuster, 'nonces' => getNonces(), 'storage_adapters' => getStorageAdapters(), 'path' => DIRECTUS_PATH, 'page' => '#tables', 'tables' => parseTables($tableSchema), 'preferences' => parsePreferences($tableSchema), 'users' => $users, 'groups' => $groups, 'settings' => getSettings(), 'active_files' => getActiveFiles(), 'authenticatedUser' => $authenticatedUser, 'extensions' => getExtensions($currentUserGroup), 'privileges' => getPrivileges($groupId), 'ui' => getUI(), 'locale' => get_user_locale(), 'localesAvailable' => parseLocalesAvailable(get_locales_available()), 'phrases' => get_phrases(get_user_locale()), 'timezone' => get_user_timezone(), 'timezones' => get_timezone_list(), 'listViews' => getListViews(), 'messages' => getInbox(), 'user_notifications' => getLoginNotification(), 'bookmarks' => getBookmarks(), 'extendedUserColumns' => getExtendedUserColumns($tableSchema), 'statusMapping' => $statusMapping]; $templateVars = ['cacheBuster' => $cacheBuster, 'data' => json_encode($data), 'path' => DIRECTUS_PATH, 'locale' => get_user_locale(), 'dir' => 'ltr', 'customFooterHTML' => getCusomFooterHTML(), 'cssFilePath' => getCSSFilePath()]; echo template(file_get_contents('main.html'), $templateVars);