コード例 #1
0
ファイル: xicompiler.php プロジェクト: nubissurveying/nubis
 function addSection($seid, $questionsection = false)
 {
     $_SESSION['SURVEY_LANGUAGE'] = $this->survey->getDefaultLanguage($this->mode);
     // use main language
     $newxi = new XiCompiler($this->suid, $this->currentmode, $this->version);
     $newxi->generateRouting($seid);
     $this->routing_output[$this->seid][] = implode("", $newxi->getRoutingOutput($seid));
 }
コード例 #2
0
 function showXiCompileRes($content = "")
 {
     $returnStr = $this->showToolsHeader(Language::headerToolsXiCompiler());
     $returnStr .= $content;
     require_once "xicompiler.php";
     set_time_limit(0);
     $compile = loadvar("compile");
     $_SESSION['PARAMETER_RETRIEVAL'] = PARAMETER_SURVEY_RETRIEVAL;
     $xi = new XiCompiler($compile, loadvar("ximode"), getSurveyVersion());
     $xi->generateTypes();
     $xi->generateVariableDescriptives();
     $seid = getBaseSectionSeid($_SESSION["SUID"]);
     $xi->generateRouting($seid);
     $_SESSION['PARAMETER_RETRIEVAL'] = PARAMETER_ADMIN_RETRIEVAL;
     $returnStr .= '<div>
                         <ul class="nav nav-tabs" role="tablist">
                             <li role="presentation" class="active"><a href="#vars" aria-controls="vars" role="tab" data-toggle="tab">' . Language::linkVariables() . '</a></li>
                             <li role="presentation" class=""><a href="#types" aria-controls="types" role="tab" data-toggle="tab">' . Language::linkTypes() . '</a></li>
                             <li role="presentation" class=""><a href="#routing" aria-controls="routing" role="tab" data-toggle="tab">' . Language::linkRouting() . '</a></li>                            
                         </ul>
                         <div class="tab-content">';
     // variables
     $returnStr .= "<div role='tabpanel' class='tab-pane active' id='vars'><textarea class='form-control' name=variablestext id=variablestext style='width: min-width 500px; width: 100%; min-height: 800px; height: 100%'>";
     $returnStr .= "<?php\r\n\r\n" . implode("\r\n", $xi->getVariableDescriptivesOutput()) . "\r\n\r\n?>";
     $returnStr .= "</textarea></div>";
     // types
     $returnStr .= "<div role='tabpanel' class='tab-pane' id='types'><textarea class='form-control' name=typestext id=typestext style='width: min-width 500px; width: 100%; min-height: 800px; height: 100%'>";
     $returnStr .= "<?php\r\n\r\n" . implode("\r\n", $xi->getTypesOutput()) . "\r\n\r\n?>";
     $returnStr .= "</textarea></div>";
     // routing
     $returnStr .= "<div role='tabpanel' class='tab-pane' id='routing'><textarea class='form-control' name=routingtext id=routingtext style='width: min-width 500px; width: 100%; min-height: 800px; height: 100%'>";
     $returnStr .= "<?php\r\n\r\n" . implode("", $xi->getRoutingOutput($seid)) . "\r\n\r\n?>";
     $returnStr .= "</textarea></div>";
     $returnStr .= "</div></div>";
     $returnStr .= '</p></div>    </div>';
     //container and wrap
     $returnStr .= $this->showBottomBar();
     /*$returnStr .= $this->getCodeMirror();
       $returnStr .= '<script src="js/codemirror/mode/php/php.js"></script>';
       $returnStr .= '<script type="text/javascript">                
                           $(document).ready(function() {                
                               //var editor1 = CodeMirror.fromTextArea(document.getElementById("variablestext"), {lineNumbers: true, mode: "application/x-php"});
                               //var editor2 = CodeMirror.fromTextArea(document.getElementById("typestext"), {lineNumbers: true, mode: "application/x-php"});
                               var editor3 = CodeMirror.fromTextArea(document.getElementById("routingtext"), {lineNumbers: true, mode: "application/x-httpd-php"});
                               });
                           </script>';        
                           
       //var editor = CodeMirror.fromTextArea(document.getElementById("variables"), lineNumbers: true, matchBrackets: true, mode: "application/x-httpd-php", indentUnit: 4, indentWithTabs: true});
        */
     $returnStr .= $this->showFooter(false);
     return $returnStr;
 }