function register ($model, $options = 'AdminOptions') { $opt = new $options($model); // Get app name from model $app_name = $opt->meta->app->name; // Save model URL $opt->meta->admin_url = join_path(array($app_name, uncamel($model)), '/'); // Register the entry grouping by app // Start app array if not found if (!$this->registry[$app_name]) { $this->registry[$app_name] = array($opt->get_name() => $opt); } // Or include the new entry else { $this->registry[$app_name][$opt->get_name()] = $opt; } }
function __construct ($obj, $parent) { parent::__construct($obj); $this->parent = $parent; // Block FK from editing $this->get_fk()->editable = false; // Get model-slug from ModelMeta $this->model_slug = uncamel($this->meta->name); // Set field-name format: inline_model_name[sequence_or_id_number][field_name] // $this->field_name_format = $this->model_slug . '[%d][%%s]'; $this->field_name_format = $this->model_slug . '[%s][%%s]'; }