b2evolution PHP Cross Reference Blogging Systems

Source: /inc/skins/views/_skin_list_available.view.php - 70 lines - 1995 bytes - Text - Print

Description: This file implements the UI view for the Available skins. This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}. See also {@link http://sourceforge.net/projects/evocms/}.

   1  <?php
   2  /**
   3   * This file implements the UI view for the Available skins.
   4   *
   5   * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
   6   * See also {@link http://sourceforge.net/projects/evocms/}.
   7   *
   8   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}.
   9   *
  10   * @license http://b2evolution.net/about/license.html GNU General Public License (GPL)
  11   *
  12   * @package admin
  13   *
  14   * @version $Id: _skin_list_available.view.php 6136 2014-03-08 07:59:48Z manuel $
  15   */
  16  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  17  
  18  global $skins_path;
  19  
  20  global $redirect_to;
  21  
  22  /**
  23   * @var SkinCache
  24   */
  25  $SkinCache = & get_SkinCache();
  26  $SkinCache->load_all();
  27  
  28  $block_item_Widget = new Widget( 'block_item' );
  29  
  30  $block_item_Widget->title = T_('Skins available for installation').get_manual_link('installing_skins');
  31  
  32  if( $current_User->check_perm( 'options', 'edit', false ) )
  33  { // We have permission to modify:
  34    $block_item_Widget->global_icon( T_('Cancel install!'), 'close', $redirect_to );
  35  }
  36  
  37  $block_item_Widget->disp_template_replaced( 'block_start' );
  38  
  39  $filename_params = array(
  40          'inc_files'        => false,
  41          'recurse'        => false,
  42          'basename'        => true,
  43      );
  44  // Get all skin folder names:
  45  $skin_folders = get_filenames( $skins_path, $filename_params );
  46  
  47  // Go through all skin folders:
  48  foreach( $skin_folders as $skin_folder )
  49  {
  50      if( ! strlen($skin_folder) || $skin_folder[0] == '.' || $skin_folder == 'CVS' )
  51      {
  52          continue;
  53      }
  54      if( $SkinCache->get_by_folder( $skin_folder, false ) )
  55      {    // Already installed...
  56          continue;
  57      }
  58  
  59      // Display skinshot:
  60      $disp_params = array(
  61          'function' => 'install',
  62          'function_url' => '?ctrl=skins&amp;action=create&amp;skin_folder='.rawurlencode($skin_folder).'&amp;redirect_to='.rawurlencode($redirect_to).'&amp;'.url_crumb('skin')
  63      );
  64      Skin::disp_skinshot( $skin_folder, $skin_folder, $disp_params );
  65  }
  66  
  67  echo '<div class="clear"></div>';
  68  $block_item_Widget->disp_template_replaced( 'block_end' );
  69  
  70  ?>

title

Description

title

Description

title

Description

title

title

Body