Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
093a3307
Commit
093a3307
authored
Apr 22, 2009
by
Nigel McNie
Browse files
Add helper method to convert strings to a format that can be used in a URL.
parent
0f0663a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/export/html/lib.php
View file @
093a3307
...
...
@@ -139,6 +139,17 @@ class PluginExportHtml extends PluginExport {
return
$smarty
;
}
/**
* Converts the passed text, which is assumed to be a reasonably short
* string, into a a form that could be used in a URL.
*
* @param string $text The text to convert
* @return string The converted text
*/
public
static
function
text_to_path
(
$text
)
{
return
preg_replace
(
'#[^a-zA-Z0-9_-]+#'
,
'-'
,
$text
);
}
private
function
build_index_page
(
$summaries
)
{
$smarty
=
$this
->
get_smarty
();
$smarty
->
assign
(
'summaries'
,
$summaries
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment