Add config events

@param string $id
@param string $event
197610
protected function addConfigListeners($id, $event)
    {
        if (isset($this->configuredEvents[$id][$event]) || !$this->canAddConfig || !$this->config) {
            return $this;
        }

        // Disable config load now to avoid being triggerd recursively by inner events
        $this->canAddConfig = false;

        $this->config->configureEventManager($this, $id, $event);
        $this->configuredEvents[$id][$event] = true;

        // Add wildcard events if not done, yet
        if (!isset($this->configuredEvents[$id]['*'])) {
            $this->config->configureEventManager($this, $id, '*');
            $this->configuredEvents[$id]['*'] = true;
        }

        $this->canAddConfig = true;
        return $this;
    }
217917
public function editAction(Request $request, $id)
    {
        /** @var ConfiguratorFactory $configuratorFactory */
        $configuratorFactory = $this->getConfiguratorFactory($this->getClassName());
        /** @var CrudConfigurator $crudConfigurator */
        $crudConfigurator = $configuratorFactory->getConfigurator(CrudConfigurator::class);

        $this->isGrantedOr404Error($crudConfigurator, Constants::ACTION_UPDATE);

        $model = $this->findOr404Error($id);
        $form = $crudConfigurator->getForm($model);

        return $this->createOrUpdate($request, $model, $form, Constants::ACTION_UPDATE, $crudConfigurator->getTemplate()->getEdit());
    }
1100860
public function registerClientScript($id)
	{
        $booster = Booster::getBooster();
        $booster->registerAssetJs('bootstrap-modalmanager.js', CClientScript::POS_HEAD);
        $booster->registerAssetCss('bootstrap-modalmanager.css');

		$options = !empty($this->format) ? CJavaScript::encode(array('format' => $this->format)) : '';

		ob_start();
		echo "jQuery('#{$id}').modalmanager({$options})";
		foreach ($this->events as $event => $handler) {
			echo ".on('{$event}', " . CJavaScript::encode($handler) . ")";
		}

		Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $this->getId(), ob_get_clean() . ';');

		foreach ($this->events as $name => $handler) {
			$handler = CJavaScript::encode($handler);
			Yii::app()->getClientScript()->registerScript(
				__CLASS__ . '#' . $id . '_' . $name,
				"jQuery('#{$id}').on('{$name}', {$handler});"
			);
		}
	}
143873
function ( key, value ) {
            YAHOO.log("Firing Config event: " + key + "=" + value, "info", "Config");
            var property = this.config[key];
        
            if (property && property.event) {
                property.event.fire(value);
            } 
        }
602046
public function attach($event)
    {
        $this->attachRows($event);
        $this->attachSeo($event);
        $this->attachAnonsModule($event);
    }
103704
public function updateEventTypeById($id, $fields) {
        $event = new \CEventType();
        if ($event->Update(array('ID' => $id), $fields)) {
            return $id;
        }

        $this->throwException(__METHOD__, 'event type not updated');
    }
1234810
public function addTab(string $id, array $tab): void
	{
		$this->optionTabs[] = array_merge($tab, ['DIV' => $id]);
	}
1152613
public function postEvent($id, $event, $options = [ ]) {
        $data = $options;
        $data['id'] = $id;
        $data['event'] = $event;

        $result = $this->apiPost('event', $data);
        return $result;
    }
303896
public function addEvent(IDS_Event $event)
    {
        $this->clear();
        $this->events[$event->getName()] = $event;

        return $this;
    }
1005449
public function prepareConfig($event)
    {
        if (empty($this->batch_type)) {
            $this->batch_type = null;
        }
        if (isset($this->_configObject)) {
            if (!$this->configObject->validate()) {
                $this->addError('config', 'Invalid configuration');
                $event->isValid = false;
                return false;
            }
            try {
                $attributes = $this->configObject->attributes;
                unset($attributes['model']);
                $this->config = json_encode(['class' => get_class($this->configObject), 'attributes' => $attributes]);
            } catch (\Exception $e) {
                \d($this->_configObject);
                exit;
            }
        } else {
            $this->addError('config', 'Need to provide configuration for this subscription');
            $event->isValid = false;
            return false;
        }
    }
929520
public function setId($id)
    {
        if (is_null($this->id) && ! is_null($id) && ($model = $this->getRepository()->find($id))) {
            $this->id = $id;

            parent::setModel($model);
            $this->getButtons()->setModel($model);
            $this->setModelClass(get_class($model));
        }
    }
657949
public function configureFactory(SystemEvent $event)
    {
        $systemConfig  = $this->getConfig();
        $initialConfig = $systemConfig->getInitialConfig();

        if (isset($initialConfig['cache'])) {
            $cacheConfig = (array) $initialConfig['cache'];
            CacheFactory::setConfig($cacheConfig);
        }
    }
88195
public function addContextEvent($event = [])
    {
        $contactId                       = isset($this->context['id']) ? $this->context['id'] : 0;
        $this->context['event']['id']    = !empty($event['id']) ? (int) $event['id'] : null;
        $this->context['event']['name']  = !empty($event['name']) ? $event['name'] : null;
        $this->context['event']['token'] = null;
        if ($contactId || $this->context['event']['id'] || $this->context['campaign']['id']) {
            $this->context['event']['token'] = $this->eventTokenEncode(
                [
                    $this->context['campaign']['id'],
                    $this->context['event']['id'],
                    $contactId,
                ]
            );
        }
    }
1248461
public function addEvent($event, $eventParams)
    {
        // check if valid rule usage for object_type_id
        $this->validateRule("Events", $event);
        // get required parameters for specific rule
        $requiredParams = Events::GetRequiredParams($event);
        // checking for missing and invalid types for each parameter
        $check_params = $this->_checkParams($requiredParams, $eventParams);
        // if no missing or invalid rule parameters
        if ($check_params)
        {
            $value = $this->_formatParams($eventParams);
            $rule = $event . "(" . $value . ")";
            $this->_events[] = $rule;

            return $this->_events;
        }
        return false;
    }
612486
public function onBlock(BlockEvent $event)
    {
        $identifier = $event->getSetting('id', null);

        if (null === $identifier) {
            return;
        }

        $block = new Block();
        $block->setId(uniqid());
        $block->setSettings($event->getSettings());
        $block->setType($this->blockService->getName());

        $event->addBlock($block);
    }
118610
public function updateEventMessageById($id, $fields) {
        $event = new \CEventMessage;
        if ($event->Update($id, $fields)) {
            return $id;
        }

        $this->throwException(__METHOD__, $event->LAST_ERROR);
    }
253831
public function onEvent(Event $event): void
    {
        if (!$event instanceof GetResponseEvent || !$this->injected) {
            if (null !== ($filter = $this->getFilter())) {
                $this->injectParameters($filter);
            }
        }
    }