I have made a custom brick by adding another xx extends Am_form_brick class to the library/Am/Form/Brick.php file but is there a way to add a custom brick without editing this file so my custom code wont be overwritten on an upgrade?
sure. to make it efficient, it must be done from a separate file in the plugin. file application/default/plugins/misc/myplugin/myplugin.php PHP: class Am_Plugin_Myplugin extends Am_Plugin{ function onLoadBricks(Am_Event $event) { require_once dirname(__FILE__) . '/brick.php'; }} file application/default/plugins/misc/myplugin/brick.php PHP: class Am_Form_Brick_Mybrick extends Am_Form_Brick{ protected $labels = array( 'Tada', ); public function __construct($id = null, $config = null) { $this->name = ___("Sample Myplugin Brick"); parent::__construct($id, $config); } public function insertBrick(HTML_QuickForm2_Container $form) { // using HTML_QuickForm2 elements $form->addText('_testfield')->setLabel($this->___('Tada')); }}