Dotclear

Changeset 2396


Ignore:
Timestamp:
06/25/10 17:17:08 (13 years ago)
Author:
JcDenis
Message:

periodical 0.3.1

  • Fixed postgreSQL compatibility
  • Fixed php 5.3 compatibility on post action combo
  • Fixed admin crash on non DC 2.2
  • Fixed users rights
Location:
plugins/periodical
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • plugins/periodical/_admin.php

    r2329 r2396  
    5151     } 
    5252      
    53      public static function adminPostsActionsCombo(&$args) 
     53     public static function adminPostsActionsCombo($args) 
    5454     { 
    5555          global $core; 
     
    9898                    $posts = $core->blog->getPosts($params); 
    9999                     
     100                    $posts_ids = array(); 
     101                    while($posts->fetch()) 
     102                    { 
     103                         # Check if user can edit this post 
     104                         if ($action == 'add_post_periodical' && $posts->isEditable()) 
     105                         { 
     106                              $posts_ids[$posts->post_id] = $posts->post_title; 
     107                         } 
     108                         # Check if user can delete this post 
     109                         if ($action == 'remove_post_periodical' && $posts->isDeletable()) 
     110                         { 
     111                              $posts_ids[$posts->post_id] = $posts->post_title; 
     112                         } 
     113                    } 
     114                     
    100115                    if ($posts->isEmpty()) 
    101116                    { 
    102117                         echo '<p>'.__('There is no pending post').'</p>'; 
     118                    } 
     119                    elseif (empty($posts_ids)) 
     120                    { 
     121                         echo '<p>'.__('There is no editable post').'</p>'; 
    103122                    } 
    104123                    else 
     
    108127                         '<h3>'.__('Entries').'</h3><ul>'; 
    109128                          
    110                          while($posts->fetch()) 
     129                         foreach($posts_ids as $k => $v) 
    111130                         { 
    112131                              echo 
    113132                              '<li><label class="classic">'. 
    114                               form::checkbox(array('periodical_entries[]'),$posts->post_id,1).' '. 
    115                               $posts->post_title. 
     133                              form::checkbox(array('periodical_entries[]'),$k,1).' '. 
     134                              html::escapeHTML($v). 
    116135                              '</label></li>'; 
    117136                         } 
     
    148167     } 
    149168      
    150      public static function adminPostsActions(&$core,$posts,$action,$redir) 
     169     public static function adminPostsActions($core,$posts,$action,$redir) 
    151170     { 
    152171          if (!in_array($action,array('remove_post_periodical','add_post_periodical'))  
     
    161180                    if (in_array($posts->post_id,$_POST['periodical_entries'])) 
    162181                    { 
    163                          if ($action == 'remove_post_periodical') 
     182                         if ($action == 'remove_post_periodical' && $posts->isDeletable()) 
    164183                         { 
    165184                              $obj->delPost($posts->post_id); 
    166185                         } 
    167                          elseif ($action == 'add_post_periodical'  
     186                         elseif ($action == 'add_post_periodical' && $posts->isEditable()  
    168187                          && $posts->post_status == '-2') 
    169188                         { 
     
    183202          global $core; 
    184203           
    185           if (!$core->auth->check('contentadmin',$core->blog->id)) return; 
     204          if ($post !== null && !$post->isEditable()) return; 
     205          if ($post === null && !$core->auth->check('contentadmin',$core->blog->id)) return; 
    186206           
    187207          $obj = new periodical($core); 
     
    213233     { 
    214234          global $core; 
    215           # Not contentadmin 
    216           if (!$core->auth->check('contentadmin',$core->blog->id) || $post_id === null) return; 
     235          # Not saved 
     236          if ($post_id === null) return; 
    217237          # Period object 
    218238          $obj = new periodical($core); 
  • plugins/periodical/_define.php

    r2329 r2396  
    1717     /* Description*/         "Published periodically entries", 
    1818     /* Author */             "JC Denis", 
    19      /* Version */            '0.3', 
     19     /* Version */            '0.3.1', 
    2020     /* Permissions */        'usage,contentadmin' 
    2121); 
    22      /* date */          #20100608 
     22     /* date */          #20100625 
    2323?> 
  • plugins/periodical/_install.php

    r2329 r2396  
    2323     if (version_compare(DC_VERSION,'2.2-beta','<')) 
    2424     { 
    25           throw new Exception('translater requires Dotclear 2.2'); 
     25          throw new Exception('periodical requires Dotclear 2.2'); 
    2626     } 
    2727      
  • plugins/periodical/_prepend.php

    r2329 r2396  
    1212 
    1313if (!defined('DC_RC_PATH')){return;} 
     14if (version_compare(DC_VERSION,'2.2-alpha','<')){return;} 
    1415 
    1516global $__autoload, $core; 
  • plugins/periodical/inc/class.periodical.php

    r2329 r2396  
    209209           
    210210          $params['from'] .= 'LEFT JOIN '.$this->core->prefix.'meta R ON P.post_id = R.post_id '; 
    211           $params['from'] .= 'LEFT JOIN '.$this->table.' T ON R.meta_id = T.periodical_id '; 
     211          $params['from'] .= 'LEFT JOIN '.$this->table.' T ON  CAST(T.periodical_id as char)=R.meta_id '; 
    212212           
    213213          $params['sql'] .= "AND R.meta_type = 'periodical' "; 
  • plugins/periodical/inc/lib.dc.twitter.php

    r2329 r2396  
    375375          # Send request 
    376376          $client = netHttp::initClient($api,$path); 
    377           $client->setUserAgent('libDcTwitterSender - '.self::$version); 
     377          $client->setUserAgent('libDcTwitterSender'); 
    378378          $client->setPersistReferers(false); 
    379379          $client->get($path,$data); 
  • plugins/periodical/release.txt

    r2329 r2396  
     10.3.1 20100625 
     2 * Fixed postgreSQL compatibility 
     3 * Fixed php 5.3 compatibility on post action combo 
     4 * Fixed admin crash on non DC 2.2 
     5 * Fixed users rights 
     6 
    170.3 20100608 
    28 * Switched to DC 2.2 
Note: See TracChangeset for help on using the changeset viewer.

Sites map