Skip to content
Browse files

Basic layout with site selector and admin menu.

  • Loading branch information...
1 parent ad530c7 commit 9f0ac96d2fec6bd31aaefb90e02a1ed4535f9a53 @halfdan committed Feb 27, 2013
Showing with 45 additions and 0 deletions.
  1. +23 −0 Controller.php
  2. +13 −0 FeedAnnotation.php
  3. +2 −0 lang/en.php
  4. +7 −0 templates/index.tpl
View
23 Controller.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ *
+ * @package Piwik_FeedAnnotation
+ */
+class Piwik_FeedAnnotation_Controller extends Piwik_Controller
+{
+ function index()
+ {
+ Piwik::checkUserHasSomeAdminAccess();
+ $view = Piwik_View::factory('index');
+ $this->setBasicVariablesView($view);
+
+ $idSite = Piwik_Common::getRequestVar('idSite', false, 'int');
+ $idSitesAvailable = Piwik_SitesManager_API::getInstance()->getSitesWithAdminAccess();
+
+
+ $view->idSiteSelected = $idSite;
+ $view->idSitesAvailable = $idSitesAvailable;
+ $view->menu = Piwik_GetAdminMenu();
+ echo $view->render();
+ }
+}
View
13 FeedAnnotation.php
@@ -34,4 +34,17 @@ public function getInformation()
'translationAvailable' => true,
);
}
+ public function getListHooksRegistered()
+ {
+ return array(
+ 'AdminMenu.add' => 'addAdminMenu'
+ );
+ }
+
+ public function addAdminMenu() {
+ Piwik_AddAdminSubMenu('General_Settings', 'FeedAnnotation_MenuGeneralSettings',
+ array('module' => 'FeedAnnotation', 'action' => 'index'),
+ Piwik::isUserHasSomeAdminAccess(),
+ $order = 10);
+ }
}
View
2 lang/en.php
@@ -11,4 +11,6 @@
$translations = array(
'FeedAnnotation_PluginDescription' => 'Plugin to automatically create Annotations by polling a feed (Atom/RSS)',
+ 'FeedAnnotation_MenuGeneralSettings' => 'Feed Annotations',
+ 'FeedAnnotation_Manage' => 'Manage Feed Annotations',
);
View
7 templates/index.tpl
@@ -0,0 +1,7 @@
+{include file="CoreAdminHome/templates/header.tpl"}
+<h2>{'FeedAnnotation_Manage'|translate}</h2>
+
+{include file="CoreHome/templates/sites_selection.tpl"
+idSite=$idSiteSelected sites=$idSitesAvailable showAllSitesItem=false siteSelectorId="feedAnnotationSiteSelect" switchSiteOnSelect=true}
+
+{include file="CoreAdminHome/templates/footer.tpl"}

0 comments on commit 9f0ac96

Please sign in to comment.
Something went wrong with that request. Please try again.