b2evolution PHP Cross Reference Blogging Systems

Source: /inc/tools/views/_misc_test.view.php - 94 lines - 3814 bytes - Text - Print

Description: This file display the additional tools

   1  <?php
   2  /**

   3   * This file display the additional tools

   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   * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.

  10   *

  11   * @license http://b2evolution.net/about/license.html GNU General Public License (GPL)

  12   *

  13   * @package admin

  14   *

  15   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}

  16   * @author blueyed: Daniel HAHLER

  17   * @author efy-asimo: Attila Simo.

  18   *

  19   * @version $Id: _misc_test.view.php 1487 2012-07-03 13:54:54Z yura $

  20   */
  21  
  22  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  23  
  24  
  25  global $template_action, $template_title, $Messages;
  26  
  27  $block_item_Widget = new Widget( 'block_item' );
  28  
  29  if( !empty( $template_action ) )
  30  { // Execute actions in template to display a process
  31      $block_item_Widget->title = empty( $template_title ) ? T_('Log') : $template_title;
  32      $block_item_Widget->disp_template_replaced( 'block_start' );
  33  
  34      switch( $template_action )
  35      {
  36          case 'test_flush':
  37              // Test a flush function

  38              tool_test_flush();
  39              break;
  40  
  41          case 'create_sample_comments':
  42              // Create the comments and display a process of creating

  43              global $blog_ID, $num_comments, $num_posts;
  44              tool_create_sample_comments( $blog_ID, $num_comments, $num_posts );
  45              break;
  46  
  47          case 'create_sample_posts':
  48              // Create the posts and display a process of creating

  49              global $blog_ID, $num_posts;
  50              tool_create_sample_posts( $blog_ID, $num_posts );
  51              break;
  52  
  53          case 'create_sample_users':
  54              // Create the users and display a process of creating

  55              global $group_ID, $num_users;
  56              tool_create_sample_users( $group_ID, $num_users );
  57              break;
  58  
  59          case 'create_sample_hits':
  60              // Create the hits and display a process of creating

  61              global $days, $min_interval, $max_interval;
  62              tool_create_sample_hits( $days, $min_interval, $max_interval );
  63              break;
  64  
  65          case 'create_sample_messages':
  66              // Create the messages and display a process of creating

  67              global $num_loops, $num_messages, $num_words, $max_users;
  68              tool_create_sample_messages( $num_loops, $num_messages, $num_words, $max_users );
  69              break;
  70      }
  71  
  72      $block_item_Widget->disp_template_raw( 'block_end' );
  73  
  74      // Display the messages from tool functions

  75      $Messages->display();
  76  }
  77  
  78  // TODO: dh> this should really be a separate permission.. ("tools", "exec") or similar!

  79  if( $current_User->check_perm('options', 'edit') )
  80  { // default admin actions:
  81      $block_item_Widget->title = T_('Testing Tools').get_manual_link( 'testing-tools' );
  82      $block_item_Widget->disp_template_replaced( 'block_start' );
  83      echo '<ul>';
  84      echo '<li><a href="'.regenerate_url('action', 'action=test_flush&amp;'.url_crumb('tools')).'">'.T_('Test flush').'</a></li>';
  85      echo '<li><a href="'.regenerate_url('action', 'action=show_create_comments&amp;'.url_crumb('tools')).'">'.T_('Create sample comments').'</a></li>';
  86      echo '<li><a href="'.regenerate_url('action', 'action=show_create_posts&amp;'.url_crumb('tools')).'">'.T_('Create sample posts').'</a></li>';
  87      echo '<li><a href="'.regenerate_url('action', 'action=show_create_users&amp;'.url_crumb('tools')).'">'.T_('Create sample users').'</a></li>';
  88      echo '<li><a href="'.regenerate_url('action', 'action=show_create_hits&amp;'.url_crumb('tools')).'">'.T_('Create sample hit data').'</a></li>';
  89      echo '<li><a href="'.regenerate_url('action', 'action=show_create_messages&amp;'.url_crumb('tools')).'">'.T_('Create sample messages').'</a></li>';
  90      echo '</ul>';
  91      $block_item_Widget->disp_template_raw( 'block_end' );
  92  }
  93  
  94  ?>

title

Description

title

Description

title

Description

title

title

Body