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

Language PHP Lines 79
MD5 Hash 7a251f8800976f03acd81a6c85144550 Estimated Cost $800 (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
<?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 links view
 *
 * @package		NewLifeInIT
 * @subpackage	com_redirect
 * @version		1.0
 */
class RedirectViewLinks extends JView
{
	/**
	 * Display the view
	 */
	public function display($tpl = null)
	{
		// Get data from the model.
		$this->state		= $this->get('State');
		$this->items		= $this->get('Items');
		$this->pagination	= $this->get('Pagination');

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

		// Build the state filter options.
		$poptions[] = JHTML::_('select.option','*', 'Any');
		$poptions[] = JHTML::_('select.option', '0', 'Pending');
		$poptions[] = JHTML::_('select.option', '1', 'Active');
		$poptions[] = JHTML::_('select.option', '2', 'Archived');

		// Assign data to the view.
		$this->filter_state = $poptions;

		$this->buildDefaultToolBar();

		// Render the layout.
		parent::display($tpl);
	}

	/**
	 * Build the default toolbar.
	 *
	 * @return	void
	 * @since	1.0
	 */
	protected function buildDefaultToolBar()
	{
		$bar = JToolBar::getInstance('toolbar');

		JToolBarHelper::title('Redirect: Links', 'logo');

		JToolBarHelper::custom('link.activate', 'default.png', 'default_f2.png', 'Activate', true);
		JToolBarHelper::custom('link.archive', 'archive.png', 'archive_f2.png', 'Archive', true);
		JToolBarHelper::custom('link.publish', 'publish.png', 'publish_f2.png', 'Publish', true);
		JToolBarHelper::custom('link.unpublish', 'unpublish.png', 'unpublish_f2.png', 'Unpublish', true);
		JToolBarHelper::custom('link.edit', 'edit.png', 'edit_f2.png', 'Edit', true);
		JToolBarHelper::custom('link.add', 'new.png', 'new_f2.png', 'New', false);
		JToolBarHelper::deleteList('Are you sure you want to remove these links?', 'link.delete', 'delete');

		// We can't use the toolbar helper here because there is no generic popup button.
		JToolBar::getInstance('toolbar')
			->appendButton('Popup', 'help', 'COM_REDIRECT_TOOLBAR_ABOUT', 'index.php?option=com_redirect&view=about&tmpl=component');
	}
}
Back to Top