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


PHP Evaluation::getNextChild方法代码示例

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


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

示例1: showTree

 /**
 * prints out the tree beginning at the parent-item
 *
 * @access  public
 * @param   string   $itemID  the item to display
 * @param   string   $start   YES if its the basecall
 * @return  string   the tree (html)
 */
 function showTree($itemID = ROOT_BLOCK, $start = NULL)
 {
     $items = array();
     if (!is_array($itemID)) {
         $items[0] = $itemID;
         $mode = $this->getInstance($itemID);
         switch ($mode) {
             case ROOT_BLOCK:
                 $this->startItemID = $itemID;
                 break;
             case ARRANGMENT_BLOCK:
             case QUESTION_BLOCK:
                 $parentgroup =& $this->tree->getGroupObject($itemID);
                 $this->startItemID = $parentgroup->getObjectID();
                 break;
         }
         $this->startItemID = $itemID;
     } else {
         $items = $itemID;
     }
     $num_items = count($items);
     $html = "";
     // this is the first / the opened item
     if ($start) {
         $mode = $this->getInstance($itemID);
         switch ($mode) {
             case ROOT_BLOCK:
                 break;
             case ARRANGMENT_BLOCK:
             case QUESTION_BLOCK:
                 $group =& $this->tree->getGroupObject($itemID);
                 $parentID = $group->getParentID();
                 $mode = $this->getInstance($parentID);
                 if ($mode == ROOT_BLOCK) {
                     $eval = new Evaluation($this->evalID, NULL, EVAL_LOAD_FIRST_CHILDREN);
                     while ($child = $eval->getNextChild()) {
                         $items2[] = $child->getObjectID();
                     }
                 } else {
                     $parentgroup =& $this->tree->getGroupObject($parentID, NULL, EVAL_LOAD_FIRST_CHILDREN);
                     while ($child = $parentgroup->getNextChild()) {
                         $items2[] = $child->getObjectID();
                     }
                 }
                 $num_items2 = count($items2);
                 $num_items = $num_items2;
                 $items = $items2;
                 break;
         }
     }
     for ($j = 0; $j < $num_items; ++$j) {
         $html .= $this->createTreeLevelOutput($items[$j]);
         $html .= $this->createTreeItemOutput($items[$j]);
         if ($this->tree->hasKids($items[$j]) && $this->itemID == $items[$j]) {
             $html .= $this->showTree($this->tree->tree_childs[$items[$j]]);
         }
     }
     return $html;
 }
开发者ID:ratbird,项目名称:hope,代码行数:67,代码来源:EvaluationTreeEditView.class.php

示例2: callSafeguard


//.........这里部分代码省略.........
                 // set new start date
                 if (Request::option("startMode") && !$time_msg) {
                     $eval->setStartDate($startDate);
                     if ($startDate != NULL && $startDate <= time() - 1) {
                         $message .= $message ? "<br>" : " ";
                         $message .= _("Die Evaluation wurde gestartet.");
                     }
                 }
                 // set new stop date
                 if (Request::get("stopMode") && !$time_msg) {
                     $eval->setStopDate($stopDate);
                     $eval->setTimeSpan($timeSpan);
                     if ($stopDate != NULL && $stopDate <= time() - 1 || $timeSpan != NULL && $eval->getStartdate() != NULL && $eval->getStartdate() + $timeSpan <= time() - 1) {
                         $message .= $message ? "<br>" : " ";
                         $message .= _("Die Evaluation wurde beendet.");
                     }
                 }
                 if ($eval->isError()) {
                     $safeguard .= $this->createSafeguard("", EvalCommon::createErrorReport($eval));
                     return $safeguard;
                 }
                 $eval->save();
             }
             $evalChanged = YES;
             // start/endtime aren't saved, because of ranges with no permisson
             if ($time_msg) {
                 $safeguard .= $this->createSafeguard("ausruf", $time_msg);
             }
             // everything is just fine so print the all messages
             if ($update_message && !$time_msg) {
                 $safeguard .= $this->createSafeguard("ok", $update_message . "<br>" . $message);
             } elseif ($time_msg && $message) {
                 $safeguard .= $this->createSafeguard("ok", $message);
             }
             break;
         case "search_showrange":
         case "search_range":
             $search = Request::get("search");
             if (EvaluationObjectDB::getGlobalPerm(YES) < 31) {
                 $safeguard = $this->createSafeguard("ausruf", _("Sie besitzen keine Berechtigung eine Suche durchzuführen."));
                 return $safeguard;
             }
             $results = $evalDB->search_range($search);
             if (empty($search)) {
                 $safeguard .= $this->createSafeguard("ausruf", _("Bitte einen Suchbegriff eingeben."), $search);
             } elseif (sizeof($results) == 0) {
                 $safeguard .= $this->createSafeguard("ausruf", sprintf(_("Es wurde kein Bereich gefunden, der den Suchbegriff <b>%s</b> enthält."), htmlReady($search)), $search);
             } else {
                 $safeguard .= $this->createSafeguard("ok", sprintf(_("Es wurden %s Bereiche gefunden, die den Suchbegriff <b>%s</b> enthalten."), sizeof($results), htmlReady($search)), $search);
             }
             break;
         case "check_abort_creation":
             # check if the evaluation is new and not yet edited
             $eval = new Evaluation($evalID, NULL, EVAL_LOAD_NO_CHILDREN);
             $abort_creation = false;
             if ($eval->getTitle() == _("Neue Evaluation") && $eval->getText() == "") {
                 # the evaluationen may be not edited yet ... so continue checking
                 $eval = new Evaluation($evalID, NULL, EVAL_LOAD_ALL_CHILDREN);
                 $number_of_childs = $eval->getNumberChildren();
                 $child = $eval->getNextChild();
                 if ($number_of_childs == 1 && $child && $child->getTitle() == _("Erster Gruppierungsblock") && $child->getChildren() == NULL && $child->getText() == "") {
                     $abort_creation = true;
                 }
             }
             if ($abort_creation != true) {
                 break;
             }
             # continue abort_creation
         # continue abort_creation
         case "abort_creation":
             $eval = new Evaluation($evalID, NULL, EVAL_LOAD_ALL_CHILDREN);
             $eval->delete();
             // error_ausgabe
             if ($eval->isError()) {
                 $safeguard .= $this->createSafeguard("", EvalCommon::createErrorReport($eval));
                 return $safeguard;
             }
             $safeguard .= $this->createSafeguard("ok", _("Die Erstellung einer Evaluation wurde abgebrochen."), "", "", "", $referer);
             break;
         case "nothing":
             break;
         default:
             $safeguard .= $this->createSafeguard("ausruf", _("Fehler! Es wurde versucht, eine nicht vorhandene Aktion auszuführen."));
             break;
     }
     /* Send SMS when eval has been modified by admin/root ----------------- */
     if ($evalChanged && $eval->getAuthorID() != $auth->auth["uid"]) {
         $sms = new messaging();
         $sms->insert_message(sprintf(_("An Ihrer Evaluation \"%s\" wurden von %s Änderungen vorgenommen."), $eval->getTitle(), get_username($auth->auth["uid"])), get_username($eval->getAuthorID()), "____%system%____", FALSE, FALSE, "1");
     }
     /* ------------------------------------------------------ end: send SMS */
     // the current range has been removed from the eval
     if ($current_range_removed) {
         $return["msg"] = $safeguard;
         $return["option"] = DISCARD_OPENID;
         return $return;
     } else {
         return $safeguard;
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:101,代码来源:evaluation_admin_overview.lib.php


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