Commit deef457b authored by jonnybradley's avatar jonnybradley

[bp/r66183][ENH] search: Add format=slug to the list display plugin to render...

[bp/r66183][ENH] search: Add format=slug to the list display plugin to render values out using the current wiki url scheme (known as the page slug)
parent b87b7551
......@@ -2588,6 +2588,7 @@ lib/core/Search/Formatter/ValueFormatter/Number.php -text
lib/core/Search/Formatter/ValueFormatter/Objectlink.php -text
lib/core/Search/Formatter/ValueFormatter/Plain.php -text
lib/core/Search/Formatter/ValueFormatter/Reference.php -text
lib/core/Search/Formatter/ValueFormatter/Slug.php -text
lib/core/Search/Formatter/ValueFormatter/Snippet.php -text
lib/core/Search/Formatter/ValueFormatter/Sorthandle.php -text
lib/core/Search/Formatter/ValueFormatter/Timeago.php -text
......
<?php
// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
class Search_Formatter_ValueFormatter_Slug extends Search_Formatter_ValueFormatter_Abstract
{
private $manager = null;
function __construct($arguments)
{
$this->manager = TikiLib::lib('slugmanager');
}
function render($name, $value, array $entry)
{
global $prefs;
$slug = $this->manager->generate($prefs['wiki_url_scheme'], $value, $prefs['url_only_ascii'] === 'y');
return $slug;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment