示例#1
0
                }
                break;
            case 'popStudents':
                if (isset($_POST['roster'])) {
                    $roster = $_POST['roster'];
                    popStudents($csv, $roster);
                } else {
                    $output = ['success' => false, 'error' => 'No class roster selected'];
                    echo json_encode($output);
                }
                break;
            case 'error':
                errorCheck($csv);
                break;
            case 'class list':
                getClassList($csv);
                break;
            default:
                echo 'No action chosen';
                break;
        }
    } else {
        echo '<h2>No action chosen <a href=\'javascript:history.go(-1)\'>Return</a></h2>';
    }
} else {
    echo '<h2>No CSV data found <a href=\'javascript:history.go(-1)\'>Return</a></h2>';
}
function buildArray($csv)
{
    $output = [];
    $sData = str_getcsv($csv, "\n", $enclosure = '"');
示例#2
0
				
			</fieldset>
			<br/>
			<fieldset>
				<legend>
					<?php 
echo ucf(i18n("creating"));
?>
				</legend>
			
				<?php 
echo ucf(i18n("default new class"));
?>
				<select class="form" name="default_class_name">
				<?
					$classlist = getClassList();
					foreach ($classlist as $class_name)
					{
						$value = $object->getMeta("default_class_name", "");
						$selected = "";
						
						if (($class_name == $value) || ($class_name == "folder" && empty($value)))
							$selected = "selected";
							
						$class_name2 = $class_name;
						if ($class_name == "folder")
							$class_name2 = "";
					
						echo "<option $selected value=\"$class_name2\">".ucf(str_replace("_", " ", $class_name))."</option>";
					}
				?>
/**
 * File containing the script to restore missing relations from XML blocks
 *
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
 * @license For full copyright and license information view LICENSE file distributed with this source code.
 * @version 2014.11.1
 * @package update
 * @see Issue 19174
 */
require "autoload.php";
$script = eZScript::instance(array("description" => "eZ Publish missing relations sanitizer script (#19174).", "use-session" => false, "use-modules" => false, "use-extensions" => true));
$script->startup();
$options = $script->getOptions();
$script->initialize();
$cli = eZCLI::instance();
$affectedClasses = getClassList();
$languages = eZContentLanguage::fetchList();
if (count($languages) < 2) {
    $script->shutdown(0, "This upgrade script is only required for installations that have more than one language");
}
$totalUpdatedRelations = 0;
foreach ($affectedClasses as $affectedClassId => $classAttributeIdentifiers) {
    $count = eZContentObject::fetchListCount(array('contentclass_id' => $affectedClassId));
    if ($count > 0) {
        $done = 0;
        do {
            $objects = eZContentObject::fetchList(true, array('contentclass_id' => $affectedClassId), $done, 100);
            foreach ($objects as $object) {
                $updatedRelations = restoreXmlRelations($object, $classAttributeIdentifiers);
                if ($updatedRelations) {
                    $cli->output(str_repeat('.', $updatedRelations), false);
示例#4
0
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 
}