MDL-25612 sql - make rss_client block cross-db

This commit is contained in:
Eloy Lafuente (stronk7) 2011-02-12 20:38:03 +01:00
parent d911c72bf9
commit 3612c3be4a

View File

@ -49,11 +49,12 @@ class block_rss_client_edit_form extends block_edit_form {
}
$rssfeeds = $DB->get_records_sql_menu('
SELECT id, CASE WHEN preferredtitle = ? THEN title ELSE preferredtitle END AS acutaltitle
SELECT id,
CASE WHEN preferredtitle = ? THEN ' . $DB->sql_compare_text('title', 64) .' ELSE preferredtitle END
FROM {block_rss_client}
WHERE userid = ? OR shared = 1
ORDER BY acutaltitle',
array($DB->sql_empty(), $USER->id));
ORDER BY CASE WHEN preferredtitle = ? THEN ' . $DB->sql_compare_text('title', 64) . ' ELSE preferredtitle END ',
array($DB->sql_empty(), $USER->id, $DB->sql_empty()));
if ($rssfeeds) {
$select = $mform->addElement('select', 'config_rssid', get_string('choosefeedlabel', 'block_rss_client'), $rssfeeds);
$select->setMultiple(true);