Changeset 80
- Timestamp:
- 08/09/11 14:48:35 (14 years ago)
- Location:
- Dev/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/applicationcreation.php
r78 r80 1 1 <?php 2 2 require 'classes/master.php'; 3 4 var_dump($_POST); 3 5 4 6 if (is_null($_SESSION['username'])) … … 16 18 17 19 $applicationDBI = new ApplicationDatabaseInterface($id); 18 $applicationDBI->setApplicationInfo($application); 20 $applicationDBI->setApplicationInfo($_POST); 21 } 22 else if(isset($_POST['applicationTitle'])) 23 { 24 $title = $_POST['applicationTitle']; 25 $description = $_POST['applicationDescription']; 26 $application = new Application($title, $description); 27 28 $applicationDBI = new ApplicationDatabaseInterface(null); 29 $applicationDBI->setApplicationInfo($_POST); 19 30 } 20 31 -
Dev/trunk/classes/ApplicationDatabaseInterface.php
r78 r80 28 28 public function setApplicationInfo($applicationInfo) 29 29 { 30 $appTitle = $application ['applicationTitle'];31 $appDescription = $application ['applicationDescription'];32 $appStyle = $application['applicationStyle'];30 $appTitle = $applicationInfo['applicationTitle']; 31 $appDescription = $applicationInfo['applicationDescription']; 32 $appStyle = null; 33 33 34 34 $this->applicationRDFWriter->setApplicationInfo($appTitle, $appDescription, $appStyle); … … 56 56 57 57 $resultApplication = $this->applicationRDFReader->readAllApplications(); 58 59 for($aNumber = 0;$aNumber< =sizeof($resultApplication[0]);$aNumber++)58 59 for($aNumber = 0;$aNumber<sizeof($resultApplication[0]);$aNumber++) 60 60 { 61 61 $aID = substr($resultApplication[0][$aNumber]['?uid'],9,strlen($resultApplication[0][$aNumber]['?uid'])-11); 62 $aTitle = substr($resultApplication[1][$aNumber]['?title'],9,strlen($resultApplication[ 0][$aNumber]['?title'])-11);62 $aTitle = substr($resultApplication[1][$aNumber]['?title'],9,strlen($resultApplication[1][$aNumber]['?title'])-11); 63 63 $applicationInfo[$aID] = $aTitle; 64 64 } -
Dev/trunk/classes/ApplicationRDFWriter.php
r62 r80 15 15 16 16 if(file_exists($this->fileName)) 17 $this->model->load($this->fileName);17 $this->model->load($this->fileName); 18 18 } 19 19 20 20 public function saveApplications() 21 21 { 22 $this->model->saveAs($ fileName,'rdf');22 $this->model->saveAs($this->fileName,'rdf'); 23 23 } 24 24 -
Dev/trunk/classes/SessionDatabaseInterface.php
r78 r80 62 62 63 63 foreach ($resultSession[1][1] as $surveyInfo) 64 { 65 64 { 65 $surveyUID = substr($surveyInfo['?uid'],9,strlen($surveyInfo['?uid'])-11); 66 $surveyIndex = substr($surveyInfo['?index'],9,strlen($surveyInfo['?index'])-11); 67 $sessionInfo[$surveyIndex . 's'] = $surveyUID; 68 } 69 foreach ($resultSession[1][2] as $applicationInfo) 70 { 71 $applicationUID = substr($applicationInfo['?uid'],9,strlen($applicationInfo['?uid'])-11); 72 $applicationIndex = substr($applicationInfo['?index'],9,strlen($applicationInfo['?index'])-11); 73 $sessionInfo[$applicationIndex . 'a'] = $applicationUID; 74 } 75 foreach ($resultSession[1][3] as $dashboardInfo) 76 { 77 $dashboardUID = substr($dashboardInfo['?uid'],9,strlen($dashboardInfo['?uid'])-11); 78 $dashboardIndex = substr($dashboardInfo['?index'],9,strlen($dashboardInfo['?index'])-11); 79 $sessionInfo[$dashboardIndex . 's'] = $dashboardUID; 66 80 } 67 81 } … … 69 83 public function getExistingSessions() 70 84 { 71 85 $sessionIDs = array(); 86 $sessions = array(); 87 88 if($handle = opendir('data/sessions/')) 89 { 90 while (false !== ($file = readdir($handle))) { 91 if(strstr($file, 'session_')) 92 $sessionIDs[] = substr($file,7,strlen($file)-11); 93 } 94 } 95 96 foreach($sessionIDs as $sessionID) 97 { 98 $sessionTitle = $this->sessionRDFReader->getSessionTitleByID($sessionID); 99 $$sessions[$sessionID] = substr($sessionTitle[0]['?title'],9,strlen($sessionTitle[0]['?title'])-11); 100 } 101 102 return $surveys; 72 103 } 73 104 } -
Dev/trunk/classes/SessionRDFReader.php
r78 r80 112 112 return $result; 113 113 } 114 115 public function getSessionTitleByID($sessionID) 116 { 117 // Create empty MemModel 118 $factory = new ModelFactory(); 119 $tempmodel= $factory->getDefaultModel(); 120 $tempmodel->load('data/sessions/session_'.$sessionID.'/session_'.$sessionID.'.rdf'); 121 122 $querystring = ' 123 PREFIX predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '> 124 PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '> 125 SELECT ?title 126 WHERE 127 { 128 _session predicates:resource_type resources:session ; 129 predicates:title ?title 130 }'; 131 132 $result = $tempmodel->sparqlQuery($querystring); 133 134 return $result; 135 } 114 136 } 115 137 -
Dev/trunk/classes/SurveyDatabaseInterface.php
r62 r80 120 120 return $surveys; 121 121 } 122 123 public function getSurveyTitleByID($surveyID) 124 { 125 $surveyTitleLiteral = $this->surveyRDFReader->getSurveyTitleByID($surveyID); 126 $surveyTitle = substr($surveyTitle[0]['?title'],9,strlen($surveyTitle[0]['?title'])-11); 127 128 return $surveyTitle; 129 } 122 130 123 131 } -
Dev/trunk/survey.php
r78 r80 2 2 require 'classes/master.php'; 3 3 4 var_dump($_POST);4 //var_dump($_POST); 5 5 6 6 if (is_null($_SESSION['username'])) … … 16 16 $savedSurvey = Survey::getSurvey($info); 17 17 18 //var_dump($_POST);18 var_dump($_POST); 19 19 } 20 20 else -
Dev/trunk/surveycreation.php
r59 r80 18 18 } 19 19 20 /* AUTOSAVE */ else if (isset($_POST['timeStamp'])) { 20 /* AUTOSAVE */ 21 else if (isset($_POST['timeStamp'])) { 21 22 $timeStamp = $_POST['timeStamp']; 22 23
Note: See TracChangeset
for help on using the changeset viewer.