PageRenderTime 26ms CodeModel.GetById 22ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 0ms

/administrator/components/com_media/views/imageslist/view.html.php

https://bitbucket.org/eternaware/joomus
PHP | 67 lines | 41 code | 11 blank | 15 comment | 5 complexity | f1813831eb128e8597328ae7956d4caf MD5 | raw file
Possible License(s): LGPL-2.1
 1<?php
 2/**
 3 * @package     Joomla.Administrator
 4 * @subpackage  com_media
 5 *
 6 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 7 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 8 */
 9
10defined('_JEXEC') or die;
11
12/**
13 * HTML View class for the Media component
14 *
15 * @package     Joomla.Administrator
16 * @subpackage  com_media
17 * @since       1.0
18 */
19class MediaViewImagesList extends JViewLegacy
20{
21	public function display($tpl = null)
22	{
23		// Do not allow cache
24		JResponse::allowCache(false);
25
26		$app = JFactory::getApplication();
27
28		$lang	= JFactory::getLanguage();
29
30		JHtml::_('stylesheet', 'media/popup-imagelist.css', array(), true);
31		if ($lang->isRTL()) :
32			JHtml::_('stylesheet', 'media/popup-imagelist_rtl.css', array(), true);
33		endif;
34
35		$document = JFactory::getDocument();
36		$document->addScriptDeclaration("var ImageManager = window.parent.ImageManager;");
37
38		$images = $this->get('images');
39		$folders = $this->get('folders');
40		$state = $this->get('state');
41
42		$this->baseURL = COM_MEDIA_BASEURL;
43		$this->images = &$images;
44		$this->folders = &$folders;
45		$this->state = &$state;
46
47		parent::display($tpl);
48	}
49
50	function setFolder($index = 0)
51	{
52		if (isset($this->folders[$index])) {
53			$this->_tmp_folder = &$this->folders[$index];
54		} else {
55			$this->_tmp_folder = new JObject;
56		}
57	}
58
59	function setImage($index = 0)
60	{
61		if (isset($this->images[$index])) {
62			$this->_tmp_img = &$this->images[$index];
63		} else {
64			$this->_tmp_img = new JObject;
65		}
66	}
67}