public function init()
{
$this->mode = @$_POST['EventTypeModuleMode'] ? 'update' : 'create';
if (isset($_GET['ajax']) && preg_match('/^[a-zA-Z0-9_]+$/', $_GET['ajax'])) {
if ($_GET['ajax'] == 'table_fields') {
self::dump_table_fields($_GET['table']);
} elseif ($_GET['ajax'] == 'field_unique_values') {
self::dump_field_unique_values($_GET['table'], $_GET['field']);
} elseif ($_GET['ajax'] == 'dump_field_unique_values_multi') {
self::dump_field_unique_values_multi($_GET['table'], $_GET['field']);
} elseif ($_GET['ajax'] == 'getEyedrawSize') {
self::getEyedrawSize($_GET['class']);
} elseif ($_GET['ajax'] == 'event_type_properties') {
self::eventTypeProperties($_GET['event_type_id']);
} else {
if (file_exists("protected/gii/EventTypeModule/views/{$_GET['ajax']}.php")) {
Yii::app()->getController()->renderPartial($_GET['ajax'], $_GET);
}
}
Yii::app()->end();
}
if (!empty($_POST)) {
$this->validate_form();
}
parent::init();
}