× Feature Requests

Please do NOT use this section of the forum to request help if Joomdle does not work for you in some particular way. Your post will be deleted.

Moodle Strings Untranslated in Joomdle Search Results

2 months 1 week ago
ncy
Posts: 15
More
Topic Author
Moodle Strings Untranslated in Joomdle Search Results #1
Although format_text() is applied to search results, the Moodle data returned is always in the default language. This is seemingly solved by passing in the language tag (i.e. JFactory::getLanguage()->getTag()) to JoomdleHelperContent::call_method("search_XXXXX", ...) and setting in /auth/joomdle/auth.php for each of these functions:
public function search_XXXXX (...) {
    global $SESSION;
    $langtag = substr($langtag, 0, 2); // Moodle language tags are 2-letters only
    $SESSION->lang = $langtag;
    ...

Where XXXXX is courses/categories/topics. BUT, this breaks the link, giving an "Invalid controller" error. Rather than mess with the router, I just rewrite the link myself:

/plugins/search/courses/courses.php
$rows_result[$i]->href = $params->get('MOODLE_URL') . '/course/view.php?id='.$row['remoteid'];

/plugins/search/coursecategories/coursecategories.php:
$rows_result[$i]->href = $params->get('MOODLE_URL') . '/course/index.php?categoryid='.$row['cat_id'];

/plugins/search/coursetopics/coursetopics.php:
$rows_result[$i]->href = $params->get('MOODLE_URL') . '/course/view.php?id='.$row['course'].'#section-'.$row['section'];
$rows_result[$i]->title= $row['sec_name'];

Of course, if you are using Moodle embedded within Joomla, this probably doesn't work the way you want. It would be nice to have a configuration option to choose whether to directly link to the Moodle pages. Unfortunately the modifications above are indeed directly to Joomdle code.
2 months 1 week ago
Antonio Durán
Posts: 6945
More
Moodle Strings Untranslated in Joomdle Search Results #2
Thanks for your contributions, I will study them and get back to you.

> Of course, if you are using Moodle embedded within Joomla, this probably doesn't work the way you want. It would be nice to have a configuration option to choose whether to directly link to the Moodle pages.

Do you mean having an option in search plugins, to link to Moodle instead of Joomdle pages in Joomla, like it's done now, right?
For example, in courses plugin, depending on the option, it would link to:
$rows_result[$i]->href = 'index.php?option=com_joomdle&view=detail&cat_id='.$cat_slug.'&course_id='.$course_slug;
or:
$rows_result[$i]->href = $params->get('MOODLE_URL') . '/course/view.php?id='.$row['remoteid'];
2 months 1 week ago
ncy
Posts: 15
More
Topic Author
Moodle Strings Untranslated in Joomdle Search Results #3

Do you mean having an option in search plugins, to link to Moodle instead of Joomdle pages in Joomla, like it's done now, right?


Yes, exactly :). Thanks for the speedy replies.
Cron Job Starts