Ignore:
Timestamp:
08/09/11 14:48:35 (14 years ago)
Author:
basvannuland
Message:

Application save load from db should work. styles not part of save yet.
More work on session save load

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/classes/SessionDatabaseInterface.php

    r78 r80  
    6262       
    6363        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;
    6680        }
    6781    }
     
    6983    public function getExistingSessions()
    7084    {
    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;
    72103    }
    73104}
Note: See TracChangeset for help on using the changeset viewer.