[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/administrator/components/com_media/views/media/ -> view.html.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: view.html.php 14401 2010-01-26 14:10:00Z louis $
   4  * @package        Joomla
   5  * @subpackage    Media
   6  * @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   7  * @license        GNU/GPL, see LICENSE.php
   8  * Joomla! is free software. This version may have been modified pursuant
   9  * to the GNU General Public License, and as distributed it includes or
  10  * is derivative of works licensed under the GNU General Public License or
  11  * other free or open source software licenses.
  12  * See COPYRIGHT.php for copyright notices and details.
  13  */
  14  
  15  // Check to ensure this file is included in Joomla!
  16  defined('_JEXEC') or die( 'Restricted access' );
  17  
  18  jimport( 'joomla.application.component.view');
  19  
  20  /**
  21   * HTML View class for the Media component
  22   *
  23   * @static
  24   * @package        Joomla
  25   * @subpackage    Media
  26   * @since 1.0
  27   */
  28  class MediaViewMedia extends JView
  29  {
  30  	function display($tpl = null)
  31      {
  32          global $mainframe;
  33  
  34          $config =& JComponentHelper::getParams('com_media');
  35  
  36          $style = $mainframe->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
  37  
  38          $listStyle = "
  39              <ul id=\"submenu\">
  40                  <li><a id=\"thumbs\" onclick=\"MediaManager.setViewType('thumbs')\">".JText::_('Thumbnail View')."</a></li>
  41                  <li><a id=\"details\" onclick=\"MediaManager.setViewType('details')\">".JText::_('Detail View')."</a></li>
  42              </ul>
  43          ";
  44  
  45          $document =& JFactory::getDocument();
  46          $document->setBuffer($listStyle, 'modules', 'submenu');
  47  
  48          JHTML::_('behavior.mootools');
  49          $document->addScript('components/com_media/assets/mediamanager.js');
  50          $document->addStyleSheet('components/com_media/assets/mediamanager.css');
  51  
  52          JHTML::_('behavior.modal');
  53          $document->addScriptDeclaration("
  54          window.addEvent('domready', function() {
  55              document.preview = SqueezeBox;
  56          });");
  57  
  58          JHTML::script('mootree.js');
  59          JHTML::stylesheet('mootree.css');
  60  
  61          if ($config->get('enable_flash', 0)) {
  62              JHTML::_('behavior.uploader', 'file-upload', array('onAllComplete' => 'function(){ MediaManager.refreshFrame(); }'));
  63          }
  64  
  65          if(DS == '\\')
  66          {
  67              $base = str_replace(DS,"\\\\",COM_MEDIA_BASE);
  68          } else {
  69              $base = COM_MEDIA_BASE;
  70          }
  71  
  72          $js = "
  73              var basepath = '".$base."';
  74              var viewstyle = '".$style."';
  75          " ;
  76          $document->addScriptDeclaration($js);
  77  
  78          /*
  79           * Display form for FTP credentials?
  80           * Don't set them here, as there are other functions called before this one if there is any file write operation
  81           */
  82          jimport('joomla.client.helper');
  83          $ftp = !JClientHelper::hasCredentials('ftp');
  84  
  85          $this->assignRef('session', JFactory::getSession());
  86          $this->assignRef('config', $config);
  87          $this->assignRef('state', $this->get('state'));
  88          $this->assign('require_ftp', $ftp);
  89          $this->assign('folders_id', ' id="media-tree"');
  90          $this->assign('folders', $this->get('folderTree'));
  91          
  92          $user =& JFactory::getUser();
  93          $this->assignRef('user', $user);
  94  
  95          // Set the toolbar
  96          $this->_setToolBar();
  97  
  98          parent::display($tpl);
  99          echo JHTML::_('behavior.keepalive');
 100      }
 101  
 102  	function _setToolBar()
 103      {
 104          // Get the toolbar object instance
 105          $bar =& JToolBar::getInstance('toolbar');
 106  
 107          // Set the titlebar text
 108          JToolBarHelper::title( JText::_( 'Media Manager' ), 'mediamanager.png');
 109  
 110          // Add a delete button
 111          $title = JText::_('Delete');
 112          $dhtml = "<a href=\"#\" onclick=\"MediaManager.submit('folder.delete')\" class=\"toolbar\">
 113                      <span class=\"icon-32-delete\" title=\"$title\" type=\"Custom\"></span>
 114                      $title</a>";
 115          $bar->appendButton( 'Custom', $dhtml, 'delete' );
 116  
 117          // Add a popup configuration button
 118          JToolBarHelper::help( 'screen.mediamanager' );
 119      }
 120  
 121  	function getFolderLevel($folder)
 122      {
 123          $this->folders_id = null;
 124          $txt = null;
 125          if (isset($folder['children']) && count($folder['children'])) {
 126              $tmp = $this->folders;
 127              $this->folders = $folder;
 128              $txt = $this->loadTemplate('folders');
 129              $this->folders = $tmp;
 130          }
 131          return $txt;
 132      }
 133  }
element ', [['libraries/joomla/html','html.php',159]], 29], 'setbuffer': ['setbuffer', 'Set the contents of the document buffer ', [['libraries/joomla/document','document.php',357],['libraries/joomla/document/html','html.php',196]], 8], 'count': ['count', '', [], 832], 'defined': ['defined', '', [], 1004], 'str_replace': ['str_replace', '', [], 424]}; CLASS_DATA={ 'jtoolbarhelper': ['jtoolbarhelper', 'Utility class for the button bar ', [['administrator/includes','toolbar.php',19]], 346], 'jhtml': ['jhtml', 'Utility class for all HTML drawing classes ', [['libraries/joomla/html','html.php',15]], 1096], 'mediaviewmedia': ['mediaviewmedia', 'HTML View class for the Media component ', [['administrator/components/com_media/views/media','view.html.php',20]], 0], 'jclienthelper': ['jclienthelper', 'Client helper class ', [['libraries/joomla/client','helper.php',13]], 56], 'jfactory': ['jfactory', 'Joomla Framework Factory class ', [['libraries/joomla','factory.php',14]], 981], 'jtoolbar': ['jtoolbar', 'ToolBar handler ', [['libraries/joomla/html','toolbar.php',21]], 36], 'jcomponenthelper': ['jcomponenthelper', 'Component helper class ', [['libraries/joomla/application/component','helper.php',18]], 82], 'jtext': ['jtext', 'Text handling class ', [['libraries/joomla','methods.php',99]], 3334], 'jview': ['jview', 'Base class for a Joomla View ', [['libraries/joomla/application/component','view.php',18]], 48]}; CONST_DATA={ 'COM_MEDIA_BASE': ['COM_MEDIA_BASE', '', [['administrator/components/com_media','media.php',34],['components/com_media','media.php',25]], 15], '_JEXEC': ['_JEXEC', '', [['','index.php',15],['administrator','index.php',15],['xmlrpc','index.php',14],['installation/installer','jajax.php',15],['installation','index.php',13],['xmlrpc','client.php',15]], 689]};


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1