本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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> " . $courseTermName . " ";
print "\n\t<input type='submit' value='" . _("Remove") . "' />";
print "\n</form>\n";
}
}
}
$output = new Block(ob_get_clean(), STANDARD_BLOCK);
return $output;
}