本文整理汇总了PHP中Subjects::getSubjectInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Subjects::getSubjectInfo方法的具体用法?PHP Subjects::getSubjectInfo怎么用?PHP Subjects::getSubjectInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subjects
的用法示例。
在下文中一共展示了Subjects::getSubjectInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __vyucujePredmet
/**
* Zisti ci dotycna osoba vyucuje dany predmet v danej roli
* @param int $pedagogID - id pedagoga
* @param int $predmetID - id rpedmetu
* @param String $rola - kod roli
* @param String $akcia - popis akcie tkoru chce vykonat nad predmetom (aktualne see alebo edit)
* @return boolean - true ak vyucuje predmet, inakk false
*/
private function __vyucujePredmet($pedagogID, $predmetID, $rola, $akcia)
{
$vyucuje = $this->courses->vyucujePredmet($pedagogID, $predmetID, $rola);
if (!$vyucuje) {
$subject = Subjects::getSubjectInfo($predmetID);
$this->controller->log("Pokus o akciu `{$akcia}` neprideleného predmetu `{$subject}` v roli `{$rola}`");
$this->controller->flash("Tento predmet vám nebol pridelený.", "error");
}
return $vyucuje;
}
示例2: save
public function save()
{
try {
$this->bind($this->requirements);
$courseID = $this->requirements->course_id;
// ak ho nevyucuje nepovoli mu zadat
if (!$this->canEdit($courseID, "Pract", $this->redirect)) {
return;
}
$lock = $this->session->read($this->getLockName($courseID));
$this->requirements->save($this->getUserID(), $lock);
$courseInfo = Subjects::getSubjectInfo($courseID);
//odoslat notifikaciu
$this->notificator->sendRequirementChangedMsg("pract/requirements/edit/", $courseID, "Pract");
$this->log("Vloženie novej požiadavky cvičiaceho na predmet `{$courseInfo}`");
$this->flash('Požiadavky uložené.', 'info');
$this->redirect('pract/requirements/index');
} catch (dataValidationException $ex) {
// tak treba nacitat data ako pri add
// BACHA: ak sa zrube validacia do $courseID = sa NEVYKONA !
$this->__getCommonData($this->requirements->course_id);
// nastavi iba validne data !
$this->set("requirement", $ex->checked["requirement"]);
// nastavi ci bola poziadavka preberana alebo nie
$this->set("poziadavka_prebrata", $this->requirements->poziadavka_prebrata);
// nezabudnut nastavit aj ID aby vedel robit kontroly kolizii
$this->set("actualMetaID", $this->requirements->previousMetaID);
} catch (RequestModified $ex) {
// toto sa zrube uz pri save takze $courseID mame
$hlaska = "Požiadavka bola zmenená iným používateľom.<br/>";
$hlaska .= "Kliknutim <a href=\"pract/requirements/edit/{$courseID}\" target=\"_BLANK\">sem</a> si otvorte poslednú verziu požiadavky a upravte tú.";
$this->flash($hlaska, "error");
$this->__getCommonData($courseID);
$this->set("requirement", $this->requirements->requirement);
$this->set("poziadavka_prebrata", $this->requirements->poziadavka_prebrata);
// nezabudnut nastavit aj ID aby vedel robit kontroly kolizii
$this->set("actualMetaID", $this->requirements->previousMetaID);
}
}
示例3: save
/**
* Zabezpeci ulozenie poziadavky. Handluje aj pridanie aj upravu existujucej.
*/
function save()
{
try {
$crses = new Courses();
$minule = $crses->getMinulorocne($this->getSemesterID());
$this->set('minule', $minule);
$checked = $this->bind($this->requirements);
if (!$this->canEdit($this->requirements->id, "Garant", $this->redirect)) {
return;
}
$this->requirements->save();
$courseInfo = Subjects::getSubjectInfo($this->requirements->id);
//poslat notifikaciu
$this->notificator->sendCourseAssignedMsg($this->requirements);
$this->log("Vloženie/editácia garantovej požiadavky na predmet `{$courseInfo}`");
$this->flash('Požiadavky boli uložené.');
$this->redirect('garant/requirements/index');
} catch (dataValidationException $ex) {
$this->set('requirements', $ex->checked);
$this->__commonData($this->requirements->id);
}
}
示例4: sendChatChangedMsg
public function sendChatChangedMsg($comments, $urlPart, $role)
{
$userChangedChat = $this->controller->session->read("name");
$courseID = $comments->course_id;
$courseInfo = Subjects::getSubjectInfo($courseID);
$default = array('DATE' => date("d.m.Y H:i", time()), 'COURSE' => $courseInfo, 'USER_CHANGED_CHAT' => $userChangedChat, 'REQUIREMENT' => $comments->metaID, 'LAST_COMMENT' => nl2br($comments->commentText), 'URL' => BASE_URL . "/{$urlPart}/{$courseID}#komentare");
$message = $this->__createTemplate("messages/chatChanged.tpl", $default);
$toList = $this->__unify($this->maily->getListForComments($courseID, $role));
$subject_part = $role == "Pract" ? "k cvičeniu" : "k prednáške";
$ref = $this->__createRef("requirement.{$role}.chat", $courseID);
$this->sendNotifyMessage($toList, $message, "[{$courseInfo}] zmenený komentár {$subject_part}", $ref);
}