b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 2.4) [ class tree: plugins ] [ index: plugins ] [ all elements ]

Source for file _autolinks.plugin.php

Documentation is available at _autolinks.plugin.php

  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-2008 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.19  2008/01/21 09:35:38  fplanque
  70.  * (c) 2008
  71.  *
  72.  * Revision 1.18  2007/06/16 20:20:53  blueyed
  73.  * Added todo for ... in links
  74.  *
  75.  * Revision 1.17  2007/04/26 00:11:04  fplanque
  76.  * (c) 2007
  77.  *
  78.  * Revision 1.16  2007/04/20 02:53:13  fplanque
  79.  * limited number of installs
  80.  *
  81.  * Revision 1.15  2007/01/17 21:41:05  blueyed
  82.  * todo for useful settings/features
  83.  *
  84.  * Revision 1.14  2006/12/26 03:19:12  fplanque
  85.  * assigned a few significant plugin groups
  86.  *
  87.  * Revision 1.13  2006/07/10 20:19:30  blueyed
  88.  * Fixed PluginInit behaviour. It now gets called on both installed and non-installed Plugins, but with the "is_installed" param appropriately set.
  89.  *
  90.  * Revision 1.12  2006/07/07 21:26:49  blueyed
  91.  * Bumped to 1.9-dev
  92.  *
  93.  * Revision 1.11  2006/07/06 19:56:29  fplanque
  94.  * no message
  95.  *
  96.  * Revision 1.10  2006/06/16 21:30:57  fplanque
  97.  * Started clean numbering of plugin versions (feel free do add dots...)
  98.  *
  99.  * Revision 1.9  2006/05/30 19:39:55  fplanque
  100.  * plugin cleanup
  101.  *
  102.  * Revision 1.8  2006/04/11 21:22:26  fplanque
  103.  * partial cleanup
  104.  *
  105.  */
  106. ?>

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