Dotclear

Changeset 2400


Ignore:
Timestamp:
06/27/10 02:26:01 (13 years ago)
Author:
JcDenis
Message:

shareOn 0.5

  • Switched to DC 2.2
  • Fixed rights (limit to admin)
  • Fixed default buttons settings
Location:
plugins/shareOn
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • plugins/shareOn/_admin.php

    r2206 r2400  
    2020     'plugin.php?p=shareOn','index.php?pf=shareOn/icon.png', 
    2121     preg_match('/plugin.php\?p=shareOn(&.*)?$/',$_SERVER['REQUEST_URI']), 
    22      $core->auth->check('content',$core->blog->id)); 
     22     $core->auth->check('admin',$core->blog->id) 
     23); 
    2324?> 
  • plugins/shareOn/_define.php

    r2261 r2400  
    1717     /* Description*/         "Add some buttons to your posts to share them", 
    1818     /* Author */        "JC Denis", 
    19      /* Version */       '0.4.3', 
    20      /* Permissions */        'content' 
     19     /* Version */       '0.5', 
     20     /* Permissions */        'admin' 
    2121); 
    22      /* date */          #20100525 
     22     /* date */          #20100626 
    2323?> 
  • plugins/shareOn/_install.php

    r2217 r2400  
    1818if (version_compare($old_version,$new_version,'>=')) return; 
    1919 
    20 try { 
    21      # Check DC version (dev on) 
    22      if (!version_compare(DC_VERSION,'2.1.6','>=')) 
     20try 
     21{ 
     22     # Check DC version 
     23     if (version_compare(DC_VERSION,'2.2-alpha','<')) 
    2324     { 
    24           throw new Exception('Plugin called shareOn requires Dotclear 2.1.6 or higher.'); 
     25          throw new Exception('Plugin called rateIt requires Dotclear 2.2 or higher.'); 
    2526     } 
    26  
     27      
    2728     # Setting 
    2829     $css =  
     
    3132     "#sidebar .shareonwidget ul { list-style: none; margin: 4px; padding: 0; border: none; } \n". 
    3233     "#sidebar .shareonwidget ul li { margin: 4px; padding: 0; border: none; } \n"; 
    33  
    34      $s = shareOnSettings($core); 
     34      
     35     $s = $core->blog->settings->shareOn; 
    3536     $s->put('shareOn_active',false,'boolean','Enable shareOn',false,true); 
    3637     $s->put('shareOn_style',$css,'string','Special ShareOn css',false,true); 
     
    4041     $s->put('shareOn_tag_place','after','string','Where to place ShareOn bar on tag page',false,true); 
    4142     $s->put('shareOn_post_place','after','string','Where to place ShareOn bar on post page',false,true); 
    42  
     43      
    4344     # Version 
    4445     $core->setVersion('shareOn',$new_version); 
    45  
     46      
    4647     return true; 
    4748} 
    48 catch (Exception $e) { 
     49catch (Exception $e) 
     50{ 
    4951     $core->error->add($e->getMessage()); 
    5052} 
  • plugins/shareOn/_prepend.php

    r2261 r2400  
    1212 
    1313if (!defined('DC_RC_PATH')) return; 
     14if (version_compare(DC_VERSION,'2.2-alpha','<')){return;} 
    1415 
    15 global $core; 
    16  
    17 function shareOnSettings($core,$ns='shareOn') { 
    18      if (!version_compare(DC_VERSION,'2.1.7','<=')) {  
    19           $core->blog->settings->addNamespace($ns);  
    20           return $core->blog->settings->{$ns};  
    21      } else {  
    22           $core->blog->settings->setNamespace($ns);  
    23           return $core->blog->settings;  
    24      } 
    25 } 
     16global $core, $__autoload; 
     17$core->blog->settings->addNamespace('shareOn'); 
    2618 
    2719if (!isset($core->shareOnButtons)) { $core->shareOnButtons = array(); } 
     20 
     21$__autoload['shareOn'] = dirname(__FILE__).'/inc/class.shareon.php'; 
     22 
     23$__autoload['flattrButton'] = dirname(__FILE__).'/inc/class.shareon.php'; 
     24$__autoload['tweetmemeButton'] = dirname(__FILE__).'/inc/class.shareon.php'; 
     25$__autoload['fbshareButton'] = dirname(__FILE__).'/inc/class.shareon.php'; 
     26$__autoload['fbloveButton'] = dirname(__FILE__).'/inc/class.shareon.php'; 
     27$__autoload['diggButton'] = dirname(__FILE__).'/inc/class.shareon.php'; 
     28$__autoload['redditButton'] = dirname(__FILE__).'/inc/class.shareon.php'; 
     29$__autoload['dzoneButton'] = dirname(__FILE__).'/inc/class.shareon.php'; 
     30$__autoload['ybuzzButton'] = dirname(__FILE__).'/inc/class.shareon.php'; 
     31$__autoload['gbuzzButton'] = dirname(__FILE__).'/inc/class.shareon.php'; 
    2832 
    2933$core->shareOnButtons['flattr'] = 'flattrButton'; 
  • plugins/shareOn/_public.php

    r2217 r2400  
    2525); 
    2626 
    27 if (!shareOnSettings($core)->shareOn_active) 
     27if (!$core->blog->settings->shareOn->shareOn_active) 
    2828{ 
    2929     $core->tpl->addValue('shareOnButton',array('tplShareOn','disable')); 
     
    3838     public static function publicHeadContent($core) 
    3939     { 
    40           $s = shareOnSettings($core)->shareOn_style; 
     40          $s = $core->blog->settings->shareOn->shareOn_style; 
    4141          if (!$s) return; 
    4242 
     
    6060     protected static function publicEntryContent($core,$_ctx,$place) 
    6161     { 
    62           $s = shareOnSettings($core); 
     62          $s = $core->blog->settings->shareOn; 
    6363          if (!$s->shareOn_active || empty($core->shareOnButtons)) return; 
    6464 
     
    115115          return  
    116116          "<?php \n". 
    117           "if (shareOnSettings(\$core)->shareOn_active ". 
     117          "if (\$core->blog->settings->shareOn->shareOn_active ". 
    118118          " && !empty(\$core->shareOnButtons) ". 
    119119          " && isset(\$core->shareOnButtons['".$attr['button']."']) ". 
  • plugins/shareOn/_widgets.php

    r2217 r2400  
    2020     { 
    2121          global $core; 
    22  
    23           require_once dirname(__FILE__).'/inc/class.shareon.php'; 
    24  
     22           
    2523          $w->create('shareon', 
    2624               __('Share on'),array('shareOnWidget','publicShareOn') 
     
    3533          { 
    3634               $o = new $button($core); 
    37  
     35                
    3836               $w->shareon->setting('use_'.$button_id, 
    3937                    sprintf(__('Add %s'),$o->name),1,'check' 
     
    4139          } 
    4240     } 
    43  
     41      
    4442     public static function publicShareOn($w) 
    4543     { 
    4644          global $core, $_ctx; 
    47  
     45           
    4846          # Disable 
    49           if (!shareOnSettings($core)->shareOn_active) return; 
     47          if (!$core->blog->settings->shareOn->shareOn_active) return; 
    5048          # No button 
    5149          if (empty($core->shareOnButtons)) return; 
    5250          # Not in post context 
    5351          if ('post.html' != $_ctx->current_tpl) return; 
    54  
    55           require_once dirname(__FILE__).'/inc/class.shareon.php'; 
    56  
     52           
    5753          $li = '';  
    5854          foreach($core->shareOnButtons as $button_id => $button) 
     
    6864               if (!empty($res)) $li .= '<li>'.$res.'</li>'; 
    6965          } 
    70  
     66           
    7167          if (empty($li)) return; 
    72  
     68           
    7369          return 
    7470          '<div class="shareonwidget">'. 
  • plugins/shareOn/inc/class.shareon.php

    r2261 r2400  
    1717     public $core; 
    1818     public $s; 
    19  
     19      
    2020     public $id = 'undefined'; 
    2121     public $name = 'undefined'; 
    2222     public $home = ''; 
    2323     public $base = ''; 
    24  
     24      
    2525     public $_active = false; // enable button 
    2626     public $_small = false; // button size 
     
    3030     ); 
    3131     public $encode = true; 
    32  
     32      
    3333     public function __construct($core) 
    3434     { 
    3535          $this->core = $core; 
    36           $this->s = shareOnSettings($core); 
     36          $this->s = $core->blog->settings->shareOn; 
    3737          $this->loadSettings(); 
    3838     } 
    39  
     39      
    4040     public function loadSettings() 
    4141     { 
     
    4545          $this->_small = (boolean) $this->s->{$s}; 
    4646     } 
    47  
     47      
    4848     public function saveSettings($active,$small) 
    4949     { 
     
    5151          $this->s->put('shareOn_button'.$this->id.'_small',$small,'boolean'); 
    5252     } 
    53  
     53      
    5454     public function moreSettingsForm() 
    5555     { 
    5656          return ; 
    5757     } 
    58  
     58      
    5959     public function moreSettingsSave() 
    6060     { 
    6161      
    6262     } 
    63  
     63      
    6464     public function generateHTMLButton($url,$title) 
    6565     { 
    6666          if (!$this->_active) return ''; 
    67  
     67           
    6868          if ($this->encode) 
    6969          { 
     
    7474          $width = $this->size[(integer) $this->_small]['width']; 
    7575          $height = $this->size[(integer) $this->_small]['height']; 
    76       
     76           
    7777          $base = str_replace( 
    7878               array('%URL%','%TITLE%','%STYLE%','%WIDTH%','%HEIGHT%'), 
     
    8383          return $this->completeHTMLButton($base); 
    8484     } 
    85  
     85      
    8686     public function completeHTMLButton($base) 
    8787     { 
     
    102102     public $_rt = ''; // retweet special name 
    103103     public $encode = false; 
    104  
    105      public function __construct($core) 
    106      { 
    107           parent::__construct($core); 
    108           $this->_rt = (string) $this->s->shareOn_button_tweetmeme_rt; 
    109      } 
    110  
     104      
     105     public function __construct($core) 
     106     { 
     107          parent::__construct($core); 
     108           
     109          $rt = (string) $this->s->shareOn_button_tweetmeme_rt; 
     110           
     111          if ($rt) 
     112          { 
     113               $this->_rt = $rt; 
     114          } 
     115     } 
     116      
    111117     public function moreSettingsForm() 
    112118     { 
    113119          return 
    114          '<p class="field"><label>'. 
    115           __('Retweet name:'). 
     120         '<p><label>'. 
     121          __('Retweet name:').'<br />'. 
    116122         form::field(array('tweetmeme_rt'),50,255,$this->_rt). 
    117123          '</label></p>'. 
    118124          '<p class="form-note">'.__("Change the RT source of the button from RT @tweetmeme to RT @yourname. Please use the format of 'yourname', not 'RT @yourname'.").'</p>'; 
    119125     } 
    120  
     126      
    121127     public function moreSettingsSave() 
    122128     { 
    123           if (isset($_POST['tweetmeme_rt'])) { 
     129          if (isset($_POST['tweetmeme_rt'])) 
     130          { 
    124131               $this->s->put('shareOn_button_tweetmeme_rt',$_POST['tweetmeme_rt'],'string'); 
    125132          } 
    126133     } 
    127  
     134      
    128135     public function completeHTMLButton($base) 
    129136     { 
     
    144151     ); 
    145152     public $encode = false; 
    146  
     153      
    147154     public function __construct($core) 
    148155     { 
     
    161168          1 => array('style'=>'button_count','width'=>90,'height'=>22) 
    162169     ); 
    163  
     170      
    164171     public $_hover = ''; 
    165172     public $_showfaces = 'false'; 
    166173     public $_colorscheme = 'light'; 
    167174     public $_action = 'like'; 
    168  
    169      public function __construct($core) 
    170      { 
    171           parent::__construct($core); 
    172           $this->_hover = (string) $this->s->shareOn_button_fblove_hover; 
    173           $this->_showfaces = (string) $this->s->shareOn_button_fblove_showfaces; 
    174           $this->_colorscheme = (string) $this->s->shareOn_button_fblove_colorscheme; 
    175           $this->_action = (string) $this->s->shareOn_button_fblove_action; 
    176      } 
    177  
     175      
     176     public function __construct($core) 
     177     { 
     178          parent::__construct($core); 
     179           
     180          $hover = (string) $this->s->shareOn_button_fblove_hover; 
     181          $showfaces = (string) $this->s->shareOn_button_fblove_showfaces; 
     182          $colorscheme = (string) $this->s->shareOn_button_fblove_colorscheme; 
     183          $action = (string) $this->s->shareOn_button_fblove_action; 
     184           
     185          if ($hover) 
     186          { 
     187               $this->_hover = $hover; 
     188          } 
     189          if ($showfaces) 
     190          { 
     191               $this->_showfaces = $showfaces; 
     192          } 
     193          if ($colorscheme) 
     194          { 
     195               $this->_colorscheme = $colorscheme; 
     196          } 
     197          if ($action) 
     198          { 
     199               $this->_action = $action; 
     200          } 
     201     } 
     202      
    178203     public function moreSettingsForm() 
    179204     { 
    180205          return 
    181          '<p class="field"><label>'. 
    182           __('Button title:'). 
     206         '<p><label>'. 
     207          __('Button title:').'<br />'. 
    183208         form::field(array('fblove_hover'),50,7,$this->_hover). 
    184209          '</label></p>'. 
    185          '<p class="field"><label>'. 
    186           __('Show faces:'). 
     210         '<p><label>'. 
     211          __('Show faces:').'<br />'. 
    187212         form::combo(array('fblove_showfaces'),array(__('yes')=>'true',__('no')=>'false'),$this->_showfaces). 
    188213          '</label></p>'. 
    189          '<p class="field"><label>'. 
    190           __('Colors scheme:'). 
     214         '<p><label>'. 
     215          __('Colors scheme:').'<br />'. 
    191216         form::combo(array('fblove_colorscheme'),array(__('light')=>'light',__('dark')=>'dark'),$this->_colorscheme). 
    192217          '</label></p>'. 
    193          '<p class="field"><label>'. 
    194           __('Type:'). 
     218         '<p><label>'. 
     219          __('Type:').'<br />'. 
    195220         form::combo(array('fblove_action'),array(__('I like')=>'like',__('I recommend')=>'recommend'),$this->_action). 
    196221          '</label></p>'; 
    197222     } 
    198  
     223      
    199224     public function moreSettingsSave() 
    200225     { 
    201           if (isset($_POST['fblove_hover'])) { 
     226          if (isset($_POST['fblove_hover'])) 
     227          { 
    202228               $this->s->put('shareOn_button_fblove_hover',$_POST['fblove_hover'],'string'); 
    203229          } 
    204           if (isset($_POST['fblove_showfaces'])) { 
     230          if (isset($_POST['fblove_showfaces'])) 
     231          { 
    205232               $this->s->put('shareOn_button_fblove_showfaces',$_POST['fblove_showfaces'],'string'); 
    206233          } 
    207           if (isset($_POST['fblove_colorscheme'])) { 
     234          if (isset($_POST['fblove_colorscheme'])) 
     235          { 
    208236               $this->s->put('shareOn_button_fblove_colorscheme',$_POST['fblove_colorscheme'],'string'); 
    209237          } 
    210           if (isset($_POST['fblove_action'])) { 
     238          if (isset($_POST['fblove_action'])) 
     239          { 
    211240               $this->s->put('shareOn_button_fblove_action',$_POST['fblove_action'],'string'); 
    212241          } 
    213242     } 
    214  
     243      
    215244     public function completeHTMLButton($base) 
    216245     { 
     
    238267     public $name = 'Digg'; 
    239268     public $home = 'http://digg.com'; 
    240      public $base = '<script type="text/javascript">digg_url = \'%URL%\';digg_title = \'%TITLE%\';digg_skin = \'%STYLE%\';digg_bgcolor = \'%BGCOLOR%\';digg_window = \'new\';</script><script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>'; 
     269     public $base = '<script type="text/javascript">digg_url = "%URL%";digg_title = "%TITLE%";digg_skin = "%STYLE%";digg_bgcolor = "%BGCOLOR%";digg_window = "new";</script><script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>'; 
    241270     public $size = array( 
    242271          0 => array('style'=>'normal','width'=>52,'height'=>80), 
     
    244273     ); 
    245274     public $_bgcolor = '#FFFFFF'; // special background-color; 
    246  
    247      public function __construct($core) 
    248      { 
    249           parent::__construct($core); 
    250           $this->_bgcolor = (string) $this->s->shareOn_button_digg_bgcolor; 
    251      } 
    252  
     275      
     276     public function __construct($core) 
     277     { 
     278          parent::__construct($core); 
     279           
     280          $bgcolor = (string) $this->s->shareOn_button_digg_bgcolor; 
     281           
     282          if ($bgcolor) 
     283          { 
     284               $this->_bgcolor = $bgcolor; 
     285          } 
     286     } 
     287      
    253288     public function moreSettingsForm() 
    254289     { 
    255290          return 
    256          '<p class="field"><label>'. 
    257           __('Background color:'). 
     291         '<p><label>'. 
     292          __('Background color:').'<br />'. 
    258293         form::field(array('digg_bgcolor'),50,7,$this->_bgcolor). 
    259294          '</label></p>'. 
    260295          '<p class="form-note">'.__("Use color code like '#CC00FF'.").'</p>'; 
    261296     } 
    262  
     297      
    263298     public function moreSettingsSave() 
    264299     { 
    265           if (isset($_POST['digg_bgcolor'])) { 
     300          if (isset($_POST['digg_bgcolor'])) 
     301          { 
    266302               $this->s->put('shareOn_button_digg_bgcolor',$_POST['digg_bgcolor'],'string'); 
    267303          } 
    268304     } 
    269  
     305      
    270306     public function completeHTMLButton($base) 
    271307     { 
     
    284320          1 => array('style'=>'1','width'=>120,'height'=>22) 
    285321     ); 
    286  
     322      
    287323     public function __construct($core) 
    288324     { 
     
    301337          1 => array('style'=>'2','width'=>120,'height'=>22) 
    302338     ); 
    303  
     339      
    304340     public function __construct($core) 
    305341     { 
     
    318354          1 => array('style'=>'small-votes','width'=>159,'height'=>22) 
    319355     ); 
    320  
     356      
    321357     public function __construct($core) 
    322358     { 
     
    330366     public $name = 'Flattr'; 
    331367     public $home = 'http://flattr.com'; 
    332      public $base = "<script type=\"text/javascript\">var flattr_uid = '%UID%'; var flattr_cat = 'text'; var flattr_tle = '%TITLE%'; var flattr_dsc = '%DESC%'; var flattr_btn = '%STYLE%'; var flattr_tag = '%TAG%'; var flattr_url = '%URL%'; var flattr_lng = '%LANG%'; </script><script src=\"http://api.flattr.com/button/load.js\" type=\"text/javascript\"></script>"; 
     368     public $base = '<script type="text/javascript">var flattr_uid = "%UID%"; var flattr_cat = "text"; var flattr_tle = "%TITLE%"; var flattr_dsc = "%DESC%"; var flattr_btn = "%STYLE%"; var flattr_tag = "%TAG%"; var flattr_url = "%URL%"; var flattr_lng = "%LANG%"; </script><script src="http://api.flattr.com/button/load.js" type="text/javascript"></script>'; 
    333369     public $size = array( 
    334370          0 => array('style'=>'','width'=>53,'height'=>69), 
     
    341377     { 
    342378          parent::__construct($core); 
     379           
    343380          $this->_uid = (string) $this->s->shareOn_button_flattr_uid; 
    344381     } 
    345  
     382      
    346383     public function moreSettingsForm() 
    347384     { 
    348385          return 
    349          '<p class="field"><label>'. 
    350           __('Your Flattr UID:'). 
     386         '<p><label>'. 
     387          __('Your Flattr UID:').'<br />'. 
    351388         form::field(array('flattr_uid'),50,7,$this->_uid). 
    352389          '</label></p>'; 
    353390     } 
    354  
     391      
    355392     public function moreSettingsSave() 
    356393     { 
    357           if (isset($_POST['flattr_uid'])) { 
     394          if (isset($_POST['flattr_uid'])) 
     395          { 
    358396               $this->s->put('shareOn_button_flattr_uid',$_POST['flattr_uid'],'string'); 
    359397          } 
    360398     } 
    361  
     399      
    362400     public function completeHTMLButton($base) 
    363401     { 
    364402          global $core, $_ctx; 
    365403           
     404          if (!$this->_uid) { return; } 
     405           
    366406          $lang = 'en_GB'; 
    367           if ($_ctx->posts->post_lang != '') { 
     407          if ($_ctx->posts->post_lang != '') 
     408          { 
    368409               $lang = $_ctx->posts->post_lang; 
    369410               $lang = self::flattrLangCode($lang); 
     
    371412           
    372413          $desc = ''; 
    373           if ($_ctx->posts->post_content != '') { 
    374                if ($_ctx->posts->post_excerpt != '') { 
     414          if ($_ctx->posts->post_content != '') 
     415          { 
     416               if ($_ctx->posts->post_excerpt != '') 
     417               { 
    375418                    $desc = self::flattrClean($_ctx->posts->post_excerpt); 
    376419               } 
     
    378421                
    379422               $desc = text::cutString($desc,180); 
     423               $desc = html::escapeJS($desc); 
    380424          } 
    381425           
    382426          $tag = ''; 
    383           if ($_ctx->exists('posts')) { 
     427          if ($_ctx->exists('posts')) 
     428          { 
    384429               $obj = new dcMeta($core); 
    385430               $metas = $obj->getMeta('tag',null,null,$_ctx->posts->post_id); 
    386431               $tags = array(); 
    387                while ($metas->fetch()) {  
     432               while ($metas->fetch()) 
     433               {  
    388434                    $tags[] = $metas->meta_id; 
    389435               } 
    390436               $tag = implode(', ',$tags); 
    391437               $tag = self::flattrClean($tag); 
     438               $tag = html::escapeJS($tag); 
    392439          } 
    393440           
     
    398445          ); 
    399446     } 
    400  
     447      
    401448     protected static function flattrClean($str) 
    402449     { 
     
    463510               'vi' => 'vi_VN' 
    464511          ); 
    465           if (!isset($langs[$code])) { 
     512          if (!isset($langs[$code])) 
     513          { 
    466514               return 'en_GB'; 
    467515          } 
    468           else { 
     516          else 
     517          { 
    469518               return $langs[$code]; 
    470519          } 
     
    484533     public $encode = false; 
    485534     public $_showdesc = false; 
    486  
    487      public function __construct($core) 
    488      { 
    489           parent::__construct($core); 
    490           $this->_showdesc = (string) $this->s->shareOn_button_gbuzz_showdesc; 
    491      } 
    492  
     535      
     536     public function __construct($core) 
     537     { 
     538          parent::__construct($core); 
     539          $this->_showdesc = (boolean) $this->s->shareOn_button_gbuzz_showdesc; 
     540     } 
     541      
    493542     public function moreSettingsForm() 
    494543     { 
    495544          return 
    496          '<p class="field"><label>'. 
     545         '<p><label class="classic">'. 
     546         form::checkbox(array('gbuzz_showdesc'),1,$this->_showdesc). 
    497547          __('Add post description to message'). 
    498          form::checkbox(array('gbuzz_showdesc'),1,$this->_showdesc). 
    499548          '</label></p>'; 
    500549     } 
    501  
     550      
    502551     public function moreSettingsSave() 
    503552     { 
    504           if (isset($_POST['gbuzz_showdesc'])) { 
     553          if (isset($_POST['gbuzz_showdesc'])) 
     554          { 
    505555               $this->s->put('shareOn_button_gbuzz_showdesc',$_POST['gbuzz_showdesc'],'boolean'); 
    506556          } 
    507557     } 
    508  
     558      
    509559     public function completeHTMLButton($base) 
    510560     { 
    511           if (!$this->_showdesc) {  
     561          if (!$this->_showdesc) 
     562          {  
    512563               return str_replace('%DESC%','',$base); 
    513564          } 
    514  
     565           
    515566          global $core, $_ctx; 
    516567           
    517568          $desc = ''; 
    518           if ($_ctx->posts->post_excerpt != '') { 
     569          if ($_ctx->posts->post_excerpt != '') 
     570          { 
    519571               $desc = self::gbuzzClean($_ctx->posts->post_excerpt); 
    520572          } 
    521           elseif ($_ctx->posts->post_content != '') { 
     573          elseif ($_ctx->posts->post_content != '') 
     574          { 
    522575               $desc .= self::gbuzzClean($_ctx->posts->post_content,500); 
    523576          } 
    524  
     577           
    525578          return str_replace('%DESC%',' - '.$desc,$base); 
    526579     } 
    527  
     580      
    528581     protected static function gbuzzClean($str,$len=null) 
    529582     { 
     
    537590          ))))); 
    538591           
    539           if ($len) { 
     592          if ($len) 
     593          { 
    540594               return text::cutString($str,$len); 
    541595          } 
    542           else { 
     596          else 
     597          { 
    543598               return $str; 
    544599          } 
  • plugins/shareOn/index.php

    r2217 r2400  
    1313if (!defined('DC_CONTEXT_ADMIN')){return;} 
    1414 
    15 if (!isset($core->shareOnButtons)) $core->shareOnButtons = array(); 
    16  
    17 require_once dirname(__FILE__).'/inc/class.shareon.php'; 
    18  
     15dcPage::check('admin'); 
    1916 
    2017# Vars 
    21 $s = shareOnSettings($core); 
    22  
     18$s = $core->blog->settings->shareOn; 
     19 
     20# Settings 
    2321$_active = (boolean) $s->shareOn_active; 
    2422$_style = (string) $s->shareOn_style; 
     
    2927$_post_place = (string) $s->shareOn_post_place; 
    3028 
     29# Combos 
    3130$combo_place = array( 
    3231     __('hide') => '', 
     
    4544     'savebuttons' => __('Buttons successfully updated') 
    4645); 
    47 if (isset($msg_list[$msg])) { 
     46if (isset($msg_list[$msg])) 
     47{ 
    4848     $msg = sprintf('<p class="message">%s</p>',$msg_list[$msg]); 
    4949} 
     
    6565          $_tag_place = isset($_POST['_tag_place']) ? $_POST['_tag_place'] : ''; 
    6666          $_post_place = isset($_POST['_post_place']) ? $_POST['_post_place'] : ''; 
    67  
    68           $s->put('shareOn_active',$_active); 
    69           $s->put('shareOn_style',$_style); 
    70           $s->put('shareOn_title',$_title); 
    71           $s->put('shareOn_home_place',$_home_place); 
    72           $s->put('shareOn_cat_place',$_cat_place); 
    73           $s->put('shareOn_tag_place',$_tag_place); 
    74           $s->put('shareOn_post_place',$_post_place); 
    75  
     67           
     68          $s->put('shareOn_active',$_active,'boolean'); 
     69          $s->put('shareOn_style',$_style,'string'); 
     70          $s->put('shareOn_title',$_title,'string'); 
     71          $s->put('shareOn_home_place',$_home_place,'string'); 
     72          $s->put('shareOn_cat_place',$_cat_place,'string'); 
     73          $s->put('shareOn_tag_place',$_tag_place,'string'); 
     74          $s->put('shareOn_post_place',$_post_place,'string'); 
     75           
    7676          $core->blog->triggerBlog(); 
    7777          http::redirect($p_url.'&part=setting&msg='.$action.'&section='.$section); 
     
    125125     '</h2>'.$msg.' 
    126126     <form method="post" action="'.$p_url.'" id="buttons-form">'; 
    127  
     127      
    128128     foreach($core->shareOnButtons as $button_id => $button) 
    129129     { 
     
    136136          } 
    137137          echo 
    138           '<p class="field"><label>'. 
    139           __('Enable this button'). 
     138          '<p><label class="classic">'. 
    140139          form::checkbox(array($button_id.'_active'),'1',$o->_active). 
     140          __('Enable this button on post content'). 
    141141          '</label></p>'. 
    142           '<p class="field"><label>'. 
    143           __('Use small button'). 
     142          '<p><label class="classic">'. 
    144143          form::checkbox(array($button_id.'_small'),'1',$o->_small). 
     144          __('Use small button on post content'). 
    145145          '</label></p>'. 
    146146          $o->moreSettingsForm(). 
     
    167167     '</h2>'.$msg.' 
    168168     <form method="post" action="'.$p_url.'" id="setting-form"> 
    169  
     169      
    170170     <fieldset id="plugin"><legend>'. __('Plugin activation').'</legend> 
    171171     <p><label class="classic">'. 
     
    174174     </label></p> 
    175175     </fieldset> 
    176  
     176      
    177177     <fieldset id="sstyle"><legend>'.__('Style').'</legend> 
    178178     <p>'.__('You can add here special cascading style sheet. Share on bar has class "shareonentry" and widget has class "shareonwidget".').'</p> 
     
    181181     </p> 
    182182     </fieldset> 
    183  
     183      
    184184     <fieldset id="scontent"><legend>'.__('Content').'</legend> 
    185      <p>'.__('To use this option you must have behavior "publicEntryBeforeContent", "publicEntryAfterContent" and "publicHeadContent" in your theme.').'</p> 
     185     <p>'. 
     186     __('To use this option you must have behavior "publicEntryBeforeContent", "publicEntryAfterContent" and "publicHeadContent" in your theme.').'<br />'. 
     187     __('A widget is also available to add buttons to your blog.').'</p> 
    186188     <p><label class="classic">'. 
    187189     __('Title:').'<br />'. 
     
    206208     </label></p> 
    207209     </fieldset> 
    208  
     210      
    209211     <p> 
    210212     <input type="submit" name="settings" value="'.__('save').'" />'. 
  • plugins/shareOn/locales/fr/main.lang.php

    r2217 r2400  
    11<?php 
    2 // Language: français  
    3 // Module: shareOn - 0.4 
    4 // Date: 2010-05-05 16:05:57  
    5 // Translated with dcTranslater - 1.3  
     2// Language: Français  
     3// Module: shareOn - 0.5 
     4// Date: 2010-06-27 00:24:33  
     5// Translated with dcTranslater - 1.4.1  
    66 
    7 #_widgets.php:32 
     7#_admin.php:19 
     8#_widgets.php:24 
     9#_widgets.php:27 
     10#index.php:109 
     11#index.php:124 
     12#index.php:165 
     13$GLOBALS['__l10n']['Share on'] = 'Partager sur'; 
     14 
     15#_widgets.php:30 
    816$GLOBALS['__l10n']['Use small buttons'] = 'Utiliser les petits boutons'; 
    917 
    10 #_widgets.php:39 
     18#_widgets.php:37 
    1119$GLOBALS['__l10n']['Add %s'] = 'Ajouter %s'; 
    1220 
    13 #inc/class.shareon.php:115 
     21#inc/class.shareon.php:121 
    1422$GLOBALS['__l10n']['Retweet name:'] = 'Nom de retweet :'; 
    1523 
    16 #inc/class.shareon.php:118 
     24#inc/class.shareon.php:124 
    1725$GLOBALS['__l10n']['Change the RT source of the button from RT @tweetmeme to RT @yourname. Please use the format of \'yourname\', not \'RT @yourname\'.'] = 'Changer la source du RT de RT @tweetmeme vers RT @votrenom. Utiliser le format \'votrenom\', pas \'RT @votrenom\'.'; 
    1826 
    19 #inc/class.shareon.php:181 
     27#inc/class.shareon.php:207 
    2028$GLOBALS['__l10n']['Button title:'] = 'Titre du bouton :'; 
    2129 
    22 #inc/class.shareon.php:185 
     30#inc/class.shareon.php:211 
    2331$GLOBALS['__l10n']['Show faces:'] = 'Afficher les têtes :'; 
    2432 
    25 #inc/class.shareon.php:189 
     33#inc/class.shareon.php:215 
    2634$GLOBALS['__l10n']['Colors scheme:'] = 'Schema de couleurs :'; 
    2735 
    28 #inc/class.shareon.php:190 
     36#inc/class.shareon.php:216 
    2937$GLOBALS['__l10n']['light'] = 'clair'; 
    3038 
    31 #inc/class.shareon.php:190 
     39#inc/class.shareon.php:216 
    3240$GLOBALS['__l10n']['dark'] = 'foncé'; 
    3341 
    34 #inc/class.shareon.php:194 
     42#inc/class.shareon.php:220 
    3543$GLOBALS['__l10n']['I like'] = 'J\'aime'; 
    3644 
    37 #inc/class.shareon.php:194 
     45#inc/class.shareon.php:220 
    3846$GLOBALS['__l10n']['I recommend'] = 'Je recommande'; 
    3947 
    40 #inc/class.shareon.php:259 
     48#inc/class.shareon.php:295 
    4149$GLOBALS['__l10n']['Use color code like \'#CC00FF\'.'] = 'Utiliser le code de couleur comme \'#CC00FF\'.'; 
    4250 
    43 #inc/class.shareon.php:349 
     51#inc/class.shareon.php:387 
    4452$GLOBALS['__l10n']['Your Flattr UID:'] = 'Votre UID Flattr :'; 
    4553 
    46 #index.php:33 
     54#inc/class.shareon.php:547 
     55$GLOBALS['__l10n']['Add post description to message'] = 'Ajouter la description du billet au message'; 
     56 
     57#index.php:32 
    4758$GLOBALS['__l10n']['before content'] = 'Avant le contenu'; 
    4859 
    49 #index.php:34 
     60#index.php:33 
    5061$GLOBALS['__l10n']['after content'] = 'Après le contenu'; 
    5162 
    52 #index.php:44 
     63#index.php:43 
    5364$GLOBALS['__l10n']['Configuration successfully saved'] = 'Configuration sauvegardée avec succès'; 
    5465 
    55 #index.php:45 
     66#index.php:44 
    5667$GLOBALS['__l10n']['Buttons successfully updated'] = 'Boutons mis à jour avec succès'; 
    5768 
     
    6576$GLOBALS['__l10n']['Learn more about %s.'] = 'En savoir plus à propos de %s.'; 
    6677 
    67 #index.php:139 
    68 $GLOBALS['__l10n']['Enable this button'] = 'Activer ce bouton'; 
     78#index.php:140 
     79$GLOBALS['__l10n']['Enable this button on post content'] = 'Activer ce bouton sur le contenu des billets'; 
    6980 
    70 #index.php:143 
    71 $GLOBALS['__l10n']['Use small button'] = 'Utiliser le petit bouton'; 
     81#index.php:144 
     82$GLOBALS['__l10n']['Use small button on post content'] = 'Utiliser le petit bouton sur le contenu des billets'; 
    7283 
    7384#index.php:166 
    74 #index.php:223 
     85#index.php:225 
    7586$GLOBALS['__l10n']['Settings'] = 'Paramètres'; 
    7687 
     
    93104$GLOBALS['__l10n']['Content'] = 'Contenu'; 
    94105 
    95 #index.php:185 
     106#index.php:186 
    96107$GLOBALS['__l10n']['To use this option you must have behavior "publicEntryBeforeContent", "publicEntryAfterContent" and "publicHeadContent" in your theme.'] = 'Pour utiliser cette option vous devez avoir les behavior "publicEntryBeforeContent", "publicEntryAfterContent" et "publicHeadContent" dans votre thème.'; 
    97108 
    98 #index.php:190 
     109#index.php:187 
     110$GLOBALS['__l10n']['A widget is also available to add buttons to your blog.'] = 'Un widget est également disponible pour ajouter les boutons sur votre blog.'; 
     111 
     112#index.php:192 
    99113$GLOBALS['__l10n']['Title of group of buttons could be empty.'] = 'Le titre du groupe de boutons peut être vide.'; 
    100114 
    101 #index.php:192 
     115#index.php:194 
    102116$GLOBALS['__l10n']['Show buttons on each posts on home page:'] = 'Afficher les boutons sur chaques billets de la page d\'accueil :'; 
    103117 
    104 #index.php:196 
     118#index.php:198 
    105119$GLOBALS['__l10n']['Show buttons on each posts on categorie page:'] = 'Afficher les boutons sur chaques billets de la page de catégorie :'; 
    106120 
    107 #index.php:200 
     121#index.php:202 
    108122$GLOBALS['__l10n']['Show buttons on each posts on tag page:'] = 'Afficher les boutons sur chaques pages de tag :'; 
    109123 
    110 #index.php:204 
     124#index.php:206 
    111125$GLOBALS['__l10n']['Show buttons on a post page:'] = 'Afficher les boutons sur la page d\'un billet :'; 
    112126 
  • plugins/shareOn/locales/fr/main.po

    r2217 r2400  
    1 # Language: français 
    2 # Module: shareOn - 0.4 
    3 # Date: 2010-05-05 16:05:57 
    4 # Translated with translater 1.3 
     1# Language: Français 
     2# Module: shareOn - 0.5 
     3# Date: 2010-06-27 00:24:33 
     4# Translated with translater 1.4.1 
    55 
    66msgid "" 
    77msgstr "" 
    88"Content-Type: text/plain; charset=UTF-8\n" 
    9 "Project-Id-Version: shareOn 0.4\n" 
     9"Project-Id-Version: shareOn 0.5\n" 
    1010"POT-Creation-Date: \n" 
    11 "PO-Revision-Date: 2010-05-05T16:05:57+00:00\n" 
     11"PO-Revision-Date: 2010-06-27T00:24:33+00:00\n" 
    1212"Last-Translator: JC Denis\n" 
    1313"Language-Team: \n" 
     
    1515"Content-Transfer-Encoding: 8bit\n" 
    1616 
    17 #: _widgets.php:32 
     17#: _admin.php:19 
     18#: _widgets.php:24 
     19#: _widgets.php:27 
     20#: index.php:109 
     21#: index.php:124 
     22#: index.php:165 
     23msgid "Share on" 
     24msgstr "Partager sur" 
     25 
     26#: _widgets.php:30 
    1827msgid "Use small buttons" 
    1928msgstr "Utiliser les petits boutons" 
    2029 
    21 #: _widgets.php:39 
     30#: _widgets.php:37 
    2231msgid "Add %s" 
    2332msgstr "Ajouter %s" 
    2433 
    25 #: inc/class.shareon.php:115 
     34#: inc/class.shareon.php:121 
    2635msgid "Retweet name:" 
    2736msgstr "Nom de retweet :" 
    2837 
    29 #: inc/class.shareon.php:118 
     38#: inc/class.shareon.php:124 
    3039msgid "Change the RT source of the button from RT @tweetmeme to RT @yourname. Please use the format of 'yourname', not 'RT @yourname'." 
    3140msgstr "Changer la source du RT de RT @tweetmeme vers RT @votrenom. Utiliser le format 'votrenom', pas 'RT @votrenom'." 
    3241 
    33 #: inc/class.shareon.php:181 
     42#: inc/class.shareon.php:207 
    3443msgid "Button title:" 
    3544msgstr "Titre du bouton :" 
    3645 
    37 #: inc/class.shareon.php:185 
     46#: inc/class.shareon.php:211 
    3847msgid "Show faces:" 
    3948msgstr "Afficher les têtes :" 
    4049 
    41 #: inc/class.shareon.php:189 
     50#: inc/class.shareon.php:215 
    4251msgid "Colors scheme:" 
    4352msgstr "Schema de couleurs :" 
    4453 
    45 #: inc/class.shareon.php:190 
     54#: inc/class.shareon.php:216 
    4655msgid "light" 
    4756msgstr "clair" 
    4857 
    49 #: inc/class.shareon.php:190 
     58#: inc/class.shareon.php:216 
    5059msgid "dark" 
    5160msgstr "foncé" 
    5261 
    53 #: inc/class.shareon.php:194 
     62#: inc/class.shareon.php:220 
    5463msgid "I like" 
    5564msgstr "J'aime" 
    5665 
    57 #: inc/class.shareon.php:194 
     66#: inc/class.shareon.php:220 
    5867msgid "I recommend" 
    5968msgstr "Je recommande" 
    6069 
    61 #: inc/class.shareon.php:259 
     70#: inc/class.shareon.php:295 
    6271msgid "Use color code like '#CC00FF'." 
    6372msgstr "Utiliser le code de couleur comme '#CC00FF'." 
    6473 
    65 #: inc/class.shareon.php:349 
     74#: inc/class.shareon.php:387 
    6675msgid "Your Flattr UID:" 
    6776msgstr "Votre UID Flattr :" 
    6877 
    69 #: index.php:33 
     78#: inc/class.shareon.php:547 
     79msgid "Add post description to message" 
     80msgstr "Ajouter la description du billet au message" 
     81 
     82#: index.php:32 
    7083msgid "before content" 
    7184msgstr "Avant le contenu" 
    7285 
    73 #: index.php:34 
     86#: index.php:33 
    7487msgid "after content" 
    7588msgstr "Après le contenu" 
    7689 
    77 #: index.php:44 
     90#: index.php:43 
    7891msgid "Configuration successfully saved" 
    7992msgstr "Configuration sauvegardée avec succès" 
    8093 
    81 #: index.php:45 
     94#: index.php:44 
    8295msgid "Buttons successfully updated" 
    8396msgstr "Boutons mis à jour avec succès" 
     
    95108msgstr "En savoir plus à propos de %s." 
    96109 
    97 #: index.php:139 
    98 msgid "Enable this button" 
    99 msgstr "Activer ce bouton" 
     110#: index.php:140 
     111msgid "Enable this button on post content" 
     112msgstr "Activer ce bouton sur le contenu des billets" 
    100113 
    101 #: index.php:143 
    102 msgid "Use small button" 
    103 msgstr "Utiliser le petit bouton" 
     114#: index.php:144 
     115msgid "Use small button on post content" 
     116msgstr "Utiliser le petit bouton sur le contenu des billets" 
    104117 
    105118#: index.php:166 
    106 #: index.php:223 
     119#: index.php:225 
    107120msgid "Settings" 
    108121msgstr "Paramètres" 
     
    132145msgstr "Contenu" 
    133146 
    134 #: index.php:185 
     147#: index.php:186 
    135148msgid "To use this option you must have behavior \"publicEntryBeforeContent\", \"publicEntryAfterContent\" and \"publicHeadContent\" in your theme." 
    136149msgstr "Pour utiliser cette option vous devez avoir les behavior \"publicEntryBeforeContent\", \"publicEntryAfterContent\" et \"publicHeadContent\" dans votre thème." 
    137150 
    138 #: index.php:190 
     151#: index.php:187 
     152msgid "A widget is also available to add buttons to your blog." 
     153msgstr "Un widget est également disponible pour ajouter les boutons sur votre blog." 
     154 
     155#: index.php:192 
    139156msgid "Title of group of buttons could be empty." 
    140157msgstr "Le titre du groupe de boutons peut être vide." 
    141158 
    142 #: index.php:192 
     159#: index.php:194 
    143160msgid "Show buttons on each posts on home page:" 
    144161msgstr "Afficher les boutons sur chaques billets de la page d'accueil :" 
    145162 
    146 #: index.php:196 
     163#: index.php:198 
    147164msgid "Show buttons on each posts on categorie page:" 
    148165msgstr "Afficher les boutons sur chaques billets de la page de catégorie :" 
    149166 
    150 #: index.php:200 
     167#: index.php:202 
    151168msgid "Show buttons on each posts on tag page:" 
    152169msgstr "Afficher les boutons sur chaques pages de tag :" 
    153170 
    154 #: index.php:204 
     171#: index.php:206 
    155172msgid "Show buttons on a post page:" 
    156173msgstr "Afficher les boutons sur la page d'un billet :" 
  • plugins/shareOn/release.txt

    r2261 r2400  
    22 * Added CSS class to buttons box 
    33 * Fixed buttons default size 
     4 
     50.5 20100626 
     6 * Switched to DC 2.2 
     7 * Fixed rights (limit to admin) 
     8 * Fixed default buttons settings 
    49 
    5100.4.2 20100506 
Note: See TracChangeset for help on using the changeset viewer.

Sites map