Changeset 5958


Ignore:
Timestamp:
Apr 25, 2010, 12:33:24 AM (10 years ago)
Author:
grum
Message:

Update changes for release 3.1.0

Location:
extensions/GrumPluginClasses
Files:
2 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/GrumPluginClasses/classes/CommonPlugin.class.inc.php

    r5550 r5958  
    225225
    226226  /*
    227     intialize plugin's events
     227    initialize plugin's events
    228228    to be surcharged by child's classes
    229229  */
  • extensions/GrumPluginClasses/classes/GPCCore.class.inc.php

    r5919 r5958  
    33/* -----------------------------------------------------------------------------
    44  class name     : GPCCore
    5   class version  : 3.0.0
    6   plugin version : 3.0.0
     5  class version  : 1.1.0
     6  plugin version : 3.1.0
    77  date           : 2010-03-30
    88  ------------------------------------------------------------------------------
     
    1414
    1515| release | date       |
    16 | 3.0.0   | 2010/03/30 | * Update class & function names
    17 |         |            |
     16| 1.0.0   | 2010/03/30 | * Update class & function names
     17|         |            |
     18| 1.1.0   | 2010/03/30 | * add the BBtoHTML function
    1819|         |            |
    1920|         |            |
     
    3132    - static function register
    3233    - static function unregister
     34    - static function BBtoHTML
    3335   ---------------------------------------------------------------------- */
    3436
     
    4850        Array('name' => "CommonPlugin", 'version' => "2.1.0"),
    4951        Array('name' => "GPCAjax", 'version' => "3.0.0"),
    50         Array('name' => "GPCCore", 'version' => "1.0.0"),
     52        Array('name' => "GPCCore", 'version' => "1.1.0"),
    5153        Array('name' => "GPCCss", 'version' => "3.0.0"),
    5254        Array('name' => "GPCPagesNavigations", 'version' => "2.0.0"),
     
    223225  }
    224226
     227
     228  /**
     229   * convert (light) BB tag to HTML tag
     230   *
     231   * all BB codes are not recognized, only :
     232   *  - [ul] [/ul]
     233   *  - [li] [/li]
     234   *  - [b] [/b]
     235   *  - [i] [/i]
     236   *  - [url] [/url]
     237   *  - carriage return is replaced by a <br>
     238   *
     239   * @param String $text : text to convert
     240   * @return String : BB to HTML text
     241   */
     242  static public function BBtoHTML($text)
     243  {
     244    $patterns = Array(
     245      '/\[li\](.*?)\[\/li\]\n*/im',
     246      '/\[b\](.*?)\[\/b\]/ism',
     247      '/\[i\](.*?)\[\/i\]/ism',
     248      '/\[url\]([\w]+?:\/\/[^ \"\n\r\t<]*?)\[\/url\]/ism',
     249      '/\[url=([\w]+?:\/\/[^ \"\n\r\t<]*?)\](.*?)\[\/url\]/ism',
     250      '/\n{0,1}\[ul\]\n{0,1}/im',
     251      '/\n{0,1}\[\/ul\]\n{0,1}/im',
     252      '/\n/im',
     253    );
     254    $replacements = Array(
     255      '<li>\1</li>',
     256      '<b>\1</b>',
     257      '<i>\1</i>',
     258      '<a href="\1">\1</a>',
     259      '<a href="\1">\2</a>',
     260      '<ul>',
     261      '</ul>',
     262      '<br>',
     263    );
     264
     265    return(preg_replace($patterns, $replacements, $text));
     266  }
     267
    225268} //class
    226269
  • extensions/GrumPluginClasses/classes/GPCCss.class.inc.php

    r5550 r5958  
    4141{
    4242  private $filename;
     43
     44  static public function applyGpcCss()
     45  {
     46    add_event_handler('loc_end_page_header', array('GPCCss', 'applyCSSFile'));
     47  }
     48
     49  static public function applyCSSFile($fileName="")
     50  {
     51    global $template;
     52
     53    if($fileName=="")
     54    {
     55      //if no filename given, load the gpc.css file
     56      $fileName=basename(dirname(dirname(__FILE__))).'/css/gpc.css';
     57      $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="plugins/'.$fileName.'">');
     58    }
     59    elseif(file_exists($fileName))
     60    {
     61      $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="plugins/'.basename(dirname($fileName))."/".basename($fileName).'">');
     62    }
     63  }
    4364
    4465  public function __construct($filename)
     
    86107    global $template;
    87108
    88     if($this->fileExists())
    89     {
    90       $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="plugins/'.basename(dirname($this->filename))."/".basename($this->filename).'">');
    91     }
     109    GPCCss::applyCSSFile($this->filename);
    92110  }
     111
     112
    93113} //class
    94114
  • extensions/GrumPluginClasses/classes/genericjs.class.inc.php

    r5550 r5958  
    1212   this classes provides base functions to add genericjs.js file into html page
    1313
    14    > see genericjs.js file to know javascript functions added 
     14   > see genericjs.js file to know javascript functions added
    1515
    1616    - constructor genericjs()
     
    2929    global $template;
    3030
    31     $name='plugins/'.basename(dirname(__FILE__)).'/genericjs.js';
     31    $name='plugins/'.basename(dirname(dirname(__FILE__))).'/js/genericjs.js';
    3232
    3333    $template->append('head_elements', '<script src="'.$name.'" type="text/javascript"></script>');
  • extensions/GrumPluginClasses/main.inc.php

    r5918 r5958  
    4242|         |            |   . it_IT
    4343|         |            |
    44 | 3.1.0   | 2010/04/18 | * add the GPCTabSheet class
     44| 3.1.0   | 2010/04/24 | * add the GPCTabSheet class
     45|         |            | * update the GPCCore class
    4546|         |            | * Add new languages
    4647|         |            |   . nl_NL
Note: See TracChangeset for help on using the changeset viewer.