Example #1
0
 * Display comment view
 */
if (isset($vars['entity'])) {
    $comment = $vars['entity'];
    $owner = get_user($comment->owner_guid);
    $canedit = answers_can_edit_comment($comment);
    $markdown = is_callable('markdown_text');
    if ($comment && $owner) {
        $full_comment_text = parse_urls(filter_tags($comment->value)) . ($markdown ? "\n" : " ") . "&mdash; " . "<span class=\"answers_comment_owner\">" . "<a href=\"" . $owner->getURL() . "\">" . $owner->name . "</a>" . " " . elgg_view_friendly_time($comment->time_created) . "</span>";
        if ($canedit) {
            $full_comment_text .= "&nbsp;&nbsp;" . elgg_view("output/confirmlink", array('href' => $vars['url'] . "action/answers/comment/delete?comment_id=" . $comment->id, 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'), 'class' => '', 'is_action' => true));
            $edit = elgg_echo('edit');
            $full_comment_text .= "&nbsp;&nbsp;<a class=\"collapsibleboxlink\">{$edit}</a>";
        }
        if ($markdown) {
            $full_comment_text = markdown_text($full_comment_text);
        } else {
            $full_comment_text = autop($full_comment_text);
        }
        ?>
	<div class="answers_comment">
		<a name="<?php 
        echo $comment->id;
        ?>
"></a>
        <?php 
        echo $full_comment_text;
        ?>
		<?php 
        if ($canedit) {
            ?>
Example #2
0
 public function handle(MandrillMail $mailer, OrderRepository $repository, CountryRepository $country)
 {
     $payment_kind_slugs = config('shop.payment_kind_slugs');
     $payment_kind_slug = $payment_kind_slugs[$this->order->payment_kind_id];
     $countries = $country->getList();
     $template = email_template('order_confirmation', config('app.locale'));
     $subject = str_replace('{order-number}', $this->order->order_number, $template['subject']);
     $body = markdown_text($template['body']);
     $body = str_replace('{name}', $this->order->invoice_first_name . ' ' . $this->order->invoice_last_name, $body);
     $body = str_replace('{order-number}', $this->order->order_number, $body);
     $order_details = '';
     $total = 0;
     if ($this->order->order_products) {
         foreach ($this->order->order_products as $order_product) {
             $complete_price = $order_product->quantity * $order_product->price_brut;
             $total += $complete_price;
             $order_details .= $order_product->quantity . " x " . $order_product->product_collection . " // " . $order_product->product_variant . " // " . $order_product->product_color . "\r" . trans('order.single_price') . ": " . convert_from_cents($order_product->price_brut) . " € // " . trans("shop.complete_price") . ": " . convert_from_cents($complete_price) . " €<hr>";
         }
     }
     $order_details .= trans('shop.price_sum') . ": " . convert_from_cents($total) . " €<hr>";
     $order_details .= trans('shop.shipping_costs') . ": " . convert_from_cents(config('shop.default_shipping_cost')) . " €<hr>";
     $order_details .= "<strong>" . trans('shop.total') . ": " . convert_from_cents(config('shop.default_shipping_cost') + $total) . " €</strong><hr><br><br>";
     $order_details .= trans('checkout.remarks') . ":<br>" . nl2br($this->order->remarks) . "<br><br>";
     if ($this->mode == 'self') {
         if ($this->order->paypal_transaction_id) {
             $order_details .= $this->order->paypal_transaction_id . "<br>";
         }
         if ($this->order->stripe_token_id) {
             $order_details .= $this->order->stripe_token_id . "<br>";
         }
     }
     $order_details .= trans('order.order_number') . ": " . $this->order->order_number . "<br>";
     $order_details .= trans('shop.payment_kind') . ": " . $this->order->payment_kind->name . "<br><br>";
     $body .= $order_details;
     $email_description = str_replace('{total}', convert_from_cents(config('shop.default_shipping_cost') + $total) . ' €', $this->order->payment_kind->email_description);
     $email_description = str_replace('{order-number}', $this->order->order_number, $email_description);
     $payment_details = $email_description . "<br><br>";
     if ($payment_kind_slug == 'prepayment') {
         $payment_details .= markdown_settings('bank_account') . "<br><br>";
     }
     $body .= $payment_details;
     $account_details = trans('shop.invoice_address') . ":<br>" . $this->order->invoice_first_name . " " . $this->order->invoice_last_name . "<br>";
     $account_details .= $this->order->invoice_street . "<br>" . $this->order->invoice_zip . " " . $this->order->invoice_city . "<br>";
     $account_details .= $countries[$this->order->invoice_country_id] . "<br><br>";
     $account_details .= trans('shop.shipping_address') . ":<br>" . $this->order->shipping_first_name . " " . $this->order->shipping_last_name . "<br>";
     $account_details .= $this->order->shipping_street . "<br>" . $this->order->shipping_zip . " " . $this->order->shipping_city . "<br>";
     $account_details .= $countries[$this->order->shipping_country_id] . "<br><br>";
     $body .= $account_details;
     if ($this->mode != 'self') {
         $legal = "";
         $legal .= "<br><br><div class='small'><em>" . trans('order.right_of_withdrawal_note') . "</em><br>";
         $legal .= markdown_settings('right_of_withdrawal');
         $legal .= "<br><em>" . trans('order.end_of_right_of_withdrawal_note') . "</em></div><br><br>";
         $body .= $legal;
         /*
         $terms = "";
         $terms .= "<br><br><div class='small'>";
         $terms .= markdown_settings('terms');
         $terms .= "</div><br><br>";
         $body .= $terms;
         */
     }
     $html_content = $body;
     $to_emails = [$this->order->invoice_email];
     if ($this->mode == 'self') {
         $to_emails = explode(',', settings('order_email_addresses'));
     }
     foreach ($to_emails as $to_email) {
         $message = ['subject' => $subject, 'inline_css' => true, 'merge' => true, 'merge_language' => 'handlebars', 'preserve_recipients' => false, 'global_merge_vars' => array(['name' => 'maincontent', 'content' => $html_content])];
         $message['to'] = [['email' => $to_email, 'type' => 'to']];
         $mandrill_responses = MandrillMail::messages()->sendTemplate('order-confirmation', '', $message);
     }
 }