Changeset 12887 for trunk/admin
- Timestamp:
- Jan 14, 2012, 11:29:10 PM (12 years ago)
- Location:
- trunk/admin
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_modify.php
r12796 r12887 49 49 'id' => $_GET['cat_id'], 50 50 'name' => @$_POST['name'], 51 'commentable' => isset($_POST['commentable'])?$_POST['commentable']:'false',52 51 'comment' => 53 52 $conf['allow_html_descriptions'] ? 54 53 @$_POST['comment'] : strip_tags(@$_POST['comment']), 55 54 ); 55 56 if ($conf['activate_comments']) 57 { 58 $data['commentable'] = isset($_POST['commentable'])?$_POST['commentable']:'false'; 59 } 56 60 57 61 mass_updates( … … 223 227 'CAT_STATUS' => $category['status'], 224 228 'CAT_VISIBLE' => boolean_to_string($category['visible']), 225 'CAT_COMMENTABLE' => boolean_to_string($category['commentable']),226 229 227 230 'U_JUMPTO' => make_index_url( … … 239 242 ) 240 243 ); 244 245 if ($conf['activate_comments']) 246 { 247 $template->assign('CAT_COMMENTABLE', boolean_to_string($category['commentable'])); 248 } 241 249 242 250 -
trunk/admin/cat_options.php
r8728 r12887 143 143 $tabsheet->add('status', l10n('Public / Private'), $opt_link.'status'); 144 144 $tabsheet->add('visible', l10n('Lock'), $opt_link.'visible'); 145 $tabsheet->add('comments', l10n('Comments'), $opt_link.'comments'); 145 if ($conf['activate_comments']) 146 { 147 $tabsheet->add('comments', l10n('Comments'), $opt_link.'comments'); 148 } 146 149 if ($conf['allow_random_representative']) 147 150 { -
trunk/admin/configuration.php
r12879 r12887 67 67 68 68 $comments_checkboxes = array( 69 'activate_comments', 69 70 'comments_forall', 70 71 'comments_validation', -
trunk/admin/intro.php
r11839 r12887 185 185 ;'; 186 186 list($nb_groups) = pwg_db_fetch_row(pwg_query($query)); 187 188 $query = '189 SELECT COUNT(*)190 FROM '.COMMENTS_TABLE.'191 ;';192 list($nb_comments) = pwg_db_fetch_row(pwg_query($query));193 187 194 188 $query = ' … … 219 213 'DB_USERS' => l10n_dec('%d user', '%d users', $nb_users), 220 214 'DB_GROUPS' => l10n_dec('%d group', '%d groups', $nb_groups), 221 'DB_COMMENTS' => l10n_dec('%d comment', '%d comments', $nb_comments),222 215 'DB_RATES' => sprintf('%d rates', $nb_rates), 223 216 'U_CHECK_UPGRADE' => PHPWG_ROOT_PATH.'admin.php?action=check_upgrade', … … 227 220 ) 228 221 ); 222 223 if ($conf['activate_comments']) 224 { 225 $query = ' 226 SELECT COUNT(*) 227 FROM '.COMMENTS_TABLE.' 228 ;'; 229 list($nb_comments) = pwg_db_fetch_row(pwg_query($query)); 230 $template->assign('DB_COMMENTS', l10n_dec('%d comment', '%d comments', $nb_comments)); 231 232 // unvalidated comments 233 $query = ' 234 SELECT COUNT(*) 235 FROM '.COMMENTS_TABLE.' 236 WHERE validated=\'false\' 237 ;'; 238 list($nb_comments) = pwg_db_fetch_row(pwg_query($query)); 239 240 if ($nb_comments > 0) 241 { 242 $template->assign( 243 'unvalidated', 244 array( 245 'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments', 246 'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments) 247 ) 248 ); 249 } 250 } 229 251 230 252 if ($nb_elements > 0) … … 248 270 } 249 271 250 // unvalidated comments251 $query = '252 SELECT COUNT(*)253 FROM '.COMMENTS_TABLE.'254 WHERE validated=\'false\'255 ;';256 list($nb_comments) = pwg_db_fetch_row(pwg_query($query));257 258 if ($nb_comments > 0)259 {260 $template->assign(261 'unvalidated',262 array(263 'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments',264 'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments)265 )266 );267 }268 269 272 // graphics library 270 273 switch (pwg_image::get_library()) -
trunk/admin/themes/default/template/admin.tpl
r12829 r12887 75 75 {/if} 76 76 <li><a href="{$U_MAINTENANCE}">{'Maintenance'|@translate}</a></li> 77 {if isset($U_PENDING_COMMENTS)} 77 78 <li><a href="{$U_PENDING_COMMENTS}">{'Pending Comments'|@translate}</a></li> 79 {/if} 78 80 <li><a href="{$U_UPDATES}">{'Updates'|@translate}</a></li> 79 81 </ul> -
trunk/admin/themes/default/template/cat_modify.tpl
r12681 r12887 83 83 </td> 84 84 </tr> 85 {if isset($CAT_COMMENTABLE)} 85 86 <tr> 86 87 <td><strong>{'Comments'|@translate}</strong> … … 89 90 </td> 90 91 </tr> 92 {/if} 91 93 </table> 92 94 </fieldset> -
trunk/admin/themes/default/template/configuration.tpl
r12879 r12887 184 184 <li> 185 185 <label> 186 <span class="property">{'Activate comments'|@translate}</span> 187 <input type="checkbox" name="activate_comments" id="activate_comments"{if ($comments.activate_comments)}checked="checked"{/if}> 188 </label> 189 </li> 190 </ul> 191 192 <ul id="comments_param_warp"{if not ($comments.activate_comments)} style="display:none;"{/if}> 193 <li> 194 <label> 186 195 <span class="property">{'Comments for all'|@translate}</span> 187 196 <input type="checkbox" name="comments_forall" {if ($comments.comments_forall)}checked="checked"{/if}> … … 244 253 </ul> 245 254 </fieldset> 255 {footer_script}{literal} 256 $(document).ready(function(){ 257 $("#activate_comments").change(function(){ 258 if ($(this).attr('checked')) { 259 $("#comments_param_warp").css('display', ''); 260 } else { 261 $("#comments_param_warp").css('display', 'none'); 262 } 263 }); 264 }); 265 {/literal}{/footer_script} 246 266 {/if} 247 267 -
trunk/admin/themes/default/template/intro.tpl
r12427 r12887 73 73 <li>{$DB_USERS}</li> 74 74 <li>{$DB_GROUPS}</li> 75 {if isset($DB_COMMENTS)} 75 76 <li> 76 77 {$DB_COMMENTS} … … 79 80 {/if} 80 81 </li> 82 {/if} 81 83 <li>{$DB_RATES}</li> 82 84 </ul> -
trunk/admin/themes/default/template/profile_content.tpl
r12882 r12887 48 48 <input type="text" size="4" maxlength="3" name="nb_image_page" id="nb_image_page" value="{$NB_IMAGE_PAGE}"> 49 49 </li> 50 {if not $SPECIAL_USER}50 {if not $SPECIAL_USER} 51 51 <li> 52 52 <span class="property"> … … 61 61 {html_options id=language name=language options=$language_options selected=$language_selection} 62 62 </li> 63 {/if}63 {/if} 64 64 <li> 65 65 <span class="property"> … … 72 72 {html_radios name='expand' options=$radio_options selected=$EXPAND} 73 73 </li> 74 {if $ACTIVATE_COMMENTS} 74 75 <li> 75 76 <span class="property">{'Show number of comments'|@translate}</span> 76 77 {html_radios name='show_nb_comments' options=$radio_options selected=$NB_COMMENTS} 77 78 </li> 79 {/if} 78 80 <li> 79 81 <span class="property">{'Show number of hits'|@translate}</span> -
trunk/admin/themes/default/template/user_list.tpl
r12886 r12887 236 236 </tr> 237 237 238 {if $ACTIVATE_COMMENTS} 238 239 <tr> 239 240 <td>{'Show number of comments'|@translate}</td> … … 245 246 </td> 246 247 </tr> 248 {/if} 247 249 248 250 <tr> -
trunk/admin/user_list.php
r12886 r12887 416 416 $dbfields = array('primary' => array('user_id'), 'update' => array()); 417 417 418 $formfields = 419 array('nb_image_page', 'theme', 'language', 420 'recent_period', 'expand', 'show_nb_comments', 421 'show_nb_hits', 'status', 'enabled_high', 422 'level'); 423 424 $true_false_fields = array('expand', 'show_nb_comments', 425 'show_nb_hits', 'enabled_high'); 418 $formfields = array( 419 'nb_image_page', 'theme', 'language', 420 'recent_period', 'expand', 'show_nb_hits', 421 'status', 'enabled_high', 'level' 422 ); 423 424 $true_false_fields = array('expand', 'show_nb_hits', 'enabled_high'); 425 426 if ($conf['activate_comments']) 427 { 428 array_push($formfields, 'show_nb_comments'); 429 array_push($true_false_fields, 'show_nb_comments'); 430 } 426 431 427 432 foreach ($formfields as $formfield) … … 556 561 'F_ADD_ACTION' => $base_url, 557 562 'F_USERNAME' => @htmlentities($_GET['username'], ENT_COMPAT, 'UTF-8'), 558 'F_FILTER_ACTION' => get_root_url().'admin.php' 563 'F_FILTER_ACTION' => get_root_url().'admin.php', 564 565 'ACTIVATE_COMMENTS' => $conf['activate_comments'], 559 566 )); 560 567
Note: See TracChangeset
for help on using the changeset viewer.