Merge remote branch 'gallery3-contrib/master'
This commit is contained in:
commit
aa211be5fd
@ -18,7 +18,7 @@
|
|||||||
* 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 ContactOwner_Controller extends Controller {
|
class ContactOwner_Controller extends Controller {
|
||||||
static function get_email_form($user_id, $item_id) {
|
static function get_email_form($user_id, $item_id=null) {
|
||||||
// Determine name of the person the message is going to.
|
// Determine name of the person the message is going to.
|
||||||
$str_to_name = "";
|
$str_to_name = "";
|
||||||
if ($user_id == -1) {
|
if ($user_id == -1) {
|
||||||
@ -34,7 +34,7 @@ class ContactOwner_Controller extends Controller {
|
|||||||
|
|
||||||
// If item_id is set, include a link to the item.
|
// If item_id is set, include a link to the item.
|
||||||
$email_body = "";
|
$email_body = "";
|
||||||
if ($item_id <> "") {
|
if (!empty($item_id)) {
|
||||||
$item = ORM::factory("item", $item_id);
|
$item = ORM::factory("item", $item_id);
|
||||||
$email_body = "This message refers to <a href=\"" . url::abs_site("{$item->type}s/{$item->id}") . "\">this page</a>.";
|
$email_body = "This message refers to <a href=\"" . url::abs_site("{$item->type}s/{$item->id}") . "\">this page</a>.";
|
||||||
}
|
}
|
||||||
@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user