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
019572b1
Commit
019572b1
authored
Apr 22, 2014
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PMs to user submenu
parent
ba6464b5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
24 deletions
+49
-24
qa-app-format.php
qa-include/qa-app-format.php
+32
-0
qa-lang-misc.php
qa-include/qa-lang-misc.php
+1
-0
qa-page-message.php
qa-include/qa-page-message.php
+2
-0
qa-page-messages.php
qa-include/qa-page-messages.php
+14
-24
No files found.
qa-include/qa-app-format.php
View file @
019572b1
...
...
@@ -1304,6 +1304,11 @@
'url'
=>
qa_path_html
(
'user/'
.
$handle
.
'/wall'
),
),
'messages'
=>
array
(
'label'
=>
qa_lang_html
(
'misc/nav_user_pms'
),
'url'
=>
qa_path_html
(
'messages'
),
),
'activity'
=>
array
(
'label'
=>
qa_lang_html
(
'misc/nav_user_activity'
),
'url'
=>
qa_path_html
(
'user/'
.
$handle
.
'/activity'
),
...
...
@@ -1332,6 +1337,33 @@
if
(
!
$ismyuser
)
unset
(
$navigation
[
'favorites'
]);
if
(
!
$ismyuser
||
!
qa_opt
(
'allow_private_messages'
)
||
!
qa_opt
(
'show_message_history'
))
unset
(
$navigation
[
'messages'
]);
return
$navigation
;
}
function
qa_messages_sub_navigation
(
$selected
=
null
)
/*
Return the sub navigation structure for private message pages
*/
{
$navigation
=
array
(
'inbox'
=>
array
(
'label'
=>
qa_lang_html
(
'misc/inbox'
),
'url'
=>
qa_path_html
(
'messages'
),
),
'outbox'
=>
array
(
'label'
=>
qa_lang_html
(
'misc/outbox'
),
'url'
=>
qa_path_html
(
'messages/sent'
),
)
);
if
(
isset
(
$navigation
[
$selected
]))
$navigation
[
$selected
][
'selected'
]
=
true
;
return
$navigation
;
}
...
...
qa-include/qa-lang-misc.php
View file @
019572b1
...
...
@@ -74,6 +74,7 @@
'nav_my_favorites'
=>
'My favorites'
,
'nav_user_activity'
=>
'Recent activity'
,
'nav_user_as'
=>
'All answers'
,
'nav_user_pms'
=>
'Private messages'
,
'nav_user_qs'
=>
'All questions'
,
'nav_user_wall'
=>
'Wall'
,
'no_activity_from_x'
=>
'No activity from ^'
,
...
...
qa-include/qa-page-message.php
View file @
019572b1
...
...
@@ -223,6 +223,8 @@
foreach
(
$showmessages
as
$message
)
$qa_content
[
'message_list'
][
'messages'
][]
=
qa_message_html_fields
(
$message
,
$options
);
}
$qa_content
[
'navigation'
][
'sub'
]
=
qa_messages_sub_navigation
();
}
...
...
qa-include/qa-page-messages.php
View file @
019572b1
...
...
@@ -39,7 +39,13 @@
// Check which box we're showing (inbox/sent), we're not using Q2A's single-sign on integration and that we're logged in
$showingInbox
=
qa_request_part
(
1
)
!==
'sent'
;
$req
=
qa_request_part
(
1
);
if
(
$req
===
null
)
$showBox
=
'inbox'
;
else
if
(
$req
===
'sent'
)
$showBox
=
'outbox'
;
else
return
include
QA_INCLUDE_DIR
.
'qa-page-not-found.php'
;
if
(
QA_FINAL_EXTERNAL_USERS
)
qa_fatal_error
(
'User accounts are handled by external code'
);
...
...
@@ -50,23 +56,21 @@
return
$qa_content
;
}
if
(
!
qa_opt
(
'allow_private_messages'
)
)
if
(
!
qa_opt
(
'allow_private_messages'
)
||
!
qa_opt
(
'show_message_history'
)
)
return
include
QA_INCLUDE_DIR
.
'qa-page-not-found.php'
;
// Find the user profile and questions and answers for this handle
$pmSpec
=
$showingInbox
?
qa_db_messages_inbox_selectspec
(
'private'
,
$loginUserId
,
true
)
:
qa_db_messages_outbox_selectspec
(
'private'
,
$loginUserId
,
true
);
$func
=
'qa_db_messages_'
.
$showBox
.
'_selectspec'
;
$pmSpec
=
$func
(
'private'
,
$loginUserId
,
true
);
$userMessages
=
qa_db_select_with_pending
(
$pmSpec
);
// Prepare content for theme
$qa_content
=
qa_content_prepare
();
$qa_content
[
'title'
]
=
$showingInbox
?
qa_lang_html
(
'misc/pm_inbox_title'
)
:
qa_lang_html
(
'misc/pm_outbox
_title'
);
$qa_content
[
'title'
]
=
qa_lang_html
(
'misc/pm_'
.
$showBox
.
'
_title'
);
$qa_content
[
'message_list'
]
=
array
(
'tags'
=>
'id="privatemessages"'
,
...
...
@@ -74,26 +78,12 @@
);
$htmlDefaults
=
qa_message_html_defaults
();
if
(
!
$showingInbox
)
{
if
(
$showBox
===
'outbox'
)
$htmlDefaults
[
'towhomview'
]
=
true
;
}
foreach
(
$userMessages
as
$message
)
{
foreach
(
$userMessages
as
$message
)
$qa_content
[
'message_list'
][
'messages'
][]
=
qa_message_html_fields
(
$message
,
$htmlDefaults
);
}
$qa_content
[
'navigation'
][
'sub'
]
=
array
(
'inbox'
=>
array
(
'label'
=>
qa_lang_html
(
'misc/inbox'
),
'url'
=>
qa_path_html
(
'messages'
),
'selected'
=>
$showingInbox
,
),
'outbox'
=>
array
(
'label'
=>
qa_lang_html
(
'misc/outbox'
),
'url'
=>
qa_path_html
(
'messages/sent'
),
'selected'
=>
!
$showingInbox
,
)
);
$qa_content
[
'navigation'
][
'sub'
]
=
qa_messages_sub_navigation
(
$showBox
);
return
$qa_content
;
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