*/
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) {
Esempio n. 2
0
 * Commons Attribution-NonCommercial-ShareAlike 3.0 
 * United States. (http://creativecommons.org/licenses/by-nc-sa/3.0/us/).  
 * For more information, contact Ian Monroe: ian@ianmonroe.com
 *
 * @author     Ian Monroe <*****@*****.**>
 * @copyright  2016
 * @version    0.1 ALPHA UNSTABLE
 * @link       http://www.ianmonroe.com
 * @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>
 * @copyright  2016
 * @version    0.1 ALPHA UNSTABLE
 * @link       http://www.ianmonroe.com
 * @since      File included in initial release
 *
 */
// bootstrap the rest of the codebase.
require_once '../config.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;