Changeset 2779
- Timestamp:
- 11/28/10 15:27:41 (13 years ago)
- Location:
- plugins/tagflash
- Files:
-
- 26 added
- 3 deleted
- 8 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
plugins/tagflash/CHANGELOG
r2778 r2779 1 Tag Flash 1.1.0 - 2010-11-28 2 ================================= 3 * Sanitize code 4 * Upgrade tagcloud.swf 5 * Use colorpicker to define colors for animation 6 * Add help 7 * Option to add code for search engine 8 * Remove swfobject dependency 9 1 10 Tag Flash 1.0.3 - 2010-11-24 2 11 ================================= -
plugins/tagflash/MANIFEST
r2778 r2779 1 1 tagflash/CREDITS 2 2 tagflash/_public.php 3 tagflash/locales/fr/main.lang.php 3 tagflash/locales/en/help.html 4 tagflash/locales/fr/main.po 5 tagflash/locales/fr/help.html 4 6 tagflash/_widgets.php 5 7 tagflash/_prepend.php 6 tagflash/default-templates/tagFlash-widget.html7 8 tagflash/MANIFEST 9 tagflash/index.php 10 tagflash/img/colorpicker_hex.png 11 tagflash/img/colorpicker_hsb_b.png 12 tagflash/img/colorpicker_rgb_g.png 13 tagflash/img/colorpicker_overlay.png 14 tagflash/img/colorpicker_rgb_b.png 15 tagflash/img/colorpicker_submit.png 16 tagflash/img/colorpicker_select.gif 17 tagflash/img/colorpicker_hsb_h.png 18 tagflash/img/icon.png 19 tagflash/img/colorpicker_indic.gif 20 tagflash/img/colorpicker_rgb_r.png 21 tagflash/img/colorpicker_hsb_s.png 22 tagflash/img/colorpicker_background.png 8 23 tagflash/tagcloud.swf 9 24 tagflash/swfobject.js 25 tagflash/tpl/index.tpl 26 tagflash/js/jquery.colorpicker.js 10 27 tagflash/CHANGELOG 11 28 tagflash/_admin.php 29 tagflash/inc/class.tpl.tag.flash.php 30 tagflash/colorpicker.css 31 tagflash/_install.php 12 32 tagflash/_define.php 13 33 tagflash/COPYING 14 tagflash/class.dc.publicWidget.php15 34 tagflash/TODO -
plugins/tagflash/_admin.php
r2778 r2779 23 23 if (!defined('DC_CONTEXT_ADMIN')) { return; } 24 24 25 $_menu['Plugins']->addItem(__('Tag Flash'), 26 'plugin.php?p=tagflash', 27 'index.php?pf=tagflash/img/icon.png', 28 preg_match('/plugin.php\?p=tagflash(&.*)?$/', $_SERVER['REQUEST_URI']), 29 $core->auth->check('usage,contentadmin', $core->blog->id) 30 ); 31 32 25 33 require dirname(__FILE__).'/_widgets.php'; 26 34 ?> -
plugins/tagflash/_define.php
r2778 r2779 27 27 /* Description*/ "Flash based Tag Cloud for Dotclear", 28 28 /* Author */ "Gwénaël Després (based on WordPress plugin by Roy Tanck)", 29 /* Version */ '1. 0.3',29 /* Version */ '1.1.0', 30 30 /* Permissions */ 'usage,contentadmin' 31 31 ); -
plugins/tagflash/_install.php
r2778 r2779 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | Tag Flash - a plugin for Dotclear|3 // | tagFlash - a plugin for Dotclear | 4 4 // +-----------------------------------------------------------------------+ 5 5 // | Copyright(C) 2010 Nicolas Roudaire http://www.nikrou.net | 6 // | Copyright(C) 2010 Guenaël Després|6 // | Copyright(C) 2010 Guenaël | 7 7 // +-----------------------------------------------------------------------+ 8 8 // | This program is free software; you can redistribute it and/or modify | … … 21 21 // +-----------------------------------------------------------------------+ 22 22 23 if (!defined('DC_ RC_PATH')) { return; }23 if (!defined('DC_CONTEXT_ADMIN')) { exit; } 24 24 25 $__autoload['dcPublicWidget'] = dirname(__FILE__).'/class.dc.publicWidget.php'; 26 ?> 25 $version = $core->plugins->moduleInfo('tagflash','version'); 26 if (version_compare($core->getVersion('tagflash'),$version,'>=')) { 27 return; 28 } 29 30 $settings = $core->blog->settings; 31 $settings->addNamespace('tagflash'); 32 33 $settings->tagflash->put('active', false, 'boolean', 'Tag Flash plugin activated', false); 34 $settings->tagflash->put('bgcolor', '', 'string', 'Animation background color', false); 35 $settings->tagflash->put('color1', '', 'string', 'Color 1 for animation', false); 36 $settings->tagflash->put('color2', '', 'string', 'Color 2 for animation', false); 37 $settings->tagflash->put('hicolor', '', 'string', 'Highlight color for animation', false); 38 $settings->tagflash->put('width', '', 'string', 'Animation width', false); 39 $settings->tagflash->put('height', '', 'string', 'Animation height', false); 40 $settings->tagflash->put('speed', '', 'string', 'Animation roation speed', false); 41 42 $core->setVersion('tagflash', $version); 43 44 return true; -
plugins/tagflash/_prepend.php
r2778 r2779 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | Tag Flash - a plugin for Dotclear|3 // | tagFlash - a plugin for Dotclear | 4 4 // +-----------------------------------------------------------------------+ 5 5 // | Copyright(C) 2010 Nicolas Roudaire http://www.nikrou.net | 6 // | Copyright(C) 2010 Guenaël Després|6 // | Copyright(C) 2010 Guenaël | 7 7 // +-----------------------------------------------------------------------+ 8 8 // | This program is free software; you can redistribute it and/or modify | … … 23 23 if (!defined('DC_RC_PATH')) { return; } 24 24 25 $__autoload[' dcPublicWidget'] = dirname(__FILE__).'/class.dc.publicWidget.php';25 $__autoload['tplTagFlash'] = dirname(__FILE__).'/inc/class.tpl.tag.flash.php'; 26 26 ?> -
plugins/tagflash/_public.php
r2778 r2779 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Tag Flash - a plugin for Dotclear |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2010 Nicolas Roudaire http://www.nikrou.net |6 // | Copyright(C) 2010 Guenaël Després |7 // +-----------------------------------------------------------------------+8 // | This program is free software; you can redistribute it and/or modify |9 // | it under the terms of the GNU General Public License as published by |10 // | the Free Software Foundation |11 // | |12 // | This program is distributed in the hope that it will be useful, but |13 // | WITHOUT ANY WARRANTY; without even the implied warranty of |14 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |15 // | General Public License for more details. |16 // | |17 // | You should have received a copy of the GNU General Public License |18 // | along with this program; if not, write to the Free Software |19 // | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |20 // | MA 02110-1301 USA. |21 // +-----------------------------------------------------------------------+22 23 2 if (!defined('DC_RC_PATH')) { return; } 24 3 25 4 require(dirname(__FILE__).'/_widgets.php'); 26 27 class publicTagFlashWidget extends dcPublicWidget28 {29 public static function tagFlashWidget($w) {30 global $core, $_ctx;31 32 $_ctx->widget = $w;33 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates');34 35 return self::serveWidget('tagFlash-widget.html');36 }37 }38 39 $core->tpl->addValue('WidgetParam',40 array('tplWidget', 'widgetParam'));41 42 class tplWidget {43 44 public static function widgetParam($attr) {45 46 $param = null;47 if (!empty($attr['param'])) {48 $param = addslashes($attr['param']);49 }50 51 $f = $GLOBALS['core']->tpl->getFilters($attr);52 if ($param != null) {53 return '<?php echo '.sprintf($f,'$GLOBALS[\'_ctx\']->widget->'.$param.'').'; ?>';54 }55 return;56 }57 }58 59 $core->tpl->addValue('tagFlashWidth', array('tplTagFlash', 'tagFlashWidth'));60 $core->tpl->addValue('tagFlashHeight', array('tplTagFlash', 'tagFlashHeight'));61 $core->tpl->addValue('tagFlashTagColor', array('tplTagFlash', 'tagFlashTagColor'));62 $core->tpl->addValue('tagFlashBackgroundColor', array('tplTagFlash', 'tagFlashBackgroundColor'));63 $core->tpl->addBlock('tagFlashIfTransparent', array('tplTagFlash', 'tagFlashIfTransparent'));64 $core->tpl->addValue('tagFlashSpeed', array('tplTagFlash', 'tagFlashSpeed'));65 $core->tpl->addValue('tagFlashTags', array('tplTagFlash', 'tagFlashTags'));66 67 class tplTagFlash {68 69 private static $SIZE_TRANSLATOR = array(70 '0' => '0',71 '10' => '8',72 '20' => '10',73 '30' => '12',74 '40' => '14',75 '50' => '16',76 '60' => '18',77 '70' => '20',78 '80' => '22',79 '90' => '24',80 '100' => '26'81 );82 83 public static function tagFlashWidth($attr) {84 85 return '<?php echo tplTagFlash::getWidth(); ?>';86 }87 public static function getWidth() {88 89 return $GLOBALS['_ctx']->widget->width;90 }91 92 public static function tagFlashHeight($attr) {93 return '<?php echo tplTagFlash::getHeight(); ?>';94 }95 public static function getHeight() {96 return $GLOBALS['_ctx']->widget->height;97 }98 99 public static function tagFlashTagColor($attr) {100 return '<?php echo tplTagFlash::getTagColor(); ?>';101 }102 public static function getTagColor() {103 $w = $GLOBALS['_ctx']->widget;104 $color = '';105 if ($w->color != '') {106 $color = '0x'.$w->color;107 }108 return $color;109 }110 111 public static function tagFlashBackgroundColor($attr) {112 return '<?php echo tplTagFlash::getBackgroundColor(); ?>';113 }114 public static function getBackgroundColor() {115 116 $w = $GLOBALS['_ctx']->widget;117 118 $color = '';119 if ($w->bgcolor != '') {120 $color = '#'.$w->bgcolor;121 }122 return $color;123 }124 125 public static function tagFlashIfTransparent($attr, $content) {126 127 return '<?php if (tplTagFlash::isTransparent()) { echo \''.$content.'\'; } ?>';128 }129 public static function isTransparent() {130 131 return ($GLOBALS['_ctx']->widget->transparent == "1");132 }133 134 public static function tagFlashSpeed($attr) {135 return '<?php echo tplTagFlash::getSpeed(); ?>';136 }137 public static function getSpeed() {138 139 $w = $GLOBALS['_ctx']->widget;140 141 $speed = '150';142 if ((integer) $w->speed > 0) {143 $speed = $w->speed;144 }145 146 return $speed;147 }148 149 public static function tagFlashTags($attr) {150 return '<?php echo tplTagFlash::getTags(); ?>';151 }152 public static function getTags() {153 154 $core = $GLOBALS['core'];155 $w = $GLOBALS['_ctx']->widget;156 157 $limit = null;158 if ($w->limit != "" && is_numeric($w->limit)) {159 $limit = $w->limit;160 }161 162 $objMeta = new dcMeta($core);163 $rs = $objMeta->getMeta('tag', $limit);164 165 $buff = '<tags>';166 167 if (!$rs->isEmpty()) {168 while ($rs->fetch()) {169 170 $buff .=171 '<a href=\''.$core->blog->url.$core->url->getBase('tag').'/'.rawurlencode($rs->meta_id).'\' '.172 'style=\''.self::$SIZE_TRANSLATOR[$rs->roundpercent].'\'>'.173 $rs->meta_id.'<\\/a>';174 }175 }176 177 $buff .= '<\\/tags>';178 179 return $buff;180 }181 }182 5 ?> -
plugins/tagflash/_widgets.php
r2778 r2779 23 23 if (!defined('DC_RC_PATH')) { return; } 24 24 25 $core->addBehavior('initWidgets', 26 array('tagFlashWidgetBehaviors','initWidgets') 27 ); 28 $core->addBehavior('initDefaultWidgets', 29 array('tagFlashWidgetBehaviors','initDefaultWidgets') 30 ); 25 $core->addBehavior('initWidgets',array('tagFlashWidgetBehaviors','initWidgets')); 26 $core->addBehavior('initDefaultWidgets',array('tagFlashWidgetBehaviors','initDefaultWidgets')); 31 27 32 28 class tagFlashWidgetBehaviors … … 38 34 public static function initWidgets($w) { 39 35 $w->create('tagFlash',__('Tags Flash'), 40 array(' publicTagFlashWidget','tagFlashWidget')36 array('tplTagFlash','widget') 41 37 ); 42 38 43 $w->tagFlash->setting('title',__('Title:'), 44 'Tags','text'); 45 $w->tagFlash->setting('width',__('Width of the Flash tag cloud:'), 46 '100%','text'); 47 $w->tagFlash->setting('height',__('Height of the Flash tag cloud:'), 48 '200px','text'); 49 $w->tagFlash->setting('color',__('Color of the tags (6 character hex color value without the # prefix):'), 50 '000000','text'); 51 $w->tagFlash->setting('bgcolor',__('Backgound color (6 character hex color value without the # prefix):'), 52 'ffffff','text'); 53 $w->tagFlash->setting('transparent',__('Use transparent mode'), 54 'true','check'); 55 $w->tagFlash->setting('speed',__('Rotation speed (default=150):'), 56 '150','text'); 57 $w->tagFlash->setting('limit',__('Maximun displayed tags (empty=no limit):'), 58 '','text'); 39 $w->tagFlash->setting('title',__('Title:'),'Tags','text'); 40 $w->tagFlash->setting('seo_content',__('Add tags for SEO'),1,'check'); 41 $w->tagFlash->setting('transparent_mode',__('Transparent mode'),1,'check'); 42 $w->tagFlash->setting('limit',__('Maximun displayed tags (empty=no limit):'),0,'text'); 59 43 } 60 44 } -
plugins/tagflash/locales/en/resources.php
r2778 r2779 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | Tag Flash - a plugin for Dotclear|3 // | tagFlash - a plugin for Dotclear | 4 4 // +-----------------------------------------------------------------------+ 5 5 // | Copyright(C) 2010 Nicolas Roudaire http://www.nikrou.net | 6 // | Copyright(C) 2010 Guenaël Després|6 // | Copyright(C) 2010 Guenaël | 7 7 // +-----------------------------------------------------------------------+ 8 8 // | This program is free software; you can redistribute it and/or modify | … … 21 21 // +-----------------------------------------------------------------------+ 22 22 23 if (!defined('DC_CONTEXT_ADMIN')) { return; } 24 25 require dirname(__FILE__).'/_widgets.php'; 23 $__resources['help']['tagflash'] = dirname(__FILE__).'/help.html'; 26 24 ?> -
plugins/tagflash/locales/fr/resources.php
r2778 r2779 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | Tag Flash - a plugin for Dotclear|3 // | tagFlash - a plugin for Dotclear | 4 4 // +-----------------------------------------------------------------------+ 5 5 // | Copyright(C) 2010 Nicolas Roudaire http://www.nikrou.net | 6 // | Copyright(C) 2010 Guenaël Després|6 // | Copyright(C) 2010 Guenaël | 7 7 // +-----------------------------------------------------------------------+ 8 8 // | This program is free software; you can redistribute it and/or modify | … … 21 21 // +-----------------------------------------------------------------------+ 22 22 23 if (!defined('DC_CONTEXT_ADMIN')) { return; } 24 25 require dirname(__FILE__).'/_widgets.php'; 23 $__resources['help']['tagflash'] = dirname(__FILE__).'/help.html'; 26 24 ?>
Note: See TracChangeset
for help on using the changeset viewer.