diff options
| author | 2015-10-25 00:08:53 +0200 | |
|---|---|---|
| committer | 2015-10-25 00:08:53 +0200 | |
| commit | 4860101811ada1c869dbacd0e3311194c4ea6ff5 (patch) | |
| tree | a3467d992684b89e4e750bf87b2d604ea5eadf22 /app | |
| parent | 481c2a671913cdd6099a1b6ee4d5491dff16c0bf (diff) | |
| parent | 02a3cb4652d4c87ec3202d39f6cd8a240a1a7373 (diff) | |
Merge branch 'allow_robots' into dev
Diffstat (limited to 'app')
| -rw-r--r-- | app/Models/Context.php | 13 | ||||
| -rw-r--r-- | app/i18n/cz/gen.php | 2 | ||||
| -rw-r--r-- | app/i18n/de/gen.php | 2 | ||||
| -rw-r--r-- | app/i18n/en/gen.php | 2 | ||||
| -rw-r--r-- | app/i18n/fr/gen.php | 2 | ||||
| -rw-r--r-- | app/i18n/nl/gen.php | 2 | ||||
| -rw-r--r-- | app/layout/layout.phtml | 4 |
7 files changed, 20 insertions, 7 deletions
diff --git a/app/Models/Context.php b/app/Models/Context.php index dbdbfaa69..d8dd81e88 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -10,6 +10,7 @@ class FreshRSS_Context { public static $categories = array(); public static $name = ''; + public static $description = ''; public static $total_unread = 0; public static $total_starred = array( @@ -94,6 +95,13 @@ class FreshRSS_Context { } /** + * Return true iif the current requests target a feed and not a category or all articles. + */ + public static function isFeed() { + return self::$current_get['feed'] != false; + } + + /** * Return true if $get parameter correspond to the $current_get attribute. */ public static function isCurrentGet($get) { @@ -146,8 +154,8 @@ class FreshRSS_Context { self::$state = self::$state | FreshRSS_Entry::STATE_FAVORITE; break; case 'f': - // We try to find the corresponding feed. - $feed = FreshRSS_CategoryDAO::findFeed(self::$categories, $id); + // We try to find the corresponding feed. When allowing robots, always retrieve the full feed including description + $feed = FreshRSS_Context::$system_conf->allow_robots ? null : FreshRSS_CategoryDAO::findFeed(self::$categories, $id); if ($feed === null) { $feedDAO = FreshRSS_Factory::createFeedDao(); $feed = $feedDAO->searchById($id); @@ -160,6 +168,7 @@ class FreshRSS_Context { self::$current_get['feed'] = $id; self::$current_get['category'] = $feed->category(); self::$name = $feed->name(); + self::$description = $feed->description(); self::$get_unread = $feed->nbNotRead(); break; case 'c': diff --git a/app/i18n/cz/gen.php b/app/i18n/cz/gen.php index 6b89cf627..ffc138abb 100644 --- a/app/i18n/cz/gen.php +++ b/app/i18n/cz/gen.php @@ -120,7 +120,7 @@ return array( 'de' => 'Deutsch', 'en' => 'English', 'fr' => 'Français', - 'it' => 'Italian', + 'it' => 'Italiano', 'nl' => 'Nederlands', ), 'menu' => array( diff --git a/app/i18n/de/gen.php b/app/i18n/de/gen.php index 6e5dc7c3f..842383498 100644 --- a/app/i18n/de/gen.php +++ b/app/i18n/de/gen.php @@ -120,7 +120,7 @@ return array( 'de' => 'Deutsch', 'en' => 'English', 'fr' => 'Français', - 'it' => 'Italian', + 'it' => 'Italiano', 'nl' => 'Nederlands', ), 'menu' => array( diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php index c9a7e2d4e..d23b12f95 100644 --- a/app/i18n/en/gen.php +++ b/app/i18n/en/gen.php @@ -120,7 +120,7 @@ return array( 'de' => 'Deutsch', 'en' => 'English', 'fr' => 'Français', - 'it' => 'Italian', + 'it' => 'Italiano', 'nl' => 'Nederlands', ), 'menu' => array( diff --git a/app/i18n/fr/gen.php b/app/i18n/fr/gen.php index fc16c74ab..2f16f09b9 100644 --- a/app/i18n/fr/gen.php +++ b/app/i18n/fr/gen.php @@ -120,7 +120,7 @@ return array( 'de' => 'Deutsch', 'en' => 'English', 'fr' => 'Français', - 'it' => 'Italian', + 'it' => 'Italiano', 'nl' => 'Nederlands', ), 'menu' => array( diff --git a/app/i18n/nl/gen.php b/app/i18n/nl/gen.php index f61cb638b..b8467f92f 100644 --- a/app/i18n/nl/gen.php +++ b/app/i18n/nl/gen.php @@ -120,7 +120,7 @@ return array( 'de' => 'Deutsch', 'en' => 'English', 'fr' => 'Français', - 'it' => 'Italian', + 'it' => 'Italiano', 'nl' => 'Nederlands', ), 'menu' => array( diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index 083ffd4b3..d7e9d115b 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -36,7 +36,11 @@ <meta name="apple-mobile-web-app-status-bar-style" content="black" /> <meta name="apple-mobile-web-app-title" content="<?php echo FreshRSS_Context::$system_conf->title; ?>"> <meta name="msapplication-TileColor" content="#FFF" /> +<?php if (FreshRSS_Context::$system_conf->allow_robots) { ?> + <meta name="description" content="<?php echo htmlspecialchars(FreshRSS_Context::$name . ' | ' . FreshRSS_Context::$description, ENT_NOQUOTES, 'UTF-8'); ?>" /> +<?php } else { ?> <meta name="robots" content="noindex,nofollow" /> +<?php } ?> </head> <body class="<?php echo Minz_Request::param('output', 'normal'); ?>"> <?php $this->partial('header'); ?> |
