b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (CVS HEAD) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Source for file _coll_longdesc.widget.php

Documentation is available at _coll_longdesc.widget.php

  1. <?php
  2. /**
  3.  * This file implements the xyz Widget class.
  4.  *
  5.  * This file is part of the evoCore framework - {@link http://evocore.net/}
  6.  * See also {@link http://sourceforge.net/projects/evocms/}.
  7.  *
  8.  * @copyright (c)2003-2010 by Francois PLANQUE - {@link http://fplanque.net/}
  9.  *
  10.  *  {@internal License choice
  11.  *  - If you have received this file as part of a package, please find the license.txt file in
  12.  *    the same folder or the closest folder above for complete license terms.
  13.  *  - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  14.  *    then you must choose one of the following licenses before using the file:
  15.  *    - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  16.  *    - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  17.  *  }}}
  18.  *
  19.  * @package evocore
  20.  *
  21.  *  {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  22.  * @author fplanque: Francois PLANQUE.
  23.  *
  24.  * @version $Id: _coll_longdesc.widget.php,v 1.12 2010/02/08 17:54:48 efy-yury Exp $
  25.  */
  26. if!defined('EVO_MAIN_INIT') ) die'Please, do not access this page directly.' );
  27.  
  28. load_class'widgets/model/_widget.class.php''ComponentWidget' );
  29.  
  30. /**
  31.  * ComponentWidget Class
  32.  *
  33.  * A ComponentWidget is a displayable entity that can be placed into a Container on a web page.
  34.  *
  35.  * @package evocore
  36.  */
  37. {
  38.     /**
  39.      * Constructor
  40.      */
  41.     function coll_longdesc_Widget$db_row NULL )
  42.     {
  43.         // Call parent constructor:
  44.         parent::ComponentWidget$db_row'core''coll_longdesc' );
  45.     }
  46.  
  47.  
  48.     /**
  49.      * Get name of widget
  50.      */
  51.     function get_name()
  52.     {
  53.         return T_('Long Description of this Blog');
  54.     }
  55.  
  56.  
  57.     /**
  58.      * Get a very short desc. Used in the widget list.
  59.      */
  60.     function get_short_desc()
  61.     {
  62.         return format_to_output($this->disp_params['title']);
  63.     }
  64.  
  65.  
  66.   /**
  67.      * Get short description
  68.      */
  69.     function get_desc()
  70.     {
  71.         global $Blog;
  72.         return sprintfT_('Long description from the blog\'s <a %s>general settings</a>.'),
  73.                         'href="?ctrl=coll_settings&tab=general&blog='.$Blog->ID.'"' );
  74.     }
  75.  
  76.  
  77.   /**
  78.    * Get definitions for editable params
  79.    *
  80.      * @see Plugin::GetDefaultSettings()
  81.      * @param local params like 'for_editing' => true
  82.      */
  83.     function get_param_definitions$params )
  84.     {
  85.         $r array_mergearray(
  86.                 'title' => array(
  87.                     'label' => T_('Block title'),
  88.                     'note' => T_'Title to display in your skin.' ),
  89.                     'size' => 40,
  90.                     'defaultvalue' => '',
  91.                 ),
  92.  
  93.             )parent::get_param_definitions$params )    );
  94.  
  95.         return $r;
  96.     }
  97.  
  98.  
  99.     /**
  100.      * Display the widget!
  101.      *
  102.      * @param array MUST contain at least the basic display params
  103.      */
  104.     function display$params )
  105.     {
  106.         global $Blog;
  107.  
  108.         $this->init_display$params );
  109.  
  110.         // Collection long description:
  111.         echo $this->disp_params['block_start'];
  112.  
  113.         // Display title if requested
  114.         $this->disp_title();
  115.  
  116.         $Blog->disp'longdesc''htmlbody' );
  117.  
  118.         echo $this->disp_params['block_end'];
  119.  
  120.         return true;
  121.     }
  122. }
  123.  
  124.  
  125. /*
  126.  * $Log: _coll_longdesc.widget.php,v $
  127.  * Revision 1.12  2010/02/08 17:54:48  efy-yury
  128.  * copyright 2009 -> 2010
  129.  *
  130.  * Revision 1.11  2009/09/14 13:54:13  efy-arrin
  131.  * Included the ClassName in load_class() call with proper UpperCase
  132.  *
  133.  * Revision 1.10  2009/09/12 11:03:13  efy-arrin
  134.  * Included the ClassName in the loadclass() with proper UpperCase
  135.  *
  136.  * Revision 1.9  2009/09/10 13:44:57  tblue246
  137.  * Translation fixes/update
  138.  *
  139.  * Revision 1.8  2009/03/14 15:27:01  blueyed
  140.  * coll_longdesc_Widget: do not add hardcoded P tags around the long desc, which can be html itself
  141.  *
  142.  * Revision 1.7  2009/03/13 02:32:07  fplanque
  143.  * Cleaned up widgets.
  144.  * Removed stupid widget_name param.
  145.  *
  146.  * Revision 1.6  2009/03/08 23:57:46  fplanque
  147.  * 2009
  148.  *
  149.  * Revision 1.5  2008/05/06 23:35:47  fplanque
  150.  * The correct way to add linebreaks to widgets is to add them to $disp_params when the container is called, right after the array_merge with defaults.
  151.  *
  152.  * Revision 1.3  2008/01/21 09:35:37  fplanque
  153.  * (c) 2008
  154.  *
  155.  * Revision 1.2  2007/12/23 17:47:59  fplanque
  156.  * fixes
  157.  *
  158.  * Revision 1.1  2007/06/25 11:02:13  fplanque
  159.  * MODULES (refactored MVC)
  160.  *
  161.  * Revision 1.2  2007/06/20 21:42:13  fplanque
  162.  * implemented working widget/plugin params
  163.  *
  164.  * Revision 1.1  2007/06/18 21:25:47  fplanque
  165.  * one class per core widget
  166.  *
  167.  */
  168. ?>

Documentation generated on Sat, 06 Mar 2010 04:05:07 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).