Dotclear


Ignore:
Files:
8 deleted
24 edited

Legend:

Unmodified
Added
Removed
  • .hgsubstate

    r1693 r1624  
    1 3811959404614e7014b897d3d3b96caad10e214f inc/libs/clearbricks 
     1f5e0517435fc94082b6acaad5f4f111252b6149f inc/libs/clearbricks 
  • admin/blog_pref.php

    r1698 r1636  
    580580               $user_url_p = '%1$s'; 
    581581          } 
    582  
    583           # Sort users list on user_id key 
    584           ksort($blog_users); 
    585  
    586           $post_type = $core->getPostTypes(); 
    587           $current_blog_id = $core->blog->id; 
    588           if ($blog_id != $core->blog->id) { 
    589                $core->setBlog($blog_id); 
    590           } 
    591  
     582           
    592583          foreach ($blog_users as $k => $v) 
    593584          { 
     
    595586               { 
    596587                    echo 
    597                     '<div class="user-perm">'. 
    598588                    '<h4>'.sprintf($user_url_p,html::escapeHTML($k)). 
    599589                    ' ('.html::escapeHTML(dcUtils::getUserCN( 
    600590                         $k, $v['name'], $v['firstname'], $v['displayname'] 
    601591                    )).')</h4>'; 
    602  
    603                     if ($core->auth->isSuperAdmin()) { 
    604                          echo  
    605                          '<p>'.__('Email:').' '. 
    606                          ($v['email'] != '' ? '<a href="mailto:'.$v['email'].'">'.$v['email'].'</a>' : __('(none)')). 
    607                          '</p>'; 
    608                     } 
    609  
    610                     echo 
    611                     '<h5>'.__('Publications on this blog:').'</h5>'. 
    612                     '<ul>'; 
    613                     foreach ($post_type as $type => $pt_info) { 
    614                          $params = array( 
    615                               'post_type' => $type, 
    616                               'user_id' => $k 
    617                               ); 
    618                          echo '<li>'.sprintf(__('%1$s: %2$s'),__($pt_info['label']),$core->blog->getPosts($params,true)->f(0)).'</li>'; 
    619                     } 
    620                     echo 
    621                     '</ul>'; 
    622  
    623                     echo 
    624                     '<h5>'.__('Permissions:').'</h5>'. 
    625                     '<ul>'; 
     592                     
     593                    echo '<ul class="nice">'; 
    626594                    if ($v['super']) { 
    627                          echo '<li class="user_super">'.__('Super administrator').'</li>'; 
     595                         echo '<li>'.__('Super administrator').'</li>'; 
    628596                    } else { 
    629597                         foreach ($v['p'] as $p => $V) { 
    630                               echo '<li '.($p == 'admin' ? 'class="user_admin"' : '').'>'.__($perm_types[$p]).'</li>'; 
     598                              echo '<li>'.__($perm_types[$p]).'</li>'; 
    631599                         } 
    632600                    } 
    633                     echo  
    634                     '</ul>'; 
     601                    echo '</ul>'; 
    635602                     
    636603                    if (!$v['super'] && $core->auth->isSuperAdmin()) { 
    637604                         echo  
    638605                         '<form action="users_actions.php" method="post">'. 
    639                          '<p class="change-user-perm"><input type="submit" class="reset" value="'.__('Change permissions').'" />'. 
     606                         '<p><input type="submit" value="'.__('Change permissions').'" />'. 
    640607                         form::hidden(array('redir'),'blog_pref.php?id='.$k). 
    641608                         form::hidden(array('action'),'perms'). 
     
    646613                         '</form>'; 
    647614                    } 
    648                     echo '</div>'; 
    649615               } 
    650           } 
    651           if ($current_blog_id != $core->blog->id) { 
    652                $core->setBlog($current_blog_id); 
    653616          } 
    654617     } 
  • admin/index.php

    r1699 r1620  
    6363     $core->auth->user_prefs->dashboard->put('quickentry',false,'boolean'); 
    6464} 
    65  
    66 // Handle folded/unfolded sections in admin from user preferences 
    67 $ws = $core->auth->user_prefs->addWorkspace('toggles'); 
    68 if (!$core->auth->user_prefs->toggles->prefExists('unfolded_sections')) { 
    69      $core->auth->user_prefs->toggles->put('unfolded_sections','','string','Folded sections in admin',null,true); 
    70 } 
    71  
    7265 
    7366# Dashboard icons 
     
    217210 
    218211     if ($updater->getNotify() && $new_v) { 
    219           echo 
    220           '<div class="dc-update"><h3>'.sprintf(__('Dotclear %s is available!'),$new_v).'</h3> '. 
    221           '<p><a class="button submit" href="update.php">'.sprintf(__('Upgrade now'),$new_v).'</a> '. 
    222           '<a href="update.php?hide_msg=1">'.__('Remind me later').'</a>'. 
    223           ($version_info ? ' </p>'. 
    224           '<p><a href="'.$version_info.'" class="info">'.__('information about this version').'</a>' : '').'</p>'. 
    225           '</div>'; 
     212          $message = 
     213          '<div><p>'.sprintf(__('Dotclear %s is available!'),$new_v).'</p> '. 
     214          '<ul><li><strong><a href="update.php">'.sprintf(__('Upgrade now'),$new_v).'</a></strong>'. 
     215          '</li><li><a href="update.php?hide_msg=1">'.__('Remind me later').'</a>'. 
     216          ($version_info ? ' </li><li><a href="'.$version_info.'">'.__('information about this version').'</a>' : ''). 
     217          '</li></ul></div>'; 
     218          dcPage::message($message,false,true); 
    226219     } 
    227220} 
  • admin/js/_index.js

    r1699 r1638  
    7575     $('#quick h3').toggleWithLegend($('#quick').children().not('h3'),{ 
    7676          legend_click: true, 
    77           user_pref: 'dcx_quick_entry' 
     77          cookie: 'dcx_quick_entry' 
    7878     }); 
    7979}); 
  • admin/js/_post.js

    r1714 r1712  
    120120          // Hide some fields 
    121121          $('#notes-area label').toggleWithLegend($('#notes-area').children().not('label'),{ 
    122                user_pref: 'dcx_post_notes', 
     122               cookie: 'dcx_post_notes', 
    123123               legend_click:true, 
    124124               hide: $('#post_notes').val() == '' 
     
    129129          }); 
    130130          $('#post_lang').parent().children('label').toggleWithLegend($('#post_lang'),{ 
    131                user_pref: 'dcx_post_lang', 
     131               cookie: 'dcx_post_lang', 
    132132               legend_click: true 
    133133          }); 
    134134          $('#post_password').parent().children('label').toggleWithLegend($('#post_password'),{ 
    135                user_pref: 'dcx_post_password', 
     135               cookie: 'dcx_post_password', 
    136136               legend_click: true, 
    137137               hide: $('#post_password').val() == '' 
    138138          }); 
    139139          $('#post_status').parent().children('label').toggleWithLegend($('#post_status'),{ 
    140                user_pref: 'dcx_post_status', 
     140               cookie: 'dcx_post_status', 
    141141               legend_click: true 
    142142          }); 
    143143          $('#post_dt').parent().children('label').toggleWithLegend($('#post_dt').parent().children().not('label'),{ 
    144                user_pref: 'dcx_post_dt', 
     144               cookie: 'dcx_post_dt', 
    145145               legend_click: true 
    146146          }); 
    147147          $('#label_format').toggleWithLegend($('#label_format').parent().children().not('#label_format'),{ 
    148                user_pref: 'dcx_post_format', 
     148               cookie: 'dcx_post_format', 
    149149               legend_click: true 
    150150          }); 
    151151          $('#cat_id').parent().children('label').toggleWithLegend($('#cat_id'),{ 
    152                user_pref: 'cat_id', 
     152               cookie: 'cat_id', 
    153153               legend_click: true 
    154154          }); 
     
    158158          }); 
    159159          $('#post_url').parent().children('label').toggleWithLegend($('#post_url').parent().children().not('label'),{ 
    160                user_pref: 'post_url', 
     160               cookie: 'post_url', 
    161161               legend_click: true 
    162162          }); 
    163163          // We load toolbar on excerpt only when it's ready 
    164164          $('#excerpt-area label').toggleWithLegend($('#excerpt-area').children().not('label'),{ 
    165                user_pref: 'dcx_post_excerpt', 
     165               cookie: 'dcx_post_excerpt', 
    166166               legend_click: true, 
    167167               hide: $('#post_excerpt').val() == '' 
  • admin/js/common.js

    r1699 r1635  
    6363          img_off_src: dotclear.img_minus_src, 
    6464          img_off_alt: dotclear.img_minus_alt, 
    65           unfolded_sections: dotclear.unfolded_sections, 
    6665          hide: true, 
    6766          speed: 0, 
    6867          legend_click: false, 
    6968          fn: false, // A function called on first display, 
    70           user_pref: false, 
    71           reverse_user_pref: false, // Reverse cookie behavior 
    72           user_pref:false, 
    73           reverse_user_pref: false 
     69          cookie: false, 
     70          reverse_cookie: false // Reverse cookie behavior 
    7471     }; 
    7572     var p = jQuery.extend(defaults,s); 
     
    8178          p.hide = p.reverse_cookie; 
    8279     } 
    83       
    84      var set_user_pref = p.hide ^ p.reverse_user_pref; 
    85      if (p.user_pref && (p.user_pref in p.unfolded_sections)) { 
    86           p.hide = p.reverse_user_pref; 
    87      } 
     80 
    8881     var toggle = function(i,speed) { 
    8982          speed = speed || 0; 
     
    109102               } 
    110103          } 
     104 
    111105          p.hide = !p.hide; 
    112106     }; 
     
    131125          } 
    132126          $(ctarget).click(function() { 
    133                if (p.user_pref && set_user_pref) { 
    134                     if (p.hide ^ p.reverse_user_pref) { 
    135                          jQuery.post('services.php',  
    136                               {'f':'setSectionFold','section':p.user_pref,'value':1,xd_check: dotclear.nonce}, 
    137                               function(data) {}); 
    138                     } else { 
    139                          jQuery.post('services.php',  
    140                               {'f':'setSectionFold','section':p.user_pref,'value':0,xd_check: dotclear.nonce}, 
    141                               function(data) {}); 
    142                     } 
    143                     jQuery.cookie(p.user_pref,'',{expires: -1}); 
    144                } 
    145127               toggle(i,p.speed); 
    146128               return false; 
     
    366348     } 
    367349     $('#blog-menu h3:first').toggleWithLegend($('#blog-menu ul:first'), 
    368           $.extend({user_pref:'dc_blog_menu'},menu_settings) 
     350          $.extend({cookie:'dc_blog_menu'},menu_settings) 
    369351     ); 
    370352     $('#system-menu h3:first').toggleWithLegend($('#system-menu ul:first'), 
    371           $.extend({user_pref:'dc_system_menu'},menu_settings) 
     353          $.extend({cookie:'dc_system_menu'},menu_settings) 
    372354     ); 
    373355     $('#plugins-menu h3:first').toggleWithLegend($('#plugins-menu ul:first'), 
    374           $.extend({user_pref:'dc_plugins_menu'},menu_settings) 
     356          $.extend({cookie:'dc_plugins_menu'},menu_settings) 
    375357     ); 
    376358     $('#favorites-menu h3:first').toggleWithLegend($('#favorites-menu ul:first'), 
    377           $.extend({user_pref:'dc_favorites_menu',hide:false,reverse_user_pref:true},menu_settings) 
     359          $.extend({cookie:'dc_favorites_menu',hide:false,reverse_cookie:true},menu_settings) 
    378360     ); 
    379361 
  • admin/media.php

    r1681 r1678  
    231231$core->auth->user_prefs->addWorkspace('interface'); 
    232232$user_ui_enhanceduploader = $core->auth->user_prefs->interface->enhanceduploader; 
     233 
    233234 
    234235if (!isset($core->media)) { 
     
    342343if ($core_media_writable) 
    343344{ 
    344      echo  
    345      '<h3>'.sprintf(__('In %s:'),($d == '' ? '“'.__('Media manager').'”' : '“'.$d.'”')).'</h3>'. 
    346      '<div class="media-action-box">'; 
     345     echo '<div class="two-cols">'; 
    347346      
    348347     if ($user_ui_enhanceduploader) { 
    349348          echo 
    350           '<div class="enhanced_uploader">'; 
     349          '<div class="col enhanced_uploader">'; 
    351350     } else { 
    352351          echo 
    353           '<div>'; 
    354      } 
    355  
    356      echo 
    357      '<h4>'.__('Add files').'</h4>'. 
     352          '<div class="col">'; 
     353     } 
     354 
     355     echo 
     356     '<div class="fieldset">'. 
     357     '<h3>'.__('Add files').'</h3>'. 
    358358     '<p>'.__('Please take care to publish media that you own and that are not protected by copyright.').'</p>'. 
    359359     '<p class="max-sizer form-note info">&nbsp;'.__('Maximum file size allowed:').' '.files::size(DC_MAX_UPLOAD_SIZE).'</p>'. 
     
    391391     '<p style="clear:both;">'.form::hidden(array('d'),$d).'</p>'. 
    392392     '</form>'. 
    393      '</div>'. 
    394      '</div>'; 
    395  
    396      echo 
    397      '<div class="media-action-box">'. 
    398      '<form action="'.html::escapeURL($page_url).'" method="post">'. 
     393     '</div></div>'; 
     394 
     395     echo 
     396     '<div class="col">'. 
     397     '<form class="clear fieldset" action="'.html::escapeURL($page_url).'" method="post">'. 
    399398     '<div id="new-dir-f">'. 
    400      '<h4>'.__('Create new directory').'</h4>'. 
     399     '<h3>'.__('New directory').'</h3>'. 
    401400     $core->formNonce(). 
    402401     '<p><label for="newdir">'.__('Directory Name:').'</label>'. 
     
    405404     form::hidden(array('d'),html::escapeHTML($d)).'</p>'. 
    406405     '</div>'. 
    407      '</form>'. 
    408      '</div>'; 
    409      } 
     406     '</form></div>'; 
     407      
     408     echo '</div>'; 
     409} 
    410410 
    411411# Empty remove form (for javascript actions) 
    412412echo 
    413 '<form id="media-remove-hide" action="'.html::escapeURL($page_url).'" method="post" class="hidden">'. 
    414 '<div>'. 
     413'<form id="media-remove-hide" action="'.html::escapeURL($page_url).'" method="post"><div class="clear">'. 
    415414form::hidden('rmyes',1).form::hidden('d',html::escapeHTML($d)). 
    416415form::hidden('remove',''). 
    417416$core->formNonce(). 
    418 '</div>'. 
    419 '</form>'; 
     417'</div></form>'; 
    420418 
    421419# Get zip directory 
     
    424422{ 
    425423     echo 
    426      '<div class="media-action-box">'. 
    427      '<h4>'.__('Backup content').'</h4>'. 
    428      '<p>'.__('Compress this directory with its content as a zip file and download it.').'</p>'. 
    429      '<p><a class="submit" href="'.html::escapeURL($page_url).'&amp;zipdl=1">'. 
    430      __('Download').'</a></p>'. 
    431      '</div>'; 
     424     '<p class="zip-dl"><a class="submit" href="'.html::escapeURL($page_url).'&amp;zipdl=1">'. 
     425     __('Download this directory as a zip file').'</a></p>'; 
    432426} 
    433427 
  • admin/post.php

    r1714 r1711  
    518518          "post_excerpt" => 
    519519               '<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').'<span class="form-note">'. 
    520                __('Introduction to the post.').'</span></label> '. 
     520               __('Add an introduction to the post.').'</span></label> '. 
    521521               form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)). 
    522522               '</p>', 
     
    530530          "post_notes" => 
    531531               '<p class="area" id="notes-area"><label for="post_notes">'.__('Personal notes:').'<span class="form-note">'. 
    532                __('Unpublished notes.').'</span></label>'. 
     532               __('Add unpublished notes.').'</span></label>'. 
    533533               form::textarea('post_notes',50,5,html::escapeHTML($post_notes)). 
    534534               '</p>' 
  • admin/services.php

    r1699 r1538  
    2626$core->rest->addFunction('setPostMeta',array('dcRestMethods','setPostMeta')); 
    2727$core->rest->addFunction('searchMeta',array('dcRestMethods','searchMeta')); 
    28 $core->rest->addFunction('setSectionFold',array('dcRestMethods','setSectionFold')); 
    2928 
    3029$core->rest->serve(); 
     
    413412          return $rsp; 
    414413     } 
    415       
    416      public static function setSectionFold($core,$get,$post) 
    417      { 
    418           if (empty($post['section'])) { 
    419                throw new Exception('No section name'); 
    420           } 
    421           if ($core->auth->user_prefs->toggles === null) { 
    422                $core->auth->user_prefs->addWorkspace('toggles'); 
    423           } 
    424           $section = $post['section']; 
    425           $status = isset($post['value']) && ($post['value'] != 0); 
    426           if ($core->auth->user_prefs->toggles->prefExists('unfolded_sections')) { 
    427                $toggles = explode(',',trim($core->auth->user_prefs->toggles->unfolded_sections)); 
    428           } else { 
    429                $toggles = array(); 
    430           } 
    431           $k = array_search($section,$toggles); 
    432           if ($status) { // true == Fold section ==> remove it from unfolded list 
    433                if ($k !== false) { 
    434                     unset($toggles[$k]); 
    435                }  
    436           } else { // false == unfold section ==> add it to unfolded list 
    437                if ($k === false) { 
    438                     $toggles[]=$section; 
    439                };  
    440           } 
    441           $core->auth->user_prefs->toggles->put('unfolded_sections',join(',',$toggles)); 
    442           return true; 
    443      } 
    444            
    445       
    446414} 
    447415?> 
  • admin/style/default.css

    r1698 r1678  
    797797     border: none; 
    798798} 
    799 .media-item, .media-action-box { 
     799.media-item { 
    800800     position: relative; 
    801801     border: 1px solid #ccc; 
     
    803803     padding: 1em; 
    804804     width: 300px; 
     805     height: 120px; 
    805806     display: inline-block; 
    806807     vertical-align: top; 
    807      min-height: 120px 
     808} 
     809div.media-list .media-item { 
    808810} 
    809811a.media-icon { 
     
    903905     margin-left: 0; 
    904906} 
    905 /* in blog_pref */ 
    906 .user-perm { 
    907      margin: 2em 0px; 
    908      background: transparent url(user.png) no-repeat left top; 
    909      width: 320px; 
    910      display: inline-block; 
    911      vertical-align: top; 
    912 } 
    913 .user-perm h4, .user-perm h5, .user-perm p, .user-perm ul, .user-perm li { 
    914      margin: .5em 0 .33em; 
    915      padding: 0; 
    916 } 
    917 .user-perm h4 { 
    918      padding-left: 28px; 
    919 } 
    920 .user-perm ul { 
    921      list-style-type: inside; 
    922 } 
    923 .user-perm li { 
    924      margin-left: 1em; 
    925      padding-left: 0; 
    926 } 
    927 .user-perm h5 { 
    928      margin:   1em 0 0 0; 
    929 } 
    930 li.user_super, li.user_admin { 
    931      margin-left: 0; 
    932      padding-left: 1em; 
    933      list-style: none; 
    934      background: transparent url(../images/superadmin.png) no-repeat -2px 2px; 
    935 } 
    936 li.user_admin { 
    937      background-image: url(../images/admin.png); 
    938 } 
    939  
    940907/* -------------------------------------------------------------------- Themes */ 
    941908#themes { 
     
    11951162.success a { 
    11961163     color: #666; 
    1197 } 
    1198 .dc-update { 
    1199      padding: 1em 48px 0.5em 48px; 
    1200      margin-bottom: 1em; 
    1201      border-radius: 8px; 
    1202      background: #A2CBE9 url(msg-success.png) no-repeat .7em .7em; 
    1203 } 
    1204 .dc-update a { 
    1205      color: #000; 
    1206      border-color: #000; 
    1207      margin-right: 1em; 
    1208 } 
    1209 a.info { 
    1210      margin-left: 2em; 
    1211      font-weight: bold; 
    12121164} 
    12131165/* ------------------------------------------------------------------ navigation */ 
  • admin/style/jsToolBar/jsToolBar.css

    r1697 r1636  
    4848     width: 12em; 
    4949     margin-right: .6rem; 
    50      border: 1px solid #ccc;  
    5150} 
    5251.jstElements button { 
     
    7271     background: #dfdfdf; 
    7372} 
    74 span.jstSpacer { 
    75      width : 6px; 
     73 
     74.jstSpacer { 
     75     width : 2px; 
    7676     height: 28px; 
    7777     margin-right: 0; 
  • inc/admin/lib.dc.page.php

    r1699 r1655  
    114114          echo 
    115115          self::jsCommon(). 
    116           self::jsToggles(). 
    117116          $head; 
    118117 
     
    254253          echo 
    255254          self::jsCommon(). 
    256           self::jsToggles(). 
    257255          $head; 
    258256 
     
    446444     } 
    447445 
    448      public static function jsToggles() 
    449      { 
    450           if($GLOBALS['core']->auth->user_prefs->toggles) { 
    451                $unfolded_sections = explode(',',$GLOBALS['core']->auth->user_prefs->toggles->unfolded_sections); 
    452                foreach ($unfolded_sections as $k=>&$v) { 
    453                     if ($v == '') { 
    454                          unset($unfolded_sections[$k]); 
    455                     } else { 
    456                          $v = "'".html::escapeJS($v)."':true"; 
    457                     } 
    458                } 
    459           } else { 
    460                $unfolded_sections=array(); 
    461           } 
    462           return '<script type="text/javascript">'."\n". 
    463                          "//<![CDATA[\n". 
    464                          'dotclear.unfolded_sections = {'.join(",",$unfolded_sections)."};\n". 
    465                          "\n//]]>\n". 
    466                     "</script>\n"; 
    467      } 
    468       
    469446     public static function jsCommon() 
    470447     { 
     
    567544          self::jsVar('dotclear.msg.load_enhanced_uploader', 
    568545               __('Loading enhanced uploader, please wait.')). 
    569                "\n//]]>\n". 
     546          "\n//]]>\n". 
    570547          "</script>\n"; 
    571548     } 
     
    815792} 
    816793 
    817 public static function jsToolMan() 
    818 { 
    819      return 
    820      '<script type="text/javascript" src="js/tool-man/core.js"></script>'. 
    821      '<script type="text/javascript" src="js/tool-man/events.js"></script>'. 
    822      '<script type="text/javascript" src="js/tool-man/css.js"></script>'. 
    823      '<script type="text/javascript" src="js/tool-man/coordinates.js"></script>'. 
    824      '<script type="text/javascript" src="js/tool-man/drag.js"></script>'. 
    825      '<script type="text/javascript" src="js/tool-man/dragsort.js"></script>'. 
    826      '<script type="text/javascript" src="js/dragsort-tablerows.js"></script>'; 
    827 } 
    828  
    829794public static function jsMetaEditor() 
    830795{ 
  • inc/core/class.dc.blog.php

    r1689 r1620  
    199199     /** 
    200200     Updates comments and trackbacks counters in post table. Should be called 
    201      every time comments or trackbacks are added, removed or changed their status. 
     201     every time comments or trackbacks are added, removed or changed there status. 
    202202      
    203203     @param    ids       <b>mixed</b>        Comment(s) ID(s) 
     
    18801880     - cat_id: (integer or array) Get comments belonging to entries of given category ID 
    18811881     - comment_id: (integer) Get comment with given ID 
    1882      - comment_site: (string) Get comments with given comment_site 
    18831882     - comment_status: (integer) Get comments with given comment_status 
    18841883     - comment_trackback: (integer) Get only comments (0) or trackbacks (1) 
     
    19701969          if (isset($params['comment_id']) && $params['comment_id'] !== '') { 
    19711970               $strReq .= 'AND comment_id = '.(integer) $params['comment_id'].' '; 
    1972           } 
    1973            
    1974           if (isset($params['comment_site'])) { 
    1975                $comment_site = $this->con->escape(str_replace('*','%',$params['comment_site'])); 
    1976                $strReq .= "AND comment_site LIKE '".$comment_site."' "; 
    19771971          } 
    19781972           
  • inc/core/class.dc.core.php

    r1698 r1593  
    345345     } 
    346346      
    347      public function setPostType($type,$admin_url,$public_url,$label='') 
     347     public function setPostType($type,$admin_url,$public_url) 
    348348     { 
    349349          $this->post_types[$type] = array( 
    350350               'admin_url' => $admin_url, 
    351                'public_url' => $public_url, 
    352                'label' => ($label != '' ? $label : $type) 
     351               'public_url' => $public_url 
    353352          ); 
    354353     } 
     
    818817          $strReq = 
    819818          'SELECT U.user_id AS user_id, user_super, user_name, user_firstname, '. 
    820           'user_displayname, user_email, permissions '. 
     819          'user_displayname, permissions '. 
    821820          'FROM '.$this->prefix.'user U '. 
    822821          'JOIN '.$this->prefix.'permissions P ON U.user_id = P.user_id '. 
     
    827826               'UNION '. 
    828827               'SELECT U.user_id AS user_id, user_super, user_name, user_firstname, '. 
    829                "user_displayname, user_email, NULL AS permissions ". 
     828               "user_displayname, NULL AS permissions ". 
    830829               'FROM '.$this->prefix.'user U '. 
    831830               'WHERE user_super = 1 '; 
     
    842841                    'firstname' => $rs->user_firstname, 
    843842                    'displayname' => $rs->user_displayname, 
    844                     'email' => $rs->user_email, 
    845843                    'super' => (boolean) $rs->user_super, 
    846844                    'p' => $this->auth->parsePermissions($rs->permissions) 
  • inc/core/class.dc.trackback.php

    r1689 r1674  
    1414/** 
    1515@ingroup DC_CORE 
    16 @brief Trackbacks/Pingbacks sender and server 
    17  
    18 Sends and receives trackbacks/pingbacks. Also handles trackbacks/pingbacks auto discovery. 
     16@brief Trackbacks sender and server 
     17 
     18Sends and receives trackbacks. Also handles trackbacks auto discovery. 
    1919*/ 
    2020class dcTrackback 
     
    146146     } 
    147147     //@} 
    148       
    149      private function pingAlreadyDone($post_id, $from_url) 
    150      { 
    151           $params = array( 
    152                'post_id' => $post_id, 
    153                'comment_site' => $from_url, 
    154                'comment_trackback' => 1, 
    155           ); 
    156            
    157           $rs = $this->core->blog->getComments($params, true); 
    158           if ($rs && !$rs->isEmpty()) { 
    159                return ($rs->f(0)); 
    160           } 
    161            
    162           return false; 
    163      } 
    164       
    165      private function addBacklink($post_id, $url, $blog_name, $title, $excerpt, &$comment) 
    166      { 
    167           if (empty($blog_name)) { 
    168                $blog_name = 'Anonymous blog'; 
    169           } 
    170            
    171           $comment = 
    172           "<!-- TB -->\n". 
    173           '<p><strong>'.($title ? $title : $blog_name)."</strong></p>\n". 
    174           '<p>'.$excerpt.'</p>'; 
    175            
    176           $cur = $this->core->con->openCursor($this->core->prefix.'comment'); 
    177           $cur->comment_author = (string) $blog_name; 
    178           $cur->comment_site = (string) $url; 
    179           $cur->comment_content = (string) $comment; 
    180           $cur->post_id = $post_id; 
    181           $cur->comment_trackback = 1; 
    182           $cur->comment_status = $this->core->blog->settings->system->trackbacks_pub ? 1 : -1; 
    183           $cur->comment_ip = http::realIP(); 
    184            
    185           # --BEHAVIOR-- publicBeforeTrackbackCreate 
    186           $this->core->callBehavior('publicBeforeTrackbackCreate',$cur); 
    187           if ($cur->post_id) { 
    188                $comment_id = $this->core->blog->addComment($cur); 
    189                 
    190                # --BEHAVIOR-- publicAfterTrackbackCreate 
    191                $this->core->callBehavior('publicAfterTrackbackCreate',$cur,$comment_id); 
    192           } 
    193      } 
    194148      
    195149     /// @name Receive trackbacks 
     
    222176          $charset = ''; 
    223177          $comment = ''; 
    224                      
     178           
    225179          $err = false; 
    226180          $msg = ''; 
     
    255209                    $msg = 'Trackbacks are not allowed for this post or weblog.'; 
    256210               } 
    257  
    258                $url = trim(html::clean($url)); 
    259                if ($this->pingAlreadyDone($post->post_id, $url)) { 
    260                     $err = true; 
    261                     $msg = 'The trackback has already been registered'; 
    262                } 
    263211          } 
    264212           
     
    268216                
    269217               if (!$charset) { 
    270                     $charset = self::detectCharset($title.' '.$excerpt.' '.$blog_name); 
     218                    $charset = mb_detect_encoding($title.' '.$excerpt.' '.$blog_name, 
     219                    'UTF-8,ISO-8859-1,ISO-8859-2,ISO-8859-3,'. 
     220                    'ISO-8859-4,ISO-8859-5,ISO-8859-6,ISO-8859-7,ISO-8859-8,'. 
     221                    'ISO-8859-9,ISO-8859-10,ISO-8859-13,ISO-8859-14,ISO-8859-15'); 
    271222               } 
    272223                
     
    293244               $blog_name = text::cutString($blog_name,60); 
    294245                
     246               $url = trim(html::clean($url)); 
     247                
     248               if (!$blog_name) { 
     249                    $blog_name = 'Anonymous blog'; 
     250               } 
     251                
     252               $comment = 
     253               "<!-- TB -->\n". 
     254               '<p><strong>'.($title ? $title : $blog_name)."</strong></p>\n". 
     255               '<p>'.$excerpt.'</p>'; 
     256                
     257               $cur = $this->core->con->openCursor($this->core->prefix.'comment'); 
     258               $cur->comment_author = (string) $blog_name; 
     259               $cur->comment_site = (string) $url; 
     260               $cur->comment_content = (string) $comment; 
     261               $cur->post_id = $post_id; 
     262               $cur->comment_trackback = 1; 
     263               $cur->comment_status = $this->core->blog->settings->system->trackbacks_pub ? 1 : -1; 
     264               $cur->comment_ip = http::realIP(); 
     265                
    295266               try 
    296267               { 
    297                     $this->addBacklink($post_id, $url, $blog_name, $title, $excerpt, $comment); 
     268                    # --BEHAVIOR-- publicBeforeTrackbackCreate 
     269                    $this->core->callBehavior('publicBeforeTrackbackCreate',$cur); 
     270                    if ($cur->post_id) { 
     271                         $comment_id = $this->core->blog->addComment($cur); 
     272                          
     273                         # --BEHAVIOR-- publicAfterTrackbackCreate 
     274                         $this->core->callBehavior('publicAfterTrackbackCreate',$cur,$comment_id); 
     275                    } 
    298276               } 
    299277               catch (Exception $e) 
     
    303281               } 
    304282          } 
     283           
     284           
     285          $debug_trace = 
     286          "  <debug>\n". 
     287          '    <title>'.$title."</title>\n". 
     288          '    <excerpt>'.$excerpt."</excerpt>\n". 
     289          '    <url>'.$url."</url>\n". 
     290          '    <blog_name>'.$blog_name."</blog_name>\n". 
     291          '    <charset>'.$charset."</charset>\n". 
     292          '    <comment>'.$comment."</comment>\n". 
     293          "  </debug>\n"; 
    305294           
    306295          $resp = 
     
    314303           
    315304          if (!empty($_POST['__debug'])) { 
    316                $resp .=  
    317                "  <debug>\n". 
    318                '    <title>'.$title."</title>\n". 
    319                '    <excerpt>'.$excerpt."</excerpt>\n". 
    320                '    <url>'.$url."</url>\n". 
    321                '    <blog_name>'.$blog_name."</blog_name>\n". 
    322                '    <charset>'.$charset."</charset>\n". 
    323                '    <comment>'.$comment."</comment>\n". 
    324                "  </debug>\n"; 
     305               $resp .= $debug_trace; 
    325306          } 
    326307           
     
    381362          } 
    382363 
    383           if ($this->pingAlreadyDone($posts->post_id, $from_url)) { 
    384                throw new Exception(__('Don\'t repeat yourself, please.'), 48); 
    385           } 
    386            
    387364          # OK. We've found our champion. Time to check the remote part. 
    388365          try { 
     
    404381               $remote_content = $http->getContent(); 
    405382 
    406                $charset = self::getCharsetFromRequest($http->getHeader('content-type')); 
    407  
    408                if (!$charset) { 
    409                     $charset = self::detectCharset($remote_content); 
    410                } 
    411                 
     383               $charset = mb_detect_encoding($remote_content, 
     384                    'UTF-8,ISO-8859-1,ISO-8859-2,ISO-8859-3,'. 
     385                    'ISO-8859-4,ISO-8859-5,ISO-8859-6,ISO-8859-7,ISO-8859-8,'. 
     386                    'ISO-8859-9,ISO-8859-10,ISO-8859-13,ISO-8859-14,ISO-8859-15'); 
     387 
    412388               if (strtolower($charset) != 'utf-8') { 
    413389                    $remote_content = iconv($charset,'UTF-8',$remote_content); 
     
    440416               } 
    441417               if ($excerpt) { 
    442                     $excerpt = '(&#8230;) '.text::cutString(html::escapeHTML($excerpt),200).' (&#8230;)'; 
     418                    $excerpt = '(&#8230;) '.text::cutString(html::escapeHTML($excerpt),255).' (&#8230;)'; 
    443419               } 
    444420               else { 
    445                     $excerpt = '(&#8230;)'; 
    446                } 
    447  
    448                $this->addBacklink($posts->post_id, $from_url, '', $title, $excerpt, $comment); 
     421                    $excerpt = '(??)'; 
     422               } 
     423 
     424               $comment = 
     425               "<!-- TB -->\n". 
     426               '<p><strong>'.$title."</strong></p>\n". 
     427               '<p>'.$excerpt.'</p>'; 
     428                
     429               $cur = $this->core->con->openCursor($this->core->prefix.'comment'); 
     430               $cur->comment_author = 'Anonymous blog'; 
     431               $cur->comment_site = (string) $from_url; 
     432               $cur->comment_content = (string) $comment; 
     433               $cur->post_id = $posts->post_id; 
     434               $cur->comment_trackback = 1; 
     435               $cur->comment_status = $this->core->blog->settings->system->trackbacks_pub ? 1 : -1; 
     436               $cur->comment_ip = http::realIP(); 
     437                
     438               # --BEHAVIOR-- publicBeforeTrackbackCreate 
     439               $this->core->callBehavior('publicBeforeTrackbackCreate',$cur); 
     440               if ($cur->post_id) { 
     441                    $comment_id = $this->core->blog->addComment($cur); 
     442                     
     443                    # --BEHAVIOR-- publicAfterTrackbackCreate 
     444                    $this->core->callBehavior('publicAfterTrackbackCreate',$cur,$comment_id); 
     445               } 
    449446          } 
    450447          catch (Exception $e) { 
     
    467464     } 
    468465      
    469      private static function getCharsetFromRequest($header = '') 
    470      { 
    471           if (!$header && isset($_SERVER['CONTENT_TYPE'])) { 
    472                $header = $_SERVER['CONTENT_TYPE']; 
    473           } 
    474            
    475           if ($header) { 
    476                if (preg_match('|charset=([a-zA-Z0-9-]+)|',$header,$m)) { 
     466     private static function getCharsetFromRequest() 
     467     { 
     468          if (isset($_SERVER['CONTENT_TYPE'])) 
     469          { 
     470               if (preg_match('|charset=([a-zA-Z0-9-]+)|',$_SERVER['CONTENT_TYPE'],$m)) { 
    477471                    return $m[1]; 
    478472               } 
     
    481475          return null; 
    482476     } 
    483  
    484      private static function detectCharset($string) 
    485      { 
    486           return mb_detect_encoding($remote_content, 
    487                     'UTF-8,ISO-8859-1,ISO-8859-2,ISO-8859-3,'. 
    488                     'ISO-8859-4,ISO-8859-5,ISO-8859-6,ISO-8859-7,ISO-8859-8,'. 
    489                     'ISO-8859-9,ISO-8859-10,ISO-8859-13,ISO-8859-14,ISO-8859-15'); 
    490      } 
    491            
     477      
    492478     /// @name Trackbacks auto discovery 
    493479     //@{ 
  • inc/core/class.dc.xmlrpc.php

    r1688 r1674  
    16441644               throw new Exception(__('No valid source URL provided? Try again!'), 0); 
    16451645          } 
    1646  
    1647           if (!(filter_var($to_url, FILTER_VALIDATE_URL) && preg_match('!^https?://!',$to_url))) { 
    1648                throw new Exception(__('No valid target URL provided? Try again!'), 0); 
    1649           } 
    1650  
    1651           if (html::sanitizeURL(urldecode($from_url)) == html::sanitizeURL(urldecode($to_url))) { 
    1652                throw new Exception(__('LOL!'), 0); 
    1653           } 
    1654            
    1655           # Time to get things done... 
     1646           
    16561647          $this->setBlog(true); 
    16571648          $tb = new dcTrackback($this->core); 
  • inc/prepend.php

    r1694 r1468  
    220220$core->url->register('xmlrpc','xmlrpc','^xmlrpc/(.+)$',array('dcUrlHandlers','xmlrpc')); 
    221221 
    222 $core->setPostType('post','post.php?id=%d',$core->url->getURLFor('post','%s'),'Posts'); 
     222$core->setPostType('post','post.php?id=%d',$core->url->getURLFor('post','%s')); 
    223223 
    224224# Store upload_max_filesize in bytes 
  • locales/fr/main.po

    r1697 r1678  
    30383038msgstr "Billet précédent" 
    30393039 
    3040 msgid "Introduction to the post." 
    3041 msgstr "Introduction au billet." 
    3042  
    3043 msgid "Unpublished notes." 
    3044 msgstr "Notes non publiées." 
     3040msgid "Add an introduction to the post." 
     3041msgstr "Ajoute une introduction au billet." 
     3042 
     3043msgid "Add unpublished notes." 
     3044msgstr "Ajoute des notes non publiées." 
    30453045 
    30463046msgid "Edit basename:" 
     
    32863286msgstr "Modifier le %1$s de %2$s" 
    32873287 
    3288 msgid "Backup content" 
    3289 msgstr "Sauvegarder le contenu" 
    3290  
    3291 msgid "Create new directory" 
    3292 msgstr "Créer un répertoire" 
    3293  
    3294 msgid "In %s:" 
    3295 msgstr "Dans %s :" 
    3296  
    3297 msgid "Download" 
    3298 msgstr "Télécharger" 
    3299  
    3300 msgid "Compress this directory with its content as a zip file and download it." 
    3301 msgstr "Compressez ce dossier et son contenu dans un fichier zip et téléchargez-le." 
    3302  
    3303 msgid "Permissions:" 
    3304 msgstr "Permissions :" 
    3305  
    3306 msgid "Publications on this blog:" 
    3307 msgstr "Publications sur ce blog :" 
    3308  
    3309 msgid "Posts" 
    3310 msgstr "Billets" 
    3311  
    3312 msgid "%1$s: %2$s" 
    3313 msgstr "%1$s : %2$s" 
     3288msgid "Backup" 
     3289msgstr "Sauvegarde" 
  • locales/fr/plugins.po

    r1694 r1669  
    19871987msgid "Drag widgets here to remove them from this sidebar." 
    19881988msgstr "Glisser les widgets ici pour les retirer du volet." 
    1989  
    1990 msgid "Pages" 
    1991 msgstr "Pages" 
  • plugins/attachments/js/post.js

    r1699 r1606  
    11$(function() { 
    22     $('h5.s-attachments').toggleWithLegend($('.s-attachments').not('h5'),{ 
    3           user_pref: 'dcx_attachments', 
     3          cookie: 'dcx_attachments', 
    44          legend_click: true 
    55     }); 
  • plugins/pages/_prepend.php

    r1694 r1179  
    1717$core->url->register('pagespreview','pagespreview','^pagespreview/(.+)$',array('urlPages','pagespreview')); 
    1818 
    19 $core->setPostType('page','plugin.php?p=pages&act=page&id=%d',$core->url->getURLFor('pages','%s'),'Pages'); 
     19$core->setPostType('page','plugin.php?p=pages&act=page&id=%d',$core->url->getURLFor('pages','%s')); 
    2020 
    2121# We should put this as settings later 
  • plugins/pings/post.js

    r1699 r1606  
    1313          } 
    1414          $('h5.ping-services').toggleWithLegend($('p.ping-services'),{ 
    15                user_pref: 'dcx_ping_services', 
     15               cookie: 'dcx_ping_services', 
    1616               legend_click: true 
    1717          }); 
  • plugins/tags/js/post.js

    r1699 r1606  
    6060 
    6161     $('h5 .s-tags').toggleWithLegend($('.s-tags').not('label'),{ 
    62           user_pref: 'post_tags', 
     62          cookie: 'post_tags', 
    6363          legend_clik: true 
    6464     }); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map