예제 #1
0
if (!isset($APP)) {
    die;
}
// $default_controller = $APP['controller_path'].'/aspect_controller.php';
$default_controller = 'src/controllers/aspect_controller.php';
$action = 'new_aspect_type';
$form_id = 'new_aspect_type_form';
$id = NULL;
if (isset($_GET['id'])) {
    $id = (int) trim($_GET['id']);
}
if (isset($_GET['aspect_group'])) {
    $ag = (int) trim($_GET['aspect_group']);
}
$current_aspect_group = new AspectGroup();
$current_aspect_group->load($ag);
$assigned_aspects_array = $current_aspect_group->get_group_members();
$unassigned_aspects_array = $current_aspect_group->get_nongroup_members();
// now we need all the aspects that AREN'T in the group already as an array.
// Dropdowns are here if you need them.
// $dropdowns = new HTMLDropDown;
?>


<div class="col-xs-6 panel" style="height: 400px; overflow: scroll;">
	<h4>Available Aspect Types</h4>

	<ul id="sortable1" class="connectedSortable">
	<?php 
foreach ($unassigned_aspects_array as $k => $v) {
    ?>
예제 #2
0
 * @since      File included in initial release
 *
 */
if (!isset($APP)) {
    die;
}
$current_subject = new Subject();
$current_aspect_group = new AspectGroup();
// $default_controller = $APP['controller_path'].'/aspect_controller.php';
$default_controller = 'src/controllers/aspect_controller.php';
$post_data = 'action: "add_aspect_to_subject"';
$id = NULL;
if (isset($_GET['id'])) {
    $id = (int) trim($_GET['id']);
    $current_subject->load($id);
    $current_aspect_group->load($current_subject->get_aspect_group_id());
}
?>


<form class="form-horizontal" id="new_aspect_form"
	enctype="multipart/form-data">
	<fieldset>


		<!-- Form Name -->
		<legend>Add a new Aspect</legend>


		<input name="subject_id" type="hidden"
			value="<?php 
csfr_protection();
$db = Database::get_instance();
$action = NULL;
if (isset($_POST['action'])) {
    $action = trim($_POST['action']);
}
if (isset($action)) {
    $new_aspect_group = new AspectGroup();
    switch ($action) {
        case "new_aspect_group":
            $new_aspect_group->group_name = $_POST['group_name'];
            $new_aspect_group->save();
            echo "new aspect group added.";
            break;
        case "view_aspect_group":
            $new_aspect_group->load($_POST['id']);
            $output = '<h2>Viewing ' . $new_aspect_group->group_name . ' aspects</h2>';
            $output .= '<ul>';
            foreach ($new_aspect_group->aspects as $as) {
                $output .= '<li>' . $as->aspect_name . '</li>';
            }
            $output .= '</ul>';
            echo $output;
            break;
        case "add_type_to_group":
            $new_aspect_group->load($_POST['aspect_group_id']);
            $new_aspect_group->quick_add_aspect_type($_POST['aspect_type_id']);
            break;
        case "remove_type_from_group":
            $new_aspect_group->load($_POST['aspect_group_id']);
            $new_aspect_group->quick_remove_aspect_type($_POST['aspect_type_id']);