the-art-of-joomla-archive /redirect/code/trunk/administrator/components/com_redirect/views/link/view.html.php

Language PHP Lines 80
MD5 Hash 448517f285dcfabf00592b49532c7f15 Estimated Cost $776 (why?)
Repository https://bitbucket.org/eddieajau/the-art-of-joomla-archive View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/**
 * @version		$Id: view.html.php 390 2010-11-05 11:35:33Z eddieajau $
 * @package		NewLifeInIT
 * @subpackage	com_redirect
 * @copyright	Copyright 2005 - 2010 New Life in IT Pty Ltd. All rights reserved.
 * @license		GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
 * @link		http://www.theartofjoomla.com
 */

defined('_JEXEC') or die('Invalid Request.');

jimport('joomla.application.component.view');

/**
 * The HTML Redirect link view
 *
 * @package		NewLifeInIT
 * @subpackage	com_redirect
 * @version		1.0
 */
class RedirectViewLink extends JView
{
	/**
	 * Display the view
	 *
	 * @access	public
	 */
	function display($tpl = null)
	{
		$this->state	= $this->get('State');
		$this->item		= $this->get('Item');
		$this->form		= $this->get('Form');

		// Check for errors.
		if (count($errors = $this->get('Errors'))) {
			JError::raiseError(500, implode("\n", $errors));
			return false;
		}

		// Bind the item data to the form object.
		if ($this->item) {
			$this->form->bind($this->item);
		}

		$this->buildDefaultToolBar();

		parent::display($tpl);
	}

	/**
	 * Build the default toolbar.
	 *
	 * @return	void
	 * @since	1.0
	 */
	protected function buildDefaultToolBar()
	{
		JRequest::setVar('hidemainmenu', true);

		if (is_object($this->item)) {
			$isNew			= ($this->item->id == 0);
		}
		else {
			$isNew			= true;
		}

		JToolBarHelper::title('Redirect: '.$isNew ? 'Add Link' : 'Edit Link', 'logo');
		JToolBarHelper::custom('link.save2new', 'new.png', 'new_f2.png', 'Save and New', false);
		JToolBarHelper::save('link.save');
		JToolBarHelper::apply('link.apply');
		JToolBarHelper::cancel('link.cancel');

		// We can't use the toolbar helper here because there is no generic popup button.
		//$bar = &JToolBar::getInstance('toolbar');
		//$bar->appendButton('Popup', 'config', 'JX_CONFIGURATION', 'index.php?option=com_redirect&view=config&tmpl=component', 570, 500);

		//JToolBarHelper::help('index', true);
	}
}
Back to Top