Dotclear

Changeset 2427


Ignore:
Timestamp:
07/03/10 05:38:33 (13 years ago)
Author:
JcDenis
Message:

rateIt 2.0-alpha4

  • Fixed attributes 'type' and 'style' to rateIt in templates
  • Added condition for 'style' to rateItIf in templates
Location:
plugins/rateIt
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • plugins/rateIt/_define.php

    r2394 r2427  
    1717     /* Description*/         "Rating system for your blogs", 
    1818     /* Author */             "JC Denis", 
    19      /* Version */            '2.0-alpha2', 
     19     /* Version */            '2.0-alpha4', 
    2020     /* Permissions */        'admin' 
    2121); 
    22      /* date */          #20100625 
     22     /* date */          #20100703 
    2323?> 
  • plugins/rateIt/_public.php

    r2394 r2427  
    301301          global $core; 
    302302           
    303           $style = isset($attr['style']) ? $attr['style'] : 'classic'; 
    304           $type = isset($attr['type']) ? $attr['type'] : ''; 
     303          $style = isset($attr['style']) ? html::escapeHTML($attr['style']) : ''; 
     304          $type = isset($attr['type']) ? html::escapeHTML($attr['type']) : ''; 
    305305          $res = ''; 
    306306           
     
    312312          return 
    313313          "<?php \n". 
    314           "if ('".$style."' == \$core->blog->settings->rateit->rateit_rating_style) { \n". 
     314          "\$rateit_style = \"".$style."\"; \n". 
     315          "if (empty(\$rateit_style)) { ". 
     316          " \$rateit_style = \$core->blog->settings->rateit->rateit_rating_style; ". 
     317          "} \n". 
     318          "if (empty(\$rateit_params)) { ". 
     319          "\$rateit_params = array('type'=>'','id'=>''); \n". 
    315320          $res. 
     321          "} ". 
    316322          "if (!empty(\$rateit_params['type'])) { \n". 
    317323          " \$rateit_voted = \$core->rateIt->voted(\$rateit_params['type'],\$rateit_params['id']); \n". 
     
    324330          "} \n". 
    325331          "unset(\$rateit_params); \n". 
    326           "} \n". 
     332          "unset(\$rateit_style); \n". 
    327333          "?> \n"; 
    328334     } 
     
    352358               { 
    353359                    $if[] = '\''.$attr['type'].'\' == $_ctx->rateIt->type'; 
     360               } 
     361          } 
     362          if (!empty($attr['style'])) 
     363          { 
     364               if (substr($attr['style'],0,1) == '!') 
     365               { 
     366                    $if[] = '\''.substr($attr['style'],1).'\' != $rateit_style'; 
     367               } 
     368               else 
     369               { 
     370                    $if[] = '\''.$attr['style'].'\' == $rateit_style'; 
    354371               } 
    355372          } 
     
    388405          global $core; 
    389406          $f = $core->tpl->getFilters($attr); 
    390           return '<?php echo rateItContext::linker($rateit_voted,$_ctx->rateIt->type,$_ctx->rateIt->id,$_ctx->rateIt->note,$_ctx->rateIt->quotient); ?>'; 
     407          return '<?php echo rateItContext::linker($rateit_voted,$_ctx->rateIt->type,$_ctx->rateIt->id,$_ctx->rateIt->note,$_ctx->rateIt->quotient,$rateit_style); ?>'; 
    391408     } 
    392409      
  • plugins/rateIt/default-templates/tpl/rateit.html

    r2358 r2427  
    11<tpl:rateIt> 
     2 
     3 <tpl:rateItIf style="classic"> 
    24  <div class="rateit rateit-classic"> 
    35    <h3>{{tpl:rateItTitle}}</h3> 
     
    1113    </ul> 
    1214  </div> 
    13 </tpl:rateIt> 
     15  </tpl:rateItIf> 
    1416 
    15 <tpl:rateIt style="twin"> 
     17 <tpl:rateItIf style="twin"> 
    1618  <div class="rateit rateit-twin"> 
    1719     <p>{{tpl:rateItMinCount}}</p> 
     
    1921     <p>{{tpl:rateItMaxCount}}</p> 
    2022  </div> 
    21 </tpl:rateIt> 
     23 </tpl:rateItIf> 
    2224 
    23 <tpl:rateIt style="simple"> 
     25 <tpl:rateItIf style="simple"> 
    2426  <div class="rateit retait-simple"> 
    2527     {{tpl:rateItLinker}} 
    2628     <p>{{tpl:rateItMaxCount}}</p> 
    2729  </div> 
     30 </tpl:rateItIf> 
     31 
    2832</tpl:rateIt> 
  • plugins/rateIt/inc/lib.rateit.context.php

    r2424 r2427  
    1616{ 
    1717     # Form 
    18      public static function linker($enable,$type,$id,$note,$quotient) 
     18     public static function linker($enable,$type,$id,$note,$quotient,$style='') 
    1919     { 
    2020          global $core; 
    2121           
     22          if (!in_array($style,array('classic','simple','twin'))) 
     23          { 
     24               $style = $core->blog->settings->rateit->rateit_rating_style; 
     25          } 
    2226          $like = $core->blog->settings->rateit->rateit_msglike; 
    2327          if (empty($like)) { $like = __('I like'); } 
     
    3640           
    3741           
    38           if ($core->blog->settings->rateit->rateit_rating_style == 'simple') 
     42          if ($style == 'simple') 
    3943          { 
    4044               $chk = $enable ? ' checked="checked"' : ''; 
    4145               $res .= '<input title="'.$like.'" name="'.$uid.'" class="rateit-'.$type.'-'.$id.'" type="radio" value="'.$quotient.'" '.$chk.$dis.' />'; 
    4246          } 
    43           elseif ($core->blog->settings->rateit->rateit_rating_style == 'twin') 
     47          elseif ($style == 'twin') 
    4448          { 
    4549               $chk = $enable ? ' checked="checked"' : ''; 
  • plugins/rateIt/inc/modules/lib.rateit.module.post.public.php

    r2394 r2427  
    2929     { 
    3030          if ($type != '' && $type != 'post') return; 
    31            
     31//utiliser $core->getPostType       
    3232          return  
    3333          "if (\$_ctx->exists('posts')". 
  • plugins/rateIt/release.txt

    r2394 r2427  
    44 - Not added public API 
    55 - Not completed modules behaviors (delete/edit category, tag...) 
     6 
     72.0-alpha4 20100703 
     8 * Fixed attributes 'type' and 'style' to rateIt in templates 
     9 * Added condition for 'style' to rateItIf in templates 
     10 
     112.0-alpha3 20100701 
     12 * Fixed filename 
    613 
    7142.0-alpha2 20100625 
Note: See TracChangeset for help on using the changeset viewer.

Sites map