function showDocumenation() { $returnStr = $this->showResearchHeader(Language::messageSMSTitle()); $returnStr .= '<div id="wrap">'; $returnStr .= $this->showNavBar(); $returnStr .= '<div class="container"><p>'; //CONTENT $returnStr .= '<ol class="breadcrumb">'; $returnStr .= '<li class="active">' . Language::labelOutputDocumentation() . '</li>'; $returnStr .= '</ol>'; $communication = new Communication(); $files = array(); $communication->getScriptFiles($files, 'documentation'); $oldDirStr = ''; if (sizeof($files) > 0) { foreach ($files as $file) { $ext = pathinfo($file, PATHINFO_EXTENSION); if ($ext == 'html' || $ext == 'doc' || $ext == 'docx') { $dirStr = ''; $dir = preg_replace('#/+#', '', dirname($file)); if ($dir != '') { $dirStr = $dir . ': '; } if ($oldDirStr != $dirStr && $oldDirStr != '') { $returnStr .= '<hr>'; } $oldDirStr = $dirStr; $returnStr .= $dirStr . '<a href="documentation' . $file . '" target="_blank">' . basename($file) . '</a><br/>'; } } } else { $returnStr .= $this->displayWarning(Language::labelResearcherNoDocs()); } //ENDCONTENT $returnStr .= '</p></div> </div>'; //container and wrap $returnStr .= $this->showBottomBar(); $returnStr .= $this->showFooter(false); return $returnStr; }
function showScriptUpdateRes() { /* update last page */ $_SESSION['LASTPAGE'] = 'sysadmin.sms.update'; $communication = new Communication(); //load script in mysql (from /var/haalsi/scripts .. follow same directy structure //filename + content in _communication $files = array(); $communication->getScriptFiles($files, '/var/haalsi/scripts'); $displaySms = new DisplaySms(); if (true || sizeof($files) > 0) { $selected = loadvar("iwers"); //echo $selected; if (!is_array($selected)) { $selected = array($selected); } if (loadvar("iwers") == "") { $message = $displaySms->displayInfo(Language::labelSMSLaptopSelectInterviewers()); return $displaySms->showScriptUpdate($message); } else { $users = new Users(); $users = $users->getUsers(); foreach ($files as $key => $file) { //$message .= $key . ':' . $file . '<br/>'; foreach ($users as $user) { if ($user->getUserType() == USER_INTERVIEWER) { //interviewer: get update ready! if (inArray($user->getUrid(), $selected) || inArray(-1, $selected)) { //this should be per laptop (id on macaddress??), not interviewer //$communication->addScriptToUser($key, $file, $user->getUrid()); } } } //$communication->addScriptToUser($key, $file, 14); } $message = $displaySms->displaySuccess(Language::labelSMSLaptopScriptUpdateReady()); } } else { $message = $displaySms->displayInfo(Language::labelSMSLaptopScriptUpdateNoFiles(dbConfig::defaultFileLocation())); return $displaySms->showScriptUpdate($message); } return $this->showMetaDataUpdate($message); }