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
b6a72e35
Commit
b6a72e35
authored
Jul 09, 2016
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor widget check code (qa_content_prepare)
parent
8698c12a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
qa-page.php
qa-include/qa-page.php
+15
-9
No files found.
qa-include/qa-page.php
View file @
b6a72e35
...
...
@@ -647,23 +647,29 @@
'B'
=>
'bottom'
,
);
foreach
(
$widgets
as
$widget
)
if
(
is_numeric
(
strpos
(
','
.
$widget
[
'tags'
]
.
','
,
','
.
$qa_template
.
','
))
||
is_numeric
(
strpos
(
','
.
$widget
[
'tags'
]
.
','
,
',all,'
)))
{
// see if it has been selected for display on this template
$region
=@
$regioncodes
[
substr
(
$widget
[
'place'
],
0
,
1
)];
$place
=@
$placecodes
[
substr
(
$widget
[
'place'
],
1
,
2
)];
foreach
(
$widgets
as
$widget
)
{
$tagstring
=
','
.
$widget
[
'tags'
]
.
','
;
if
(
strpos
(
$tagstring
,
",
$qa_template
,"
)
!==
false
||
strpos
(
$tagstring
,
',all,'
)
!==
false
)
{
// widget has been selected for display on this template
$region
=
@
$regioncodes
[
substr
(
$widget
[
'place'
],
0
,
1
)];
$place
=
@
$placecodes
[
substr
(
$widget
[
'place'
],
1
,
2
)];
if
(
isset
(
$region
)
&&
isset
(
$place
))
{
// check region/place codes recognized
$module
=
qa_load_module
(
'widget'
,
$widget
[
'title'
]);
if
(
isset
(
$region
)
&&
isset
(
$place
))
{
// region/place codes recognized
$module
=
qa_load_module
(
'widget'
,
$widget
[
'title'
]);
if
(
isset
(
$module
)
&&
method_exists
(
$module
,
'allow_template'
)
&&
$module
->
allow_template
((
substr
(
$qa_template
,
0
,
7
)
==
'custom-'
)
?
'custom'
:
$qa_template
)
&&
$module
->
allow_template
((
substr
(
$qa_template
,
0
,
7
)
==
'custom-'
)
?
'custom'
:
$qa_template
)
&&
method_exists
(
$module
,
'allow_region'
)
&&
$module
->
allow_region
(
$region
)
&&
method_exists
(
$module
,
'output_widget'
)
)
$qa_content
[
'widgets'
][
$region
][
$place
][]
=
$module
;
// if module loaded and happy to be displayed here, tell theme about it
)
{
// if module loaded and happy to be displayed here, tell theme about it
$qa_content
[
'widgets'
][
$region
][
$place
][]
=
$module
;
}
}
}
}
...
...
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