diff options
author | Fabian Becker <halfdan@xnorfz.de> | 2013-04-05 22:38:07 +0400 |
---|---|---|
committer | Fabian Becker <halfdan@xnorfz.de> | 2013-04-05 22:38:07 +0400 |
commit | 488442cfdf9f119d9169771a887e8f18489a83f1 (patch) | |
tree | 0750f40d67903b6f0576e4b478eee62d87823b38 | |
parent | 862c6bcac0b828b1041211b6a204f426cc8a35b4 (diff) |
Partial conversion of Annotations plugin
-rwxr-xr-x | plugins/Annotations/Controller.php | 6 | ||||
-rwxr-xr-x | plugins/Annotations/templates/evolutionAnnotations.tpl | 15 | ||||
-rwxr-xr-x | plugins/Annotations/templates/evolutionAnnotations.twig | 15 |
3 files changed, 18 insertions, 18 deletions
diff --git a/plugins/Annotations/Controller.php b/plugins/Annotations/Controller.php index 9b9f9e352c..124163fe5c 100755 --- a/plugins/Annotations/Controller.php +++ b/plugins/Annotations/Controller.php @@ -55,7 +55,7 @@ class Piwik_Annotations_Controller extends Piwik_Controller } // create & render the view - $view = Piwik_View::factory('annotationManager'); + $view = new Piwik_View('@Annotations/annotationManager'); $allAnnotations = Piwik_API_Request::processRequest( 'Annotations.getAll', array('date' => $date, 'period' => $period, 'lastN' => $lastN)); @@ -103,7 +103,7 @@ class Piwik_Annotations_Controller extends Piwik_Controller if ($_SERVER["REQUEST_METHOD"] == "POST") { $this->checkTokenInUrl(); - $view = Piwik_View::factory('annotation'); + $view = new Piwik_View('@Annotations//annotation'); // NOTE: permissions checked in API method // save the annotation @@ -208,7 +208,7 @@ class Piwik_Annotations_Controller extends Piwik_Controller "Annotations.getAnnotationCountForDates", array('getAnnotationText' => 1)); // create & render the view - $view = Piwik_View::factory('evolutionAnnotations'); + $view = new Piwik_View('@Annotations/evolutionAnnotations'); $view->annotationCounts = reset($annotationCounts); // only one idSite allowed for this action echo $view->render(); diff --git a/plugins/Annotations/templates/evolutionAnnotations.tpl b/plugins/Annotations/templates/evolutionAnnotations.tpl deleted file mode 100755 index eaf6f9d9d3..0000000000 --- a/plugins/Annotations/templates/evolutionAnnotations.tpl +++ /dev/null @@ -1,15 +0,0 @@ -<div class="evolution-annotations"> - {foreach from=$annotationCounts item=dateCountPair} - {assign var=date value=$dateCountPair[0]} - {assign var=counts value=$dateCountPair[1]} - <span data-date="{$date}" data-count="{$counts.count}" data-starred="{$counts.starred}" - {if $counts.count eq 0}title="{'Annotations_AddAnnotationsFor_js'|translate:$date}" - {elseif $counts.count eq 1}title="{'Annotations_AnnotationOnDate'|translate:$date:$counts.note} - -{'Annotations_ClickToEditOrAdd'|translate}" - {else}title="{'Annotations_ViewAndAddAnnotations_js'|translate:$date}" - {/if}> - <img src="themes/default/images/{if $counts.starred > 0}yellow_marker.png{else}grey_marker.png{/if}" width="16" height="16"/> - </span> - {/foreach} -</div> diff --git a/plugins/Annotations/templates/evolutionAnnotations.twig b/plugins/Annotations/templates/evolutionAnnotations.twig new file mode 100755 index 0000000000..c168ac9a31 --- /dev/null +++ b/plugins/Annotations/templates/evolutionAnnotations.twig @@ -0,0 +1,15 @@ +<div class="evolution-annotations"> + {% for dateCountPair in annotationCounts %} + {% set date=dateCountPair[0] %} + {% set counts=dateCountPair[1] %} + <span data-date="{{ date }}" data-count="{{ counts.count }}" data-starred="{{ counts.starred }}" + {% if counts.count == 0 %}title="{{ 'Annotations_AddAnnotationsFor_js'|translate(date) }}" + {% elseif counts.count == 1 %}title="{{ 'Annotations_AnnotationOnDate'|translate(date,counts.note) }} + +{{ 'Annotations_ClickToEditOrAdd'|translate }}" + {% else %}}title="{{ 'Annotations_ViewAndAddAnnotations_js'|translate(date) }}" + {% endif %}> + <img src="plugins/Zeitgeist/theme/images/{% if counts.starred > 0 %}yellow_marker.png{% else %}}grey_marker.png{% endif %}}" width="16" height="16"/> + </span> + {% endfor %} +</div> |