mirror of
https://github.com/itflow-org/itflow
synced 2026-12-02 09:09:01 +00:00
Documents and articles outside the agent app read like the document page: the portal document and Help article pages, shared links and the public help center lay out what they say as on the agent document page, with a long one's Contents beside it in view as you scroll and marking the section being read, or above it on a phone; pictures open full size when clicked; a section picked from Contents stays marked, on the agent page too; 26.12.3 changelog entries
This commit is contained in:
@@ -892,3 +892,23 @@ function documentHtmlPurify($html) {
|
||||
}
|
||||
return $purifier->purify((string) $html);
|
||||
}
|
||||
|
||||
/**
|
||||
* A document or Knowledge Base article to read outside the agent app - the client portal, a shared
|
||||
* link, the public help center: what it says ($html, purified already) laid out as on the agent's
|
||||
* document page (.itflow-prose), and beside it the Contents of a long one (js/document_contents.js),
|
||||
* which sits above it on a phone. $panel is the class of the box it is in; $attributes go on what
|
||||
* it says (a shared link fills it in later). With $keep_address the Contents leaves the address as
|
||||
* it is - a shared link's secret is after its #.
|
||||
*/
|
||||
function documentReadHtml($html, $panel = 'itflow-portal-panel itflow-portal-panel-body', $attributes = '', $keep_address = false) {
|
||||
return '<div class="itflow-document-read mb-4">'
|
||||
. '<aside class="itflow-portal-panel itflow-document-contents itflow-document-read-contents d-print-none" data-document-contents' . ($keep_address ? ' data-document-contents-keep-address' : '') . ' hidden>'
|
||||
. '<div class="itflow-portal-panel-head"><h2><i class="fas fa-list-ul"></i>Contents</h2></div>'
|
||||
. '<nav class="itflow-document-read-nav" aria-label="Contents"></nav>'
|
||||
. '</aside>'
|
||||
. '<article class="itflow-document-read-body ' . $panel . '">'
|
||||
. '<div class="prettyContent itflow-prose itflow-portal-document" data-document-body' . ($attributes !== '' ? ' ' . $attributes : '') . '>' . $html . '</div>'
|
||||
. '</article>'
|
||||
. '</div>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user