1
0

Merge branch 'master' of git@github.com:gallery/gallery3-contrib

This commit is contained in:
Tim Almdal 2011-06-20 17:34:08 -07:00
commit e621d5de2f
2 changed files with 15 additions and 20 deletions

View File

@ -83,10 +83,10 @@ class ContactOwner_Controller extends Controller {
} }
// Set up and display the actual page. // Set up and display the actual page.
$template = new Theme_View("page.html", "other", "Contact"); $view = new View("contactowner_emailform.html");
$template->content = new View("contactowner_emailform.html"); $view->sendmail_form = $this->get_email_form("-1", $item_id);
$template->content->sendmail_form = $this->get_email_form("-1", $item_id);
print $template; print $view;
} }
public function emailid($user_id, $item_id) { public function emailid($user_id, $item_id) {
@ -98,10 +98,11 @@ class ContactOwner_Controller extends Controller {
} }
// Set up and display the actual page. // Set up and display the actual page.
$template = new Theme_View("page.html", "other", "Contact"); // Set up and display the actual page.
$template->content = new View("contactowner_emailform.html"); $view = new View("contactowner_emailform.html");
$template->content->sendmail_form = $this->get_email_form($user_id, $item_id); $view->sendmail_form = $this->get_email_form($user_id, $item_id);
print $template;
print $view;
} }
public function sendemail($user_id) { public function sendemail($user_id) {
@ -154,18 +155,12 @@ class ContactOwner_Controller extends Controller {
->message($str_emailbody) ->message($str_emailbody)
->send(); ->send();
// Display a message telling the visitor that their email has been sent. message::info(t("Your Message Has Been Sent."));
$template = new Theme_View("page.html", "other", "Contact"); json::reply(array("result" => "success"));
$template->content = new View("contactowner_emailform.html");
$template->content->sendmail_form = t("Your Message Has Been Sent.");
print $template;
} else { } else {
// Set up and display the actual page. // Set up and display the actual page.
$template = new Theme_View("page.html", "other", "Contact"); json::reply(array("result" => "error", "html" => (string) $form));
$template->content = new View("contactowner_emailform.html");
$template->content->sendmail_form = $form;
print $template;
} }
} }
} }

View File

@ -53,7 +53,7 @@ class contactowner_block_Core {
if ((count($userDetails) > 0) && ($userDetails[0]->email != "") && if ((count($userDetails) > 0) && ($userDetails[0]->email != "") &&
(module::get_var("contactowner", "contact_user_link") == true)) { (module::get_var("contactowner", "contact_user_link") == true)) {
$block->content->userLink = "<a href=\"" . url::site("contactowner/emailid/" . $block->content->userLink = "<a href=\"" . url::site("contactowner/emailid/" .
$theme->item->owner_id) . "/" . $theme->item->id . "\">" . t("Contact") . " " . $theme->item->owner_id) . "/" . $theme->item->id . "\" class='g-dialog-link'>" . t("Contact") . " " .
$userDetails[0]->name . "</a>"; $userDetails[0]->name . "</a>";
$displayBlock = true; $displayBlock = true;
} }
@ -63,10 +63,10 @@ class contactowner_block_Core {
if (module::get_var("contactowner", "contact_owner_link")) { if (module::get_var("contactowner", "contact_owner_link")) {
if ($theme->item()) { if ($theme->item()) {
$block->content->ownerLink = "<a href=\"" . url::site("contactowner/emailowner") . "/" . $theme->item->id . $block->content->ownerLink = "<a href=\"" . url::site("contactowner/emailowner") . "/" . $theme->item->id .
"\">" . t(module::get_var("contactowner", "contact_button_text")) . "</a>"; "\" class='g-dialog-link'>" . t(module::get_var("contactowner", "contact_button_text")) . "</a>";
} else { } else {
$block->content->ownerLink = "<a href=\"" . url::site("contactowner/emailowner") . $block->content->ownerLink = "<a href=\"" . url::site("contactowner/emailowner") .
"\">" . t(module::get_var("contactowner", "contact_button_text")) . "</a>"; "\" class='g-dialog-link'>" . t(module::get_var("contactowner", "contact_button_text")) . "</a>";
} }
$displayBlock = true; $displayBlock = true;
} }