Changeset 1155:49ba58cbf593 for admin
- Timestamp:
- 04/09/13 09:15:41 (13 years ago)
- Branch:
- twig
- Parents:
- 1154:e85c1417b8a4 (diff), 1143:fbf575ae9bda (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- admin
- Files:
-
- 2 deleted
- 3 edited
-
js/jquery/jquery.constantfooter.js (deleted)
-
post.php (modified) (7 diffs)
-
style/dc_logo_small.png (deleted)
-
style/default.css (modified) (20 diffs)
-
style/default.css (modified) (26 diffs)
Legend:
- Unmodified
- Added
- Removed
-
admin/post.php
r1139 r1155 15 15 dcPage::check('usage,contentadmin'); 16 16 17 $post_id = ''; 18 $cat_id = ''; 19 $post_dt = ''; 20 $post_format = $core->auth->getOption('post_format'); 21 $post_password = ''; 22 $post_url = ''; 23 $post_lang = $core->auth->getInfo('user_lang'); 24 $post_title = ''; 25 $post_excerpt = ''; 26 $post_excerpt_xhtml = ''; 27 $post_content = ''; 28 $post_content_xhtml = ''; 29 $post_notes = ''; 30 $post_status = $core->auth->getInfo('user_post_status'); 31 $post_selected = false; 32 $post_open_comment = $core->blog->settings->system->allow_comments; 33 $post_open_tb = $core->blog->settings->system->allow_trackbacks; 17 function savePost($form) { 18 global $_ctx; 19 $_ctx->setAlert('save'); 20 21 } 22 23 function deletePost($form) { 24 print_r($form); exit; 25 } 34 26 35 27 $page_title = __('New entry'); … … 47 39 # If user can't publish 48 40 if (!$can_publish) { 49 $ post_status = -2;41 $form->post_status = -2; 50 42 } 51 43 … … 55 47 $categories = $core->blog->getCategories(array('post_type'=>'post')); 56 48 while ($categories->fetch()) { 57 $categories_combo[ ] = new formSelectOption(58 str_repeat(' ',$categories->level-1). ($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title),59 $categories->cat_id60 );49 $categories_combo[$categories->cat_id] = 50 str_repeat(' ',$categories->level-1). 51 ($categories->level-1 == 0 ? '' : '• '). 52 html::escapeHTML($categories->cat_title); 61 53 } 62 54 } catch (Exception $e) { } … … 64 56 # Status combo 65 57 foreach ($core->blog->getAllPostStatus() as $k => $v) { 66 $status_combo[$ v] = (string) $k;58 $status_combo[$k] = $v; 67 59 } 68 $img_status_pattern = '<img class="img_select_option" alt="%1$s" title="%1$s" src="images/%2$s" />';69 60 70 61 # Formaters combo … … 88 79 unset($rs); 89 80 90 # Validation flag 91 $bad_dt = false; 92 81 $form = new dcForm($core,'post','post.php'); 82 $form 83 ->addField( 84 new dcFieldText('post_title','', array( 85 'size' => 20, 86 'required' => true, 87 'label' => __('Title')))) 88 ->addField( 89 new dcFieldTextArea('post_excerpt','', array( 90 'cols' => 50, 91 'rows' => 5, 92 'label' => __("Excerpt:")))) 93 ->addField( 94 new dcFieldTextArea('post_content','', array( 95 'required' => true, 96 'label' => __("Content:")))) 97 ->addField( 98 new dcFieldTextArea('post_notes','', array( 99 'label' => __("Notes")))) 100 ->addField( 101 new dcFieldSubmit('save',__('Save'),array( 102 'action' => 'savePost'))) 103 ->addField( 104 new dcFieldSubmit('delete',__('Delete'),array( 105 'action' => 'deletePost'))) 106 ->addField( 107 new dcFieldCombo('post_status',$core->auth->getInfo('user_post_status'),$status_combo,array( 108 'disabled' => !$can_publish, 109 'label' => __('Entry status:')))) 110 ->addField( 111 new dcFieldCombo('cat_id','',$categories_combo,array( 112 "label" => __('Category:')))) 113 ->addField( 114 new dcFieldText('post_dt','',array( 115 "label" => __('Published on:')))) 116 ->addField( 117 new dcFieldCombo('post_format',$core->auth->getOption('post_format'),$formaters_combo,array( 118 "label" => __('Text formating:')))) 119 ->addField( 120 new dcFieldCheckbox ('post_open_comment',$core->blog->settings->system->allow_comments,array( 121 "label" => __('Accept comments')))) 122 ->addField( 123 new dcFieldCheckbox ('post_open_tb',$core->blog->settings->system->allow_trackbacks,array( 124 "label" => __('Accept trackbacks')))) 125 ->addField( 126 new dcFieldCheckbox ('post_selected',false,array( 127 "label" => __('Selected entry')))) 128 ->addField( 129 new dcFieldCombo ('post_lang',$core->auth->getInfo('user_lang'),$lang_combo, array( 130 "label" => __('Entry lang:')))) 131 ->addField( 132 new dcFieldHidden ('id','')) 133 ; 93 134 # Get entry informations 94 135 if (!empty($_REQUEST['id'])) … … 105 146 else 106 147 { 107 $post_id = $post->post_id; 108 $cat_id = $post->cat_id; 109 $post_dt = date('Y-m-d H:i',strtotime($post->post_dt)); 110 $post_format = $post->post_format; 111 $post_password = $post->post_password; 112 $post_url = $post->post_url; 113 $post_lang = $post->post_lang; 114 $post_title = $post->post_title; 115 $post_excerpt = $post->post_excerpt; 116 $post_excerpt_xhtml = $post->post_excerpt_xhtml; 117 $post_content = $post->post_content; 118 $post_content_xhtml = $post->post_content_xhtml; 119 $post_notes = $post->post_notes; 120 $post_status = $post->post_status; 121 $post_selected = (boolean) $post->post_selected; 122 $post_open_comment = (boolean) $post->post_open_comment; 123 $post_open_tb = (boolean) $post->post_open_tb; 148 $form->id = $post->post_id; 149 $form->cat_id = $post->cat_id; 150 $form->post_dt = date('Y-m-d H:i',strtotime($post->post_dt)); 151 $form->post_format = $post->post_format; 152 $form->post_password = $post->post_password; 153 $form->post_url = $post->post_url; 154 $form->post_lang = $post->post_lang; 155 $form->post_title = $post->post_title; 156 $form->post_excerpt = $post->post_excerpt; 157 $form->post_excerpt_xhtml = $post->post_excerpt_xhtml; 158 $form->post_content = $post->post_content; 159 $form->post_content_xhtml = $post->post_content_xhtml; 160 $form->post_notes = $post->post_notes; 161 $form->post_status = $post->post_status; 162 $form->post_selected = (boolean) $post->post_selected; 163 $form->post_open_comment = (boolean) $post->post_open_comment; 164 $form->post_open_tb = (boolean) $post->post_open_tb; 165 $form->can_edit_post = $post->isEditable(); 166 $form->can_delete= $post->isDeletable(); 124 167 125 $page_title = __('Edit entry');126 127 $can_edit_post = $post->isEditable();128 $can_delete= $post->isDeletable();129 130 $next_rs = $core->blog->getNextPost($post,1);131 $prev_rs = $core->blog->getNextPost($post,-1);132 133 if ($next_rs !== null) {134 $next_link = sprintf($post_link,$next_rs->post_id,135 html::escapeHTML($next_rs->post_title),__('next entry').' »');136 $next_headlink = sprintf($post_headlink,'next',137 html::escapeHTML($next_rs->post_title),$next_rs->post_id);138 }139 140 if ($prev_rs !== null) {141 $prev_link = sprintf($post_link,$prev_rs->post_id,142 html::escapeHTML($prev_rs->post_title),'« '.__('previous entry'));143 $prev_headlink = sprintf($post_headlink,'previous',144 html::escapeHTML($prev_rs->post_title),$prev_rs->post_id);145 }146 147 try {148 $core->media = new dcMedia($core);149 } catch (Exception $e) {}150 168 } 151 169 } 152 170 153 # Format excerpt and content 154 if (!empty($_POST) && $can_edit_post) 155 { 156 $post_format = $_POST['post_format']; 157 $post_excerpt = $_POST['post_excerpt']; 158 $post_content = $_POST['post_content']; 159 160 $post_title = $_POST['post_title']; 161 162 $cat_id = (integer) $_POST['cat_id']; 163 164 if (isset($_POST['post_status'])) { 165 $post_status = (integer) $_POST['post_status']; 166 } 167 168 if (empty($_POST['post_dt'])) { 169 $post_dt = ''; 170 } else { 171 try 172 { 173 $post_dt = strtotime($_POST['post_dt']); 174 if ($post_dt == false || $post_dt == -1) { 175 $bad_dt = true; 176 throw new Exception(__('Invalid publication date')); 177 } 178 $post_dt = date('Y-m-d H:i',$post_dt); 179 } 180 catch (Exception $e) 181 { 182 $core->error->add($e->getMessage()); 183 } 184 } 185 186 $post_open_comment = !empty($_POST['post_open_comment']); 187 $post_open_tb = !empty($_POST['post_open_tb']); 188 $post_selected = !empty($_POST['post_selected']); 189 $post_lang = $_POST['post_lang']; 190 $post_password = !empty($_POST['post_password']) ? $_POST['post_password'] : null; 191 192 $post_notes = $_POST['post_notes']; 193 194 if (isset($_POST['post_url'])) { 195 $post_url = $_POST['post_url']; 196 } 197 198 $core->blog->setPostContent( 199 $post_id,$post_format,$post_lang, 200 $post_excerpt,$post_excerpt_xhtml,$post_content,$post_content_xhtml 201 ); 202 } 203 204 # Delete post 205 if (!empty($_POST['delete']) && $can_delete) 206 { 207 try { 208 # --BEHAVIOR-- adminBeforePostDelete 209 $core->callBehavior('adminBeforePostDelete',$post_id); 210 $core->blog->delPost($post_id); 211 http::redirect('posts.php'); 212 } catch (Exception $e) { 213 $core->error->add($e->getMessage()); 214 } 215 } 216 217 # Create or update post 218 if (!empty($_POST) && !empty($_POST['save']) && $can_edit_post && !$bad_dt) 219 { 220 $cur = $core->con->openCursor($core->prefix.'post'); 221 222 $cur->post_title = $post_title; 223 $cur->cat_id = ($cat_id ? $cat_id : null); 224 $cur->post_dt = $post_dt ? date('Y-m-d H:i:00',strtotime($post_dt)) : ''; 225 $cur->post_format = $post_format; 226 $cur->post_password = $post_password; 227 $cur->post_lang = $post_lang; 228 $cur->post_title = $post_title; 229 $cur->post_excerpt = $post_excerpt; 230 $cur->post_excerpt_xhtml = $post_excerpt_xhtml; 231 $cur->post_content = $post_content; 232 $cur->post_content_xhtml = $post_content_xhtml; 233 $cur->post_notes = $post_notes; 234 $cur->post_status = $post_status; 235 $cur->post_selected = (integer) $post_selected; 236 $cur->post_open_comment = (integer) $post_open_comment; 237 $cur->post_open_tb = (integer) $post_open_tb; 238 239 if (isset($_POST['post_url'])) { 240 $cur->post_url = $post_url; 241 } 242 243 # Update post 244 if ($post_id) 245 { 246 try 247 { 248 # --BEHAVIOR-- adminBeforePostUpdate 249 $core->callBehavior('adminBeforePostUpdate',$cur,$post_id); 250 251 $core->blog->updPost($post_id,$cur); 252 253 # --BEHAVIOR-- adminAfterPostUpdate 254 $core->callBehavior('adminAfterPostUpdate',$cur,$post_id); 255 256 http::redirect('post.php?id='.$post_id.'&upd=1'); 257 } 258 catch (Exception $e) 259 { 260 $core->error->add($e->getMessage()); 261 } 262 } 263 else 264 { 265 $cur->user_id = $core->auth->userID(); 266 267 try 268 { 269 # --BEHAVIOR-- adminBeforePostCreate 270 $core->callBehavior('adminBeforePostCreate',$cur); 271 272 $return_id = $core->blog->addPost($cur); 273 274 # --BEHAVIOR-- adminAfterPostCreate 275 $core->callBehavior('adminAfterPostCreate',$cur,$return_id); 276 277 http::redirect('post.php?id='.$return_id.'&crea=1'); 278 } 279 catch (Exception $e) 280 { 281 $core->error->add($e->getMessage()); 282 } 283 } 284 } 171 $form->setup(); 285 172 286 173 /* DISPLAY … … 294 181 } 295 182 296 dcPage::open($page_title.' - '.__('Entries'), 297 dcPage::jsDatePicker(). 298 dcPage::jsToolBar(). 299 dcPage::jsModal(). 300 dcPage::jsMetaEditor(). 301 dcPage::jsLoad('js/_post.js'). 302 dcPage::jsConfirmClose('entry-form','comment-form'). 303 # --BEHAVIOR-- adminPostHeaders 304 $core->callBehavior('adminPostHeaders'). 305 dcPage::jsPageTabs($default_tab). 306 $next_headlink."\n".$prev_headlink 307 ); 183 $_ctx 184 ->fillPageTitle(__('Entries'),'posts.php') 185 ->fillPageTitle($page_title) 186 ->default_tab = $default_tab; 308 187 309 if (!empty($_GET['upd'])) { 310 dcPage::message(__('Entry has been successfully updated.')); 311 } 312 elseif (!empty($_GET['crea'])) { 313 dcPage::message(__('Entry has been successfully created.')); 314 } 315 elseif (!empty($_GET['attached'])) { 316 dcPage::message(__('File has been successfully attached.')); 317 } 318 elseif (!empty($_GET['rmattach'])) { 319 dcPage::message(__('Attachment has been successfully removed.')); 320 } 321 322 if (!empty($_GET['creaco'])) { 323 dcPage::message(__('Comment has been successfully created.')); 324 } 325 326 # XHTML conversion 327 if (!empty($_GET['xconv'])) 328 { 329 $post_excerpt = $post_excerpt_xhtml; 330 $post_content = $post_content_xhtml; 331 $post_format = 'xhtml'; 332 333 dcPage::message(__('Don\'t forget to validate your XHTML conversion by saving your post.')); 334 } 335 336 echo '<h2>'.html::escapeHTML($core->blog->name).' › '.'<a href="posts.php">'.__('Entries').'</a> › <span class="page-title">'.$page_title; 337 if ($post_id) { 338 switch ($post_status) { 339 case 1: 340 $img_status = sprintf($img_status_pattern,__('published'),'check-on.png'); 341 break; 342 case 0: 343 $img_status = sprintf($img_status_pattern,__('unpublished'),'check-off.png'); 344 break; 345 case -1: 346 $img_status = sprintf($img_status_pattern,__('scheduled'),'scheduled.png'); 347 break; 348 case -2: 349 $img_status = sprintf($img_status_pattern,__('pending'),'check-wrn.png'); 350 break; 351 default: 352 $img_status = ''; 353 } 354 echo ' “'.$post_title.'”'.' '.$img_status; 355 } 356 echo '</span></h2>'; 357 358 if ($post_id && $post->post_status == 1) { 359 echo '<p><a href="'.$post->getURL().'" onclick="window.open(this.href);return false;" title="'.$post_title.' ('.__('new window').')'.'">'.__('Go to this entry on the site').' <img src="images/outgoing-blue.png" alt="" /></a></p>'; 360 } 361 if ($post_id) 362 { 363 echo '<p>'; 364 if ($prev_link) { echo $prev_link; } 365 if ($next_link && $prev_link) { echo ' - '; } 366 if ($next_link) { echo $next_link; } 367 368 # --BEHAVIOR-- adminPostNavLinks 369 $core->callBehavior('adminPostNavLinks',isset($post) ? $post : null); 370 371 echo '</p>'; 372 } 373 374 # Exit if we cannot view page 375 if (!$can_view_page) { 376 dcPage::helpBlock('core_post'); 377 dcPage::close(); 378 exit; 379 } 380 381 /* Post form if we can edit post 382 -------------------------------------------------------- */ 383 if ($can_edit_post) 384 { 385 echo '<div class="multi-part" title="'.__('Edit entry').'" id="edit-entry">'; 386 echo '<form action="post.php" method="post" id="entry-form">'; 387 echo '<div id="entry-wrapper">'; 388 echo '<div id="entry-content"><div class="constrained">'; 389 390 echo 391 '<p class="col"><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:'). 392 form::field('post_title',20,255,html::escapeHTML($post_title),'maximal'). 393 '</label></p>'. 394 395 '<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').'</label> '. 396 form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)). 397 '</p>'. 398 399 '<p class="area"><label class="required" '. 400 'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '. 401 form::textarea('post_content',50,$core->auth->getOption('edit_size'),html::escapeHTML($post_content)). 402 '</p>'. 403 404 '<p class="area" id="notes-area"><label for="post_notes">'.__('Notes:').'</label>'. 405 form::textarea('post_notes',50,5,html::escapeHTML($post_notes)). 406 '</p>'; 407 408 # --BEHAVIOR-- adminPostForm 409 $core->callBehavior('adminPostForm',isset($post) ? $post : null); 410 411 echo 412 '<p>'. 413 ($post_id ? form::hidden('id',$post_id) : ''). 414 '<input type="submit" value="'.__('Save').' (s)" '. 415 'accesskey="s" name="save" /> '; 416 if ($post_id) { 417 $preview_url = 418 $core->blog->url.$core->url->getURLFor('preview',$core->auth->userID().'/'. 419 http::browserUID(DC_MASTER_KEY.$core->auth->userID().$core->auth->getInfo('user_pwd')). 420 '/'.$post->post_url); 421 echo '<a id="post-preview" href="'.$preview_url.'" class="button" accesskey="p">'.__('Preview').' (p)'.'</a> '; 422 } 423 echo 424 ($can_delete ? '<input type="submit" class="delete" value="'.__('Delete').'" name="delete" />' : ''). 425 $core->formNonce(). 426 '</p>'; 427 428 echo '</div></div>'; // End #entry-content 429 echo '</div>'; // End #entry-wrapper 430 431 echo '<div id="entry-sidebar">'; 432 433 echo 434 '<p><label for="cat_id">'.__('Category:'). 435 form::combo('cat_id',$categories_combo,$cat_id,'maximal'). 436 '</label></p>'. 437 438 '<p><label for="post_status">'.__('Entry status:'). 439 form::combo('post_status',$status_combo,$post_status,'','',!$can_publish). 440 '</label></p>'. 441 442 '<p><label for="post_dt">'.__('Published on:'). 443 form::field('post_dt',16,16,$post_dt,($bad_dt ? 'invalid' : '')). 444 '</label></p>'. 445 446 '<p><label for="post_format">'.__('Text formating:'). 447 form::combo('post_format',$formaters_combo,$post_format). 448 '</label>'. 449 '</p>'. 450 '<p>'.($post_id && $post_format != 'xhtml' ? '<a id="convert-xhtml" class="button" href="post.php?id='.$post_id.'&xconv=1">'.__('Convert to XHTML').'</a>' : '').'</p>'. 451 452 '<p><label for="post_open_comment" class="classic">'.form::checkbox('post_open_comment',1,$post_open_comment).' '. 453 __('Accept comments').'</label></p>'. 454 ($core->blog->settings->system->allow_comments ? 455 (isContributionAllowed($post_id,strtotime($post_dt),true) ? 456 '' : 457 '<p class="form-note warn">'.__('Warning: Comments are not more accepted for this entry.').'</p>') : 458 '<p class="form-note warn">'.__('Warning: Comments are not accepted on this blog.').'</p>'). 459 460 '<p><label for="post_open_tb" class="classic">'.form::checkbox('post_open_tb',1,$post_open_tb).' '. 461 __('Accept trackbacks').'</label></p>'. 462 ($core->blog->settings->system->allow_trackbacks ? 463 (isContributionAllowed($post_id,strtotime($post_dt),false) ? 464 '' : 465 '<p class="form-note warn">'.__('Warning: Trackbacks are not more accepted for this entry.').'</p>') : 466 '<p class="form-note warn">'.__('Warning: Trackbacks are not accepted on this blog.').'</p>'). 467 468 '<p><label for="post_selected" class="classic">'.form::checkbox('post_selected',1,$post_selected).' '. 469 __('Selected entry').'</label></p>'. 470 471 '<p><label for="post_lang">'.__('Entry lang:'). 472 form::combo('post_lang',$lang_combo,$post_lang). 473 '</label></p>'. 474 475 '<p><label for="post_password">'.__('Entry password:'). 476 form::field('post_password',10,32,html::escapeHTML($post_password),'maximal'). 477 '</label></p>'. 478 479 '<div class="lockable">'. 480 '<p><label for="post_url">'.__('Basename:'). 481 form::field('post_url',10,255,html::escapeHTML($post_url),'maximal'). 482 '</label></p>'. 483 '<p class="form-note warn">'. 484 __('Warning: If you set the URL manually, it may conflict with another entry.'). 485 '</p>'. 486 '</div>'; 487 488 # --BEHAVIOR-- adminPostFormSidebar 489 $core->callBehavior('adminPostFormSidebar',isset($post) ? $post : null); 490 491 echo '</div>'; // End #entry-sidebar 492 493 echo '</form>'; 494 495 # --BEHAVIOR-- adminPostForm 496 $core->callBehavior('adminPostAfterForm',isset($post) ? $post : null); 497 498 echo '</div>'; 499 500 if ($post_id && $post->post_status == 1) { 501 echo '<p><a href="trackbacks.php?id='.$post_id.'" class="multi-part">'. 502 __('Ping blogs').'</a></p>'; 503 } 504 505 } 506 507 508 /* Comments and trackbacks 509 -------------------------------------------------------- */ 510 if ($post_id) 511 { 512 $params = array('post_id' => $post_id, 'order' => 'comment_dt ASC'); 513 514 $comments = $core->blog->getComments(array_merge($params,array('comment_trackback'=>0))); 515 $trackbacks = $core->blog->getComments(array_merge($params,array('comment_trackback'=>1))); 516 517 # Actions combo box 518 $combo_action = array(); 519 if ($can_edit_post && $core->auth->check('publish,contentadmin',$core->blog->id)) 520 { 521 $combo_action[__('publish')] = 'publish'; 522 $combo_action[__('unpublish')] = 'unpublish'; 523 $combo_action[__('mark as pending')] = 'pending'; 524 $combo_action[__('mark as junk')] = 'junk'; 525 } 526 527 if ($can_edit_post && $core->auth->check('delete,contentadmin',$core->blog->id)) 528 { 529 $combo_action[__('Delete')] = 'delete'; 530 } 531 532 # --BEHAVIOR-- adminCommentsActionsCombo 533 $core->callBehavior('adminCommentsActionsCombo',array(&$combo_action)); 534 535 $has_action = !empty($combo_action) && (!$trackbacks->isEmpty() || !$comments->isEmpty()); 536 537 echo 538 '<div id="comments" class="multi-part" title="'.__('Comments').'">'; 539 540 if ($has_action) { 541 echo '<form action="comments_actions.php" id="form-comments" method="post">'; 542 } 543 544 echo '<h3>'.__('Trackbacks').'</h3>'; 545 546 if (!$trackbacks->isEmpty()) { 547 showComments($trackbacks,$has_action,true); 548 } else { 549 echo '<p>'.__('No trackback').'</p>'; 550 } 551 552 echo '<h3>'.__('Comments').'</h3>'; 553 if (!$comments->isEmpty()) { 554 showComments($comments,$has_action); 555 } else { 556 echo '<p>'.__('No comment').'</p>'; 557 } 558 559 if ($has_action) { 560 echo 561 '<div class="two-cols">'. 562 '<p class="col checkboxes-helpers"></p>'. 563 564 '<p class="col right"><label for="action" class="classic">'.__('Selected comments action:').'</label> '. 565 form::combo('action',$combo_action). 566 form::hidden('redir','post.php?id='.$post_id.'&co=1'). 567 $core->formNonce(). 568 '<input type="submit" value="'.__('ok').'" /></p>'. 569 '</div>'. 570 '</form>'; 571 } 572 573 echo '</div>'; 574 } 575 576 /* Add a comment 577 -------------------------------------------------------- */ 578 if ($post_id) 579 { 580 echo 581 '<div class="multi-part" id="add-comment" title="'.__('Add a comment').'">'. 582 '<h3>'.__('Add a comment').'</h3>'. 583 584 '<form action="comment.php" method="post" id="comment-form">'. 585 '<div class="constrained">'. 586 '<p><label for="comment_author" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Name:'). 587 form::field('comment_author',30,255,html::escapeHTML($core->auth->getInfo('user_cn'))). 588 '</label></p>'. 589 590 '<p><label for="comment_email">'.__('Email:'). 591 form::field('comment_email',30,255,html::escapeHTML($core->auth->getInfo('user_email'))). 592 '</label></p>'. 593 594 '<p><label for="comment_site">'.__('Web site:'). 595 form::field('comment_site',30,255,html::escapeHTML($core->auth->getInfo('user_url'))). 596 '</label></p>'. 597 598 '<p class="area"><label for="comment_content" class="required"><abbr title="'.__('Required field').'">*</abbr> '. 599 __('Comment:').'</label> '. 600 form::textarea('comment_content',50,8,html::escapeHTML('')). 601 '</p>'. 602 603 '<p>'.form::hidden('post_id',$post_id). 604 $core->formNonce(). 605 '<input type="submit" name="add" value="'.__('Save').'" /></p>'. 606 '</div>'. 607 '</form>'. 608 '</div>'; 609 } 610 611 # Controls comments or trakbacks capabilities 612 function isContributionAllowed($id,$dt,$com=true) 613 { 614 global $core; 615 616 if (!$id) { 617 return true; 618 } 619 if ($com) { 620 if (($core->blog->settings->system->comments_ttl == 0) || 621 (time() - $core->blog->settings->system->comments_ttl*86400 < $dt)) { 622 return true; 623 } 624 } else { 625 if (($core->blog->settings->system->trackbacks_ttl == 0) || 626 (time() - $core->blog->settings->system->trackbacks_ttl*86400 < $dt)) { 627 return true; 628 } 629 } 630 return false; 631 } 632 633 # Show comments or trackbacks 634 function showComments($rs,$has_action,$tb=false) 635 { 636 echo 637 '<table class="comments-list"><tr>'. 638 '<th colspan="2">'.__('Author').'</th>'. 639 '<th>'.__('Date').'</th>'. 640 '<th class="nowrap">'.__('IP address').'</th>'. 641 '<th>'.__('Status').'</th>'. 642 '<th> </th>'. 643 '</tr>'; 644 645 while($rs->fetch()) 646 { 647 $comment_url = 'comment.php?id='.$rs->comment_id; 648 649 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 650 switch ($rs->comment_status) { 651 case 1: 652 $img_status = sprintf($img,__('published'),'check-on.png'); 653 break; 654 case 0: 655 $img_status = sprintf($img,__('unpublished'),'check-off.png'); 656 break; 657 case -1: 658 $img_status = sprintf($img,__('pending'),'check-wrn.png'); 659 break; 660 case -2: 661 $img_status = sprintf($img,__('junk'),'junk.png'); 662 break; 663 } 664 665 echo 666 '<tr class="line'.($rs->comment_status != 1 ? ' offline' : '').'"'. 667 ' id="c'.$rs->comment_id.'">'. 668 669 '<td class="nowrap">'. 670 ($has_action ? form::checkbox(array('comments[]'),$rs->comment_id,'','','',0,'title="'.($tb ? __('select this trackback') : __('select this comment')).'"') : '').'</td>'. 671 '<td class="maximal">'.html::escapeHTML($rs->comment_author).'</td>'. 672 '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$rs->comment_dt).'</td>'. 673 '<td class="nowrap"><a href="comments.php?ip='.$rs->comment_ip.'">'.$rs->comment_ip.'</a></td>'. 674 '<td class="nowrap status">'.$img_status.'</td>'. 675 '<td class="nowrap status"><a href="'.$comment_url.'">'. 676 '<img src="images/edit-mini.png" alt="" title="'.__('Edit this comment').'" /></a></td>'. 677 678 '</tr>'; 679 } 680 681 echo '</table>'; 682 } 683 684 dcPage::helpBlock('core_post','core_wiki'); 685 dcPage::close(); 188 $core->tpl->display('post.html.twig'); 686 189 ?> -
admin/style/default.css
r1140 r1155 40 40 margin-bottom: 0.6em; 41 41 } 42 42 43 h2 { 43 44 color: #666; … … 52 53 font-size: 1.2em; 53 54 } 55 54 56 p, div.p { 55 57 margin: 0 0 1em 0; 56 58 } 59 57 60 hr { 58 61 height: 1px; … … 61 64 border-style: solid; 62 65 } 66 63 67 pre, code { 64 68 font: 100% "Andale Mono","Courier New",monospace; … … 77 81 cursor: help; 78 82 } 83 79 84 80 85 /* LAYOUT … … 431 436 color: #666; 432 437 } 438 433 439 #dashboard-items { 434 440 float: left; … … 536 542 height: 500px; 537 543 } 544 538 545 #add-file-f { 539 546 position: relative; … … 619 626 display: inline; 620 627 } 628 621 629 #default-favs h3 { 622 630 margin-top: 2em; 623 631 margin-bottom: 1em; 624 632 } 633 625 634 .fav-list { 626 635 list-style-type: none; … … 915 924 vertical-align: middle; 916 925 } 926 917 927 /* Si quelque chose a besoin d'être caché sauf pour les revues d'écran */ 918 928 .hidden { … … 949 959 overflow: auto; 950 960 } 961 951 962 .grid { 952 963 background: transparent repeat url('grid.png') 0 0; 953 964 } 965 954 966 .line p { 955 967 margin: 0; … … 958 970 color: #666; 959 971 } 972 960 973 ul.nice { 961 974 margin: 1em 0; … … 1006 1019 margin-bottom: .5em; 1007 1020 } 1008 1009 1021 th, td { 1010 1022 border-width: 0 0 1px 0; … … 1021 1033 border-width: 0; 1022 1034 } 1035 1023 1036 table .maximal, table.maximal { 1024 1037 width: 100%; … … 1027 1040 width: 1px; 1028 1041 } 1042 1029 1043 table .nowrap { 1030 1044 white-space: nowrap; … … 1117 1131 font-weight: normal; 1118 1132 } 1133 1119 1134 input, textarea, select { 1120 1135 background: #f9f9f9; … … 1149 1164 background: transparent; 1150 1165 } 1166 1151 1167 label { 1152 1168 display: block; … … 1194 1210 resize: vertical; 1195 1211 } 1212 1196 1213 label.required { 1197 1214 font-weight: bold; … … 1218 1235 top: 0; 1219 1236 } 1237 1220 1238 label .maximal, textarea.maximal, input.maximal { 1221 1239 width: 100%; … … 1232 1250 padding-left: 20px; 1233 1251 } 1252 1253 a#toggle-filters { 1254 font-weight: bold; 1255 background: url(../images/plus.png) no-repeat 0 0; 1256 padding-left: 20px; 1257 } 1258 1259 a#toggle-filters.opened { 1260 background: url(../images/minus.png) no-repeat 0 0; 1261 } 1262 1234 1263 .constrained { 1235 1264 margin: 0; … … 1351 1380 background-color: #2373A8; 1352 1381 } 1353 1354 1382 /* jQuery Autocomplete plugin */ 1355 1383 .ac_results { … … 1384 1412 color: white; 1385 1413 } 1414 1415 form#filters {font-size: 100%; background: #f0f0f0; padding: 1em; border-radius: .5em; border: 1px solid #ddd;} 1416 form#filters .margintop {padding-top: 1.33em;} 1417 form#filters ul, form#filters p {list-style-type:none;margin: 0; padding: 0 0 .5em 0; margin-left: 1em;} 1418 form#filters .col30 {border-left: 1px solid #999;} 1419 form#filters .col30 h3 {margin-left: 1em;} 1420 1421 p.line, li.line { position: relative; padding: 3px 0 0 28px; margin: 0 0 1em 0;} 1422 li.line input[type=submit] {position: absolute; left:0;top:0; padding: 0 .1em; margin: 0;} 1423 li.line input[type=checkbox], li.line input[type=checkbox] {position: absolute; left: 0; top: .2em; padding: 0 .1em; margin: 0;} 1424 li.line select { margin-right: 2em;} 1425 li.line label { display: block; width: 8em; float: left;} 1426 li.line label img {margin-right: 8px;} 1427 li.line span.or { 1428 text-align: right; 1429 margin-left: 5em; 1430 font-weight: bold; 1431 } 1432 p.line label.or + select {margin-left: 2em;} 1433 li.line { padding: 0 0 0 20px; height: 1em;} 1434 li.line label {width: auto;} 1435 1436 #available_filters input[type=submit] {padding: 0 .1em; margin-left: .5em;} 1437 1438 div.pagination span, div.pagination a { 1439 margin-right: 1em; 1440 } -
admin/style/default.css
r1147 r1155 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 12 */ 13 14 /* ------------------------------------------------------------------ html */ 13 15 body { 14 16 font: 75%/1.5em Helvetica,Arial,sans-serif; … … 151 153 height: 2em; 152 154 } 155 #info-box1 p { 156 margin: 0; 157 display: inline; 158 } 153 159 #info-box1 select { 154 160 width: 15em; … … 193 199 } 194 200 #content { 195 margin: 1.5em 1.5em 4em 13em;201 margin: 1.5em 1.5em .5em 13em; 196 202 padding: 1em; 197 203 background: #fff; 198 -webkit-border-radius: .5em;199 -moz-border-radius: .5em;200 204 border-radius: .5em; 201 205 border: 1px solid #ddd; … … 255 259 background: #dfdfdf; 256 260 text-decoration: none; 257 -webkit-border-top-left-radius: .3em;258 -webkit-border-top-right-radius: .3em;259 -moz-border-radius-topleft: .3em;260 -moz-border-radius-topright: .3em;261 261 border-top-left-radius: .3em; 262 262 border-top-right-radius: .3em; … … 282 282 float: left; 283 283 margin-top: 1.2em; 284 margin-bottom: 1em;284 margin-bottom: .5em; 285 285 } 286 286 #main-menu h3 { … … 302 302 padding: .2em 0 0 32px; 303 303 background-repeat: no-repeat; 304 background-position: 12px . 2em;304 background-position: 12px .4em; 305 305 } 306 306 #main-menu a { … … 340 340 #footer { 341 341 clear: both; 342 padding: .75em 2em; 343 margin: 6em 15px .5em 15px; 344 -webkit-border-radius: .3em; 345 -moz-border-radius: .3em; 346 border-radius: .3em; 347 background: #575859 url(dc_logo_small.png) no-repeat right bottom; 348 color: #fff; 342 padding: .75em .75em 0 0; 343 text-align: right; 349 344 } 350 345 #footer p { … … 355 350 } 356 351 #footer a { 357 color: #f5f5f5;358 352 } 359 353 #footer p span.credit { … … 378 372 border: 1px solid #999; 379 373 padding: 1em 1em 0 1em; 380 -moz-border-radius: 4px;381 -webkit-border-radius: 4px;382 374 border-radius: 4px; 383 375 } … … 513 505 border: 1px solid #ccc; 514 506 border-left: 1em solid #E5E3DA; 515 -moz-border-radius: .3em;516 -webkit-border-radius: .3em;517 507 border-radius: .3em; 518 508 } … … 668 658 border: 1px solid #ddd; 669 659 padding: .2em; 670 -moz-border-radius: .5em;671 -webkit-border-radius: .5em;672 660 border-radius: .5em; 673 661 } … … 764 752 border: 1px solid #f3f3f3; 765 753 cursor: pointer; 766 -moz-border-radius: 4px;767 -webkit-border-radius: 4px;768 754 border-radius: 4px; 769 755 } … … 804 790 } 805 791 #help-button { 806 position: absolute;807 top: 6.2em;792 position: fixed; 793 top: 3.2em; 808 794 right: 0px; 809 795 cursor: pointer; … … 815 801 text-transform: capitalize; 816 802 padding: .33em .75em .33em 1em; 817 -moz-border-radius: 1em 0 0 1em; 818 -webkit-border-top-left-radius: 1em; 819 -webkit-border-bottom-left-radius: 1em; 803 border-radius: 1em 0 0 1em; 820 804 color: #444; 821 805 } … … 879 863 div.message, p.message, 880 864 div.static-msg, p.static-msg { 881 padding: 0.5em 0.5em 0.5em 4 0px;865 padding: 0.5em 0.5em 0.5em 48px; 882 866 margin-bottom: 1em; 883 -moz-border-radius: 8px;884 -webkit-border-radius: 8px;885 867 border-radius: 8px; 886 868 } … … 890 872 } 891 873 div.error, p.error { 892 background: # e5bfbf url(msg-error.png) no-repeat 5px 5px;893 color: # 600;874 background: #ffdec8 url(msg-error.png) no-repeat .7em .7em; 875 color: #000; 894 876 } 895 877 div.message, p.message, 896 878 div.static-msg, p.static-msg { 897 background: #666 url(msg-std.png) no-repeat 5px 5px;879 background: #666 url(msg-std.png) no-repeat .7em .7em; 898 880 color: #fff; 899 881 } … … 1015 997 right: 0; 1016 998 } 999 .distrib img { 1000 display: block; 1001 float: right; 1002 margin-top: -1em; 1003 } 1017 1004 /* TABLES 1018 1005 -------------------------------------------------------- */ … … 1041 1028 th { 1042 1029 text-align: left; 1030 border-bottom-color: #666; 1043 1031 } 1044 1032 .noborder td, td.noborder, .noborder th, th.noborder { … … 1056 1044 white-space: nowrap; 1057 1045 vertical-align: top; 1046 } 1047 table.settings, table.prefs { 1048 width: 80%; 1049 } 1050 table.settings th:first-child, table.prefs th:first-child { 1051 width: 20%; 1052 } 1053 table.settings th + th, table.prefs th + th { 1054 width: 30%; 1055 } 1056 table.settings th + th + th, table.prefs th + th + th { 1057 width: 10%; 1058 } 1059 table.settings th:last-child, table.prefs th:last-child { 1060 width: 40%; 1058 1061 } 1059 1062 … … 1136 1139 border-color: #000 #ccc #ccc #000; 1137 1140 } 1141 input.invalid, textarea.invalid, select.invalid { 1142 border: 1px solid red; 1143 background: #fff; 1144 color: red; 1145 box-shadow: 0 0 0 1px rgba(218, 62, 90, 0.3) 1146 } 1138 1147 input, textarea, select, option { 1139 1148 font: 1em "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif; … … 1167 1176 color: #666; 1168 1177 } 1178 span.form-note { 1179 font-style:italic; 1180 font-weight: normal; 1181 color: #666; 1182 } 1169 1183 p.form-note.warn, p.form-note.info, p.warning { 1170 1184 font-style: normal; … … 1172 1186 } 1173 1187 p.form-note.warn, p.warning { 1174 background: #ffd url(warning.png) no-repeat . 2em .2em;1188 background: #ffd url(warning.png) no-repeat .3em .3em; 1175 1189 border: 1px solid #f0c020; 1176 1190 } 1177 1191 p.form-note.info { 1178 background: #eef url(info.png) no-repeat . 2em .2em;1192 background: #eef url(info.png) no-repeat .3em .2em; 1179 1193 border: 1px solid #99f; 1180 1194 } … … 1209 1223 p.field { 1210 1224 position: relative; 1211 1225 1212 1226 } 1213 1227 p.field label { … … 1275 1289 padding: .1em .5em 0 .5em; 1276 1290 text-shadow: 0 1px 1px rgba(0,0,0,.3); 1277 -webkit-border-radius: .2em;1278 -moz-border-radius: .2em;1279 1291 border-radius: .2em; 1280 1292 margin-bottom: .1em; … … 1358 1370 } 1359 1371 a.button.add { 1360 -webkit-border-radius: .5em;1361 -moz-border-radius: .5em;1362 1372 border-radius: .5em; 1363 1373 margin-bottom: .1em; 1364 background: #2C8FD1 url( add.png) no-repeat 6px center;1374 background: #2C8FD1 url(../images/add.png) no-repeat 6px center; 1365 1375 color: #fff; 1366 1376 padding: .2em 16px .2em 30px; … … 1369 1379 a.button.add:hover, a.button.add:focus { 1370 1380 background-color: #2373A8; 1381 } 1382 /* jQuery Autocomplete plugin */ 1383 .ac_results { 1384 padding: 0px; 1385 border: 1px dotted #f90; 1386 background-color: white; 1387 overflow: hidden; 1388 z-index: 99999; 1389 } 1390 .ac_results ul { 1391 width: 100%; 1392 list-style-position: outside; 1393 list-style: none; 1394 padding: 0; 1395 margin: 0; 1396 } 1397 .ac_results li { 1398 margin: 0px; 1399 padding: 2px 5px; 1400 cursor: default; 1401 display: block; 1402 font: menu; 1403 font-size: 1em; 1404 line-height: 16px; 1405 overflow: hidden; 1406 } 1407 .ac_loading { 1408 background: transparent url('loader.gif') right center no-repeat; 1409 } 1410 .ac_over { 1411 background-color: #06c; 1412 color: white; 1371 1413 } 1372 1414
Note: See TracChangeset
for help on using the changeset viewer.
