Beispiel #1
0
function show_assignments()
{
    global $tool_content, $m, $langEdit, $langDelete, $langNoAssign, $langNewAssign, $langCommands, $course_code, $themeimg, $course_id, $langConfirmDelete, $langDaysLeft, $m, $langWarnForSubmissions, $langDelSure;
    $result = Database::get()->queryArray("SELECT *, CAST(UNIX_TIMESTAMP(deadline)-UNIX_TIMESTAMP(NOW()) AS SIGNED) AS time\n              FROM assignment WHERE course_id = ?d ORDER BY CASE WHEN CAST(deadline AS UNSIGNED) = '0' THEN 1 ELSE 0 END, deadline", $course_id);
    $tool_content .= action_bar(array(array('title' => $langNewAssign, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&add=1", 'button-class' => 'btn-success', 'icon' => 'fa-plus-circle', 'level' => 'primary-label')));
    if (count($result) > 0) {
        $tool_content .= "\n            <div class='row'><div class='col-sm-12'>\n                    <div class='table-responsive'>\n                    <table class='table-default'>\n                    <tr>\n                      <th>{$m['title']}</th>\n                      <th class='text-center'>{$m['subm']}</th>\n                      <th class='text-center'>{$m['nogr']}</th>\n                      <th class='text-center'>{$m['deadline']}</th>\n                      <th class='text-center'>" . icon('fa-gears') . "</th>\n                    </tr>";
        $index = 0;
        foreach ($result as $row) {
            // Check if assignement contains submissions
            $num_submitted = Database::get()->querySingle("SELECT COUNT(*) AS count FROM assignment_submit WHERE assignment_id = ?d", $row->id)->count;
            if (!$num_submitted) {
                $num_submitted = '&nbsp;';
            }
            $num_ungraded = Database::get()->querySingle("SELECT COUNT(*) AS count FROM assignment_submit WHERE assignment_id = ?d AND grade IS NULL", $row->id)->count;
            if (!$num_ungraded) {
                $num_ungraded = '&nbsp;';
            }
            $tool_content .= "<tr class='" . (!$row->active ? "not_visible" : "") . "'>";
            $deadline = (int) $row->deadline ? nice_format($row->deadline, true) : $m['no_deadline'];
            $tool_content .= "<td>\n                                <a href='{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;id={$row->id}'>{$row->title}</a>\n                            </td>\n                            <td class='text-center'>{$num_submitted}</td>\n                            <td class='text-center'>{$num_ungraded}</td>\n                            <td class='text-center'>{$deadline}";
            if ($row->time > 0) {
                $tool_content .= " <br><span class='label label-warning'>{$langDaysLeft}" . format_time_duration($row->time) . "</span>";
            } else {
                if ((int) $row->deadline) {
                    $tool_content .= " <br><span class='label label-danger'>{$m['expired']}</span>";
                }
            }
            $tool_content .= "</td>\n              <td class='option-btn-cell'>" . action_button(array(array('title' => $langDelete, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;id={$row->id}&amp;choice=do_delete", 'icon' => 'fa-times', 'class' => 'delete', 'confirm' => $langConfirmDelete), array('title' => $langEdit, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;id={$row->id}&amp;choice=edit", 'icon' => 'fa-edit'), array('title' => $m['WorkSubsDelete'], 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;id={$row->id}&amp;choice=do_purge", 'icon' => 'fa-eraser', 'confirm' => "{$langWarnForSubmissions} {$langDelSure}", 'show' => is_numeric($num_submitted) && $num_submitted > 0), array('title' => $row->active == 1 ? $m['deactivate'] : $m['activate'], 'url' => $row->active == 1 ? "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;choice=disable&amp;id={$row->id}" : "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;choice=enable&amp;id={$row->id}", 'icon' => $row->active == 1 ? 'fa-eye' : 'fa-eye-slash'))) . "</td></tr>";
            $index++;
        }
        $tool_content .= '</table></div></div></div>';
    } else {
        $tool_content .= "<div class='alert alert-warning'>{$langNoAssign}</div>";
    }
}
Beispiel #2
0
            if ($is_dir) {
                $tool_content .= "<td>&nbsp;</td><td class='center'>{$date}</td>";
            } else {
                if ($entry['format'] == ".meta") {
                    $size = format_file_size($entry['size']);
                    $tool_content .= "<td class='center'>{$size}</td><td class='center'>{$date}</td>";
                } else {
                    $size = format_file_size($entry['size']);
                    $tool_content .= "<td class='center'>{$size}</td><td class='center' title='{$date_with_time}'>{$date}</td>";
                }
            }
            if (!$is_in_tinymce) {
                if ($can_upload) {
                    $tool_content .= "<td class='option-btn-cell'>";
                    $xmlCmdDirName = $entry['format'] == ".meta" && get_file_extension($cmdDirName) == "xml" ? substr($cmdDirName, 0, -4) : $cmdDirName;
                    $tool_content .= action_button(array(array('title' => $langGroupSubmit, 'url' => "{$urlAppend}modules/work/group_work.php?course={$course_code}&amp;group_id={$group_id}&amp;submit={$cmdDirName}", 'icon' => 'fa-book', 'show' => $subsystem == GROUP and isset($is_member) and $is_member), array('title' => $dload_msg, 'url' => $download_url, 'icon' => 'fa-save'), array('title' => $langVisible, 'url' => "{$base_url}" . ($entry['visible'] ? "mkInvisibl={$cmdDirName}" : "mkVisibl={$cmdDirName}"), 'icon' => $entry['visible'] ? 'fa-eye' : 'fa-eye-slash'), array('title' => $langResourceAccess, 'url' => "{$base_url}limited={$cmdDirName}", 'icon' => 'fa-unlock', 'show' => $course_id > 0 and course_status($course_id) == COURSE_OPEN and $entry['public']), array('title' => $langMove, 'url' => "{$base_url}move={$cmdDirName}", 'icon' => 'fa-arrows', 'show' => $entry['format'] != '.meta'), array('title' => $langRename, 'url' => "{$base_url}rename={$cmdDirName}", 'icon' => 'fa-repeat', 'show' => $entry['format'] != '.meta'), array('title' => $langComments, 'url' => "{$base_url}comment={$cmdDirName}", 'icon' => 'fa-comment-o', 'show' => $entry['format'] != '.meta'), array('title' => $langReplace, 'url' => "{$base_url}replace={$cmdDirName}", 'icon' => 'fa-reply', 'show' => !$is_dir && $entry['format'] != '.meta'), array('title' => $langMetadata, 'url' => "{$base_url}metadata={$xmlCmdDirName}", 'icon' => 'fa-tags', 'show' => get_config("insert_xml_metadata")), array('title' => $langResourceAccess, 'url' => "{$base_url}public={$cmdDirName}", 'icon' => 'fa-lock', 'show' => $course_id > 0 and course_status($course_id) == COURSE_OPEN and !$entry['public']), array('title' => $langDelete, 'url' => "{$base_url}filePath={$cmdDirName}&amp;delete=1", 'icon' => 'fa-times', 'class' => 'delete', 'confirm' => "{$langConfirmDelete} {$entry['filename']}")));
                    $tool_content .= "</td>";
                } else {
                    // student view
                    $tool_content .= "<td class='text-center'>" . icon('fa-save', $dload_msg, $download_url) . "</td>";
                }
            }
            $tool_content .= "</tr>";
        }
    }
    $tool_content .= "</table>\n            </div>\n        </div>\n    </div>";
    if ($can_upload && !$is_in_tinymce) {
        $tool_content .= "<br><div class='text-right'>{$langMaxFileSize} " . ini_get('upload_max_filesize') . "</div>";
    }
}
if (defined('SAVED_COURSE_CODE')) {
    /**
     * @brief display event list
     * @global type $course_code
     * @global type $is_editor
     * @global type $langEvents
     * @global type $langCalendar
     * @global type $langDateNow
     * @global type $dateFormatLong
     * @global type $langHour
     * @global type $langHours
     * @global type $langDuration
     * @global type $langAgendaNoTitle
     * @global type $langDelete
     * @global type $langConfirmDeleteEvent
     * @global type $langConfirmDeleteRecursive
     * @global type $langConfirmDeleteRecursiveEvents
     * @global type $langModify
     * @global type $langVisible
     * @param type $events
     * @param type $sens
     * @return string
     */
    function event_list($events, $sens, $type = '') {
        global $course_code, $is_editor, $langDateNow, $dateFormatLong,
                $langHour, $langHours, $langDuration, $langAgendaNoTitle, $langDelete,
                $langConfirmDeleteEvent, $langConfirmDeleteRecursive, $langConfirmDeleteRecursiveEvents,
                $langEditChange, $langViewHide, $langViewShow, $id, $is_admin;

        $dateNow = date("j-n-Y / H:i", time());
        $barMonth = '';
        $nowBarShowed = false;
        $eventlist = "<div class='table-responsive'><table class='table-default'>";
        foreach ($events as $myrow) {
            $content = standard_text_escape($myrow->content);
            $d = strtotime($myrow->start);
            if (!$nowBarShowed) {
                // Following order
                if ((($d > time()) and ($sens == " ASC")) or ( ($d < time()) and ( $sens == " DESC "))) {
                    if ($barMonth != date("m", time())) {
                        $barMonth = date("m", time());
                        $eventlist .= "<tr>";
                        // current month
                        $eventlist .= "<td colspan='2' class='monthLabel list-header'><b>" . ucfirst(claro_format_locale_date("%B %Y", time())) . "</b></td>";
                        $eventlist .= "</tr>";
                    }
                    $nowBarShowed = TRUE;
                    $eventlist .= "<tr>";
                    $eventlist .= "<td colspan='2' class='today'>$langDateNow $dateNow</td>";
                    $eventlist .= "</tr>";
                }
            }
            if ($barMonth != date("m", $d)) {
                $barMonth = date("m", $d);
                // month LABEL
                $eventlist .= "<tr>";
                $eventlist .= "<td colspan='2' class='monthLabel list-header'>";
                $eventlist .= "<div align='center'><b>" . ucfirst(claro_format_locale_date("%B %Y", $d)) . "</b></div></td>";
                $eventlist .= "</tr>";
            }

            $classvis = '';
            if ($is_editor) {
                if ($myrow->visible == 0) {
                    $classvis = 'class = "not_visible"';
                }
            }
            $eventlist .= "<tr $classvis>";
            if ($is_editor or $type == 'personal' or ($is_admin and $type == 'admin')) {
                $eventlist .= "<td style='padding:15px;'>";
            } else {
                $eventlist .= "<td style='padding:15px;' colspan='2'>";
            }
            if (($myrow->duration != '0:00') and ($myrow->duration != '')) {
                if ($myrow->duration == 1) {
                    $message = $langHour;
                } else {
                    $message = $langHours;
                }
                $msg = "($langDuration: " . q($myrow->duration) . " $message)";
            } else {
                $msg = '';
            }
            if ($myrow->title == '') {
                $eventlist .= "<a href='$_SERVER[PHP_SELF]?course=$course_code&amp;id=$myrow->id'>$langAgendaNoTitle</a>";
            } else {
                $eventlist .= "<strong><a href='$_SERVER[PHP_SELF]?course=$course_code&amp;id=$myrow->id'>".q($myrow->title)."</a></strong> &nbsp;&nbsp;$msg";
            }

            $eventlist .= "<div><span class='day'>" . ucfirst(claro_format_locale_date($dateFormatLong, $d)) . "</span> ($langHour: " . ucfirst(date('H:i', $d)) . ")</div>";
            if (isset($id)) {
                $eventlist .= "<br>";
                $eventlist .= "<div class='text-muted'>$content</div>";
            }
            $eventlist .= "</td>";
            if ($type == 'admin' and $is_admin == true) {
               $eventlist .= "<td class='option-btn-cell'>";
               $eventlist .= action_button(array(
                        array('title' => $langEditChange,
                             'url' => "?admin=1&amp;modify=$myrow->id",
                             'icon' => 'fa-edit'),
                        array('title' => $langConfirmDeleteRecursive,
                                   'url' => "?delete=$myrow->id&et=admin&amp;rep=yes",
                                   'icon' => 'fa-times-circle-o',
                                   'class' => 'delete',
                                   'confirm' => $langConfirmDeleteRecursiveEvents,
                                   'show' => !(is_null($myrow->recursion_period) || is_null($myrow->recursion_end))),
                        array('title' => $langDelete,
                              'url' => "?delete=$myrow->id&et=admin",
                              'icon' => 'fa-times',
                              'class' => 'delete',
                              'confirm' => $langConfirmDeleteEvent)
                   ));
              $eventlist .= "</td>";
            } else {
               if ($is_editor) {
                    $eventlist .= "<td class='option-btn-cell'>";
                    $eventlist .= action_button(array(
                        array('title' => $langEditChange,
                             'url' => "?course=$course_code&amp;id=$myrow->id&amp;edit=true",
                             'icon' => 'fa-edit'),
                        array('title' => $myrow->visible ?   $langViewHide : $langViewShow,
                             'url' => "?course=$course_code&amp;id=$myrow->id" . ($myrow->visible? "&amp;mkInvisibl=true" : "&amp;mkVisibl=true"),
                             'icon' => $myrow->visible ? 'fa-eye-slash' : 'fa-eye'),
                       array('title' => $langDelete,
                             'url' => "?course=$course_code&amp;id=$myrow->id&amp;delete=yes",
                             'icon' => 'fa-times',
                             'class' => 'delete',
                             'confirm' => $langConfirmDeleteEvent),
                       array('title' => $langConfirmDeleteRecursive,
                             'url' => "?course=$course_code&amp;id=$myrow->id&amp;delete=yes&amp;rep=yes",
                             'icon' => 'fa-times-circle-o',
                             'class' => 'delete',
                             'confirm' => $langConfirmDeleteRecursiveEvents,
                             'show' => !(is_null($myrow->recursion_period) || is_null($myrow->recursion_end)))
                   ));
                    $eventlist .= "</td>";
                } elseif ($type == 'personal') { // personal or admin event
                    $eventlist .= "<td class='option-btn-cell'>";
                    $eventlist .= action_button(array(
                            array('title' => $langEditChange,
                                  'url' => "?modify=$myrow->id",
                                  'icon' => 'fa-edit'),
                            array('title' => $langDelete,
                                  'url' => "?delete=$myrow->id&et=$type",
                                  'icon' => 'fa-times',
                                  'class' => 'delete',
                                  'confirm' => $langConfirmDeleteEvent),
                            array('title' => $langConfirmDeleteRecursive,
                                  'url' => "?delete=$myrow->id&et=$type&amp;rep=yes",
                                  'icon' => 'fa-times-circle-o',
                                  'class' => 'delete',
                                  'confirm' => $langConfirmDeleteRecursiveEvents,
                                  'show' => !(is_null($myrow->recursion_period) || is_null($myrow->recursion_end))),
                        ));
                   $eventlist .= "</td>";
                }
           }
           $eventlist .= "</tr>";
       }
       $eventlist .= "</table></div>";
       return $eventlist;
   }
Beispiel #4
0
     foreach ($scales as $scale) {
         $scales_list .= "<li>$scale[scale_item_name] ($scale[scale_item_value])</li>";
     }
     $table_content .= "
                 <tr>
                     <td>$grading_scale->title</td>
                     <td>
                         <ul class='list-unstyled'>
                             $scales_list
                         </ul>
                     </td>
                     <td class='option-btn-cell'>
                     ". action_button(array(
                         array(
                             'title' => $langEdit,
                             'url' => "grading_scales.php?course=$course_code&amp;scale_id=$grading_scale->id",
                             'icon' => 'fa-edit'
                         )
                     ))."
                     </td>
                 </tr>
                 ";
 }
 $tool_content .= "
     <div class='table-responsive'>
         <table class='table-default'>
             <thead>
                 <tr>
                     <th>$langTitle</th>
                     <th>$langGradebookMEANS</th>
                     <th class='text-center'>" . icon('fa-gears') . "</th>
function track_result_row($row)
{
    $a = start_form();
    $a .= "<tr>\n";
    $a .= "<td class=\"cell_value\">" . track_input_text('Ttrack_number', 'Ttrack_number', $row['track_number']) . "</td>\n";
    $a .= "<td class=\"cell_value\">" . track_input_text('Ttitle', 'Ttitle', $row['title']) . "</td>\n";
    $a .= "<td class=\"cell_value\">" . track_input_text('Tduration', 'Tduration', $row['disp_duration']) . "</td>\n";
    $a .= "<td class=\"cell_value\">" . action_button('track_update', ' Update ') . action_button('track_delete', ' Delete ') . "</td>\n";
    $a .= hidden_element('a', 'track_update') . hidden_element('album_id', $row['album_id']) . hidden_element('id', $row['id']) . "\n";
    $a .= "</tr>\n";
    $a .= end_form();
    return $a;
}
Beispiel #6
0
                $definition_data = q($g->definition);
            } else {
                $definition_data = '-';
            }

            $tool_content .= "<tr>
                     <td width='150'><strong><a href='$base_url&amp;id=" . getIndirectReference($g->id) . "'>" . q($g->term) . "</a></strong><br><span><small>$cat_descr</small></span></td>
                     <td><em>$definition_data</em>$urllink</td>";

            if ($is_editor) {
                $tool_content .= "<td class='option-btn-cell'>";
                $tool_content .= action_button(array(
                        array('title' => $langEditChange,
                              'url' => "$edit_url&amp;edit=" . getIndirectReference($g->id),
                              'icon' => 'fa-edit'),
                        array('title' => $langDelete,
                              'url' => "$edit_url&amp;delete=" . getIndirectReference($g->id),
                              'icon' => 'fa-times',
                              'class' => 'delete',
                              'confirm' => $langConfirmDelete))
                    );
               $tool_content .= "</td>";
            }                        
            $tool_content .= "</tr>";        
        }
        $tool_content .= "</table></div>";
    } else {
        $tool_content .= "<br><div class='alert alert-warning'>$langNoResult</div>";
    }
}
draw($tool_content, 2, null, $head_content);
Beispiel #7
0
            foreach ($searchResult as $page) {
                if ('__MainPage__' == $page->title) {
                    $title = $langWikiMainPage;
                } else {
                    $title = $page->title;
                }
                $urltitle = rawurlencode($page->title);
                $link = '<a href="' . htmlspecialchars($_SERVER['SCRIPT_NAME'] . '?wikiId=' . $wikiId . '&title=' . $urltitle . '&action=show') . '">' . $title . '</a>';
                $tool_content .= '<li>' . $link . '</li>' . "\n";
            }
            $tool_content .= '</ul>' . "\n";
        } else {
            $tool_content .= $langNoResult;
        }
        break;
    case 'rqSearch':
        $tool_content .= "\n            <div class='form-wrapper'>\n                <form class='form-inline' role='form' method='post' action='" . htmlspecialchars($_SERVER['SCRIPT_NAME'] . '?wikiId=' . $wikiId . '&course=' . $course_code) . "'>\n                    <input type='hidden' name='action' value='exSearch'>\n                    <div class='form-group'>\n                        <label for='searchPattern'>{$langSearch}:</label>\n                        <input class='form-control' type='text' id='searchPattern' name='searchPattern' placeholder='{$langSearch}'>\n                    </div>\n                    <div class='form-group'>\n                        <input class='btn btn-primary' type='submit' value='" . $langSubmit . "'>\n                        <a class='btn btn-default' href='" . htmlspecialchars($_SERVER['SCRIPT_NAME'] . '?wikiId=' . $wikiId . '&course=' . $course_code) . "'>{$langCancel}</a>\n                    </div>\n                </form>\n            </div>";
        break;
    default:
        trigger_error("Invalid action supplied to " . $_SERVER['SCRIPT_NAME'], E_USER_ERROR);
}
$print_button = icon('fa-print', $langWikiPagePrintable, "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;wikiId=" . $wiki->getWikiId() . "&amp;action=show&amp;printable=yes&amp;versionId={$versionId}&amp;title=" . rawurlencode($wiki_title));
if ($action == 'show' && (!isset($_GET['printable']) || $_GET['printable'] != "yes")) {
    $tool_content .= "<div class='panel panel-action-btn-default'>\n                                <div class='panel-heading'>\n                                    <div class='pull-right'>\n                                    " . action_button(array(array('title' => $langWikiEditPage, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;wikiId=" . $wiki->getWikiId() . "&amp;action=edit&amp;title=" . rawurlencode($wiki_title) . "&amp;versionId={$versionId}", 'icon' => 'fa-edit', 'show' => $is_allowedToEdit || $is_allowedToCreate), array('title' => $langWikiDeletePage, 'class' => 'delete', 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;wikiId=" . $wiki->getWikiId() . "&amp;action=delete&amp;title=" . rawurlencode($wiki_title), 'icon' => 'fa-times', 'confirm' => $langWikiDeletePageWarning, 'show' => ($is_allowedToEdit || $is_allowedToCreate) && $wiki_title != "__MainPage__" && $is_editor), array('title' => $langWikiPageHistory, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;wikiId=" . $wiki->getWikiId() . "&amp;action=history&amp;title=" . rawurlencode($wiki_title), 'icon' => 'fa-history'), array('title' => $langWikiPagePrintable, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;wikiId=" . $wiki->getWikiId() . "&amp;action=show&amp;printable=yes&amp;versionId={$versionId}&amp;title=" . rawurlencode($wiki_title), 'icon' => 'fa-print'))) . "</div>\n                                    <h3 class='panel-title'>\n                                        " . ($wiki_title != "__MainPage__" ? $wiki_title : $langWikiMainPage) . " \n                                     </h3>\n                                </div>\n                                <div class='panel-body'>\n                                    " . (isset($wiki_content) ? $wiki_content : "") . "\n                                </div>\n                          </div>";
}
add_units_navigation(TRUE);
if (isset($_GET['printable']) and $_GET['printable'] == "yes") {
    print $printable_content;
} else {
    draw($tool_content, 2, null, $head_content);
}
Beispiel #8
0
                    if ($announce->module_auto_id == 1) {
                        $tool_content .= $langExercise;
                    } elseif ($announce->module_auto_id == 2) {
                        $tool_content .= $langAssignment;
                    }
                    if ($announce->auto) {
                        $tool_content .= "<br>({$langAttendanceInsAut})";
                    } else {
                        $tool_content .= "<br>({$langAttendanceInsMan})";
                    }
                } else {
                    $tool_content .= $langAttendanceActivity;
                }
                $tool_content .= "</td>";
                $tool_content .= "<td>" . userAttendTotalActivityStats($announce->id, $participantsNumber) . "</td>";
                $tool_content .= "<td class='text-center option-btn-cell'>" . action_button(array(array('title' => $langDelete, 'icon' => 'fa-times', 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;delete={$announce->id}", 'confirm' => $langConfirmDelete, 'class' => 'delete'), array('title' => $langAttendanceBook, 'icon' => 'fa-plus', 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;ins={$announce->id}"), array('title' => $langModify, 'icon' => 'fa-edit', 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;modify={$announce->id}"))) . "</td></tr>";
            }
            // end of while
            $tool_content .= "</table></div></div></div>";
        } else {
            $tool_content .= "<div class='alert alert-warning'>{$langAttendanceNoActMessage1} <a href='{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;addActivity=1'>{$langHere}</a> {$langAttendanceNoActMessage3}</div>";
        }
    }
} else {
    //============Student View==================
    $pageName = $langAttendance;
    $userID = $uid;
    $result = Database::get()->queryArray("SELECT * FROM attendance_activities  WHERE attendance_id = ?d  ORDER BY `DATE` DESC", $attendance_id);
    $announcementNumber = count($result);
    if ($announcementNumber > 0) {
        $tool_content .= "<div class='alert alert-info'>" . userAttendTotal($attendance_id, $userID) . " " . $langAttendanceAbsencesFrom . " " . q($attendance_limit) . " " . $langAttendanceAbsencesFrom2 . " </div>";
Beispiel #9
0
                    chkValidator.addValidation("max_rooms_form","req","' . $langΒΒΒServerAlertMaxRooms . '");
                    chkValidator.addValidation("max_rooms_form","numeric","' . $langΒΒΒServerAlertMaxRooms . '");
                    chkValidator.addValidation("max_users_form","req","' . $langΒΒΒServerAlertMaxUsers . '");
                    chkValidator.addValidation("max_users_form","numeric","' . $langΒΒΒServerAlertMaxUsers . '");
                    chkValidator.addValidation("weight","req","' . $langΒΒΒServerAlertOrder . '");
                    chkValidator.addValidation("weight","numeric","' . $langΒΒΒServerAlertOrder . '");
                //]]></script>';
            } else {
                //display available BBB servers
                $tool_content .= action_bar(array(array('title' => $langAddBBBServer, 'url' => "bbbmoduleconf.php?add_server", 'icon' => 'fa-plus-circle', 'level' => 'primary-label', 'button-class' => 'btn-success')));
                $q = Database::get()->queryArray("SELECT * FROM bbb_servers");
                $tool_content .= "<div class='table-responsive'>";
                $tool_content .= "<table class='table-default'>\r\n            <thead>\r\n            <tr><th class = 'text-center'>{$langHost}</th>\r\n                <th class = 'text-center'>IP</th>\r\n                <th class = 'text-center'>{$langBBBEnabled}</th>\r\n                <th class = 'text-center'>{$langBBBConnectedUsers}</th>\r\n                <th class = 'text-center'>{$langBBBServerOrderP}</th>\r\n                <th class = 'text-center'>" . icon('fa-gears') . "</th></tr>\r\n            </thead>";
                foreach ($q as $srv) {
                    $enabled_bbb_server = $srv->enabled ? $langYes : $langNo;
                    $connected_users = get_connected_users($srv->server_key, $srv->api_url, $srv->ip) . '/' . $srv->max_rooms;
                    $tool_content .= "<tr>";
                    $tool_content .= "<td>{$srv->hostname}</td>";
                    $tool_content .= "<td>{$srv->ip}</td>";
                    $tool_content .= "<td>{$enabled_bbb_server}</td>";
                    $tool_content .= "<td>{$connected_users}</td>";
                    $tool_content .= "<td>{$srv->weight}</td>";
                    $tool_content .= "<td class='option-btn-cell'>" . action_button(array(array('title' => $langEdit, 'url' => "{$_SERVER['SCRIPT_NAME']}?edit_server={$srv->id}", 'icon' => 'fa-edit'), array('title' => $langDelete, 'url' => "{$_SERVER['SCRIPT_NAME']}?delete_server={$srv->id}", 'icon' => 'fa-times', 'class' => 'delete', 'confirm' => $langConfirmDelete))) . "</td>";
                    $tool_content .= "</tr>";
                }
                $tool_content .= "</table></div>";
            }
        }
    }
}
draw($tool_content, 3, null, $head_content);
Beispiel #10
0
 $tool_content .= "<div class='panel panel-action-btn-default'>
                         <div class='panel-heading'>
                             <div class='pull-right'>
                             ".action_button(array(
                               array(
                                   'title' => $langWikiEditPage,
                                   'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;wikiId=".$wiki->getWikiId()."&amp;action=edit&amp;title=". rawurlencode($wiki_title). "&amp;versionId=$versionId",
                                   'icon' => 'fa-edit',
                                   'show' => ($is_allowedToEdit || $is_allowedToCreate)
                               ),
                               array(
                                   'title' => $langWikiPageHistory,
                                   'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;wikiId=". $wiki->getWikiId(). "&amp;action=history&amp;title=". rawurlencode($wiki_title),
                                   'icon' => 'fa-history'
                               ),
                               array(
                                   'title' => $langWikiPagePrintable,
                                   'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;wikiId=". $wiki->getWikiId(). "&amp;action=show&amp;printable=yes&amp;versionId=$versionId&amp;title=". rawurlencode($wiki_title),
                                   'icon' => 'fa-print'
                               )    ,
                               array(
                                   'title' => $langWikiDeletePage,
                                   'class' => 'delete',
                                   'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;wikiId=".$wiki->getWikiId()."&amp;action=delete&amp;title=".rawurlencode($wiki_title),
                                   'icon' => 'fa-times',
                                   'confirm' => $langWikiDeletePageWarning,
                                   'show' => ($is_allowedToEdit || $is_allowedToCreate) && $wiki_title != "__MainPage__" && $is_editor
                               )                                    
                             ))."</div>
                             <h3 class='panel-title'>
                                 ". ( $wiki_title != "__MainPage__" ? $wiki_title : $langWikiMainPage) ." 
                              </h3>
Beispiel #11
0
        foreach ($posts as $post) {
            $sharing_content = '';
            $rating_content = '';
            if ($sharing_allowed) {
                $sharing_content = $sharing_enabled ? print_sharing_links($urlServer . "modules/blog/index.php?course={$course_code}&amp;action=showPost&amp;pId=" . $post->getId(), $post->getTitle()) : '';
            }
            if ($ratings_enabled) {
                $rating = new Rating('up_down', 'blogpost', $post->getId());
                $rating_content = $rating->put($is_editor, $uid, $course_id);
            }
            if ($comments_enabled) {
                $comm = new Commenting('blogpost', $post->getId());
                $comment_content = "<a class='btn btn-primary btn-xs pull-right' href='{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=showPost&amp;pId=" . $post->getId() . "#comments_title'>{$langComments} (" . $comm->getCommentsNum() . ")</a>";
            } else {
                $comment_content = "<div class=\"blog_post_empty_space\"></div>";
            }
            $tool_content .= "<div class='panel panel-action-btn-default'>\r\n                                <div class='panel-heading'>\r\n                                    <div class='pull-right'>\r\n                                        " . action_button(array(array('title' => $langModify, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=editPost&amp;pId=" . $post->getId(), 'icon' => 'fa-edit', 'show' => $post->permEdit($is_editor, $stud_allow_create, $uid)), array('title' => $langDelete, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=delPost&amp;pId=" . $post->getId(), 'icon' => 'fa-times', 'class' => 'delete', 'confirm' => $langSureToDelBlogPost, 'show' => $post->permEdit($is_editor, $stud_allow_create, $uid)))) . "\r\n                                    </div>\r\n                                    <h3 class='panel-title'>\r\n                                        <a href='{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=showPost&amp;pId=" . $post->getId() . "'>" . q($post->getTitle()) . "</a>\r\n                                    </h3>                                    \r\n                                </div>\r\n                                <div class='panel-body'>\r\n                                    <div class='label label-success'>" . nice_format($post->getTime(), true) . "</div><small>" . $langBlogPostUser . display_user($post->getAuthor(), false, false) . "</small><br><br>" . standard_text_escape(ellipsize_html($post->getContent(), $num_chars_teaser_break, "<strong>&nbsp;...<a href='{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=showPost&amp;pId=" . $post->getId() . "'> <span class='smaller'>[{$langMore}]</span></a></strong>")) . "\r\n                                    {$comment_content}\r\n                                </div>\r\n                                <div class='panel-footer'>\r\n                                    <div class='row'>\r\n                                        <div class='col-sm-6'>{$rating_content}</div>\r\n                                        <div class='col-sm-6 text-right'>{$sharing_content}</div>\r\n                                    </div>                                    \r\n                                </div>\r\n                             </div>";
        }
        //display navigation links
        $tool_content .= $blog->navLinksHTML($page, $posts_per_page);
        $tool_content .= "</div>";
        /***end of blog posts area***/
        /***sidebar area***/
        $tool_content .= "<div class='col-sm-3'>";
        $tool_content .= $blog->popularBlogPostsHTML($num_popular);
        $tool_content .= $blog->chronologicalTreeHTML(date('n', strtotime($posts[0]->getTime())), date('Y', strtotime($posts[0]->getTime())));
        $tool_content .= "</div></div>";
        /***end of sidebar area***/
    }
}
draw($tool_content, 2, null, $head_content);
Beispiel #12
0
         '</div>';                    
     } else {
         $cunits_content .= "<div class='item-side'>" .
         action_button(array(
             array('title' => $langEditChange,
                   'url' => $urlAppend . "modules/units/info.php?course=$course_code&amp;edit=$cu->id",
                   'icon' => 'fa-edit'),
             array('title' => $langDown,
                   'level' => 'primary',
                   'url' => "$_SERVER[SCRIPT_NAME]?down=". getIndirectReference($cu->id),
                   'icon' => 'fa-arrow-down',
                   'disabled' => $cu->id == $last_id),
             array('title' => $langUp,
                   'level' => 'primary',
                   'url' => "$_SERVER[SCRIPT_NAME]?up=". getIndirectReference($cu->id),
                   'icon' => 'fa-arrow-up',
                   'disabled' => $count_index == 1),
             array('title' => $vis == 1? $langViewHide : $langViewShow,
                   'url' => "$_SERVER[SCRIPT_NAME]?vis=". getIndirectReference($cu->id),
                   'icon' => $vis == 1? 'fa-eye-slash' : 'fa-eye'),
             array('title' => $access == 1? $langResourceAccessLock : $langResourceAccessUnlock,
                   'url' => "$_SERVER[SCRIPT_NAME]?access=". getIndirectReference($cu->id),
                   'icon' => $access == 1? 'fa-lock' : 'fa-unlock',
                   'show' => $visible == COURSE_OPEN),
             array('title' => $langDelete,
                   'url' => "$_SERVER[SCRIPT_NAME]?del=". getIndirectReference($cu->id),
                   'icon' => 'fa-times',
                   'class' => 'delete',
                   'confirm' => $langCourseUnitDeleteConfirm))) .
         '</div>';
     }
 }
Beispiel #13
0
 
 $tool_content .= "<td class='option-btn-cell'>".action_button(array(
         array('title' => $langEditChange,
               'url' => "admin.php?course=$course_code&amp;exerciseId=$row->id",
               'icon' => 'fa-edit'),
         array('title' => $row->active ?  $langViewHide : $langViewShow,
               'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;".($row->active ? "choice=disable" : "choice=enable").(isset($page) ? "&amp;page=$page" : "")."&amp;exerciseId=" . $row->id,
               'icon' => $row->active ? 'fa-eye-slash' : 'fa-eye' ),
         array('title' => $row->public ? $langResourceAccessLock : $langResourceAccessUnlock,
               'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;".($row->public ? "choice=limited" : "choice=public")."&amp;exerciseId=$row->id",
               'icon' => $row->public ? 'fa-lock' : 'fa-unlock',
               'show' => course_status($course_id) == COURSE_OPEN),
         array('title' => $langUsage,
               'url' => "exercise_stats.php?course=$course_code&amp;exerciseId=$row->id",
               'icon' => 'fa-line-chart'),
         array('title' => $langCreateDuplicate,
               'icon-class' => 'warnLink',
               'icon-extra' => "data-exerciseid='$row->id'",
               'url' => "#",
               'icon' => 'fa-copy'),
         array('title' => $langPurgeExerciseResults,
               'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;choice=purge&amp;exerciseId=$row->id",
               'icon' => 'fa-eraser',
               'confirm' => $langConfirmPurgeExerciseResults),
         array('title' => $langDelete,
               'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;choice=delete&amp;exerciseId=$row->id",
               'icon' => 'fa-times',
               'class' => 'delete',
               'confirm' => $langConfirmPurgeExercise)
         ))."</td></tr>";
 
Beispiel #14
0
    $data['aaData'] = array();
    if ($is_editor) {
        $iterator = 1;
        foreach ($result as $myrow) {
            //checking visible status
            if ($myrow->visible == '0') {
                $visible = 1;
                $vis_icon = 'fa-eye-slash';
                $vis_class = 'not_visible';
            } else {
                $visible = 0;
                $vis_icon = 'fa-eye';
                $vis_class = 'visible';
            }
            //setting datables column data
            $data['aaData'][] = array('DT_RowId' => $myrow->id, 'DT_RowClass' => $vis_class, '0' => '<a href="' . $_SERVER['SCRIPT_NAME'] . '?course=' . $course_code . '&an_id=' . $myrow->id . '">' . $myrow->title . '</a>', '1' => date('d-m-Y', strtotime($myrow->date)), '2' => action_button(array(array('title' => $langModify, 'icon' => 'fa-edit', 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;modify={$myrow->id}"), array('title' => $langVisible, 'icon' => $vis_icon, 'icon-class' => 'vis_btn', 'icon-extra' => "data-vis='{$visible}' data-id='{$myrow->id}'"), array('title' => $langDelete, 'class' => 'delete', 'icon' => 'fa-times', 'icon-class' => 'delete_btn', 'icon-extra' => "data-id='{$myrow->id}'"), array('title' => $langMove, 'level' => 'primary', 'icon' => 'fa-arrow-up', 'disabled' => !($iterator != 1 || $offset > 0), 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;up={$myrow->id}"), array('title' => $langMove, 'level' => 'primary', 'disabled' => $offset + $iterator >= $all_announc->total, 'icon' => 'fa-arrow-down', 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;down={$myrow->id}"))));
            $iterator++;
        }
    } else {
        foreach ($result as $myrow) {
            $data['aaData'][] = array('0' => date('d-m-Y', strtotime($myrow->date)), '1' => '<a href="' . $_SERVER['SCRIPT_NAME'] . '?course=' . $course_code . '&an_id=' . $myrow->id . '">' . q($myrow->title) . '</a>');
        }
    }
    echo json_encode($data);
    exit;
}
load_js('tools.js');
//check if Datables code is needed
if (!isset($_GET['addAnnounce']) && !isset($_GET['modify']) && !isset($_GET['an_id'])) {
    load_js('datatables');
    load_js('datatables_filtering_delay');
Beispiel #15
0
         } elseif ($row->type == 3) {
             $answerType = $langFillBlanks;
         } elseif ($row->type == 4) {
             $answerType = $langMatching;
         } elseif ($row->type == 5) {
             $answerType = $langTrueFalse;
         } elseif ($row->type == 6) {
             $answerType = $langFreeText;
         }
         $tool_content .= "<tr>";
         if (!isset($fromExercise)) {
             $tool_content .= "<td><a " . (count($exercise_ids) > 0 ? "class='warnLink' data-toggle='modal' data-target='#modalWarning' data-remote='false'" : "") . "href=\"admin.php?course={$course_code}&amp;editQuestion=" . $row->id . "&amp;fromExercise=\">" . q($row->question) . "</a><br/>" . $answerType . "</td>";
         } else {
             $tool_content .= "<td><a href=\"admin.php?course={$course_code}&amp;editQuestion=" . $row->id . "&amp;fromExercise=" . $fromExercise . "\">" . q($row->question) . "</a><br/>" . $answerType . "</td>";
         }
         $tool_content .= "<td class='option-btn-cell'>" . action_button(array(array('title' => $langModify, 'url' => "admin.php?course={$course_code}&amp;editQuestion=" . $row->id, 'icon-class' => 'warnLink', 'icon-extra' => count($exercise_ids) > 0 ? " data-toggle='modal' data-target='#modalWarning' data-remote='false'" : "", 'icon' => 'fa-edit', 'show' => !isset($fromExercise)), array('title' => $langDelete, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;exerciseId={$exerciseId}&amp;delete={$row->id}", 'icon' => 'fa-times', 'class' => 'delete', 'confirm' => $langConfirmYourChoice, 'show' => !isset($fromExercise)), array('title' => $langReuse, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;recup={$row->id}&amp;fromExercise=" . (isset($fromExercise) ? $fromExercise : '') . "&amp;exerciseId={$exerciseId}", 'icon' => 'fa-plus-square', 'show' => isset($fromExercise)))) . "</td></tr>";
     }
 }
 if (!$nbrQuestions) {
     $tool_content .= "<tr>";
     if (isset($fromExercise) && $fromExercise) {
         $tool_content .= "<td colspan='3'>";
     } else {
         $tool_content .= "<td colspan='4'>";
     }
     $tool_content .= $langNoQuestion . "</td></tr>";
 }
 // questions pagination
 $numpages = intval(($total_questions - 1) / QUESTIONS_PER_PAGE);
 if ($numpages > 0) {
     $tool_content .= "<tr>";
            return true;
        }
        // find the order
        if ($announcement->id == $thisAnnouncementId) {
            $thisAnnouncementOrder = $announcement->order;
            $thisAnnouncementOrderFound = true;
        }
    });
}
// display admin announcements
if ($displayAnnouncementList == true) {
    $result = Database::get()->queryArray("SELECT * FROM admin_announcement ORDER BY `order` DESC");
    $bottomAnnouncement = $announcementNumber = count($result);
    if ($announcementNumber > 0) {
        $tool_content .= "<div class='table-responsive'><table class='table-default'>\n                        <tr><th>{$langTitle}</th>\n                            <th>{$langAnnouncement}</th>\n                            <th colspan='2'><div align='center'>" . icon('fa-gears') . "</th>";
        foreach ($result as $myrow) {
            if ($myrow->visible == 1) {
                $visibility = 0;
                $classvis = '';
            } else {
                $visibility = 1;
                $classvis = 'not_visible';
            }
            $myrow->date = claro_format_locale_date($dateFormatLong, strtotime($myrow->date));
            $tool_content .= "<tr class='{$classvis}'>\n                <td width='200'><b>" . q($myrow->title) . "</b><br><span class='smaller'>{$myrow->date}</span></td>\n                <td>" . standard_text_escape($myrow->body) . "</td>\n                <td width='6'>" . action_button(array(array('title' => $langModify, 'url' => "{$_SERVER['SCRIPT_NAME']}?modify={$myrow->id}", 'icon' => 'fa-edit'), array('title' => $langDelete, 'class' => 'delete', 'url' => "{$_SERVER['SCRIPT_NAME']}?delete={$myrow->id}", 'confirm' => $langConfirmDelete, 'icon' => 'fa-times'), array('title' => $langVisibility, 'url' => "{$_SERVER['SCRIPT_NAME']}?id={$myrow->id}&amp;vis={$visibility}", 'icon' => $visibility == 0 ? 'fa-eye' : 'fa-eye-slash'), array('title' => $langUp, 'url' => "{$_SERVER['SCRIPT_NAME']}?up={$myrow->id}", 'icon' => 'fa-arrow-up'), array('title' => $langDown, 'url' => "{$_SERVER['SCRIPT_NAME']}?down={$myrow->id}", 'icon' => 'fa-arrow-down'))) . "\n                </td></tr>";
        }
        $tool_content .= "</table>";
        $tool_content .= "</div>";
    }
}
draw($tool_content, 3, null, $head_content);
Beispiel #17
0
                         </div>";
         $section_title = "<div class='form-group".(Session::getError('new_section_title') ? " has-error" : "")."'>
                             <input type='text size='3' class='form-control' name='new_section_title' value='$qstitle'>
                             <span class='help-block'>".Session::getError('new_section_title')."</span>    
                         </div>
                         ";
         $section_editing = true;
         $section_tools = "<input class='btn btn-primary' type='submit' name='new_section_submit' value='$langModify' />";
     } else {
         $section_id = q($section->public_id);
         $section_title = q($section->title);
         $section_tools = action_button(array(
                             array('title' => $langEditChange,
                                   'url' => "edit.php?course=$course_code&amp;id=$ebook_id&amp;s=$sid&amp;editEbook=1",
                                   'icon' => 'fa-edit'),
                             array('title' => $langDelete,
                                   'url' => "edit.php?course=$course_code&amp;id=$ebook_id&amp;delete=$sid&amp;editEbook=1",
                                   'icon' => 'fa-times',
                                   'class' => 'delete',
                                   'confirm' => $langEBookSectionDelConfirm)
         ));            
     }       
     $tool_content .= "
     <tr>
       <td style='width:70px;'>$section_id</td>
       <td>$section_title</td>
       <td class='text-center'>$section_tools</td>
     </tr>";          
 }
 $new_section_id = Session::has('new_section_id') ? Session::get('new_section_id') : '';
 if (!$section_editing) {
     $tool_content .= "
Beispiel #18
0
 $user_role_controls = action_button(array(
     array(
       'title' => $langUnregCourse,
       'level' => 'primary',
       'url' => '#',
       'icon' => 'fa-times',
       'btn_class' => 'delete_btn btn-default'
     ),
     array(
         'title' => $myrow->tutor == '0' ? $langGiveRightTutor : $langRemoveRightTutor,
         'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;".($myrow->tutor == '0' ? "give" : "remove")."Tutor=". getIndirectReference($myrow->id),
         'icon' => $myrow->tutor == '0' ? "fa-square-o" : "fa-check-square-o"
     ),
     array(
         'title' => $myrow->editor == '0' ? $langGiveRightEditor : $langRemoveRightEditor,
         'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;".($myrow->editor == '0' ? "give" : "remove")."Editor=". getIndirectReference($myrow->id),
         'icon' => $myrow->editor == '0' ? "fa-square-o" : "fa-check-square-o"
     ),            
     array(
         'title' => $myrow->status != '1' ? $langGiveRightAdmin : $langRemoveRightAdmin,
         'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;".($myrow->status == '1' ? "remove" : "give")."Admin=". getIndirectReference($myrow->id),
         'icon' => $myrow->status != '1' ? "fa-square-o" : "fa-check-square-o",
         'disabled' => $myrow->id == $_SESSION["uid"] || ($myrow->id != $_SESSION["uid"] && get_config('opencourses_enable') && $myrow->reviewer == '1')
     ),
     array(
         'title' => $myrow->reviewer != '1' ? $langGiveRightReviewer : $langRemoveRightReviewer,
         'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;".($myrow->reviewer == '1' ? "remove" : "give")."Reviewer=". getIndirectReference($myrow->id),
         'icon' => $myrow->reviewer != '1' ? "fa-square-o" : "fa-check-square-o",
         'disabled' => $myrow->id == $_SESSION["uid"],
         'show' => get_config('opencourses_enable') && 
                     (
                         ($myrow->id == $_SESSION["uid"] && $myrow->reviewer == '1') || 
                         ($myrow->id != $_SESSION["uid"] && $is_opencourses_reviewer && $is_admin)
                     )
     )            
 ));
         }
         $myrow->date = claro_format_locale_date($dateFormatLong, strtotime($myrow->date));
         $tool_content .= "<tr class='$classvis'>
             <td width='200'><b>" . q($myrow->title) . "</b><br><span class='smaller'>$myrow->date</span></td>
             <td>" . standard_text_escape($myrow->body) . "</td>
             <td width='6'>" .
                 action_button(array(
                     array('title' => $langEditChange,
                         'url' => "$_SERVER[SCRIPT_NAME]?modify=$myrow->id",
                         'icon' => 'fa-edit'),
                     array('title' => $visibility == 0 ? $langViewHide : $langViewShow,
                         'url' => "$_SERVER[SCRIPT_NAME]?id=$myrow->id&amp;vis=$visibility",
                         'icon' => $visibility == 0 ? 'fa-eye-slash' : 'fa-eye'),
                     array('title' => $langUp,
                         'url' => "$_SERVER[SCRIPT_NAME]?up=$myrow->id",
                         'icon' => 'fa-arrow-up'),
                     array('title' => $langDown,
                         'url' => "$_SERVER[SCRIPT_NAME]?down=$myrow->id",
                         'icon' => 'fa-arrow-down'),
                     array('title' => $langDelete,
                         'class' => 'delete',
                         'url' => "$_SERVER[SCRIPT_NAME]?delete=$myrow->id",
                         'confirm' => $langConfirmDelete,
                         'icon' => 'fa-times')
                 )) . "
             </td></tr>";
     }
     $tool_content .= "</table>";
     $tool_content .= "</div>";
 } else {
     $tool_content .= "<div class='row'><div class='col-xs-12'><div class='alert alert-warning'>$langNoAnnounce</div></div></div>";
Beispiel #20
0
        ?>
.</td>
								<td><?php 
        echo $cat->getName();
        ?>
</td>
        						<td><?php 
        echo $cat->getPosts() ? count($cat->getPosts()) : 0;
        ?>
</td>
        						<td><?php 
        if (\App::isGranted('editCategory')) {
            echo action_button('edit', site_url('admin/post/category/edit/' . $cat->getSlug()), array('title' => 'Edit ' . $cat->getName())) . "&emsp;";
        }
        if (\App::isGranted('deleteCategory')) {
            echo action_button('delete', site_url('admin/post/category/delete/' . $cat->getSlug()), array('title' => 'Delete ' . $cat->getName()));
        }
        ?>
        						</td>
        					</tr>
        					<?php 
    }
}
?>
        				<?php 
if ($count == 0) {
    ?>
						    <tr>
						    	<td colspan="6" style="text-align: center;">
						    		<strong>No Category found!</strong>
						    	</td>
Beispiel #21
0
/**
 * @brief resource actions
 * @global type $is_editor
 * @global type $langEdit
 * @global type $langDelete
 * @global type $langVisibility
 * @global type $langAddToCourseHome
 * @global type $langDown
 * @global type $langUp
 * @global type $langConfirmDelete
 * @global type $course_code
 * @staticvar boolean $first
 * @param type $res_type
 * @param type $resource_id
 * @param type $status
 * @param type $res_id
 * @return string
 */
function actions($res_type, $resource_id, $status, $res_id = false)
{
    global $is_editor, $langEdit, $langDelete, $langVisibility, $langAddToCourseHome, $langDown, $langUp, $langConfirmDelete, $course_code;
    static $first = true;
    if (!$is_editor) {
        return '';
    }
    if ($res_type == 'description') {
        $icon_vis = $status == 1 ? 'fa-send' : 'fa-send-o';
        $edit_link = "edit.php?course={$course_code}&amp;numBloc={$res_id}";
    } else {
        $icon_vis = $status == 1 ? 'fa-eye' : 'fa-eye-slash';
        $edit_link = "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;edit={$resource_id}";
    }
    $content = "<td class='option-btn-cell'>";
    $content .= action_button(array(array('title' => $langEdit, 'url' => $edit_link, 'icon' => 'fa-edit', 'show' => $status != 'del'), array('title' => $langDelete, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;del={$resource_id}", 'icon' => 'fa-times', 'confirm' => $langConfirmDelete, 'class' => 'delete'), array('title' => $langVisibility, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;vis={$resource_id}", 'icon' => $icon_vis, 'show' => $status != 'del' and in_array($res_type, array('text', 'video', 'forum', 'topic'))), array('title' => $langAddToCourseHome, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;vis={$resource_id}", 'icon' => $icon_vis, 'show' => $status != 'del' and in_array($res_type, array('description'))), array('title' => $langDown, 'level' => 'primary', 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;down={$resource_id}", 'icon' => 'fa-arrow-down', 'disabled' => $resource_id == $GLOBALS['max_resource_id']), array('title' => $langUp, 'level' => 'primary', 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;up={$resource_id}", 'icon' => 'fa-arrow-up', 'disabled' => $first)));
    $first = false;
    return $content;
}
Beispiel #22
0
if (empty($group_description)) {
    $tool_content_description = ' &nbsp;&nbsp;-&nbsp;&nbsp;  ';
} else {
    $tool_content_description = q($group_description);
}

$tool_content .= "
    <div class='panel panel-action-btn-primary'>
        <div class='panel-heading'>
            <div class='pull-right'>
            ". (($is_editor) ? 
                    action_button(array(
                        array(
                            'title' => $langEditGroup,
                            'url' => "group_edit.php?course=$course_code&group_id=$group_id&from=group",
                            'level' => 'primary-label',
                            'icon' => 'fa-edit',
                            'show' => $is_editor or $is_tutor                            
                        )
                    )) : "")."    
            </div>        
            <h3 class='panel-title'>
            $langGroupInfo
            </h3>
        </div>
        <div class='panel-body'>
            <div class='row'>
                <div class='col-sm-3'><strong>$langGroupName:</strong></div>
                <div class='col-sm-9'>" . q($group_name) . "</div>
            </div>
            <div class='row'>
Beispiel #23
0
            } elseif ($row2->attempt_status == ATTEMPT_PENDING) {
                $status = "<a href='exercise_result.php?course=$course_code&amp;eurId=$row2->eurid'>" .$langAttemptPending. "</a>";
            } elseif ($row2->attempt_status == ATTEMPT_PAUSED) {
                $status = $langAttemptPaused;
            } elseif ($row2->attempt_status == ATTEMPT_CANCELED) {
                $status = $langAttemptCanceled;
            }
            $tool_content .= "
                    <td class='text-center'>$status</td>";
            if ($is_editor) {
            $tool_content .= "
                    <td class='option-btn-cell'>" . action_button(array(
                        array(
                            'title' => $langDelete,
                            'url' => "results.php?course=$course_code&exerciseId=$exerciseId&purgeAttempID=$row2->eurid",
                            'icon' => "fa-times",
                            'confirm' => $langQuestionCatDelConfirrm,
                            'class' => 'delete'
                        )
                    )) . "</td>";
            }
            $tool_content .= "            
                </tr>";            
            $k++;
        }
        $tool_content .= "</table></div><br>";
    }
}
$head_content .= "
    <script type='text/javascript'>
            $(function(){
Beispiel #24
0
 }
 $section_editing = false;
 foreach ($q as $section) {
     $sid = $section->id;
     $qsid = q($section->public_id);
     $qstitle = q($section->title);
     $sections[$sid] = $qsid . '. ' . ellipsize($section->title, 25);
     if ($sid === $edit_section) {
         $section_id = "<input type='hidden' name='csid' value='{$sid}' />" . "<input type='text size='3' name='new_section_id' value='{$qsid}' />";
         $section_title = "<input type='text size='3' name='new_section_title' value='{$qstitle}' />";
         $section_editing = true;
         $section_tools = "<input class='btn btn-primary' type='submit' name='new_section_submit' value='{$langModify}' />";
     } else {
         $section_id = $qsid;
         $section_title = $qstitle;
         $section_tools = action_button(array(array('title' => $langModify, 'url' => "edit.php?course={$course_code}&amp;id={$ebook_id}&amp;s={$sid}", 'icon' => 'fa-edit'), array('title' => $langDelete, 'url' => "edit.php?course={$course_code}&amp;id={$ebook_id}&amp;delete={$sid}", 'icon' => 'fa-times', 'class' => 'delete', 'confirm' => $langEBookSectionDelConfirm)));
     }
     $tool_content .= "\n        <tr>\n          <td class='text-right'>{$section_id}</td>\n          <td>{$section_title}</td>\n          <td class='text-center'>{$section_tools}</td>\n        </tr>";
 }
 if (!$section_editing) {
     $tool_content .= "\n        <tr>\n          <td><input type='text' size='2' name='new_section_id' /></td>\n          <td><input type='text' size='35' name='new_section_title' /></td>\n          <td class='center'><input class='btn btn-primary' type='submit' name='new_section_submit' value='{$langAdd}' /></td>\n        </tr>";
 }
 $tool_content .= "\n      </table>\n      </fieldset>";
 // Form #3 - edit subsection file assignment
 $tool_content .= "\n     <fieldset>\n     <h4>{$langEBookMenuTitle}</h4>\n     <table width='100%' class='table-default'>\n     <tr>       \n       <th>{$langFileName}</th>\n       <th>{$langTitle}</th>\n       <th>{$langSection}</th>\n       <th>{$langSubsection}</th>\n     </tr>";
 $q = Database::get()->queryArray("SELECT ebook_section.id AS sid,\n                              ebook_section.id AS psid,\n                              ebook_section.title AS section_title,\n                              ebook_subsection.id AS ssid,\n                              ebook_subsection.public_id AS pssid,\n                              ebook_subsection.title AS subsection_title,\n                              ebook_subsection.file_id as file_id\n                       FROM ebook_section, ebook_subsection\n                       WHERE ebook_section.ebook_id = {$info->id} AND\n                             ebook_section.id = ebook_subsection.section_id\n                             ORDER BY CONVERT(psid, UNSIGNED), psid,\n                                      CONVERT(pssid, UNSIGNED), pssid");
 foreach ($q as $r) {
     $file_id = $r->file_id;
     $display_id = $r->sid . ',' . $r->ssid;
     $tool_content .= "\n            <tr>              \n              <td class='smaller'><a href='show.php/{$course_code}/{$ebook_id}/{$display_id}/' target='_blank'>" . q($files[$id_map[$file_id]]) . "</a></td>\n              <td><input type='text' name='title[{$file_id}]' size='30' value='" . q($r->subsection_title) . "'></td>\n              <td>" . selection($sections, "sid[{$file_id}]", $r->sid, 'class="form-control"') . "</td>\n              <td class='center'><input type='hidden' name='oldssid[{$file_id}]' value='{$r->ssid}'>\n                  <input type='text' name='ssid[{$file_id}]' size='3' value='" . q($r->pssid) . "'></td>\n            </tr>";
     unset($files[$id_map[$file_id]]);
    $form_action_url .= isset($_GET['modifyCat']) ? "&modifyCat=" . intval($_GET['modifyCat']) : "&newCat=yes";
    if (isset($_GET['modifyCat'])) {
        $q_cat = Database::get()->querySingle("SELECT * FROM exercise_question_cats WHERE question_cat_id = ?d", $_GET['modifyCat']);
    }
    $questionCatName = Session::has('questionCatName') ? Session::get('questionCatName') : (isset($q_cat) ? $q_cat->question_cat_name : '');
    $tool_content .= action_bar(array(array('title' => $langBack, 'level' => 'primary-label', 'icon' => 'fa-reply', 'url' => "question_categories.php?course={$course_code}")));
    $tool_content .= "\n        <div class='form-wrapper'>\n            <form class='form-horizontal' role='form' action='{$form_action_url}' method='post'>\n                <div class='form-group " . (Session::getError('questionCatName') ? "has-error" : "") . "'>\n                    <label for='questionCatName' class='col-sm-2 control-label'>{$langTitle}:</label>\n                    <div class='col-sm-10'>\n                      <input name='questionCatName' type='text' class='form-control' id='questionCatName' placeholder='{$langTitle}' value='{$questionCatName}'>\n                      <span class='help-block'>" . Session::getError('questionCatName') . "</span>\n                    </div>\n                </div>\n                <div class='form-group'>\n                    <div class='col-sm-10 col-sm-offset-2'>\n                        <input class='btn btn-primary' name='submitCat' type='submit' value='{$langSubmit}'>\n                        <a href='question_categories.php?course={$course_code}' class='btn btn-default'>{$langCancel}</a>\n                    </div>\n                </div>                \n            </form>\n        </div>";
} elseif (isset($_GET['deleteCat'])) {
    $q_cat_id = $_GET['deleteCat'];
    if (Database::get()->query("DELETE FROM exercise_question_cats WHERE question_cat_id = ?d AND course_id = ?d", $q_cat_id, $course_id)->affectedRows > 0) {
        Database::get()->query("UPDATE exercise_question SET category = ?d WHERE category = ?d AND course_id = ?d", 0, $q_cat_id, $course_id);
        Session::Messages($langDelCatSuccess, 'alert-success');
    }
    redirect_to_home_page("modules/exercise/question_categories.php?course={$course_code}");
} else {
    $pageName = $langQuestionCats;
    $navigation[] = array("url" => "index.php?course={$course_code}", "name" => $langExercices);
    $tool_content .= action_bar(array(array('title' => $langNewCat, 'level' => 'primary-label', 'icon' => 'fa-plus-circle', 'url' => "question_categories.php?course={$course_code}&newCat=yes", 'button-class' => 'btn-success'), array('title' => $langBack, 'level' => 'primary', 'icon' => 'fa-reply', 'url' => "index.php?course={$course_code}")));
    $q_cats = Database::get()->queryArray("SELECT * FROM exercise_question_cats WHERE course_id = ?d", $course_id);
    if (count($q_cats) > 0) {
        $tool_content .= "\n            <div class='table-responsive'>\n                <table class='table-default'>\n                    <tbody>\n                        <tr>\n                            <th>{$langTitle}</th>\n                            <th class='text-center'>" . icon('fa-gears') . "</th>\n                        </tr> \n                    ";
        foreach ($q_cats as $q_cat) {
            $action_button = action_button(array(array('title' => $langEdit, 'url' => "question_categories.php?course={$course_code}&modifyCat={$q_cat->question_cat_id}", 'icon' => 'fa-edit'), array('title' => $langDelete, 'url' => "question_categories.php?course={$course_code}&deleteCat={$q_cat->question_cat_id}", 'icon' => 'fa-times', 'confirm' => $langQuestionCatDelConfirrm, 'class' => 'delete')));
            $tool_content .= "\n                        <tr>\n                            <td>{$q_cat->question_cat_name}</td>\n                            <td class='option-btn-cell'>{$action_button}</td>\n                        </tr>";
        }
        $tool_content .= "                \n                    </tbody>\n                </table>\n            </div>";
    } else {
        $tool_content .= "<div class='alert alert-warning'>{$langNoQuestionCats}</div>";
    }
}
draw($tool_content, 2, null, $head_content);
Beispiel #26
0
     $comm = new Commenting('blogpost', $post->getId());
     $comment_content = "<a class='btn btn-primary btn-xs pull-right' href='$_SERVER[SCRIPT_NAME]?$url_params&amp;action=showPost&amp;pId=".$post->getId()."#comments_title'>$langComments (".$comm->getCommentsNum().")</a>";
 } else {
     $comment_content = "<div class=\"blog_post_empty_space\"></div>";
 }            
 $tool_content .= "<div class='panel panel-action-btn-default'>
                     <div class='panel-heading'>
                         <div class='pull-right'>
                             ". action_button(array(
                                 array(
                                     'title' => $langEditChange,
                                     'url' => "$_SERVER[SCRIPT_NAME]?$url_params&amp;action=editPost&amp;pId=".$post->getId(),
                                     'icon' => 'fa-edit',
                                     'show' => $allow_to_edit
                                 ),
                                 array(
                                     'title' => $langDelete,
                                     'url' => "$_SERVER[SCRIPT_NAME]?$url_params&amp;action=delPost&amp;pId=".$post->getId(),
                                     'icon' => 'fa-times',
                                     'class' => 'delete',
                                     'confirm' => $langSureToDelBlogPost,
                                     'show' => $allow_to_edit
                                 )                                        
                             ))."
                         </div>
                         <h3 class='panel-title'>
                             <a href='$_SERVER[SCRIPT_NAME]?$url_params&amp;action=showPost&amp;pId=".$post->getId()."'>".q($post->getTitle())."</a>
                         </h3>                                    
                     </div>
                     <div class='panel-body'>
                         <div class='label label-success'>" . nice_format($post->getTime(), true). "</div><small>".$langBlogPostUser.display_user($post->getAuthor(), false, false)."</small><br><br>".standard_text_escape(ellipsize_html($post->getContent(), $num_chars_teaser_break, "<strong>&nbsp;...<a href='$_SERVER[SCRIPT_NAME]?$url_params&amp;action=showPost&amp;pId=".$post->getId()."'> <span class='smaller'>[$langMore]</span></a></strong>"))."
                         $comment_content
Beispiel #27
0
                'icon' => 'fa-times',
                'class' => 'delete',
                'confirm' => $langConfirmDelete)
        );
        
        if ($is_editor) {
            if ($topic_locked == 0) {
                $dyntools[] = array('title' => $langLockTopic,
                    'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;forum=$forum_id&amp;topic_id=$myrow->id&amp;topiclock=yes",
                    'icon' => 'fa-lock'
                    );
            } else {
                $dyntools[] = array('title' => $langUnlockTopic,
                    'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;forum=$forum_id&amp;topic_id=$myrow->id&amp;topiclock=yes",
                    'icon' => 'fa-unlock'
                    );
            }
        }
        
        $dyntools[] = array('title' => $langNotify,
                            'url' => (isset($_GET['start']) and $_GET['start'] > 0) ? "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;forum=$forum_id&amp;start=$_GET[start]&amp;topicnotify=$topic_link_notify&amp;topic_id=$myrow->id" : "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;forum=$forum_id&amp;topicnotify=$topic_link_notify&amp;topic_id=$myrow->id",
                            'icon' => 'fa-envelope');
        $tool_content .= action_button($dyntools);
        $tool_content .= "</td></tr>";        
    } // end of while
    $tool_content .= "</table></div>";
} else {
    $tool_content .= "<div class='alert alert-warning'>$langNoTopics</div>";
}
draw($tool_content, 2, null, $head_content);
                    } else {
                        if ($module['contentType'] == CTMEDIA_ || $module['contentType'] == CTMEDIALINK_) {
                            $moduleImg = "fa-film";
                        } else {
                            $moduleImg = choose_image(basename($module['path']));
                        }
                    }
                }
            }
        }
        $contentType_alt = selectAlt($module['contentType']);
        $tool_content .= "<span style=\"vertical-align: middle;\">" . icon($moduleImg, $contentType_alt) . "</span>&nbsp;<a href=\"viewer.php?course={$course_code}&amp;path_id=" . (int) $_SESSION['path_id'] . "&amp;module_id=" . $module['module_id'] . "\"" . $style . ">" . htmlspecialchars($module['name']) . "</a>";
    }
    $tool_content .= "</td>";
    // end of td of module name
    if ($module['contentType'] == CTSCORM_ || $module['contentType'] == CTSCORMASSET_) {
        $del_conf_text = clean_str_for_javascript($langAreYouSureToRemoveSCORM);
    } else {
        if ($module['contentType'] == CTLABEL_) {
            $del_conf_text = clean_str_for_javascript($langAreYouSureToRemoveLabel);
        } else {
            $del_conf_text = clean_str_for_javascript($langAreYouSureToRemoveStd);
        }
    }
    $tool_content .= "<td class='option-btn-cell'>" . action_button(array(array('title' => $langBlock, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&amp;cmd=mkBlock&amp;cmdid=" . $module['learnPath_module_id'], 'icon' => 'fa-unlock', 'show' => $module['lock'] == 'OPEN'), array('title' => $langAltMakeNotBlocking, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&amp;cmd=mkUnblock&amp;cmdid=" . $module['learnPath_module_id'], 'icon' => 'fa-lock', 'show' => $module['lock'] == 'CLOSE'), array('title' => $langModify, 'url' => "module.php?course={$course_code}&amp;module_id=" . $module['module_id'], 'icon' => 'fa-edit'), array('title' => $langRemove, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&amp;cmd=delModule&amp;cmdid=" . $module['learnPath_module_id'], 'class' => 'delete', 'confirm' => $del_conf_text + " " + $module['name'], 'icon' => 'fa-times'), array('title' => $langVisible, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&amp;cmd=mkVisibl&amp;cmdid=" . $module['module_id'], 'icon' => 'fa-eye-slash', 'show' => $module['visible'] == 0), array('title' => $langVisible, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&amp;cmd=mkInvisibl&amp;cmdid=" . $module['module_id'], 'icon' => 'fa-eye', 'confirm' => $module['lock'] == 'CLOSE' ? $langAlertBlockingMakedInvisible : null, 'confirm_title' => "", 'confirm_button' => $langAccept, 'show' => $module['visible'] != 0), array('title' => $langMove, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&amp;cmd=changePos&amp;cmdid=" . $module['learnPath_module_id'], 'icon' => 'fa-mail-forward'), array('title' => $langUp, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&amp;cmd=moveUp&amp;cmdid=" . $module['learnPath_module_id'], 'level' => 'primary', 'icon' => 'fa-arrow-up', 'disabled' => !$module['up']), array('title' => $langDown, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&amp;cmd=moveDown&amp;cmdid=" . $module['learnPath_module_id'], 'level' => 'primary', 'icon' => 'fa-arrow-down', 'disabled' => !$module['down']))) . "</td>";
    $tool_content .= "</tr>";
    $ind++;
}
// end of foreach
$tool_content .= "</table></div><br>";
draw($tool_content, 2, null, $head_content, $body_action);
Beispiel #29
0
                }
                if (\App::isGranted('deleteUser')) {
                    echo action_button('trash', site_url('admin/user/trash/' . $user->getUsername()), array('title' => 'Delete ' . $user->getUsername())) . "&emsp;";
                }
                break;
            case user\models\User::STATUS_BLOCK:
                if (\App::isGranted('editUser')) {
                    echo action_button('unblock', site_url('admin/user/unblock/' . $user->getUsername()), array('title' => 'Unblock ' . $user->getUsername())) . "&emsp;";
                }
                break;
            case user\models\User::STATUS_TRASH:
                if (\App::isGranted('editUser')) {
                    echo action_button('restore', site_url('admin/user/activate/' . $user->getUsername()), array('title' => 'Restore ' . $user->getUsername())) . "&emsp;";
                }
                if (\App::isGranted('deleteUser')) {
                    echo action_button('delete', site_url('admin/user/delete/' . $user->getUsername()), array('title' => 'Delete ' . $user->getUsername() . ' permanently!')) . "&emsp;";
                }
                break;
        }
    }
    ?>
					</td>
				</tr>
		    <?php 
}
?>

		    <?php 
if ($list == 0) {
    ?>
		    <tr>
Beispiel #30
0
 $tool_content .= "      
         <div class='pull-right'>".
         action_button(
                 array(
                     array(
                         'title' => $langEditChange,
                         'url' => "edit.php?course=$course_code&amp;id=" . getIndirectReference($row->id),
                         'icon' => 'fa-edit'
                     ),
                     array('title' => $row->visible ? $langRemoveFromCourseHome : $langAddToCourseHome,
                         'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;vis=" . getIndirectReference($row->id),
                         'icon' => $row->visible ? 'fa-eye-slash' : 'fa-eye'
                     ),
                     array('title' => q($langUp),
                         'level' => 'primary',
                         'icon' => 'fa-arrow-up',
                         'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;up=" . getIndirectReference($row->id),
                         'disabled' => $i <= 0),
                     array('title' => q($langDown),
                         'level' => 'primary',
                         'icon' => 'fa-arrow-down',
                         'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;down=" . getIndirectReference($row->id),
                         'disabled' => $i + 1 >= count($q)),
                     array('title' => q($langDelete),
                         'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&amp;del=" . getIndirectReference($row->id),
                         'icon' => 'fa-times',
                         'class' => 'delete',
                         'confirm' => $langConfirmDelete)                            
                 )
         ) ."</div>";
 }
 $tool_content .= "