本文整理汇总了PHP中CourseManager::getById方法的典型用法代码示例。如果您正苦于以下问题:PHP CourseManager::getById方法的具体用法?PHP CourseManager::getById怎么用?PHP CourseManager::getById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CourseManager
的用法示例。
在下文中一共展示了CourseManager::getById方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: slide_presentation_quiz
function slide_presentation_quiz(Quiz $quiz, $name)
{
global $tr;
$manageCourse = new CourseManager();
$c = $manageCourse->getById($quiz->getCourseId());
return "<div class='sp-presentation-content'>\r\n <div>\r\n <h4><strong>" . $tr->__("Author") . "</strong>: " . $name . "</h4>\r\n <h4><strong>" . $tr->__("Course") . "</strong>: " . $c->getName() . "</h4>\r\n <h4><strong>" . $tr->__("Duration") . "</strong>: " . $quiz->getDuration() . " min</h4>\r\n </div>\r\n <h2>" . $quiz->getName() . "</h2>\r\n\r\n </div>";
}
示例2: StudyPressUserWP
exit;
}
wp_enqueue_media();
global $tr;
$user = new StudyPressUserWP();
$managerCourse = new CourseManager();
$course = null;
$error_course_update = "";
$error_course_add = "";
if (isset($_GET['id']) && !empty($_GET['id'])) {
$v = new validation();
$v->addSource($_GET);
$v->addRule('id', 'numeric', true, 1, 9999999, true);
$v->run();
if (!sizeof($v->errors) > 0) {
$course = $managerCourse->getById($v->sanitized['id']);
if ($course) {
if (isset($_POST['update'])) {
if ($user->isAdministrator()) {
if (isset($_POST['course']) && isset($_POST['course']['categories']) && isset($_POST['course']['users'])) {
$v1 = new validation();
$v2 = new validation();
$v3 = new validation();
$v1->addSource($_POST['course']);
$v2->addSource($_POST['course']['categories']);
$v3->addSource($_POST['course']['users']);
//rule Image
if (isset($_POST['course']['pictureId']) && !empty($_POST['course']['pictureId'])) {
$v1->addRule('pictureId', 'numeric', true, 1, 999999, true);
}
$v1->AddRules(array('id' => array('type' => 'numeric', "required" => true, 'min' => '1', 'max' => '999999', 'trim' => true), 'name' => array('type' => 'string', "required" => true, 'min' => '1', 'max' => '200', 'trim' => true), 'description' => array('type' => 'string', "required" => true, 'min' => '0', 'max' => '999999', 'trim' => true)));
示例3: StudyPressUserWP
if (sizeof($v->errors) > 0) {
$error_quiz_update = $v->getMessageErrors();
} else {
$currentUser = new StudyPressUserWP();
if ($managerCourse->getCoursesByAuthor($currentUser->id())) {
$quiz = $managerQuiz->getById($v->sanitized['id']);
$quiz->setName($v->sanitized['name']);
$quiz->setCourseId($v->sanitized['courseId']);
$quiz->setDescription($v->sanitized['description']);
$quiz->setDuration($v->sanitized['duree']);
$quiz->setPictureUrl($v->sanitized['pictureurl']);
$quiz->setTags($notes);
$quiz->setGlossary($glossaires);
$managerQuiz->update($v->sanitized['id'], $quiz);
$quiz = $managerQuiz->getById($v->sanitized['id']);
}
}
}
} else {
wp_die("Access denied !");
}
$course = $managerCourse->getById($quiz->getCourseId());
if ($user->isAdministrator() || in_array($user->id(), $course->getAuthors())) {
require_once __ROOT_PLUGIN__ . "Views/admin/modQuiz.view.php";
} else {
wp_die("Access denied !");
}
} else {
echo "<h3>" . $tr->__("Page not found") . " !!</h3>";
}
}
示例4: CourseManager
wp_register_style("display_css_rating", plugins_url("../css/player/rating.css", __FILE__));
wp_enqueue_style('display_css_rating');
?>
<style>
#sp-rate-id
{
margin: 0;
padding: 0;
}
</style>
<?php
$managerCourse = new CourseManager();
$course = $managerCourse->getById($id);
if ($course) {
if ($course->getPictureId()) {
$courseImageUrl = wp_get_attachment_image_src($course->getPictureId(), $size = 'thumbnail');
} else {
$courseImageUrl[0] = __ROOT_PLUGIN__2 . "images/course.png";
}
?>
<div class='course-description'>
<p>
<img src="<?php
echo $courseImageUrl[0];
?>
示例5: StudyPressUserWP
if (sizeof($v->errors) > 0) {
$error_lesson_update = $v->getMessageErrors();
} else {
$currentUser = new StudyPressUserWP();
if ($managerCourse->getCoursesByAuthor($currentUser->id())) {
$lesson = $managerLesson->getById($v->sanitized['id']);
$lesson->setName($v->sanitized['name']);
$lesson->setCourseId($v->sanitized['courseId']);
$lesson->setDescription($v->sanitized['description']);
$lesson->setDuration($v->sanitized['duree']);
$lesson->setPictureUrl($v->sanitized['pictureurl']);
$lesson->setTags($notes);
$lesson->setGlossary($glossaires);
$managerLesson->update($v->sanitized['id'], $lesson);
$lesson = $managerLesson->getById($v->sanitized['id']);
}
}
}
} else {
wp_die("Access denied !");
}
$course = $managerCourse->getById($lesson->getCourseId());
if ($user->isAdministrator() || in_array($user->id(), $course->getAuthors())) {
require_once __ROOT_PLUGIN__ . "Views/admin/modLesson.view.php";
} else {
wp_die("Access denied !");
}
} else {
echo "<h3>" . $tr->__("Page not found") . " !!</h3>";
}
}
示例6: shareOnGroupsBP
public function shareOnGroupsBP(AbstractActivity $activity, $action, $content)
{
if (self::isBuddyPressActive()) {
$configuration = new Configuration();
$configuration = $configuration->getConfig();
if ($configuration['bp_shareActivity'] === 'true') {
$managerCourse = new CourseManager();
$course = $managerCourse->getById($activity->getCourseId());
foreach ($course->getGroupsBP() as $groupId) {
$activity_id = bp_activity_add(array('user_id' => $activity->getAuthorId(), 'component' => 'groups', 'type' => 'activity_update', 'action' => $action, 'content' => $content, 'item_id' => $groupId));
}
}
}
}