J1.5:How to create a custom button

From Joomla! Documentation
(Difference between revisions)
Jump to: navigation, search
(Upload Button)
(Tidied up a bit. This page is useful but needs to be completed.)
Line 1: Line 1:
The scripts below are used for using the back end toolbar when developing components or modules.
+
{{cookiejar}}
 +
{{incomplete}}
 +
The code below is used for adding buttons to the back-end toolbar when developing components and modules.
  
Put this script on your component or module code to make a custom button:
+
==Apply button==
 +
<source lang="php">
 +
JToolBarHelper::apply();
 +
</source>
  
'''JToolBarHelper::custom("task",'''
+
==Back button==
'''"icon",'''
+
<source lang="php">
'''"icon over",'''
+
JToolBarHelper::back();
'''"alt",'''
+
</source>
'''boolean,'''
+
'''boolean);'''
+
  
For a back button you can use this one:
+
==Cancel button==
 +
<source lang="php">
 +
JToolBarHelper::cancel();
 +
</source>
  
'''JToolBarHelper::back();'''
+
==Custom button==
 +
<source lang="php">
 +
JToolBarHelper::custom( 'task', 'icon', 'icon over', 'alt', boolean, boolean );
 +
</source>
  
Calcel button:
+
==Upload button==
     
+
* Method 1:
'''JToolBarHelper::cancel();'''
+
<source lang="php">
 
+
// Add an upload button and view a popup screen width 550 and height 400
Apply button:
+
$alt = "Upload";
 
+
$bar=& JToolBar::getInstance( 'toolbar' );
'''JToolBarHelper::apply();'''
+
$bar->appendButton( 'Popup', 'upload', $alt, 'index.php', 550, 400 );
 
+
</source>
 
+
* Method 2:
== Upload Button ==
+
<source lang="php">
 
+
// You view button for popup media manager tools
You can put ''upload button'' in two ways:
+
JToolBarHelper::media_manager( '/' );
 
+
</source>
* '''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 13:05, 18 June 2008

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
Note

Please note that the content on this page is currently incomplete. Please treat it as a work in progress.

This article was last edited by Chris Davenport (talk| contribs) 4 years ago. (Purge)

The code below is used for adding buttons to the back-end toolbar when developing components and modules.

Contents

Apply button

JToolBarHelper::apply();

Back button

JToolBarHelper::back();

Cancel button

JToolBarHelper::cancel();

Custom button

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

Upload button

  • Method 1:
// Add an upload button and view a popup screen width 550 and height 400
$alt = "Upload";
$bar=& JToolBar::getInstance( 'toolbar' );
$bar->appendButton( 'Popup', 'upload', $alt, 'index.php', 550, 400 );
  • Method 2:
// You view button for popup media manager tools
JToolBarHelper::media_manager( '/' );
Personal tools
Namespaces

Variants
Actions
Navigation
Joomla! Sites
Toolbox