Server : Apache System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64 User : palandch ( 1163) PHP Version : 7.1.33 Disable Function : NONE Directory : /home/palandch/www/core/model/modx/processors/system/dashboard/widget/ |
<?php /** * Removes multiple Dashboard Widgets * * @var modX $modx * @var array $scriptProperties * @var modProcessor $this * * @package modx * @subpackage processors.system.dashboard.widget */ class modDashboardWidgetRemoveMultipleProcessor extends modProcessor { public function checkPermissions() { return $this->modx->hasPermission('dashboards'); } public function getLanguageTopics() { return array('dashboards'); } public function process() { $widgets = $this->getProperty('widgets',null); if (empty($widgets)) { return $this->failure($this->modx->lexicon('widget_err_ns')); } $widgetIds = is_array($widgets) ? $widgets : explode(',',$widgets); foreach ($widgetIds as $widgetId) { /** @var modDashboardWidget $widget */ $widget = $this->modx->getObject('modDashboardWidget',$widgetId); if (empty($widget)) { continue; } if ($widget->remove() == false) { $this->modx->log(modX::LOG_LEVEL_ERROR,$this->modx->lexicon('widget_err_remove')); continue; } $this->modx->logManagerAction('dashboard_widget_remove','modDashboardWidget',$widget->get('id')); } return $this->success(); } } return 'modDashboardWidgetRemoveMultipleProcessor';