Changeset 1731:e1d588577ead
- Timestamp:
- 09/05/13 14:13:29 (11 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/index.php
r1730 r1731 63 63 $core->auth->user_prefs->dashboard->put('quickentry',false,'boolean'); 64 64 } 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 65 72 66 73 # Dashboard icons … … 121 128 $__dashboard_items = new ArrayObject(array(new ArrayObject,new ArrayObject)); 122 129 123 # Documentation links124 130 $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 }139 131 140 132 if ($core->auth->user_prefs->dashboard->dcnews) { … … 152 144 if ($feed) 153 145 { 154 $latest_news = '<h3>'.__(' Latestnews').'</h3><dl id="news">';146 $latest_news = '<h3>'.__('Dotclear news').'</h3><dl id="news">'; 155 147 $i = 1; 156 148 foreach ($feed->items as $item) 157 149 { 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; 160 152 161 153 if ($i < 3) { … … 180 172 } 181 173 174 # Documentation links 175 if ($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 182 191 $core->callBehavior('adminDashboardItems', $core, $__dashboard_items); 183 192 … … 193 202 dcPage::jsLoad('js/_index.js'). 194 203 # --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) 196 210 ); 197 211 198 echo '<h2>'.html::escapeHTML($core->blog->name).' › <span class="page-title">'.__('Dashboard').'</span></h2>'; 212 # Dotclear updates notifications 213 if ($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 } 199 229 200 230 if ($core->auth->getInfo('user_default_blog') != $core->blog->id && $core->auth->blog_count > 1) { … … 204 234 205 235 if ($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>'; 207 237 } 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>'; 209 239 } 210 240 … … 272 302 echo '</ul></div>'; 273 303 } 274 275 # Dashboard columns (processed first, as we need to know the result before displaying the icons.)276 $dashboardItems = '';277 278 # Dotclear updates notifications279 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 295 304 # Errors modules notifications 296 305 if ($core->auth->isSuperAdmin()) … … 302 311 303 312 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> '. 306 315 '<ul>'.implode("\n",$list).'</ul></div>'; 307 316 } 308 309 } 317 } 318 319 # Dashboard columns (processed first, as we need to know the result before displaying the icons.) 320 $dashboardItems = ''; 310 321 311 322 foreach ($__dashboard_items as $i) … … 313 324 if ($i->count() > 0) 314 325 { 315 $dashboardItems .= '<div >';326 $dashboardItems .= '<div class="db-box">'; 316 327 foreach ($i as $v) { 317 328 $dashboardItems .= $v; … … 322 333 323 334 # Dashboard icons 324 echo '<div id="dashboard-main" '.($dashboardItems ? '' : ' class="fullwidth"').'><div id="icons">';335 echo '<div id="dashboard-main"><div id="icons">'; 325 336 foreach ($__dashboard_icons as $i) 326 337 { … … 335 346 { 336 347 # 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(' ',$categories->level-1).($categories->level-1 == 0 ? '' : '• ').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 350 352 echo 351 353 '<div id="quick">'. 352 354 '<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>'. 356 358 form::field('post_title',20,255,'','maximal'). 357 '</ label></p>'.359 '</p>'. 358 360 '<p class="area"><label class="required" '. 359 361 'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '. 360 362 form::textarea('post_content',50,7). 361 363 '</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>'. 364 366 ($core->auth->check('categories', $core->blog->id) 365 367 ? '<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>'. 367 374 '<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>'.373 375 '</div>' 374 376 : ''). … … 384 386 form::hidden('post_notes',''). 385 387 '</p>'. 386 '</fieldset>'.387 388 '</form>'. 388 389 '</div>'; … … 394 395 if ($i->count() > 0) 395 396 { 396 $dashboardContents .= '<div >';397 $dashboardContents .= '<div class="db-box">'; 397 398 foreach ($i as $v) { 398 399 $dashboardContents .= $v; … … 401 402 } 402 403 } 403 echo ($dashboardContents ? '<div id="dashboard-contents">'.$dashboardContents.'</div>' : ''); 404 405 $class = ' '.(($dashboardItems != '') && ($dashboardContents != '') ? 'two-db' : 'one-db'); 406 407 if ($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 } 404 415 405 416 echo '</div>'; 406 407 echo ($dashboardItems ? '<div id="dashboard-items">'.$dashboardItems.'</div>' : '');408 417 409 418 dcPage::close();
Note: See TracChangeset
for help on using the changeset viewer.