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


PHP SessionManager::getCoachesByCourseSessionToString方法代码示例

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


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

示例1: html_to_pdf_with_template

 /**
  * Export the given HTML to PDF, using a global template
  *
  * @uses export/table_pdf.tpl
  * @param $content
  * @param bool|false $saveToFile
  * @param bool|false $returnHtml
  *
  * @return string
  */
 public function html_to_pdf_with_template($content, $saveToFile = false, $returnHtml = false)
 {
     if (empty($this->template)) {
         $tpl = new Template('', false, false, false);
     } else {
         $tpl = $this->template;
     }
     // Assignments
     // Assignments
     $tpl->assign('pdf_content', $content);
     $organization = api_get_setting('Institution');
     $img = api_get_path(SYS_CSS_PATH) . 'themes/' . api_get_visual_theme() . '/images/header-logo.png';
     // Search for classic logo
     if (file_exists($img)) {
         $img = api_get_path(WEB_CSS_PATH) . 'themes/' . api_get_visual_theme() . '/images/header-logo.png';
         $organization = "<img src='{$img}'>";
     } else {
         // Just use the platform title.
         if (!empty($organization)) {
             $organization = '<h2 align="left">' . $organization . '</h2>';
         }
     }
     // Use custom logo image.
     $pdfLogo = api_get_setting('pdf_logo_header');
     if ($pdfLogo === 'true') {
         $visualTheme = api_get_visual_theme();
         $img = api_get_path(SYS_CSS_PATH) . 'themes/' . $visualTheme . '/images/pdf_logo_header.png';
         if (file_exists($img)) {
             $img = api_get_path(WEB_CSS_PATH) . 'themes/' . $visualTheme . '/images/pdf_logo_header.png';
             $organization = "<img src='{$img}'>";
         }
     }
     $tpl->assign('organization', $organization);
     //Showing only the current teacher/admin instead the all teacher list name see BT#4080
     if (isset($this->params['show_real_course_teachers']) && $this->params['show_real_course_teachers']) {
         if (isset($this->params['session_info']) && !empty($this->params['session_info'])) {
             $teacher_list = SessionManager::getCoachesByCourseSessionToString($this->params['session_info']['id'], $this->params['course_info']['real_id']);
         } else {
             $teacher_list = CourseManager::get_teacher_list_from_course_code_to_string($this->params['course_code']);
         }
     } else {
         $user_info = api_get_user_info();
         if ($this->params['show_teacher_as_myself']) {
             $teacher_list = $user_info['complete_name'];
         }
     }
     $tpl->assign('pdf_course', $this->params['course_code']);
     $tpl->assign('pdf_course_info', $this->params['course_info']);
     $tpl->assign('pdf_session_info', $this->params['session_info']);
     $tpl->assign('pdf_date', $this->params['pdf_date']);
     $tpl->assign('pdf_teachers', $teacher_list);
     $tpl->assign('pdf_title', $this->params['pdf_title']);
     $tpl->assign('pdf_student_info', $this->params['student_info']);
     $tpl->assign('show_grade_generated_date', $this->params['show_grade_generated_date']);
     $tpl->assign('add_signatures', $this->params['add_signatures']);
     // Getting template
     $tableTemplate = $tpl->get_template('export/table_pdf.tpl');
     $html = $tpl->fetch($tableTemplate);
     $html = api_utf8_encode($html);
     $css_file = api_get_path(TO_SYS, WEB_CSS_PATH) . '/print.css';
     $css = file_exists($css_file) ? @file_get_contents($css_file) : '';
     $html = self::content_to_pdf($html, $css, $this->params['filename'], $this->params['course_code'], 'D', $saveToFile, null, $returnHtml);
     if ($returnHtml) {
         return $html;
     }
 }
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:76,代码来源:pdf.lib.php

示例2: html_to_pdf_with_template

    /**
     * Export the given HTML to PDF, using a global template
     * @param string $content the HTML content
     *
     * @uses export/table_pdf.tpl
     */
    public function html_to_pdf_with_template($content)
    {
        global $_configuration;
        Display :: display_no_header();

        // Assignments
        Display::$global_template->assign('pdf_content', $content);

        $organization = api_get_setting('Institution');
        $img = api_get_path(SYS_CODE_PATH).'css/'.api_get_visual_theme().'/images/header-logo.png';

        // Search for classic logo
        if (file_exists($img)) {
            $img = api_get_path(WEB_CODE_PATH).'css/'.api_get_visual_theme().'/images/header-logo.png';
            $organization = "<img src='$img'>";
        } else {
            // Just use the platform title.
            if (!empty($organization)) {
                $organization = '<h2 align="left">'.$organization.'</h2>';
            }
        }

        // Use custom logo image.
        if (isset($_configuration['pdf_logo_header']) &&
            $_configuration['pdf_logo_header']
        ) {
            $img = api_get_path(SYS_CODE_PATH).'css/'.api_get_visual_theme().'/images/pdf_logo_header.png';
            if (file_exists($img)) {
                $img = api_get_path(WEB_CODE_PATH) . 'css/' . api_get_visual_theme() . '/images/pdf_logo_header.png';
                $organization = "<img src='$img'>";
            }
        }

        Display::$global_template->assign('organization', $organization);

        //Showing only the current teacher/admin instead the all teacher list name see BT#4080

        if (isset($this->params['show_real_course_teachers']) &&
            $this->params['show_real_course_teachers']
        ) {
            if (isset($this->params['session_info']) &&
                !empty($this->params['session_info'])
            ) {
                $teacher_list = SessionManager::getCoachesByCourseSessionToString(
                    $this->params['session_info']['id'],
                    $this->params['course_code']

                );
            } else {
                $teacher_list = CourseManager::get_teacher_list_from_course_code_to_string(
                    $this->params['course_code']
                );
            }
        } else {
            $user_info = api_get_user_info();
            $teacher_list = $user_info['complete_name'];
        }

        Display::$global_template->assign('pdf_course', $this->params['course_code']);
        Display::$global_template->assign('pdf_course_info', $this->params['course_info']);
        Display::$global_template->assign('pdf_session_info', $this->params['session_info']);
        Display::$global_template->assign('pdf_date', api_format_date(api_get_local_time(), DATE_TIME_FORMAT_LONG));
        Display::$global_template->assign('pdf_teachers', $teacher_list);
        Display::$global_template->assign('pdf_title', $this->params['pdf_title']);
        Display::$global_template->assign('add_signatures', $this->params['add_signatures']);

        // Getting template
        $tpl = Display::$global_template->get_template('export/table_pdf.tpl');
        $html = Display::$global_template->fetch($tpl);
        $html = api_utf8_encode($html);

        $css_file = api_get_path(TO_SYS, WEB_CSS_PATH).'/print.css';
        $css = file_exists($css_file) ? @file_get_contents($css_file) : '';
        self::content_to_pdf($html, $css, $this->params['filename'], $this->params['course_code']);
    }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:81,代码来源:pdf.lib.php

示例3: exportAllStudentWorkFromPublication

/**
 * @param int $workId
 * @param array $courseInfo
 * @param int $sessionId
 * @param string $format
 * @return bool
 */
function exportAllStudentWorkFromPublication(
    $workId,
    $courseInfo,
    $sessionId,
    $format = 'pdf'
) {
    if (empty($courseInfo)) {
        return false;
    }

    $workData = get_work_data_by_id($workId);

    if (empty($workData)) {
        return false;
    }

    $assignment = get_work_assignment_by_id($workId);

    $courseCode = $courseInfo['code'];
    $header = get_lang('Course').': '.$courseInfo['title'];
    $teachers = CourseManager::get_teacher_list_from_course_code_to_string(
        $courseCode
    );

    if (!empty($sessionId)) {
        $sessionInfo = api_get_session_info($sessionId);
        if (!empty($sessionInfo)) {
            $header .= ' - ' . $sessionInfo['name'];
            $header .= '<br />' . $sessionInfo['description'];
            $teachers = SessionManager::getCoachesByCourseSessionToString(
                $sessionId,
                $courseCode
            );
        }
    }

    $header .= '<br />'.get_lang('Teachers').': '.$teachers.'<br />';
    $header .= '<br />'.get_lang('Date').': '.api_get_local_time().'<br />';
    $header .= '<br />'.get_lang('StudentPublication').': '.$workData['title'].'<br />';

    $content = null;
    $expiresOn = null;

    if (!empty($assignment) && isset($assignment['expires_on'])) {
        $content .= '<br /><strong>' . get_lang('ExpiryDate') . '</strong>: ' . api_get_local_time($assignment['expires_on']);
        $expiresOn = api_get_local_time($assignment['expires_on']);
    }

    if (!empty($workData['description'])) {
        $content .= '<br /><strong>' . get_lang('Description') . '</strong>: ' . $workData['description'];
    }

    $workList = get_work_user_list(null, null, null, null, $workId);

    switch ($format) {
        case 'pdf':
            if (!empty($workList)) {
                require_once api_get_path(LIBRARY_PATH).'pdf.lib.php';

                $table = new HTML_Table(array('class' => 'data_table'));
                $headers = array(
                    get_lang('Name'),
                    get_lang('User'),
                    get_lang('HandOutDateLimit'),
                    get_lang('SentDate'),
                    get_lang('Filename'),
                    get_lang('Score'),
                    get_lang('Feedback')
                );

                $column = 0;
                foreach($headers as $header) {
                    $table->setHeaderContents(0, $column, $header);
                    $column++;
                }

                $row = 1;

                //$pdf->set_custom_header($header);
                foreach ($workList as $work) {
                    $content .= '<hr />';
                    // getWorkComments need c_id
                    $work['c_id'] = $courseInfo['real_id'];

                    //$content .= get_lang('Date').': '.api_get_local_time($work['sent_date_from_db']).'<br />';
                    $score = null;
                    if (!empty($work['qualification_only'])) {
                        $score = $work['qualification_only'];
                    }
                    //$content .= get_lang('Description').': '.$work['description'].'<br />';
                    $comments = getWorkComments($work);

                    $feedback = null;
//.........这里部分代码省略.........
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:101,代码来源:work.lib.php


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