<commit_before><?php
class Kwc_Basic_ImageEnlarge_EnlargeTag_ImagePage_Events extends Kwc_Abstract_Events
{
    public function getListeners()
    {
        $ret = parent::getListeners();
        $ret[] = array(
            'event' => 'Kwf_Component_Event_Media_Changed',
            'callback' => 'onMediaChanged'
        );
        return $ret;
    }

    public function onMediaChanged(Kwf_Component_Event_Media_Changed $event)
    {
        $components = Kwf_Component_Data_Root::getInstance()
            ->getComponentById($event->componentId, array('ignoreVisible'=>true))
            ->getChildComponents(array('componentClass' => $this->_class));
        foreach ($components as $component) {
            $this->fireEvent(new Kwf_Component_Event_Component_ContentChanged(
                $this->_class, $component->dbId
            ));<commit_msg>only listen to Media_Changed for classes where ImagePage is a child page from<commit_after><?php
class Kwc_Basic_ImageEnlarge_EnlargeTag_ImagePage_Events extends Kwc_Abstract_Events
{
    public function getListeners()
    {
        $ret = parent::getListeners();

        //find components that can create ourself ($this->_class)
        foreach (Kwc_Abstract::getComponentClasses() as $class) {
            if (in_array('Kwc_Abstract_Image_Component', Kwc_Abstract::getParentClasses($class))) {
                if (Kwc_Abstract::getChildComponentClasses($class, array('componentClass'=>$this->_class))) {

                    $ret[] = array(
                        'class' => $class,
                        'event' => 'Kwf_Component_Event_Media_Changed',
                        'callback' => 'onMediaChanged'
                    );

                }
            }
        }
    }

    public function onMediaChanged(Kwf_Component_Event_Media_Changed $event)
    {
        $components = Kwf_Component_Data_Root::getInstance()
            ->getComponentById($event->componentId, array('ignoreVisible'=>true))
            ->getChildComponents(array('componentClass' => $this->_class));
        foreach ($components as $component) {
            $this->fireEvent(new Kwf_Component_Event_Component_ContentChanged(
                $this->_class, $component->dbId
            ));
{'fraction_non_alphanumeric': 0.11061352440662786, 'fraction_numerical': 0.0, 'mean_word_length': 2.650326797385621, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '411858', 'n_tokens_mistral': 597, 'n_tokens_neox': 580, 'n_words': 101}