1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 06:35:55 +00:00

allow overriding built-in templates via templates.local

This commit is contained in:
Andrew Dolgov
2020-03-13 14:40:35 +03:00
parent 82326187f9
commit 1f2a721905
10 changed files with 48 additions and 40 deletions

View File

@@ -31,13 +31,11 @@ class Af_Comics_Gocomics extends Af_ComicFilter {
$body = fetch_file_contents(array('url' => $article_link, 'type' => 'text/html', 'followlocation' => false));
require_once 'lib/MiniTemplator.class.php';
$feed_title = htmlspecialchars($comic[1]);
$site_url = htmlspecialchars($site_url);
$article_link = htmlspecialchars($article_link);
$tpl = new MiniTemplator();
$tpl = new Templator();
$tpl->readTemplateFromFile('templates/generated_feed.txt');

View File

@@ -25,11 +25,10 @@ class Af_Comics_Gocomics_FarSide extends Af_ComicFilter {
public function on_fetch($url) {
if (preg_match("#^https?://www\.thefarside\.com#", $url)) {
require_once 'lib/MiniTemplator.class.php';
$article_link = htmlspecialchars("https://www.thefarside.com" . date('/Y/m/d'));
$tpl = new MiniTemplator();
$tpl = new Templator();
$tpl->readTemplateFromFile('templates/generated_feed.txt');

View File

@@ -235,11 +235,9 @@ class Auth_Internal extends Plugin implements IAuthModule {
if ($row = $sth->fetch()) {
$mailer = new Mailer();
require_once "lib/MiniTemplator.class.php";
$tpl = new Templator();
$tpl = new MiniTemplator;
$tpl->readTemplateFromFile("templates/password_change_template.txt");
$tpl->readTemplateFromFile("password_change_template.txt");
$tpl->setVariable('LOGIN', $row["login"]);
$tpl->setVariable('TTRSS_HOST', SELF_URL_PATH);

View File

@@ -92,18 +92,20 @@ class Mail extends Plugin {
if ($row = $sth->fetch()) {
$user_email = htmlspecialchars($row['email']);
$user_name = htmlspecialchars($row['full_name']);
} else {
$user_name = "";
$user_email = "";
}
if (!$user_name) $user_name = $_SESSION['name'];
if (!$user_name)
$user_name = $_SESSION['name'];
print_hidden("from_email", "$user_email");
print_hidden("from_name", "$user_name");
require_once "lib/MiniTemplator.class.php";
$tpl = new Templator();
$tpl = new MiniTemplator;
$tpl->readTemplateFromFile("templates/email_article_template.txt");
$tpl->readTemplateFromFile("email_article_template.txt");
$tpl->setVariable('USER_NAME', $_SESSION["name"], true);
$tpl->setVariable('USER_EMAIL', $user_email, true);
@@ -116,6 +118,8 @@ class Mail extends Plugin {
if (count($ids) > 1) {
$subject = __("[Forwarded]") . " " . __("Multiple articles");
} else {
$subject = "";
}
while ($line = $sth->fetch()) {

View File

@@ -29,11 +29,9 @@ class MailTo extends Plugin {
$ids = explode(",", $_REQUEST['param']);
$ids_qmarks = arr_qmarks($ids);
require_once "lib/MiniTemplator.class.php";
$tpl = new Templator();
$tpl = new MiniTemplator;
$tpl->readTemplateFromFile("templates/email_article_template.txt");
$tpl->readTemplateFromFile("email_article_template.txt");
$tpl->setVariable('USER_NAME', $_SESSION["name"], true);
//$tpl->setVariable('USER_EMAIL', $user_email, true);