Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve #3

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Controllers/indexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

class FreshExtension_index_Controller extends FreshRSS_index_Controller {
public function aboutAction() {
Minz_View::prependTitle(_t('ext.about.new_title') . ' · ');
Minz_View::prependTitle(_t('ext.hello_world.about.title') . ' · ');
}
}
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
Extension-HelloWorld
====================
# Extension-HelloWorld

An HelloWorld extension
An HelloWorld extension for [FreshRSS](https://github.com/FreshRSS/FreshRSS).

It is a bit described in the documentation: https://freshrss.github.io/FreshRSS/en/developers/03_Backend/05_Extensions.html#write-an-extension-for-freshrss

## Warning

It is not recommended to install this extension on your production server. This extension manipulates the important “About” page.

## How to install

To install this extension, download the extension archive first and extract it on your PC. Then, upload this on your server. Extensions must be in the `./extensions` directory of your FreshRSS installation.

## What it does

This extension is a little showcase and boilerplate for a FreshRSS extension.

As showcase it will manipulate some little things:
- the “About” page content will be overwritten
- the “Save” button titles will be changed
- the normal view article list will be changed
21 changes: 21 additions & 0 deletions i18n/de/ext.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/******************************************************************************/
/* Each entry of that file can be associated with a comment to indicate its */
/* state. When there is no comment, it means the entry is fully translated. */
/* The recognized comments are (comment matching is case-insensitive): */
/* + TODO: the entry has never been translated. */
/* + DIRTY: the entry has been translated but needs to be updated. */
/* + IGNORE: the entry does not need to be translated. */
/* When a comment is not recognized, it is discarded. */
/******************************************************************************/

return array(
'hello_world' => array(
'no_configuration' => 'Hier kann leider nichts konfiguriert werden!',
'about' => array (
'title' => 'Über: Hello World FreshRSS',
'content' => 'Eine neue „Über“ Seite, die von der Erweiterung „xExtension-HelloWorld“ überschrieben wurde'
),
),
);
20 changes: 20 additions & 0 deletions i18n/de/gen.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/******************************************************************************/
/* Each entry of that file can be associated with a comment to indicate its */
/* state. When there is no comment, it means the entry is fully translated. */
/* The recognized comments are (comment matching is case-insensitive): */
/* + TODO: the entry has never been translated. */
/* + DIRTY: the entry has been translated but needs to be updated. */
/* + IGNORE: the entry does not need to be translated. */
/* When a comment is not recognized, it is discarded. */
/******************************************************************************/

return array(
'action' => array(
'submit' => 'OK Hello World!', // IGNORE
),
'menu' => array(
'about' => 'Über FreshRSS und Hello World',
),
);
14 changes: 14 additions & 0 deletions i18n/en/ext.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
<?php

/******************************************************************************/
/* Each entry of that file can be associated with a comment to indicate its */
/* state. When there is no comment, it means the entry is fully translated. */
/* The recognized comments are (comment matching is case-insensitive): */
/* + TODO: the entry has never been translated. */
/* + DIRTY: the entry has been translated but needs to be updated. */
/* + IGNORE: the entry does not need to be translated. */
/* When a comment is not recognized, it is discarded. */
/******************************************************************************/

return array(
'hello_world' => array(
'no_configuration' => 'There is nothing to configure in this extension, sorry!',
'about' => array (
'title' => 'About: Hello World FreshRSS',
'content' => 'A new about page that was overwritten by the extension “xExtension-HelloWorld”'
),
),
);
15 changes: 14 additions & 1 deletion i18n/en/gen.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
<?php

/******************************************************************************/
/* Each entry of that file can be associated with a comment to indicate its */
/* state. When there is no comment, it means the entry is fully translated. */
/* The recognized comments are (comment matching is case-insensitive): */
/* + TODO: the entry has never been translated. */
/* + DIRTY: the entry has been translated but needs to be updated. */
/* + IGNORE: the entry does not need to be translated. */
/* When a comment is not recognized, it is discarded. */
/******************************************************************************/

return array(
'action' => array(
'submit' => 'Save',
'submit' => 'OK Hello World!',
),
'menu' => array(
'about' => 'About FreshRSS and Hello World',
),
);
14 changes: 14 additions & 0 deletions i18n/fr/ext.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
<?php

/******************************************************************************/
/* Each entry of that file can be associated with a comment to indicate its */
/* state. When there is no comment, it means the entry is fully translated. */
/* The recognized comments are (comment matching is case-insensitive): */
/* + TODO: the entry has never been translated. */
/* + DIRTY: the entry has been translated but needs to be updated. */
/* + IGNORE: the entry does not need to be translated. */
/* When a comment is not recognized, it is discarded. */
/******************************************************************************/

return array(
'hello_world' => array(
'no_configuration' => 'Il n’y a rien à configurer dans cette extension, désolé !',
),
'about' => array (
'title' => 'About: Hello World FreshRSS', // TODO
'content' => 'A new about page that was overwritten by the extension “xExtension-HelloWorld”' // TODO
),
Comment on lines +17 to +20
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO left: please support here with the French translation

);
15 changes: 14 additions & 1 deletion i18n/fr/gen.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
<?php

/******************************************************************************/
/* Each entry of that file can be associated with a comment to indicate its */
/* state. When there is no comment, it means the entry is fully translated. */
/* The recognized comments are (comment matching is case-insensitive): */
/* + TODO: the entry has never been translated. */
/* + DIRTY: the entry has been translated but needs to be updated. */
/* + IGNORE: the entry does not need to be translated. */
/* When a comment is not recognized, it is discarded. */
/******************************************************************************/

return array(
'action' => array(
'submit' => 'Sauvegarder',
'submit' => 'OK Hello World!', // TODO
),
'menu' => array(
'about' => 'About FreshRSS and Hello World', // TODO
Comment on lines -5 to +18
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO left: please support here with the French translation

),
);
23 changes: 19 additions & 4 deletions views/index/about.phtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
<div class="post content">
<h1>About</h1>
<p>A new about page!</p>
</div>
<?php
/** @var FreshRSS_View $this */
if (FreshRSS_Auth::hasAccess()) {
$this->partial('aside_configure');
}
?>

<main class="post content<?= !FreshRSS_Auth::hasAccess() ? ' centered' : ''?>">
<h1><?= _t('ext.hello_world.about.title')?></h1>
<p><?= _t('ext.hello_world.about.content')?></p>
</main>

<?php if (!FreshRSS_Auth::hasAccess()) { ?>
<footer class="main-footer">
<?php if (file_exists(TOS_FILENAME)) { ?>
<a href="<?= _url('index', 'tos') ?>"><?= _t('index.tos.title')?></a>
<?php } ?>
</footer>
<?php } ?>