[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/plugins/system/legacy/ -> html.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: html.php 14401 2010-01-26 14:10:00Z louis $
   4  * @package        Joomla.Legacy
   5  * @subpackage    1.5
   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 within the rest of the framework
  16  defined('JPATH_BASE') or die();
  17  
  18  /**
  19   * Legacy class, use {@link JHTML} instead
  20   *
  21   * @deprecated    As of version 1.5
  22   * @package    Joomla.Legacy
  23   * @subpackage    1.5
  24   */
  25  class mosHTML
  26  {
  27      /**
  28        * Legacy function, use {@link JHTML::_('select.option')} instead
  29        *
  30        * @deprecated    As of version 1.5
  31       */
  32  	function makeOption( $value, $text='', $value_name='value', $text_name='text' )
  33      {
  34          return JHTML::_('select.option', $value, $text, $value_name, $text_name);
  35      }
  36  
  37      /**
  38        * Legacy function, use {@link JHTML::_('select.genericlist')} instead
  39        *
  40        * @deprecated    As of version 1.5
  41       */
  42  	function selectList( &$arr, $tag_name, $tag_attribs, $key, $text, $selected=NULL, $idtag=false, $flag=false )
  43      {
  44          return JHTML::_('select.genericlist', $arr, $tag_name, $tag_attribs, $key, $text, $selected, $idtag, $flag );
  45      }
  46  
  47      /**
  48        * Legacy function, use {@link JHTML::_('select.integerlist')} instead
  49        *
  50        * @deprecated    As of version 1.5
  51       */
  52  	function integerSelectList( $start, $end, $inc, $tag_name, $tag_attribs, $selected, $format="" )
  53      {
  54          return JHTML::_('select.integerlist', $start, $end, $inc, $tag_name, $tag_attribs, $selected, $format) ;
  55      }
  56  
  57      /**
  58        * Legacy function, use {@link JHTML::_('select.radiolist')} instead
  59        *
  60        * @deprecated    As of version 1.5
  61       */
  62  	function radioList( &$arr, $tag_name, $tag_attribs, $selected=null, $key='value', $text='text', $idtag=false )
  63      {
  64          return JHTML::_('select.radiolist', $arr, $tag_name, $tag_attribs, $key, $text,  $selected, $idtag) ;
  65      }
  66  
  67      /**
  68        * Legacy function, use {@link JHTML::_('select.booleanlist')} instead
  69        *
  70        * @deprecated    As of version 1.5
  71       */
  72  	function yesnoRadioList( $tag_name, $tag_attribs, $selected, $yes='yes', $no='no', $id=false )
  73      {
  74          return JHTML::_('select.booleanlist',  $tag_name, $tag_attribs, $selected, $yes, $no, $id ) ;
  75      }
  76  
  77      /**
  78        * Legacy function, deprecated
  79        *
  80        * @deprecated    As of version 1.5
  81       */
  82  	function writableCell( $folder, $relative=1, $text='', $visible=1 )
  83      {
  84          $writeable         = '<b><font color="green">'. JText::_( 'Writable' ) .'</font></b>';
  85          $unwriteable     = '<b><font color="red">'. JText::_( 'Unwritable' ) .'</font></b>';
  86  
  87          echo '<tr>';
  88          echo '<td class="item">';
  89          echo $text;
  90          if ( $visible ) {
  91              echo $folder . '/';
  92          }
  93          echo '</td>';
  94          echo '<td >';
  95          if ( $relative ) {
  96              echo is_writable( "../$folder" )     ? $writeable : $unwriteable;
  97          } else {
  98              echo is_writable( "$folder" )         ? $writeable : $unwriteable;
  99          }
 100          echo '</td>';
 101          echo '</tr>';
 102      }
 103  
 104      /**
 105        * Legacy function, deprecated
 106        *
 107        * @deprecated    As of version 1.5
 108       */
 109  	function monthSelectList( $tag_name, $tag_attribs, $selected )
 110      {
 111          $arr = array(
 112              mosHTML::makeOption( '01', JText::_( 'JANUARY_SHORT' ) ),
 113              mosHTML::makeOption( '02', JText::_( 'FEBRUARY_SHORT' ) ),
 114              mosHTML::makeOption( '03', JText::_( 'MARCH_SHORT' ) ),
 115              mosHTML::makeOption( '04', JText::_( 'APRIL_SHORT' ) ),
 116              mosHTML::makeOption( '05', JText::_( 'MAY_SHORT' ) ),
 117              mosHTML::makeOption( '06', JText::_( 'JUNE_SHORT' ) ),
 118              mosHTML::makeOption( '07', JText::_( 'JULY_SHORT' ) ),
 119              mosHTML::makeOption( '08', JText::_( 'AUGUST_SHORT' ) ),
 120              mosHTML::makeOption( '09', JText::_( 'SEPTEMBER_SHORT' ) ),
 121              mosHTML::makeOption( '10', JText::_( 'OCTOBER_SHORT' ) ),
 122              mosHTML::makeOption( '11', JText::_( 'NOVEMBER_SHORT' ) ),
 123              mosHTML::makeOption( '12', JText::_( 'DECEMBER_SHORT' ) )
 124          );
 125  
 126          return mosHTML::selectList( $arr, $tag_name, $tag_attribs, 'value', 'text', $selected );
 127      }
 128  
 129      /**
 130        * Legacy function, deprecated
 131        *
 132        * @deprecated    As of version 1.5
 133       */
 134  	function treeSelectList( &$src_list, $src_id, $tgt_list, $tag_name, $tag_attribs, $key, $text, $selected )
 135      {
 136  
 137          // establish the hierarchy of the menu
 138          $children = array();
 139          // first pass - collect children
 140          foreach ($src_list as $v ) {
 141              $pt = $v->parent;
 142              $list = @$children[$pt] ? $children[$pt] : array();
 143              array_push( $list, $v );
 144              $children[$pt] = $list;
 145          }
 146          // second pass - get an indent list of the items
 147          $ilist = JHTML::_('menu.treerecurse', 0, '', array(), $children );
 148  
 149          // assemble menu items to the array
 150          $this_treename = '';
 151          foreach ($ilist as $item) {
 152              if ($this_treename) {
 153                  if ($item->id != $src_id && strpos( $item->treename, $this_treename ) === false) {
 154                      $tgt_list[] = mosHTML::makeOption( $item->id, $item->treename );
 155                  }
 156              } else {
 157                  if ($item->id != $src_id) {
 158                      $tgt_list[] = mosHTML::makeOption( $item->id, $item->treename );
 159                  } else {
 160                      $this_treename = "$item->treename/";
 161                  }
 162              }
 163          }
 164          // build the html select list
 165          return mosHTML::selectList( $tgt_list, $tag_name, $tag_attribs, $key, $text, $selected );
 166      }
 167  
 168      /**
 169        * Legacy function, deprecated
 170        *
 171        * @deprecated    As of version 1.5
 172       */
 173  	function yesnoSelectList( $tag_name, $tag_attribs, $selected, $yes='yes', $no='no' )
 174      {
 175          $arr = array(
 176              mosHTML::makeOption( 0, JText::_( $no ) ),
 177              mosHTML::makeOption( 1, JText::_( $yes ) ),
 178          );
 179  
 180          return mosHTML::selectList( $arr, $tag_name, $tag_attribs, 'value', 'text', (int) $selected );
 181      }
 182  
 183      /**
 184        * Legacy function, use {@link JHTML::_('grid.id')} instead
 185        *
 186        * @deprecated    As of version 1.5
 187       */
 188  	function idBox( $rowNum, $recId, $checkedOut=false, $name='cid' )
 189      {
 190          return JHTML::_('grid.id', $rowNum, $recId, $checkedOut, $name);
 191      }
 192  
 193      /**
 194        * Legacy function, deprecated
 195        *
 196        * @deprecated    As of version 1.5
 197       */
 198  	function sortIcon( $text, $base_href, $field, $state='none' )
 199      {
 200          $alts = array(
 201              'none'     => JText::_( 'No Sorting' ),
 202              'asc'     => JText::_( 'Sort Ascending' ),
 203              'desc'     => JText::_( 'Sort Descending' ),
 204          );
 205  
 206          $next_state = 'asc';
 207          if ($state == 'asc') {
 208              $next_state = 'desc';
 209          } else if ($state == 'desc') {
 210              $next_state = 'none';
 211          }
 212  
 213          if ($state == 'none') {
 214              $img = '';
 215          } else {
 216              $img = "<img src=\"images/sort_$state.png\" width=\"12\" height=\"12\" border=\"0\" alt=\"{$alts[$next_state]}\" />";
 217          }
 218  
 219          $html = "<a href=\"$base_href&field=$field&order=$next_state\">"
 220          . JText::_( $text )
 221          . '&nbsp;&nbsp;'
 222          . $img
 223          . "</a>";
 224  
 225          return $html;
 226      }
 227  
 228      /**
 229        * Legacy function, deprecated
 230        *
 231        * @deprecated    As of version 1.5
 232       */
 233  	function CloseButton ( &$params, $hide_js=NULL )
 234      {
 235  
 236          // displays close button in Pop-up window
 237          if ( $params->get( 'popup' ) && !$hide_js ) {
 238              ?>
 239              <div align="center" style="margin-top: 30px; margin-bottom: 30px;">
 240                  <script type="text/javascript">
 241                      document.write('<a href="#" onclick="javascript:window.close();"><span class="small"><?php echo JText::_( 'Close Window' );?></span></a>');
 242                  </script>
 243                  <?php
 244                  if ( $_SERVER['HTTP_REFERER'] != "") {
 245                      echo '<noscript>';
 246                      echo '<a href="'. str_replace(array('"', '<', '>', "'"), '', $_SERVER['HTTP_REFERER']) .'"><span class="small">'. JText::_( 'BACK' ) .'</span></a>';
 247                      echo '</noscript>';
 248                  }
 249                  ?>
 250              </div>
 251              <?php
 252          }
 253      }
 254  
 255      /**
 256        * Legacy function, deprecated
 257        *
 258        * @deprecated    As of version 1.5
 259       */
 260  	function BackButton ( &$params, $hide_js=NULL )
 261      {
 262  
 263          // Back Button
 264          if ( $params->get( 'back_button' ) && !$params->get( 'popup' ) && !$hide_js) {
 265              ?>
 266              <div class="back_button">
 267                  <a href='javascript:history.go(-1)'>
 268                      <?php echo JText::_( 'BACK' ); ?></a>
 269              </div>
 270              <?php
 271          }
 272      }
 273  
 274      /**
 275        * Legacy function, use {@link JFilterOutput::cleanText()} instead
 276        *
 277        * @deprecated    As of version 1.5
 278       */
 279  	function cleanText ( &$text ) {
 280          return JFilterOutput::cleanText($text);
 281      }
 282  
 283      /**
 284        * Legacy function, deprecated
 285        *
 286        * @deprecated    As of version 1.5
 287       */
 288  	function PrintIcon( &$row, &$params, $hide_js, $link, $status=NULL )
 289      {
 290  
 291          if ( $params->get( 'print' )  && !$hide_js ) {
 292              // use default settings if none declared
 293              if ( !$status ) {
 294                  $status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no';
 295              }
 296  
 297              // checks template image directory for image, if non found default are loaded
 298              if ( $params->get( 'icons' ) ) {
 299                  $image = mosAdminMenus::ImageCheck( 'printButton.png', '/images/M_images/', NULL, NULL, JText::_( 'Print' ), JText::_( 'Print' ) );
 300              } else {
 301                  $image = JText::_( 'ICON_SEP' ) .'&nbsp;'. JText::_( 'Print' ) .'&nbsp;'. JText::_( 'ICON_SEP' );
 302              }
 303  
 304              if ( $params->get( 'popup' ) && !$hide_js ) {
 305                  // Print Preview button - used when viewing page
 306                  ?>
 307                  <script type="text/javascript">
 308                      document.write('<td align="right" width="100%" class="buttonheading">');
 309                      document.write('<a href="#" onclick="javascript:window.print(); return false" title="<?php echo JText::_( 'Print' );?>">');
 310                      document.write('<?php echo $image;?>');
 311                      document.write('</a>');
 312                      document.write('</td>');
 313                  </script>
 314                  <?php
 315              } else {
 316                  // Print Button - used in pop-up window
 317                  ?>
 318                  <td align="right" width="100%" class="buttonheading">
 319                  <a href="<?php echo $link; ?>" onclick="window.open('<?php echo $link; ?>','win2','<?php echo $status; ?>'); return false;" title="<?php echo JText::_( 'Print' );?>">
 320                      <?php echo $image;?></a>
 321                  </td>
 322                  <?php
 323              }
 324          }
 325      }
 326  
 327      /**
 328        * Legacy function, use {@link JHTML::_('email.cloak')} instead
 329        *
 330        * @deprecated    As of version 1.5
 331       */
 332  	function emailCloaking( $mail, $mailto=1, $text='', $email=1 )
 333      {
 334          return JHTML::_('email.cloak', $mail, $mailto, $text, $email);
 335      }
 336  
 337      /**
 338        * Legacy function, use {@link JHTML::_('behavior.keepalive')} instead
 339        *
 340        * @deprecated    As of version 1.5
 341       */
 342  	function keepAlive()
 343      {
 344          echo JHTML::_('behavior.keepalive');
 345      }
 346  }


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