mirror of
https://github.com/Oreolek/kangana.git
synced 2024-06-16 23:11:07 +03:00
Followup to 12a7db2
This commit is contained in:
parent
12a7db25e3
commit
a8a35d03bd
|
@ -58,7 +58,11 @@ class Model_Instant extends ORM {
|
|||
{
|
||||
Log::instance()->add(Log::NOTICE, __('Sending letter with subject "%subject" to address %address', array('%subject' => $subject, '%address' => $address)));
|
||||
$sender = Kohana::$config->load('email')->get('sender');
|
||||
$email = Email::factory($subject, $text)->from($sender[0], $sender[1]);
|
||||
$template = new View_Letter_View;
|
||||
$template->content = $text;
|
||||
$template->token = $token;
|
||||
$renderer = Kostache_Layout::factory($template->_layout);
|
||||
$email = Email::factory($subject, $renderer->render($template, $template->_view))->from($sender[0], $sender[1]);
|
||||
if (is_array($address))
|
||||
{
|
||||
$email->bcc($address);
|
||||
|
|
|
@ -69,6 +69,8 @@ class Model_Letter extends ORM {
|
|||
Log::instance()->add(Log::NOTICE, __('Sending letter with subject "%subject" to address %address', array('%subject' => $subject, '%address' => $address)));
|
||||
$sender = Kohana::$config->load('email')->get('sender');
|
||||
$template = new View_Letter_View;
|
||||
$template->content = $text;
|
||||
$template->token = $token;
|
||||
$renderer = Kostache_Layout::factory($template->_layout);
|
||||
$email = Email::factory($subject, $renderer->render($template, $template->_view))->from($sender[0], $sender[1]);
|
||||
if (is_array($address))
|
||||
|
|
|
@ -19,28 +19,4 @@ class View_Letter_View extends View {
|
|||
{
|
||||
return Kostache::factory()->render($this->content);
|
||||
}
|
||||
|
||||
public function scripts()
|
||||
{
|
||||
$scripts = $this->scripts;
|
||||
$temp = "";
|
||||
foreach($scripts as $script):
|
||||
if (strstr($script, '://') === FALSE) //no protocol given, script is local
|
||||
{
|
||||
if ($script === 'jquery') // CDN shortcut
|
||||
{
|
||||
$temp .= HTML::script('https://yandex.st/jquery/2.0.3/jquery.min.js')."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$temp .= HTML::script('application/assets/javascript/'.$script)."\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$temp .= HTML::script($script)."\n";
|
||||
}
|
||||
endforeach;
|
||||
return $temp;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,5 @@
|
|||
{{>content}}
|
||||
</div>
|
||||
</div>
|
||||
{{{scripts}}}
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue