b2evolution PHP Cross Reference Blogging Systems

Source: /inc/widgets/views/_widget.form.php - 80 lines - 2705 bytes - Text - Print

Description: This file implements the UI view for the widgets params form. 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 widgets params form.
   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: _widget.form.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  load_funcs('plugins/_plugin.funcs.php');
  19  
  20  /**
  21   * @var ComponentWidget
  22   */
  23  global $edited_ComponentWidget;
  24  
  25  // Determine if we are creating or updating...
  26  $creating = is_create_action( $action );
  27  
  28  $Form = new Form( NULL, 'form' );
  29  
  30  $Form->global_icon( T_('Cancel editing!'), 'close', regenerate_url( 'action' ) );
  31  
  32  $Form->begin_form( 'fform', sprintf( $creating ?  T_('New widget %s in %s') : T_('Edit widget %s in %s'), $edited_ComponentWidget->get_name(), $edited_ComponentWidget->get( 'sco_name' ) ) );
  33  
  34      $Form->add_crumb( 'widget' );
  35      $Form->hidden( 'action', $creating ? 'create' : 'update' );
  36      $Form->hidden( 'wi_ID', $edited_ComponentWidget->ID );
  37      $Form->hiddens_by_key( get_memorized( 'action' ) );
  38  
  39  // Display properties:
  40  $Form->begin_fieldset( T_('Properties') );
  41      $Form->info( T_('Widget type'), $edited_ComponentWidget->get_name() );
  42       $Form->info( T_('Description'), $edited_ComponentWidget->get_desc() );
  43  $Form->end_fieldset();
  44  
  45  
  46  // Display (editable) parameters:
  47  $Form->begin_fieldset( T_('Params') );
  48  
  49      //$params = $edited_ComponentWidget->get_params();
  50  
  51      // Loop through all widget params:
  52      foreach( $edited_ComponentWidget->get_param_definitions( $tmp_params = array('for_editing'=>true) ) as $l_name => $l_meta )
  53      {
  54          // Display field:
  55          autoform_display_field( $l_name, $l_meta, $Form, 'Widget', $edited_ComponentWidget );
  56      }
  57  
  58  $Form->end_fieldset();
  59  
  60  
  61  // dh> TODO: allow the widget to display information, e.g. the coll_category_list
  62  //       widget could say which blogs it affects. (Maybe this would be useful
  63  //       for all even, so a default info field(set)).
  64  //       Does a callback make sense? Then we should have a action hook too, to
  65  //       catch any params/settings maybe? Although this could be done in the
  66  //       same hook in most cases probably. (dh)
  67  
  68  
  69  if( $creating )
  70  {
  71      $Form->end_form( array( array( 'submit', 'submit', T_('Record'), 'SaveButton' ),
  72                                                      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
  73  }
  74  else
  75  {
  76      $Form->end_form( array( array( 'submit', 'submit', T_('Update'), 'SaveButton' ),
  77                                                      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
  78  }
  79  
  80  ?>

title

Description

title

Description

title

Description

title

title

Body