本文整理汇总了PHP中FSS_Helper::ObjectToArray方法的典型用法代码示例。如果您正苦于以下问题:PHP FSS_Helper::ObjectToArray方法的具体用法?PHP FSS_Helper::ObjectToArray怎么用?PHP FSS_Helper::ObjectToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FSS_Helper
的用法示例。
在下文中一共展示了FSS_Helper::ObjectToArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: EMail_To_Ticket_Handler
/**
* Emails to admins
*/
static function EMail_To_Ticket_Handler($template, &$ticket, $subject, $body, $files = array())
{
$ticket = FSS_Helper::ObjectToArray($ticket);
$mailer = new FSSMailer();
self::Ticket_To_Admins($mailer, $ticket);
$lang = "";
if ($ticket['admin_id'] > 0) {
$user = JFactory::getUser($ticket['admin_id']);
$lang = $user->getParam('language');
}
//$lang =
// parse template etc
$template = self::Get_Template($template, $lang);
$email = self::ParseTemplate($template, $ticket, $subject, $body, $template['ishtml']);
$mailer->isHTML($template['ishtml']);
$mailer->setSubject($email['subject']);
$mailer->setBody($email['body']);
if (FSS_Settings::get('support_email_file_handler') == 1) {
$mailer->addFiles($files);
}
$mailer->addDebug('Ticket', $ticket);
$mailer->send();
}
示例2: EMail_To_Ticket_User
static function EMail_To_Ticket_User($template_name, &$ticket, $subject = "", $body = "", $files = array())
{
$cc_admins = $template_name == "email_on_create" || $template_name == "email_on_create_unreg" || $template_name == "email_unreg_passwords" ? false : true;
$is_create = $template_name == "email_on_create" || $template_name == "email_on_create_unreg" ? true : false;
$ticket = FSS_Helper::ObjectToArray($ticket);
$db = JFactory::getDBO();
$mailer = new FSSMailer();
self::Ticket_To_Users($mailer, $ticket);
// Add bcc to admins if set up. Dont send when creating a ticket as they get notifications from
// Admin_Create function
if ($cc_admins && FSS_Settings::get('support_email_bcc_handler')) {
self::Ticket_To_Admins($mailer, $ticket);
}
// build template and parse it
$template = self::Get_Template($template_name, $ticket['lang']);
$email = self::ParseTemplate($template, $ticket, $subject, $body, $template['ishtml'], true);
// set result to mailer
$mailer->isHTML($template['ishtml']);
$mailer->setSubject($email['subject']);
$mailer->setBody($email['body']);
// Only send attachments to users when creating if the ticket is created by an admin
$session = JFactory::getSession();
if (FSS_Settings::get('support_email_file_user') && (!$is_create || $session->Get('admin_create') > 0)) {
$mailer->addFiles($files);
}
// add debug info
$mailer->addDebug('Ticket', $ticket);
// send actual mail
self::Send($mailer);
}