Dotclear

Changeset 3335


Ignore:
Timestamp:
01/22/15 12:34:24 (8 years ago)
Author:
nikrou
Message:
  • Add default values for width, height, colors at first installation.
  • Update widget options
  • Fix CR for some files Thanks to brol <contact@…> for all theses points.
Location:
plugins/tagflash
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • plugins/tagflash/CHANGELOG

    r3307 r3335  
     1Tag Flash 1.2.2 - 2015-01-22 
     2================================= 
     3* Add default values for width, height, colors at first installation. 
     4* Update widget options 
     5* Fix CR for some files 
     6  Thanks to brol <contact@brol.info> for all theses points. 
     7 
    18Tag Flash 1.2.1 - 2014-04-13 
    29================================= 
     
    2734* Add help 
    2835* Option to add code for search engine 
    29 * Remove swfobject dependency  
     36* Remove swfobject dependency 
    3037 
    3138Tag Flash 1.0.3 - 2010-11-24 
  • plugins/tagflash/_admin.php

    r3306 r3335  
    33// | tagFlash  - a plugin for Dotclear                                     | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010,2014 Nicolas Roudaire        http://www.nikrou.net  | 
     5// | Copyright(C) 2010,2015 Nicolas Roudaire        http://www.nikrou.net  | 
    66// | Copyright(C) 2010 Guenaël                                             | 
    77// +-----------------------------------------------------------------------+ 
     
    2323if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    2424 
    25 $_menu['Blog']->addItem(__('Tag Flash'),  
     25$_menu['Blog']->addItem(__('Tag Flash'), 
    2626                  'plugin.php?p=tagflash', 
    2727                  'index.php?pf=tagflash/img/icon.png', 
     
    3030                  ); 
    3131 
    32  
    3332require dirname(__FILE__).'/_widgets.php'; 
  • plugins/tagflash/_define.php

    r3307 r3335  
    33// | tagFlash  - a plugin for Dotclear                                     | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010,2014 Nicolas Roudaire        http://www.nikrou.net  | 
     5// | Copyright(C) 2010,2015 Nicolas Roudaire        http://www.nikrou.net  | 
    66// | Copyright(C) 2010 Guenaël                                             | 
    77// +-----------------------------------------------------------------------+ 
     
    2727     /* Description*/    "Flash based Tag Cloud for Dotclear", 
    2828     /* Author */        "Gwénaël Després (based on WordPress plugin by Roy Tanck)", 
    29      /* Version */       "1.2.1", 
     29     /* Version */       "1.2.2", 
    3030     /* Permissions */   "usage,contentadmin", 
    3131     /* Properties */    array('type' => 'plugin', 
     
    3333                                     'support' => 'http://forum.dotclear.net/viewtopic.php?id=34559', 
    3434                                     'details' => 'http://plugins.dotaddict.org/dc2/details/tagflash' 
    35                                     ) 
    36                            ); 
     35    ) 
     36); 
  • plugins/tagflash/_install.php

    r3306 r3335  
    33// | tagFlash  - a plugin for Dotclear                                     | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010,2014 Nicolas Roudaire        http://www.nikrou.net  | 
     5// | Copyright(C) 2010,2015 Nicolas Roudaire        http://www.nikrou.net  | 
    66// | Copyright(C) 2010 Guenaël                                             | 
    77// +-----------------------------------------------------------------------+ 
     
    2424 
    2525$version = $core->plugins->moduleInfo('tagflash','version'); 
    26 if (version_compare($core->getVersion('tagflash'),$version,'>=')) {  
     26if (version_compare($core->getVersion('tagflash'),$version,'>=')) { 
    2727  return; 
    2828} 
     
    3232 
    3333$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); 
     34$settings->tagflash->put('bgcolor', 'FFFFFF', 'string', 'Animation background color', false); 
     35$settings->tagflash->put('color1', '333333', 'string', 'Color 1 for animation', false); 
     36$settings->tagflash->put('color2', 'FF3363', 'string', 'Color 2 for animation', false); 
     37$settings->tagflash->put('hicolor', '00CC00', 'string', 'Highlight color for animation', false); 
     38$settings->tagflash->put('width', '600', 'string', 'Animation width', false); 
     39$settings->tagflash->put('height', '400', 'string', 'Animation height', false); 
    4040$settings->tagflash->put('speed', '', 'string', 'Animation roation speed', false); 
    4141 
  • plugins/tagflash/_prepend.php

    r3306 r3335  
    33// | tagFlash  - a plugin for Dotclear                                     | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010,2014 Nicolas Roudaire        http://www.nikrou.net  | 
     5// | Copyright(C) 2010,2015 Nicolas Roudaire        http://www.nikrou.net  | 
    66// | Copyright(C) 2010 Guenaël                                             | 
    77// +-----------------------------------------------------------------------+ 
  • plugins/tagflash/_public.php

    r3306 r3335  
    33// | tagFlash  - a plugin for Dotclear                                     | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010,2014 Nicolas Roudaire        http://www.nikrou.net  | 
     5// | Copyright(C) 2010,2015 Nicolas Roudaire        http://www.nikrou.net  | 
    66// | Copyright(C) 2010 Guenaël                                             | 
    77// +-----------------------------------------------------------------------+ 
  • plugins/tagflash/_widgets.php

    r3306 r3335  
    33// | tagFlash  - a plugin for Dotclear                                     | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010,2014 Nicolas Roudaire        http://www.nikrou.net  | 
     5// | Copyright(C) 2010,2015 Nicolas Roudaire        http://www.nikrou.net  | 
    66// | Copyright(C) 2010 Guenaël                                             | 
    77// +-----------------------------------------------------------------------+ 
     
    2323if (!defined('DC_RC_PATH')) { return; } 
    2424 
     25$self_ns = $core->blog->settings->addNamespace('tagflash'); 
     26if (!$self_ns->active) { 
     27    return; 
     28} 
     29 
    2530$core->addBehavior('initWidgets',array('tagFlashWidgetBehaviors','initWidgets')); 
    2631$core->addBehavior('initDefaultWidgets',array('tagFlashWidgetBehaviors','initDefaultWidgets')); 
    2732 
    28 class tagFlashWidgetBehaviors  
     33class tagFlashWidgetBehaviors 
    2934{ 
    3035    public static function initDefaultWidgets($w, $d) { 
     
    3439    public static function initWidgets($w) { 
    3540        $w->create('tagFlash',__('Tags Flash'), array('tplTagFlash','widget')); 
    36          
     41 
    3742        $w->tagFlash->setting('title',__('Title:'),'Tags','text'); 
    3843        $w->tagFlash->setting('seo_content',__('Add tags for SEO'),1,'check'); 
    3944        $w->tagFlash->setting('transparent_mode',__('Transparent mode'),1,'check'); 
    4045        $w->tagFlash->setting('limit',__('Maximun displayed tags (empty=no limit):'),0,'text'); 
    41          
     46 
    4247        $w->tagFlash->setting('homeonly', 
    4348        __('Display on:'), 0, 'combo', 
     
    5055        $w->tagFlash->setting('content_only', __('Content only'), 0, 'check'); 
    5156        $w->tagFlash->setting('class', __('CSS class:'), ''); 
     57        $w->tagFlash->setting('offline',__('Offline'),0,'check'); 
    5258    } 
    5359} 
  • plugins/tagflash/inc/class.tpl.tag.flash.php

    r3307 r3335  
    33// | tagFlash  - a plugin for Dotclear                                     | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010,2014 Nicolas Roudaire        http://www.nikrou.net  | 
     5// | Copyright(C) 2010,2015 Nicolas Roudaire        http://www.nikrou.net  | 
    66// | Copyright(C) 2010 Guenaël                                             | 
    77// +-----------------------------------------------------------------------+ 
     
    2121// +-----------------------------------------------------------------------+ 
    2222 
     23if (!defined('DC_RC_PATH')) { return; } 
     24 
    2325class tplTagFlash 
    2426{ 
     
    3032    public static function widget($w) { 
    3133        global $core, $_ctx; 
    32      
     34 
    3335        if (!$core->blog->settings->tagflash->active) { 
    3436            return; 
    3537        } 
     38 
     39          if ($w->offline) 
     40               return; 
    3641 
    3742          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     
    4550 
    4651        $res = ''; 
    47          
    48         if ($w->title) { 
    49             $res .= '<h2>'.$w->title.'</h2>'; 
    50         } 
    5152 
    5253        $res .= sprintf('<object data="%s" width="%s" height="%s" type="application/x-shockwave-flash">'."\n", 
     
    5556        $settings->height 
    5657        ); 
    57                
     58 
    5859        $res .= sprintf('<param name="movie" value="%s"/>', $flash_url); 
    5960        $res .= '<param name="allowScriptAccess" value="sameDomain"/>'."\n"; 
     
    6970        } 
    7071 
    71         $res .= '<div id="tagFlashContent">'.self::getTags($w, false).'</div>'."\n";     
     72        $res .= '<div id="tagFlashContent">'.self::getTags($w, false).'</div>'."\n"; 
    7273        $res .= '</object>'."\n"; 
    7374        $res .= '<p><strong><a href="'.$core->blog->url.$core->url->getBase('tags').'">'.__('All tags').'</a></strong></p>'; 
    7475 
    75         return 
    76             ($w->content_only ? '' : '<div class="tagFlash'.($w->class ? ' '.html::escapeHTML($w->class) : '').'">'). 
    77             $res. 
    78             ($w->content_only ? '' : '</div>'); 
     76        $res = 
     77        ($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : ''). 
     78              $res; 
     79 
     80              return $w->renderDiv($w->content_only,'tagFlash '.$w->class,'',$res); 
    7981    } 
    8082 
     
    9698    public static function getTags($w, $for_flash=true) { 
    9799        global $core; 
    98        
     100 
    99101        $limit = null; 
    100102        if ($w->limit && is_numeric($w->limit)) { 
    101103            $limit = $w->limit; 
    102104        } 
    103      
     105 
    104106        $rs = $core->meta->computeMetaStats( 
    105107            $core->meta->getMetadata(array('meta_type'=> 'tag', 
    106108            'limit'=> $limit) 
    107109            ) 
    108         );  
     110        ); 
    109111        $res = ''; 
    110112        if ($for_flash) { 
     
    113115            $fmt_tag = '<li><a href="%s" class="tag%s" rel="tag">%s</a></li>'; 
    114116        } 
    115      
     117 
    116118        if (!$rs->isEmpty()) { 
    117119            while ($rs->fetch()) { 
    118                 $res .= sprintf($fmt_tag,  
     120                $res .= sprintf($fmt_tag, 
    119121                $core->blog->url.$core->url->getBase('tag').'/'.urlencode(utf8_encode($rs->meta_id)), 
    120122                self::$size_translator[$rs->roundpercent], 
     
    123125            } 
    124126        } 
    125          
     127 
    126128        if ($for_flash) { 
    127129            $res = '<tags>'.$res.'</tags>'; 
     
    129131            $res = '<ul>'.$res.'</ul>'; 
    130132        } 
    131          
     133 
    132134        return $res; 
    133135    } 
  • plugins/tagflash/index.php

    r3307 r3335  
    33// | tagFlash  - a plugin for Dotclear                                     | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010,2014 Nicolas Roudaire        http://www.nikrou.net  | 
     5// | Copyright(C) 2010,2015 Nicolas Roudaire        http://www.nikrou.net  | 
    66// | Copyright(C) 2010 Guenaël                                             | 
    77// +-----------------------------------------------------------------------+ 
     
    5050        $tagflash_active = (empty($_POST['tagflash_active']))?false:true; 
    5151        $core->blog->settings->tagflash->put('active', $tagflash_active, 'boolean'); 
    52          
     52 
    5353        if (!empty($_POST['tagflash_width'])) { 
    5454            $tagflash_width = trim($_POST['tagflash_width'], " /\n\t\r\0\x0B"); 
    5555            $core->blog->settings->tagflash->put('width', $tagflash_width, 'string'); 
    5656        } 
    57          
     57 
    5858        if (!empty($_POST['tagflash_height'])) { 
    5959            $tagflash_height = trim($_POST['tagflash_height'], " /\n\t\r\0\x0B"); 
    6060            $core->blog->settings->tagflash->put('height', $tagflash_height, 'string'); 
    6161        } 
    62          
     62 
    6363        if (!empty($_POST['tagflash_bgcolor'])) { 
    6464            $tagflash_bgcolor = trim($_POST['tagflash_bgcolor'], " /\n\t\r\0\x0B"); 
    6565            $core->blog->settings->tagflash->put('bgcolor', $tagflash_bgcolor, 'string'); 
    6666        } 
    67          
     67 
    6868        if (!empty($_POST['tagflash_color1'])) { 
    6969            $tagflash_color1 = trim($_POST['tagflash_color1'], " /\n\t\r\0\x0B"); 
    7070            $core->blog->settings->tagflash->put('color1', $tagflash_color1, 'string'); 
    7171        } 
    72          
     72 
    7373        if (!empty($_POST['tagflash_color2'])) { 
    7474            $tagflash_color2 = trim($_POST['tagflash_color2'], " /\n\t\r\0\x0B"); 
    7575            $core->blog->settings->tagflash->put('color2', $tagflash_color2, 'string'); 
    7676        } 
    77          
     77 
    7878        if (!empty($_POST['tagflash_hicolor'])) { 
    7979            $tagflash_hicolor = trim($_POST['tagflash_hicolor'], " /\n\t\r\0\x0B"); 
    8080            $core->blog->settings->tagflash->put('hicolor', $tagflash_hicolor, 'string'); 
    8181        } 
    82          
     82 
    8383        if (!empty($_POST['tagflash_speed'])) { 
    8484            $tagflash_speed = (int)trim($_POST['tagflash_speed'], " /\n\t\r\0\x0B"); 
     
    8989        } 
    9090 
    91         $core->blog->triggerBlog();     
     91        $core->blog->triggerBlog(); 
    9292        $message = __('Configuration successfully updated.'); 
    9393    } catch (Exception $e) { 
  • plugins/tagflash/locales/en/resources.php

    r3306 r3335  
    33// | tagFlash  - a plugin for Dotclear                                     | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010,2014 Nicolas Roudaire        http://www.nikrou.net  | 
     5// | Copyright(C) 2010,2015 Nicolas Roudaire        http://www.nikrou.net  | 
    66// | Copyright(C) 2010 Guenaël                                             | 
    77// +-----------------------------------------------------------------------+ 
  • plugins/tagflash/locales/fr/resources.php

    r3306 r3335  
    33// | tagFlash  - a plugin for Dotclear                                     | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010,2014 Nicolas Roudaire        http://www.nikrou.net  | 
     5// | Copyright(C) 2010,2015 Nicolas Roudaire        http://www.nikrou.net  | 
    66// | Copyright(C) 2010 Guenaël                                             | 
    77// +-----------------------------------------------------------------------+ 
Note: See TracChangeset for help on using the changeset viewer.

Sites map