Permalink
Browse files

Added translations

Basic table listing for configured feeds.
Added daily schedule to process feeds and create annotations
  • Loading branch information...
1 parent 200d9dc commit da993779b5a4d1fea20000ae065282677bc5559a @halfdan committed Feb 27, 2013
Showing with 50 additions and 5 deletions.
  1. +28 −1 FeedAnnotation.php
  2. +3 −0 lang/en.php
  3. +19 −4 templates/index.tpl
View
@@ -45,6 +45,7 @@ public function install() {
idfeed INT NOT NULL AUTO_INCREMENT,
idsite INT(11) NOT NULL,
feed_url VARCHAR(200) NOT NULL,
+ last_processed DATETIME,
PRIMARY KEY (idfeed)
) DEFAULT CHARSET=utf8;";
@@ -67,7 +68,8 @@ public function install() {
public function getListHooksRegistered()
{
return array(
- 'AdminMenu.add' => 'addAdminMenu'
+ 'AdminMenu.add' => 'addAdminMenu',
+ 'TaskScheduler.getScheduledTasks' => 'getScheduledTasks'
);
}
@@ -80,4 +82,29 @@ public function addAdminMenu() {
Piwik::isUserHasSomeAdminAccess(),
$order = 10);
}
+
+ /**
+ * Gets all scheduled tasks executed by this plugin.
+ *
+ * @param Piwik_Event_Notification $notification notification object
+ */
+ public function getScheduledTasks($notification)
+ {
+ $tasks = &$notification->getNotificationObject();
+
+ $cacheDataByArchiveNameReportsTask = new Piwik_ScheduledTask(
+ $this,
+ 'updateFeedAnnotations',
+ null,
+ new Piwik_ScheduledTime_Daily()
+ );
+ $tasks[] = $cacheDataByArchiveNameReportsTask;
+ }
+
+ /**
+ * Fetches configured feeds and creates/updates Annotations.
+ */
+ public function updateFeedAnnotations() {
+
+ }
}
View
@@ -13,4 +13,7 @@
'FeedAnnotation_PluginDescription' => 'Plugin to automatically create Annotations by polling a feed (Atom/RSS)',
'FeedAnnotation_MenuGeneralSettings' => 'Feed Annotations',
'FeedAnnotation_Manage' => 'Manage Feed Annotations',
+ 'FeedAnnotation_AdminDescription' => 'Here you can add and remove feeds from your websites that are automatically fetched. Feed ttems will automatically be added as Annotations on a daily basis.',
+ 'FeedAnnotation_FeedUrl' => 'Feed URL',
+ 'FeedAnnotation_LastProcessed' => 'Last Processed'
);
View
@@ -1,11 +1,26 @@
{include file="CoreAdminHome/templates/header.tpl"}
<h2>{'FeedAnnotation_Manage'|translate}</h2>
+<p>{'FeedAnnotation_AdminDescription'|translate}</p>
+
<section>
-{include file="CoreHome/templates/sites_selection.tpl"
- idSite=$idSiteSelected sites=$idSitesAvailable showAllSitesItem=false
- showSelectedSite=true siteSelectorId="feedAnnotationSiteSelect"
- switchSiteOnSelect=true}
+ {include file="CoreHome/templates/sites_selection.tpl"
+ idSite=$idSiteSelected sites=$idSitesAvailable showAllSitesItem=false
+ showSelectedSite=true siteSelectorId="feedAnnotationSiteSelect"
+ switchSiteOnSelect=true}
</section>
+<div class="entityContainer">
+ <table class="entityTable dataTable" id="editSites">
+ <thead>
+ <tr>
+ <th>{'FeedAnnotation_FeedUrl'|translate}</th>
+ <th>{'FeedAnnotation_LastProcessed'|translate}</th>
+ </tr>
+ </thead>
+ <tbody>
+ </tbody>
+ </table>
+</div>
+
{include file="CoreAdminHome/templates/footer.tpl"}

0 comments on commit da99377

Please sign in to comment.