J1.5

Difference between revisions of "How to create a custom button"

From Joomla! Documentation

Line 15: Line 15:
  
 
Calcel button:
 
Calcel button:
'''
+
     
JToolBarHelper::cancel();'''
+
'''JToolBarHelper::cancel();'''
  
 
Apply button:
 
Apply button:
  
 
'''JToolBarHelper::apply();'''
 
'''JToolBarHelper::apply();'''
 +
 +
 +
== Upload Button ==
 +
 +
You can put ''upload button'' in two ways:
 +
 +
* '''First:'''
 +
 +
                ''// Add an upload button and view a popup screen large 550 and height 400''
 +
 +
''$alt = "Upload";''
 +
                ''$bar=& JToolBar::getInstance("toolbar");''
 +
                ''$bar->appendButton( "Popup", "upload", $alt, "index.php", 550, 400 );''
 +
 +
* '''Second:'''
 +
 +
                ''// You view button for popup media manager tools''
 +
                ''JToolBarHelper::media_manager('/');''

Revision as of 12:01, 18 June 2008

The "J1.5" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

The scripts below are used for using the back end toolbar when developing components or modules.

Put this script on your component or module code to make a custom button:

JToolBarHelper::custom("task", "icon", "icon over", "alt", boolean, boolean);

For a back button you can use this one:

JToolBarHelper::back();

Calcel button:

JToolBarHelper::cancel();

Apply button:

JToolBarHelper::apply();


Upload Button[edit]

You can put upload button in two ways:

  • First:
                // Add an upload button and view a popup screen large 550 and height 400

$alt = "Upload";

                $bar=& JToolBar::getInstance("toolbar");
                $bar->appendButton( "Popup", "upload", $alt, "index.php", 550, 400 );
  • Second:
                // You view button for popup media manager tools
                JToolBarHelper::media_manager('/');