Fixed typo in admin area
Added option to hide the user cloud for guests Don't send notification mail on new comment when notification module is active and user is watching item
This commit is contained in:
parent
b7ee10fce4
commit
daf1d8a66c
@ -89,6 +89,8 @@ class Admin_Photoannotation_Controller extends Admin_Controller {
|
|||||||
"photoannotation", "nonotifications", $form->notifications->nonotifications->value, true);
|
"photoannotation", "nonotifications", $form->notifications->nonotifications->value, true);
|
||||||
module::set_var(
|
module::set_var(
|
||||||
"photoannotation", "notificationoptout", $form->notifications->notificationoptout->value, true);
|
"photoannotation", "notificationoptout", $form->notifications->notificationoptout->value, true);
|
||||||
|
module::set_var(
|
||||||
|
"photoannotation", "allowguestsearch", $form->notifications->allowguestsearch->value, true);
|
||||||
module::set_var(
|
module::set_var(
|
||||||
"photoannotation", "newtagsubject", strip_tags($form->newtagmail->newtagsubject->value));
|
"photoannotation", "newtagsubject", strip_tags($form->newtagmail->newtagsubject->value));
|
||||||
module::set_var(
|
module::set_var(
|
||||||
@ -251,19 +253,21 @@ class Admin_Photoannotation_Controller extends Admin_Controller {
|
|||||||
->value(module::get_var("photoannotation", "hovercolor", "990000"))
|
->value(module::get_var("photoannotation", "hovercolor", "990000"))
|
||||||
->rules("valid_alpha_numeric|length[6]");
|
->rules("valid_alpha_numeric|length[6]");
|
||||||
$group = $form->group("legendsettings")->label(t("Legend settings"));
|
$group = $form->group("legendsettings")->label(t("Legend settings"));
|
||||||
$group->checkbox("showusers")->label(t("Show face annotation below photo."))
|
$group->checkbox("showusers")->label(t("Show user annotations below photo."))
|
||||||
->checked(module::get_var("photoannotation", "showusers", false));
|
->checked(module::get_var("photoannotation", "showusers", false));
|
||||||
$group->checkbox("showfaces")->label(t("Show face annotation below photo."))
|
$group->checkbox("showfaces")->label(t("Show tag annotations below photo."))
|
||||||
->checked(module::get_var("photoannotation", "showfaces", false));
|
->checked(module::get_var("photoannotation", "showfaces", false));
|
||||||
$group->checkbox("shownotes")->label(t("Show note annotations below photo."))
|
$group->checkbox("shownotes")->label(t("Show note annotations below photo."))
|
||||||
->checked(module::get_var("photoannotation", "shownotes", false));
|
->checked(module::get_var("photoannotation", "shownotes", false));
|
||||||
$group->checkbox("fullname")->label(t("Show full name of a user instead of the username on annotations (username will be dispayed for users without a full name)."))
|
$group->checkbox("fullname")->label(t("Show full name of a user instead of the username on annotations (username will be dispayed for users without a full name)."))
|
||||||
->checked(module::get_var("photoannotation", "fullname", false));
|
->checked(module::get_var("photoannotation", "fullname", false));
|
||||||
$group = $form->group("notifications")->label(t("Notification settings"));
|
$group = $form->group("notifications")->label(t("Notification and user cloud settings"));
|
||||||
$group->checkbox("nonotifications")->label(t("Disable user notifications."))
|
$group->checkbox("nonotifications")->label(t("Disable user notifications."))
|
||||||
->checked(module::get_var("photoannotation", "nonotifications", false));
|
->checked(module::get_var("photoannotation", "nonotifications", false));
|
||||||
$group->checkbox("notificationoptout")->label(t("Notify users by default (only applies to new users and user who have not saved their profile after installing this module)."))
|
$group->checkbox("notificationoptout")->label(t("Notify users by default (only applies to new users and user who have not saved their profile after installing this module)."))
|
||||||
->checked(module::get_var("photoannotation", "notificationoptout", false));
|
->checked(module::get_var("photoannotation", "notificationoptout", false));
|
||||||
|
$group->checkbox("allowguestsearch")->label(t("Show user cloud and allow user search for guests."))
|
||||||
|
->checked(module::get_var("photoannotation", "allowguestsearch", false));
|
||||||
$group = $form->group("newtagmail")->label(t("Customize the mail sent to users when a user annotation is created"));
|
$group = $form->group("newtagmail")->label(t("Customize the mail sent to users when a user annotation is created"));
|
||||||
$group->input("newtagsubject")->label(t("Subject"))
|
$group->input("newtagsubject")->label(t("Subject"))
|
||||||
->value(module::get_var("photoannotation", "newtagsubject", "Someone tagged a photo of you"));
|
->value(module::get_var("photoannotation", "newtagsubject", "Someone tagged a photo of you"));
|
||||||
|
@ -18,7 +18,12 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
class photoannotation_Controller extends Controller {
|
class photoannotation_Controller extends Controller {
|
||||||
public function showuser($item_id) {
|
public function showuser() {
|
||||||
|
if (identity::active_user()->guest && !module::get_var("photoannotation", "allowguestsearch", false)) {
|
||||||
|
message::error(t("You have to log in to perform a user search."));
|
||||||
|
url::redirect(url::site());
|
||||||
|
return;
|
||||||
|
}
|
||||||
$form = photoannotation::get_user_search_form("g-user-cloud-form");
|
$form = photoannotation::get_user_search_form("g-user-cloud-form");
|
||||||
$user_id = Input::instance()->get("name", "");
|
$user_id = Input::instance()->get("name", "");
|
||||||
if ($user_id == "") {
|
if ($user_id == "") {
|
||||||
@ -40,10 +45,10 @@ class photoannotation_Controller extends Controller {
|
|||||||
list ($count, $result) = photoannotation::search_user($user_id, $page_size, $offset);
|
list ($count, $result) = photoannotation::search_user($user_id, $page_size, $offset);
|
||||||
$max_pages = max(ceil($count / $page_size), 1);
|
$max_pages = max(ceil($count / $page_size), 1);
|
||||||
if ($page > 1) {
|
if ($page > 1) {
|
||||||
$previous_page_url = url::site("photoannotation/showuser/". $item_id ."?name=". $user_id ."&page=". ($page - 1));
|
$previous_page_url = url::site("photoannotation/showuser?name=". $user_id ."&page=". ($page - 1));
|
||||||
}
|
}
|
||||||
if ($page < $max_pages) {
|
if ($page < $max_pages) {
|
||||||
$next_page_url = url::site("photoannotation/showuser/". $item_id ."?name=". $user_id ."&page=". ($page + 1));
|
$next_page_url = url::site("photoannotation/showuser?name=". $user_id ."&page=". ($page + 1));
|
||||||
}
|
}
|
||||||
if ($user_id == "") {
|
if ($user_id == "") {
|
||||||
$user_id = "*";
|
$user_id = "*";
|
||||||
|
@ -171,6 +171,12 @@ class photoannotation_Core {
|
|||||||
case "newcomment":
|
case "newcomment":
|
||||||
//Only send if user has this option enabled
|
//Only send if user has this option enabled
|
||||||
if ($notification_settings->comment) {
|
if ($notification_settings->comment) {
|
||||||
|
//Don't send if the notification module is active and the user is watching this item
|
||||||
|
if (module::is_active("notification")) {
|
||||||
|
if (notification::is_watching($item, $recipient)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
//Get subject and body and send the mail
|
//Get subject and body and send the mail
|
||||||
$subject = module::get_var("photoannotation", "newcommentsubject", "Someone added a comment to photo of you");
|
$subject = module::get_var("photoannotation", "newcommentsubject", "Someone added a comment to photo of you");
|
||||||
$body = module::get_var("photoannotation", "newcommentbody", "Hello %name, please visit %url to read the comment.");
|
$body = module::get_var("photoannotation", "newcommentbody", "Hello %name, please visit %url to read the comment.");
|
||||||
@ -181,6 +187,12 @@ class photoannotation_Core {
|
|||||||
case "updatecomment":
|
case "updatecomment":
|
||||||
//Only send if user has this option enabled
|
//Only send if user has this option enabled
|
||||||
if ($notification_settings->comment) {
|
if ($notification_settings->comment) {
|
||||||
|
//Don't send if the notification module is active and the user is watching this item
|
||||||
|
if (module::is_active("notification")) {
|
||||||
|
if (notification::is_watching($item, $recipient)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
//Get subject and body and send the mail
|
//Get subject and body and send the mail
|
||||||
$subject = module::get_var("photoannotation", "updatedcommentsubject", "Someone updated a comment to photo of you");
|
$subject = module::get_var("photoannotation", "updatedcommentsubject", "Someone updated a comment to photo of you");
|
||||||
$body = module::get_var("photoannotation", "updatedcommentbody", "Hello %name, please visit %url to read the comment.");
|
$body = module::get_var("photoannotation", "updatedcommentbody", "Hello %name, please visit %url to read the comment.");
|
||||||
|
@ -24,6 +24,7 @@ class photoannotation_block_Core {
|
|||||||
|
|
||||||
static function get($block_id, $theme) {
|
static function get($block_id, $theme) {
|
||||||
$block = "";
|
$block = "";
|
||||||
|
if (!identity::active_user()->guest || module::get_var("photoannotation", "allowguestsearch", false)) {
|
||||||
switch ($block_id) {
|
switch ($block_id) {
|
||||||
case "photoannotation":
|
case "photoannotation":
|
||||||
$block = new Block();
|
$block = new Block();
|
||||||
@ -33,6 +34,7 @@ class photoannotation_block_Core {
|
|||||||
$block->content->cloud = photoannotation::cloud(30);
|
$block->content->cloud = photoannotation::cloud(30);
|
||||||
$block->content->form = photoannotation::get_user_search_form("g-user-cloud-form");
|
$block->content->form = photoannotation::get_user_search_form("g-user-cloud-form");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $block;
|
return $block;
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user