예제 #1
0
     // do something.
     $new_aspect = new Aspect();
     $new_aspect->load((int) $_POST['aspect_id']);
     $new_aspect->aspect_type = (int) $_POST['aspect_type'];
     $new_aspect->aspect_data = $_POST['aspect_data'];
     $new_aspect->aspect_binary = NULL;
     $new_aspect->predicted_accuracty = NULL;
     $new_aspect->aspect_notes = $_POST['aspect_notes'];
     $new_aspect->aspect_source = $_POST['aspect_source'];
     $new_aspect->update();
     $output = 'Updated ' . $new_aspect->return_aspect_type_name() . '.';
     echo $output;
     break;
 case "delete_aspect":
     $new_aspect = new Aspect();
     $new_aspect->load($_POST['aspect_id']);
     $new_aspect->delete();
     echo "Deleted aspect.";
     break;
 case "new_aspect_type":
     $new_aspect_type = new AspectType();
     $new_aspect_type->aspect_groups[] = $_POST['aspect_group'];
     $new_aspect_type->aspect_name = $_POST['aspect_name'];
     $new_aspect_type->aspect_description = $_POST['aspect_description'];
     $new_aspect_type->markdown = $_POST['markdown'];
     $new_aspect_type->is_viewable = $_POST['viewable'];
     $new_aspect_type->save();
     echo "Added new aspect type.";
     break;
 default:
     new LogEntry(__FILE__ . " was hit with an invalid action, from IP: " . $_SERVER['HTTP_X_FORWARDED_FOR']);
예제 #2
0
 * @version    0.1 ALPHA UNSTABLE
 * @link       http://www.ianmonroe.com
 * @since      File included in initial release
 *
 */
if (!isset($APP)) {
    die;
}
$current_aspect = new Aspect();
$default_controller = 'src/controllers/aspect_controller.php';
$action = 'edit_aspect';
$form_id = 'edit_aspect_form';
$id = NULL;
if (isset($_GET['id'])) {
    $id = (int) trim($_GET['id']);
    $current_aspect->load($id);
}
// $current_aspect_group = new AspectGroup;
// $current_aspect_group->load($current_aspect->return_aspect_group_id());
// Dropdowns are here if you need them.
// $dropdowns = new HTMLDropDown;
?>


<form class="form-horizontal" id="<?php 
echo $form_id;
?>
">
	<fieldset>

		<!-- Form Name -->
예제 #3
0
 public function get_aspect_data($aspect_type_id)
 {
     // If the Aspect_type is present, return the data. Otherwise, return false.
     $output = false;
     if ($this->has_aspect($aspect_type_id)) {
         $a = new Aspect();
         $a->load($this->has_aspect($aspect_type_id));
         $output = $a->aspect_data;
     }
     return $output;
 }