\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82
| Path : /var/www/html/ob-wp-eski/pwk/plugins/ExamplePlugin/Widgets/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : //var/www/html/ob-wp-eski/pwk/plugins/ExamplePlugin/Widgets/MyExampleWidget.php |
<?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\ExamplePlugin\Widgets;
use Piwik\Widget\Widget;
use Piwik\Widget\WidgetConfig;
use Piwik\View;
/**
* This class allows you to add your own widget to the Piwik platform. In case you want to remove widgets from another
* plugin please have a look at the "configureWidgetsList()" method.
* To configure a widget simply call the corresponding methods as described in the API-Reference:
* http://developer.piwik.org/api-reference/Piwik/Plugin\Widget
*/
class MyExampleWidget extends Widget
{
public static function configure(WidgetConfig $config)
{
/**
* Set the category the widget belongs to. You can reuse any existing widget category or define
* your own category.
*/
$config->setCategoryId('About Piwik');
/**
* Set the subcategory the widget belongs to. If a subcategory is set, the widget will be shown in the UI.
*/
// $config->setSubcategoryId('General_Overview');
/**
* Set the name of the widget belongs to.
*/
$config->setName('Example Widget Name');
/**
* Set the order of the widget. The lower the number, the earlier the widget will be listed within a category.
*/
$config->setOrder(99);
/**
* Optionally set URL parameters that will be used when this widget is requested.
* $config->setParameters(array('myparam' => 'myvalue'));
*/
/**
* Define whether a widget is enabled or not. For instance some widgets might not be available to every user or
* might depend on a setting (such as Ecommerce) of a site. In such a case you can perform any checks and then
* set `true` or `false`. If your widget is only available to users having super user access you can do the
* following:
*
* $config->setIsEnabled(\Piwik\Piwik::hasUserSuperUserAccess());
* or
* if (!\Piwik\Piwik::hasUserSuperUserAccess())
* $config->disable();
*/
}
/**
* This method renders the widget. It's on you how to generate the content of the widget.
* As long as you return a string everything is fine. You can use for instance a "Piwik\View" to render a
* twig template. In such a case don't forget to create a twig template (eg. myViewTemplate.twig) in the
* "templates" directory of your plugin.
*
* @return string
*/
public function render()
{
// or: return $this->renderTemplate('myViewTemplate', array(...view variables...));
return '<div class="widgetBody">My Widget Text</div>';
}
}