예제 #1
0
 /**
  * @param $args
  *
  * @return false|void
  */
 public function unregisterWidgets($args)
 {
     if (!SecurityUtil::checkPermission('Dashboard::', '::', ACCESS_ADMIN)) {
         return LogUtil::registerPermissionError();
     }
     return Dashboard_Util::unregisterWidgets($args['module']);
 }
예제 #2
0
 /**
  * On an module remove hook call this listener
  *
  * Listens for the 'user.account.create' event.
  *
  * @param Zikula_Event $event Event.
  */
 public static function onCreateUser(Zikula_Event $event)
 {
     if (!ModUtil::getVar('Dashboard', 'widgetsnewuser', false)) {
         return;
     }
     $user = $event->getSubject();
     $helper = new Dashboard_Helper_WidgetHelper(ServiceUtil::getService('doctrine.entitymanager'));
     $widgets = $helper->getRegisteredWidgets($user['uid']);
     foreach ($widgets as $widget) {
         Dashboard_Util::addUserWidget($user['uid'], $widget);
     }
 }
예제 #3
0
 public function removeWidget()
 {
     $this->checkCsrfToken();
     if (!SecurityUtil::checkPermission('Dashboard::', '::', ACCESS_READ)) {
         return LogUtil::registerPermissionError();
     }
     $id = $this->request->request->get('id', null);
     if (null === $id) {
         throw new Exception($this->__('id not specified'));
     }
     Dashboard_Util::removeUserWidget($id);
     return $this->redirect(ModUtil::url('Dashboard', 'user', 'view'));
 }
예제 #4
0
 /**
  * On an module remove hook call this listener
  *
  * Listens for the 'user.account.delete' event.
  *
  * @param Zikula_Event $event Event.
  */
 public static function onRemoveUser(Zikula_Event $event)
 {
     $user = $event->getSubject();
     Dashboard_Util::removeUserWidgets($user['uid']);
 }
예제 #5
0
 /**
  * On an module remove hook call this listener
  *
  * Listens for the 'installer.module.uninstalled' event.
  *
  * @param Zikula_Event $event Event.
  *
  * @return void
  */
 public static function onUninstallModule(Zikula_Event $event)
 {
     $moduleName = $event['name'];
     Dashboard_Util::unregisterWidgets($moduleName);
 }