Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Q
q2a-email-notification
Project
Project
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
contest
pdp-intro
q2a-email-notification
Commits
494cdd09
Commit
494cdd09
authored
Jul 03, 2014
by
Amiya Sahu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added function prefixes
parent
67843de9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
functions.php
functions.php
+9
-9
qa-email-notifications-event.php
qa-email-notifications-event.php
+2
-2
No files found.
functions.php
View file @
494cdd09
...
@@ -5,7 +5,7 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
...
@@ -5,7 +5,7 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
exit
;
exit
;
}
}
function
reset_all_notification_options
()
{
function
ami_
reset_all_notification_options
()
{
qa_opt
(
'ami_email_notf_allow_cat_follower'
,
false
);
qa_opt
(
'ami_email_notf_allow_cat_follower'
,
false
);
qa_opt
(
'ami_email_notf_allow_tag_follower'
,
false
);
qa_opt
(
'ami_email_notf_allow_tag_follower'
,
false
);
qa_opt
(
'ami_email_notf_allow_user_follower'
,
false
);
qa_opt
(
'ami_email_notf_allow_user_follower'
,
false
);
...
@@ -13,16 +13,16 @@ function reset_all_notification_options() {
...
@@ -13,16 +13,16 @@ function reset_all_notification_options() {
qa_opt
(
'ami_email_notf_min_point_val'
,
false
);
qa_opt
(
'ami_email_notf_min_point_val'
,
false
);
}
}
function
reset_all_notification_points_options
()
{
function
ami_
reset_all_notification_points_options
()
{
qa_opt
(
'ami_email_notf_min_point'
,
false
);
qa_opt
(
'ami_email_notf_min_point'
,
false
);
qa_opt
(
'ami_email_notf_min_point_val'
,
false
);
qa_opt
(
'ami_email_notf_min_point_val'
,
false
);
}
}
function
set_all_notification_options
()
{
function
ami_
set_all_notification_options
()
{
$error
=
array
();
$error
=
array
();
//if plugin is enabled then atlest one option has to be enabled
//if plugin is enabled then atlest one option has to be enabled
if
(
options_selected
())
{
if
(
ami_
options_selected
())
{
qa_opt
(
'ami_email_notf_allow_cat_follower'
,
!!
qa_post_text
(
'ami_email_notf_allow_cat_follower'
));
qa_opt
(
'ami_email_notf_allow_cat_follower'
,
!!
qa_post_text
(
'ami_email_notf_allow_cat_follower'
));
qa_opt
(
'ami_email_notf_allow_tag_follower'
,
!!
qa_post_text
(
'ami_email_notf_allow_tag_follower'
));
qa_opt
(
'ami_email_notf_allow_tag_follower'
,
!!
qa_post_text
(
'ami_email_notf_allow_tag_follower'
));
qa_opt
(
'ami_email_notf_allow_user_follower'
,
!!
qa_post_text
(
'ami_email_notf_allow_user_follower'
));
qa_opt
(
'ami_email_notf_allow_user_follower'
,
!!
qa_post_text
(
'ami_email_notf_allow_user_follower'
));
...
@@ -35,27 +35,27 @@ function set_all_notification_options() {
...
@@ -35,27 +35,27 @@ function set_all_notification_options() {
qa_opt
(
'ami_email_notf_min_point_val'
,
(
int
)
$minimum_user_point_value
);
qa_opt
(
'ami_email_notf_min_point_val'
,
(
int
)
$minimum_user_point_value
);
}
else
if
(
!!
$minimum_user_point_value
&&
(
!
is_numeric
(
$minimum_user_point_value
)
||
$minimum_user_point_value
<=
0
))
{
}
else
if
(
!!
$minimum_user_point_value
&&
(
!
is_numeric
(
$minimum_user_point_value
)
||
$minimum_user_point_value
<=
0
))
{
// the minimum_user_point_value is set but the value is not valid
// the minimum_user_point_value is set but the value is not valid
reset_all_notification_points_options
();
ami_
reset_all_notification_points_options
();
//send a error message to UI
//send a error message to UI
$error
[
'enter_point_value'
]
=
qa_lang
(
'notify/point_value_should_numeric'
);
$error
[
'enter_point_value'
]
=
qa_lang
(
'notify/point_value_should_numeric'
);
}
else
{
}
else
{
reset_all_notification_points_options
();
ami_
reset_all_notification_points_options
();
//send a error message to UI
//send a error message to UI
$error
[
'enter_point_value'
]
=
qa_lang
(
'notify/point_value_required'
);
;
$error
[
'enter_point_value'
]
=
qa_lang
(
'notify/point_value_required'
);
;
}
}
}
else
{
}
else
{
reset_all_notification_points_options
();
ami_
reset_all_notification_points_options
();
}
}
}
else
{
}
else
{
//if none of the elements are selected disable the plugin and send a error message UI
//if none of the elements are selected disable the plugin and send a error message UI
qa_opt
(
'ami_email_notf_enable_plugin'
,
false
);
qa_opt
(
'ami_email_notf_enable_plugin'
,
false
);
reset_all_notification_options
();
ami_
reset_all_notification_options
();
$error
[
'no_options_selected'
]
=
qa_lang
(
'notify/choose_atleast_one_opt'
);
$error
[
'no_options_selected'
]
=
qa_lang
(
'notify/choose_atleast_one_opt'
);
}
}
return
$error
;
return
$error
;
}
}
function
options_selected
()
{
function
ami_
options_selected
()
{
return
((
!!
qa_post_text
(
'ami_email_notf_allow_cat_follower'
))
||
return
((
!!
qa_post_text
(
'ami_email_notf_allow_cat_follower'
))
||
(
!!
qa_post_text
(
'ami_email_notf_allow_tag_follower'
))
||
(
!!
qa_post_text
(
'ami_email_notf_allow_tag_follower'
))
||
(
!!
qa_post_text
(
'ami_email_notf_allow_user_follower'
))
);
(
!!
qa_post_text
(
'ami_email_notf_allow_user_follower'
))
);
...
...
qa-email-notifications-event.php
View file @
494cdd09
...
@@ -202,9 +202,9 @@ class qa_email_notifications_event {
...
@@ -202,9 +202,9 @@ class qa_email_notifications_event {
qa_opt
(
'ami_email_notf_enable_plugin'
,
$enable_plugin
);
qa_opt
(
'ami_email_notf_enable_plugin'
,
$enable_plugin
);
if
(
!
$enable_plugin
)
{
if
(
!
$enable_plugin
)
{
//if the plugin is disabled then turn off all features
//if the plugin is disabled then turn off all features
reset_all_notification_options
();
ami_
reset_all_notification_options
();
}
else
{
}
else
{
$response
=
set_all_notification_options
();
$response
=
ami_
set_all_notification_options
();
//$error will be false if the
//$error will be false if the
$error
=
(
isset
(
$response
)
&&
is_array
(
$response
)
&&
!
empty
(
$response
))
?
true
:
false
;
$error
=
(
isset
(
$response
)
&&
is_array
(
$response
)
&&
!
empty
(
$response
))
?
true
:
false
;
}
}
...
...
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