thank you for the answer.
i understand the problem about backwards compatibility.
maybe an idea :
before :
Code: Select all
function LoadFormMethods()
{
if (!$this->modform)
{
require_once(cms_join_path(dirname(__FILE__), 'module_support', 'modform.inc.php'));
$this->modform = true;
}
}
function CreateInputText($id, $name, $value='', $size='10', $maxlength='255', $addttext='')
{
$this->LoadFormMethods();
return cms_module_CreateInputText($this, $id, $name, $value, $size, $maxlength, $addttext);
}
could be
Code: Select all
function LoadFormMethods()
{
if (empty($this->modform))
{
require_once(cms_join_path(dirname(__FILE__), 'module_support', 'modform.inc.php'));
$this->modform = Modform::getInstance(); //static access
}
}
function CreateInputText($id, $name, $value='', $size='10', $maxlength='255', $addttext='')
{
$this->LoadFormMethods();
return $this->modform->cms_module_CreateInputText($this, $id, $name, $value, $size, $maxlength, $addttext);
}
and transforming modform.inc.php into a new static class : Modform
so my code could be :
in classes which extend cms Module class or
Code: Select all
require_once(cms_join_path(dirname(__FILE__), 'module_support', 'modform.inc.php'));
$html_tools = Modform::getInstance();
$mod->CreateInputPassword(...);
in other classes (like toolbox)
obviously i'm not sure ... all code is assumed
I think I'll test at home by converting the file into a static class and see if some lines of code can't be used in static.
I will give news of my tests
