[ Index ]
 

Code source de b2evolution 2.1.0-beta

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/blogs/plugins/ -> _autolinks.plugin.php (source)

   1  <?php
   2  /**

   3   * This file implements the Automatic Links plugin for b2evolution

   4   *

   5   * b2evolution - {@link http://b2evolution.net/}

   6   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}

   7   * @copyright (c)2003-2007 by Francois PLANQUE - {@link http://fplanque.net/}

   8   *

   9   * @package plugins

  10   */
  11  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  12  
  13  
  14  /**

  15   * Automatic links plugin.

  16   *

  17   * @todo dh> Provide a setting for:

  18   *   - marking external and internal (relative URL or on the blog's URL) links with a HTML/CSS class

  19   *   - add e.g. 'target="_blank"' to external links

  20   * @todo Add "max. displayed length setting" and add full title + dots in the middle to shorten it.

  21   *       (e.g. plain long URLs with a lot of params and such). This should not cause the layout to

  22   *       behave ugly. This should only shorten non-whitespace strings in the link's innerHTML of course.

  23   *

  24   * @package plugins

  25   */
  26  class autolinks_plugin extends Plugin
  27  {
  28      var $code = 'b2evALnk';
  29      var $name = 'Auto Links';
  30      var $priority = 60;
  31      var $version = '1.9-dev';
  32      var $apply_rendering = 'opt-out';
  33      var $group = 'rendering';
  34      var $short_desc;
  35      var $long_desc;
  36      var $number_of_installs = 1;
  37  
  38  
  39      /**

  40       * Init

  41       */
  42  	function PluginInit( & $params )
  43      {
  44          $this->short_desc = T_('Make URLs clickable');
  45          $this->long_desc = T_('This renderer will detect URLs in the text and automatically transform them into clickable links.');
  46      }
  47  
  48  
  49      /**

  50       * Perform rendering

  51       *

  52       * @param array Associative array of parameters

  53       *                             (Output format, see {@link format_to_output()})

  54       * @return boolean true if we can render something for the required output format

  55       */
  56  	function RenderItemAsHtml( & $params )
  57      {
  58          $content = & $params['data'];
  59  
  60          $content = make_clickable( $content );
  61  
  62          return true;
  63      }
  64  }
  65  
  66  
  67  /*

  68   * $Log: _autolinks.plugin.php,v $

  69   * Revision 1.18  2007/06/16 20:20:53  blueyed

  70   * Added todo for ... in links

  71   *

  72   * Revision 1.17  2007/04/26 00:11:04  fplanque

  73   * (c) 2007

  74   *

  75   * Revision 1.16  2007/04/20 02:53:13  fplanque

  76   * limited number of installs

  77   *

  78   * Revision 1.15  2007/01/17 21:41:05  blueyed

  79   * todo for useful settings/features

  80   *

  81   * Revision 1.14  2006/12/26 03:19:12  fplanque

  82   * assigned a few significant plugin groups

  83   *

  84   * Revision 1.13  2006/07/10 20:19:30  blueyed

  85   * Fixed PluginInit behaviour. It now gets called on both installed and non-installed Plugins, but with the "is_installed" param appropriately set.

  86   *

  87   * Revision 1.12  2006/07/07 21:26:49  blueyed

  88   * Bumped to 1.9-dev

  89   *

  90   * Revision 1.11  2006/07/06 19:56:29  fplanque

  91   * no message

  92   *

  93   * Revision 1.10  2006/06/16 21:30:57  fplanque

  94   * Started clean numbering of plugin versions (feel free do add dots...)

  95   *

  96   * Revision 1.9  2006/05/30 19:39:55  fplanque

  97   * plugin cleanup

  98   *

  99   * Revision 1.8  2006/04/11 21:22:26  fplanque

 100   * partial cleanup

 101   *

 102   */
 103  ?>


Généré le : Thu Nov 29 23:58:50 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics