Changeset 2396
- Timestamp:
- 06/25/10 17:17:08 (13 years ago)
- Location:
- plugins/periodical
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/periodical/_admin.php
r2329 r2396 51 51 } 52 52 53 public static function adminPostsActionsCombo( &$args)53 public static function adminPostsActionsCombo($args) 54 54 { 55 55 global $core; … … 98 98 $posts = $core->blog->getPosts($params); 99 99 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 100 115 if ($posts->isEmpty()) 101 116 { 102 117 echo '<p>'.__('There is no pending post').'</p>'; 118 } 119 elseif (empty($posts_ids)) 120 { 121 echo '<p>'.__('There is no editable post').'</p>'; 103 122 } 104 123 else … … 108 127 '<h3>'.__('Entries').'</h3><ul>'; 109 128 110 while($posts->fetch())129 foreach($posts_ids as $k => $v) 111 130 { 112 131 echo 113 132 '<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). 116 135 '</label></li>'; 117 136 } … … 148 167 } 149 168 150 public static function adminPostsActions( &$core,$posts,$action,$redir)169 public static function adminPostsActions($core,$posts,$action,$redir) 151 170 { 152 171 if (!in_array($action,array('remove_post_periodical','add_post_periodical')) … … 161 180 if (in_array($posts->post_id,$_POST['periodical_entries'])) 162 181 { 163 if ($action == 'remove_post_periodical' )182 if ($action == 'remove_post_periodical' && $posts->isDeletable()) 164 183 { 165 184 $obj->delPost($posts->post_id); 166 185 } 167 elseif ($action == 'add_post_periodical' 186 elseif ($action == 'add_post_periodical' && $posts->isEditable() 168 187 && $posts->post_status == '-2') 169 188 { … … 183 202 global $core; 184 203 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; 186 206 187 207 $obj = new periodical($core); … … 213 233 { 214 234 global $core; 215 # Not contentadmin216 if ( !$core->auth->check('contentadmin',$core->blog->id) ||$post_id === null) return;235 # Not saved 236 if ($post_id === null) return; 217 237 # Period object 218 238 $obj = new periodical($core); -
plugins/periodical/_define.php
r2329 r2396 17 17 /* Description*/ "Published periodically entries", 18 18 /* Author */ "JC Denis", 19 /* Version */ '0.3 ',19 /* Version */ '0.3.1', 20 20 /* Permissions */ 'usage,contentadmin' 21 21 ); 22 /* date */ #201006 0822 /* date */ #20100625 23 23 ?> -
plugins/periodical/_install.php
r2329 r2396 23 23 if (version_compare(DC_VERSION,'2.2-beta','<')) 24 24 { 25 throw new Exception(' translaterrequires Dotclear 2.2');25 throw new Exception('periodical requires Dotclear 2.2'); 26 26 } 27 27 -
plugins/periodical/_prepend.php
r2329 r2396 12 12 13 13 if (!defined('DC_RC_PATH')){return;} 14 if (version_compare(DC_VERSION,'2.2-alpha','<')){return;} 14 15 15 16 global $__autoload, $core; -
plugins/periodical/inc/class.periodical.php
r2329 r2396 209 209 210 210 $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 '; 212 212 213 213 $params['sql'] .= "AND R.meta_type = 'periodical' "; -
plugins/periodical/inc/lib.dc.twitter.php
r2329 r2396 375 375 # Send request 376 376 $client = netHttp::initClient($api,$path); 377 $client->setUserAgent('libDcTwitterSender - '.self::$version);377 $client->setUserAgent('libDcTwitterSender'); 378 378 $client->setPersistReferers(false); 379 379 $client->get($path,$data); -
plugins/periodical/release.txt
r2329 r2396 1 0.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 1 7 0.3 20100608 2 8 * Switched to DC 2.2
Note: See TracChangeset
for help on using the changeset viewer.