function glossary_show_entry_entrylist($course, $cm, $glossary, $entry, $mode = '', $hook = '', $printicons = 1, $ratings = NULL, $aliases = true)
{
    global $USER;
    $return = false;
    echo '<table class="glossarypost entrylist" cellspacing="0">';
    echo '<tr valign="top">';
    echo '<td class="entry">';
    if ($entry) {
        glossary_print_entry_approval($cm, $entry, $mode);
        echo "<span class=\"concept\"><a href=\"showentry.php?courseid={$course->id}&amp;eid={$entry->id}&amp;displayformat=dictionary\" target=\"_blank\" onClick=\"return openpopup('/mod/glossary/showentry.php?courseid={$course->id}&amp;eid={$entry->id}&amp;displayformat=dictionary', 'entry', 'menubar=0,location=0,scrollbars,resizable,width=600,height=450', 0);\">";
        glossary_print_entry_concept($entry);
        echo '</a></span> ';
        echo '</td><td align="right" class="entrylowersection">';
        if ($printicons) {
            glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode, $hook, 'print');
        }
        if ($ratings) {
            echo '<br />';
            echo '<span class="ratings">';
            $return = glossary_print_entry_ratings($course, $entry, $ratings);
            echo '</span>';
        }
        echo '<br />';
    } else {
        echo '<div style="text-align:center">';
        print_string('noentry', 'glossary');
        echo '</div>';
    }
    echo '</td></tr>';
    echo "</table>\n";
    return $return;
}
function glossary_show_entry_fullwithoutauthor($course, $cm, $glossary, $entry, $mode = "", $hook = "", $printicons = 1, $ratings = NULL, $aliases = true)
{
    global $CFG, $USER;
    $return = false;
    if ($entry) {
        echo '<table class="glossarypost fullwithoutauthor" cellspacing="0">';
        echo '<tr valign="top">';
        echo '<th class="entryheader">';
        echo '<div class="concept">';
        glossary_print_entry_concept($entry);
        echo '</div>';
        echo '<span class="time">(' . get_string('lastedited') . ': ' . userdate($entry->timemodified) . ')</span>';
        echo '</th>';
        echo '<td class="entryattachment">';
        glossary_print_entry_approval($cm, $entry, $mode);
        glossary_print_entry_attachment($entry, $cm, 'html', 'right');
        echo '</td>';
        echo '</tr>';
        echo '<tr valign="top">';
        echo '<td width="100%" colspan="2" class="entry">';
        glossary_print_entry_definition($entry, $glossary, $cm);
        echo '</td></tr>';
        echo '<tr valign="top"><td colspan="2" class="entrylowersection">';
        $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
        echo ' ';
        echo '</td></tr>';
        echo "</table>\n";
    } else {
        echo '<center>';
        print_string('noentry', 'glossary');
        echo '</center>';
    }
    return $return;
}
Beispiel #3
0
function glossary_show_entry_faq($course, $cm, $glossary, $entry, $mode = "", $hook = "", $printicons = 1, $aliases = true)
{
    global $USER;
    if ($entry) {
        echo '<table class="glossarypost faq" cellspacing="0">';
        echo '<tr valign="top">';
        echo '<th class="entryheader">';
        $entry->course = $course->id;
        echo '<div class="concept">' . get_string('question', 'glossary') . ': ';
        glossary_print_entry_concept($entry);
        echo '</div>';
        echo '<span class="time">(' . get_string('lastedited') . ': ' . userdate($entry->timemodified) . ')</span>';
        echo '</th>';
        echo '<td class="entryattachment">';
        glossary_print_entry_approval($cm, $entry, $mode);
        echo '</td>';
        echo '</tr>';
        echo "\n<tr>";
        echo '<td colspan="2" class="entry">';
        echo '<b>' . get_string('answer', 'glossary') . ':</b> ';
        glossary_print_entry_definition($entry, $glossary, $cm);
        glossary_print_entry_attachment($entry, $cm, 'html');
        echo '</td></tr>';
        echo '<tr valign="top"><td colspan="3" class="entrylowersection">';
        glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $aliases);
        echo '</td></tr></table>';
    } else {
        echo '<div style="text-align:center">';
        print_string('noentry', 'glossary');
        echo '</div>';
    }
}
Beispiel #4
0
function glossary_show_entry_entrylist($course, $cm, $glossary, $entry, $mode = '', $hook = '', $printicons = 1, $aliases = true)
{
    global $USER, $OUTPUT;
    $return = false;
    echo '<table class="glossarypost entrylist" cellspacing="0">';
    echo '<tr valign="top">';
    echo '<td class="entry">';
    if ($entry) {
        glossary_print_entry_approval($cm, $entry, $mode);
        $anchortagcontents = glossary_print_entry_concept($entry, true);
        $link = new moodle_url('/mod/glossary/showentry.php', array('courseid' => $course->id, 'eid' => $entry->id, 'displayformat' => 'dictionary'));
        $anchor = html_writer::link($link, $anchortagcontents);
        echo "<div class=\"concept\">{$anchor}</div> ";
        echo '</td><td align="right" class="entrylowersection">';
        if ($printicons) {
            glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode, $hook, 'print');
        }
        if (!empty($entry->rating)) {
            echo '<br />';
            echo '<span class="ratings">';
            $return = glossary_print_entry_ratings($course, $entry);
            echo '</span>';
        }
        echo '<br />';
    } else {
        echo '<div style="text-align:center">';
        print_string('noentry', 'glossary');
        echo '</div>';
    }
    echo '</td></tr>';
    echo "</table>\n";
    return $return;
}
Beispiel #5
0
function glossary_show_entry_entrylist($course, $cm, $glossary, $entry, $mode = '', $hook = '', $printicons = 1, $aliases = true)
{
    global $USER, $OUTPUT;
    $return = false;
    echo '<table class="glossarypost entrylist" cellspacing="0">';
    echo '<tr valign="top">';
    echo '<td class="entry">';
    if ($entry) {
        glossary_print_entry_approval($cm, $entry, $mode);
        $anchortagcontents = glossary_print_entry_concept($entry, true);
        $link = "/mod/glossary/showentry.php?courseid={$course->id}&eid={$entry->id}&displayformat=dictionary";
        $action = new popup_action('click', $link . '&popup=1', 'entry', array('title' => 'entry', 'width' => 600, 'height' => 450));
        $anchor = $OUTPUT->action_link($link, $anchortagcontents, $action);
        echo "<div class=\"concept\">{$anchor}</div> ";
        echo '</td><td align="right" class="entrylowersection">';
        if ($printicons) {
            glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode, $hook, 'print');
        }
        if (!empty($entry->rating)) {
            echo '<br />';
            echo '<span class="ratings">';
            $return = glossary_print_entry_ratings($course, $entry);
            echo '</span>';
        }
        echo '<br />';
    } else {
        echo '<div style="text-align:center">';
        print_string('noentry', 'glossary');
        echo '</div>';
    }
    echo '</td></tr>';
    echo "</table>\n";
    return $return;
}
function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode = '', $hook = '', $printicons = 1, $ratings = NULL, $aliases = true)
{
    global $CFG, $USER, $DB;
    $user = $DB->get_record('user', array('id' => $entry->userid));
    $strby = get_string('writtenby', 'glossary');
    $return = false;
    if ($entry) {
        echo '<table class="glossarypost encyclopedia" cellspacing="0">';
        echo '<tr valign="top">';
        echo '<td class="left picture">';
        print_user_picture($user, $course->id, $user->picture);
        echo '</td>';
        echo '<th class="entryheader">';
        echo '<div class="concept">';
        glossary_print_entry_concept($entry);
        echo '</div>';
        $fullname = fullname($user);
        $by = new object();
        $by->name = '<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $user->id . '&amp;course=' . $course->id . '">' . $fullname . '</a>';
        $by->date = userdate($entry->timemodified);
        echo '<span class="author">' . get_string('bynameondate', 'forum', $by) . '</span>';
        echo '</th>';
        echo '<td class="entryapproval">';
        glossary_print_entry_approval($cm, $entry, $mode);
        echo '</td>';
        echo '</tr>';
        echo '<tr valign="top">';
        echo '<td class="left side" rowspan="2">&nbsp;</td>';
        echo '<td colspan="2" class="entry">';
        if ($entry->attachment) {
            $entry->course = $course->id;
            if (strlen($entry->definition) % 2) {
                $align = 'right';
            } else {
                $align = 'left';
            }
            glossary_print_entry_attachment($entry, $cm, null, $align, false);
        }
        glossary_print_entry_definition($entry, $glossary, $cm);
        if ($printicons or $ratings or $aliases) {
            echo '</td></tr>';
            echo '<tr>';
            echo '<td colspan="2" class="entrylowersection">';
            $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
            echo ' ';
        }
        echo '</td></tr>';
        echo "</table>\n";
    } else {
        echo '<div style="text-align:center">';
        print_string('noentry', 'glossary');
        echo '</div>';
    }
    return $return;
}
Beispiel #7
0
function glossary_show_entry_fullwithauthor($course, $cm, $glossary, $entry, $mode = "", $hook = "", $printicons = 1, $ratings = NULL, $aliases = true)
{
    global $CFG, $USER;
    $user = get_record('user', 'id', $entry->userid);
    $strby = get_string('writtenby', 'glossary');
    $return = false;
    if ($entry) {
        echo '<table class="glossarypost fullwithauthor" cellspacing="0">';
        echo '<tr valign="top">';
        echo '<td class="picture">';
        print_user_picture($user->id, $course->id, $user->picture);
        echo '</td>';
        echo '<th class="entryheader">';
        echo '<div class="concept">';
        glossary_print_entry_concept($entry);
        echo '</div>';
        $fullname = fullname($user);
        $by = new object();
        $by->name = '<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $user->id . '&amp;course=' . $course->id . '">' . $fullname . '</a>';
        $by->date = userdate($entry->timemodified);
        echo '<span class="author">' . get_string('bynameondate', 'forum', $by) . '</span>';
        echo '</th>';
        echo '<td class="entryattachment">';
        glossary_print_entry_approval($cm, $entry, $mode);
        glossary_print_entry_attachment($entry, 'html', 'right');
        echo '</td>';
        echo '</tr>';
        echo '<tr valign="top">';
        echo '<td class="left">&nbsp;</td>';
        echo '<td colspan="2" class="entry">';
        glossary_print_entry_definition($entry);
        echo '</td></tr>';
        echo '<tr valign="top">';
        echo '<td class="left">&nbsp;</td>';
        echo '<td colspan="2" class="entrylowersection">';
        $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
        echo ' ';
        echo '</td></tr>';
        echo "</table>\n";
    } else {
        echo '<div style="text-align:center">';
        print_string('noentry', 'glossary');
        echo '</div>';
    }
    return $return;
}
function glossary_show_entry_dictionary($course, $cm, $glossary, $entry, $mode = '', $hook = '', $printicons = 1, $aliases = true)
{
    global $CFG, $USER;
    echo '<table class="glossarypost dictionary" cellspacing="0">';
    echo '<tr valign="top">';
    echo '<td class="entry">';
    glossary_print_entry_approval($cm, $entry, $mode);
    glossary_print_entry_attachment($entry, $cm, 'html', 'right');
    echo '<div class="concept">';
    glossary_print_entry_concept($entry);
    echo '</div> ';
    glossary_print_entry_definition($entry, $glossary, $cm);
    echo '</td></tr>';
    echo '<tr valign="top"><td class="entrylowersection">';
    glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $aliases);
    echo '</td>';
    echo '</tr>';
    echo "</table>\n";
}
function glossary_show_entry_continuous($course, $cm, $glossary, $entry, $mode = '', $hook = '', $printicons = 1, $ratings = NULL, $aliases = false)
{
    global $USER;
    echo '<table class="glossarypost continuous" cellspacing="0">';
    echo '<tr valign="top">';
    echo '<td class="entry">';
    glossary_print_entry_approval($cm, $entry, $mode);
    glossary_print_entry_attachment($entry, 'html', 'right');
    echo '<span class="concept">';
    glossary_print_entry_concept($entry);
    echo ':</span> ';
    glossary_print_entry_definition($entry);
    $entry->alias = '';
    echo '</td></tr>';
    echo '<tr valign="top"><td class="entrylowersection">';
    $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
    echo '</td>';
    echo '</tr>';
    echo "</table>\n";
    return $return;
}
Beispiel #10
0
function glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode = '', $hook = '', $printicons = 1, $ratings = NULL, $aliases = true)
{
    global $CFG, $USER, $DB, $OUTPUT;
    $user = $DB->get_record('user', array('id' => $entry->userid));
    $strby = get_string('writtenby', 'glossary');
    if ($entry) {
        echo '<table class="glossarypost TEMPLATE">';
        echo '<tr>';
        echo '<td class="entryheader">';
        //Use this function to show author's image
        //Comments: Configuration not supported
        echo $OUTPUT->user_picture(moodle_user_picture::make($user, $course->id));
        //Line separator to show this template fine. :-)
        echo '<br />';
        //Use this code to show author's name
        //Comments: Configuration not supported
        $fullname = fullname($user);
        $by = new object();
        $by->name = '<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $user->id . '&amp;course=' . $course->id . '">' . $fullname . '</a>';
        $by->date = userdate($entry->timemodified);
        echo '<span class="author">' . get_string('bynameondate', 'forum', $by) . '</span>' . '<br />';
        //Use this code to show modification date
        //Comments: Configuration not supported
        echo get_string('lastedited') . ': ' . userdate($entry->timemodified) . '<br /></span>';
        //Use this function to show the approval button. It'll be shown if necessary
        //Comments: You can configure this parameters:
        //----Define where to show the approval button
        $approvalalign = 'right';
        //Values: left, center and right (default right)
        //----Define if the approval button must be showed into a 100% width table
        $approvalinsidetable = true;
        //Values: true, false (default true)
        //Call the function
        glossary_print_entry_approval($cm, $entry, $mode, $approvalalign, $approvalinsidetable);
        //Line separator to show this template fine. :-)
        echo '<br />';
        echo '</td>';
        echo '<td class="entryattachment">';
        //Use this function to show the attachment. It'll be showed if necessary
        //Comments: You can configure this parameters:
        //----Define how to show the attachment
        $attachmentformat = 'html';
        //Values: html (link) and NULL (inline image if possible) (default NULL)
        //----Define where to show the attachment
        $attachmentalign = 'right';
        //Values: left, center and right (default right)
        //----Define if the attachment must be showed into a 100% width table
        $attachmentinsidetable = true;
        //Values: true, false (default true)
        //Call the function
        glossary_print_entry_attachment($entry, $cm, $attachmentformat, $attachmentalign, $attachmentinsidetable);
        //Line separator to show this template fine. :-)
        echo "<br />\n";
        echo '</td></tr>';
        echo '<tr valign="top">';
        echo '<td class="entry">';
        //Use this function to print the concept in a heading <h3>
        //Comments: Configuration not supported
        glossary_print_entry_concept($entry);
        //Line separator not normally needed now.
        //echo "<br />\n";
        //Use this function to show the definition
        //Comments: Configuration not supported
        glossary_print_entry_definition($entry, $glossary, $cm);
        //Line separator to show this template fine. :-)
        echo "<br />\n";
        //Use this function to show aliases, editing icons and ratings (all know as the 'lower section')
        //Comments: You can configure this parameters:
        //----Define when to show the aliases popup
        //    use it only if you are really sure!
        //$aliases = true; //Values: true, false (Default: true)
        //----Uncoment this line to avoid ratings being showed
        //    use it only if you are really sure! You can define this in the glossary conf. page.
        //$ratings = NULL;
        //----Uncoment this line to avoid editing icons being showed
        //    use it only if you are really sure!
        //$printicons = false;
        $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
        echo '</td>';
        echo '</tr>';
        echo "</table>\n";
    } else {
        echo '<div style="text-align:center">';
        print_string('noentry', 'glossary');
        echo '</div>';
    }
    return $return;
}