primo commit
This commit is contained in:
		
							
								
								
									
										55
									
								
								plugins/system/stats/layouts/field/data.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								plugins/system/stats/layouts/field/data.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,55 @@ | ||||
| <?php | ||||
|  | ||||
| /** | ||||
|  * @package     Joomla.Plugin | ||||
|  * @subpackage  System.stats | ||||
|  * | ||||
|  * @copyright   (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> | ||||
|  * @license     GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  */ | ||||
|  | ||||
| defined('_JEXEC') or die; | ||||
|  | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Language\Text; | ||||
|  | ||||
| /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ | ||||
| $wa = Factory::getApplication()->getDocument()->getWebAssetManager(); | ||||
| $wa->registerAndUseScript('plg_system_stats.stats', 'plg_system_stats/stats.js', [], ['defer' => true], ['core']); | ||||
|  | ||||
| extract($displayData); | ||||
|  | ||||
| /** | ||||
|  * Layout variables | ||||
|  * ----------------- | ||||
|  * @var   string   $autocomplete    Autocomplete attribute for the field. | ||||
|  * @var   boolean  $autofocus       Is autofocus enabled? | ||||
|  * @var   string   $class           Classes for the input. | ||||
|  * @var   string   $description     Description of the field. | ||||
|  * @var   boolean  $disabled        Is this field disabled? | ||||
|  * @var   string   $group           Group the field belongs to. <fields> section in form XML. | ||||
|  * @var   boolean  $hidden          Is this field hidden in the form? | ||||
|  * @var   string   $hint            Placeholder for the field. | ||||
|  * @var   string   $id              DOM id of the field. | ||||
|  * @var   string   $label           Label of the field. | ||||
|  * @var   string   $labelclass      Classes to apply to the label. | ||||
|  * @var   boolean  $multiple        Does this field support multiple values? | ||||
|  * @var   string   $name            Name of the input field. | ||||
|  * @var   string   $onchange        Onchange attribute for the field. | ||||
|  * @var   string   $onclick         Onclick attribute for the field. | ||||
|  * @var   string   $pattern         Pattern (Reg Ex) of value of the form field. | ||||
|  * @var   boolean  $readonly        Is this field read only? | ||||
|  * @var   boolean  $repeat          Allows extensions to duplicate elements. | ||||
|  * @var   boolean  $required        Is this field required? | ||||
|  * @var   integer  $size            Size attribute of the input. | ||||
|  * @var   boolean  $spellcheck      Spellcheck state for the form field. | ||||
|  * @var   string   $validate        Validation rules to apply. | ||||
|  * @var   string   $value           Value attribute of the field. | ||||
|  * @var   array    $options         Options available for this field. | ||||
|  * @var   array    $statsData       Statistics that will be sent to the stats server | ||||
|  */ | ||||
| ?> | ||||
| <?php if (count($statsData)) : ?> | ||||
|     <a href="#" id="js-pstats-data-details-toggler"><?php echo Text::_('PLG_SYSTEM_STATS_MSG_WHAT_DATA_WILL_BE_SENT'); ?></a> | ||||
|     <?php echo $field->render('stats', compact('statsData')); ?> | ||||
| <?php endif; ?> | ||||
							
								
								
									
										49
									
								
								plugins/system/stats/layouts/field/uniqueid.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								plugins/system/stats/layouts/field/uniqueid.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,49 @@ | ||||
| <?php | ||||
|  | ||||
| /** | ||||
|  * @package     Joomla.Plugin | ||||
|  * @subpackage  System.stats | ||||
|  * | ||||
|  * @copyright   (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> | ||||
|  * @license     GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  */ | ||||
|  | ||||
| defined('_JEXEC') or die; | ||||
|  | ||||
| use Joomla\CMS\Language\Text; | ||||
|  | ||||
| extract($displayData); | ||||
|  | ||||
| /** | ||||
|  * Layout variables | ||||
|  * ----------------- | ||||
|  * @var   string   $autocomplete    Autocomplete attribute for the field. | ||||
|  * @var   boolean  $autofocus       Is autofocus enabled? | ||||
|  * @var   string   $class           Classes for the input. | ||||
|  * @var   string   $description     Description of the field. | ||||
|  * @var   boolean  $disabled        Is this field disabled? | ||||
|  * @var   string   $group           Group the field belongs to. <fields> section in form XML. | ||||
|  * @var   boolean  $hidden          Is this field hidden in the form? | ||||
|  * @var   string   $hint            Placeholder for the field. | ||||
|  * @var   string   $id              DOM id of the field. | ||||
|  * @var   string   $label           Label of the field. | ||||
|  * @var   string   $labelclass      Classes to apply to the label. | ||||
|  * @var   boolean  $multiple        Does this field support multiple values? | ||||
|  * @var   string   $name            Name of the input field. | ||||
|  * @var   string   $onchange        Onchange attribute for the field. | ||||
|  * @var   string   $onclick         Onclick attribute for the field. | ||||
|  * @var   string   $pattern         Pattern (Reg Ex) of value of the form field. | ||||
|  * @var   boolean  $readonly        Is this field read only? | ||||
|  * @var   boolean  $repeat          Allows extensions to duplicate elements. | ||||
|  * @var   boolean  $required        Is this field required? | ||||
|  * @var   integer  $size            Size attribute of the input. | ||||
|  * @var   boolean  $spellcheck      Spellcheck state for the form field. | ||||
|  * @var   string   $validate        Validation rules to apply. | ||||
|  * @var   string   $value           Value attribute of the field. | ||||
|  * @var   array    $options         Options available for this field. | ||||
|  */ | ||||
| ?> | ||||
| <input type="hidden" name="<?php echo $name; ?>" id="<?php echo $id; ?>" value="<?php echo htmlspecialchars($value, ENT_QUOTES, 'UTF-8'); ?>"> | ||||
| <button class="btn btn-secondary" type="button" id="js-pstats-reset-uid"> | ||||
|     <span class="icon-sync"></span> <?php echo Text::_('PLG_SYSTEM_STATS_RESET_UNIQUE_ID'); ?> | ||||
| </button> | ||||
							
								
								
									
										47
									
								
								plugins/system/stats/layouts/message.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								plugins/system/stats/layouts/message.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,47 @@ | ||||
| <?php | ||||
|  | ||||
| /** | ||||
|  * @package     Joomla.Plugin | ||||
|  * @subpackage  System.stats | ||||
|  * | ||||
|  * @copyright   (C) 2015 Open Source Matters, Inc. <https://www.joomla.org> | ||||
|  * @license     GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  */ | ||||
|  | ||||
| defined('_JEXEC') or die; | ||||
|  | ||||
| use Joomla\CMS\Language\Text; | ||||
| use Joomla\Registry\Registry; | ||||
|  | ||||
| extract($displayData); | ||||
|  | ||||
| /** | ||||
|  * Layout variables | ||||
|  * ----------------- | ||||
|  * @var  \Joomla\Plugin\System\Stats\Extension\Stats  $plugin        Plugin rendering this layout | ||||
|  * @var  Registry                                     $pluginParams  Plugin parameters | ||||
|  * @var  array                                        $statsData     Array containing the data that will be sent to the stats server | ||||
|  */ | ||||
| ?> | ||||
|  | ||||
| <joomla-alert type="info" dismiss class="js-pstats-alert hidden" role="alertdialog" close-text="<?php echo Text::_('JCLOSE'); ?>" aria-labelledby="alert-stats-heading"> | ||||
|     <div class="alert-heading" id="alert-stats-heading"><?php echo Text::_('PLG_SYSTEM_STATS_LABEL_MESSAGE_TITLE'); ?></div> | ||||
|     <div> | ||||
|         <div class="alert-message"> | ||||
|             <p> | ||||
|                 <?php echo Text::_('PLG_SYSTEM_STATS_MSG_JOOMLA_WANTS_TO_SEND_DATA'); ?> | ||||
|             </p> | ||||
|             <p> | ||||
|                 <a href="#" class="js-pstats-btn-details alert-link"><?php echo Text::_('PLG_SYSTEM_STATS_MSG_WHAT_DATA_WILL_BE_SENT'); ?></a> | ||||
|             </p> | ||||
|             <?php | ||||
|                 echo $plugin->render('stats', compact('statsData')); | ||||
|             ?> | ||||
|             <p class="fw-bold"><?php echo Text::_('PLG_SYSTEM_STATS_MSG_ALLOW_SENDING_DATA'); ?></p> | ||||
|             <p class="actions"> | ||||
|                 <button type="button" class="btn btn-primary js-pstats-btn-allow-never"><?php echo Text::_('PLG_SYSTEM_STATS_BTN_NEVER_SEND'); ?></button> | ||||
|                 <button type="button" class="btn btn-primary js-pstats-btn-allow-always"><?php echo Text::_('PLG_SYSTEM_STATS_BTN_SEND_ALWAYS'); ?></button> | ||||
|             </p> | ||||
|         </div> | ||||
|     </div> | ||||
| </joomla-alert> | ||||
							
								
								
									
										47
									
								
								plugins/system/stats/layouts/stats.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								plugins/system/stats/layouts/stats.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,47 @@ | ||||
| <?php | ||||
|  | ||||
| /** | ||||
|  * @package     Joomla.Plugin | ||||
|  * @subpackage  System.stats | ||||
|  * | ||||
|  * @copyright   (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> | ||||
|  * @license     GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  */ | ||||
|  | ||||
| defined('_JEXEC') or die; | ||||
|  | ||||
| use Joomla\CMS\Language\Text; | ||||
|  | ||||
| extract($displayData); | ||||
|  | ||||
| /** | ||||
|  * Layout variables | ||||
|  * ----------------- | ||||
|  * @var   array  $statsData  Array containing the data that will be sent to the stats server | ||||
|  */ | ||||
|  | ||||
| $versionFields = ['php_version', 'db_version', 'cms_version']; | ||||
| ?> | ||||
| <table class="table mb-3 d-none" id="js-pstats-data-details"> | ||||
|     <caption class="visually-hidden"> | ||||
|         <?php echo Text::_('PLG_SYSTEM_STATS_STATISTICS'); ?> | ||||
|     </caption> | ||||
|     <thead> | ||||
|         <tr> | ||||
|             <th scope="col" class="w-15"> | ||||
|                 <?php echo Text::_('PLG_SYSTEM_STATS_SETTING'); ?> | ||||
|             </th> | ||||
|             <th scope="col"> | ||||
|                 <?php echo Text::_('PLG_SYSTEM_STATS_VALUE'); ?> | ||||
|             </th> | ||||
|         </tr> | ||||
|     </thead> | ||||
|     <tbody> | ||||
|     <?php foreach ($statsData as $key => $value) : ?> | ||||
|         <tr> | ||||
|             <th scope="row"><?php echo Text::_('PLG_SYSTEM_STATS_LABEL_' . strtoupper($key)); ?></th> | ||||
|             <td><?php echo in_array($key, $versionFields) ? (preg_match('/\d+(?:\.\d+)+/', $value, $matches) ? $matches[0] : $value) : $value; ?></td> | ||||
|         </tr> | ||||
|     <?php endforeach; ?> | ||||
|     </tbody> | ||||
| </table> | ||||
		Reference in New Issue
	
	Block a user