當前位置: 首頁>>代碼示例>>PHP>>正文


PHP flexible_table::column_style方法代碼示例

本文整理匯總了PHP中flexible_table::column_style方法的典型用法代碼示例。如果您正苦於以下問題:PHP flexible_table::column_style方法的具體用法?PHP flexible_table::column_style怎麽用?PHP flexible_table::column_style使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在flexible_table的用法示例。


在下文中一共展示了flexible_table::column_style方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

        has_capability('mod/feedback:deletetemplate', $systemcontext)) {
        $templates = feedback_get_template_list($course, 'public');
        if (!is_array($templates)) {
            echo $OUTPUT->box(get_string('no_templates_available_yet', 'feedback'),
                              'generalbox boxaligncenter');
        } else {
            echo $OUTPUT->heading(get_string('public', 'feedback'), 3);
            echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');
            $tablecolumns = array('template', 'action');
            $tableheaders = array(get_string('template', 'feedback'), '');
            $tablepublic = new flexible_table('feedback_template_public_table');

            $tablepublic->define_columns($tablecolumns);
            $tablepublic->define_headers($tableheaders);
            $tablepublic->define_baseurl($deleteurl);
            $tablepublic->column_style('action', 'width', '10%');

            $tablepublic->sortable(false);
            $tablepublic->set_attribute('width', '100%');
            $tablepublic->set_attribute('class', 'generaltable');
            $tablepublic->setup();

            foreach ($templates as $template) {
                $data = array();
                $data[] = $template->name;
                $url = new moodle_url($deleteurl, array(
                                                'id'=>$id,
                                                'deletetempl'=>$template->id,
                                                'shoulddelete'=>1,
                                                ));
開發者ID:verbazend,項目名稱:AWFA,代碼行數:30,代碼來源:delete_template.php

示例2: array

$PAGE->set_context($coursecontext);
$PAGE->set_pagelayout('incourse');
#---------------------- table setup here--------------------------
$refresh_txt = get_string('refresh_page', 'wiziq');
$table = new flexible_table('wixiq_content');
$table->define_columns(array('name', 'status', 'delete'));
$statusicon = '<img src="'.$CFG->wwwroot.'/mod/wiziq/pix/refresh.png" alt='.$refresh_txt.'/>';
$stausimage_first = '<a href="javascript:location.reload(true)"';
$stausimage_second = ' title="'.$refresh_txt.'">'.$statusicon.'</a>';
$stausimage = $stausimage_first.$stausimage_second;
$status = 'Status'." ".$stausimage;
$nameheding = get_string('nameheading', 'wiziq');
$deleteheading = get_string('deleteheading', 'wiziq');
$table->define_headers(array($nameheding, $status, $deleteheading));
$table->column_style_all('text-align', 'left');
$table->column_style('name', 'width', 'auto');
$table->column_style('status', 'text-align', 'center');
$table->column_style('delete', 'text-align', 'center');
$table->column_style('status', 'width', '180px');
$table->column_style('delete', 'width', '180px');
$table->define_baseurl($PAGE->url);
$table->is_downloadable(false);
$table->sortable(false);
$table->pageable(true);
echo $OUTPUT->header();
#--------------------------tabs for navigation-----------
$schedulenewwiziqclass = new moodle_url("$CFG->wwwroot/course/modedit.php",
        array('add' => 'wiziq', 'type' => '', 'course' => $course->id,
              'section' => '0', 'return' => '0'));
$navigationtabsmanage = new moodle_url("$CFG->wwwroot/mod/wiziq/index.php",
        array('id' =>  $course->id, 'sesskey' => sesskey()));
開發者ID:narasimhaeabyas,項目名稱:tataaiapro,代碼行數:31,代碼來源:content.php

示例3: array

echo html_writer::start_tag('form', $formattributes);
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'returnto', 'value' => s($PAGE->url->out(false))));
// Setup submissions table.
$table = new flexible_table('mod-block-progress-overview');
$table->pagesize($perpage, $numberofusers);
$tablecolumns = array('select', 'picture', 'fullname', 'lastonline', 'progressbar', 'progress');
$table->define_columns($tablecolumns);
$tableheaders = array('', '', get_string('fullname'), get_string('lastonline', 'block_progress'), get_string('progressbar', 'block_progress'), get_string('progress', 'block_progress'));
$table->define_headers($tableheaders);
$table->sortable(true);
$table->set_attribute('class', 'overviewTable');
$table->column_style_all('padding', '5px');
$table->column_style_all('text-align', 'left');
$table->column_style_all('vertical-align', 'middle');
$table->column_style('select', 'text-align', 'right');
$table->column_style('select', 'padding', '5px 0 5px 5px');
$table->column_style('progressbar', 'width', '200px');
$table->column_style('progress', 'text-align', 'center');
$table->no_sorting('select');
$select = '';
$table->no_sorting('picture');
$table->no_sorting('progressbar');
if ($paged) {
    $table->no_sorting('progress');
}
$table->define_baseurl($PAGE->url);
$table->setup();
// Sort the users (except by progress).
$sort = $table->get_sql_sort();
$sortbyprogress = strncmp($sort, 'progress', 8) == 0;
開發者ID:nwp90,項目名稱:Moodle-block_progress,代碼行數:31,代碼來源:overview.php

示例4: array

 $perpage = get_user_preferences('stampcoll_perpage', STAMPCOLL_USERS_PER_PAGE);
 $tablecolumns = array('picture', 'fullname', 'count', 'stamps');
 $tableheaders = array('', get_string('fullname'), get_string('numberofstamps', 'stampcoll'), '');
 require_once $CFG->libdir . '/tablelib.php';
 $table = new flexible_table('mod-stampcoll-stamps');
 $table->define_columns($tablecolumns);
 $table->define_headers($tableheaders);
 $table->define_baseurl($CFG->wwwroot . '/mod/stampcoll/view.php?id=' . $cm->id . '&amp;currentgroup=' . $currentgroup);
 $table->sortable(true);
 $table->collapsible(false);
 $table->initialbars(true);
 $table->column_class('picture', 'picture');
 $table->column_class('fullname', 'fullname');
 $table->column_class('count', 'count');
 $table->column_class('stamps', 'stamps');
 $table->column_style('stamps', 'width', '50%');
 $table->set_attribute('cellspacing', '0');
 $table->set_attribute('id', 'stamps');
 $table->set_attribute('class', 'stamps');
 $table->set_attribute('width', '90%');
 $table->set_attribute('align', 'center');
 $table->setup();
 if (empty($users)) {
     print_heading(get_string('nousers', 'stampcoll'));
     return true;
 }
 /// Construct the SQL
 if ($where = $table->get_sql_where()) {
     $where .= ' AND ';
 }
 if ($sort = $table->get_sql_sort()) {
開發者ID:hmatulis,項目名稱:RTL-BIDI-Hebrew-Moodle-Plugins,代碼行數:31,代碼來源:view.php

示例5: navmenu

 function display_submissions($message = '')
 {
     global $CFG, $db, $USER;
     require_once $CFG->libdir . '/gradelib.php';
     // Update preferences
     if (isset($_POST['updatepref'])) {
         $perpage = optional_param('perpage', 20, PARAM_INT);
         $perpage = $perpage <= 0 ? 20 : $perpage;
         set_user_preference('assignment_perpage', $perpage);
         $moderationtarget = optional_param('moderationtarget', 0, PARAM_INT);
         $moderationtarget = $moderationtarget <= 0 ? 0 : $moderationtarget;
         set_user_preference('assignment_moderationtarget', $moderationtarget);
     }
     // Get preferences
     $perpage = get_user_preferences('assignment_perpage', 10);
     $moderationtarget = get_user_preferences('assignment_moderationtarget', 0);
     // Some shortcuts to make the code read better
     $grading_info = grade_get_grades($this->course->id, 'mod', 'assignment', $this->assignment->id);
     $course = $this->course;
     $assignment = $this->assignment;
     $cm = $this->cm;
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
     $page = optional_param('page', 0, PARAM_INT);
     // Log this view
     add_to_log($course->id, 'assignment', 'view submission', 'submissions.php?id=' . $this->assignment->id, $this->assignment->id, $this->cm->id);
     // Print header and navigation breadcrumbs
     $navigation = build_navigation($this->strsubmissions, $this->cm);
     print_header_simple(format_string($this->assignment->name, true), "", $navigation, '', '', true, update_module_button($cm->id, $course->id, $this->strassignment), navmenu($course, $cm));
     // Print tabs at top of page
     $tabs = array();
     $row = array();
     $inactive = array();
     $activated = array();
     $row[] = new tabobject('criteria', "type/peerreview/" . self::CRITERIA_FILE . "?id=" . $this->cm->id . "&a=" . $this->assignment->id, get_string('criteria', 'assignment_peerreview'));
     $row[] = new tabobject('submissions', '', get_string('submissions', 'assignment_peerreview'));
     $tabs[] = $row;
     $currenttab = 'submissions';
     $inactive[] = 'submissions';
     $activated[] = 'submissions';
     print_tabs($tabs, $currenttab, $inactive, $activated);
     // Print optional message
     if (!empty($message)) {
         echo $message;
         // display messages here if any
     }
     // Check to see if groups are being used in this assignment
     // find out current groups mode
     // $groupmode = groups_get_activity_groupmode($cm);
     // $currentgroup = groups_get_activity_group($cm, true);
     // groups_print_activity_menu($cm, $CFG->wwwroot.'/mod/assignment/submissions.php?id=' . $cm->id);
     // Get all ppl that are allowed to submit assignments
     // if ($users = get_users_by_capability($context, 'mod/assignment:submit', 'u.id', '', '', '', $currentgroup, '', false)) {
     if ($users = get_users_by_capability($context, 'mod/assignment:submit', 'u.id')) {
         $users = array_keys($users);
     }
     // Filter out teachers
     if ($users && ($teachers = get_users_by_capability($context, 'mod/assignment:grade', 'u.id'))) {
         $users = array_diff($users, array_keys($teachers));
     }
     // Warn if class is too small
     if (count($users) < 5) {
         notify(get_string('numberofstudentswarning', 'assignment_peerreview'));
     }
     // if groupmembersonly used, remove users who are not in any group
     // if ($users and !empty($CFG->enablegroupings) and $cm->groupmembersonly) {
     // if ($groupingusers = groups_get_grouping_members($cm->groupingid, 'u.id', 'u.id')) {
     // $users = array_intersect($users, array_keys($groupingusers));
     // }
     // }
     // Create the table to be shown
     require_once $CFG->libdir . '/tablelib.php';
     $table = new flexible_table('mod-assignment-submissions');
     $tablecolumns = array('picture', 'fullname', 'submitted', 'reviews', 'moderations', 'status', 'seedoreviews', 'suggestedmark', 'finalgrade');
     $table->define_columns($tablecolumns);
     $tableheaders = array('', get_string('fullname'), get_string('submission', 'assignment_peerreview'), get_string('reviewsbystudent', 'assignment_peerreview') . helpbutton('reviewsbystudent', get_string('reviewsbystudent', 'assignment_peerreview'), 'assignment/type/peerreview/', true, false, '', true), get_string('moderationstitle', 'assignment_peerreview') . helpbutton('moderationtarget', get_string('moderationtarget', 'assignment_peerreview'), 'assignment/type/peerreview/', true, false, '', true), get_string('status') . helpbutton('status', get_string('status', 'assignment_peerreview'), 'assignment/type/peerreview/', true, false, '', true), get_string('seedoreviews', 'assignment_peerreview') . helpbutton('seedoreviews', get_string('seedoreviews', 'assignment_peerreview'), 'assignment/type/peerreview/', true, false, '', true), get_string('suggestedgrade', 'assignment_peerreview') . helpbutton('suggestedgrade', get_string('suggestedgrade', 'assignment_peerreview'), 'assignment/type/peerreview/', true, false, '', true), get_string('finalgrade', 'assignment_peerreview') . helpbutton('finalgrade', get_string('finalgrade', 'assignment_peerreview'), 'assignment/type/peerreview/', true, false, '', true));
     $table->define_headers($tableheaders);
     // $table->define_baseurl($CFG->wwwroot.'/mod/assignment/submissions.php?id='.$this->cm->id.'&amp;currentgroup='.$currentgroup);
     $table->define_baseurl($CFG->wwwroot . '/mod/assignment/submissions.php?id=' . $this->cm->id);
     // $table->sortable(true, 'submitted');
     $table->sortable(false);
     $table->collapsible(true);
     // $table->initialbars(true);
     $table->initialbars(false);
     $table->column_suppress('picture');
     $table->column_suppress('fullname');
     $table->column_class('picture', 'picture');
     $table->column_class('fullname', 'fullname');
     $table->column_class('submitted', 'submitted');
     $table->column_class('reviews', 'reviews');
     $table->column_class('moderations', 'moderations');
     $table->column_class('status', 'status');
     $table->column_class('seedoreviews', 'seedoreviews');
     $table->column_class('suggestedmark', 'suggestedmark');
     $table->column_class('finalgrade', 'finalgrade');
     $table->set_attribute('cellspacing', '0');
     $table->set_attribute('id', 'attempts');
     $table->set_attribute('class', 'submissions');
     $table->set_attribute('width', '99%');
     $table->set_attribute('align', 'center');
     $table->column_style('submitted', 'text-align', $alignment);
//.........這裏部分代碼省略.........
開發者ID:hmatulis,項目名稱:RTL-BIDI-Hebrew-Moodle-Plugins,代碼行數:101,代碼來源:assignment.class.php

示例6: list

     $boublogid = $result->boublogid;
     $bcontextid = $result->bcontextid;
     $boublogname = $result->boublogname;
     $bcoursename = $result->bcoursename;
 } else {
     list($bid, $boublogid, $bcontextid, $boublogname, $bcoursename) = oublog_import_getbloginfo($bid);
 }
 echo html_writer::start_tag('p', array('class' => 'oublog_import_step1_from'));
 echo get_string('import_step1_from', 'oublog') . '<br />' . html_writer::tag('span', $boublogname);
 echo html_writer::end_tag('p');
 // Setup table early so sort can be determined (needs setup to be called first).
 $table = new flexible_table($cm->id * $bid);
 $url = new moodle_url('/mod/oublog/import.php', $params + $stepinfo);
 $table->define_baseurl($url);
 $table->define_columns(array('title', 'timeposted', 'tags', 'include'));
 $table->column_style('include', 'text-align', 'center');
 $table->sortable(true, 'timeposted', SORT_DESC);
 $table->maxsortkeys = 1;
 $table->no_sorting('tags');
 $table->no_sorting('include');
 $table->setup();
 $sort = flexible_table::get_sort_for_table($cm->id * $bid);
 if (empty($sort)) {
     $sort = 'timeposted DESC';
 }
 if ($tags = optional_param('tags', null, PARAM_SEQUENCE)) {
     // Filter by joining tag instances.
     $stepinfo['tags'] = $tags;
 }
 $perpage = 100;
 // Must match value in oublog_import_getallposts.
開發者ID:nadavkav,項目名稱:moodle-mod_oublog,代碼行數:31,代碼來源:import.php

示例7: array

    echo $OUTPUT->footer();
    die;
}
// Start with a description.
if ($expiry > 0) {
    $expirydisplay = format_time($expiry);
    echo '<div class=\'alert\'>' . get_string('deleteexpirywarning', 'tool_recyclebin', $expirydisplay) . '</div>';
}
// Define columns and headers.
$firstcolstr = $context->contextlevel == CONTEXT_COURSE ? 'activity' : 'course';
$columns = array($firstcolstr, 'date', 'restore', 'delete');
$headers = array(get_string($firstcolstr), get_string('datedeleted', 'tool_recyclebin'), get_string('restore'), get_string('delete'));
// Define a table.
$table = new flexible_table('recyclebin');
$table->define_columns($columns);
$table->column_style('restore', 'text-align', 'center');
$table->column_style('delete', 'text-align', 'center');
$table->define_headers($headers);
$table->define_baseurl($PAGE->url);
$table->set_attribute('id', 'recycle-bin-table');
$table->setup();
// Cache a list of modules.
$modules = null;
if ($context->contextlevel == CONTEXT_COURSE) {
    $modules = $DB->get_records('modules');
}
// Add all the items to the table.
$showempty = false;
$canrestore = $recyclebin->can_restore();
foreach ($items as $item) {
    $row = array();
開發者ID:IFPBMoodle,項目名稱:moodle,代碼行數:31,代碼來源:index.php

示例8: switch

 /**
  * Helper method, displays a table
  * of users with checkboxes next to them.
  * Also includes a submit button to take
  * action on those users.
  *
  * @param string $hook The calling hook
  * @return string
  * @todo Not in love with this method, but it works
  **/
 function display_user_table($hook)
 {
     global $CFG;
     global $DB, $OUTPUT;
     require_once $CFG->libdir . '/tablelib.php';
     ob_start();
     $pagesize = optional_param('pagesize', 50, PARAM_INT);
     print "<form class=\"userform\" id=\"userformid\" action=\"{$CFG->wwwroot}/blocks/gdata/index.php\" method=\"post\">";
     $table = new flexible_table("blocks-gdata-{$hook}");
     $filter = $this->create_filter($hook, $pagesize);
     // Define columns based on hook
     switch ($hook) {
         case 'users':
             $table->define_columns(array('username', 'fullname', 'email', 'lastsync', 'status'));
             $table->define_headers(array(get_string('username'), get_string('fullname'), get_string('email'), get_string('lastsync', 'block_gdata'), get_string('status')));
             break;
         case 'addusers':
             $table->define_columns(array('username', 'fullname', 'email'));
             $table->define_headers(array(get_string('username'), get_string('fullname'), get_string('email')));
             break;
     }
     $table->define_baseurl("{$CFG->wwwroot}/blocks/gdata/index.php?hook={$hook}&amp;pagesize={$pagesize}");
     $table->pageable(true);
     $table->sortable(true, 'username', SORT_DESC);
     $table->set_attribute('width', '100%');
     $table->set_attribute('class', 'flexible generaltable generalbox');
     $table->column_style('action', 'text-align', 'center');
     $table->setup();
     list($select, $from, $where, $params) = $this->get_sql($hook, $filter);
     $total = $DB->count_records_sql("SELECT COUNT(*) {$from} {$where}", $params);
     $table->pagesize($pagesize, $total);
     if ($users = $DB->get_records_sql("{$select} {$from} {$where} ORDER BY " . $table->get_sql_sort(), array(), $table->get_page_start(), $table->get_page_size())) {
         foreach ($users as $user) {
             $username = print_checkbox("userids[]", $user->id, false, s($user->username), s($user->username), '', true);
             // Define table contents based on hook
             switch ($hook) {
                 case 'users':
                     if ($user->lastsync > 0) {
                         $lastsync = userdate($user->lastsync);
                     } else {
                         $lastsync = get_string('never');
                     }
                     $table->add_data(array($username, fullname($user), $user->email, $lastsync, get_string("status{$user->status}", 'block_gdata')));
                     break;
                 case 'addusers':
                     $table->add_data(array($username, fullname($user), $user->email));
                     break;
             }
         }
     }
     print $OUTPUT->box_start('boxaligncenter boxwidthwide', '', array());
     print $filter->display_add();
     print $filter->display_active();
     if (empty($table->totalrows)) {
         // Avoid printing the form on empty tables
         print $table->finish_output();
     } else {
         $allstr = get_string('selectall', 'block_gdata');
         $nonestr = get_string('selectnone', 'block_gdata');
         $submitstr = get_string("submitbutton{$hook}", 'block_gdata');
         $submitallstr = get_string("submitbuttonall{$hook}", 'block_gdata', $total);
         $confirmstr = get_string("confirm{$hook}", 'block_gdata', $total);
         $confirmstr = addslashes_js($confirmstr);
         $options = array(50 => 50, 100 => 100, 250 => 250, 500 => 500, 1000 => 1000);
         print '<input type="hidden" name="hook" value="' . $hook . '" />';
         print '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
         print $table->finish_output();
         print "<p><a href=\"#\" title=\"{$allstr}\" onclick=\"select_all_in('FORM', 'userform', 'userformid'); return false;\">{$allstr}</a> / ";
         print "<a href=\"#\" title=\"{$nonestr}\" onclick=\"deselect_all_in('FORM', 'userform', 'userformid'); return false;\">{$nonestr}</a></p>";
         print "<input type=\"submit\" name=\"users\" value=\"{$submitstr}\" />&nbsp;&nbsp;";
         print "<input type=\"submit\" name=\"allusers\" value=\"{$submitallstr}\" onclick=\"return confirm('{$confirmstr}');\" />";
         print '</form><br />';
         print $OUTPUT->single_select("{$CFG->wwwroot}/blocks/gdata/index.php?hook={$hook}&amp;pagesize=", 'changepagesize', $options, $pagesize);
     }
     print $OUTPUT->box_end(true);
     $tablehtml = ob_get_contents();
     ob_end_clean();
     return $tablehtml;
 }
開發者ID:stefanotirati,項目名稱:moodle-google-apps,代碼行數:89,代碼來源:block_gdata.php

示例9: count

$sql = "SELECT DISTINCT {$picturefields}, u.lastaccess\n         FROM {user} u, {role_assignments} a {$groupsfrom}\n        WHERE a.contextid = :contextid\n          AND a.userid = u.id\n          {$rolewhere}\n          {$groupwhere}";
$params['contextid'] = $context->id;
$users = array_values($DB->get_records_sql($sql, $params));
$numberofusers = count($users);
// Setup submissions table
$table = new flexible_table('mod-block-progress-overview');
$tablecolumns = array('picture', 'fullname', 'lastonline', 'progressbar', 'progress');
$table->define_columns($tablecolumns);
$tableheaders = array('', get_string('fullname'), get_string('lastonline', 'block_progress'), get_string('progressbar', 'block_progress'), get_string('progress', 'block_progress'));
$table->define_headers($tableheaders);
$table->sortable(true);
$table->set_attribute('class', 'generalbox');
$table->column_style_all('padding', '5px 10px');
$table->column_style_all('text-align', 'left');
$table->column_style_all('vertical-align', 'middle');
$table->column_style('progressbar', 'width', '200px');
$table->column_style('progress', 'text-align', 'center');
$table->no_sorting('picture');
$table->no_sorting('progressbar');
$table->define_baseurl($PAGE->url);
$table->setup();
// Build table of progress bars as they are marked
for ($i = 0; $i < $numberofusers; $i++) {
    $picture = $OUTPUT->user_picture($users[$i], array('course' => $course->id));
    $name = '<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $users[$i]->id . '&course=' . $course->id . '">' . fullname($users[$i]) . '</a>';
    if ($users[$i]->lastaccess == 0) {
        $lastonline = get_string('never');
    } else {
        $lastonline = userdate($users[$i]->lastaccess);
    }
    $attempts = get_attempts($modules, $config, $events, $users[$i]->id, $course->id);
開發者ID:vinoth4891,項目名稱:clinique,代碼行數:31,代碼來源:overview.php

示例10: array

}
//$filter->set_data();
$filter->display();
// Add activity button
if ($cpd_years && $cpdyearid) {
    $buttonurl = new moodle_url('/admin/report/cpd/edit_activity.php', array('cpdyearid' => $cpdyearid));
    echo $OUTPUT->single_button($buttonurl, get_string('addactivity', 'report_cpd'), 'get');
}
if (!empty($cpd_years[$cpdyearid])) {
    echo $OUTPUT->heading(get_string('cpdyeara', 'report_cpd', $cpd_years[$cpdyearid]), 4, 'printonly');
}
echo $OUTPUT->heading(fullname($USER), 3, 'printonly');
$table = new flexible_table('cpd');
$table->define_columns(array_keys($columns));
$table->define_headers(array_values($columns));
$table->column_style('edit', 'text-align', 'center');
$table->column_style('delete', 'text-align', 'center');
$table->column_class('edit', 'no_print_col');
$table->column_class('delete', 'no_print_col');
$table->define_baseurl($PAGE->url->out());
$table->sortable(false);
$table->collapsible(false);
$table->column_style_all('white-space', 'normal');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'attempts');
$table->set_attribute('class', 'generaltable boxalignleft cpd');
$table->setup();
foreach ($cpd_records as $cpd_record) {
    $table->add_data($cpd_record);
}
$table->finish_output();
開發者ID:rtsfc,項目名稱:moodle-report_cpd,代碼行數:31,代碼來源:index.php

示例11: array

}
/// set table columns and headers
$tablecolumns = array('timesent', 'subject', 'attachment', '');
$tableheaders = array(get_string('date', 'block_quickmail'), get_string('subject', 'forum'), get_string('attachment', 'block_quickmail'), get_string('action', 'block_quickmail'));
$table = new flexible_table('bocks-quickmail-emaillog');
/// define table columns, headers, and base url
$table->define_columns($tablecolumns);
$table->define_headers($tableheaders);
$table->define_baseurl($CFG->wwwroot . '/blocks/quickmail/emaillog.php?id=' . $course->id . '&amp;instanceid=' . $instanceid);
/// table settings
$table->sortable(true, 'timesent', SORT_DESC);
$table->collapsible(true);
$table->initialbars(false);
$table->pageable(true);
/// column styles (make sure date does not wrap) NOTE: More table styles in styles.php
$table->column_style('timesent', 'width', '40%');
$table->column_style('timesent', 'white-space', 'nowrap');
/// set attributes in the table tag
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'emaillog');
$table->set_attribute('class', 'generaltable generalbox');
$table->set_attribute('align', 'center');
$table->set_attribute('width', '80%');
$table->setup();
/// SQL
$sql = "SELECT * \n              FROM {$CFG->prefix}block_quickmail_log\n             WHERE courseid = {$course->id} \n               AND userid = {$USER->id} ";
if ($table->get_sql_where()) {
    $sql .= 'AND ' . $table->get_sql_where();
}
$sql .= ' ORDER BY ' . $table->get_sql_sort();
/// set page size
開發者ID:hmatulis,項目名稱:RTL-BIDI-Hebrew-Moodle-Plugins,代碼行數:31,代碼來源:emaillog.php

示例12: count

$settingslicenses = new moodle_url('/admin/settings.php?section=blocksettingcourse_files_license');
$PAGE->navbar->add(get_string('blocks'));
$PAGE->navbar->add(get_string('pluginname', 'block_course_files_license'), $settingslicenses);
$PAGE->navbar->add(get_string('managelicenses', 'block_course_files_license'), $managelicenses);
echo $OUTPUT->header();
echo $OUTPUT->heading($strtitle, 2);
$table = new flexible_table('license-display');
$table->define_columns(array('name', 'description', 'actions'));
$table->define_headers(array(get_string('license_name', 'block_course_files_license'), get_string('license_description', 'block_course_files_license'), get_string('actions', 'moodle')));
$table->define_baseurl($baseurl);
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'licenses-table');
$table->set_attribute('class', 'generaltable generalbox');
$table->column_class('license', 'license');
$table->column_class('actions', 'actions');
$table->column_style('actions', 'text-align', 'right');
$table->setup();
$i = 0;
$len = count($licenses);
$upicon = new pix_icon('t/up', get_string('up'));
$downicon = new pix_icon('t/down', get_string('down'));
foreach ($licenses as $license) {
    $l_name = '<div class="license-name">' . $license->name . '</div>';
    $l_description = '<div class="license-description">' . $license->description . '</div>';
    $editurl = new moodle_url('/blocks/course_files_license/editlicense.php?id=' . $license->id . $extraparams);
    $editaction = $OUTPUT->action_icon($editurl, new pix_icon('t/edit', get_string('edit')));
    $deleteurl = new moodle_url('/blocks/course_files_license/managelicenses.php?deleteid=' . $license->id . '&sesskey=' . sesskey() . $extraparams);
    $deleteicon = new pix_icon('t/delete', get_string('delete'));
    $deleteaction = $OUTPUT->action_icon($deleteurl, $deleteicon, new confirm_action(get_string('deletelicenseconfirm', 'block_course_files_license')));
    $moveaction = '';
    if ($i == 0 && $len > 1) {
開發者ID:adrianrv,項目名稱:moodle-block_course_files_license,代碼行數:31,代碼來源:managelicenses.php


注:本文中的flexible_table::column_style方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。