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


PHP Display::returnIconPath方法代码示例

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


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

示例1: get_information

 /**
  * Get document information
  */
 private function get_information($course_id, $doc_id)
 {
     $course_information = api_get_course_info($course_id);
     $course_id = $course_information['real_id'];
     $course_path = $course_information['path'];
     if (!empty($course_information)) {
         $item_property_table = Database::get_course_table(TABLE_ITEM_PROPERTY);
         $doc_table = Database::get_course_table(TABLE_DOCUMENT);
         $doc_id = intval($doc_id);
         $sql = "SELECT * FROM       {$doc_table}\n                    WHERE      {$doc_table}.id = {$doc_id} AND c_id = {$course_id}\n                    LIMIT 1";
         $dk_result = Database::query($sql);
         $sql = "SELECT insert_user_id FROM       {$item_property_table}\n                    WHERE   ref = {$doc_id} AND tool = '" . TOOL_DOCUMENT . "' AND c_id = {$course_id}\n                    LIMIT 1";
         $name = '';
         if ($row = Database::fetch_array($dk_result)) {
             $name = $row['title'];
             $url = api_get_path(WEB_COURSE_PATH) . '%s/document%s';
             $url = sprintf($url, $course_path, $row['path']);
             // Get the image path
             $icon = choose_image(basename($row['path']));
             $thumbnail = Display::returnIconPath($icon);
             $image = $thumbnail;
             //FIXME: use big images
             // get author
             $author = '';
             $item_result = Database::query($sql);
             if ($row = Database::fetch_array($item_result)) {
                 $user_data = api_get_user_info($row['insert_user_id']);
                 $author = api_get_person_name($user_data['firstName'], $user_data['lastName']);
             }
         }
         return array($thumbnail, $image, $name, $author, $url);
         // FIXME: is it posible to get an author here?
     } else {
         return array();
     }
 }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:39,代码来源:document_processor.class.php

示例2: createForm

    /**
     * This function creates the form elements for the multiple response questions
     *
     * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
     * @version January 2007
     */
    public function createForm($survey_data, $form_content)
    {
        parent::createForm($survey_data, $form_content);
        $this->html .= '	<tr>';
        $this->html .= '		<td colspan="2"><strong>' . get_lang('DisplayAnswersHorVert') . '</strong></td>';
        $this->html .= '	</tr>';
        // Horizontal or vertical
        $this->html .= '	<tr>';
        $this->html .= '		<td align="right" valign="top">&nbsp;</td>';
        $this->html .= '		<td>';
        $this->html .= '		  <input name="horizontalvertical" type="radio" value="horizontal" ';
        if (empty($form_content['horizontalvertical']) || $form_content['horizontalvertical'] == 'horizontal') {
            $this->html .= 'checked="checked"';
        }
        $this->html .= '/>' . get_lang('Horizontal') . '</label><br />';
        $this->html .= '		  <input name="horizontalvertical" type="radio" value="vertical" ';
        if (isset($form_content['horizontalvertical']) && $form_content['horizontalvertical'] == 'vertical') {
            $this->html .= 'checked="checked"';
        }
        $this->html .= ' />' . get_lang('Vertical') . '</label>';
        $this->html .= '		</td>';
        $this->html .= '		<td>&nbsp;</td>';
        $this->html .= '	</tr>';
        $this->html .= '		<tr>
								<td colspan="">&nbsp;</td>
							</tr>';
        // The options
        $this->html .= '	<tr>';
        $this->html .= '		<td colspan="3"><strong>' . get_lang('AnswerOptions') . '</strong></td>';
        $this->html .= '	</tr>';
        $total_number_of_answers = count($form_content['answers']);
        $question_values = array();
        // Values of question options
        if (is_array($form_content['values'])) {
            // Check if data is correct
            foreach ($form_content['values'] as $key => &$value) {
                $question_values[] = '<input size="3" type="text" id="values[' . $key . ']" name="values[' . $key . ']" value="' . $value . '" />';
            }
        }
        $count = 0;
        if (is_array($form_content['answers'])) {
            foreach ($form_content['answers'] as $key => &$value) {
                $this->html .= '<tr>';
                $this->html .= '<td align="right"><label for="answers[' . $key . ']">' . ($key + 1) . '</label></td>';
                $this->html .= '<td width="550">' . api_return_html_area('answers[' . $key . ']', api_html_entity_decode(stripslashes($form_content['answers'][$key])), '', '', null, array('ToolbarSet' => 'Survey', 'Width' => '100%', 'Height' => '120')) . '</td>';
                $this->html .= '<td>';
                if ($total_number_of_answers > 2) {
                    $this->html .= $question_values[$count];
                }
                if ($key < $total_number_of_answers - 1) {
                    $this->html .= '<input type="image" style="width:22px"   src="' . Display::returnIconPath('down.png') . '"  value="move_down[' . $key . ']" name="move_down[' . $key . ']"/>';
                }
                if ($key > 0) {
                    $this->html .= '<input type="image" style="width:22px"   src="' . Display::returnIconPath('up.png') . '"  value="move_up[' . $key . ']" name="move_up[' . $key . ']"/>';
                }
                if ($total_number_of_answers > 2) {
                    $this->html .= '<input type="image" style="width:22px"   src="' . Display::returnIconPath('delete.png') . '"  value="delete_answer[' . $key . ']" name="delete_answer[' . $key . ']"/>';
                }
                $this->html .= '</td>';
                $this->html .= '</tr>';
                $count++;
            }
        }
        // The buttons for adding or removing
        //$this->html .= parent :: add_remove_buttons($form_content);
    }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:72,代码来源:ch_personality.php

示例3:

                            var hasJs = $(this).attr('href').indexOf('javascript');
                            if (hasJs >= 0) {
                                return true;
                            }
                        }

                        if ($(this).attr('class')) {
                            var hasAccordion = $(this).attr('class').indexOf('accordion-toggle');
                            if (hasAccordion >= 0) {
                                return true;
                            }
                        }

                        var src = $(this).attr('href');
                        src = url+'&type=link&src='+src;
                        src = src.replace('https', 'http');
                        $(this).attr('href', src);
                        var myAnchor = $('<a><img src="<?php 
echo Display::returnIconPath('link-external.png');
?>
"/></a>').attr("href", src).attr('target', '_blank').attr('class', 'generated');
                        $(this).after(myAnchor);
                        $(this).after('-');
                    }
                });
            });
        }

    }
}
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:30,代码来源:scorm_api.php

示例4: api_format_course_array

/**
 * Reformat the course array (output by api_get_course_info()) in order, mostly,
 * to switch from 'code' to 'id' in the array. This is a legacy feature and is
 * now possibly causing massive confusion as a new "id" field has been added to
 * the course table in 1.9.0.
 * @param $course_data
 * @return array
 * @todo eradicate the false "id"=code field of the $_course array and use the int id
 */
function api_format_course_array($course_data)
{
    if (empty($course_data)) {
        return array();
    }
    $_course = array();
    $_course['id'] = $course_data['code'];
    $_course['real_id'] = $course_data['id'];
    // Added
    $_course['code'] = $course_data['code'];
    $_course['name'] = $course_data['title'];
    $_course['title'] = $course_data['title'];
    $_course['official_code'] = $course_data['visual_code'];
    $_course['visual_code'] = $course_data['visual_code'];
    $_course['sysCode'] = $course_data['code'];
    $_course['path'] = $course_data['directory'];
    // Use as key in path.
    $_course['directory'] = $course_data['directory'];
    $_course['creation_date'] = $course_data['creation_date'];
    $_course['titular'] = $course_data['tutor_name'];
    $_course['language'] = $course_data['course_language'];
    $_course['extLink']['url'] = $course_data['department_url'];
    $_course['extLink']['name'] = $course_data['department_name'];
    $_course['categoryCode'] = $course_data['faCode'];
    $_course['categoryName'] = $course_data['faName'];
    $_course['visibility'] = $course_data['visibility'];
    $_course['subscribe_allowed'] = $course_data['subscribe'];
    $_course['subscribe'] = $course_data['subscribe'];
    $_course['unsubscribe'] = $course_data['unsubscribe'];
    $_course['course_language'] = $course_data['course_language'];
    $_course['activate_legal'] = isset($course_data['activate_legal']) ? $course_data['activate_legal'] : false;
    $_course['legal'] = $course_data['legal'];
    $_course['show_score'] = $course_data['show_score'];
    //used in the work tool
    $_course['department_name'] = $course_data['department_name'];
    $_course['department_url'] = $course_data['department_url'];
    // Course password
    $_course['registration_code'] = !empty($course_data['registration_code']) ? sha1($course_data['registration_code']) : null;
    $_course['disk_quota'] = $course_data['disk_quota'];
    $_course['course_public_url'] = api_get_path(WEB_COURSE_PATH) . $course_data['directory'] . '/index.php';
    if (array_key_exists('add_teachers_to_sessions_courses', $course_data)) {
        $_course['add_teachers_to_sessions_courses'] = $course_data['add_teachers_to_sessions_courses'];
    }
    if (file_exists(api_get_path(SYS_COURSE_PATH) . $course_data['directory'] . '/course-pic85x85.png')) {
        $url_image = api_get_path(WEB_COURSE_PATH) . $course_data['directory'] . '/course-pic85x85.png';
    } else {
        $url_image = Display::return_icon('course.png', null, null, ICON_SIZE_BIG, null, true);
    }
    $_course['course_image'] = $url_image;
    if (file_exists(api_get_path(SYS_COURSE_PATH) . $course_data['directory'] . '/course-pic.png')) {
        $url_image = api_get_path(WEB_COURSE_PATH) . $course_data['directory'] . '/course-pic.png';
    } else {
        $url_image = Display::returnIconPath('session_default.png');
    }
    $_course['course_image_large'] = $url_image;
    $_course['extra_fields'] = isset($course_data['extra_fields']) ? $course_data['extra_fields'] : array();
    $_course['settings'] = isset($course_data['settings']) ? $course_data['settings'] : array();
    $_course['teacher_list'] = isset($course_data['teacher_list']) ? $course_data['teacher_list'] : array();
    $_course['teacher_list_formatted'] = isset($course_data['teacher_list_formatted']) ? $course_data['teacher_list_formatted'] : array();
    return $_course;
}
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:70,代码来源:api.lib.php

示例5: __construct

    /**
     * @param $form_name
     * @param null $action
     */
    public function __construct($form_name, $action = null)
    {
        parent::__construct($form_name, 'post', $action);
        $displayscore = ScoreDisplay::instance();
        $customdisplays = $displayscore->get_custom_score_display_settings();
        $nr_items = count($customdisplays) != '0' ? count($customdisplays) : '1';
        $this->setDefaults(array('scorecolpercent' => $displayscore->get_color_split_value()));
        $this->addElement('hidden', 'maxvalue', '100');
        $this->addElement('hidden', 'minvalue', '0');
        $counter = 1;
        //setting the default values
        if (is_array($customdisplays)) {
            foreach ($customdisplays as $customdisplay) {
                $this->setDefaults(array('endscore[' . $counter . ']' => $customdisplay['score'], 'displaytext[' . $counter . ']' => $customdisplay['display']));
                $counter++;
            }
        }
        $scorecol = array();
        //settings for the colored score
        $this->addElement('header', get_lang('ScoreEdit'));
        if ($displayscore->is_coloring_enabled()) {
            $this->addElement('html', '<b>' . get_lang('ScoreColor') . '</b>');
            $this->addElement('text', 'scorecolpercent', array(get_lang('Below'), get_lang('WillColorRed'), '%'), array('size' => 5, 'maxlength' => 5, 'input-size' => 2));
            if (api_get_setting('gradebook.teachers_can_change_score_settings') != 'true') {
                $this->freeze('scorecolpercent');
            }
            $this->addRule('scorecolpercent', get_lang('OnlyNumbers'), 'numeric');
            $this->addRule(array('scorecolpercent', 'maxvalue'), get_lang('Over100'), 'compare', '<=');
            $this->addRule(array('scorecolpercent', 'minvalue'), get_lang('UnderMin'), 'compare', '>');
        }
        //Settings for the scoring system
        if ($displayscore->is_custom()) {
            $this->addElement('html', '<br /><b>' . get_lang('ScoringSystem') . '</b>');
            $this->addElement('static', null, null, get_lang('ScoreInfo'));
            $this->setDefaults(array('beginscore' => '0'));
            $this->addElement('text', 'beginscore', array(get_lang('Between'), null, '%'), array('size' => 5, 'maxlength' => 5, 'disabled' => 'disabled', 'input-size' => 2));
            for ($counter = 1; $counter <= 20; $counter++) {
                $renderer =& $this->defaultRenderer();
                $elementTemplateTwoLabel = '<div id=' . $counter . ' style="display: ' . ($counter <= $nr_items ? 'inline' : 'none') . ';">

				<!-- BEGIN required --><span class="form_required">*</span> <!-- END required -->

                <label class="control-label">{label}</label>
				<div class="form-group">
				<label class="col-sm-2 control-label">
                </label>

				<div class="col-sm-1">
				<!-- BEGIN error --><span class="form_error">{error}</span><br />
				<!-- END error -->&nbsp<b>' . get_lang('And') . '</b>
				</div>

				<div class="col-sm-2">
				{element}
				</div>

				<div class="col-sm-1">
				=
				</div>


				';
                $elementTemplateTwoLabel2 = '
				<div class="col-sm-2">
					<!-- BEGIN error --><span class="form_error">{error}</span>
					<!-- END error -->
					{element}
				</div>
				<div class="col-sm-1">
                    <a href="javascript:plusItem(' . ($counter + 1) . ')">
                    <img style="display: ' . ($counter >= $nr_items ? 'inline' : 'none') . ';" id="plus-' . ($counter + 1) . '" src="' . Display::returnIconPath('add.png') . '" alt="' . get_lang('Add') . '" title="' . get_lang('Add') . '"></a>
        			<a href="javascript:minItem(' . $counter . ')">
        			<img style="display: ' . ($counter >= $nr_items && $counter != 1 ? 'inline' : 'none') . ';" id="min-' . $counter . '" src="' . Display::returnIconPath('delete.png') . '" alt="' . get_lang('Delete') . '" title="' . get_lang('Delete') . '"></a>
				</div>
				</div>
				</div>';
                $scorebetw = array();
                $this->addElement('text', 'endscore[' . $counter . ']', null, array('size' => 5, 'maxlength' => 5, 'id' => 'txta-' . $counter, 'input-size' => 2));
                $this->addElement('text', 'displaytext[' . $counter . ']', null, array('size' => 40, 'maxlength' => 40, 'id' => 'txtb-' . $counter));
                $renderer->setElementTemplate($elementTemplateTwoLabel, 'endscore[' . $counter . ']');
                $renderer->setElementTemplate($elementTemplateTwoLabel2, 'displaytext[' . $counter . ']');
                $this->addRule('endscore[' . $counter . ']', get_lang('OnlyNumbers'), 'numeric');
                $this->addRule(array('endscore[' . $counter . ']', 'maxvalue'), get_lang('Over100'), 'compare', '<=');
                $this->addRule(array('endscore[' . $counter . ']', 'minvalue'), get_lang('UnderMin'), 'compare', '>');
            }
        }
        if ($displayscore->is_custom()) {
            $this->addButtonSave(get_lang('Ok'));
        }
    }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:94,代码来源:scoredisplayform.class.php

示例6: api_get_system_encoding

  *
  *     visibility 1 -> 0 - $hide / $restore
  */
 /*
  * Diplay message to confirm that a tools must be hide from aivailable tools
  * (visibility 0,1->2)
  */
 if ($remove) {
     $sql = "SELECT * FROM {$TBL_ACCUEIL} WHERE c_id = {$course_id} AND id={$id}";
     $result = Database::query($sql);
     $tool = Database::fetch_array($result);
     $tool_name = @htmlspecialchars($tool['name'] != '' ? $tool['name'] : $tool['link'], ENT_QUOTES, api_get_system_encoding());
     if ($tool['img'] != 'external.gif') {
         $tool['link'] = api_get_path(WEB_CODE_PATH) . $tool['link'];
     }
     $tool['image'] = Display::returnIconPath($tool['image']);
     echo "<br /><br /><br />\n";
     echo "<table class=\"message\" width=\"70%\" align=\"center\">\n", "<tr><td width=\"7%\" align=\"center\">\n", "<a href=\"" . $tool['link'] . "\">" . Display::return_icon($tool['image'], get_lang('Delete')), "</a></td>\n", "<td width=\"28%\" height=\"45\"><small>\n", "<a href=\"" . $tool['link'] . "\">" . $tool_name . "</a></small></td>\n";
     echo "<td align=\"center\">\n", "<font color=\"#ff0000\">", "&nbsp;&nbsp;&nbsp;", "<strong>", get_lang('DelLk'), "</strong>", "<br />&nbsp;&nbsp;&nbsp;\n", "<a href=\"" . api_get_self() . "\">", get_lang('No'), "</a>\n", "&nbsp;|&nbsp;\n", "<a href=\"" . api_get_self() . "?destroy=yes&amp;id={$id}\">", get_lang('Yes'), "</a>\n", "</font></td></tr>\n", "</table>\n";
     echo "<br /><br /><br />\n";
 } elseif ($destroy) {
     Database::query("UPDATE {$TBL_ACCUEIL} SET visibility='2' WHERE c_id = {$course_id} AND id = {$id}");
 } elseif ($hide) {
     // visibility 1 -> 0
     Database::query("UPDATE {$TBL_ACCUEIL} SET visibility=0 WHERE c_id = {$course_id} AND id={$id}");
     $show_message .= Display::return_message(get_lang('ToolIsNowHidden'), 'confirmation');
 } elseif ($restore) {
     // visibility 0,2 -> 1
     Database::query("UPDATE {$TBL_ACCUEIL} SET visibility=1  WHERE c_id = {$course_id} AND id={$id}");
     $show_message .= Display::return_message(get_lang('ToolIsNowVisible'), 'confirmation');
 } elseif (isset($update) && $update) {
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:3column.php

示例7: getLpStats


//.........这里部分代码省略.........
                                         $time_attemp = ' - ';
                                     }
                                     if (!$is_allowed_to_edit && $result_disabled_ext_all) {
                                         $view_score = Display::return_icon('invisible.gif', get_lang('ResultsHiddenByExerciseSetting'));
                                     } else {
                                         // Show only float when need it
                                         if ($my_score == 0) {
                                             $view_score = ExerciseLib::show_score(0, $my_maxscore, false);
                                         } else {
                                             if ($my_maxscore == 0) {
                                                 $view_score = $my_score;
                                             } else {
                                                 $view_score = ExerciseLib::show_score($my_score, $my_maxscore, false);
                                             }
                                         }
                                     }
                                     $my_lesson_status = $row_attempts['status'];
                                     if ($my_lesson_status == '') {
                                         $my_lesson_status = learnpathitem::humanize_status('completed');
                                     } elseif ($my_lesson_status == 'incomplete') {
                                         $my_lesson_status = learnpathitem::humanize_status('incomplete');
                                     }
                                     $output .= '<tr class="' . $oddclass . '" >
                                     <td></td>
                                     <td>' . $extend_attempt_link . '</td>
                                     <td colspan="3">' . get_lang('Attempt') . ' ' . $n . '</td>
                                     <td colspan="2">' . $my_lesson_status . '</td>
                                     <td colspan="2">' . $view_score . '</td>
                                     <td colspan="2">' . $time_attemp . '</td>';
                                     if ($action == 'classic') {
                                         if ($origin != 'tracking') {
                                             if (!$is_allowed_to_edit && $result_disabled_ext_all) {
                                                 $output .= '<td>
                                                         <img src="' . Display::returnIconPath('quiz_na.gif') . '" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '">
                                                         </td>';
                                             } else {
                                                 $output .= '<td>
                                                         <a href="../exercice/exercise_show.php?origin=' . $origin . '&id=' . $my_exe_id . '&cidReq=' . $courseCode . '" target="_parent">
                                                         <img src="' . Display::returnIconPath('quiz.gif') . '" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '">
                                                         </a></td>';
                                             }
                                         } else {
                                             if (!$is_allowed_to_edit && $result_disabled_ext_all) {
                                                 $output .= '<td>
                                                             <img src="' . Display::returnIconPath('quiz_na.gif') . '" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></td>';
                                             } else {
                                                 $output .= '<td>
                                                                 <a href="../exercice/exercise_show.php?cidReq=' . $courseCode . '&origin=correct_exercise_in_lp&id=' . $my_exe_id . '" target="_parent">
                                                                 <img src="' . Display::returnIconPath('quiz.gif') . '" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></a></td>';
                                             }
                                         }
                                     }
                                     $output .= '</tr>';
                                     $n++;
                                 }
                             }
                             $output .= '<tr><td colspan="12">&nbsp;</td></tr>';
                         }
                     }
                 }
             }
             $total_time += $time_for_total;
             // QUIZZ IN LP
             $a_my_id = array();
             if (!empty($my_lp_id)) {
                 $a_my_id[] = $my_lp_id;
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:67,代码来源:tracking.lib.php

示例8: validate_text_empty

	// Multiple filepaths for image form
	var filepaths = document.getElementById("filepaths");
	if (document.getElementById("filepath_"+counter_image)) {
		counter_image = counter_image + 1;
	}  else {
		counter_image = counter_image;
	}
	var elem1 = document.createElement("div");
	elem1.setAttribute("id","filepath_"+counter_image);
	filepaths.appendChild(elem1);
	id_elem1 = "filepath_"+counter_image;
	id_elem1 = "\'"+id_elem1+"\'";
	document.getElementById("filepath_"+counter_image).innerHTML = "\\n\\
        <input type=\\"file\\" name=\\"attach_"+counter_image+"\\"  size=\\"20\\" />\\n\\
        <a href=\\"javascript:remove_image_form("+id_elem1+")\\">\\n\\
            <img src=\\"' . Display::returnIconPath('delete.gif') . '\\">\\n\\
        </a>\\n\\
    ";

	if (filepaths.childNodes.length == 3) {
		var link_attach = document.getElementById("link-more-attach");
		if (link_attach) {
			link_attach.innerHTML="";
		}
	}
}

function validate_text_empty (str,msg) {
	var str = str.replace(/^\\s*|\\s*$/g,"");
	if (str.length == 0) {
		alert(msg);
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:group_view.php

示例9: get_tickets_by_user_id


//.........这里部分代码省略.........
            }
        }
        if ($keyword_unread == 'yes') {
            $sql .= " AND ticket.ticket_id IN (SELECT ticket.ticket_id\n                FROM {$table_support_tickets} ticket,\n                    {$table_support_messages} message,\n                    {$table_main_user} user\n                WHERE ticket.ticket_id = message.ticket_id\n                    AND message.status = 'NOL'\n                    AND message.sys_insert_user_id = user.user_id\n                    AND user.user_id NOT IN (SELECT user_id FROM {$table_main_admin})\n                    AND ticket.status_id != 'REE'\n                GROUP BY ticket.ticket_id)";
        } else {
            if ($keyword_unread == 'no') {
                $sql .= " AND ticket.ticket_id NOT IN (SELECT ticket.ticket_id\n                    FROM {$table_support_tickets} ticket,\n                        {$table_support_messages} message,\n                        {$table_main_user} user\n                    WHERE ticket.ticket_id = message.ticket_id\n                        AND message.status = 'NOL'\n                        AND message.sys_insert_user_id = user.user_id\n                        AND user.user_id NOT IN (\n                            SELECT user_id FROM {$table_main_admin}\n                            )\n                        AND ticket.status_id != 'REE'\n                    GROUP BY ticket.ticket_id)";
            }
        }
        $sql .= " ORDER BY col{$column} {$direction}";
        $sql .= " LIMIT {$from}, {$number_of_items}";
        $result = Database::query($sql);
        $tickets = array();
        $webPath = api_get_path(WEB_PATH);
        $webCodePath = api_get_path(WEB_CODE_PATH);
        while ($row = Database::fetch_assoc($result)) {
            $sql_unread = "SELECT\n                              COUNT(DISTINCT message.message_id) AS unread\n                           FROM {$table_support_tickets}  ticket,\n                                {$table_support_messages} message,\n                                {$table_main_user} user\n                           WHERE ticket.ticket_id = message.ticket_id\n                           AND ticket.ticket_id = '{$row['col0']}'\n                           AND message.status = 'NOL'\n                           AND message.sys_insert_user_id = user.user_id ";
            if ($isAdmin) {
                $sql_unread .= " AND user.user_id\n                                 NOT IN (SELECT user_id FROM {$table_main_admin})\n                                 AND ticket.status_id != 'REE' ";
            } else {
                $sql_unread .= " AND user.user_id\n                                 IN (SELECT user_id FROM {$table_main_admin}) ";
            }
            $result_unread = Database::query($sql_unread);
            $unread = Database::fetch_object($result_unread)->unread;
            $userInfo = api_get_user_info($row['user_id']);
            $hrefUser = $webPath . 'main/admin/user_information.php?user_id=' . $row['user_id'];
            $name = "<a href='{$hrefUser}'> {$userInfo['username']} </a>";
            $actions = "";
            if ($row['responsible'] != 0) {
                $row['responsible'] = api_get_user_info($row['responsible']);
                if (!empty($row['responsible'])) {
                    $hrefResp = $webPath . 'main/admin/user_information.php?user_id=' . $row['responsible']['user_id'];
                    $row['responsible'] = "<a href='{$hrefResp}'> {$row['responsible']['username']} </a>";
                } else {
                    $row['responsible'] = get_lang('UnknownUser');
                }
            } else {
                if ($row['status_id'] != 'REE') {
                    $row['responsible'] = '<span style="color:#ff0000;">' . $plugin->get_lang('ToBeAssigned') . '</span>';
                } else {
                    $row['responsible'] = '<span style="color:#00ff00;">' . get_lang('MessageResent') . '</span>';
                }
            }
            switch ($row['source']) {
                case 'PRE':
                    $img_source = 'icons/32/user.png';
                    break;
                case 'MAI':
                    $img_source = 'icons/32/mail.png';
                    break;
                case 'TEL':
                    $img_source = 'icons/32/event.png';
                    break;
                default:
                    $img_source = 'icons/32/course_home.png';
                    break;
            }
            $row['col1'] = api_get_local_time($row['col1']);
            $row['col2'] = api_get_local_time($row['col2']);
            if ($isAdmin) {
                $actions .= '<a href="ticket_details.php?ticket_id=' . $row['col0'] . '">' . Display::return_icon('synthese_view.gif', get_lang('Info')) . '</a>&nbsp;&nbsp;';
                if ($row['priority_id'] == 'HGH' && $row['status_id'] != 'CLS') {
                    $actions .= '<img src="' . $webCodePath . 'img/exclamation.png" border="0" />';
                }
                $row['col0'] = Display::return_icon($img_source, get_lang('Info')) . '<a href="ticket_details.php?ticket_id=' . $row['col0'] . '">' . $row['ticket_code'] . '</a>';
                if ($row['col7'] == 'PENDIENTE') {
                    $row['col7'] = '<span style="color: #f00; font-weight:bold;">' . $row['col7'] . '</span>';
                }
                $ticket = array($row['col0'], api_format_date($row['col1'], '%d/%m/%y - %I:%M:%S %p'), api_format_date($row['col2'], '%d/%m/%y - %I:%M:%S %p'), $row['col3'], $name, $row['responsible'], $row['col7'], $row['col8'], $actions, $row['col9']);
            } else {
                $actions = "";
                $actions .= '<a href="ticket_details.php?ticket_id=' . $row['col0'] . '">' . Display::return_icon('synthese_view.gif', get_lang('Info')) . '</a>&nbsp;&nbsp;';
                $row['col0'] = Display::return_icon($img_source, get_lang('Info')) . '<a href="ticket_details.php?ticket_id=' . $row['col0'] . '">' . $row['ticket_code'] . '</a>';
                $now = api_strtotime(api_get_utc_datetime());
                $last_edit_date = api_strtotime($row['sys_lastedit_datetime']);
                $dif = $now - $last_edit_date;
                if ($dif > 172800 && $row['priority_id'] == 'NRM' && $row['status_id'] != 'CLS') {
                    $actions .= '<a href="myticket.php?ticket_id=' . $row['ticket_id'] . '&amp;action=alert">
                                 <img src="' . Display::returnIconPath('exclamation.png') . '" border="0" /></a>';
                }
                if ($row['priority_id'] == 'HGH') {
                    $actions .= '<img src="' . Display::returnIconPath('admin_star.png') . '" border="0" />';
                }
                $ticket = array($row['col0'], api_format_date($row['col1'], '%d/%m/%y - %I:%M:%S %p'), api_format_date($row['col2'], '%d/%m/%y - %I:%M:%S %p'), $row['col3'], $row['col7'], $actions);
            }
            if ($unread > 0) {
                $ticket['0'] = $ticket['0'] . '&nbsp;&nbsp;(' . $unread . ')<a href="ticket_details.php?ticket_id=' . $row['ticket_id'] . '">
                                <img src="' . Display::returnIconPath('message_new.png') . '" border="0" title="' . $unread . ' ' . get_lang('Messages') . '"/>
                                </a>';
            }
            if ($isAdmin) {
                $ticket['0'] .= '&nbsp;&nbsp;<a  href="javascript:void(0)" onclick="load_history_ticket(\'div_' . $row['ticket_id'] . '\',' . $row['ticket_id'] . ')">
					<img onclick="load_course_list(\'div_' . $row['ticket_id'] . '\',' . $row['ticket_id'] . ')" onmouseover="clear_course_list (\'div_' . $row['ticket_id'] . '\')" src="' . Display::returnIconPath('history.gif') . '" title="' . get_lang('Historial') . '" alt="' . get_lang('Historial') . '"/>
					<div class="blackboard_hide" id="div_' . $row['ticket_id'] . '">&nbsp;&nbsp;</div>
					</a>&nbsp;&nbsp;';
            }
            $tickets[] = $ticket;
        }
        return $tickets;
    }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:101,代码来源:ticket.class.php

示例10: display_subscribe_icon

    /**
     * Displays the subscribe icon if subscribing is allowed and
     * if the user is not yet subscribed to this course
     *
     * @global type $stok
     * @param array $current_course
     * @param array $user_courses
     * @return bool
     */
    function display_subscribe_icon($current_course, $user_courses)
    {
        global $stok;
        //Already subscribed
        $code = $current_course['code'];
        if (isset($user_courses[$code])) {
            echo self::get_lang('AlreadySubscribed');
            return false;
        }
        //Not authorized to subscribe
        if ($current_course['subscribe'] != SUBSCRIBE_ALLOWED) {
            echo self::get_lang('SubscribingNotAllowed');
            return false;
        }
        //Subscribe form
        $self = $_SERVER['PHP_SELF'];
        echo <<<EOT
                <form action="{$self}?action=subscribe" method="post">
                    <input type="hidden" name="sec_token" value="{$stok}" />
                    <input type="hidden" name="subscribe" value="{$code}" />
EOT;
        $search_term = $this->post('search_term');
        if ($search_term) {
            $search_term = Security::remove_XSS($search_term);
            echo <<<EOT
                    <input type="hidden" name="search_course" value="1" />
                    <input type="hidden" name="search_term" value="{$search_term}" />
EOT;
        }
        echo '<input type="image" name="unsub" src="' . Display::returnIconPath('enroll.gif') . '" alt="' . get_lang('Subscribe') . '" />
                ' . get_lang('Subscribe') . '
                </form>
        ';
        return true;
    }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:44,代码来源:search_course_widget.class.php

示例11: display_form_session_export

    /**
     * Display the form session export
     * @param array $hidden_fiels Hidden fields to add to the form.
     * @param boolean the document array will be serialize. This is used in the course_copy.php file
     */
    public static function display_form_session_export($list_course, $hidden_fields = null, $avoid_serialize = false)
    {
        ?>
		<script>
			function exp(item) {
				el = document.getElementById('div_'+item);
				if (el.style.display=='none'){
					el.style.display='';
					document.getElementById('img_'+item).src='<?php 
        echo Display::returnIconPath('1.gif');
        ?>
';
				}
				else{
					el.style.display='none';
					document.getElementById('img_'+item).src='<?php 
        echo Display::returnIconPath('0.gif');
        ?>
';
				}
			}
			function setCheckbox(type,value) {
 				d = document.course_select_form;
 				for (i = 0; i < d.elements.length; i++) {
   					if (d.elements[i].type == "checkbox") {
						var name = d.elements[i].attributes.getNamedItem('name').nodeValue;
 						if( name.indexOf(type) > 0 || type == 'all' ){
						     d.elements[i].checked = value;
						}
   					}
 				}
			}
			function checkLearnPath(message){
				d = document.course_select_form;
 				for (i = 0; i < d.elements.length; i++) {
 					if (d.elements[i].type == "checkbox") {
						var name = d.elements[i].attributes.getNamedItem('name').nodeValue;
 						if( name.indexOf('learnpath') > 0){
 							if(d.elements[i].checked){
	 							setCheckbox('document',true);
	 							alert(message);
	 							break;
 							}
 						}
 					}
 				}
			}
		</script>
		<?php 
        //get destination course title
        if (!empty($hidden_fields['destination_course'])) {
            if (!empty($hidden_fields['destination_session'])) {
                $sessionTitle = ' (' . api_get_session_name($hidden_fields['destination_session']) . ')';
            } else {
                $sessionTitle = null;
            }
            $course_infos = CourseManager::get_course_information($hidden_fields['destination_course']);
            echo '<h3>';
            echo get_lang('DestinationCourse') . ' : ' . $course_infos['title'] . $sessionTitle;
            echo '</h3>';
        }
        echo '<script type="text/javascript">var myUpload = new upload(1000);</script>';
        $icon = Display::returnIconPath('progress_bar.gif');
        echo '<form method="post" id="upload_form" name="course_select_form" onsubmit="myUpload.start(\'dynamic_div\',\'' . $icon . '\',\'' . get_lang('PleaseStandBy') . '\',\'upload_form\')">';
        echo '<input type="hidden" name="action" value="course_select_form"/>';
        foreach ($list_course as $course) {
            foreach ($course->resources as $type => $resources) {
                if (count($resources) > 0) {
                    echo '<img id="img_' . $course->code . '" src="' . Display::returnIconPath('1.gif') . '" onclick="javascript:exp(' . "'{$course->code}'" . ');" />';
                    echo '<b  onclick="javascript:exp(' . "'{$course->code}'" . ');" > ' . $course->code . '</b><br />';
                    echo '<div id="div_' . $course->code . '">';
                    echo '<blockquote>';
                    echo '<div class="btn-group">';
                    echo "<a class=\"btn\" href=\"#\" onclick=\"javascript:setCheckbox('" . $course->code . "',true);\" >" . get_lang('All') . "</a>";
                    echo "<a class=\"btn\" href=\"#\" onclick=\"javascript:setCheckbox('" . $course->code . "',false);\" >" . get_lang('None') . "</a>";
                    echo '</div><br />';
                    foreach ($resources as $id => $resource) {
                        echo '<label class="checkbox" for="resource[' . $course->code . '][' . $id . ']">';
                        echo '<input type="checkbox" name="resource[' . $course->code . '][' . $id . ']" id="resource[' . $course->code . '][' . $id . ']"/>';
                        $resource->show();
                        echo '</label>';
                    }
                    echo '</blockquote>';
                    echo '</div>';
                    echo '<script type="text/javascript">exp(' . "'{$course->code}'" . ')</script>';
                }
            }
        }
        if ($avoid_serialize) {
            //Documents are avoided due the huge amount of memory that the serialize php function "eats" (when there are directories with hundred/thousand of files)
            // this is a known issue of serialize
            $course->resources['document'] = null;
        }
        echo '<input type="hidden" name="course" value="' . base64_encode(Course::serialize($course)) . '"/>';
        if (is_array($hidden_fields)) {
//.........这里部分代码省略.........
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:101,代码来源:CourseSelectForm.class.php

示例12: getSessionsFollowedByUser

 /**
  * Get sessions followed by human resources manager
  * @param int $userId
  * @param int $start
  * @param int $limit
  * @param bool $getCount
  * @param bool $getOnlySessionId
  * @param bool $getSql
  * @param string $orderCondition
  * @param string $keyword
  * @param string $description
  * @return array sessions
  */
 public static function getSessionsFollowedByUser($userId, $status = null, $start = null, $limit = null, $getCount = false, $getOnlySessionId = false, $getSql = false, $orderCondition = null, $keyword = '', $description = '')
 {
     // Database Table Definitions
     $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
     $tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
     $tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
     $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
     $userId = intval($userId);
     $select = " SELECT DISTINCT * ";
     if ($getCount) {
         $select = " SELECT count(DISTINCT(s.id)) as count ";
     }
     if ($getOnlySessionId) {
         $select = " SELECT DISTINCT(s.id) ";
     }
     $limitCondition = null;
     if (!empty($start) && !empty($limit)) {
         $limitCondition = " LIMIT " . intval($start) . ", " . intval($limit);
     }
     if (empty($orderCondition)) {
         $orderCondition = " ORDER BY s.name ";
     }
     $whereConditions = null;
     $sessionCourseConditions = null;
     $sessionConditions = null;
     $sessionQuery = null;
     $courseSessionQuery = null;
     switch ($status) {
         case DRH:
             $sessionQuery = "SELECT sru.session_id\n                                 FROM\n                                 {$tbl_session_rel_user} sru\n                                 WHERE\n                                    sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "' AND\n                                    sru.user_id = {$userId}";
             break;
         case COURSEMANAGER:
             $courseSessionQuery = "\n                    SELECT scu.session_id as id\n                    FROM {$tbl_session_rel_course_rel_user} scu\n                    WHERE (scu.status = 2 AND scu.user_id = {$userId})";
             $whereConditions = " OR (s.id_coach = {$userId}) ";
             break;
         default:
             $sessionQuery = "SELECT sru.session_id\n                                 FROM\n                                 {$tbl_session_rel_user} sru\n                                 WHERE\n                                    sru.user_id = {$userId}";
             break;
     }
     $keywordCondition = '';
     if (!empty($keyword)) {
         $keyword = Database::escape_string($keyword);
         $keywordCondition = " AND (s.name LIKE '%{$keyword}%' ) ";
         if (!empty($description)) {
             $description = Database::escape_string($description);
             $keywordCondition = " AND (s.name LIKE '%{$keyword}%' OR s.description LIKE '%{$description}%' ) ";
         }
     }
     $whereConditions .= $keywordCondition;
     $subQuery = $sessionQuery . $courseSessionQuery;
     $sql = " {$select} FROM {$tbl_session} s\n                INNER JOIN {$tbl_session_rel_access_url} a ON (s.id = a.session_id)\n                WHERE\n                    access_url_id = " . api_get_current_access_url_id() . " AND\n                    s.id IN (\n                        {$subQuery}\n                    )\n                    {$whereConditions}\n                    {$orderCondition}\n                    {$limitCondition}";
     if ($getSql) {
         return $sql;
     }
     $result = Database::query($sql);
     if ($getCount) {
         $row = Database::fetch_array($result);
         return $row['count'];
     }
     $sessions = array();
     if (Database::num_rows($result) > 0) {
         $sysUploadPath = api_get_path(SYS_UPLOAD_PATH) . 'sessions/';
         $webUploadPath = api_get_path(WEB_UPLOAD_PATH) . 'sessions/';
         $imgPath = Display::returnIconPath('session_default_small.png');
         $tableExtraFields = Database::get_main_table(TABLE_EXTRA_FIELD);
         $sql = "SELECT id FROM " . $tableExtraFields . "\n                    WHERE extra_field_type = 3 AND variable='image'";
         $resultField = Database::query($sql);
         $imageFieldId = Database::fetch_assoc($resultField);
         while ($row = Database::fetch_array($result)) {
             $row['image'] = null;
             $sessionImage = $sysUploadPath . $imageFieldId['id'] . '_' . $row['id'] . '.png';
             if (is_file($sessionImage)) {
                 $sessionImage = $webUploadPath . $imageFieldId['id'] . '_' . $row['id'] . '.png';
                 $row['image'] = $sessionImage;
             } else {
                 $row['image'] = $imgPath;
             }
             $sessions[$row['id']] = $row;
         }
     }
     return $sessions;
 }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:95,代码来源:sessionmanager.lib.php

示例13: add_real_progress_bar

    /**
     * Uses new functions (php 5.2) for displaying real upload progress.
     * @param string $upload_id							The value of the field UPLOAD_IDENTIFIER, the second parameter (XXX) of the $form->addElement('file', XXX) sentence
     * @param string $element_after						The first element of the form (to place at first UPLOAD_IDENTIFIER)
     * @param int $delay (optional)						The frequency of the xajax call
     * @param bool $wait_after_upload (optional)
     */
    public function add_real_progress_bar($upload_id, $element_after, $delay = 2, $wait_after_upload = false)
    {
        if (!function_exists('uploadprogress_get_info')) {
            $this->add_progress_bar($delay);
            return;
        }
        $xajax_upload = new xajax(api_get_path(WEB_LIBRARY_PATH) . 'upload.xajax.php');
        $xajax_upload->registerFunction('updateProgress');
        // IMPORTANT : must be the first element of the form
        $el = $this->insertElementBefore(FormValidator::createElement('html', '<input type="hidden" name="UPLOAD_IDENTIFIER" value="' . $upload_id . '" />'), $element_after);
        $this->addElement('html', '<br />');
        // Add div-element where the progress bar is to be displayed
        $this->addElement('html', '
                		<div id="dynamic_div_container" style="display:none">
                			<div id="dynamic_div_label">' . get_lang('UploadFile') . '</div>
                <div id="dynamic_div_frame" style="width:214px; height:12px; border:1px solid grey; background-image:url(' . Display::returnIconPath('real_upload_frame.gif') . ');">
                    <div id="dynamic_div_filled" style="width:0%;height:100%;background-image:url(' . Display::returnIconPath('real_upload_step.gif') . ');background-repeat:repeat-x;background-position:center;"></div>
                			</div>
            </div>');
        if ($wait_after_upload) {
            $this->addElement('html', '
			<div id="dynamic_div_waiter_container" style="display:none">
				<div id="dynamic_div_waiter_label">
					' . get_lang('SlideshowConversion') . '
				</div>
				<div id="dynamic_div_waiter_frame">
					' . Display::return_icon('real_upload_frame.gif') . '
				</div>
			</div>
		');
        }
        // Get the xajax code
        $this->addElement('html', $xajax_upload->getJavascript(api_get_path(WEB_LIBRARY_PATH) . 'xajax'));
        // Get the upload code
        $this->addElement('html', '<script type="text/javascript">var myUpload = new upload(' . abs(intval($delay)) * 1000 . ');</script>');
        if (!$wait_after_upload) {
            $wait_after_upload = 0;
        }
        // Add the upload event
        $this->updateAttributes("onsubmit=\"javascript: myUpload.startRealUpload('dynamic_div','" . $upload_id . "','" . $this->getAttribute('id') . "'," . $wait_after_upload . ")\"");
    }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:48,代码来源:FormValidator.class.php

示例14: add_image_form

}

function add_image_form() {
	// Multiple filepaths for image form
	var filepaths = document.getElementById("filepaths");
	if (document.getElementById("filepath_"+counter_image)) {
		counter_image = counter_image + 1;
	}  else {
		counter_image = counter_image;
	}
	var elem1 = document.createElement("div");
	elem1.setAttribute("id","filepath_"+counter_image);
	filepaths.appendChild(elem1);
	id_elem1 = "filepath_"+counter_image;
	id_elem1 = "\'"+id_elem1+"\'";
	document.getElementById("filepath_"+counter_image).innerHTML = "<input type=\\"file\\" name=\\"attach_"+counter_image+"\\"  size=\\"20\\" />&nbsp;<a href=\\"javascript:remove_image_form("+id_elem1+")\\"><img src=\\"' . Display::returnIconPath('delete.gif') . '\\"></a>";

	if (filepaths.childNodes.length == 3) {
		var link_attach = document.getElementById("link-more-attach");
		if (link_attach) {
			link_attach.innerHTML="";
		}
	}
}

function show_icon_edit(element_html) {
    ident="#edit_image";
    $(ident).show();
}

function hide_icon_edit(element_html)  {
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:group_topics.php

示例15: array

        $fixed_queries = array($course_filter);
    }
}
if ($query) {
    list($count, $results) = chamilo_query_query(api_convert_encoding($query, 'UTF-8', $charset), 0, 1000, $fixed_queries);
} else {
    $count = 0;
    $results = [];
}
// Prepare blocks to show.
$blocks = array();
if ($count > 0) {
    foreach ($results as $result) {
        // Fill the result array.
        if (empty($result['thumbnail'])) {
            $result['thumbnail'] = Display::returnIconPath('no_document_thumb.jpg');
        }
        if (!empty($result['url'])) {
            $a_prefix = '<a href="' . $result['url'] . '">';
            $a_sufix = '</a>';
        } else {
            $a_prefix = '';
            $a_sufix = '';
        }
        if ($mode == 'gallery') {
            $title = $a_prefix . str_replace('_', ' ', $result['title']) . $a_sufix;
            $blocks[] = array(1 => $a_prefix . '<img src="' . $result['thumbnail'] . '" />' . $a_sufix . '<br />' . $title . '<br />' . $result['author']);
        } else {
            $title = '<div style="text-align:left;">' . $a_prefix . $result['title'] . $a_sufix . (!empty($result['author']) ? ' ' . $result['author'] : '') . '<div>';
            $blocks[] = array(1 => $title);
        }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:lp_list_search.php


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