Dotclear

Changeset 1731:e1d588577ead


Ignore:
Timestamp:
09/05/13 14:13:29 (11 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Children:
1733:34d6ea6a495a, 1737:8c9305c14ab4
Parents:
1729:19daad6a1d74 (diff), 1730:2595b5e176dd (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.
Message:

Merge 2.5 commits into default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/index.php

    r1730 r1731  
    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'); 
     68if (!$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 
    6572 
    6673# Dashboard icons 
     
    121128$__dashboard_items = new ArrayObject(array(new ArrayObject,new ArrayObject)); 
    122129 
    123 # Documentation links 
    124130$dashboardItem = 0; 
    125 if ($core->auth->user_prefs->dashboard->doclinks) { 
    126      if (!empty($__resources['doc'])) 
    127      { 
    128           $doc_links = '<h3>'.__('Documentation and support').'</h3><ul>'; 
    129       
    130           foreach ($__resources['doc'] as $k => $v) { 
    131                $doc_links .= '<li><a href="'.$v.'" title="'.$k.' '.__('(external link)').'">'.$k.'</a></li>'; 
    132           } 
    133       
    134           $doc_links .= '</ul>'; 
    135           $__dashboard_items[$dashboardItem][] = $doc_links; 
    136           $dashboardItem++; 
    137      } 
    138 } 
    139131 
    140132if ($core->auth->user_prefs->dashboard->dcnews) { 
     
    152144          if ($feed) 
    153145          { 
    154                $latest_news = '<h3>'.__('Latest news').'</h3><dl id="news">'; 
     146               $latest_news = '<h3>'.__('Dotclear news').'</h3><dl id="news">'; 
    155147               $i = 1; 
    156148               foreach ($feed->items as $item) 
    157149               { 
    158                     $dt = isset($item->link) ? '<a href="'.$item->link.'" title="'.$item->title.' '.__('(external link)').'">'. 
    159                          $item->title.'</a>' : $item->title; 
     150                    $dt = isset($item->link) ? '<a href="'.$item->link.'" title="'.$item->title.' ('.__('new window').')">'. 
     151                         $item->title.' <img src="images/outgoing-blue.png" alt="" /></a>' : $item->title; 
    160152                
    161153                    if ($i < 3) { 
     
    180172} 
    181173 
     174# Documentation links 
     175if ($core->auth->user_prefs->dashboard->doclinks) { 
     176     if (!empty($__resources['doc'])) 
     177     { 
     178          $doc_links = '<h3>'.__('Documentation and support').'</h3><ul>'; 
     179      
     180          foreach ($__resources['doc'] as $k => $v) { 
     181               $doc_links .= '<li><a href="'.$v.'" title="'.$k.' ('.__('new window').')">'.$k. 
     182               ' <img src="images/outgoing-blue.png" alt="" /></a></li>'; 
     183          } 
     184      
     185          $doc_links .= '</ul>'; 
     186          $__dashboard_items[$dashboardItem][] = $doc_links; 
     187          $dashboardItem++; 
     188     } 
     189} 
     190 
    182191$core->callBehavior('adminDashboardItems', $core, $__dashboard_items); 
    183192 
     
    193202     dcPage::jsLoad('js/_index.js'). 
    194203     # --BEHAVIOR-- adminDashboardHeaders 
    195      $core->callBehavior('adminDashboardHeaders') 
     204     $core->callBehavior('adminDashboardHeaders'), 
     205     dcPage::breadcrumb( 
     206          array( 
     207          '<span class="page-title">'.__('Dashboard').' : '.html::escapeHTML($core->blog->name).'</span>' => '' 
     208          ), 
     209          false) 
    196210); 
    197211 
    198 echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Dashboard').'</span></h2>'; 
     212# Dotclear updates notifications 
     213if ($core->auth->isSuperAdmin() && is_readable(DC_DIGESTS)) 
     214{ 
     215     $updater = new dcUpdate(DC_UPDATE_URL,'dotclear',DC_UPDATE_VERSION,DC_TPL_CACHE.'/versions'); 
     216     $new_v = $updater->check(DC_VERSION); 
     217     $version_info = $new_v ? $updater->getInfoURL() : ''; 
     218 
     219     if ($updater->getNotify() && $new_v) { 
     220          echo 
     221          '<div class="dc-update"><h3>'.sprintf(__('Dotclear %s is available!'),$new_v).'</h3> '. 
     222          '<p><a class="button submit" href="update.php">'.sprintf(__('Upgrade now'),$new_v).'</a> '. 
     223          '<a href="update.php?hide_msg=1">'.__('Remind me later').'</a>'. 
     224          ($version_info ? ' </p>'. 
     225          '<p><a href="'.$version_info.'" class="info">'.__('information about this version').'</a>' : '').'</p>'. 
     226          '</div>'; 
     227     } 
     228} 
    199229 
    200230if ($core->auth->getInfo('user_default_blog') != $core->blog->id && $core->auth->blog_count > 1) { 
     
    204234 
    205235if ($core->blog->status == 0) { 
    206      echo '<p class="static-msg">'.__('This blog is offline').'</p>'; 
     236     echo '<p class="static-msg">'.__('This blog is offline').'.</p>'; 
    207237} elseif ($core->blog->status == -1) { 
    208      echo '<p class="static-msg">'.__('This blog is removed').'</p>'; 
     238     echo '<p class="static-msg">'.__('This blog is removed').'.</p>'; 
    209239} 
    210240 
     
    272302     echo '</ul></div>'; 
    273303} 
    274  
    275 # Dashboard columns (processed first, as we need to know the result before displaying the icons.) 
    276 $dashboardItems = ''; 
    277  
    278 # Dotclear updates notifications 
    279 if ($core->auth->isSuperAdmin() && is_readable(DC_DIGESTS)) 
    280 { 
    281      $updater = new dcUpdate(DC_UPDATE_URL,'dotclear',DC_UPDATE_VERSION,DC_TPL_CACHE.'/versions'); 
    282      $new_v = $updater->check(DC_VERSION); 
    283      $version_info = $new_v ? $updater->getInfoURL() : ''; 
    284       
    285      if ($updater->getNotify() && $new_v) { 
    286           $dashboardItems .= 
    287           '<div id="upg-notify" class="static-msg"><p>'.sprintf(__('Dotclear %s is available!'),$new_v).'</p> '. 
    288           '<ul><li><strong><a href="update.php">'.sprintf(__('Upgrade now'),$new_v).'</a></strong>'. 
    289           '</li><li><a href="update.php?hide_msg=1">'.__('Remind me later').'</a>'. 
    290           ($version_info ? ' </li><li>'.sprintf(__('<a href="%s">Information about this version</a>.'),$version_info) : ''). 
    291           '</li></ul></div>'; 
    292      } 
    293 } 
    294  
    295304# Errors modules notifications 
    296305if ($core->auth->isSuperAdmin()) 
     
    302311      
    303312     if (count($list) > 0) { 
    304           $dashboardItems .= 
    305           '<div id="module-errors" class="error"><p>'.__('Some plugins are installed twice:').'</p> '. 
     313          echo  
     314          '<div class="error" id="module-errors" class="error"><p>'.__('Some plugins are installed twice:').'</p> '. 
    306315          '<ul>'.implode("\n",$list).'</ul></div>'; 
    307316     } 
    308       
    309 } 
     317} 
     318 
     319# Dashboard columns (processed first, as we need to know the result before displaying the icons.) 
     320$dashboardItems = ''; 
    310321 
    311322foreach ($__dashboard_items as $i) 
     
    313324     if ($i->count() > 0) 
    314325     { 
    315           $dashboardItems .= '<div>'; 
     326          $dashboardItems .= '<div class="db-box">'; 
    316327          foreach ($i as $v) { 
    317328               $dashboardItems .= $v; 
     
    322333 
    323334# Dashboard icons 
    324 echo '<div id="dashboard-main"'.($dashboardItems ? '' : ' class="fullwidth"').'><div id="icons">'; 
     335echo '<div id="dashboard-main"><div id="icons">'; 
    325336foreach ($__dashboard_icons as $i) 
    326337{ 
     
    335346     { 
    336347          # Getting categories 
    337           $categories_combo = array(__('(No cat)') => ''); 
    338           try { 
    339                $categories = $core->blog->getCategories(array('post_type'=>'post')); 
    340                if (!$categories->isEmpty()) { 
    341                     while ($categories->fetch()) { 
    342                          $catparents_combo[] = $categories_combo[] = new formSelectOption( 
    343                               str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title), 
    344                               $categories->cat_id 
    345                          ); 
    346                     } 
    347                } 
    348           } catch (Exception $e) { } 
    349            
     348          $categories_combo = dcAdminCombos::getCategoriesCombo( 
     349               $core->blog->getCategories(array('post_type'=>'post')) 
     350          ); 
     351      
    350352          echo 
    351353          '<div id="quick">'. 
    352354          '<h3>'.__('Quick entry').'</h3>'. 
    353           '<form id="quick-entry" action="post.php" method="post">'. 
    354           '<fieldset><legend>'.__('New entry').'</legend>'. 
    355           '<p class="col"><label for="post_title" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:'). 
     355          '<form id="quick-entry" action="post.php" method="post" class="fieldset">'. 
     356          '<h4>'.__('New entry').'</h4>'. 
     357          '<p class="col"><label for="post_title" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label>'. 
    356358          form::field('post_title',20,255,'','maximal'). 
    357           '</label></p>'. 
     359          '</p>'. 
    358360          '<p class="area"><label class="required" '. 
    359361          'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '. 
    360362          form::textarea('post_content',50,7). 
    361363          '</p>'. 
    362           '<p><label for="cat_id" class="classic">'.__('Category:').' '. 
    363           form::combo('cat_id',$categories_combo).'</label></p>'. 
     364          '<p><label for="cat_id" class="classic">'.__('Category:').'</label> '. 
     365          form::combo('cat_id',$categories_combo).'</p>'. 
    364366          ($core->auth->check('categories', $core->blog->id) 
    365367               ? '<div>'. 
    366                '<p id="new_cat">'.__('Add a new category').'</p>'. 
     368               '<p id="new_cat" class="q-cat">'.__('Add a new category').'</p>'. 
     369               '<p class="q-cat"><label for="new_cat_title">'.__('Title:').'</label> '. 
     370               form::field('new_cat_title',30,255,'','').'</p>'. 
     371               '<p class="q-cat"><label for="new_cat_parent">'.__('Parent:').'</label> '. 
     372               form::combo('new_cat_parent',$categories_combo,'',''). 
     373               '</p>'. 
    367374               '<p class="form-note info clear">'.__('This category will be created when you will save your post.').'</p>'. 
    368                '<p><label for="new_cat_title">'.__('Title:').' '. 
    369                form::field('new_cat_title',30,255,'','maximal').'</label></p>'. 
    370                '<p><label for="new_cat_parent">'.__('Parent:').' '. 
    371                form::combo('new_cat_parent',$categories_combo,'','maximal'). 
    372                '</label></p>'. 
    373375               '</div>' 
    374376               : ''). 
     
    384386          form::hidden('post_notes',''). 
    385387          '</p>'. 
    386           '</fieldset>'. 
    387388          '</form>'. 
    388389          '</div>'; 
     
    394395     if ($i->count() > 0) 
    395396     { 
    396           $dashboardContents .= '<div>'; 
     397          $dashboardContents .= '<div class="db-box">'; 
    397398          foreach ($i as $v) { 
    398399               $dashboardContents .= $v; 
     
    401402     } 
    402403} 
    403 echo ($dashboardContents ? '<div id="dashboard-contents">'.$dashboardContents.'</div>' : ''); 
     404 
     405$class = ' '.(($dashboardItems != '') && ($dashboardContents != '') ? 'two-db' : 'one-db'); 
     406 
     407if ($dashboardContents != '' || $dashboardItems != '') { 
     408     echo  
     409     '<div id="dashboard-widgets">'; 
     410          echo ($dashboardContents ? '<div class="db-contents'.$class.'">'.$dashboardContents.'</div>' : ''); 
     411          echo ($dashboardItems ? '<div class="db-items'.$class.'">'.$dashboardItems.'</div>' : ''); 
     412     echo 
     413     '</div>';       
     414} 
    404415 
    405416echo '</div>'; 
    406  
    407 echo ($dashboardItems ? '<div id="dashboard-items">'.$dashboardItems.'</div>' : ''); 
    408417 
    409418dcPage::close(); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map