Files
@ 9a29f073412c
Branch filter:
Location: hot67beta/administrator/components/com_media/views/media/view.html.php - annotation
9a29f073412c
3.7 KiB
text/x-php
pad
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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 | <?php
/**
* @version $Id: view.html.php 11236 2008-11-02 02:44:35Z ian $
* @package Joomla
* @subpackage Media
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
/**
* HTML View class for the Media component
*
* @static
* @package Joomla
* @subpackage Media
* @since 1.0
*/
class MediaViewMedia extends JView
{
function display($tpl = null)
{
global $mainframe;
$config =& JComponentHelper::getParams('com_media');
$style = $mainframe->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
$listStyle = "
<ul id=\"submenu\">
<li><a id=\"thumbs\" onclick=\"MediaManager.setViewType('thumbs')\">".JText::_('Thumbnail View')."</a></li>
<li><a id=\"details\" onclick=\"MediaManager.setViewType('details')\">".JText::_('Detail View')."</a></li>
</ul>
";
$document =& JFactory::getDocument();
$document->setBuffer($listStyle, 'modules', 'submenu');
JHTML::_('behavior.mootools');
$document->addScript('components/com_media/assets/mediamanager.js');
$document->addStyleSheet('components/com_media/assets/mediamanager.css');
JHTML::_('behavior.modal');
$document->addScriptDeclaration("
window.addEvent('domready', function() {
document.preview = SqueezeBox;
});");
JHTML::script('mootree.js');
JHTML::stylesheet('mootree.css');
if ($config->get('enable_flash', 0)) {
JHTML::_('behavior.uploader', 'file-upload', array('onAllComplete' => 'function(){ MediaManager.refreshFrame(); }'));
}
if(DS == '\\')
{
$base = str_replace(DS,"\\\\",COM_MEDIA_BASE);
} else {
$base = COM_MEDIA_BASE;
}
$js = "
var basepath = '".$base."';
var viewstyle = '".$style."';
" ;
$document->addScriptDeclaration($js);
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before this one if there is any file write operation
*/
jimport('joomla.client.helper');
$ftp = !JClientHelper::hasCredentials('ftp');
$this->assignRef('session', JFactory::getSession());
$this->assignRef('config', $config);
$this->assignRef('state', $this->get('state'));
$this->assign('require_ftp', $ftp);
$this->assign('folders_id', ' id="media-tree"');
$this->assign('folders', $this->get('folderTree'));
// Set the toolbar
$this->_setToolBar();
parent::display($tpl);
echo JHTML::_('behavior.keepalive');
}
function _setToolBar()
{
// Get the toolbar object instance
$bar =& JToolBar::getInstance('toolbar');
// Set the titlebar text
JToolBarHelper::title( JText::_( 'Media Manager' ), 'mediamanager.png');
// Add a delete button
$title = JText::_('Delete');
$dhtml = "<a href=\"#\" onclick=\"MediaManager.submit('folder.delete')\" class=\"toolbar\">
<span class=\"icon-32-delete\" title=\"$title\" type=\"Custom\"></span>
$title</a>";
$bar->appendButton( 'Custom', $dhtml, 'delete' );
// Add a popup configuration button
JToolBarHelper::help( 'screen.mediamanager' );
}
function getFolderLevel($folder)
{
$this->folders_id = null;
$txt = null;
if (isset($folder['children']) && count($folder['children'])) {
$tmp = $this->folders;
$this->folders = $folder;
$txt = $this->loadTemplate('folders');
$this->folders = $tmp;
}
return $txt;
}
}
|