diff --git a/plugins/CorePluginsAdmin/Controller.php b/plugins/CorePluginsAdmin/Controller.php index 0237c26a81c5d04d706e55466b30a834d4b47a49..996ffd3e192cc61d9a64dd698ee73d4ef6b57a49 100644 --- a/plugins/CorePluginsAdmin/Controller.php +++ b/plugins/CorePluginsAdmin/Controller.php @@ -22,6 +22,17 @@ use Piwik\Url; */ class Controller extends \Piwik\Controller\Admin { + + function search_plugin() + { + $view = $this->configureView('@CorePluginsAdmin/search_plugin'); + + $plugins = json_decode(file_get_contents('http://plugins.piwik.org/api/1.0/plugins')); + $view->plugins = $plugins->plugins; + + echo $view->render(); + } + function extend() { $view = $this->configureView('@CorePluginsAdmin/extend'); diff --git a/plugins/CorePluginsAdmin/templates/search_plugin.twig b/plugins/CorePluginsAdmin/templates/search_plugin.twig new file mode 100644 index 0000000000000000000000000000000000000000..f78cefe68fe77900b13d7c8ed8e5548a13c98b1f --- /dev/null +++ b/plugins/CorePluginsAdmin/templates/search_plugin.twig @@ -0,0 +1,47 @@ +{% extends 'admin.twig' %} + +{% block content %} + <style type="text/css"> + .plugin li { display: inline-block;padding-right: 10px;font-size: 90%; } + .plugin ul { list-style: none;margin-left: 0; } + .plugin .description { padding-bottom: 10px; } + .plugin .install { float: right; } + .pluginslist { margin-top: 20px;max-width:980px; } + </style> + + <div style="max-width:980px;"> + + <h2>Extend Piwik by installing a new plugin</h2> + + <div> + <input placeholder="Search" type="text" name="q"/> + <button type="submit">Search</button> + | + <a href="#">popular</a> + | + <a href="#">newest</a> + </div> + </div> + + <div class="pluginslist" style=""> + + {% for plugin in plugins %} + + <div class="plugin"> + + <a href="#" class="install">Install</a> + + <h3>{{ plugin.name }}</h3> + <p class="description">{{ plugin.description }}</p> + <ul> + <li>Version {{ plugin.latestVersion }}</li> + <li>Updated {{ plugin.timestamp }}</li> + <li>Downloads {{ plugin.numDownloads }}</li> + </ul> + + </div> + + {% endfor %} + + </div> +{% endblock %}