當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Services::GetService方法代碼示例

本文整理匯總了PHP中Services::GetService方法的典型用法代碼示例。如果您正苦於以下問題:PHP Services::GetService方法的具體用法?PHP Services::GetService怎麽用?PHP Services::GetService使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Services的用法示例。


在下文中一共展示了Services::GetService方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAddForm

 /**
  * Build a form to add information to add course sections.
  *
  * @return void
  * @access public
  * @since 8/29/05
  */
 function getAddForm($offering)
 {
     $harmoni = Harmoni::instance();
     $cmm = Services::getService("CourseManagement");
     $idManager = Services::getService("Id");
     $am = Services::GetService("AgentManager");
     ob_start();
     $offeringName = $offering->getDisplayName();
     $offeringId = $offering->getId();
     $offeringIdString = $offeringId->getIdString();
     print _("<h3>Course offering: " . $offeringName . "</h3>") . "";
     print _("<h4>Please enter the following information to add a course section in " . $offeringName . ".</h4>") . "";
     // Search header
     $self = $harmoni->request->quickURL("coursemanagement", "createcoursesection", array("sectionType", "sectionStatus", "sectionLocation"));
     $last_type = $harmoni->request->get("sectionType");
     $section_type = RequestContext::name("sectionType");
     $last_status = $harmoni->request->get("sectionStatus");
     $section_status = RequestContext::name("sectionStatus");
     $last_location = $harmoni->request->get("sectionLocation");
     $section_location = RequestContext::name("sectionLocation");
     print "<form action='{$self}' method='post'>\n\t\t\t<div>\n\t\t\t<p>Section Type: <br/><input type='text' name='{$section_type}' value='{$last_type}' /></p>\n\t\t\t<p>Section Status: <br/><input type='text' name='{$section_status}' value='{$last_type}' /></p>\n\t\t\t<p>Section Location: <br/><input type='text' name='{$section_location}' value='{$last_location}' /></p>";
     print "\n\t<input type='submit' value='" . _("Add") . "' />";
     print "\n\t<a href='" . $harmoni->request->quickURL() . "'>";
     print "<input type='button' value='" . _("Clear") . "' /></a>";
     print "\n</div>\n</form>\n";
     $link = $harmoni->request->quickURL("coursemanagement", "edit_offering_details", array("courseId" => $offeringIdString));
     print _("<h4><a href='{$link}'>Click here to return to offering details.</a></h4>") . "";
     $output = new Block(ob_get_clean(), STANDARD_BLOCK);
     return $output;
 }
開發者ID:adamfranco,項目名稱:polyphony,代碼行數:37,代碼來源:createcoursesection.act.php

示例2: removeStudent

 /**
  * Process any changes in the form to remove a section.
  *
  * @param object section
  * @param string agentIdString
  * @return void
  * @access public
  * @since 8/29/05
  */
 function removeStudent($section, $agentIdString)
 {
     $harmoni = Harmoni::instance();
     $harmoni->request->startNamespace("polyphony-agents");
     $harmoni->request->passthrough("agentId");
     $idManager = Services::getService("Id");
     $am = Services::GetService("AgentManager");
     $agentId = $idManager->getId($agentIdString);
     $section->removeStudent($agentId);
 }
開發者ID:adamfranco,項目名稱:polyphony,代碼行數:19,代碼來源:edit_section_roster.act.php

示例3: enrollmentIteratorHasStudent

 function enrollmentIteratorHasStudent($iter, $agent)
 {
     //this relies on usage of the HarmoniIterator
     $iter->_i = -1;
     while ($iter->hasNext()) {
         $am = Services::GetService("AgentManager");
         $er = $iter->next();
         $currAgent = $am->getAgent($er->getStudent());
         if ($agent->getDisplayName() == $currAgent->getDisplayName()) {
             return true;
         }
     }
     return false;
 }
開發者ID:adamfranco,項目名稱:harmoni,代碼行數:14,代碼來源:EnrollmentRecordTestCase.class.php

示例4: getCourses

 /**
  * Prints the list of existing course offerings with the functionality to remove.
  *
  * @return void
  * @access public
  * @since 8/29/05
  */
 function getCourses()
 {
     $harmoni = Harmoni::instance();
     $cmm = Services::getService("CourseManagement");
     $idManager = Services::getService("Id");
     $am = Services::GetService("AgentManager");
     ob_start();
     print "\n<h4>Existing course offerings.  Please click on a course offering to edit its details (e.g. add a section).</h4>";
     $canonicalCourseIterator = $cmm->getCanonicalCourses();
     if (!$canonicalCourseIterator->hasNextCanonicalCourse()) {
         print "<p>No course offerings are present.</p>";
     } else {
         while ($canonicalCourseIterator->hasNextCanonicalCourse()) {
             $canonicalCourse = $canonicalCourseIterator->nextCanonicalCourse();
             $courseOfferingIterator = $canonicalCourse->getCourseOfferings();
             while ($courseOfferingIterator->hasNextCourseOffering()) {
                 $courseOffering = $courseOfferingIterator->nextCourseOffering();
                 $id = $courseOffering->getId();
                 $idString = $id->getIdString();
                 $canonicalCourseId = $canonicalCourse->getId();
                 $canonicalCourseIdString = $canonicalCourseId->getIdString();
                 $courseName = $courseOffering->getDisplayName();
                 // Get term
                 $courseTerm = $courseOffering->getTerm();
                 $courseTermName = $courseTerm->getDisplayName();
                 $self = $harmoni->request->quickURL("coursemanagement", "createcourse", array("courseIdToRemove" => $idString));
                 print "<form action='{$self}' method='post'>";
                 print "\n<a href='" . $harmoni->request->quickURL("coursemanagement", "edit_offering_details", array("courseId" => $idString)) . "'>";
                 print "\n" . $courseName . "</a>&nbsp;&nbsp;&nbsp;" . $courseTermName . "&nbsp;&nbsp;&nbsp;";
                 print "\n\t<input type='submit' value='" . _("Remove") . "' />";
                 print "\n</form>\n";
             }
         }
     }
     $output = new Block(ob_get_clean(), STANDARD_BLOCK);
     return $output;
 }
開發者ID:adamfranco,項目名稱:polyphony,代碼行數:44,代碼來源:createcourse.act.php


注:本文中的Services::GetService方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。