does not work( form element shows, but does not work( here's the code:
if (!$entries = $DB->get_records('public_entries', array(), 'concept ASC')) {
print_error('moduledoesnotexist', 'error');
}
$baseurl = new moodle_url('../public/view.php', array ('id'=>$id));
$tablecolumns = array('concept', 'authors', 'phouse', 'year', 'stranic', 'typep', 'definition','');
$tableheaders = array($strconcept, $strauthors, $strphouse, $stryear, $strstranic, $strtypep, $strdefinition, '');
$table = new flexible_table('public-showentry-list');
$table->define_columns($tablecolumns);
$table->define_headers($tableheaders);
$table->define_baseurl($baseurl);
$table->set_attribute('class', 'admintable generaltable');
$table->sortable(true, 'lastname', SORT_DESC);
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'public_entries');
$table->set_attribute('class', 'generaltable generaltable');
$table->set_control_variables(array(
TABLE_VAR_SORT => 'ssort',
TABLE_VAR_IFIRST => 'sifirst',
TABLE_VAR_ILAST => 'silast',
TABLE_VAR_PAGE => 'spage'
));
$table->no_sorting('definition');
$table->no_sorting('');
//add
$table->is_downloadable(true);
$table->show_download_buttons_at(array(TABLE_P_BOTTOM));
$download = optional_param('download', '', PARAM_ALPHA);
$table->is_downloading($download);
//
$table->setup();
if ($table->get_sql_sort()) {
$sort = 'ORDER BY '. $table->get_sql_sort();
} else {
$sort = '';
}
list($where, $params) = $table->get_sql_where();
if ($where) {
$where = 'WHERE '. $where;
}
$allusernames = get_all_user_name_fields(true, 'u');
$query = "
SELECT pu.concept, pu.authors, pu.phouse, pu.year, pu.stranic, pu.typep, pu.definition,
u.id AS owner, $allusernames
FROM {public_entries} pu
LEFT JOIN {user} u ON u.id = pu.userid
$where
GROUP BY pu.concept, pu.authors, pu.phouse, pu.year, pu.stranic, pu.typep
$sort";
$table->initialbars(true);
require_once("lib.php");
if ($entries = $DB->get_records_sql($query, $params, $table->get_page_start(), $table->get_page_size())) {
foreach ($entries as $entry) {
$vstrentri = $entry->concept;
$params = array('id' => $entry->owner);
$ownerlink = new moodle_url($CFG->wwwroot . '/user/view.php', $params);
$owner = html_writer::link($ownerlink, fullname($entry));
$vphouse = $entry->phouse;
$vyear = $entry->year;
$vstranic = $entry->stranic;
$vtypep = $entry->typep;
$vdefinition = $entry->definition;
$editentries = $ikonki;
$data = array(
$vstrentri,
$owner,
$vphouse,
$vyear,
$vstranic,
$vtypep,
$vdefinition,
);
$table->add_data($data);
}
}
$table->print_html();