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 #2
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>';
    }
}
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 #4
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;
}
Beispiel #5
0
function glossary_print_entry_entrylist($course, $cm, $glossary, $entry, $mode = '', $hook = '', $printicons = 1)
{
    //The print view for this format is different from the normal view, so we implement it here completely
    global $CFG, $USER;
    //Take out autolinking in definitions un print view
    $entry->definition = '<span class="nolink">' . $entry->definition . '</span>';
    echo '<table class="glossarypost entrylist">';
    echo '<tr valign="top">';
    echo '<td class="entry">';
    echo '<b>';
    glossary_print_entry_concept($entry);
    echo ':</b> ';
    glossary_print_entry_definition($entry, $glossary, $cm);
    glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, false, false);
    echo '</td>';
    echo '</tr>';
    echo "</table>\n";
}
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 #8
0
function glossary_print_entry_entrylist($course, $cm, $glossary, $entry, $mode = '', $hook = '', $printicons = 1)
{
    //Take out autolinking in definitions un print view
    // TODO use <nolink> tags MDL-15555.
    $entry->definition = '<span class="nolink">' . $entry->definition . '</span>';
    echo html_writer::start_tag('table', array('class' => 'glossarypost entrylist mod-glossary-entrylist'));
    echo html_writer::start_tag('tr');
    echo html_writer::start_tag('td', array('class' => 'entry mod-glossary-entry'));
    echo html_writer::start_tag('div', array('class' => 'mod-glossary-concept'));
    glossary_print_entry_concept($entry);
    echo html_writer::end_tag('div');
    echo html_writer::start_tag('div', array('class' => 'mod-glossary-definition'));
    glossary_print_entry_definition($entry, $glossary, $cm);
    echo html_writer::end_tag('div');
    echo html_writer::start_tag('div', array('class' => 'mod-glossary-lower-section'));
    glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, false, false);
    echo html_writer::end_tag('div');
    echo html_writer::end_tag('td');
    echo html_writer::end_tag('tr');
    echo html_writer::end_tag('table');
}
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;
}