<commit_before><?php
abstract class Kwf_Controller_Action_Auto_Synctree extends Kwf_Controller_Action_Auto_Abstract
{
    const ADD_LAST = 0;
    const ADD_FIRST = 1;

    protected $_primaryKey;
    protected $_table;
    protected $_tableName;
    protected $_model;
    protected $_modelName;
    protected $_filters;

    protected $_icons = array (
        'root'      => 'folder',
        'default'   => 'table',
        'edit'      => 'table_edit',
        'invisible' => 'table_key',
        'add'       => 'table_add',
        'delete'    => 'table_delete'
    );
    protected $_textField = 'name';
    protected $_parentField = 'parent_id';
    protected $_buttons = array(
        'add'       => true,
        'edit'      => false,
        'delete'    => true,
        'invisible' => null,
        'reload'    => true
    );
    protected $_rootText = 'Root';
    protected $_rootVisible = true;
    protected $_hasPosition; // Gibt es ein pos-Feld
    protected $_editDialog;
    private $_openedNodes = array();
    protected $_addPosition = self::ADD_FIRST;
    protected $_enableDD;
    protected $_defaultOrder;
    protected $_rootParentValue = null;

    public function indexAction()
    {
        $this->view->controllerUrl = $this->getRequest()->getPathInfo();
        $this->view->xtype = 'kwf.autotreesync';
    }

    public function setTable($table)
    {
        $this->_model = new Kwf_Model_Db(array(
            'table' => $table
        ));
    }

    protected function _init() {}

    public function preDispatch()
    {
        parent::preDispatch();

        if (isset($this->_tableName)) {
            $this->_table = new $this->_tableName();
        } else if (isset($this->_modelName)) {
            $this->_model = new $this->_modelName();
        }
        if (isset($this->_table)) {
            $this->_model = new Kwf_Model_Db(array('table' => $this->_table));
        }
        if (!isset($this->_model)) {
            throw new Kwf_Exception('$_model oder $_modelName not set');
        }

        $this->_filters = new Kwf_Collection();
<commit_msg>tree-controller: _model can be string now<commit_after><?php
abstract class Kwf_Controller_Action_Auto_Synctree extends Kwf_Controller_Action_Auto_Abstract
{
    const ADD_LAST = 0;
    const ADD_FIRST = 1;

    protected $_primaryKey;
    protected $_table;
    protected $_tableName;
    protected $_model;
    protected $_modelName;
    protected $_filters;

    protected $_icons = array (
        'root'      => 'folder',
        'default'   => 'table',
        'edit'      => 'table_edit',
        'invisible' => 'table_key',
        'add'       => 'table_add',
        'delete'    => 'table_delete'
    );
    protected $_textField = 'name';
    protected $_parentField = 'parent_id';
    protected $_buttons = array(
        'add'       => true,
        'edit'      => false,
        'delete'    => true,
        'invisible' => null,
        'reload'    => true
    );
    protected $_rootText = 'Root';
    protected $_rootVisible = true;
    protected $_hasPosition; // Gibt es ein pos-Feld
    protected $_editDialog;
    private $_openedNodes = array();
    protected $_addPosition = self::ADD_FIRST;
    protected $_enableDD;
    protected $_defaultOrder;
    protected $_rootParentValue = null;

    public function indexAction()
    {
        $this->view->controllerUrl = $this->getRequest()->getPathInfo();
        $this->view->xtype = 'kwf.autotreesync';
    }

    public function setTable($table)
    {
        $this->_model = new Kwf_Model_Db(array(
            'table' => $table
        ));
    }

    protected function _init() {}

    public function preDispatch()
    {
        parent::preDispatch();

        if (isset($this->_tableName)) {
            $this->_table = new $this->_tableName();
        } else if (isset($this->_modelName)) {
            $this->_model = new $this->_modelName();
        }
        if (isset($this->_table)) {
            $this->_model = new Kwf_Model_Db(array('table' => $this->_table));
        }
        if (!isset($this->_model)) {
            throw new Kwf_Exception('$_model oder $_modelName not set');
        }
        if (is_string($this->_model)) {
            $this->_model = Kwf_Model_Abstract::getInstance($this->_model);
        }

        $this->_filters = new Kwf_Collection();

{'fraction_non_alphanumeric': 0.13743093922651933, 'fraction_numerical': 0.0009208103130755065, 'mean_word_length': 2.3041825095057034, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 68, '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': '4997230', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1253, 'n_words': 281}