addOption( 'Button Controls', $module, $action ); // get access to the UI functions $ui = $MIOLO->getUI(); $theme->breakContent(); // get an image located in the html/images dir $img = $ui->getImage( '', 'button_edit.png' ); // create a panel $panel = new MPanel( 'pnlDummy', 'Button Controls' ); // add some buttons $btnForm1 = new MButton( 'btnForm1', 'Submit', 'submit' ); $btnForm2 = new MButton( 'btnForm2', 'Reset', 'reset' ); $btnForm3 = new MButton( 'btnForm3', 'Print', 'print' ); $btnForm4 = new MButton( 'btnForm4', 'Return', 'return' ); $btnForm7 = new MButton( 'btnForm7', 'Execute Javascript', "alert('Javascript!');" ); $btnForm5 = new MButton( 'btnForm5', 'Goto URL', 'window:http://www.miolo.org.br' ); $btnForm6 = new MButton( 'btnForm6', 'Image', 'submit' ); $btnForm6->setImage( $img ); $btnForm6->setAction( MIOLO::getCurrentURL() ); $lnkButton = new MLinkButton( 'lnkButton', 'A label for MLinkButton', MIOLO::getCurrentURL() ); // the first parameter indicates the module or miolo's html/images by default $imgButton = new MImageButton( 'imgButton', 'A label for MImageButton', MIOLO::getCurrentURL(), $img ); // setting css class to the button $inpButton = new MInputButton( 'inpButton', 'MInputButton', MIOLO::getCurrentURL() ); $inpButton->setClass( 'mButtonFind' ); $dropDownButton = new MDropDownButton('dropDownButton', 'Drop Down'); $dropDownButton->addItem(_M('New', $module), 'mImageNew', "alert('New');"); $dropDownButton->addItem(_M('Save', $module), 'mImageSave', "alert('Save');"); $dropDownButton->addSeparator(); $dropDownButton->addItem(_M('Exit', $module), 'mImageExit', "alert('Exit');"); $btnWindow = new MButtonWindow( 'btnWindow', 'Open Google at new window', "http://www.google.com" ); $controls = array( new MLabel( 'Submit MButton: '), $btnForm1, new MSeparator(), new MLabel( 'Reset MButton: '), $btnForm2, new MSeparator(), new MLabel( 'Print MButton: '), $btnForm3, new MSeparator(), new MLabel( 'Return MButton: '), $btnForm4, new MSeparator(), new MLabel( 'URL MButton: '), $btnForm5, new MSeparator(), new MLabel( 'Image in MButton: '), $btnForm6, new MSeparator(), new MLabel( 'Javascript MButton: '), $btnForm7, new MSeparator(), new MLabel( 'MLinkButton: '), $lnkButton, new MSeparator(), new MLabel( 'MImageButton: '), $imgButton, new MSeparator(), new MLabel( 'MInputButton (ex. find): '), $inpButton, new MSeparator(), new MLabel( 'MDropDownButton: '), $dropDownButton, new MSeparator(), new MLabel( 'MButtonWindow: '), $btnWindow, new MSeparator(), ); $panel->addControl( $controls, '', 'left' ); $theme->insertContent( $panel ); // create a link to view the source of this file $src = new ViewSource( __FILE__ ); $theme->appendContent( $src ); ?>