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
b2d2e970
Commit
b2d2e970
authored
Feb 02, 2015
by
pupi1985
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More minor refactorings
parent
7631275a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
qa-theme.php
qa-theme/SnowFlat/qa-theme.php
+17
-11
No files found.
qa-theme/SnowFlat/qa-theme.php
View file @
b2d2e970
...
@@ -331,9 +331,10 @@ class qa_html_theme extends qa_html_theme_base
...
@@ -331,9 +331,10 @@ class qa_html_theme extends qa_html_theme_base
*/
*/
public
function
q_item_title
(
$q_item
)
public
function
q_item_title
(
$q_item
)
{
{
$closedText
=
qa_lang
(
'main/closed'
);
$imgHtml
=
empty
(
$q_item
[
'closed'
])
$imgHtml
=
empty
(
$q_item
[
'closed'
])
?
''
?
''
:
'<img src="'
.
$this
->
rooturl
.
$this
->
icon_url
.
'/closed-q-list.png" class="qam-q-list-close-icon" alt="
question-closed" title="'
.
qa_lang
(
'main/closed'
)
.
'" />'
:
'<img src="'
.
$this
->
rooturl
.
$this
->
icon_url
.
'/closed-q-list.png" class="qam-q-list-close-icon" alt="
'
.
$closedText
.
'" title="'
.
$closedText
.
'" />'
;
;
$this
->
output
(
$this
->
output
(
'<div class="qa-q-item-title">'
,
'<div class="qa-q-item-title">'
,
...
@@ -364,9 +365,10 @@ class qa_html_theme extends qa_html_theme_base
...
@@ -364,9 +365,10 @@ class qa_html_theme extends qa_html_theme_base
$url
=
isset
(
$q_view
[
'url'
])
?
$q_view
[
'url'
]
:
false
;
$url
=
isset
(
$q_view
[
'url'
])
?
$q_view
[
'url'
]
:
false
;
// add closed image
// add closed image
$closedText
=
qa_lang
(
'main/closed'
);
$imgHtml
=
empty
(
$q_view
[
'closed'
])
$imgHtml
=
empty
(
$q_view
[
'closed'
])
?
''
?
''
:
'<img src="'
.
$this
->
rooturl
.
$this
->
icon_url
.
'/closed-q-view.png" class="qam-q-view-close-icon" alt="
question-closed" width="24" height="24" title="'
.
qa_lang
(
'main/closed'
)
.
'" />'
:
'<img src="'
.
$this
->
rooturl
.
$this
->
icon_url
.
'/closed-q-view.png" class="qam-q-view-close-icon" alt="
'
.
$closedText
.
'" width="24" height="24" title="'
.
$closedText
.
'" />'
;
;
if
(
isset
(
$this
->
content
[
'title'
]))
{
if
(
isset
(
$this
->
content
[
'title'
]))
{
$this
->
output
(
$this
->
output
(
...
@@ -472,16 +474,21 @@ class qa_html_theme extends qa_html_theme_base
...
@@ -472,16 +474,21 @@ class qa_html_theme extends qa_html_theme_base
$this
->
output
(
'<form '
.
$a_item
[
'main_form_tags'
]
.
'>'
);
// form for buttons on answer
$this
->
output
(
'<form '
.
$a_item
[
'main_form_tags'
]
.
'>'
);
// form for buttons on answer
if
(
$a_item
[
'hidden'
])
if
(
$a_item
[
'hidden'
])
$
this
->
output
(
'<div class="qa-a-item-hidden">'
)
;
$
answerState
=
'hidden'
;
elseif
(
$a_item
[
'selected'
])
elseif
(
$a_item
[
'selected'
])
$this
->
output
(
'<div class="qa-a-item-selected">'
);
$answerState
=
'selected'
;
else
$answerState
=
null
;
if
(
isset
(
$answerState
))
$this
->
output
(
'<div class="qa-a-item-'
.
$answerState
.
'">'
);
$this
->
a_selection
(
$a_item
);
$this
->
a_selection
(
$a_item
);
if
(
isset
(
$a_item
[
'error'
]))
if
(
isset
(
$a_item
[
'error'
]))
$this
->
error
(
$a_item
[
'error'
]);
$this
->
error
(
$a_item
[
'error'
]);
$this
->
a_item_content
(
$a_item
);
$this
->
a_item_content
(
$a_item
);
if
(
$a_item
[
'hidden'
]
||
$a_item
[
'selected'
]
)
if
(
isset
(
$answerState
)
)
$this
->
output
(
'</div>'
);
$this
->
output
(
'</div>'
);
$this
->
a_item_buttons
(
$a_item
);
$this
->
a_item_buttons
(
$a_item
);
...
@@ -551,15 +558,14 @@ class qa_html_theme extends qa_html_theme_base
...
@@ -551,15 +558,14 @@ class qa_html_theme extends qa_html_theme_base
*/
*/
private
function
qam_user_account
()
private
function
qam_user_account
()
{
{
$avatarsize
=
32
;
// get logged-in user avatar
// get logged-in user avatar
if
(
qa_is_logged_in
())
{
if
(
qa_is_logged_in
())
{
$handle
=
qa_get_logged_in_user_field
(
'handle'
);
$handle
=
qa_get_logged_in_user_field
(
'handle'
);
$toggleClass
=
'qam-logged-in'
;
$toggleClass
=
'qam-logged-in'
;
$avatarsize
=
32
;
if
(
QA_FINAL_EXTERNAL_USERS
)
if
(
QA_FINAL_EXTERNAL_USERS
)
$tobar_avatar
=
qa_get_external_avatar_html
(
qa_get_logged_in_user_field
(
'userid'
),
$avatarsize
,
true
);
$tobar_avatar
=
qa_get_external_avatar_html
(
qa_get_logged_in_user_field
(
'userid'
),
$avatarsize
,
true
);
else
{
else
{
$tobar_avatar
=
qa_get_user_avatar_html
(
$tobar_avatar
=
qa_get_user_avatar_html
(
qa_get_logged_in_user_field
(
'flags'
),
qa_get_logged_in_user_field
(
'flags'
),
...
@@ -595,11 +601,11 @@ class qa_html_theme extends qa_html_theme_base
...
@@ -595,11 +601,11 @@ class qa_html_theme extends qa_html_theme_base
* @since Snow 1.4
* @since Snow 1.4
* @version 1.0
* @version 1.0
*/
*/
private
function
qam_search
(
$addon_class
=
false
,
$ids
=
false
)
private
function
qam_search
(
$addon_class
=
null
,
$ids
=
null
)
{
{
$id
=
$ids
?
' id="'
.
$ids
.
'"'
:
''
;
$id
=
isset
(
$ids
)
?
' id="'
.
$ids
.
'"'
:
''
;
$this
->
output
(
'<div class="qam-search '
.
$this
->
ask_search_box_class
.
' '
.
$addon_class
.
'"
'
.
$id
.
'
>'
);
$this
->
output
(
'<div class="qam-search '
.
$this
->
ask_search_box_class
.
' '
.
$addon_class
.
'"
'
.
$id
.
'
>'
);
$this
->
search
();
$this
->
search
();
$this
->
output
(
'</div>'
);
$this
->
output
(
'</div>'
);
}
}
...
...
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