Changeset 911
- Timestamp:
- 03/20/09 00:19:46 (14 years ago)
- Location:
- plugins/templateWidget/trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/templateWidget/trunk/WidgetBuilder.php
r746 r911 1 1 <?php 2 2 # ***** BEGIN LICENSE BLOCK ***** 3 # This file is part of templateWidget 3 4 # Copyright (c) 2009 Olivier Azeau and contributors. All rights reserved. 4 5 # 5 6 # This is free software; you can redistribute it and/or modify 6 # it under the terms of the GNU General Public License as published by7 # the Free Software Foundation; either version 2of the License, or7 # 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 8 9 # (at your option) any later version. 9 10 # … … 13 14 # GNU General Public License for more details. 14 15 # 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/>. 18 18 # 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 19 22 # ***** END LICENSE BLOCK ***** 20 23 … … 35 38 files::makeDir(DC_WIDGET_ADMIN_TPL_CACHE,true); 36 39 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(.*?))?}}'; 37 43 38 44 $this->setPath( -
plugins/templateWidget/trunk/_admin.php
r746 r911 1 1 <?php 2 2 # ***** 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. 4 5 # 5 6 # This is free software; you can redistribute it and/or modify 6 # it under the terms of the GNU General Public License as published by7 # the Free Software Foundation; either version 2of the License, or7 # 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 8 9 # (at your option) any later version. 9 10 # … … 13 14 # GNU General Public License for more details. 14 15 # 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/>. 18 18 # 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 19 22 # ***** END LICENSE BLOCK ***** 23 20 24 if (!defined('DC_CONTEXT_ADMIN')) { return; } 21 25 -
plugins/templateWidget/trunk/_define.php
r746 r911 1 1 <?php 2 2 # ***** 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. 4 5 # 5 6 # This is free software; you can redistribute it and/or modify 6 # it under the terms of the GNU General Public License as published by7 # the Free Software Foundation; either version 2of the License, or7 # 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 8 9 # (at your option) any later version. 9 10 # … … 13 14 # GNU General Public License for more details. 14 15 # 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/>. 18 18 # 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 19 22 # ***** END LICENSE BLOCK ***** 23 20 24 if (!defined('DC_RC_PATH')) { return; } 21 25 … … 24 28 /* Description*/ "Define widgets using template file only", 25 29 /* Author */ "Olivier Azeau", 26 /* Version */ '1. 1',30 /* Version */ '1.2', 27 31 /* Permissions */ null 28 32 ); -
plugins/templateWidget/trunk/_public.php
r746 r911 1 1 <?php 2 2 # ***** 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. 4 5 # 5 6 # This is free software; you can redistribute it and/or modify 6 # it under the terms of the GNU General Public License as published by7 # the Free Software Foundation; either version 2of the License, or7 # 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 8 9 # (at your option) any later version. 9 10 # … … 13 14 # GNU General Public License for more details. 14 15 # 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/>. 18 18 # 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 19 22 # ***** END LICENSE BLOCK ***** 23 20 24 if (!defined('DC_RC_PATH')) { return; } 21 25 … … 32 36 $core->tpl->addBlock('WidgetComboIf',array('templateWidgetBlocksAndValues','ComboIf')); 33 37 $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')); 34 43 35 44 define('CRLF',"\r\n"); … … 120 129 '<?php endif; ?>'.CRLF; 121 130 } 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 } 122 140 } 141 142 143 class 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 123 165 ?> -
plugins/templateWidget/trunk/default-templates/categories.and.entries.widget.html
r404 r911 34 34 </tpl:WidgetPageTypeIf> 35 35 </tpl:WidgetCheckboxIf> 36 36 37 <tpl:WidgetCheckboxIf name="homeonly" value="0"> 37 38 {{tpl:WidgetUseBlock name="Main"}}
Note: See TracChangeset
for help on using the changeset viewer.