Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Becker <halfdan@xnorfz.de>2013-04-10 21:38:37 +0400
committerFabian Becker <halfdan@xnorfz.de>2013-04-10 21:38:37 +0400
commit826e0cab08e165e5606a8523d3923065ef425692 (patch)
treeccd9f70c5971ed3e2a8d08b3a1909fe84119739a /plugins/SEO
parent05b5456591cf0a115e3d3451608d04431b08c5b6 (diff)
Converted SEO plugin to Twig.
[ci skip]
Diffstat (limited to 'plugins/SEO')
-rw-r--r--plugins/SEO/Controller.php2
-rw-r--r--plugins/SEO/templates/index.tpl50
-rw-r--r--plugins/SEO/templates/index.twig52
3 files changed, 53 insertions, 51 deletions
diff --git a/plugins/SEO/Controller.php b/plugins/SEO/Controller.php
index f0e75f8200..dad2b1630c 100644
--- a/plugins/SEO/Controller.php
+++ b/plugins/SEO/Controller.php
@@ -31,7 +31,7 @@ class Piwik_SEO_Controller extends Piwik_Controller
$dataTable = Piwik_SEO_API::getInstance()->getRank($url);
- $view = Piwik_View::factory('index');
+ $view = new Piwik_View('@SEO/index');
$view->urlToRank = Piwik_SEO_RankChecker::extractDomainFromUrl($url);
$renderer = Piwik_DataTable_Renderer::factory('php');
diff --git a/plugins/SEO/templates/index.tpl b/plugins/SEO/templates/index.tpl
deleted file mode 100644
index 0a100bddb3..0000000000
--- a/plugins/SEO/templates/index.tpl
+++ /dev/null
@@ -1,50 +0,0 @@
-<div id='SeoRanks'>
- <script type="text/javascript" src="plugins/SEO/templates/rank.js"></script>
-
- <form method="post" style="padding: 8px;">
- <div align="left" class="mediumtext">
- {'Installation_SetupWebSiteURL'|translate|ucfirst}
- <input type="text" id="seoUrl" size="15" value="{$urlToRank|escape:'html'}" class="textbox"/>
- <span style="padding-left:2px;">
- <input type="submit" id="rankbutton" value="{'SEO_Rank'|translate}"/>
- </span>
- </div>
-
- {ajaxLoadingDiv id=ajaxLoadingSEO}
-
- <div id="rankStats" align="left" style='margin-top:10px'>
- {if empty($ranks)}
- {'General_Error'|translate}
- {else}
- {capture name=cleanUrl}
- <a href='http://{$urlToRank|escape:'html'}' target='_blank'>{$urlToRank|escape:'html'}</a>
- {/capture}
- {'SEO_SEORankingsFor'|translate:$smarty.capture.cleanUrl}
- <table cellspacing='2' style='margin:auto;line-height:1.5em;padding-top:10px'>
- {foreach from=$ranks item=rank}
- <tr>
- {capture assign=seoLink}<a class="linkContent" href="?module=Proxy&action=redirect&url={$rank.logo_link|urlencode}" target="_blank"
- {if !empty($rank.logo_tooltip)}title="{$rank.logo_tooltip}"{/if}>{/capture}
- {capture assign=majesticLink}{$seoLink}Majestic</a>{/capture}
- <td>{if !empty($rank.logo_link)}{$seoLink}{/if}<img
- style='vertical-align:middle;margin-right:6px;' src='{$rank.logo}' border='0'
- alt="{$rank.label}">{if !empty($rank.logo_link)}</a>{/if} {$rank.label|replace:"Majestic":$majesticLink}
- </td>
- <td>
- <div style='margin-left:15px'>
- {if !empty($rank.logo_link)}{$seoLink}{/if}
- {if isset($rank.rank)}{$rank.rank}{else}-{/if}
- {if $rank.id=='pagerank'} /10
- {elseif $rank.id=='google-index' || $rank.id=='bing-index'} {'SEO_Pages'|translate}
- {/if}
- {if !empty($rank.logo_link)}</a>{/if}
- </div>
- </td>
- </tr>
- {/foreach}
-
- </table>
- {/if}
- </div>
- </form>
-</div>
diff --git a/plugins/SEO/templates/index.twig b/plugins/SEO/templates/index.twig
new file mode 100644
index 0000000000..eb099c3eeb
--- /dev/null
+++ b/plugins/SEO/templates/index.twig
@@ -0,0 +1,52 @@
+<div id='SeoRanks'>
+ <script type="text/javascript" src="plugins/SEO/templates/rank.js"></script>
+
+ <form method="post" style="padding: 8px;">
+ <div align="left" class="mediumtext">
+ {{ 'Installation_SetupWebSiteURL'|translate|capitalize }}
+ <input type="text" id="seoUrl" size="15" value="{{ urlToRank }}" class="textbox"/>
+ <span style="padding-left:2px;">
+ <input type="submit" id="rankbutton" value="{{ 'SEO_Rank'|translate }}"/>
+ </span>
+ </div>
+
+ {% import 'ajaxMacros.twig' as ajax %}
+ {{ ajax.loadingDiv('ajaxLoadingSEO') }}
+
+ <div id="rankStats" align="left" style='margin-top:10px'>
+ {% if ranks is empty %}
+ {{ 'General_Error'|translate }}
+ {% else %}
+ {% set cleanUrl %}
+ <a href='http://{{ urlToRank }}' target='_blank'>{{ urlToRank }}</a>
+ {% endset %}
+ {{ 'SEO_SEORankingsFor'|translate(cleanUrl) \}
+ <table cellspacing='2' style='margin:auto;line-height:1.5em;padding-top:10px'>
+ {% for rank in ranks %}
+ <tr>
+ {% set seoLink %}<a class="linkContent" href="?module=Proxy&action=redirect&url={{ rank.logo_link|url_encode }}" target="_blank"
+ {% if rank.logo_tooltip is not empty %}title="{{ rank.logo_tooltip }}"{% endif %}>
+ {% endset %}
+ {% set majesticLink %}{{ seoLink }}Majestic</a>{% endset %}
+ <td>
+ {% if rank.logo_link is not empty %}{{ seoLink }}{% endif %}
+ <img style='vertical-align:middle;margin-right:6px;' src='{{ rank.logo }}' border='0'
+ alt="{{ rank.label }}">{% if rank.logo_link is not empty %}</a>{% endif %} {{ rank.label|replace({"Majestic":majesticLink}) }}
+ </td>
+ <td>
+ <div style='margin-left:15px'>
+ {% if rank.logo_link is not empty %}{{ seoLink }}{% endif %}
+ {% if rank.rank is defined %}{{ rank.rank }}{% else %}-{% endif %}
+ {% if rank.id=='pagerank' %} /10
+ {% elseif rank.id=='google-index' or rank.id=='bing-index' %} {{ 'SEO_Pages'|translate }}
+ {% endif %}
+ {% if rank.logo_link is not empty %}</a>{% endif %}
+ </div>
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+ {% endif %}
+ </div>
+ </form>
+</div>