<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mole84</id>
	<title>Joomla! Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mole84"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Mole84"/>
	<updated>2026-08-11T14:13:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:Creating_PDF_views&amp;diff=70693</id>
		<title>J2.5:Creating PDF views</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:Creating_PDF_views&amp;diff=70693"/>
		<updated>2012-08-07T20:35:50Z</updated>

		<summary type="html">&lt;p&gt;Mole84: /* Copying document renderer files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Download the domPDF library ===&lt;br /&gt;
&lt;br /&gt;
Download the  domPDF library from https://code.google.com/p/dompdf/downloads/list&lt;br /&gt;
&lt;br /&gt;
(As of the time of writing the latest version of domPDF was DOMPDF 0.6.0 beta 3)&lt;br /&gt;
&lt;br /&gt;
Open the downloaded zip folder and copy the &#039;dompdf&#039; folder to your site &#039;libraries/&#039; folder.&lt;br /&gt;
&lt;br /&gt;
=== Create the PDF document class ===&lt;br /&gt;
Next, we will create the Joomla PDF document class.&lt;br /&gt;
&lt;br /&gt;
* Create a folder /libraries/joomla/document/pdf&lt;br /&gt;
* create a file called &#039;pdf.php&#039; in this folder.&lt;br /&gt;
* Open the file and paste in this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package		Joomla.Framework&lt;br /&gt;
 * @subpackage	Document&lt;br /&gt;
 * @copyright	Copyright (C) 2005 - 2012 Rob Clayburn&lt;br /&gt;
 * @license		GNU/GPL, see LICENSE.php&lt;br /&gt;
 * Joomla! is free software. This version may have been modified pursuant&lt;br /&gt;
 * to the GNU General Public License, and as distributed it includes or&lt;br /&gt;
 * is derivative of works licensed under the GNU General Public License or&lt;br /&gt;
 * other free or open source software licenses.&lt;br /&gt;
 * See COPYRIGHT.php for copyright notices and details.&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// Check to ensure this file is within the rest of the framework&lt;br /&gt;
defined(&#039;JPATH_BASE&#039;) or die();&lt;br /&gt;
&lt;br /&gt;
require_once(JPATH_LIBRARIES .&#039;/joomla/document/html/html.php&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * DocumentPDF class, provides an easy interface to parse and display a pdf document&lt;br /&gt;
 *&lt;br /&gt;
 * @package		Joomla.Framework&lt;br /&gt;
 * @subpackage	Document&lt;br /&gt;
 * @since		1.5&lt;br /&gt;
 */&lt;br /&gt;
class JDocumentpdf extends JDocumentHTML&lt;br /&gt;
{&lt;br /&gt;
	private $engine	= null;&lt;br /&gt;
&lt;br /&gt;
	private $name = &#039;joomla&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Class constructore&lt;br /&gt;
	 * @param	array	$options Associative array of options&lt;br /&gt;
	 */&lt;br /&gt;
&lt;br /&gt;
	function __construct($options = array())&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct($options);&lt;br /&gt;
&lt;br /&gt;
		//set mime type&lt;br /&gt;
		$this-&amp;gt;_mime = &#039;application/pdf&#039;;&lt;br /&gt;
&lt;br /&gt;
		//set document type&lt;br /&gt;
		$this-&amp;gt;_type = &#039;pdf&#039;;&lt;br /&gt;
&lt;br /&gt;
		if (!$this-&amp;gt;iniDomPdf())&lt;br /&gt;
		{&lt;br /&gt;
			JError::raiseError(500, &#039;No PDF lib found&#039;);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	protected function iniDomPdf()&lt;br /&gt;
	{&lt;br /&gt;
		$file = JPATH_LIBRARIES .&#039;/dompdf/dompdf_config.inc.php&#039;;&lt;br /&gt;
		if (!JFile::exists($file))&lt;br /&gt;
		{&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		if (!defined(&#039;DOMPDF_ENABLE_REMOTE&#039;))&lt;br /&gt;
		{&lt;br /&gt;
			define(&#039;DOMPDF_ENABLE_REMOTE&#039;, true);&lt;br /&gt;
		}&lt;br /&gt;
		//set the font cache directory to Joomla&#039;s tmp directory&lt;br /&gt;
		$config = JFactory::getConfig();&lt;br /&gt;
		if (!defined(&#039;DOMPDF_FONT_CACHE&#039;))&lt;br /&gt;
		{&lt;br /&gt;
			define(&#039;DOMPDF_FONT_CACHE&#039;, $config-&amp;gt;get(&#039;tmp_path&#039;));&lt;br /&gt;
		}&lt;br /&gt;
		require_once($file);&lt;br /&gt;
		// Default settings are a portrait layout with an A4 configuration using millimeters as units&lt;br /&gt;
		$this-&amp;gt;engine =new DOMPDF();&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Sets the document name&lt;br /&gt;
	 * @param   string   $name	Document name&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 */&lt;br /&gt;
&lt;br /&gt;
	public function setName($name = &#039;joomla&#039;)&lt;br /&gt;
	{&lt;br /&gt;
		$this-&amp;gt;name = $name;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Returns the document name&lt;br /&gt;
	 * @return	string&lt;br /&gt;
	 */&lt;br /&gt;
&lt;br /&gt;
	public function getName()&lt;br /&gt;
	{&lt;br /&gt;
		return $this-&amp;gt;name;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Render the document.&lt;br /&gt;
	 * @access public&lt;br /&gt;
	 * @param boolean 	$cache		If true, cache the output&lt;br /&gt;
	 * @param array		$params		Associative array of attributes&lt;br /&gt;
	 * @return	string&lt;br /&gt;
	 */&lt;br /&gt;
&lt;br /&gt;
	function render($cache = false, $params = array())&lt;br /&gt;
	{&lt;br /&gt;
		$pdf = $this-&amp;gt;engine;&lt;br /&gt;
		$data = parent::render();&lt;br /&gt;
 		$this-&amp;gt;fullPaths($data);&lt;br /&gt;
		//echo $data;exit;&lt;br /&gt;
		$pdf-&amp;gt;load_html($data);&lt;br /&gt;
		$pdf-&amp;gt;render();&lt;br /&gt;
		$pdf-&amp;gt;stream($this-&amp;gt;getName() . &#039;.pdf&#039;);&lt;br /&gt;
		return &#039;&#039;;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * (non-PHPdoc)&lt;br /&gt;
	 * @see JDocumentHTML::getBuffer()&lt;br /&gt;
	 */&lt;br /&gt;
&lt;br /&gt;
	public function getBuffer($type = null, $name = null, $attribs = array())&lt;br /&gt;
	{&lt;br /&gt;
		if ($type == &#039;head&#039; || $type == &#039;component&#039;)&lt;br /&gt;
		{&lt;br /&gt;
			return parent::getBuffer($type, $name, $attribs);&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			return &#039;&#039;;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * parse relative images a hrefs and style sheets to full paths&lt;br /&gt;
	 * @param	string	&amp;amp;$data&lt;br /&gt;
	 */&lt;br /&gt;
&lt;br /&gt;
	private function fullPaths(&amp;amp;$data)&lt;br /&gt;
	{&lt;br /&gt;
		$data = str_replace(&#039;xmlns=&#039;, &#039;ns=&#039;, $data);&lt;br /&gt;
		libxml_use_internal_errors(true);&lt;br /&gt;
		try&lt;br /&gt;
		{&lt;br /&gt;
			$ok = new SimpleXMLElement($data);&lt;br /&gt;
			if ($ok)&lt;br /&gt;
			{&lt;br /&gt;
				$uri = JUri::getInstance();&lt;br /&gt;
				$base = $uri-&amp;gt;getScheme() . &#039;://&#039; . $uri-&amp;gt;getHost();&lt;br /&gt;
				$imgs = $ok-&amp;gt;xpath(&#039;//img&#039;);&lt;br /&gt;
				foreach ($imgs as &amp;amp;$img)&lt;br /&gt;
				{&lt;br /&gt;
					if (!strstr($img[&#039;src&#039;], $base))&lt;br /&gt;
					{&lt;br /&gt;
						$img[&#039;src&#039;] = $base . $img[&#039;src&#039;];&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				//links&lt;br /&gt;
				$as = $ok-&amp;gt;xpath(&#039;//a&#039;);&lt;br /&gt;
				foreach ($as as &amp;amp;$a)&lt;br /&gt;
				{&lt;br /&gt;
					if (!strstr($a[&#039;href&#039;], $base))&lt;br /&gt;
					{&lt;br /&gt;
						$a[&#039;href&#039;] = $base . $a[&#039;href&#039;];&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			&lt;br /&gt;
				// css files.&lt;br /&gt;
				$links = $ok-&amp;gt;xpath(&#039;//link&#039;);&lt;br /&gt;
				foreach ($links as &amp;amp;$link)&lt;br /&gt;
				{&lt;br /&gt;
					if ($link[&#039;rel&#039;] == &#039;stylesheet&#039; &amp;amp;&amp;amp; !strstr($link[&#039;href&#039;], $base))&lt;br /&gt;
					{&lt;br /&gt;
						$link[&#039;href&#039;] = $base . $link[&#039;href&#039;];&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				$data = $ok-&amp;gt;asXML();&lt;br /&gt;
			}&lt;br /&gt;
		} catch (Exception $err)&lt;br /&gt;
		{&lt;br /&gt;
			//oho malformed html - if we are debugging the site then show the errors&lt;br /&gt;
			// otherwise continue, but it may mean that images/css/links are incorrect&lt;br /&gt;
			$errors = libxml_get_errors();&lt;br /&gt;
			if (JDEBUG)&lt;br /&gt;
			{&lt;br /&gt;
				echo &amp;quot;&amp;lt;pre&amp;gt;&amp;quot;;print_r($errors);echo &amp;quot;&amp;lt;/pre&amp;gt;&amp;quot;;&lt;br /&gt;
				exit;&lt;br /&gt;
			} &lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Copying document renderer files ===&lt;br /&gt;
&lt;br /&gt;
This class extends the JDocumentHTML class.&lt;br /&gt;
&lt;br /&gt;
As it extends JDocumentHTML, you will need to copy the folder and contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
libraries/joomla/document/html/renderer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;pre&amp;gt;libraries/joomla/document/pdf/renderer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create a PDF view for your component ===&lt;br /&gt;
&lt;br /&gt;
Then for any component you wish to create a pdf view for you should&lt;br /&gt;
&lt;br /&gt;
* copy the view&#039;s view.html.php file and rename it to view.pdf.php.&lt;br /&gt;
&lt;br /&gt;
E.g. to make a PDF view of an article, copy:&lt;br /&gt;
&amp;lt;pre&amp;gt;components/com_content/views/article/view.html.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and rename it to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;components/com_content/views/article/view.pdf.php&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to view a pdf article you need to append &#039;&#039;&#039;&amp;amp;format=pdf&#039;&#039;&#039; to your articles URL.&lt;br /&gt;
&lt;br /&gt;
E.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;http://localhost/index.php?option=com_content&amp;amp;view=article&amp;amp;id=4&amp;amp;format=pdf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you only want to output the components content to the PDF then you should add &#039;&#039;&#039;tmpl=component&#039;&#039;&#039; to the url:&lt;br /&gt;
&lt;br /&gt;
E.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;http://localhost/index.php?option=com_content&amp;amp;view=article&amp;amp;id=4&amp;amp;format=pdf&amp;amp;tmpl=component&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setting the file name ===&lt;br /&gt;
&lt;br /&gt;
By default the PDF file will download as joomla.pdf. To change this:&lt;br /&gt;
&lt;br /&gt;
* Open you view.pdf.php file&lt;br /&gt;
*inside its display() method add this code&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
$document-&amp;gt;setName(&#039;mypdf&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the PDF will now download as mypdf.pdf&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mole84</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5_talk:Creating_PDF_views&amp;diff=70692</id>
		<title>J2.5 talk:Creating PDF views</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5_talk:Creating_PDF_views&amp;diff=70692"/>
		<updated>2012-08-07T20:35:25Z</updated>

		<summary type="html">&lt;p&gt;Mole84: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Has anyone tested this method on Joomla! 2.5?&lt;br /&gt;
EDIT: tested on Joomla! 2.5 and working fine.&lt;/div&gt;</summary>
		<author><name>Mole84</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5_talk:Creating_PDF_views&amp;diff=68373</id>
		<title>J2.5 talk:Creating PDF views</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5_talk:Creating_PDF_views&amp;diff=68373"/>
		<updated>2012-07-17T19:41:45Z</updated>

		<summary type="html">&lt;p&gt;Mole84: Created page with &amp;quot;Has anyone tested this method on Joomla! 2.5?&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Has anyone tested this method on Joomla! 2.5?&lt;/div&gt;</summary>
		<author><name>Mole84</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_create_a_custom_button&amp;diff=9317</id>
		<title>J1.5:How to create a custom button</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_create_a_custom_button&amp;diff=9317"/>
		<updated>2008-07-22T19:44:50Z</updated>

		<summary type="html">&lt;p&gt;Mole84: messed it up earlier&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{cookiejar}}&lt;br /&gt;
{{incomplete}}&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&lt;br /&gt;
The code below is used for adding buttons to the back-end toolbar when developing components and modules.&lt;br /&gt;
==Explanation of  JToolBarHelper button functionality==&lt;br /&gt;
* When you add a JToolBarHelper function into an admin view it will display the icon and preform the corresponding function listed in the controller when pressed.&lt;br /&gt;
* You can modify the default function that is run by using the $this-&amp;gt;registerTask(&#039;add&#039;, &#039;edit&#039;); to redirect logic, in this example a call from the default button add is directed to the edit function.&lt;br /&gt;
&lt;br /&gt;
==Default Buttons / Functions Included with Joomla 1.5==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::title();&lt;br /&gt;
JToolBarHelper::spacer();&lt;br /&gt;
JToolBarHelper::divider();&lt;br /&gt;
JToolBarHelper::custom();&lt;br /&gt;
JToolBarHelper::customX();&lt;br /&gt;
JToolBarHelper::preview();&lt;br /&gt;
JToolBarHelper::help();&lt;br /&gt;
JToolBarHelper::back();&lt;br /&gt;
JToolBarHelper::media_manager();&lt;br /&gt;
JToolBarHelper::addNew();&lt;br /&gt;
JToolBarHelper::addNewX();&lt;br /&gt;
JToolBarHelper::publish();&lt;br /&gt;
JToolBarHelper::publishList();&lt;br /&gt;
JToolBarHelper::makeDefault();&lt;br /&gt;
JToolBarHelper::assign();&lt;br /&gt;
JToolBarHelper::unpublish();&lt;br /&gt;
JToolBarHelper::unpublishList();&lt;br /&gt;
JToolBarHelper::archiveList();&lt;br /&gt;
JToolBarHelper::unarchiveList();&lt;br /&gt;
JToolBarHelper::editList();&lt;br /&gt;
JToolBarHelper::editListX();&lt;br /&gt;
JToolBarHelper::editHtml();&lt;br /&gt;
JToolBarHelper::editHtmlX();&lt;br /&gt;
JToolBarHelper::editCss();&lt;br /&gt;
JToolBarHelper::editCssX();&lt;br /&gt;
JToolBarHelper::deleteList();&lt;br /&gt;
JToolBarHelper::deleteListX();&lt;br /&gt;
JToolBarHelper::trash();&lt;br /&gt;
JToolBarHelper::apply();&lt;br /&gt;
JToolBarHelper::save();&lt;br /&gt;
JToolBarHelper::cancel();&lt;br /&gt;
JToolBarHelper::preferences();&lt;br /&gt;
JToolBarHelper::addEntry();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The icons associated with these functions are stored at:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
www/administrator/templates/khepri/images&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom button==&lt;br /&gt;
* The syntax for a custom button that can be added into a view&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
* Writes a custom option and task button for the button bar&lt;br /&gt;
* @param string The task to perform (picked up by the switch($task) blocks&lt;br /&gt;
* @param string The image to display&lt;br /&gt;
* @param string The image to display when moused over&lt;br /&gt;
* @param string The alt text for the icon image&lt;br /&gt;
* @param boolean True if required to check that a standard list item is checked&lt;br /&gt;
* @param boolean True if required to include callinh hideMainMenu() &lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
JToolBarHelper::custom( &#039;task&#039;, &#039;icon&#039;, &#039;icon over&#039;, &#039;alt&#039;, boolean, boolean );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The Default Admin Toolbar Icons are stored at:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
www/administrator/templates/khepri/images&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From here you will notice that the icons are linked to display through the CSS file at:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
www/administrator/templates/khepri/css/icon.css&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* This icon CSS file is automatically included through the admin template. If we would like to add a custom toolbar icon into an installable component it is useful to follow the same structure. We will have to manually include our new CSS file. &lt;br /&gt;
&lt;br /&gt;
* An example of the icon CSS statement:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
.icon-32-iconname	{ &lt;br /&gt;
	background-image: url(../../images/icon-32-iconfile.png); &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* As you can see iconname and iconfile do not necessarily have to be the same.&lt;br /&gt;
** JToolBarHelper will look for the iconname at the end of .icon-32- and the filename must be preceded by icon-32-&lt;br /&gt;
&lt;br /&gt;
* The following would create this custom toolbar icon, notice the iconname dose not correspond to the actual file name but the CSS allows the reference.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper :: custom( &#039;someFunction&#039;, &#039;iconname.png&#039;, &#039;iconname.png&#039;, &#039;alt text&#039;, false, false );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* You can place your icon file and css file at any point in your installable component, which will allow it to be easily transferable. &lt;br /&gt;
&lt;br /&gt;
* To include a new CSS file to your entire admin side it may be useful to include it in the entry point.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JHTML::_(&#039;stylesheet&#039;, THISCOMPONENTNAME.css&#039;, &#039;components/THISCOMPONENT/assets/css/&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upload button==&lt;br /&gt;
* Method 1:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Add an upload button and view a popup screen width 550 and height 400&lt;br /&gt;
$alt = &amp;quot;Upload&amp;quot;;&lt;br /&gt;
$bar=&amp;amp; JToolBar::getInstance( &#039;toolbar&#039; );&lt;br /&gt;
$bar-&amp;gt;appendButton( &#039;Popup&#039;, &#039;upload&#039;, $alt, &#039;index.php&#039;, 550, 400 );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Method 2:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// You view button for popup media manager tools&lt;br /&gt;
JToolBarHelper::media_manager( &#039;/&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mole84</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_create_a_custom_button&amp;diff=9316</id>
		<title>J1.5:How to create a custom button</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_create_a_custom_button&amp;diff=9316"/>
		<updated>2008-07-22T17:42:55Z</updated>

		<summary type="html">&lt;p&gt;Mole84: /* Explanation of  JToolBarHelper button functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{cookiejar}}&lt;br /&gt;
{{incomplete}}&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&lt;br /&gt;
The code below is used for adding buttons to the back-end toolbar when developing components and modules.&lt;br /&gt;
==Explanation of  JToolBarHelper button functionality==&lt;br /&gt;
* When you add a JToolBarHelper function into an admin view it will display the icon and preform the corresponding function listed in the controller when pressed.&lt;br /&gt;
* You can modify the default function that is run by using the $this-&amp;gt;registerTask(&#039;add&#039;, &#039;edit&#039;); to redirect logic, in this example a call from the default button add is directed to the edit function.&lt;br /&gt;
&lt;br /&gt;
==Default Buttons Included with Joomla 1.5==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::send();&lt;br /&gt;
JToolBarHelper::delete();&lt;br /&gt;
JToolBarHelper::help();&lt;br /&gt;
JToolBarHelper::cancel();&lt;br /&gt;
JToolBarHelper::config();&lt;br /&gt;
JToolBarHelper::apply();&lt;br /&gt;
JToolBarHelper::back();&lt;br /&gt;
JToolBarHelper::forward();&lt;br /&gt;
JToolBarHelper::save();&lt;br /&gt;
JToolBarHelper::edit();&lt;br /&gt;
JToolBarHelper::copy();&lt;br /&gt;
JToolBarHelper::move();&lt;br /&gt;
JToolBarHelper::new();&lt;br /&gt;
JToolBarHelper::upload();&lt;br /&gt;
JToolBarHelper::assign();&lt;br /&gt;
JToolBarHelper::html(); &lt;br /&gt;
JToolBarHelper::css();&lt;br /&gt;
JToolBarHelper::menus();&lt;br /&gt;
JToolBarHelper::publish();&lt;br /&gt;
JToolBarHelper::unpublish ();&lt;br /&gt;
JToolBarHelper::restore();&lt;br /&gt;
JToolBarHelper::trash(); &lt;br /&gt;
JToolBarHelper::archive(); &lt;br /&gt;
JToolBarHelper::unarchive(); &lt;br /&gt;
JToolBarHelper::preview(); &lt;br /&gt;
JToolBarHelper::default();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The icons associated with these functions are stored at:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
www/administrator/templates/khepri/images&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom button==&lt;br /&gt;
* The syntax for a custom button that can be added into a view&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::custom( &#039;task&#039;, &#039;icon&#039;, &#039;icon over&#039;, &#039;alt&#039;, boolean, boolean );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The Default Admin Toolbar Icons are stored at:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
www/administrator/templates/khepri/images&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From here you will notice that the icons are linked to display through the CSS file at:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
www/administrator/templates/khepri/css/icon.css&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* This icon CSS file is automatically included through the admin template. If we would like to add a custom toolbar icon into an installable component it is useful to follow the same structure. We will have to manually include our new CSS file. &lt;br /&gt;
&lt;br /&gt;
* An example of the icon CSS statement:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
.icon-32-iconname	{ &lt;br /&gt;
	background-image: url(../../images/icon-32-iconfile.png); &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* As you can see iconname and iconfile do not necessarily have to be the same.&lt;br /&gt;
** JToolBarHelper will look for the iconname at the end of .icon-32- and the filename must be preceded by icon-32-&lt;br /&gt;
&lt;br /&gt;
* The following would create this custom toolbar icon, notice the iconname dose not correspond to the actual file name but the CSS allows the reference.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper :: custom( &#039;someFunction&#039;, &#039;iconname.png&#039;, &#039;iconname.png&#039;, &#039;alt text&#039;, true, true );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* You can place your icon file and css file at any point in your installable component, which will allow it to be easily transferable. &lt;br /&gt;
&lt;br /&gt;
* To include a new CSS file to your entire admin side it may be useful to include it in the entry point.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JHTML::_(&#039;stylesheet&#039;, THISCOMPONENTNAME.css&#039;, &#039;components/THISCOMPONENT/assets/css/&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upload button==&lt;br /&gt;
* Method 1:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Add an upload button and view a popup screen width 550 and height 400&lt;br /&gt;
$alt = &amp;quot;Upload&amp;quot;;&lt;br /&gt;
$bar=&amp;amp; JToolBar::getInstance( &#039;toolbar&#039; );&lt;br /&gt;
$bar-&amp;gt;appendButton( &#039;Popup&#039;, &#039;upload&#039;, $alt, &#039;index.php&#039;, 550, 400 );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Method 2:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// You view button for popup media manager tools&lt;br /&gt;
JToolBarHelper::media_manager( &#039;/&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mole84</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_create_a_custom_button&amp;diff=9313</id>
		<title>J1.5:How to create a custom button</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_create_a_custom_button&amp;diff=9313"/>
		<updated>2008-07-22T17:14:44Z</updated>

		<summary type="html">&lt;p&gt;Mole84: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{cookiejar}}&lt;br /&gt;
{{incomplete}}&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&lt;br /&gt;
The code below is used for adding buttons to the back-end toolbar when developing components and modules.&lt;br /&gt;
==Explanation of  JToolBarHelper button functionality==&lt;br /&gt;
* When you add a JToolBarHelper function into an admin view it will display the icon and preform the corresponding function listed in the controller when pressed.  &lt;br /&gt;
&lt;br /&gt;
==Default Buttons Included with Joomla 1.5==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::send();&lt;br /&gt;
JToolBarHelper::delete();&lt;br /&gt;
JToolBarHelper::help();&lt;br /&gt;
JToolBarHelper::cancel();&lt;br /&gt;
JToolBarHelper::config();&lt;br /&gt;
JToolBarHelper::apply();&lt;br /&gt;
JToolBarHelper::back();&lt;br /&gt;
JToolBarHelper::forward();&lt;br /&gt;
JToolBarHelper::save();&lt;br /&gt;
JToolBarHelper::edit();&lt;br /&gt;
JToolBarHelper::copy();&lt;br /&gt;
JToolBarHelper::move();&lt;br /&gt;
JToolBarHelper::new();&lt;br /&gt;
JToolBarHelper::upload();&lt;br /&gt;
JToolBarHelper::assign();&lt;br /&gt;
JToolBarHelper::html(); &lt;br /&gt;
JToolBarHelper::css();&lt;br /&gt;
JToolBarHelper::menus();&lt;br /&gt;
JToolBarHelper::publish();&lt;br /&gt;
JToolBarHelper::unpublish ();&lt;br /&gt;
JToolBarHelper::restore();&lt;br /&gt;
JToolBarHelper::trash(); &lt;br /&gt;
JToolBarHelper::archive(); &lt;br /&gt;
JToolBarHelper::unarchive(); &lt;br /&gt;
JToolBarHelper::preview(); &lt;br /&gt;
JToolBarHelper::default();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The icons associated with these functions are stored at:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
www/administrator/templates/khepri/images&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom button==&lt;br /&gt;
* The syntax for a custom button that can be added into a view&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::custom( &#039;task&#039;, &#039;icon&#039;, &#039;icon over&#039;, &#039;alt&#039;, boolean, boolean );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The Default Admin Toolbar Icons are stored at:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
www/administrator/templates/khepri/images&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From here you will notice that the icons are linked to display through the CSS file at:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
www/administrator/templates/khepri/css/icon.css&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* This icon CSS file is automatically included through the admin template. If we would like to add a custom toolbar icon into an installable component it is useful to follow the same structure. We will have to manually include our new CSS file. &lt;br /&gt;
&lt;br /&gt;
* An example of the icon CSS statement:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
.icon-32-iconname	{ &lt;br /&gt;
	background-image: url(../../images/icon-32-iconfile.png); &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* As you can see iconname and iconfile do not necessarily have to be the same.&lt;br /&gt;
** JToolBarHelper will look for the iconname at the end of .icon-32- and the filename must be preceded by icon-32-&lt;br /&gt;
&lt;br /&gt;
* The following would create this custom toolbar icon, notice the iconname dose not correspond to the actual file name but the CSS allows the reference.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper :: custom( &#039;someFunction&#039;, &#039;iconname.png&#039;, &#039;iconname.png&#039;, &#039;alt text&#039;, true, true );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* You can place your icon file and css file at any point in your installable component, which will allow it to be easily transferable. &lt;br /&gt;
&lt;br /&gt;
* To include a new CSS file to your entire admin side it may be useful to include it in the entry point.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JHTML::_(&#039;stylesheet&#039;, THISCOMPONENTNAME.css&#039;, &#039;components/THISCOMPONENT/assets/css/&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upload button==&lt;br /&gt;
* Method 1:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Add an upload button and view a popup screen width 550 and height 400&lt;br /&gt;
$alt = &amp;quot;Upload&amp;quot;;&lt;br /&gt;
$bar=&amp;amp; JToolBar::getInstance( &#039;toolbar&#039; );&lt;br /&gt;
$bar-&amp;gt;appendButton( &#039;Popup&#039;, &#039;upload&#039;, $alt, &#039;index.php&#039;, 550, 400 );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Method 2:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// You view button for popup media manager tools&lt;br /&gt;
JToolBarHelper::media_manager( &#039;/&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mole84</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_create_a_custom_button&amp;diff=9312</id>
		<title>J1.5:How to create a custom button</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_create_a_custom_button&amp;diff=9312"/>
		<updated>2008-07-22T16:57:25Z</updated>

		<summary type="html">&lt;p&gt;Mole84: added instructions for how to create a system for a coustom admin toolbar icon&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{cookiejar}}&lt;br /&gt;
{{incomplete}}&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&lt;br /&gt;
The code below is used for adding buttons to the back-end toolbar when developing components and modules.&lt;br /&gt;
&lt;br /&gt;
==Apply button==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::apply();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Back button==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::back();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cancel button==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::cancel();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom button==&lt;br /&gt;
* The syntax for a custom button that can be added into a view&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper::custom( &#039;task&#039;, &#039;icon&#039;, &#039;icon over&#039;, &#039;alt&#039;, boolean, boolean );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The Default Admin Toolbar Icons are stored at:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
www/administrator/templates/khepri/images&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From here you will notice that the icons are linked to display through the CSS file at:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
www/administrator/templates/khepri/css/icon.css&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* This icon CSS file is automatically included through the admin template. If we would like to add a custom toolbar icon into an installable component it is useful to follow the same structure. We will have to manually include our new CSS file. &lt;br /&gt;
&lt;br /&gt;
* An example of the icon CSS statement:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
.icon-32-iconname	{ &lt;br /&gt;
	background-image: url(../../images/icon-32-iconfile.png); &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* As you can see iconname and iconfile do not necessarily have to be the same.&lt;br /&gt;
** JToolBarHelper will look for the iconname at the end of .icon-32- and the filename must be preceded by icon-32-&lt;br /&gt;
&lt;br /&gt;
* The following would create this custom toolbar icon, notice the iconname dose not correspond to the actual file name but the CSS allows the reference.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JToolBarHelper :: custom( &#039;someFunction&#039;, &#039;iconname.png&#039;, &#039;iconname.png&#039;, &#039;alt text&#039;, true, true );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* You can place your icon file and css file at any point in your installable component, which will allow it to be easily transferable. &lt;br /&gt;
&lt;br /&gt;
* To include a new CSS file to your entire admin side it may be useful to include it in the entry point.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JHTML::_(&#039;stylesheet&#039;, THISCOMPONENTNAME.css&#039;, &#039;components/THISCOMPONENT/assets/css/&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upload button==&lt;br /&gt;
* Method 1:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Add an upload button and view a popup screen width 550 and height 400&lt;br /&gt;
$alt = &amp;quot;Upload&amp;quot;;&lt;br /&gt;
$bar=&amp;amp; JToolBar::getInstance( &#039;toolbar&#039; );&lt;br /&gt;
$bar-&amp;gt;appendButton( &#039;Popup&#039;, &#039;upload&#039;, $alt, &#039;index.php&#039;, 550, 400 );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Method 2:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// You view button for popup media manager tools&lt;br /&gt;
JToolBarHelper::media_manager( &#039;/&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mole84</name></author>
	</entry>
</feed>