From 036d799273ce0b7a4081bff8c126bb6e26ff86c1 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sun, 24 Aug 2014 14:27:55 +0300 Subject: [PATCH] cleanup --- ipf/form.php | 4 +--- ipf/legacy_orm/orm/record.php | 8 -------- ipf/router.php | 2 +- ipf/shortcuts.php | 6 ------ 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/ipf/form.php b/ipf/form.php index fed4367..a071f38 100644 --- a/ipf/form.php +++ b/ipf/form.php @@ -21,14 +21,12 @@ abstract class IPF_Form implements Iterator protected $is_valid = null; - function __construct($data=null, $extra=array(), $label_suffix=null) + function __construct($data=null, $extra=array()) { if ($data !== null) { $this->data = $data; $this->is_bound = true; } - if ($label_suffix !== null) $this->label_suffix = $label_suffix; - $this->initial = \PFF\Arr::get($extra, 'initial', array()); $this->initFields($extra); $this->f = new IPF_Form_FieldProxy($this); diff --git a/ipf/legacy_orm/orm/record.php b/ipf/legacy_orm/orm/record.php index 2b5b908..8be51ab 100644 --- a/ipf/legacy_orm/orm/record.php +++ b/ipf/legacy_orm/orm/record.php @@ -1178,14 +1178,6 @@ abstract class IPF_ORM_Record extends IPF_ORM_Record_Abstract implements Countab return sprintf('<%s #%d>', get_class($this), $this->_oid); } - public function ModelAdmin() - { - $cn = get_class($this); - if (isset(IPF_Admin_Model::$models[$cn])) - return IPF_Admin_Model::$models[$cn]; - return null; - } - public function SetFromFormData($cleaned_values) { $names = $this->_table->getFieldNames(); diff --git a/ipf/router.php b/ipf/router.php index 9c80df7..91dc75f 100644 --- a/ipf/router.php +++ b/ipf/router.php @@ -71,7 +71,7 @@ class IPF_Router $response = self::response500($req, $e); $response->render(); } - } + } public function match($req) { diff --git a/ipf/shortcuts.php b/ipf/shortcuts.php index 62a25f4..f3609ad 100644 --- a/ipf/shortcuts.php +++ b/ipf/shortcuts.php @@ -21,11 +21,5 @@ final class IPF_Shortcuts $tmpl = new IPF_Template_File($tplfile, IPF_Project_Template::getDefaultTemplateEnvironment()); return $tmpl->render($context); } - - public static function GetFormForModel($model, $data=null, $extra=array(), $label_suffix=null) - { - $extra['model'] = $model; - return new IPF_Form_Model($data, $extra, $label_suffix); - } } -- 2.49.0