Skip to content
Snippets Groups Projects
Commit ee37f36c authored by Anton Sarukhanov's avatar Anton Sarukhanov
Browse files

initial commit

parents
No related branches found
No related tags found
No related merge requests found
language: php
php:
- 5.3
env:
matrix:
- TEST_SUITE=CoreTests MYSQL_ADAPTER=PDO_MYSQL
- TEST_SUITE=PluginTests MYSQL_ADAPTER=PDO_MYSQL
script: ./travis.sh
install:
- TEST_PIWIK_VERSION=$(wget builds.piwik.org/LATEST -q -O -)
- TEST_PIWIK_VERSION=`echo $TEST_PIWIK_VERSION | tr -d ' ' | tr -d '\n'`
- mkdir Groups
- cp -R !(Groups) Groups
- cp -R .git/ Groups/
- git clone https://github.com/piwik/piwik.git piwik
- cd piwik
- git checkout "$TEST_PIWIK_VERSION"
- git submodule init
- git submodule update || true
- composer self-update
- composer install
- rm -rf plugins/Groups
- cd ../
- mv Groups piwik/plugins
before_script:
- cd piwik
- uname -a
- date
- mysql -e 'create database piwik_tests;'
- ./tests/travis/prepare.sh
- ./tests/travis/setup_webserver.sh
- wget https://raw.github.com/piwik/piwik-tests-plugins/master/activateplugin.php
- php activateplugin.php Groups
- cd tests/PHPUnit
after_script:
- cat /var/log/nginx/error.log
API.php 0 → 100644
<?php
/**
* Piwik - Open source web analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\Groups;
/**
* API for plugin Groups
*
* @method static \Piwik\Plugins\Groups\API getInstance()
*/
class API extends \Piwik\Plugin\API
{
/**
* Example method. Please remove if you do not need this API method.
* You can call this API method like this:
* /index.php?module=API&method=Groups.getAnswerToLife
* /index.php?module=API&method=Groups.getAnswerToLife?truth=0
*
* @param bool $truth
*
* @return bool
*/
public function getAnswerToLife($truth = true)
{
if ($truth) {
return 42;
}
return 24;
}
}
<?php
/**
* Piwik - Open source web analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\Groups;
use Piwik\View;
/**
*
*/
class Controller extends \Piwik\Plugin\Controller
{
public function index()
{
$view = new View('@Groups/index.twig');
$this->setBasicVariablesView($view);
$view->answerToLife = '42';
return $view->render();
}
}
<?php
/**
* Piwik - Open source web analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\Groups;
/**
*/
class Groups extends \Piwik\Plugin
{
/**
* @see Piwik\Plugin::getListHooksRegistered
*/
public function getListHooksRegistered()
{
return array(
'AssetManager.getJavaScriptFiles' => 'getJsFiles',
);
}
public function getJsFiles(&$jsFiles)
{
$jsFiles[] = 'plugins/Groups/javascripts/plugin.js';
}
}
# Piwik Groups Plugin
## Description
Add your plugin description here.
## FAQ
__My question?__
My answer
## Changelog
Here goes the changelog text.
## Support
Please direct any feedback to ...
\ No newline at end of file
/*!
* Piwik - Web Analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
$(document).ready(function () {
/**
* Please note that this JavaScript file will be loaded only if you
* enable the following setting in your config:
*
* [Debug]
* disable_merged_assets = 1
*/
if('undefined' != (typeof console)) { /* IE8 has no console */
console.log('Plugin file loaded');
}
});
{
"name": "Groups",
"version": "0.1.0",
"description": "A better ACL system.",
"theme": false,
"authors": [
{
"name": "Anton Sarukhanov",
"email": "code@ant.sr",
"homepage": "https://ant.sr"
}
]
}
<strong>Hello world!</strong>
<br/>
The answer to life is {{ answerToLife }}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment