- Timestamp:
- 11/03/11 10:30:40 (13 years ago)
- Location:
- Dev/trunk
- Files:
-
- 5 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/ApplicationConnector.php
r131 r144 11 11 * @author jkraaijeveld 12 12 */ 13 class ApplicationConnector implements IConnector {14 13 class ApplicationConnector implements IConnector { 14 15 15 protected $model; 16 16 protected $fileName = 'data/applications/applications.rdf'; … … 19 19 * Constructor for ApplicationConnector. 20 20 */ 21 public function __construct() 22 { 21 public function __construct() { 23 22 //Ensure the required folder for this connector exists 24 if (!is_dir('data/applications/')) 25 mkdir('data/applications/'); 23 if (!is_dir('data/applications/')) { 24 mkdir('data/applications/', null, true); 25 } 26 26 } 27 27 28 28 /** 29 29 * function load() … … 33 33 //Get the Memory Model from the ModelFactory 34 34 $this->model = ModelFactory::getDefaultModel(); 35 35 36 36 //Ensure the required file exists before loading 37 if (file_exists($this->fileName))37 if (file_exists($this->fileName)) 38 38 $this->model->load($this->fileName); 39 39 } 40 40 41 41 /** 42 42 * function save() … … 44 44 */ 45 45 public function save() { 46 $this->model->saveAs($this->fileName, 'rdf');46 $this->model->saveAs($this->fileName, 'rdf'); 47 47 } 48 48 49 49 /** 50 50 * function get($arguments) … … 58 58 $keys = array_keys($arguments); 59 59 //Set default values for arguments 60 $uid = "?uid"; $title = "?title"; $description = "?description"; $style = "?style"; 60 $uid = "?uid"; 61 $title = "?title"; 62 $description = "?description"; 63 $style = "?style"; 61 64 //Set the arguments if they are supplied 62 if (in_array("uid", $keys))63 $uid = "\"" .$arguments["uid"]."\"";64 if (in_array("title", $keys))65 $title = '\'' .$arguments["title"].'\'';66 if (in_array("description", $keys))67 $description = "\"" .$arguments["description"]."\"";68 if (in_array("style", $keys))69 $style = "\"" .$arguments["style"]."\"";65 if (in_array("uid", $keys)) 66 $uid = "\"" . $arguments["uid"] . "\""; 67 if (in_array("title", $keys)) 68 $title = '\'' . $arguments["title"] . '\''; 69 if (in_array("description", $keys)) 70 $description = "\"" . $arguments["description"] . "\""; 71 if (in_array("style", $keys)) 72 $style = "\"" . $arguments["style"] . "\""; 70 73 71 74 //Create the querystring … … 90 93 $results = $this->model->sparqlQuery($querystring); 91 94 $applications = array(); 92 if(!empty($results)) 93 { 95 if (!empty($results)) { 94 96 //Run over all results and create appropriate Application objets 95 foreach($results as $result) 96 { 97 $applications[] = new Application($result['?uid']->label, $result['?title']->label, $result['?description']->label, $result['?style']->label); 97 foreach ($results as $result) { 98 $applications[] = new Application($result['?uid']->label, $result['?title']->label, $result['?description']->label, $result['?style']->label); 98 99 } 99 100 } 100 101 return $applications; 101 102 } 102 103 103 104 /** 104 105 * function set() … … 107 108 * @param type $rToolObject: The ResearchToolObject to be saved. 108 109 */ 109 public function set($rToolObject) 110 { 110 public function set($rToolObject) { 111 111 $this->load(); 112 $resourceApplication = new Resource(APPLICATION .'/'.$rToolObject->uid);112 $resourceApplication = new Resource(APPLICATION . '/' . $rToolObject->uid); 113 113 //Remove the old value stored with the given id 114 114 $this->model->subtract($this->model->find($resourceApplication, null, null)); … … 117 117 $resourceApplicationType = new Resource(APPLICATION); 118 118 $predicateRType = new Resource(RTYPE); 119 $this->model->add(new Statement($resourceApplication, $predicateRType,$resourceApplicationType));120 119 $this->model->add(new Statement($resourceApplication, $predicateRType, $resourceApplicationType)); 120 121 121 $literalApplicationID = new Literal($rToolObject->uid); 122 122 $predicateUniqueID = new Resource(UID); 123 $this->model->add(new Statement($resourceApplication, $predicateUniqueID,$literalApplicationID));123 $this->model->add(new Statement($resourceApplication, $predicateUniqueID, $literalApplicationID)); 124 124 125 125 $applicationTitle = new Literal($rToolObject->title); 126 $predicateTitle = new Resource(TITLE); 127 $this->model->add(new Statement($resourceApplication, $predicateTitle,$applicationTitle));126 $predicateTitle = new Resource(TITLE); 127 $this->model->add(new Statement($resourceApplication, $predicateTitle, $applicationTitle)); 128 128 129 129 $applicationDescription = new Literal($rToolObject->description); 130 130 $predicateDescription = new Resource(DESCRIPTION); 131 $this->model->add(new Statement($resourceApplication, $predicateDescription,$applicationDescription));131 $this->model->add(new Statement($resourceApplication, $predicateDescription, $applicationDescription)); 132 132 133 133 $applicationStyle = new Literal($rToolObject->style); 134 134 $predicateStyle = new Resource(STYLE); 135 $this->model->add(new Statement($resourceApplication, $predicateStyle,$applicationStyle));136 137 135 $this->model->add(new Statement($resourceApplication, $predicateStyle, $applicationStyle)); 136 137 $this->save(); 138 138 } 139 139 140 } 140 141 -
Dev/trunk/classes/DisplayStep.php
r142 r144 18 18 public $imageURL; 19 19 public $selected = false; 20 public $name; 20 public $caption; 21 public $id; 21 22 22 public function __construct($t, $ref=null, $ n) {23 23 public function __construct($t, $ref=null, $c, $id) { 24 24 25 $this->type = $t; 25 26 $this->reference = $ref; 26 $this->name = $n; 27 27 $this->caption = $c; 28 $this->id = $id; 29 28 30 switch ($this->type) { 29 31 case "Questionnaire": 30 $this->imageURL = "images/icons/questionnaire 2.png";32 $this->imageURL = "images/icons/questionnaire.png"; 31 33 break; 32 34 case "Dashboard": 33 $this->imageURL = "images/icons/dashboard 2.png";35 $this->imageURL = "images/icons/dashboard.png"; 34 36 break; 35 37 case "Application": 36 $this->imageURL = "images/icons/application2.png"; 37 break; 38 case "Notice": 39 $this->imageURL = "images/icons/notice2.png"; 38 $this->imageURL = "images/icons/application.png"; 40 39 break; 41 40 default: … … 43 42 break; 44 43 } 45 44 46 45 //output a display object 47 echo '<div class="displayStep" style="background-image: url(\''; 48 echo $this->imageURL; 49 echo '\');" ><p>'.$this->name.'</p></div>'."\n"; 50 46 //echo '<div class="displayStep"><div class="displayStepIcon" style="background-image: url('.$this->imageURL.');"></div>'.$this->caption.'</div>'."\n"; 47 echo '<div class="displayStep"><div class="displayStepIcon"><img src="' . $this->imageURL . '" /></div>' . $this->caption . '</div>'; 51 48 } 52 49 -
Dev/trunk/css/awesome.css
r142 r144 59 59 background-image: url('../images/bg/blueishgridblock.png'); 60 60 height: 100%; 61 font-size: 12px; 61 62 } 62 63 … … 586 587 #sequencer { 587 588 width: 100%; 588 margin: 0 auto auto auto; 589 background-image: url('../images/bg/sequencerBG.png'); 589 margin: 0 auto 0 auto; 590 /*background-image: url('../images/bg/sequencerBG.png');*/ 591 background-image: linear-gradient(top, #B0B0B0 21%, #888888 80%); 592 background-image: -o-linear-gradient(top, #B0B0B0 21%, #888888 80%); 593 background-image: -moz-linear-gradient(top, #B0B0B0 21%, #888888 80%); 594 background-image: -webkit-linear-gradient(top, #B0B0B0 21%, #888888 80%); 595 background-image: -ms-linear-gradient(top, #B0B0B0 21%, #888888 80%); 596 597 background-image: -webkit-gradient( 598 linear, 599 left top, 600 left bottom, 601 color-stop(0.21, #B0B0B0), 602 color-stop(0.8, #888888) 603 ); 590 604 background-position: bottom; 591 605 background-repeat: repeat-x; … … 597 611 margin-top:0.5em; 598 612 margin-left: 1em; 599 font-size: 1.2 em;613 font-size: 1.25em; 600 614 color: #FFF; 601 615 602 616 } 603 617 604 #sequencer #seqContent { 605 height: 10em; 618 #sequencer .seqContent { 619 height: 9em; 620 overflow-x: scroll; 621 overflow-y: hidden; 606 622 margin-bottom: 0.5em; 607 background-image: url('../images/bg/sequencerContentBG.png'); 608 /*background-position: top; 609 background-color: #dddddd;*/ 623 624 background-image: linear-gradient(top, #B0B0B0 21%, #888888 80%); 625 background-image: -o-linear-gradient(top, #B0B0B0 21%, #888888 80%); 626 background-image: -moz-linear-gradient(top, #B0B0B0 21%, #888888 80%); 627 background-image: -webkit-linear-gradient(top, #B0B0B0 21%, #888888 80%); 628 background-image: -ms-linear-gradient(top, #B0B0B0 21%, #888888 80%); 629 background-image: -webkit-gradient( 630 linear, 631 left bottom, 632 left top, 633 color-stop(0.25, #B0B0B0), 634 color-stop(0.8, #888888) 635 ); 636 610 637 border: 1px solid #ddd; 611 638 -moz-border-radius: 0.5em; … … 620 647 } 621 648 622 #seqContent .displayStep {649 .seqContent .displayStep { 623 650 /*height: 140px;*/ 624 width: 100px; 651 width: 52px; 652 padding: 0; 625 653 margin: 10px 0 0 0; 626 654 background-repeat: no-repeat; … … 629 657 } 630 658 631 #seqContent .displayStep p{ 632 margin-top: 105px; 659 .seqContent .displayStep .displayStepIcon { 660 width: 50px; 661 height: 50px; 662 border: 2px solid #444444; 663 color: #FFF; 664 float: left; 665 } 666 667 .seqContent .displayStep p{ 668 margin-top: 55px; 633 669 font-weight: normal; 634 670 font-size: 0.875em; 671 float: left; 635 672 636 673 } 637 674 638 #seqContent .divider {675 .seqContent .divider { 639 676 width: 10px; 640 height: 100px;641 margin: 10px 5px 0 10px;677 height: 50px; 678 margin: 10px 15px 0 20px; 642 679 background-image: url('../images/ui/sequencerDivider.png'); 643 680 float: left; 644 681 } 645 682 683 684 685 686 687 646 688 /* 647 Toolbox 689 * 690 * 691 * TOOLBOX 692 * 693 * 648 694 */ 649 695 650 696 #toolbox { 651 width: 40%; 652 float: left; 653 background-image: url('../images/bg/sequencerBG.png'); 697 /*width: 40%;*/ 698 float: left; 699 /*background-image: url('../images/bg/sequencerBG.png');*/ 700 background-image: linear-gradient(top, #B0B0B0 21%, #888888 80%); 701 background-image: -o-linear-gradient(top, #B0B0B0 21%, #888888 80%); 702 background-image: -moz-linear-gradient(top, #B0B0B0 21%, #888888 80%); 703 background-image: -webkit-linear-gradient(top, #B0B0B0 21%, #888888 80%); 704 background-image: -ms-linear-gradient(top, #B0B0B0 21%, #888888 80%); 705 706 background-image: -webkit-gradient( 707 linear, 708 left top, 709 left bottom, 710 color-stop(0.25, #B0B0B0), 711 color-stop(0.8, #888888) 712 ); 713 654 714 } 655 715 … … 659 719 margin-top:0.5em; 660 720 margin-left: 1em; 661 font-size: 1.2 em;721 font-size: 1.25em; 662 722 color: #FFF; 663 723 } 664 724 665 #toolbox .displayStep { 666 height: 140px; 667 width: 100px; 668 margin: 0 5px 0 5px; 669 background-repeat: no-repeat; 670 float: left; 671 text-align: center; 672 } 673 674 #toolbox .displayStep p { 675 margin-top: 105px; 676 color: #FFF; 677 } 725 #toolbox .creationButton { 726 height: 50px; 727 margin: 0 0 5px 0; 728 border: 1px solid #000; 729 border-radius: 5px; 730 -moz-border-radius: 5px; 731 } 732 733 #toolbox .creationButton:hover { 734 border: 1px solid #FFF; 735 background: rgba(255, 255, 255, 0.2); 736 } 737 738 #toolbox .buttonIcon { 739 margin: 0 10px 0 5px; 740 float: left; 741 } 742 743 #toolbox .creationButton p { 744 margin: 15px 10px 0 0; 745 color: #444; 746 float: left; 747 } -
Dev/trunk/pipelineEditor.php
r142 r144 2 2 require 'classes/master.php'; //should be at top of every page 3 3 4 /*5 if(isset($_SESSION['username'])){ //user is logged in6 //get pipeline contents from database, and store in displayObject() array "pipelineSteps"7 //nu nog even gewoon een hardcoded workaround8 foreach ()9 4 10 } 11 * */ 5 $pipeline = $_SESSION['currentPipeline']; 12 6 13 // generate a random array of pipeline contents 14 $displaySteps = array(); // array containing a number of random-generated stings "$type", to fill up the sequencer 15 $numSteps = 9; // number of steps to random-generate for testing purposes. 16 $maxNumSteps = 9; // maximum number of steps that can be displayed in the sequencer (without scrollbars, at current) 7 // generate a set array of pipeline contents, in lieue of working database interface 8 //if (isset($pipeline)){ 9 //$pipeline = array(new Step("Questionnaire", "Questionnaire 1", 1), new Step("Dashboard", "Dashboard 1", 2), new Step("Application", "Application 1", 3)); 10 //} 11 //else { 12 $pipeline = $_SESSION['currentPipeline']; 13 //} 17 14 18 for ($n = 1; $n <= $numSteps; $n++) { // fill the array of types 19 $rnd = rand(1, 4); 20 switch ($rnd) { 21 case 1: 22 $type = "Dashboard"; 23 break; 24 case 2: 25 $type = "Questionnaire"; 26 break; 27 case 3: 28 $type = "Notice"; 29 break; 30 case 4: 31 $type = "Application"; 32 break; 33 default: 34 $type = "Questionnaire"; 35 break; 36 } 37 $displaySteps[] = $type; 15 if (isset($_POST['objectToCreate'])){ 16 $pipeline[] = new Step($_POST['objectToCreate'], $_POST['objectToCreate']." NEW", 4); 17 unset($_POST); 38 18 } 39 19 20 $_SESSION['currentPipeline'] = $pipeline; 21 22 $pipelineCount = 3; 40 23 $pipelineName = "Test pipeline"; 24 25 $dbi = new DatabaseInterface(); //mkdir error?!?!?! 41 26 ?> 42 27 … … 46 31 --> 47 32 <!DOCTYPE html> 33 48 34 <html> 49 35 <head> … … 53 39 <script type="text/javascript" src="js/menu.js"></script> 54 40 <script type="text/javascript" src="js/jquery.jps"></script> 41 <script type="text/javascript" src="js/editorScripts.js"></script> 55 42 </head> 56 43 <body> 57 <div id=" logo">44 <div id="header"> 58 45 <?php new Logo(); ?> 59 46 </div> … … 61 48 <div id="wrapper"> 62 49 <div id="content"> 63 <form action="pipelineEditor.php" method="POST"> 64 65 <fieldset id="sequencer"> 66 67 <div class="title">Name: <?php echo $pipelineName; ?></div> 68 69 <div id="seqContent"> 70 <?php 71 $n = 0; 72 foreach ($displaySteps as $displayStep) { 73 if ($n <= $maxNumSteps) { 74 $n++; 75 new DisplayStep($displayStep, null, "Step " . $n); 76 if ($n != $numSteps){ 77 echo "<div class='divider'></div>"; 78 } 79 } 80 } 81 ?> 82 </div> 83 84 <div id="controls"> 85 <input type="submit" name="moveSelectedLeft" value="< Move" class="surveyButton" /> 86 <input type="submit" name="moveSelectedRight" value="Move >" class="surveyButton" /> 87 <input type="submit" name="editSelected" value="Edit step" class="surveyButton" /> 88 <input type="submit" name="deleteSelected" value="Delete step" class="surveyButton" /> 89 <input type="hidden" name="selectedStep" /> 90 </div> 91 92 </fieldset> 93 94 <br /> 95 <fieldset id="toolbox"> 96 <div class="title">Toolbox</div> 97 <?php 98 new DisplayStep("Questionnaire", null, "Questionnaire"); 99 new DisplayStep("Notice", null, "Notice"); 100 new DisplayStep("Application", null, "Application"); 101 new DisplayStep("Dashboard", null, "Dashboard"); 102 ?> 103 </fieldset> 104 </form> 50 <?php new pipelineSequencer($pipeline); ?> 51 <?php new Toolbox(); ?> 105 52 </div> 106 53 </body> -
Dev/trunk/register.php
r65 r144 6 6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 7 7 <title>Facilitator</title> 8 <?php new StyleSheet( ); ?>8 <?php new StyleSheet("awesome"); ?> 9 9 <script type="text/javascript" src="js/menu.js"></script> 10 10 </head>
Note: See TracChangeset
for help on using the changeset viewer.