当前位置: 首页>>代码示例>>PHP>>正文


PHP Checker::checkVariable方法代码示例

本文整理汇总了PHP中Checker::checkVariable方法的典型用法代码示例。如果您正苦于以下问题:PHP Checker::checkVariable方法的具体用法?PHP Checker::checkVariable怎么用?PHP Checker::checkVariable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Checker的用法示例。


在下文中一共展示了Checker::checkVariable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showCheckRes

 function showCheckRes()
 {
     /* update last page */
     $_SESSION['LASTPAGE'] = substr($_SESSION['LASTPAGE'], 0, strripos($_SESSION['LASTPAGE'], "res"));
     $displaySysAdmin = new DisplaySysAdmin();
     $comp = loadvar("survey");
     $components = loadvar("components");
     if ($components == "") {
         return $displaySysAdmin->showCheck($displaySysAdmin->displayWarning(Language::messageToolsCompileSelectComponent()));
     }
     set_time_limit(0);
     $messages = array();
     $survey = new Survey($comp);
     $checker = new Checker($comp);
     $compiler = new Compiler($comp, getSurveyVersion($survey));
     $sectionmessages = array();
     $routingmessages = array();
     $variablemessages = array();
     $typemessages = array();
     $groupmessages = array();
     $surveymessages = array();
     if (inArray(SURVEY_COMPONENT_ROUTING, $components)) {
         $sections = $survey->getSections();
         foreach ($sections as $section) {
             $mess = $compiler->generateEngine($section->getSeid(), false);
             if (sizeof($mess) > 0) {
                 $routingmessages[$section->getName()] = $mess;
                 $errors = true;
             }
         }
     }
     if (inArray(SURVEY_COMPONENT_SECTION, $components)) {
         $sections = $survey->getSections();
         foreach ($sections as $section) {
             $mess = $checker->checkSection($section, true);
             if (sizeof($mess) > 0) {
                 $sectionmessages[$section->getName()] = $mess;
                 $errors = true;
             }
         }
     }
     if (inArray(SURVEY_COMPONENT_VARIABLE, $components)) {
         $vars = $survey->getVariableDescriptives();
         foreach ($vars as $var) {
             $mess = $checker->checkVariable($var, true);
             if (sizeof($mess) > 0) {
                 $variablemessages[$var->getName()] = $mess;
                 $errors = true;
             }
             $mess = $compiler->generateSetFills(array($var), false, false);
             if (sizeof($mess) > 0) {
                 //print_r($mess);
                 if (isset($variablemessages[$var->getName()])) {
                     $variablemessages[$var->getName()] = array_merge($variablemessages[$var->getName()], $mess);
                 } else {
                     $variablemessages[$var->getName()] = $mess;
                 }
                 $errors = true;
             }
         }
     }
     if (inArray(SURVEY_COMPONENT_TYPE, $components)) {
         $types = $survey->getTypes();
         foreach ($types as $type) {
             $mess = $checker->checkType($type, true);
             if (sizeof($mess) > 0) {
                 $typemessages[$type->getName()] = $mess;
                 $errors = true;
             }
         }
     }
     if (inArray(SURVEY_COMPONENT_SETTING, $components)) {
         $mess = $checker->checkSurvey();
         if (sizeof($mess) > 0) {
             $surveymessages = $mess;
             $errors = true;
         }
     }
     if (inArray(SURVEY_COMPONENT_GROUP, $components)) {
         $groups = $survey->getGroups();
         foreach ($groups as $group) {
             $mess = $checker->checkGroup($group, true);
             if (sizeof($mess) > 0) {
                 $groupmessages[$group->getName()] = $mess;
                 $errors = true;
             }
         }
     }
     $messages = array(Language::labelSections() => $sectionmessages, Language::labelVariables() => $variablemessages, Language::labelTypes() => $typemessages, Language::labelGroups() => $groupmessages, Language::labelSettings() => $surveymessages, Language::LabelRouting() => $routingmessages);
     if ($errors) {
         $m = '<a data-keyboard="false" data-toggle="modal" data-target="#errorsModal">Show error(s)</a>';
         $content .= $displaySysAdmin->displayError(Language::messageToolsCheckNotOk() . " " . $m);
     } else {
         $content .= $displaySysAdmin->displaySuccess(Language::messageToolsCheckOk());
     }
     $text = "";
     //print_r($messages);
     foreach ($messages as $k => $v) {
         if (sizeof($v) == 0) {
             //$text .= $displaySysAdmin->displaySuccess(Language::messageToolsCheckOk());
//.........这里部分代码省略.........
开发者ID:nubissurveying,项目名称:nubis,代码行数:101,代码来源:sysadmin.php


注:本文中的Checker::checkVariable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。