Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
37f557e3
Commit
37f557e3
authored
Feb 09, 2016
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DocBlock (app/format.php)
parent
6ffcdf48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
26 deletions
+54
-26
format.php
qa-include/app/format.php
+54
-26
No files found.
qa-include/app/format.php
View file @
37f557e3
...
@@ -1769,10 +1769,11 @@
...
@@ -1769,10 +1769,11 @@
}
}
/**
* Return the theme that should be used for displaying the page
* @return string
*/
function
qa_get_site_theme
()
function
qa_get_site_theme
()
/*
Return the theme that should be used for displaying the page
*/
{
{
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
...
@@ -1780,11 +1781,12 @@
...
@@ -1780,11 +1781,12 @@
}
}
/**
* Return the initialized class for $theme (or the default if it's gone), passing $template, $content and $request.
* Also applies any registered plugin layers.
* @return qa_html_theme_base
*/
function
qa_load_theme_class
(
$theme
,
$template
,
$content
,
$request
)
function
qa_load_theme_class
(
$theme
,
$template
,
$content
,
$request
)
/*
Return the initialized class for $theme (or the default if it's gone), passing $template, $content and $request.
Also applies any registered plugin layers.
*/
{
{
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
...
@@ -1869,11 +1871,15 @@
...
@@ -1869,11 +1871,15 @@
}
}
/**
* Return an instantiation of the appropriate editor module class, given $content in $format
* Pass the preferred module name in $editorname, on return it will contain the name of the module used.
* @param $content string
* @param $format string
* @param $editorname string
* @return object
*/
function
qa_load_editor
(
$content
,
$format
,
&
$editorname
)
function
qa_load_editor
(
$content
,
$format
,
&
$editorname
)
/*
Return an instantiation of the appropriate editor module class, given $content in $format
Pass the preferred module name in $editorname, on return it will contain the name of the module used.
*/
{
{
$maxeditor
=
qa_load_module
(
'editor'
,
$editorname
);
// take preferred one first
$maxeditor
=
qa_load_module
(
'editor'
,
$editorname
);
// take preferred one first
...
@@ -1900,13 +1906,22 @@
...
@@ -1900,13 +1906,22 @@
}
}
/**
* Return a form field from the $editor module while making necessary modifications to $qa_content. The parameters
* $content, $format, $fieldname, $rows and $focusnow are passed through to the module's get_field() method. ($focusnow
* is deprecated as a parameter to get_field() but it's still passed through for old editor modules.) Based on
* $focusnow and $loadnow, also add the editor's load and/or focus scripts to $qa_content's onload handlers.
* @param $editor object
* @param array $qa_content
* @param string $content
* @param string $format
* @param string $fieldname
* @param int $rows
* @param bool $focusnow
* @param bool $loadnow
* @return string|array
*/
function
qa_editor_load_field
(
$editor
,
&
$qa_content
,
$content
,
$format
,
$fieldname
,
$rows
,
$focusnow
=
false
,
$loadnow
=
true
)
function
qa_editor_load_field
(
$editor
,
&
$qa_content
,
$content
,
$format
,
$fieldname
,
$rows
,
$focusnow
=
false
,
$loadnow
=
true
)
/*
Return a form field from the $editor module while making necessary modifications to $qa_content. The parameters
$content, $format, $fieldname, $rows and $focusnow are passed through to the module's get_field() method. ($focusnow
is deprecated as a parameter to get_field() but it's still passed through for old editor modules.) Based on
$focusnow and $loadnow, also add the editor's load and/or focus scripts to $qa_content's onload handlers.
*/
{
{
if
(
!
isset
(
$editor
))
if
(
!
isset
(
$editor
))
qa_fatal_error
(
'No editor found for format: '
.
$format
);
qa_fatal_error
(
'No editor found for format: '
.
$format
);
...
@@ -1928,10 +1943,13 @@
...
@@ -1928,10 +1943,13 @@
}
}
/**
* Return an instantiation of the appropriate viewer module class, given $content in $format
* @param string $content
* @param string $format
* @return object
*/
function
qa_load_viewer
(
$content
,
$format
)
function
qa_load_viewer
(
$content
,
$format
)
/*
Return an instantiation of the appropriate viewer module class, given $content in $format
*/
{
{
$maxviewer
=
null
;
$maxviewer
=
null
;
$maxquality
=
0
;
$maxquality
=
0
;
...
@@ -1951,20 +1969,28 @@
...
@@ -1951,20 +1969,28 @@
}
}
/**
* Return the plain text rendering of $content in $format, passing $options to the appropriate module
* @param string $content
* @param string $format
* @param array $options
* @return string
*/
function
qa_viewer_text
(
$content
,
$format
,
$options
=
array
())
function
qa_viewer_text
(
$content
,
$format
,
$options
=
array
())
/*
Return the plain text rendering of $content in $format, passing $options to the appropriate module
*/
{
{
$viewer
=
qa_load_viewer
(
$content
,
$format
);
$viewer
=
qa_load_viewer
(
$content
,
$format
);
return
$viewer
->
get_text
(
$content
,
$format
,
$options
);
return
$viewer
->
get_text
(
$content
,
$format
,
$options
);
}
}
/**
* Return the HTML rendering of $content in $format, passing $options to the appropriate module
* @param string $content
* @param string $format
* @param array $options
* @return string
*/
function
qa_viewer_html
(
$content
,
$format
,
$options
=
array
())
function
qa_viewer_html
(
$content
,
$format
,
$options
=
array
())
/*
Return the HTML rendering of $content in $format, passing $options to the appropriate module
*/
{
{
$viewer
=
qa_load_viewer
(
$content
,
$format
);
$viewer
=
qa_load_viewer
(
$content
,
$format
);
return
$viewer
->
get_html
(
$content
,
$format
,
$options
);
return
$viewer
->
get_html
(
$content
,
$format
,
$options
);
...
@@ -1972,6 +1998,8 @@
...
@@ -1972,6 +1998,8 @@
/**
/**
* Retrieve title from HTTP POST, appropriately sanitised.
* Retrieve title from HTTP POST, appropriately sanitised.
* @param string $fieldname
* @return string
*/
*/
function
qa_get_post_title
(
$fieldname
)
function
qa_get_post_title
(
$fieldname
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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