add icons for Character groups

This commit is contained in:
coderkun 2014-04-29 14:18:04 +02:00
commit 2d9a41a5fe
3461 changed files with 594457 additions and 0 deletions

View file

@ -0,0 +1,108 @@
<?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\Feedback;
use Piwik\Common;
use Piwik\Config;
use Piwik\IP;
use Piwik\Mail;
use Piwik\Piwik;
use Piwik\Translate;
use Piwik\Url;
use Piwik\Version;
/**
* API for plugin Feedback
*
* @method static \Piwik\Plugins\Feedback\API getInstance()
*/
class API extends \Piwik\Plugin\API
{
/**
* Sends feedback for a specific feature to the Piwik team or alternatively to the email address configured in the
* config: "feedback_email_address".
*
* @param string $featureName The name of a feature you want to give feedback to.
* @param bool|int $like Whether you like the feature or not
* @param string|bool $message A message containing the actual feedback
*/
public function sendFeedbackForFeature($featureName, $like, $message = false)
{
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasSomeViewAccess();
$featureName = $this->getEnglishTranslationForFeatureName($featureName);
$likeText = 'Yes';
if (empty($like)) {
$likeText = 'No';
}
$body = sprintf("Feature: %s\nLike: %s\n", $featureName, $likeText, $message);
if (!empty($message)) {
$body .= sprintf("Feedback:\n%s\n", $message);
} else {
$body .= "No feedback\n";
}
$this->sendMail($featureName, $body);
}
private function sendMail($subject, $body)
{
$feedbackEmailAddress = Config::getInstance()->General['feedback_email_address'];
$subject = '[ Feedback Feature - Piwik ] ' . $subject;
$body = Common::unsanitizeInputValue($body) . "\n"
. 'Piwik ' . Version::VERSION . "\n"
. 'IP: ' . IP::getIpFromHeader() . "\n"
. 'URL: ' . Url::getReferrer() . "\n";
$mail = new Mail();
$mail->setFrom(Piwik::getCurrentUserEmail());
$mail->addTo($feedbackEmailAddress, 'Piwik Team');
$mail->setSubject($subject);
$mail->setBodyText($body);
@$mail->send();
}
private function findTranslationKeyForFeatureName($featureName)
{
if (empty($GLOBALS['Piwik_translations'])) {
return;
}
foreach ($GLOBALS['Piwik_translations'] as $key => $translations) {
$possibleKey = array_search($featureName, $translations);
if (!empty($possibleKey)) {
return $key . '_' . $possibleKey;
}
}
}
private function getEnglishTranslationForFeatureName($featureName)
{
$loadedLanguage = Translate::getLanguageLoaded();
if ($loadedLanguage == 'en') {
return $featureName;
}
$translationKeyForFeature = $this->findTranslationKeyForFeatureName($featureName);
if (!empty($translationKeyForFeature)) {
Translate::reloadLanguage('en');
$featureName = Piwik::translate($translationKeyForFeature);
Translate::reloadLanguage($loadedLanguage);
return $featureName;
}
return $featureName;
}
}

View file

@ -0,0 +1,34 @@
<?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\Feedback;
use Exception;
use Piwik\Common;
use Piwik\Config;
use Piwik\IP;
use Piwik\Mail;
use Piwik\Nonce;
use Piwik\Piwik;
use Piwik\Url;
use Piwik\Version;
use Piwik\View;
/**
*
*/
class Controller extends \Piwik\Plugin\Controller
{
function index()
{
$view = new View('@Feedback/index');
$this->setGeneralVariablesView($view);
$view->piwikVersion = Version::VERSION;
return $view->render();
}
}

View file

@ -0,0 +1,70 @@
<?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\Feedback;
use Piwik\Menu\MenuTop;
use Piwik\Piwik;
/**
*
*/
class Feedback extends \Piwik\Plugin
{
/**
* @see Piwik\Plugin::getListHooksRegistered
*/
public function getListHooksRegistered()
{
return array(
'AssetManager.getStylesheetFiles' => 'getStylesheetFiles',
'AssetManager.getJavaScriptFiles' => 'getJsFiles',
'Menu.Top.addItems' => 'addTopMenu',
'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys'
);
}
public function addTopMenu()
{
MenuTop::addEntry(
'General_Help',
array('module' => 'Feedback', 'action' => 'index', 'segment' => false),
true,
$order = 20,
$isHTML = false,
$tooltip = Piwik::translate('Feedback_TopLinkTooltip')
);
}
public function getStylesheetFiles(&$stylesheets)
{
$stylesheets[] = "plugins/Feedback/stylesheets/feedback.less";
$stylesheets[] = "plugins/Feedback/angularjs/ratefeature/ratefeature.less";
}
public function getJsFiles(&$jsFiles)
{
$jsFiles[] = "plugins/Feedback/angularjs/ratefeature/ratefeature-model.js";
$jsFiles[] = "plugins/Feedback/angularjs/ratefeature/ratefeature-controller.js";
$jsFiles[] = "plugins/Feedback/angularjs/ratefeature/ratefeature-directive.js";
}
public function getClientSideTranslationKeys(&$translationKeys)
{
$translationKeys[] = 'Feedback_ThankYou';
$translationKeys[] = 'Feedback_RateFeatureTitle';
$translationKeys[] = 'Feedback_RateFeatureThankYouTitle';
$translationKeys[] = 'Feedback_RateFeatureLeaveMessageLike';
$translationKeys[] = 'Feedback_RateFeatureLeaveMessageDislike';
$translationKeys[] = 'Feedback_SendFeedback';
$translationKeys[] = 'Feedback_RateFeatureSendFeedbackInformation';
$translationKeys[] = 'General_Ok';
}
}

View file

@ -0,0 +1,7 @@
thumbs-up.png
https://www.iconfinder.com/icons/83403/thumbs_up_icon#size=32
Creative Commons (Attribution-Share Alike 3.0 Unported)
thumbs-down.png
https://www.iconfinder.com/icons/83402/down_thumbs_icon#size=32
Creative Commons (Attribution-Share Alike 3.0 Unported)

View file

@ -0,0 +1,23 @@
/*!
* Piwik - Web Analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
angular.module('piwikApp').controller('RateFeatureController', function($scope, rateFeatureModel, $filter){
$scope.dislikeFeature = function () {
$scope.like = false;
};
$scope.likeFeature = function () {
$scope.like = true;
};
$scope.sendFeedback = function (message) {
rateFeatureModel.sendFeedbackForFeature($scope.title, $scope.like, message);
$scope.ratingDone = true;
// alert($filter('translate')('Feedback_ThankYou'));
};
});

View file

@ -0,0 +1,22 @@
/*!
* Piwik - Web Analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
/**
* Usage:
* <div piwik-rate-feature title="My Feature Name">
*/
angular.module('piwikApp').directive('piwikRateFeature', function($document, piwik, $filter){
return {
restrict: 'A',
scope: {
title: '@'
},
templateUrl: 'plugins/Feedback/angularjs/ratefeature/ratefeature.html?cb=' + piwik.cacheBuster,
controller: 'RateFeatureController'
};
});

View file

@ -0,0 +1,22 @@
/*!
* Piwik - Web Analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
angular.module('piwikApp').factory('rateFeatureModel', function (piwikApi) {
var model = {};
model.sendFeedbackForFeature = function (featureName, like, message) {
return piwikApi.fetch({
method: 'Feedback.sendFeedbackForFeature',
featureName: featureName,
like: like ? '1' : '0',
message: message + ''
});
};
return model;
});

View file

@ -0,0 +1,38 @@
<div title="{{ 'Feedback_RateFeatureTitle'|translate:title }}" class="ratefeature">
<div class="iconContainer"
ng-mouseenter="view.expanded=true;"
ng-mouseleave="view.expanded=false">
<img ng-click="likeFeature();view.showFeedbackForm=true;"
class="like-icon"
src="plugins/Feedback/angularjs/ratefeature/thumbs-up.png"/>
<img ng-click="dislikeFeature();view.showFeedbackForm=true;"
class="dislike-icon"
ng-show="view.expanded"
src="plugins/Feedback/angularjs/ratefeature/thumbs-down.png"/>
</div>
<div class="ui-confirm ratefeatureDialog" piwik-dialog="view.showFeedbackForm" yes="sendFeedback(view.feedbackMessage)">
<h2>{{ 'Feedback_RateFeatureThankYouTitle'|translate:title }}</h2>
<p ng-if="like">{{ 'Feedback_RateFeatureLeaveMessageLike'|translate }}</p>
<p ng-if="!like">{{ 'Feedback_RateFeatureLeaveMessageDislike'|translate }}</p>
<br />
<div class="messageContainer">
<textarea ng-model="view.feedbackMessage"></textarea>
</div>
<input type="button"
title="{{ 'Feedback_RateFeatureSendFeedbackInformation'|translate }}"
value="{{ 'Feedback_SendFeedback'|translate }}" role="yes"/>
</div>
<div class="ui-confirm ratefeatureDialog" piwik-dialog="ratingDone" yes="">
<h2>{{ 'Feedback_ThankYou'|translate:title }}</h2>
<input type="button" value="{{ 'General_Ok'|translate }}" role="yes"/>
</div>
</div>

View file

@ -0,0 +1,30 @@
.ratefeatureDialog {
text-align: center;
textarea {
margin-top: 5px;
width: 100%;
height: 80px;
}
}
.ratefeature {
font-size: 1px;
.iconContainer {
display: inline-block;
}
.dislike-icon,
.like-icon {
opacity: 0.2;
width: 22px;
height: 22px;
cursor: pointer;
&:hover {
opacity: 0.9;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

View file

@ -0,0 +1,115 @@
#feedback-faq {
color: #5e5e5c;
width: 675px;
font-size: 14px;
strong {
color: #5e5e5c;
}
ul {
list-style: none;
padding: 0 0 0 20px;
font-size: 12px;
line-height: 18px;
}
p {
padding-bottom: 0px;
line-height: 1.7em;
}
a {
color: #5176a0;
text-decoration: none;
}
.piwik-donate-call {
border: 0px;
padding-left: 0px;
padding-top: 0px;
}
.donate-form-instructions {
margin: 0 1.25em 0 0em;
color: #5E5E5C;
}
.piwik-donate-slider {
margin: 1em 0 1em 0em;
}
#piwik-worth {
margin: 0 1em 0 0em;
font-size: 1em;
font-style: normal;
}
.footer {
text-align: center;
a {
color: black;
&:hover {
text-decoration: underline;
}
}
hr {
background-color: #CCC;
height: 1px;
border: 0px;
}
}
.claim {
font-size: 13px;
line-height: 16px;
color: #808080;
margin-bottom: 50px;
margin-top: 15px;
}
.menu {
li {
margin: 0 10px 10px 0px
}
li:not(:first-child) {
&:before {
color: #333;
content: '· ';
}
}
a {
display: inline-block;
padding-right: 10px;
padding-left: 18px;
}
}
.social {
margin-top: 22px;
li {
margin: 0 20px 10px;
}
}
.menu,
.social {
margin: 15px 0 10px;
display: block;
.icon {
width: 15px;
height: 15px;
margin-bottom: 2px;
}
li {
display: inline-block;
}
}
}

View file

@ -0,0 +1,106 @@
{% extends 'dashboard.twig' %}
{% set test_piwikUrl='http://demo.piwik.org/' %}
{% set isPiwikDemo %}{{ piwikUrl == 'http://demo.piwik.org/' or piwikUrl == 'https://demo.piwik.org/'}}{% endset %}
{% block content %}
<div id="feedback-faq" class="admin centerLargeDiv">
<h2 piwik-enriched-headline
feature-name="{{ 'General_Help'|translate }}"
>{{ 'General_AboutPiwikX'|translate(piwikVersion) }}</h2>
<div class="header_full">
<p>{{ 'General_PiwikIsACollaborativeProjectYouCanContributeAndDonate'|translate(
"<a href='?module=Proxy&action=redirect&url=http://piwik.org' target='_blank'>",
"</a>",
"<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/get-involved/'>",
"</a>",
"<a href='#donate'>",
"</a>",
"<a href='?module=Proxy&action=redirect&url=http://piwik.org/team/' target='_blank'>",
"</a>"
)|raw }}
</p>
<br/>
</div>
<h2>{{ 'Do you need help?'|translate }}</h2>
<div class="header_full">
<p> &bull; {{ 'Feedback_ViewUserGuides'|translate("<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/docs/'>","</a>")|raw }}.</p>
<p> &bull; {{ 'Feedback_ViewAnswersToFAQ'|translate("<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/faq/'>","</a>")|raw }}.</p>
<p> &bull; {{ 'Feedback_VisitTheForums'|translate("<a target='_blank' href='?module=Proxy&action=redirect&url=http://forum.piwik.org/'>","</a>")|raw }}.</p>
<br/>
</div>
<h2>{{ 'Feedback_DoYouHaveBugReportOrFeatureRequest'|translate }}</h2>
<div class="header_full">
<p>{{ 'Feedback_HowToCreateIssue'|translate(
"<a target='_blank' href='?module=Proxy&action=redirect&url=http://developer.piwik.org/guides/core-team-workflow%23submitting-a-bug-report'>",
"</a>",
"<a target='_blank' href='?module=Proxy&action=redirect&url=http://developer.piwik.org/guides/core-team-workflow%23submitting-a-feature-request'>",
"</a>",
"<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/register'>",
"</a>",
"<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/login'>",
"</a>",
"<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/newticket'>",
"</a>"
)|raw }}</p>
<br/>
</div>
<h2>{{ 'Feedback_SpecialRequest'|translate }}</h2>
<div class="header_full">
<p>{{ 'Feedback_GetInTouch'|translate }}
<a target='_blank' href="?module=Proxy&action=redirect&url=http://piwik.org/contact/"
>{{ 'Feedback_ContactThePiwikTeam'|translate }}</a>
</p>
<br/>
</div>
<h2 id="donate">{{ 'Feedback_WantToThankConsiderDonating'|translate }}</h2>
{% include "@CoreHome/_donate.twig" with { 'msg':""} %}
<br/>
<div class="footer">
<hr/>
<ul class="social">
<li>
<a target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/newsletter/"><img class="icon" src="plugins/Feedback/images/newsletter.png"></a>
<a target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/newsletter/">Newsletter</a>
</li>
<li>
<a target="_blank" href="http://www.facebook.com/Piwik"><img class="icon" src="plugins/Feedback/images/facebook.png"></a>
<a target="_blank" href="http://www.facebook.com/Piwik">Facebook</a>
</li>
<li>
<a target="_blank" href="http://twitter.com/piwik"><img class="icon" src="plugins/Feedback/images/twitter.png"></a>
<a target="_blank" href="http://twitter.com/piwik">Twitter</a>
</li>
<li>
<a target="_blank" href="http://www.linkedin.com/groups?gid=867857"><img class="icon" src="plugins/Feedback/images/linkedin.png"></a>
<a target="_blank" href="http://www.linkedin.com/groups?gid=867857">Linkedin</a>
</li>
<li>
<a target="_blank" href="https://github.com/piwik/piwik"><img class="icon" src="plugins/Feedback/images/github.png"></a>
<a target="_blank" href="https://github.com/piwik/piwik">GitHub</a>
</li>
</ul>
<ul class="menu">
<li><a target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/blog/">Blog</a></li>
<li><a target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/about/sponsors/">Sponsors</a></li>
<li><a target="_blank" href="?module=Proxy&action=redirect&url=http://developer.piwik.org">Developers</a></li>
<li><a target="_blank" href="?module=Proxy&action=redirect&url=http://plugins.piwik.org">Marketplace</a></li>
<li><a target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/thank-you-all/">Credits</a></li>
</ul>
<p class="claim"><small>{{ 'Feedback_PrivacyClaim'|translate(
"<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/privacy/'>",
"</a>"
)|raw}}</small></p>
</div>
</div>
{% endblock %}