2015-01-15, 22:37:55
Looking at the source code on Github, it doesn't seem that I18N Search functionality has been implemented for iManager.
The modification to do so in the source isn't too difficult to do, but Bigin would need to decide if it is something that he wants to implement.
It would involve implementing actions and filters in the imanager.php file:
More detail should be available in mvlcek's I18N Search topic on plugin integration (but this would be a job for the plugin developer, not the user).
In the mean time, a very temporary internal-search solution for the user could be to do (simple) search filtering in the foreach loop for the list display:
The modification to do so in the source isn't too difficult to do, but Bigin would need to decide if it is something that he wants to implement.
It would involve implementing actions and filters in the imanager.php file:
PHP Code:
add_action('search-index', 'imanager_search_index');
add_filter('search-item', 'imanager_search_item');
add_filter('search-display', 'imanager_search_display');
// ...
function imanager_search_index(/* parameters */) {
// ...
}
function imanager_search_item(/* parameters */) {
// ...
}
function imanager_search_display(/* parameters */) {
// ...
}
More detail should be available in mvlcek's I18N Search topic on plugin integration (but this would be a job for the plugin developer, not the user).
In the mean time, a very temporary internal-search solution for the user could be to do (simple) search filtering in the foreach loop for the list display:
PHP Code:
// function for checking if an item matches the search criteria
function imanager_search_filter($item, $words) {
$contents = implode('::', $item); // searching all fields of item in one string
$wordslower = strtolower($words); // case insensitive search
return strpos($contents, $wordslower) !== false; // true if the words appear in the correct order, false otherwise
}
// assuming that you're using a GET query with the parameter 'words'
$loop = '';
foreach($pagedata['itemkeys'] as $key)
{
if (isset($_GET['words']) && imanager_search_filter($items[$key], $_GET['words'])) {
// Renders the 'loop' template to string concatenation by replacing placeholders
$loop .= $manager->paint('loop', array('loop-thumb-1' => $items[$key]['loop-thumb-1'],
'page' => $pagedata['viewpage'], 'slug' => $items[$key]['slug']));
}
}