当前位置: 首页>>代码示例>>PHP>>正文


PHP Template_Helper::getTemplateContents方法代码示例

本文整理汇总了PHP中Template_Helper::getTemplateContents方法的典型用法代码示例。如果您正苦于以下问题:PHP Template_Helper::getTemplateContents方法的具体用法?PHP Template_Helper::getTemplateContents怎么用?PHP Template_Helper::getTemplateContents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Template_Helper的用法示例。


在下文中一共展示了Template_Helper::getTemplateContents方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getWeeklyReport

 /**
  * @param int $week
  * @param string $start
  * @param string $end
  * @param bool $separate_closed
  * @return string
  * @access protected
  * @deprecated use getWeeklyReportData() and format data yourself
  */
 public function getWeeklyReport($week, $start, $end, $separate_closed)
 {
     $usr_id = Auth::getUserID();
     $week = abs($week);
     // we have to set a project so the template class works, even though the weekly report doesn't actually need it
     $projects = Project::getAssocList(Auth::getUserID());
     $prj_id = current(array_keys($projects));
     AuthCookie::setProjectCookie($prj_id);
     $prj_id = Auth::getCurrentProject();
     // figure out the correct week
     if (empty($start) || empty($end)) {
         $start = date('U') - Date_Helper::DAY * (date('w') - 1);
         if ($week > 0) {
             $start = $start - Date_Helper::WEEK * $week;
         }
         $end = date('Y-m-d', $start + Date_Helper::DAY * 6);
         $start = date('Y-m-d', $start);
     }
     if ($separate_closed) {
         // emulate smarty value for reports/weekly_data.tpl.tmpl:
         // {if $smarty.post.separate_closed == 1}
         $_POST['separate_closed'] = true;
     }
     $options = array('separate_closed' => $separate_closed);
     $tpl = new Template_Helper();
     $tpl->setTemplate('reports/weekly_data.tpl.html');
     $tpl->assign(array('report_type' => 'weekly', 'data' => Report::getWeeklyReport($usr_id, $prj_id, $start, $end, $options)));
     $ret = $tpl->getTemplateContents() . "\n";
     return $ret;
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:39,代码来源:RemoteApi.php

示例2: sendPasswordConfirmationEmail

 /**
  * Method used to send a confirmation email to the user that is associated
  * to the email address.
  *
  * @param   string $usr_id The user ID
  * @return  void
  */
 public static function sendPasswordConfirmationEmail($usr_id)
 {
     $info = self::getDetails($usr_id);
     // send confirmation email to user
     $hash = md5($info['usr_full_name'] . $info['usr_email'] . Auth::privateKey());
     $tpl = new Template_Helper();
     $tpl->setTemplate('notifications/password_confirmation.tpl.text');
     $tpl->assign(array('app_title' => Misc::getToolCaption(), 'user' => $info, 'hash' => $hash));
     $text_message = $tpl->getTemplateContents();
     $setup = Setup::load();
     $mail = new Mail_Helper();
     // need to make this message MIME based
     $mail->setTextBody($text_message);
     $mail->send($setup['smtp']['from'], $info['usr_email'], APP_SHORT_NAME . ': New Password - Confirmation Required');
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:22,代码来源:class.user.php

示例3: bounceMessage

 /**
  * Bounce message to sender.
  *
  * @param   object  $message parsed message structure.
  * @param   array   array(ERROR_CODE, ERROR_STRING) of error to bounce
  * @return  void
  */
 public function bounceMessage($message, $error)
 {
     // open text template
     $tpl = new Template_Helper();
     $tpl->setTemplate('notifications/bounced_email.tpl.text');
     $tpl->assign(array('error_code' => $error[0], 'error_message' => $error[1], 'date' => $message->date, 'subject' => Mime_Helper::fixEncoding($message->subject), 'from' => Mime_Helper::fixEncoding($message->fromaddress), 'to' => Mime_Helper::fixEncoding($message->toaddress), 'cc' => Mime_Helper::fixEncoding(@$message->ccaddress)));
     $sender_email = Mail_Helper::getEmailAddress($message->fromaddress);
     $usr_id = User::getUserIDByEmail($sender_email);
     // change the current locale
     if ($usr_id) {
         Language::set(User::getLang($usr_id));
     }
     $text_message = $tpl->getTemplateContents();
     // send email (use PEAR's classes)
     $mail = new Mail_Helper();
     $mail->setTextBody($text_message);
     $setup = $mail->getSMTPSettings();
     $mail->send($setup['from'], $sender_email, APP_SHORT_NAME . ': ' . ev_gettext('Postmaster notify: see transcript for details'));
     if ($usr_id) {
         Language::restore();
     }
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:29,代码来源:class.support.php

示例4: displayNotifiedUsers

 public static function displayNotifiedUsers($notify_list)
 {
     if (count($notify_list) > 0) {
         $update_tpl = new Template_Helper();
         $update_tpl->setTemplate('include/notified_list.tpl.html');
         $update_tpl->assign('notify_list', $notify_list);
         self::setMessage($update_tpl->getTemplateContents(false), self::MSG_HTML_BOX);
     }
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:9,代码来源:class.misc.php

示例5: elseif

        exit;
    } elseif ($res == 1) {
        Misc::setMessage(ev_gettext('Thank you, issue #%1$s was updated successfully.', $issue_id), Misc::MSG_INFO);
    }
    $notify_list = Notification::getLastNotifiedAddresses($issue_id);
    $has_duplicates = Issue::hasDuplicates($_POST['issue_id']);
    if ($has_duplicates || count($errors) > 0 || count($notify_list) > 0) {
        $update_tpl = new Template_Helper();
        $update_tpl->setTemplate('include/update_msg.tpl.html');
        $update_tpl->assign('update_result', $res);
        $update_tpl->assign('errors', $errors);
        $update_tpl->assign('notify_list', $notify_list);
        if ($has_duplicates) {
            $update_tpl->assign('has_duplicates', 'yes');
        }
        Misc::setMessage($update_tpl->getTemplateContents(false), Misc::MSG_HTML_BOX);
    }
    Auth::redirect(APP_RELATIVE_URL . 'view.php?id=' . $issue_id);
    exit;
}
$prj_id = Auth::getCurrentProject();
// if currently selected release is in the past, manually add it to list
$releases = Release::getAssocList($prj_id);
if ($details['iss_pre_id'] != 0 && empty($releases[$details['iss_pre_id']])) {
    $releases = array($details['iss_pre_id'] => $details['pre_title']) + $releases;
}
if (Workflow::hasWorkflowIntegration($prj_id)) {
    $statuses = Workflow::getAllowedStatuses($prj_id, $issue_id);
    // if currently selected release is not on list, go ahead and add it.
} else {
    $statuses = Status::getAssocStatusList($prj_id, false);
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:update.php

示例6: _recordNoRecipientError

 /**
  * Method used to send an alert to a set of email addresses when
  * a reminder action was triggered, but no action was really
  * taken because no recipients could be found.
  *
  * @param   integer $issue_id The issue ID
  * @param   string $type Which reminder are we trying to send, email or sms
  * @param   array $reminder The reminder details
  * @param   array $action The action details
  * @return  void
  */
 private function _recordNoRecipientError($issue_id, $type, $reminder, $action, $data, $conditions)
 {
     $to = Reminder::_getReminderAlertAddresses();
     if (count($to) > 0) {
         $tpl = new Template_Helper();
         $tpl->setTemplate('reminders/alert_no_recipients.tpl.text');
         $tpl->assign(array('type' => $type, 'data' => $data, 'reminder' => $reminder, 'action' => $action, 'conditions' => $conditions, 'has_customer_integration' => CRM::hasCustomerIntegration(Issue::getProjectID($issue_id))));
         $text_message = $tpl->getTemplateContents();
         foreach ($to as $address) {
             // send email (use PEAR's classes)
             $mail = new Mail_Helper();
             $mail->setTextBody($text_message);
             $setup = $mail->getSMTPSettings();
             // TRANSLATORS: %1 = issue_id, %2 - rma_title
             $subject = ev_gettext('[#%1$s] Reminder Not Triggered: [#%2$s]', $issue_id, $action['rma_title']);
             $mail->send($setup['from'], $address, $subject, 0, $issue_id);
         }
     }
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:30,代码来源:class.reminder_action.php

示例7: notifyAccountDetails

 /**
  * Method used to send the account details of an user.
  *
  * @param   integer $usr_id The user ID
  * @return  void
  */
 public function notifyAccountDetails($usr_id)
 {
     $info = User::getDetails($usr_id);
     $info['projects'] = Project::getAssocList($usr_id, true, true);
     // open text template
     $tpl = new Template_Helper();
     $tpl->setTemplate('notifications/account_details.tpl.text');
     $tpl->assign(array('app_title' => Misc::getToolCaption(), 'user' => $info));
     Language::set(User::getLang($usr_id));
     $text_message = $tpl->getTemplateContents();
     // send email (use PEAR's classes)
     $mail = new Mail_Helper();
     $mail->setTextBody($text_message);
     $setup = $mail->getSMTPSettings();
     $to = $mail->getFormattedName($info['usr_full_name'], $info['usr_email']);
     // TRANSLATORS: %s = APP_SHORT_NAME
     $subject = ev_gettext('%s: Your User Account Details', APP_SHORT_NAME);
     $mail->send($setup['from'], $to, $subject);
     Language::restore();
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:26,代码来源:class.notification.php


注:本文中的Template_Helper::getTemplateContents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。