Dotclear

Changeset 911


Ignore:
Timestamp:
03/20/09 00:19:46 (14 years ago)
Author:
Oaz
Message:

Added 'Bonjour' widget and associated code
Moved to AGPLv3 license

Location:
plugins/templateWidget/trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • plugins/templateWidget/trunk/WidgetBuilder.php

    r746 r911  
    11<?php 
    22# ***** BEGIN LICENSE BLOCK ***** 
     3# This file is part of templateWidget 
    34# Copyright (c) 2009 Olivier Azeau and contributors. All rights reserved. 
    45# 
    56# This is free software; you can redistribute it and/or modify 
    6 # it under the terms of the GNU General Public License as published by 
    7 # the Free Software Foundation; either version 2 of the License, or 
     7# it under the terms of the Affero GNU General Public License as published by 
     8# the Free Software Foundation; either version 3 of the License, or 
    89# (at your option) any later version. 
    910#  
     
    1314# GNU General Public License for more details. 
    1415#  
    15 # You should have received a copy of the GNU General Public License 
    16 # along with DotClear; if not, write to the Free Software 
    17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
     16# You should have received a copy of the Affero GNU General Public License 
     17# along with templateWidget; If not, see <http://www.gnu.org/licenses/>. 
    1818# 
     19# templateWidget is a plugin for Dotclear software. 
     20# templateWidget is not part of Dotclear. 
     21# templateWidget can be used inside Dotclear but this license only applies to templateWidget 
    1922# ***** END LICENSE BLOCK ***** 
    2023 
     
    3538          files::makeDir(DC_WIDGET_ADMIN_TPL_CACHE,true); 
    3639          parent::__construct(DC_WIDGET_ADMIN_TPL_CACHE,$self_name); 
     40 
     41          $this->tag_block = '<tpl:(%1$s)(?:(\s+.*?)>|>)(.*?)</tpl:%1$s>'; 
     42          $this->tag_value = '{{tpl:(%s)(\s(.*?))?}}'; 
    3743 
    3844    $this->setPath( 
  • plugins/templateWidget/trunk/_admin.php

    r746 r911  
    11<?php 
    22# ***** BEGIN LICENSE BLOCK ***** 
    3 # Copyright (c) 2008-2009 Olivier Azeau and contributors. All rights reserved. 
     3# This file is part of templateWidget 
     4# Copyright (c) 2009 Olivier Azeau and contributors. All rights reserved. 
    45# 
    56# This is free software; you can redistribute it and/or modify 
    6 # it under the terms of the GNU General Public License as published by 
    7 # the Free Software Foundation; either version 2 of the License, or 
     7# it under the terms of the Affero GNU General Public License as published by 
     8# the Free Software Foundation; either version 3 of the License, or 
    89# (at your option) any later version. 
    910#  
     
    1314# GNU General Public License for more details. 
    1415#  
    15 # You should have received a copy of the GNU General Public License 
    16 # along with DotClear; if not, write to the Free Software 
    17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
     16# You should have received a copy of the Affero GNU General Public License 
     17# along with templateWidget; If not, see <http://www.gnu.org/licenses/>. 
    1818# 
     19# templateWidget is a plugin for Dotclear software. 
     20# templateWidget is not part of Dotclear. 
     21# templateWidget can be used inside Dotclear but this license only applies to templateWidget 
    1922# ***** END LICENSE BLOCK ***** 
     23 
    2024if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    2125 
  • plugins/templateWidget/trunk/_define.php

    r746 r911  
    11<?php 
    22# ***** BEGIN LICENSE BLOCK ***** 
    3 # Copyright (c) 2008-2009 Olivier Azeau and contributors. All rights reserved. 
     3# This file is part of templateWidget 
     4# Copyright (c) 2009 Olivier Azeau and contributors. All rights reserved. 
    45# 
    56# This is free software; you can redistribute it and/or modify 
    6 # it under the terms of the GNU General Public License as published by 
    7 # the Free Software Foundation; either version 2 of the License, or 
     7# it under the terms of the Affero GNU General Public License as published by 
     8# the Free Software Foundation; either version 3 of the License, or 
    89# (at your option) any later version. 
    910#  
     
    1314# GNU General Public License for more details. 
    1415#  
    15 # You should have received a copy of the GNU General Public License 
    16 # along with DotClear; if not, write to the Free Software 
    17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
     16# You should have received a copy of the Affero GNU General Public License 
     17# along with templateWidget; If not, see <http://www.gnu.org/licenses/>. 
    1818# 
     19# templateWidget is a plugin for Dotclear software. 
     20# templateWidget is not part of Dotclear. 
     21# templateWidget can be used inside Dotclear but this license only applies to templateWidget 
    1922# ***** END LICENSE BLOCK ***** 
     23 
    2024if (!defined('DC_RC_PATH')) { return; } 
    2125 
     
    2428     /* Description*/         "Define widgets using template file only", 
    2529     /* Author */             "Olivier Azeau", 
    26      /* Version */            '1.1', 
     30     /* Version */            '1.2', 
    2731     /* Permissions */        null 
    2832); 
  • plugins/templateWidget/trunk/_public.php

    r746 r911  
    11<?php 
    22# ***** BEGIN LICENSE BLOCK ***** 
    3 # Copyright (c) 2008-2009 Olivier Azeau and contributors. All rights reserved. 
     3# This file is part of templateWidget 
     4# Copyright (c) 2009 Olivier Azeau and contributors. All rights reserved. 
    45# 
    56# This is free software; you can redistribute it and/or modify 
    6 # it under the terms of the GNU General Public License as published by 
    7 # the Free Software Foundation; either version 2 of the License, or 
     7# it under the terms of the Affero GNU General Public License as published by 
     8# the Free Software Foundation; either version 3 of the License, or 
    89# (at your option) any later version. 
    910#  
     
    1314# GNU General Public License for more details. 
    1415#  
    15 # You should have received a copy of the GNU General Public License 
    16 # along with DotClear; if not, write to the Free Software 
    17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
     16# You should have received a copy of the Affero GNU General Public License 
     17# along with templateWidget; If not, see <http://www.gnu.org/licenses/>. 
    1818# 
     19# templateWidget is a plugin for Dotclear software. 
     20# templateWidget is not part of Dotclear. 
     21# templateWidget can be used inside Dotclear but this license only applies to templateWidget 
    1922# ***** END LICENSE BLOCK ***** 
     23 
    2024if (!defined('DC_RC_PATH')) { return; } 
    2125 
     
    3236$core->tpl->addBlock('WidgetComboIf',array('templateWidgetBlocksAndValues','ComboIf')); 
    3337$core->tpl->addValue('WidgetCombo',array('templateWidgetBlocksAndValues','Combo')); 
     38 
     39 
     40$core->tpl->addBlock('IfKnownVisitor',array('templateWidgetBlocksAndValues','IfKnownVisitor')); 
     41 
     42$core->addBehavior('tplBeforeData',array('templateWidgetBehaviors','loadVisitorCookie')); 
    3443 
    3544define('CRLF',"\r\n"); 
     
    120129          '<?php endif; ?>'.CRLF; 
    121130  } 
     131   
     132  //========================================================= 
     133 
     134  public static function IfKnownVisitor($attr,$content) { 
     135          return 
     136          '<?php if ($_ctx->comment_preview !== null && $_ctx->comment_preview["name"]) : ?>'. 
     137          $content. 
     138          '<?php endif; ?>'; 
     139  } 
    122140} 
     141 
     142 
     143class templateWidgetBehaviors 
     144{ 
     145  public static function loadVisitorCookie(&$core) 
     146  { 
     147    if(@$_ctx->comment_preview['name']) 
     148      return; 
     149    if (empty($_COOKIE['comment_info'])) 
     150      return; 
     151    $visitorInfos = split("\n",$_COOKIE['comment_info']); 
     152    global $_ctx; 
     153          $_ctx->comment_preview = new ArrayObject(); 
     154    $_ctx->comment_preview['name'] = @$_ctx->comment_preview['name'] ? $_ctx->comment_preview['name'] : $visitorInfos[0]; 
     155          $_ctx->comment_preview['mail'] = @$_ctx->comment_preview['mail'] ? $_ctx->comment_preview['mail'] : $visitorInfos[1]; 
     156          $_ctx->comment_preview['site'] = @$_ctx->comment_preview['site'] ? $_ctx->comment_preview['site'] : $visitorInfos[2]; 
     157          $_ctx->comment_preview['content'] = ''; 
     158          $_ctx->comment_preview['rawcontent'] = ''; 
     159          $_ctx->comment_preview['remember'] = false; 
     160          $_ctx->comment_preview['preview'] = false; 
     161  } 
     162} 
     163 
     164 
    123165?> 
  • plugins/templateWidget/trunk/default-templates/categories.and.entries.widget.html

    r404 r911  
    3434  </tpl:WidgetPageTypeIf> 
    3535</tpl:WidgetCheckboxIf> 
     36 
    3637<tpl:WidgetCheckboxIf name="homeonly" value="0"> 
    3738  {{tpl:WidgetUseBlock name="Main"}} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map