Add Miniflux namespace everywhere

This commit is contained in:
Frederic Guillot 2016-08-24 21:17:58 -04:00
parent dac1dc21e0
commit 506503bbcd
No known key found for this signature in database
GPG Key ID: 92D77191BA7FBC99
72 changed files with 326 additions and 250 deletions

View File

@ -13,10 +13,10 @@ require __DIR__.'/functions.php';
PicoDb\Database::setInstance('db', function() {
$db = new PicoDb\Database(array(
'driver' => 'sqlite',
'filename' => Model\Database\get_path(),
'filename' => Miniflux\Model\Database\get_path(),
));
if ($db->schema()->check(Schema\VERSION)) {
if ($db->schema('\Miniflux\Schema')->check(Miniflux\Schema\VERSION)) {
return $db;
}
else {

View File

@ -1,6 +1,6 @@
<?php
defined('APP_VERSION') or define('APP_VERSION', Helper\parse_app_version('$Format:%d$','$Format:%H$'));
defined('APP_VERSION') or define('APP_VERSION', Miniflux\Helper\parse_app_version('$Format:%d$','$Format:%H$'));
defined('HTTP_TIMEOUT') or define('HTTP_TIMEOUT', 20);
defined('HTTP_MAX_RESPONSE_SIZE') or define('HTTP_MAX_RESPONSE_SIZE', 2097152);

View File

@ -2,6 +2,12 @@
use PicoFeed\Syndication\AtomFeedBuilder;
use PicoFeed\Syndication\AtomItemBuilder;
use Miniflux\Router;
use Miniflux\Response;
use Miniflux\Request;
use Miniflux\Template;
use Miniflux\Helper;
use Miniflux\Model;
// Ajax call to add or remove a bookmark
Router\post_action('bookmark', function () {

View File

@ -1,5 +1,15 @@
<?php
use Miniflux\Router;
use Miniflux\Response;
use Miniflux\Request;
use Miniflux\Session;
use Miniflux\Template;
use Miniflux\Helper;
use Miniflux\Model;
use Miniflux\Translator;
use Miniflux\Handler;
// Called before each action
Router\before(function ($action) {
Session\open(BASE_URL_DIRECTORY, SESSION_SAVE_PATH, 0);

View File

@ -2,6 +2,13 @@
use PicoDb\Database;
use Miniflux\Validator;
use Miniflux\Router;
use Miniflux\Response;
use Miniflux\Request;
use Miniflux\Session;
use Miniflux\Template;
use Miniflux\Helper;
use Miniflux\Model;
// Display a form to add a new database
Router\get_action('new-db', function () {
@ -196,7 +203,7 @@ Router\get_action('database', function () {
Response\html(Template\layout('database', array(
'csrf' => Helper\generate_csrf(),
'config' => Model\Config\get_all(),
'db_size' => filesize(\Model\Database\get_path()),
'db_size' => filesize(Model\Database\get_path()),
'nb_unread_items' => Model\Item\count_by_status('unread'),
'menu' => 'config',
'title' => t('Preferences')

View File

@ -1,5 +1,10 @@
<?php
use Miniflux\Router;
use Miniflux\Response;
use Miniflux\Template;
use Miniflux\Model;
// Flush console messages
Router\get_action('flush-console', function () {
@unlink(DEBUG_FILENAME);

View File

@ -2,6 +2,14 @@
use PicoFeed\Parser\MalformedXmlException;
use Miniflux\Validator;
use Miniflux\Router;
use Miniflux\Response;
use Miniflux\Request;
use Miniflux\Session;
use Miniflux\Template;
use Miniflux\Helper;
use Miniflux\Handler;
use Miniflux\Model;
// Refresh all feeds, used when Javascript is disabled
Router\get_action('refresh-all', function () {

View File

@ -1,5 +1,12 @@
<?php
use Miniflux\Router;
use Miniflux\Response;
use Miniflux\Request;
use Miniflux\Template;
use Miniflux\Helper;
use Miniflux\Model;
// Display history page
Router\get_action('history', function () {
$order = Request\param('order', 'updated');

View File

@ -1,5 +1,13 @@
<?php
use Miniflux\Router;
use Miniflux\Response;
use Miniflux\Request;
use Miniflux\Template;
use Miniflux\Helper;
use Miniflux\Handler;
use Miniflux\Model;
// Display unread items
Router\get_action('unread', function () {
Model\Item\autoflush_read();

View File

@ -1,5 +1,12 @@
<?php
use Miniflux\Router;
use Miniflux\Response;
use Miniflux\Request;
use Miniflux\Template;
use Miniflux\Helper;
use Miniflux\Model;
// Display search results page
Router\get_action('search', function() {

View File

@ -1,6 +1,12 @@
<?php
use Miniflux\Validator;
use Miniflux\Router;
use Miniflux\Response;
use Miniflux\Request;
use Miniflux\Template;
use Miniflux\Helper;
use Miniflux\Model;
// Logout and destroy session
Router\get_action('logout', function () {

View File

@ -1,6 +1,6 @@
<?php
namespace Request;
namespace Miniflux\Request;
function get_server_variable($variable)
{

View File

@ -1,6 +1,6 @@
<?php
namespace Response;
namespace Miniflux\Response;
function force_download($filename)
{

View File

@ -1,6 +1,6 @@
<?php
namespace Router;
namespace Miniflux\Router;
use Closure;

View File

@ -1,6 +1,6 @@
<?php
namespace Session;
namespace Miniflux\Session;
const SESSION_LIFETIME = 2678400;

View File

@ -1,6 +1,6 @@
<?php
namespace Template;
namespace Miniflux\Template;
const PATH = 'app/templates/';

View File

@ -1,6 +1,6 @@
<?php
namespace Translator;
namespace Miniflux\Translator;
use DirectoryIterator;

View File

@ -2,25 +2,25 @@
function tne()
{
return call_user_func_array('\Translator\translate_no_escaping', func_get_args());
return call_user_func_array('\Miniflux\Translator\translate_no_escaping', func_get_args());
}
function t()
{
return call_user_func_array('\Translator\translate', func_get_args());
return call_user_func_array('\Miniflux\Translator\translate', func_get_args());
}
function c()
{
return call_user_func_array('\Translator\currency', func_get_args());
return call_user_func_array('\Miniflux\Translator\currency', func_get_args());
}
function n()
{
return call_user_func_array('\Translator\number', func_get_args());
return call_user_func_array('\Miniflux\Translator\number', func_get_args());
}
function dt()
{
return call_user_func_array('\Translator\datetime', func_get_args());
return call_user_func_array('\Miniflux\Translator\datetime', func_get_args());
}

View File

@ -1,9 +1,9 @@
<?php
namespace Handler\Opml;
namespace Miniflux\Handler\Opml;
use Model\Feed;
use Model\Group;
use Miniflux\Model\Feed;
use Miniflux\Model\Group;
use PicoFeed\Serialization\Subscription;
use PicoFeed\Serialization\SubscriptionList;
use PicoFeed\Serialization\SubscriptionListBuilder;

View File

@ -1,9 +1,9 @@
<?php
namespace Handler\Proxy;
namespace Miniflux\Handler\Proxy;
use Helper;
use Model\Config;
use Miniflux\Helper;
use Miniflux\Model\Config;
use PicoFeed\Client\ClientException;
use PicoFeed\Config\Config as PicoFeedConfig;
use PicoFeed\Filter\Filter;

View File

@ -1,9 +1,9 @@
<?php
namespace Handler\Scraper;
namespace Miniflux\Handler\Scraper;
use PicoFeed\Scraper\Scraper;
use Model\Config;
use Miniflux\Model\Config;
function download_contents($url)
{

View File

@ -1,11 +1,11 @@
<?php
namespace Handler\Service;
namespace Miniflux\Handler\Service;
use PicoFeed\Client\Client;
use PicoFeed\Client\ClientException;
use Model\Config;
use Model\Item;
use Miniflux\Model\Config;
use Miniflux\Model\Item;
function sync($item_id)
{

View File

@ -1,6 +1,6 @@
<?php
namespace Helper;
namespace Miniflux\Helper;
function escape($value)
{

View File

@ -1,6 +1,6 @@
<?php
namespace Helper;
namespace Miniflux\Helper;
function generate_csrf()
{

View File

@ -1,6 +1,6 @@
<?php
namespace Helper;
namespace Miniflux\Helper;
function favicon_extension($type)
{

View File

@ -1,6 +1,6 @@
<?php
namespace Helper;
namespace Miniflux\Helper;
function error_class(array $errors, $name)
{

View File

@ -1,6 +1,8 @@
<?php
namespace Helper;
namespace Miniflux\Helper;
use Miniflux\Model\Config;
function flash($type, $html)
{
@ -21,7 +23,7 @@ function is_rtl(array $item)
function css()
{
$theme = \Model\Config\get('theme');
$theme = Config\get('theme');
if ($theme !== 'original') {
$css_file = THEME_DIRECTORY.'/'.$theme.'/css/app.css';

View File

@ -1,12 +1,12 @@
<?php
namespace Model\AutoUpdate;
namespace Miniflux\Model\AutoUpdate;
use ZipArchive;
use DirectoryIterator;
use RecursiveIteratorIterator;
use RecursiveDirectoryIterator;
use Model\Config;
use Miniflux\Model\Config;
// Get all files of a given directory
function get_files_list($directory)
@ -133,7 +133,7 @@ function cleanup_directory($directory)
$filename = $fileinfo->getRealPath();
if ($fileinfo->isFile()) {
\Model\Config\debug('[REMOVE] '.$filename);
Config\debug('[REMOVE] '.$filename);
@unlink($filename);
} else {
cleanup_directory($filename);

View File

@ -1,10 +1,10 @@
<?php
namespace Model\Bookmark;
namespace Miniflux\Model\Bookmark;
use PicoDb\Database;
use Handler\Service;
use Model\Config;
use Miniflux\Handler\Service;
use Miniflux\Model\Config;
function count_items($feed_ids = array())
{

View File

@ -1,9 +1,9 @@
<?php
namespace Model\Config;
namespace Miniflux\Model\Config;
use Helper;
use Translator;
use Miniflux\Helper;
use Miniflux\Translator;
use DirectoryIterator;
use PicoDb\Database;
use PicoFeed\Config\Config as ReaderConfig;

View File

@ -1,10 +1,10 @@
<?php
namespace Model\Database;
namespace Miniflux\Model\Database;
use Schema;
use DirectoryIterator;
use Model\Config;
use Miniflux\Schema;
use Miniflux\Model\Config;
// Create a new database for a new user
function create($filename, $username, $password)
@ -17,7 +17,7 @@ function create($filename, $username, $password)
'filename' => $filename,
));
if ($db->schema()->check(Schema\VERSION)) {
if ($db->schema('\Miniflux\Schema')->check(Schema\VERSION)) {
$credentials = array(
'username' => $username,
'password' => password_hash($password, PASSWORD_BCRYPT)

View File

@ -1,10 +1,10 @@
<?php
namespace Model\Favicon;
namespace Miniflux\Model\Favicon;
use Model\Config;
use Model\Group;
use Helper;
use Miniflux\Model\Config;
use Miniflux\Model\Group;
use Miniflux\Helper;
use PicoDb\Database;
use PicoFeed\Reader\Favicon;

View File

@ -1,17 +1,17 @@
<?php
namespace Model\Feed;
namespace Miniflux\Model\Feed;
use PicoFeed\Serialization\SubscriptionListParser;
use UnexpectedValueException;
use Model\Config;
use Model\Item;
use Model\Group;
use Model\Favicon;
use Helper;
use Miniflux\Model\Config;
use Miniflux\Model\Item;
use Miniflux\Model\Group;
use Miniflux\Model\Favicon;
use Miniflux\Helper;
use PicoDb\Database;
use PicoFeed\Reader\Reader;
use PicoFeed\PicoFeedException;
use PicoFeed\Serialization\SubscriptionListParser;
const LIMIT_ALL = -1;

View File

@ -1,6 +1,6 @@
<?php
namespace Model\Group;
namespace Miniflux\Model\Group;
use PicoDb\Database;

View File

@ -1,13 +1,13 @@
<?php
namespace Model\Item;
namespace Miniflux\Model\Item;
use PicoDb\Database;
use PicoFeed\Logging\Logger;
use Handler\Service;
use Model\Config;
use Model\Group;
use Handler;
use Miniflux\Handler\Service;
use Miniflux\Model\Config;
use Miniflux\Model\Group;
use Miniflux\Handler;
// Get all items without filtering
function get_all()

View File

@ -1,6 +1,6 @@
<?php
namespace Model\ItemFeed;
namespace Miniflux\Model\ItemFeed;
use PicoDb\Database;

View File

@ -1,9 +1,9 @@
<?php
namespace Model\ItemGroup;
namespace Miniflux\Model\ItemGroup;
use PicoDb\Database;
use Model\Group;
use Miniflux\Model\Group;
function mark_all_as_read($group_id)
{

View File

@ -1,11 +1,11 @@
<?php
namespace Model\RememberMe;
namespace Miniflux\Model\RememberMe;
use Helper;
use PicoDb\Database;
use Model\Config;
use Model\Database as DatabaseModel;
use Miniflux\Helper;
use Miniflux\Model\Config;
use Miniflux\Model\Database as DatabaseModel;
const TABLE = 'remember_me';
const COOKIE_NAME = '_R_';
@ -250,7 +250,7 @@ function write_cookie($token, $sequence, $expiration)
$expiration,
BASE_URL_DIRECTORY,
null,
\Helper\is_secure_connection(),
Helper\is_secure_connection(),
true
);
}
@ -283,7 +283,7 @@ function delete_cookie()
time() - 3600,
BASE_URL_DIRECTORY,
null,
\Helper\is_secure_connection(),
Helper\is_secure_connection(),
true
);
}

View File

@ -1,6 +1,6 @@
<?php
namespace Model\Search;
namespace Miniflux\Model\Search;
use PicoDb\Database;

View File

@ -1,13 +1,13 @@
<?php
namespace Model\User;
namespace Miniflux\Model\User;
use PicoDb\Database;
use Session;
use Request;
use Model\Config;
use Model\RememberMe;
use Model\Database as DatabaseModel;
use Miniflux\Session;
use Miniflux\Request;
use Miniflux\Model\Config;
use Miniflux\Model\RememberMe;
use Miniflux\Model\Database as DatabaseModel;
// Check if the user is logged in
function is_loggedin()

View File

@ -1,9 +1,9 @@
<?php
namespace Schema;
namespace Miniflux\Schema;
use PDO;
use Helper;
use Miniflux\Helper;
const VERSION = 44;
@ -64,8 +64,8 @@ function version_41(PDO $pdo)
CREATE TABLE "feeds_groups" (
feed_id INTEGER NOT NULL,
group_id INTEGER NOT NULL,
PRIMARY KEY(feed_id, group_id)
FOREIGN KEY(group_id) REFERENCES groups(id) ON DELETE CASCADE
PRIMARY KEY(feed_id, group_id),
FOREIGN KEY(group_id) REFERENCES groups(id) ON DELETE CASCADE,
FOREIGN KEY(feed_id) REFERENCES feeds(id) ON DELETE CASCADE
)
');

View File

@ -16,14 +16,14 @@
<h3><?= t('Bookmarks') ?></h3>
<ul>
<li>
<a href="<?= Helper\get_current_base_url(), '?action=bookmark-feed&amp;database=', urlencode($db_name), '&amp;token=', urlencode($config['feed_token']) ?>" target="_blank"><?= t('Bookmark RSS Feed') ?></a>
<a href="<?= Miniflux\Helper\get_current_base_url(), '?action=bookmark-feed&amp;database=', urlencode($db_name), '&amp;token=', urlencode($config['feed_token']) ?>" target="_blank"><?= t('Bookmark RSS Feed') ?></a>
</li>
</ul>
</div>
<div class="panel panel-default">
<h3><?= t('Bookmarklet') ?></h3>
<a class="bookmarklet" href="javascript:location.href='<?= Helper\get_current_base_url() ?>?action=subscribe&amp;token=<?= urlencode($config['bookmarklet_token']) ?>&amp;url='+encodeURIComponent(location.href)"><?= t('Subscribe with Miniflux') ?></a> (<?= t('Drag and drop this link to your bookmarks') ?>)
<input type="text" class="auto-select" readonly="readonly" value="javascript:location.href='<?= Helper\get_current_base_url() ?>?action=subscribe&amp;token=<?= urlencode($config['bookmarklet_token']) ?>&amp;url='+encodeURIComponent(location.href)"/>
<a class="bookmarklet" href="javascript:location.href='<?= Miniflux\Helper\get_current_base_url() ?>?action=subscribe&amp;token=<?= urlencode($config['bookmarklet_token']) ?>&amp;url='+encodeURIComponent(location.href)"><?= t('Subscribe with Miniflux') ?></a> (<?= t('Drag and drop this link to your bookmarks') ?>)
<input type="text" class="auto-select" readonly="readonly" value="javascript:location.href='<?= Miniflux\Helper\get_current_base_url() ?>?action=subscribe&amp;token=<?= urlencode($config['bookmarklet_token']) ?>&amp;url='+encodeURIComponent(location.href)"/>
</div>
<div class="panel panel-default">
<h3><?= t('About') ?></h3>

View File

@ -12,24 +12,24 @@
<form method="post" action="?action=subscribe" autocomplete="off">
<?= Helper\form_hidden('csrf', $values) ?>
<?= Miniflux\Helper\form_hidden('csrf', $values) ?>
<?= Helper\form_label(t('Website or Feed URL'), 'url') ?>
<?= Helper\form_text('url', $values, array(), array('required', 'autofocus', 'placeholder="'.t('http://website/').'"')) ?><br/><br/>
<?= Miniflux\Helper\form_label(t('Website or Feed URL'), 'url') ?>
<?= Miniflux\Helper\form_text('url', $values, array(), array('required', 'autofocus', 'placeholder="'.t('http://website/').'"')) ?><br/><br/>
<?= Helper\form_checkbox('rtl', t('Force RTL mode (Right-to-left language)'), 1, $values['rtl']) ?><br/>
<?= Helper\form_checkbox('download_content', t('Download full content'), 1, $values['download_content']) ?><br/>
<?= Helper\form_checkbox('cloak_referrer', t('Cloak the image referrer'), 1, $values['cloak_referrer']) ?><br />
<?= Miniflux\Helper\form_checkbox('rtl', t('Force RTL mode (Right-to-left language)'), 1, $values['rtl']) ?><br/>
<?= Miniflux\Helper\form_checkbox('download_content', t('Download full content'), 1, $values['download_content']) ?><br/>
<?= Miniflux\Helper\form_checkbox('cloak_referrer', t('Cloak the image referrer'), 1, $values['cloak_referrer']) ?><br />
<p class="form-help"><?= t('Downloading full content is slower because Miniflux grab the content from the original website. You should use that for subscriptions that display only a summary. This feature doesn\'t work with all websites.') ?></p>
<?= Helper\form_label(t('Groups'), 'groups'); ?>
<?= Miniflux\Helper\form_label(t('Groups'), 'groups'); ?>
<div id="grouplist">
<?php foreach ($groups as $group): ?>
<?= Helper\form_checkbox('feed_group_ids[]', $group['title'], $group['id'], in_array($group['id'], $values['feed_group_ids']), 'hide') ?>
<?= Miniflux\Helper\form_checkbox('feed_group_ids[]', $group['title'], $group['id'], in_array($group['id'], $values['feed_group_ids']), 'hide') ?>
<?php endforeach ?>
<?= Helper\form_text('create_group', $values, array(), array('placeholder="'.t('add a new group').'"')) ?>
<?= Miniflux\Helper\form_text('create_group', $values, array(), array('placeholder="'.t('add a new group').'"')) ?>
</div>
<div class="form-actions">

View File

@ -15,17 +15,17 @@
<div class="panel panel-default">
<h3 id="fever"><?= t('Fever API') ?></h3>
<ul>
<li><?= t('API endpoint:') ?> <strong><?= Helper\get_current_base_url(), 'fever/' ?></strong></li>
<li><?= t('API username:') ?> <strong><?= Helper\escape($config['username']) ?></strong></li>
<li><?= t('API token:') ?> <strong><?= Helper\escape($config['fever_token']) ?></strong></li>
<li><?= t('API endpoint:') ?> <strong><?= Miniflux\Helper\get_current_base_url(), 'fever/' ?></strong></li>
<li><?= t('API username:') ?> <strong><?= Miniflux\Helper\escape($config['username']) ?></strong></li>
<li><?= t('API token:') ?> <strong><?= Miniflux\Helper\escape($config['fever_token']) ?></strong></li>
</ul>
</div>
<div class="panel panel-default">
<h3 id="api"><?= t('Miniflux API') ?></h3>
<ul>
<li><?= t('API endpoint:') ?> <strong><?= Helper\get_current_base_url(), 'jsonrpc.php' ?></strong></li>
<li><?= t('API username:') ?> <strong><?= Helper\escape($config['username']) ?></strong></li>
<li><?= t('API token:') ?> <strong><?= Helper\escape($config['api_token']) ?></strong></li>
<li><?= t('API endpoint:') ?> <strong><?= Miniflux\Helper\get_current_base_url(), 'jsonrpc.php' ?></strong></li>
<li><?= t('API username:') ?> <strong><?= Miniflux\Helper\escape($config['username']) ?></strong></li>
<li><?= t('API token:') ?> <strong><?= Miniflux\Helper\escape($config['api_token']) ?></strong></li>
</ul>
</div>
</section>

View File

@ -1,7 +1,7 @@
<?php if (empty($items) && $group_id === null): ?>
<p class="alert alert-info"><?= t('No bookmark') ?></p>
<?php else: ?>
<?= \Template\load('search_form') ?>
<?= Miniflux\Template\load('search_form') ?>
<div class="page-header">
<h2><?= t('Bookmarks') ?><span id="page-counter"><?= isset($nb_items) ? $nb_items : '' ?></span></h2>
<?php if (!empty($groups)): ?>
@ -24,7 +24,7 @@
<section class="items" id="listing">
<?php foreach ($items as $item): ?>
<?= \Template\load('item', array(
<?= Miniflux\Template\load('item', array(
'item' => $item,
'menu' => $menu,
'offset' => $offset,
@ -36,7 +36,6 @@
)) ?>
<?php endforeach ?>
<?= \Template\load('paging', array('menu' => $menu, 'nb_items' => $nb_items, 'items_per_page' => $items_per_page, 'offset' => $offset, 'order' => $order, 'direction' => $direction, 'group_id' => $group_id)) ?>
<?= Miniflux\Template\load('paging', array('menu' => $menu, 'nb_items' => $nb_items, 'items_per_page' => $items_per_page, 'offset' => $offset, 'order' => $order, 'direction' => $direction, 'group_id' => $group_id)) ?>
</section>
<?php endif ?>

View File

@ -16,68 +16,68 @@
<h3><?= t('Authentication') ?></h3>
<div class="options">
<?= Helper\form_hidden('csrf', $values) ?>
<?= Helper\form_label(t('Username'), 'username') ?>
<?= Helper\form_text('username', $values, $errors, array('required')) ?><br/>
<?= Miniflux\Helper\form_hidden('csrf', $values) ?>
<?= Miniflux\Helper\form_label(t('Username'), 'username') ?>
<?= Miniflux\Helper\form_text('username', $values, $errors, array('required')) ?><br/>
<?= Helper\form_label(t('Password'), 'password') ?>
<?= Helper\form_password('password', $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('Password'), 'password') ?>
<?= Miniflux\Helper\form_password('password', $values, $errors) ?><br/>
<?= Helper\form_label(t('Confirmation'), 'confirmation') ?>
<?= Helper\form_password('confirmation', $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('Confirmation'), 'confirmation') ?>
<?= Miniflux\Helper\form_password('confirmation', $values, $errors) ?><br/>
</div>
<h3><?= t('Application') ?></h3>
<div class="options">
<?= Helper\form_label(t('Timezone'), 'timezone') ?>
<?= Helper\form_select('timezone', $timezones, $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('Timezone'), 'timezone') ?>
<?= Miniflux\Helper\form_select('timezone', $timezones, $values, $errors) ?><br/>
<?= Helper\form_label(t('Language'), 'language') ?>
<?= Helper\form_select('language', $languages, $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('Language'), 'language') ?>
<?= Miniflux\Helper\form_select('language', $languages, $values, $errors) ?><br/>
<?= Helper\form_label(t('Theme'), 'theme') ?>
<?= Helper\form_select('theme', $theme_options, $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('Theme'), 'theme') ?>
<?= Miniflux\Helper\form_select('theme', $theme_options, $values, $errors) ?><br/>
<?php if (ENABLE_AUTO_UPDATE): ?>
<?= Helper\form_label(t('Auto-Update URL'), 'auto_update_url') ?>
<?= Helper\form_text('auto_update_url', $values, $errors, array('required')) ?><br/>
<?= Miniflux\Helper\form_label(t('Auto-Update URL'), 'auto_update_url') ?>
<?= Miniflux\Helper\form_text('auto_update_url', $values, $errors, array('required')) ?><br/>
<?php endif ?>
<?= Helper\form_checkbox('debug_mode', t('Enable debug mode'), 1, isset($values['debug_mode']) && $values['debug_mode'] == 1) ?><br/>
<?= Miniflux\Helper\form_checkbox('debug_mode', t('Enable debug mode'), 1, isset($values['debug_mode']) && $values['debug_mode'] == 1) ?><br/>
<?= Helper\form_checkbox('image_proxy', t('Enable image proxy'), 1, isset($values['image_proxy']) && $values['image_proxy'] == 1) ?>
<?= Miniflux\Helper\form_checkbox('image_proxy', t('Enable image proxy'), 1, isset($values['image_proxy']) && $values['image_proxy'] == 1) ?>
<div class="form-help"><?= t('Avoid mixed content warnings with HTTPS') ?></div>
</div>
<h3><?= t('Reading') ?></h3>
<div class="options">
<?= Helper\form_label(t('Remove automatically read items'), 'autoflush') ?>
<?= Helper\form_select('autoflush', $autoflush_read_options, $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('Remove automatically read items'), 'autoflush') ?>
<?= Miniflux\Helper\form_select('autoflush', $autoflush_read_options, $values, $errors) ?><br/>
<?= Helper\form_label(t('Remove automatically unread items'), 'autoflush_unread') ?>
<?= Helper\form_select('autoflush_unread', $autoflush_unread_options, $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('Remove automatically unread items'), 'autoflush_unread') ?>
<?= Miniflux\Helper\form_select('autoflush_unread', $autoflush_unread_options, $values, $errors) ?><br/>
<?= Helper\form_label(t('Items per page'), 'items_per_page') ?>
<?= Helper\form_select('items_per_page', $paging_options, $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('Items per page'), 'items_per_page') ?>
<?= Miniflux\Helper\form_select('items_per_page', $paging_options, $values, $errors) ?><br/>
<?= Helper\form_label(t('Default sorting order for items'), 'items_sorting_direction') ?>
<?= Helper\form_select('items_sorting_direction', $sorting_options, $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('Default sorting order for items'), 'items_sorting_direction') ?>
<?= Miniflux\Helper\form_select('items_sorting_direction', $sorting_options, $values, $errors) ?><br/>
<?= Helper\form_label(t('Display items on lists'), 'items_display_mode') ?>
<?= Helper\form_select('items_display_mode', $display_mode, $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('Display items on lists'), 'items_display_mode') ?>
<?= Miniflux\Helper\form_select('items_display_mode', $display_mode, $values, $errors) ?><br/>
<?= Helper\form_label(t('Item title links to'), 'item_title_link') ?>
<?= Helper\form_select('item_title_link', $item_title_link, $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('Item title links to'), 'item_title_link') ?>
<?= Miniflux\Helper\form_select('item_title_link', $item_title_link, $values, $errors) ?><br/>
<?= Helper\form_label(t('When there is nothing to read, redirect me to this page'), 'redirect_nothing_to_read') ?>
<?= Helper\form_select('redirect_nothing_to_read', $redirect_nothing_to_read_options, $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('When there is nothing to read, redirect me to this page'), 'redirect_nothing_to_read') ?>
<?= Miniflux\Helper\form_select('redirect_nothing_to_read', $redirect_nothing_to_read_options, $values, $errors) ?><br/>
<?= Helper\form_label(t('Refresh interval in minutes for unread counter'), 'frontend_updatecheck_interval') ?>
<?= Helper\form_number('frontend_updatecheck_interval', $values, $errors, array('min="0"')) ?><br/>
<?= Miniflux\Helper\form_label(t('Refresh interval in minutes for unread counter'), 'frontend_updatecheck_interval') ?>
<?= Miniflux\Helper\form_number('frontend_updatecheck_interval', $values, $errors, array('min="0"')) ?><br/>
<?= Helper\form_checkbox('original_marks_read', t('Original link marks article as read'), 1, isset($values['original_marks_read']) && $values['original_marks_read'] == 1) ?><br/>
<?= Helper\form_checkbox('nocontent', t('Do not fetch the content of articles'), 1, isset($values['nocontent']) && $values['nocontent'] == 1) ?><br/>
<?= Helper\form_checkbox('favicons', t('Download favicons'), 1, isset($values['favicons']) && $values['favicons'] == 1) ?><br/>
<?= Miniflux\Helper\form_checkbox('original_marks_read', t('Original link marks article as read'), 1, isset($values['original_marks_read']) && $values['original_marks_read'] == 1) ?><br/>
<?= Miniflux\Helper\form_checkbox('nocontent', t('Do not fetch the content of articles'), 1, isset($values['nocontent']) && $values['nocontent'] == 1) ?><br/>
<?= Miniflux\Helper\form_checkbox('favicons', t('Download favicons'), 1, isset($values['favicons']) && $values['favicons'] == 1) ?><br/>
</div>
<div class="form-actions">

View File

@ -2,7 +2,7 @@
<h2><?= t('Confirmation') ?></h2>
</div>
<p class="alert alert-info"><?= t('Do you really want to remove this subscription: "%s"?', Helper\escape($feed['title'])) ?></p>
<p class="alert alert-info"><?= t('Do you really want to remove this subscription: "%s"?', Miniflux\Helper\escape($feed['title'])) ?></p>
<div class="form-actions">
<a href="?action=remove-feed&amp;feed_id=<?= $feed['id'] ?>" class="btn btn-red"><?= t('Remove') ?></a>

View File

@ -9,5 +9,5 @@
<?php if (empty($content)): ?>
<p class="alert alert-info"><?= t('Nothing to show. Enable the debug mode to see log messages.') ?></p>
<?php else: ?>
<pre id="console"><code><?= Helper\escape($content) ?></code></pre>
<pre id="console"><code><?= Miniflux\Helper\escape($content) ?></code></pre>
<?php endif ?>

View File

@ -14,7 +14,7 @@
<section>
<div class="panel panel-default">
<ul>
<li><?= t('Database size:') ?> <strong><?= Helper\format_bytes($db_size) ?></strong></li>
<li><?= t('Database size:') ?> <strong><?= Miniflux\Helper\format_bytes($db_size) ?></strong></li>
<li><a href="?action=optimize-db&amp;csrf=<?= $csrf ?>"><?= t('Optimize the database') ?></a> <?= t('(VACUUM command)') ?></li>
<li><a href="?action=download-db&amp;csrf=<?= $csrf ?>"><?= t('Download the entire database') ?></a> <?= t('(Gzip compressed Sqlite file)') ?></li>
<?php if (ENABLE_MULTIPLE_DB): ?>

View File

@ -10,32 +10,32 @@
<form method="post" action="?action=edit-feed" autocomplete="off">
<?= Helper\form_hidden('id', $values) ?>
<?= Miniflux\Helper\form_hidden('id', $values) ?>
<?= Helper\form_label(t('Title'), 'title') ?>
<?= Helper\form_text('title', $values, $errors, array('required')) ?>
<?= Miniflux\Helper\form_label(t('Title'), 'title') ?>
<?= Miniflux\Helper\form_text('title', $values, $errors, array('required')) ?>
<?= Helper\form_label(t('Website URL'), 'site_url') ?>
<?= Helper\form_text('site_url', $values, $errors, array('required', 'placeholder="http://..."')) ?>
<?= Miniflux\Helper\form_label(t('Website URL'), 'site_url') ?>
<?= Miniflux\Helper\form_text('site_url', $values, $errors, array('required', 'placeholder="http://..."')) ?>
<?= Helper\form_label(t('Feed URL'), 'feed_url') ?>
<?= Helper\form_text('feed_url', $values, $errors, array('required', 'placeholder="http://..."')) ?>
<?= Miniflux\Helper\form_label(t('Feed URL'), 'feed_url') ?>
<?= Miniflux\Helper\form_text('feed_url', $values, $errors, array('required', 'placeholder="http://..."')) ?>
<?= Helper\form_checkbox('rtl', t('Force RTL mode (Right-to-left language)'), 1, $values['rtl']) ?><br />
<?= Miniflux\Helper\form_checkbox('rtl', t('Force RTL mode (Right-to-left language)'), 1, $values['rtl']) ?><br />
<?= Helper\form_checkbox('download_content', t('Download full content'), 1, $values['download_content']) ?><br />
<?= Miniflux\Helper\form_checkbox('download_content', t('Download full content'), 1, $values['download_content']) ?><br />
<?= Helper\form_checkbox('cloak_referrer', t('Cloak the image referrer'), 1, $values['cloak_referrer']) ?><br />
<?= Miniflux\Helper\form_checkbox('cloak_referrer', t('Cloak the image referrer'), 1, $values['cloak_referrer']) ?><br />
<?= Helper\form_checkbox('enabled', t('Activated'), 1, $values['enabled']) ?><br />
<?= Miniflux\Helper\form_checkbox('enabled', t('Activated'), 1, $values['enabled']) ?><br />
<?= Helper\form_label(t('Groups'), 'groups'); ?>
<?= Miniflux\Helper\form_label(t('Groups'), 'groups'); ?>
<div id="grouplist">
<?php foreach ($groups as $group): ?>
<?= Helper\form_checkbox('feed_group_ids[]', $group['title'], $group['id'], in_array($group['id'], $values['feed_group_ids']), 'hide') ?>
<?= Miniflux\Helper\form_checkbox('feed_group_ids[]', $group['title'], $group['id'], in_array($group['id'], $values['feed_group_ids']), 'hide') ?>
<?php endforeach ?>
<?= Helper\form_text('create_group', $values, array(), array('placeholder="'.t('add a new group').'"')) ?>
<?= Miniflux\Helper\form_text('create_group', $values, array(), array('placeholder="'.t('add a new group').'"')) ?>
</div>
<div class="form-actions">

View File

@ -5,7 +5,7 @@
<?php else: ?>
<div class="page-header">
<h2><?= Helper\escape($feed['title']) ?>&lrm;<span id="page-counter"><?= isset($nb_items) ? $nb_items : '' ?></span></h2>
<h2><?= Miniflux\Helper\escape($feed['title']) ?>&lrm;<span id="page-counter"><?= isset($nb_items) ? $nb_items : '' ?></span></h2>
<ul>
<li>
<a href="?action=refresh-feed&amp;feed_id=<?= $feed['id'] ?>&amp;redirect=feed-items"><?= t('refresh') ?></a>
@ -30,7 +30,7 @@
<section class="items" id="listing" data-feed-id="<?= $feed['id'] ?>">
<?php foreach ($items as $item): ?>
<?= \Template\load('item', array(
<?= Miniflux\Template\load('item', array(
'feed' => $feed,
'item' => $item,
'menu' => $menu,
@ -47,7 +47,7 @@
<a href="?action=mark-feed-as-read&amp;feed_id=<?= $feed['id'] ?>" data-action="mark-feed-read"><?= t('mark all as read') ?></a>
</div>
<?= \Template\load('paging', array('menu' => $menu, 'nb_items' => $nb_items, 'items_per_page' => $items_per_page, 'offset' => $offset, 'order' => $order, 'direction' => $direction, 'feed_id' => $feed['id'])) ?>
<?= Miniflux\Template\load('paging', array('menu' => $menu, 'nb_items' => $nb_items, 'items_per_page' => $items_per_page, 'offset' => $offset, 'order' => $order, 'direction' => $direction, 'feed_id' => $feed['id'])) ?>
</section>
<?php endif ?>

View File

@ -31,9 +31,9 @@
<span title="<?= t('Subscription disabled') ?>"></span>
<?php endif ?>
<?= Helper\favicon($favicons, $feed['id']) ?>
<?= Miniflux\Helper\favicon($favicons, $feed['id']) ?>
<a href="?action=feed-items&amp;feed_id=<?= $feed['id'] ?>" title="<?= t('Show only this subscription') ?>"><?= Helper\escape($feed['title']) ?></a>
<a href="?action=feed-items&amp;feed_id=<?= $feed['id'] ?>" title="<?= t('Show only this subscription') ?>"><?= Miniflux\Helper\escape($feed['title']) ?></a>
&lrm;<span class="items-count"><?= $feed['items_unread'], '/', $feed['items_total'] ?></span>
<?php if ($feed['enabled']): ?>
@ -58,7 +58,7 @@
</h2>
<ul class="item-menu">
<li>
<a href="<?= $feed['site_url'] ?>" rel="noreferrer" target="_blank"><?= Helper\get_host_from_url($feed['site_url']) ?></a>
<a href="<?= $feed['site_url'] ?>" rel="noreferrer" target="_blank"><?= Miniflux\Helper\get_host_from_url($feed['site_url']) ?></a>
</li>
<?php if ($feed['enabled']): ?>

View File

@ -12,7 +12,7 @@
</nav>
</div>
<section>
<?= \Template\load('keyboard_shortcuts') ?>
<?= Miniflux\Template\load('keyboard_shortcuts') ?>
</section>
<div class="page-section">
<h2><?= t('Documentation') ?></h2>

View File

@ -1,6 +1,6 @@
<div id="help-layer" class="hide">
<span class="btn-close" data-action="close-help">&times;</span>
<section>
<?= \Template\load('keyboard_shortcuts') ?>
<?= Miniflux\Template\load('keyboard_shortcuts') ?>
</section>
</div>

View File

@ -1,7 +1,7 @@
<?php if (empty($items)): ?>
<p class="alert alert-info"><?= t('No history') ?></p>
<?php else: ?>
<?= \Template\load('search_form') ?>
<?= Miniflux\Template\load('search_form') ?>
<div class="page-header">
<h2><?= t('History') ?><span id="page-counter"><?= isset($nb_items) ? $nb_items : '' ?></span></h2>
<?php if (!empty($groups)): ?>
@ -30,7 +30,7 @@
<section class="items" id="listing">
<?php foreach ($items as $item): ?>
<?= \Template\load('item', array(
<?= Miniflux\Template\load('item', array(
'item' => $item,
'menu' => $menu,
'offset' => $offset,
@ -42,7 +42,7 @@
)) ?>
<?php endforeach ?>
<?= \Template\load('paging', array('menu' => $menu, 'nb_items' => $nb_items, 'items_per_page' => $items_per_page, 'offset' => $offset, 'order' => $order, 'direction' => $direction, 'group_id' => $group_id)) ?>
<?= Miniflux\Template\load('paging', array('menu' => $menu, 'nb_items' => $nb_items, 'items_per_page' => $items_per_page, 'offset' => $offset, 'order' => $order, 'direction' => $direction, 'group_id' => $group_id)) ?>
</section>
<?php endif ?>

View File

@ -6,7 +6,7 @@
data-item-bookmark="<?= $item['bookmark'] ?>"
<?= $hide ? 'data-hide="true"' : '' ?>
>
<h2 <?= Helper\is_rtl($item) ? 'dir="rtl"' : 'dir="ltr"' ?>>
<h2 <?= Miniflux\Helper\is_rtl($item) ? 'dir="rtl"' : 'dir="ltr"' ?>>
<span class="item-icons">
<a
class="bookmark-icon"
@ -24,19 +24,19 @@
></a>
</span>
<span class="item-title">
<?= Helper\favicon($favicons, $item['feed_id']) ?>
<?= Miniflux\Helper\favicon($favicons, $item['feed_id']) ?>
<?php if ($display_mode === 'full' || $item_title_link == 'original'): ?>
<a class="original" rel="noreferrer" target="_blank"
href="<?= $item['url'] ?>"
<?= ($original_marks_read) ? 'data-action="mark-read"' : '' ?>
title="<?= Helper\escape($item['title']) ?>"
><?= Helper\escape($item['title']) ?></a>
title="<?= Miniflux\Helper\escape($item['title']) ?>"
><?= Miniflux\Helper\escape($item['title']) ?></a>
<?php else: ?>
<a
href="?action=show&amp;menu=<?= $menu ?><?= isset($group_id) ? '&amp;group_id='.$group_id : '' ?>&amp;id=<?= $item['id'] ?>"
class="show"
title="<?= Helper\escape($item['title']) ?>"
><?= Helper\escape($item['title']) ?></a>
title="<?= Miniflux\Helper\escape($item['title']) ?>"
><?= Miniflux\Helper\escape($item['title']) ?></a>
<?php endif ?>
</span>
</h2>
@ -44,19 +44,19 @@
<?php if ($menu !== 'feed-items'): ?>
<li>
<?php if (! isset($item['feed_title'])): ?>
<?= Helper\get_host_from_url($item['url']) ?>
<?= Miniflux\Helper\get_host_from_url($item['url']) ?>
<?php else: ?>
<a href="?action=feed-items&amp;feed_id=<?= $item['feed_id'] ?>" title="<?= t('Show only this subscription') ?>"><?= Helper\escape($item['feed_title']) ?></a>
<a href="?action=feed-items&amp;feed_id=<?= $item['feed_id'] ?>" title="<?= t('Show only this subscription') ?>"><?= Miniflux\Helper\escape($item['feed_title']) ?></a>
<?php endif ?>
</li>
<?php endif ?>
<?php if (!empty($item['author'])): ?>
<li>
<?= Helper\escape($item['author']) ?>
<?= Miniflux\Helper\escape($item['author']) ?>
</li>
<?php endif ?>
<li class="hide-mobile">
<span title="<?= dt('%e %B %Y %k:%M', $item['updated']) ?>"><?= Helper\relative_time($item['updated']) ?></span>
<span title="<?= dt('%e %B %Y %k:%M', $item['updated']) ?>"><?= Miniflux\Helper\relative_time($item['updated']) ?></span>
</li>
<?php if ($display_mode === 'full' || $item_title_link == 'original'): ?>
<li>
@ -83,12 +83,12 @@
<?php endif ?>
</li>
<?php endif ?>
<?= \Template\load('bookmark_links', array('item' => $item, 'menu' => $menu, 'offset' => $offset)) ?>
<?= \Template\load('status_links', array('item' => $item, 'menu' => $menu, 'offset' => $offset)) ?>
<?= Miniflux\Template\load('bookmark_links', array('item' => $item, 'menu' => $menu, 'offset' => $offset)) ?>
<?= Miniflux\Template\load('status_links', array('item' => $item, 'menu' => $menu, 'offset' => $offset)) ?>
</ul>
<?php if ($display_mode === 'full'): ?>
<div class="preview-full-content" <?= Helper\is_rtl($item) ? 'dir="rtl"' : 'dir="ltr"' ?>><?= $item['content'] ?></div>
<div class="preview-full-content" <?= Miniflux\Helper\is_rtl($item) ? 'dir="rtl"' : 'dir="ltr"' ?>><?= $item['content'] ?></div>
<?php else: ?>
<p class="preview" <?= Helper\is_rtl($item) ? 'dir="rtl"' : 'dir="ltr"' ?>><?= Helper\escape(Helper\summary(strip_tags($item['content']), 50, 300)) ?></p>
<p class="preview" <?= Miniflux\Helper\is_rtl($item) ? 'dir="rtl"' : 'dir="ltr"' ?>><?= Miniflux\Helper\escape(Miniflux\Helper\summary(strip_tags($item['content']), 50, 300)) ?></p>
<?php endif ?>
</article>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html
<?php if (Model\Config\is_language_rtl()): ?>
<?php if (Miniflux\Model\Config\is_language_rtl()): ?>
dir="rtl"
<?php endif ?>
>
@ -12,7 +12,7 @@
<meta name="referrer" content="no-referrer">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title><?= isset($title) ? Helper\escape($title) : t('Miniflux') ?></title>
<title><?= isset($title) ? Miniflux\Helper\escape($title) : t('Miniflux') ?></title>
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<link rel="shortcut icon" href="favicon.ico">
@ -21,7 +21,7 @@
<link rel="apple-touch-icon" sizes="114x114" href="assets/img/touch-icon-iphone-retina.png">
<link rel="apple-touch-icon" sizes="144x144" href="assets/img/touch-icon-ipad-retina.png">
<link href="<?= Helper\css() ?>" rel="stylesheet" media="screen">
<link href="<?= Miniflux\Helper\css() ?>" rel="stylesheet" media="screen">
<script type="text/javascript" src="assets/js/all.js?<?= filemtime('assets/js/all.js') ?>" defer></script>
</head>
<body>
@ -54,10 +54,10 @@
</nav>
</header>
<section class="page" data-item-page="<?= $menu ?>">
<?= Helper\flash('flash_message', '<div class="alert alert-success">%s</div>') ?>
<?= Helper\flash('flash_error_message', '<div class="alert alert-error">%s</div>') ?>
<?= Miniflux\Helper\flash('flash_message', '<div class="alert alert-success">%s</div>') ?>
<?= Miniflux\Helper\flash('flash_error_message', '<div class="alert alert-error">%s</div>') ?>
<?= $content_for_layout ?>
</section>
<?= \Template\load('help_layer') ?>
<?= Miniflux\Template\load('help_layer') ?>
</body>
</html>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html
<?php if (Model\Config\is_language_rtl()): ?>
<?php if (Miniflux\Model\Config\is_language_rtl()): ?>
dir="rtl"
<?php endif ?>
>
@ -19,31 +19,31 @@
<link rel="apple-touch-icon" sizes="114x114" href="assets/img/touch-icon-iphone-retina.png">
<link rel="apple-touch-icon" sizes="144x144" href="assets/img/touch-icon-ipad-retina.png">
<title>Miniflux</title>
<link href="<?= Helper\css() ?>" rel="stylesheet" media="screen">
<link href="<?= Miniflux\Helper\css() ?>" rel="stylesheet" media="screen">
</head>
<body id="login-page">
<section class="page" id="login">
<?php if (isset($errors['login'])): ?>
<p class="alert alert-error"><?= Helper\escape($errors['login']) ?></p>
<p class="alert alert-error"><?= Miniflux\Helper\escape($errors['login']) ?></p>
<?php endif ?>
<form method="post" action="?action=login">
<?= Helper\form_hidden('csrf', $values) ?>
<?= Miniflux\Helper\form_hidden('csrf', $values) ?>
<?= Helper\form_label(t('Username'), 'username') ?>
<?= Helper\form_text('username', $values, $errors, array('autofocus', 'required')) ?><br/>
<?= Miniflux\Helper\form_label(t('Username'), 'username') ?>
<?= Miniflux\Helper\form_text('username', $values, $errors, array('autofocus', 'required')) ?><br/>
<?= Helper\form_label(t('Password'), 'password') ?>
<?= Helper\form_password('password', $values, $errors, array('required')) ?>
<?= Miniflux\Helper\form_label(t('Password'), 'password') ?>
<?= Miniflux\Helper\form_password('password', $values, $errors, array('required')) ?>
<?= Helper\form_checkbox('remember_me', t('Remember Me'), 1) ?><br/>
<?= Miniflux\Helper\form_checkbox('remember_me', t('Remember Me'), 1) ?><br/>
<?php if (ENABLE_MULTIPLE_DB && count($databases) > 1): ?>
<div id="database-selector">
<h4><?= t('Select another database') ?></h4>
<?php foreach ($databases as $filename => $dbname): ?>
<?= Helper\form_radio('database', $dbname, $filename, ($current_database === $filename)) ?>
<?= Miniflux\Helper\form_radio('database', $dbname, $filename, ($current_database === $filename)) ?>
<?php endforeach ?>
</div>
<?php endif ?>

View File

@ -14,20 +14,20 @@
<form method="post" action="?action=new-db" autocomplete="off">
<?= Helper\form_hidden('csrf', $values) ?>
<?= Miniflux\Helper\form_hidden('csrf', $values) ?>
<?= Helper\form_label(t('Database name'), 'name') ?>
<?= Helper\form_text('name', $values, $errors, array('required', 'autofocus')) ?>
<?= Miniflux\Helper\form_label(t('Database name'), 'name') ?>
<?= Miniflux\Helper\form_text('name', $values, $errors, array('required', 'autofocus')) ?>
<p class="form-help"><?= t('The name must have only alpha-numeric characters') ?></p>
<?= Helper\form_label(t('Username'), 'username') ?>
<?= Helper\form_text('username', $values, $errors, array('required')) ?><br/>
<?= Miniflux\Helper\form_label(t('Username'), 'username') ?>
<?= Miniflux\Helper\form_text('username', $values, $errors, array('required')) ?><br/>
<?= Helper\form_label(t('Password'), 'password') ?>
<?= Helper\form_password('password', $values, $errors, array('required')) ?>
<?= Miniflux\Helper\form_label(t('Password'), 'password') ?>
<?= Miniflux\Helper\form_password('password', $values, $errors, array('required')) ?>
<?= Helper\form_label(t('Confirmation'), 'confirmation') ?>
<?= Helper\form_password('confirmation', $values, $errors, array('required')) ?><br/>
<?= Miniflux\Helper\form_label(t('Confirmation'), 'confirmation') ?>
<?= Miniflux\Helper\form_password('confirmation', $values, $errors, array('required')) ?><br/>
<div class="form-actions">
<button type="submit" class="btn btn-blue"><?= t('Create') ?></button>

View File

@ -1,4 +1,4 @@
<?= \Template\load('search_form', array('text' => $text, 'opened' => true)) ?>
<?= Miniflux\Template\load('search_form', array('text' => $text, 'opened' => true)) ?>
<?php if (empty($items)): ?>
<p class="alert alert-info"><?= t('There are no results for your search') ?></p>
<?php else: ?>
@ -8,7 +8,7 @@
<section class="items" id="listing">
<?php foreach ($items as $item): ?>
<?= \Template\load('item', array(
<?= Miniflux\Template\load('item', array(
'item' => $item,
'menu' => $menu,
'offset' => $offset,
@ -20,7 +20,7 @@
)) ?>
<?php endforeach ?>
<?= \Template\load('paging', array('menu' => $menu, 'nb_items' => $nb_items, 'items_per_page' => $items_per_page, 'offset' => $offset, 'text' => $text)) ?>
<?= Miniflux\Template\load('paging', array('menu' => $menu, 'nb_items' => $nb_items, 'items_per_page' => $items_per_page, 'offset' => $offset, 'text' => $text)) ?>
</section>
<?php endif ?>

View File

@ -1,7 +1,7 @@
<div class="search">
<span id="search-opener"<?= isset($opened) && $opened ? ' class="hide"' : '' ?> data-action="show-search">&laquo; <?= t('Search')?></span>
<form id="search-form"<?= isset($opened) && $opened ? '' : ' class="hide"' ?> action="?" method="get">
<?= Helper\form_hidden('action', array('action' => 'search')) ?>
<?= Helper\form_text('text', array('text' => isset($text) ? $text : ''), array(), array('required', 'placeholder="' . t('Search') . '"')) ?>
<?= Miniflux\Helper\form_hidden('action', array('action' => 'search')) ?>
<?= Miniflux\Helper\form_text('text', array('text' => isset($text) ? $text : ''), array(), array('required', 'placeholder="' . t('Search') . '"')) ?>
</form>
</div>

View File

@ -15,29 +15,29 @@
<form method="post" action="?action=services" autocomplete="off" id="config-form">
<?= Helper\form_hidden('csrf', $values) ?>
<?= Miniflux\Helper\form_hidden('csrf', $values) ?>
<h3><?= t('Pinboard') ?></h3>
<div class="options">
<?= Helper\form_checkbox('pinboard_enabled', t('Send bookmarks to Pinboard'), 1, isset($values['pinboard_enabled']) && $values['pinboard_enabled'] == 1) ?><br />
<?= Miniflux\Helper\form_checkbox('pinboard_enabled', t('Send bookmarks to Pinboard'), 1, isset($values['pinboard_enabled']) && $values['pinboard_enabled'] == 1) ?><br />
<?= Helper\form_label(t('Pinboard API token'), 'pinboard_token') ?>
<?= Helper\form_text('pinboard_token', $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('Pinboard API token'), 'pinboard_token') ?>
<?= Miniflux\Helper\form_text('pinboard_token', $values, $errors) ?><br/>
<?= Helper\form_label(t('Pinboard tags'), 'pinboard_tags') ?>
<?= Helper\form_text('pinboard_tags', $values, $errors) ?>
<?= Miniflux\Helper\form_label(t('Pinboard tags'), 'pinboard_tags') ?>
<?= Miniflux\Helper\form_text('pinboard_tags', $values, $errors) ?>
</div>
<h3><?= t('Instapaper') ?></h3>
<div class="options">
<?= Helper\form_checkbox('instapaper_enabled', t('Send bookmarks to Instapaper'), 1, isset($values['instapaper_enabled']) && $values['instapaper_enabled'] == 1) ?><br />
<?= Miniflux\Helper\form_checkbox('instapaper_enabled', t('Send bookmarks to Instapaper'), 1, isset($values['instapaper_enabled']) && $values['instapaper_enabled'] == 1) ?><br />
<?= Helper\form_label(t('Instapaper username'), 'instapaper_username') ?>
<?= Helper\form_text('instapaper_username', $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('Instapaper username'), 'instapaper_username') ?>
<?= Miniflux\Helper\form_text('instapaper_username', $values, $errors) ?><br/>
<?= Helper\form_label(t('Instapaper password'), 'instapaper_password') ?>
<?= Helper\form_password('instapaper_password', $values, $errors) ?><br/>
<?= Miniflux\Helper\form_label(t('Instapaper password'), 'instapaper_password') ?>
<?= Miniflux\Helper\form_password('instapaper_password', $values, $errors) ?><br/>
</div>
<div class="form-actions">

View File

@ -13,7 +13,7 @@
<nav class="top">
<span class="nav-left">
<?php if ($item_nav['previous']): ?>
<a href="?action=show&amp;menu=<?= $menu ?><?= $group_id ? '&amp;group_id='.$group_id : '' ?>&amp;id=<?= $item_nav['previous']['id'] ?>" id="previous-item" title="<?= Helper\escape($item_nav['previous']['title']) ?>"><?= t('Previous') ?></a>
<a href="?action=show&amp;menu=<?= $menu ?><?= $group_id ? '&amp;group_id='.$group_id : '' ?>&amp;id=<?= $item_nav['previous']['id'] ?>" id="previous-item" title="<?= Miniflux\Helper\escape($item_nav['previous']['title']) ?>"><?= t('Previous') ?></a>
<?php else: ?>
<?= t('Previous') ?>
<?php endif ?>
@ -21,7 +21,7 @@
<span class="nav-right">
<?php if ($item_nav['next']): ?>
<a href="?action=show&amp;menu=<?= $menu ?><?= $group_id ? '&amp;group_id='.$group_id : '' ?>&amp;id=<?= $item_nav['next']['id'] ?>" id="next-item" title="<?= Helper\escape($item_nav['next']['title']) ?>"><?= t('Next') ?></a>
<a href="?action=show&amp;menu=<?= $menu ?><?= $group_id ? '&amp;group_id='.$group_id : '' ?>&amp;id=<?= $item_nav['next']['id'] ?>" id="next-item" title="<?= Miniflux\Helper\escape($item_nav['next']['title']) ?>"><?= t('Next') ?></a>
<?php else: ?>
<?= t('Next') ?>
<?php endif ?>
@ -29,8 +29,8 @@
</nav>
<?php endif ?>
<h1 <?= Helper\is_rtl($item + array('rtl' => $feed['rtl'])) ? 'dir="rtl"' : 'dir="ltr"' ?>>
<a href="<?= $item['url'] ?>" rel="noreferrer" target="_blank" class="original"><?= Helper\escape($item['title']) ?></a>
<h1 <?= Miniflux\Helper\is_rtl($item + array('rtl' => $feed['rtl'])) ? 'dir="rtl"' : 'dir="ltr"' ?>>
<a href="<?= $item['url'] ?>" rel="noreferrer" target="_blank" class="original"><?= Miniflux\Helper\escape($item['title']) ?></a>
</h1>
<ul class="item-infos">
@ -44,15 +44,15 @@
></a>
</li>
<li>
<a href="?action=feed-items&amp;feed_id=<?= $feed['id'] ?>"><?= Helper\escape($feed['title']) ?></a>
<a href="?action=feed-items&amp;feed_id=<?= $feed['id'] ?>"><?= Miniflux\Helper\escape($feed['title']) ?></a>
</li>
<?php if (!empty($item['author'])): ?>
<li>
<?= Helper\escape($item['author']) ?>
<?= Miniflux\Helper\escape($item['author']) ?>
</li>
<?php endif ?>
<li class="hide-mobile">
<span title="<?= dt('%e %B %Y %k:%M', $item['updated']) ?>"><?= Helper\relative_time($item['updated']) ?></span>
<span title="<?= dt('%e %B %Y %k:%M', $item['updated']) ?>"><?= Miniflux\Helper\relative_time($item['updated']) ?></span>
</li>
<?php if ($item['enclosure']): ?>
<li>
@ -74,7 +74,7 @@
<?php endif; ?>
</ul>
<div id="item-content" <?= Helper\is_rtl($item + array('rtl' => $feed['rtl'])) ? 'dir="rtl"' : 'dir="ltr"' ?>>
<div id="item-content" <?= Miniflux\Helper\is_rtl($item + array('rtl' => $feed['rtl'])) ? 'dir="rtl"' : 'dir="ltr"' ?>>
<?php if ($item['enclosure']): ?>
<?php if (strpos($item['enclosure_type'], 'audio') !== false): ?>
@ -103,7 +103,7 @@
<nav class="bottom">
<span class="nav-left">
<?php if ($item_nav['previous']): ?>
<a href="?action=show&amp;menu=<?= $menu ?><?= $group_id ? '&amp;group_id='.$group_id : '' ?>&amp;id=<?= $item_nav['previous']['id'] ?>" id="previous-item" title="<?= Helper\escape($item_nav['previous']['title']) ?>"><?= t('Previous') ?></a>
<a href="?action=show&amp;menu=<?= $menu ?><?= $group_id ? '&amp;group_id='.$group_id : '' ?>&amp;id=<?= $item_nav['previous']['id'] ?>" id="previous-item" title="<?= Miniflux\Helper\escape($item_nav['previous']['title']) ?>"><?= t('Previous') ?></a>
<?php else: ?>
<?= t('Previous') ?>
<?php endif ?>
@ -111,7 +111,7 @@
<span class="nav-right">
<?php if ($item_nav['next']): ?>
<a href="?action=show&amp;menu=<?= $menu ?><?= $group_id ? '&amp;group_id='.$group_id : '' ?>&amp;id=<?= $item_nav['next']['id'] ?>" id="next-item" title="<?= Helper\escape($item_nav['next']['title']) ?>"><?= t('Next') ?></a>
<a href="?action=show&amp;menu=<?= $menu ?><?= $group_id ? '&amp;group_id='.$group_id : '' ?>&amp;id=<?= $item_nav['next']['id'] ?>" id="next-item" title="<?= Miniflux\Helper\escape($item_nav['next']['title']) ?>"><?= t('Next') ?></a>
<?php else: ?>
<?= t('Next') ?>
<?php endif ?>

View File

@ -1,5 +1,5 @@
<?= \Template\load('search_form') ?>
<?= Miniflux\Template\load('search_form') ?>
<div class="page-header">
<h2><?= t('Unread') ?><span id="page-counter"><?= isset($nb_items) ? $nb_items : '' ?></span></h2>
<?php if (!empty($groups)): ?>
@ -29,7 +29,7 @@
<p class="alert alert-info"><?= t('Nothing to read') ?></p>
<?php else: ?>
<?php foreach ($items as $item): ?>
<?= \Template\load('item', array(
<?= Miniflux\Template\load('item', array(
'item' => $item,
'menu' => $menu,
'offset' => $offset,
@ -46,6 +46,6 @@
<a href="?action=mark-all-read<?= $group_id === null ? '' : '&amp;group_id='.$group_id ?>"><?= t('mark all as read') ?></a>
</div>
<?= \Template\load('paging', array('menu' => $menu, 'nb_items' => $nb_items, 'items_per_page' => $items_per_page, 'offset' => $offset, 'order' => $order, 'direction' => $direction, 'group_id' => $group_id)) ?>
<?= Miniflux\Template\load('paging', array('menu' => $menu, 'nb_items' => $nb_items, 'items_per_page' => $items_per_page, 'offset' => $offset, 'order' => $order, 'direction' => $direction, 'group_id' => $group_id)) ?>
<?php endif ?>
</section>

View File

@ -4,11 +4,11 @@ namespace Miniflux\Validator\User;
use SimpleValidator\Validator;
use SimpleValidator\Validators;
use Model\Config;
use Model\User as UserModel;
use Model\Database as DatabaseModel;
use Model\RememberMe;
use Request;
use Miniflux\Model\Config;
use Miniflux\Model\User as UserModel;
use Miniflux\Model\Database as DatabaseModel;
use Miniflux\Model\RememberMe;
use Miniflux\Request;
function validate_creation(array $values)
{

View File

@ -2,6 +2,8 @@
require __DIR__.'/app/common.php';
use Miniflux\Model;
if (php_sapi_name() === 'cli') {
$options = getopt('', array(
'limit::',

View File

@ -2,6 +2,9 @@
require __DIR__.'/app/common.php';
use Miniflux\Router;
use Miniflux\Response;
Router\bootstrap(
__DIR__.'/app/controllers',
'common',

View File

@ -3,12 +3,12 @@
require __DIR__.'/app/common.php';
use JsonRPC\Server;
use Model\Config;
use Miniflux\Model;
$server = new Server();
$server->authentication(array(
Config\get('username') => Config\get('api_token')
Model\Config\get('username') => Model\Config\get('api_token')
));
$procedureHandler = $server->getProcedureHandler();

View File

@ -1,6 +1,7 @@
<?php
use Pheanstalk\Pheanstalk;
use Miniflux\Model;
require __DIR__.'/app/common.php';

View File

@ -1,5 +1,7 @@
<?php
use Miniflux\Helper;
class HelperTest extends BaseTest
{
public function testGenerateToken()

View File

@ -1,5 +1,7 @@
<?php
use Miniflux\Request;
class RequestTest extends BaseTest
{
public function testGetIpAddress()

View File

@ -1,6 +1,7 @@
<?php
use Pheanstalk\Pheanstalk;
use Miniflux\Model;
require __DIR__.'/app/common.php';