Changeset 2468:d7fda5a0bd39 for admin
- Timestamp:
- 10/21/13 09:08:36 (12 years ago)
- Branch:
- twig
- Children:
- 2593:6741802596a0, 2609:c26642f775e2
- Parents:
- 2321:3ab5e6c3d301 (diff), 2466:e42d3233f080 (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:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/index.php
r2313 r2468 4 4 # This file is part of Dotclear 2. 5 5 # 6 # Copyright (c) 2003-201 1Olivier Meunier & Association Dotclear6 # Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or -
admin/index.php
r2358 r2468 15 15 exit; 16 16 } 17 if (!empty($_GET['tf'])) { 18 define('DC_CONTEXT_ADMIN',true); 19 require dirname(__FILE__).'/../inc/load_theme_file.php'; 20 exit; 21 } 17 22 18 23 require dirname(__FILE__).'/../inc/admin/prepend.php'; … … 43 48 $plugins_install = $core->plugins->installModules(); 44 49 50 # Send plugins install messages to templates 51 if (!empty($plugins_install['success'])) { 52 $_ctx->addMessagesList(__('Following plugins have been installed:'),$plugins_install['success']); 53 } 54 if (!empty($plugins_install['failure'])) { 55 $_ctx->addMessagesList(__('Following plugins have not been installed:'),$plugins_install['failure']); 56 } 57 58 # Send plugins errors messages to templates 59 $_ctx->modules_errors = $core->auth->isSuperAdmin() ? $core->plugins->getErrors() : array(); 60 61 # Send Dotclear updates notifications to tempaltes 62 $_ctx->updater = array(); 63 if ($core->auth->isSuperAdmin() && is_readable(DC_DIGESTS)) { 64 65 $updater = new dcUpdate(DC_UPDATE_URL,'dotclear',DC_UPDATE_VERSION,DC_TPL_CACHE.'/versions'); 66 $new_v = $updater->check(DC_VERSION); 67 $version_info = $new_v ? $updater->getInfoURL() : ''; 68 69 if ($updater->getNotify() && $new_v) { 70 $_ctx->updater = array( 71 'new_version' => $new_v, 72 'version_info' => $version_info 73 ); 74 } 75 } 76 45 77 # Check dashboard module prefs 46 78 $ws = $core->auth->user_prefs->addWorkspace('dashboard'); 79 80 # Doclinks prefs 47 81 if (!$core->auth->user_prefs->dashboard->prefExists('doclinks')) { 48 82 if (!$core->auth->user_prefs->dashboard->prefExists('doclinks',true)) { … … 51 85 $core->auth->user_prefs->dashboard->put('doclinks',true,'boolean'); 52 86 } 87 88 # Send doclinks to templates 89 $_ctx->dashboard_doclinks = array(); 90 if ($core->auth->user_prefs->dashboard->doclinks && !empty($__resources['doc'])) { 91 $_ctx->dashboard_doclinks = $__resources['doc']; 92 } 93 94 # Dcnews prefs 53 95 if (!$core->auth->user_prefs->dashboard->prefExists('dcnews')) { 54 96 if (!$core->auth->user_prefs->dashboard->prefExists('dcnews',true)) { … … 57 99 $core->auth->user_prefs->dashboard->put('dcnews',true,'boolean'); 58 100 } 59 if (!$core->auth->user_prefs->dashboard->prefExists('quickentry')) { 60 if (!$core->auth->user_prefs->dashboard->prefExists('quickentry',true)) { 61 $core->auth->user_prefs->dashboard->put('quickentry',false,'boolean','',null,true); 62 } 63 $core->auth->user_prefs->dashboard->put('quickentry',false,'boolean'); 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 72 73 # Dashboard icons 74 $__dashboard_icons = new ArrayObject(); 75 76 $favs = $core->favs->getUserFavorites(); 77 $core->favs->appendDashboardIcons($__dashboard_icons); 78 79 # Check plugins and themes update from repository 80 function dc_check_store_update($mod, $url, $img, $icon) 81 { 82 $repo = new dcStore($mod, $url); 83 $upd = $repo->get(true); 84 if (!empty($upd)) { 85 $icon[0] .= '<br />'.sprintf(__('An update is available', '%s updates are available.', count($upd)),count($upd)); 86 $icon[1] .= '#update'; 87 $icon[2] = 'images/menu/'.$img.'-b-update.png'; 88 } 89 } 90 if (isset($__dashboard_icons['plugins'])) { 91 dc_check_store_update($core->plugins, $core->blog->settings->system->store_plugin_url, 'plugins', $__dashboard_icons['plugins']); 92 } 93 if (isset($__dashboard_icons['blog_theme'])) { 94 $themes = new dcThemes($core); 95 $themes->loadModules($core->blog->themes_path, null); 96 dc_check_store_update($themes, $core->blog->settings->system->store_theme_url, 'blog-theme', $__dashboard_icons['blog_theme']); 97 } 98 99 # Latest news for dashboard 100 $__dashboard_items = new ArrayObject(array(new ArrayObject(),new ArrayObject())); 101 102 $dashboardItem = 0; 103 104 if ($core->auth->user_prefs->dashboard->dcnews) { 101 102 # Send dcnews to templates 103 $_ctx->dashboard_dcnews = array(); 104 if ($core->auth->user_prefs->dashboard->dcnews && !empty($__resources['rss_news'])) { 105 105 try 106 106 { 107 if (empty($__resources['rss_news'])) {108 throw new Exception();109 }110 111 107 $feed_reader = new feedReader; 112 108 $feed_reader->setCacheDir(DC_TPL_CACHE); … … 114 110 $feed_reader->setUserAgent('Dotclear - http://www.dotclear.org/'); 115 111 $feed = $feed_reader->parse($__resources['rss_news']); 116 if ($feed) 117 { 118 $latest_news = '<div class="box medium dc-box"><h3>'.__('Dotclear news').'</h3><dl id="news">'; 112 if ($feed) { 113 $items = array(); 119 114 $i = 1; 120 foreach ($feed->items as $item) 121 { 122 $dt = isset($item->link) ? '<a href="'.$item->link.'" class="outgoing" title="'.$item->title.'">'. 123 $item->title.' <img src="images/outgoing-blue.png" alt="" /></a>' : $item->title; 124 125 if ($i < 3) { 126 $latest_news .= 127 '<dt>'.$dt.'</dt>'. 128 '<dd><p><strong>'.dt::dt2str(__('%d %B %Y:'),$item->pubdate,'Europe/Paris').'</strong> '. 129 '<em>'.text::cutString(html::clean($item->content),120).'...</em></p></dd>'; 130 } else { 131 $latest_news .= 132 '<dt>'.$dt.'</dt>'. 133 '<dd>'.dt::dt2str(__('%d %B %Y:'),$item->pubdate,'Europe/Paris').'</dd>'; 134 } 115 foreach ($feed->items as $item) { 116 $items[] = array( 117 'title' => $item->title, 118 'link' => isset($item->link) ? $item->link : '', 119 'date' => dt::dt2str(__('%d %B %Y'),$item->pubdate,'Europe/Paris'), 120 'content' => html::clean($item->content) 121 ); 135 122 $i++; 136 if ($i > 2) { break; }123 if ($i > 3) { break; } 137 124 } 138 $latest_news .= '</dl></div>'; 139 $__dashboard_items[$dashboardItem][] = $latest_news; 140 $dashboardItem++; 125 $_ctx->dashboard_dcnews = $items; 141 126 } 142 127 } … … 144 129 } 145 130 146 # Documentation links 147 if ($core->auth->user_prefs->dashboard->doclinks) { 148 if (!empty($__resources['doc'])) 149 { 150 $doc_links = '<div class="box small dc-box"><h3>'.__('Documentation and support').'</h3><ul>'; 131 # Quick entry prefs 132 if (!$core->auth->user_prefs->dashboard->prefExists('quickentry')) { 133 if (!$core->auth->user_prefs->dashboard->prefExists('quickentry',true)) { 134 $core->auth->user_prefs->dashboard->put('quickentry',true,'boolean','',null,true); 135 } 136 $core->auth->user_prefs->dashboard->put('quickentry',true,'boolean'); 137 } 138 139 # Send quick entry to templates 140 $_ctx->dashboard_quickentry = false; 141 if ($core->auth->user_prefs->dashboard->quickentry &&$core->auth->check('usage,contentadmin',$core->blog->id)) 142 { 143 $categories_combo = array(' ' => ''); 144 try { 145 $categories = $core->blog->getCategories(array('post_type'=>'post')); 146 while ($categories->fetch()) { 147 $categories_combo[$categories->cat_id] = 148 str_repeat(' ',$categories->level-1). 149 ($categories->level-1 == 0 ? '' : '• '). 150 html::escapeHTML($categories->cat_title); 151 } 152 } catch (Exception $e) { } 151 153 152 foreach ($__resources['doc'] as $k => $v) { 153 $doc_links .= '<li><a class="outgoing" href="'.$v.'" title="'.$k.'">'.$k. 154 ' <img src="images/outgoing-blue.png" alt="" /></a></li>'; 155 } 154 $form = new dcForm($core,array('quickentry','quick-entry'),'post.php'); 155 $form 156 ->addField( 157 new dcFieldText('post_title','', array( 158 'size' => 20, 159 'required' => true, 160 'label' => __('Title')))) 161 ->addField( 162 new dcFieldTextArea('post_content','', array( 163 'required' => true, 164 'label' => __("Content:")))) 165 ->addField( 166 new dcFieldCombo('cat_id','',$categories_combo,array( 167 "label" => __('Category:')))) 168 ->addField( 169 new dcFieldSubmit('save',__('Save'),array( 170 'action' => 'savePost'))) 171 ->addField( 172 new dcFieldHidden ('post_status',-2)) 173 ->addField( 174 new dcFieldHidden ('post_format',$core->auth->getOption('post_format'))) 175 ->addField( 176 new dcFieldHidden ('post_excerpt','')) 177 ->addField( 178 new dcFieldHidden ('post_lang',$core->auth->getInfo('user_lang'))) 179 ->addField( 180 new dcFieldHidden ('post_notes','')) 181 ; 182 if ($core->auth->check('publish',$core->blog->id)) { 183 $form->addField( 184 new dcFieldHidden ('save-publish',__('Save and publish'))); 185 } 156 186 157 $doc_links .= '</ul></div>'; 158 $__dashboard_items[$dashboardItem][] = $doc_links; 159 $dashboardItem++; 160 } 161 } 162 187 $_ctx->dashboard_quickentry = true; 188 } 189 190 # Dashboard icons 191 $__dashboard_icons = new ArrayObject(); 192 193 # Dashboard favorites 194 $post_count = $core->blog->getPosts(array(),true)->f(0); 195 $str_entries = ($post_count > 1) ? __('%d entries') : __('%d entry'); 196 197 $comment_count = $core->blog->getComments(array(),true)->f(0); 198 $str_comments = ($comment_count > 1) ? __('%d comments') : __('%d comment'); 199 200 $ws = $core->auth->user_prefs->addWorkspace('favorites'); 201 $count = 0; 202 foreach ($ws->dumpPrefs() as $k => $v) { 203 // User favorites only 204 if (!$v['global']) { 205 $fav = unserialize($v['value']); 206 if (($fav['permissions'] == '*') || $core->auth->check($fav['permissions'],$core->blog->id)) { 207 if (dc_valid_fav($fav['url'])) { 208 $count++; 209 $title = ($fav['name'] == 'posts' ? sprintf($str_entries,$post_count) : 210 ($fav['name'] == 'comments' ? sprintf($str_comments,$comment_count) : $fav['title'])); 211 $__dashboard_icons[$fav['name']] = new ArrayObject(array(__($title),$fav['url'],$fav['large-icon'])); 212 213 # Let plugins set their own title for favorite on dashboard 214 $core->callBehavior('adminDashboardFavsIcon',$core,$fav['name'],$__dashboard_icons[$fav['name']]); 215 } 216 } 217 } 218 } 219 if (!$count) { 220 // Global favorites if any 221 foreach ($ws->dumpPrefs() as $k => $v) { 222 $fav = unserialize($v['value']); 223 if (($fav['permissions'] == '*') || $core->auth->check($fav['permissions'],$core->blog->id)) { 224 if (dc_valid_fav($fav['url'])) { 225 $count++; 226 $title = ($fav['name'] == 'posts' ? sprintf($str_entries,$post_count) : 227 ($fav['name'] == 'comments' ? sprintf($str_comments,$comment_count) : $fav['title'])); 228 $__dashboard_icons[$fav['name']] = new ArrayObject(array(__($title),$fav['url'],$fav['large-icon'])); 229 230 # Let plugins set their own title for favorite on dashboard 231 $core->callBehavior('adminDashboardFavsIcon',$core,$fav['name'],$__dashboard_icons[$fav['name']]); 232 } 233 } 234 } 235 } 236 if (!$count) { 237 // No user or global favorites, add "user pref" and "new entry" fav 238 if ($core->auth->check('usage,contentadmin',$core->blog->id)) { 239 $__dashboard_icons['new_post'] = new ArrayObject(array(__('New entry'),'post.php','images/menu/edit-b.png')); 240 } 241 $__dashboard_icons['prefs'] = new ArrayObject(array(__('My preferences'),'preferences.php','images/menu/user-pref-b.png')); 242 } 243 244 # Send dashboard icons to templates 245 $icons = array(); 246 foreach ($__dashboard_icons as $i) { 247 $icons[] = array( 248 'title' => $i[0], 249 'url' => $i[1], 250 'img' => dc_admin_icon_url($i[2]) 251 ); 252 } 253 $_ctx->dashboard_icons = $icons; 254 255 # Dashboard items 256 $__dashboard_items = new ArrayObject(array(new ArrayObject,new ArrayObject)); 163 257 $core->callBehavior('adminDashboardItems', $core, $__dashboard_items); 164 258 259 # Send dashboard items to templates 260 $items = array(); 261 foreach ($__dashboard_items as $i) { 262 if ($i->count() > 0) { 263 foreach ($i as $v) { 264 $items[] = $v; 265 } 266 } 267 } 268 $_ctx->dashboard_items = $items; 269 165 270 # Dashboard content 166 $dashboardContents = '';167 271 $__dashboard_contents = new ArrayObject(array(new ArrayObject,new ArrayObject)); 168 272 $core->callBehavior('adminDashboardContents', $core, $__dashboard_contents); 169 273 170 /* DISPLAY 171 -------------------------------------------------------- */ 172 dcPage::open(__('Dashboard'), 173 dcPage::jsToolBar(). 174 dcPage::jsLoad('js/_index.js'). 175 # --BEHAVIOR-- adminDashboardHeaders 176 $core->callBehavior('adminDashboardHeaders'), 177 dcPage::breadcrumb( 178 array( 179 __('Dashboard').' : '.html::escapeHTML($core->blog->name) => '' 180 ), 181 array('home_link' =>false) 182 ) 183 ); 184 185 # Dotclear updates notifications 186 if ($core->auth->isSuperAdmin() && is_readable(DC_DIGESTS)) 187 { 188 $updater = new dcUpdate(DC_UPDATE_URL,'dotclear',DC_UPDATE_VERSION,DC_TPL_CACHE.'/versions'); 189 $new_v = $updater->check(DC_VERSION); 190 $version_info = $new_v ? $updater->getInfoURL() : ''; 191 192 if ($updater->getNotify() && $new_v) { 193 echo 194 '<div class="dc-update"><h3>'.sprintf(__('Dotclear %s is available!'),$new_v).'</h3> '. 195 '<p><a class="button submit" href="update.php">'.sprintf(__('Upgrade now'),$new_v).'</a> '. 196 '<a class="button" href="update.php?hide_msg=1">'.__('Remind me later').'</a>'. 197 ($version_info ? ' </p>'. 198 '<p class="updt-info"><a href="'.$version_info.'">'.__('Information about this version').'</a>' : '').'</p>'. 199 '</div>'; 200 } 201 } 202 203 if ($core->auth->getInfo('user_default_blog') != $core->blog->id && $core->auth->getBlogCount() > 1) { 204 echo 205 '<p><a href="index.php?default_blog=1" class="button">'.__('Make this blog my default blog').'</a></p>'; 206 } 207 274 # Send dashboard contents to templates 275 $contents = array(); 276 foreach ($__dashboard_contents as $i) { 277 if ($i->count() > 0) { 278 foreach ($i as $v) { 279 $contents[] = $v; 280 } 281 } 282 } 283 $_ctx->dashboard_contents = $contents; 284 285 # Blog status message 208 286 if ($core->blog->status == 0) { 209 echo '<p class="static-msg">'.__('This blog is offline').'.</p>';287 $_ctx->addMessageStatic(__('This blog is offline')); 210 288 } elseif ($core->blog->status == -1) { 211 echo '<p class="static-msg">'.__('This blog is removed').'.</p>'; 212 } 213 289 $_ctx->addMessageStatic(__('This blog is removed')); 290 } 291 292 # Config errors messages 214 293 if (!defined('DC_ADMIN_URL') || !DC_ADMIN_URL) { 215 echo 216 '<p class="static-msg">'. 217 sprintf(__('%s is not defined, you should edit your configuration file.'),'DC_ADMIN_URL'). 218 ' '.__('See <a href="http://dotclear.org/documentation/2.0/admin/config">documentation</a> for more information.'). 219 '</p>'; 220 } 221 294 $_ctx->addMessageStatic( 295 sprintf(__('%s is not defined, you should edit your configuration file.'),'DC_ADMIN_URL').' '. 296 __('See <a href="http://dotclear.org/documentation/2.0/admin/config">documentation</a> for more information.') 297 ); 298 } 222 299 if (!defined('DC_ADMIN_MAILFROM') || !DC_ADMIN_MAILFROM) { 223 echo 224 '<p class="static-msg">'. 225 sprintf(__('%s is not defined, you should edit your configuration file.'),'DC_ADMIN_MAILFROM'). 226 ' '.__('See <a href="http://dotclear.org/documentation/2.0/admin/config">documentation</a> for more information.'). 227 '</p>'; 228 } 229 230 $err = array(); 231 232 # Check cache directory 233 if ( $core->auth->isSuperAdmin() ) { 234 if (!is_dir(DC_TPL_CACHE) || !is_writable(DC_TPL_CACHE)) { 235 $err[] = '<p>'.__("The cache directory does not exist or is not writable. You must create this directory with sufficient rights and affect this location to \"DC_TPL_CACHE\" in inc/config.php file.").'</p>'; 236 } 237 } else { 238 if (!is_dir(DC_TPL_CACHE) || !is_writable(DC_TPL_CACHE)) { 239 $err[] = '<p>'.__("The cache directory does not exist or is not writable. You should contact your administrator.").'</p>'; 240 } 241 } 242 243 # Check public directory 244 if ( $core->auth->isSuperAdmin() ) { 245 if (!is_dir($core->blog->public_path) || !is_writable($core->blog->public_path)) { 246 $err[] = '<p>'.__("There is no writable directory /public/ at the location set in about:config \"public_path\". You must create this directory with sufficient rights (or change this setting).").'</p>'; 247 } 248 } else { 249 if (!is_dir($core->blog->public_path) || !is_writable($core->blog->public_path)) { 250 $err[] = '<p>'.__("There is no writable root directory for the media manager. You should contact your administrator.").'</p>'; 251 } 252 } 253 254 # Error list 255 if (count($err) > 0) { 256 echo '<div class="error"><p><strong>Erreur :</strong></p>'. 257 '<ul><li>'.implode("</li><li>",$err).'</li></ul></div>'; 258 } 259 260 # Plugins install messages 261 if (!empty($plugins_install['success'])) 262 { 263 echo '<div class="success">'.__('Following plugins have been installed:').'<ul>'; 264 foreach ($plugins_install['success'] as $k => $v) { 265 echo '<li>'.$k.'</li>'; 266 } 267 echo '</ul></div>'; 268 } 269 if (!empty($plugins_install['failure'])) 270 { 271 echo '<div class="error">'.__('Following plugins have not been installed:').'<ul>'; 272 foreach ($plugins_install['failure'] as $k => $v) { 273 echo '<li>'.$k.' ('.$v.')</li>'; 274 } 275 echo '</ul></div>'; 276 } 277 # Errors modules notifications 278 if ($core->auth->isSuperAdmin()) 279 { 280 $list = $core->plugins->getErrors(); 281 if (!empty($list)) { 282 echo 283 '<div class="error" id="module-errors" class="error"><p>'.__('Errors have occured with following plugins:').'</p> '. 284 '<ul><li>'.implode("</li>\n<li>", $list).'</li></ul></div>'; 285 } 286 } 287 288 # Dashboard columns (processed first, as we need to know the result before displaying the icons.) 289 $dashboardItems = ''; 290 291 foreach ($__dashboard_items as $i) 292 { 293 if ($i->count() > 0) 294 { 295 $dashboardItems .= ''; 296 foreach ($i as $v) { 297 $dashboardItems .= $v; 298 } 299 $dashboardItems .= ''; 300 } 301 } 302 303 # Dashboard elements 304 echo '<div id="dashboard-main">'; 305 306 # Dashboard icons 307 echo '<div id="icons">'; 308 foreach ($__dashboard_icons as $i) 309 { 310 echo 311 '<p><a href="'.$i[1].'"><img src="'.dc_admin_icon_url($i[2]).'" alt="" />'. 312 '<br /><span>'.$i[0].'</span></a></p>'; 313 } 314 echo '</div>'; 315 316 if ($core->auth->user_prefs->dashboard->quickentry) { 317 if ($core->auth->check('usage,contentadmin',$core->blog->id)) 318 { 319 # Getting categories 320 $categories_combo = dcAdminCombos::getCategoriesCombo( 321 $core->blog->getCategories(array('post_type'=>'post')) 322 ); 323 324 echo 325 '<div id="quick">'. 326 '<h3>'.__('Quick entry').'</h3>'. 327 '<form id="quick-entry" action="post.php" method="post" class="fieldset">'. 328 '<h4>'.__('New entry').'</h4>'. 329 '<p class="col"><label for="post_title" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label>'. 330 form::field('post_title',20,255,'','maximal'). 331 '</p>'. 332 '<p class="area"><label class="required" '. 333 'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '. 334 form::textarea('post_content',50,10). 335 '</p>'. 336 '<p><label for="cat_id" class="classic">'.__('Category:').'</label> '. 337 form::combo('cat_id',$categories_combo).'</p>'. 338 ($core->auth->check('categories', $core->blog->id) 339 ? '<div>'. 340 '<p id="new_cat" class="q-cat">'.__('Add a new category').'</p>'. 341 '<p class="q-cat"><label for="new_cat_title">'.__('Title:').'</label> '. 342 form::field('new_cat_title',30,255,'','').'</p>'. 343 '<p class="q-cat"><label for="new_cat_parent">'.__('Parent:').'</label> '. 344 form::combo('new_cat_parent',$categories_combo,'',''). 345 '</p>'. 346 '<p class="form-note info clear">'.__('This category will be created when you will save your post.').'</p>'. 347 '</div>' 348 : ''). 349 '<p><input type="submit" value="'.__('Save').'" name="save" /> '. 350 ($core->auth->check('publish',$core->blog->id) 351 ? '<input type="hidden" value="'.__('Save and publish').'" name="save-publish" />' 352 : ''). 353 $core->formNonce(). 354 form::hidden('post_status',-2). 355 form::hidden('post_format',$core->auth->getOption('post_format')). 356 form::hidden('post_excerpt',''). 357 form::hidden('post_lang',$core->auth->getInfo('user_lang')). 358 form::hidden('post_notes',''). 359 '</p>'. 360 '</form>'. 361 '</div>'; 362 } 363 } 364 365 foreach ($__dashboard_contents as $i) 366 { 367 if ($i->count() > 0) 368 { 369 $dashboardContents .= ''; 370 foreach ($i as $v) { 371 $dashboardContents .= $v; 372 } 373 $dashboardContents .= ''; 374 } 375 } 376 377 if ($dashboardContents != '' || $dashboardItems != '') { 378 echo 379 '<div id="dashboard-boxes">'. 380 '<div class="db-items">'.$dashboardItems.$dashboardContents.'</div>'. 381 '</div>'; 382 } 383 384 echo '</div>'; #end dashboard-main 385 dcPage::helpBlock('core_dashboard'); 386 dcPage::close(); 300 $_ctx->addMessageStatic( 301 sprintf(__('%s is not defined, you should edit your configuration file.'),'DC_ADMIN_MAILFROM').' '. 302 __('See <a href="http://dotclear.org/documentation/2.0/admin/config">documentation</a> for more information.') 303 ); 304 } 305 306 $_ctx->setBreadCrumb(__('Dashboard').' : '.html::escapeHTML($core->blog->name), false); 307 $core->tpl->display('index.html.twig'); 387 308 ?> -
admin/post.php
r2313 r2468 4 4 # This file is part of Dotclear 2. 5 5 # 6 # Copyright (c) 2003-201 1Olivier Meunier & Association Dotclear6 # Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or -
admin/post.php
r2390 r2468 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 class PostActions 18 { 19 public static function savePost($form) { 20 global $_ctx, $core; 21 if (!$form->can_edit_post) { 22 return; 23 } 24 try { 25 $form->check($_ctx); 26 $form->cat_id = (integer) $form->cat_id; 27 28 if (!empty($form->post_dt)) { 29 try 30 { 31 $post_dt = strtotime($form->post_dt); 32 if ($post_dt == false || $post_dt == -1) { 33 $bad_dt = true; 34 throw new Exception(__('Invalid publication date')); 35 } 36 $form->post_dt = date('Y-m-d H:i',$post_dt); 37 } 38 catch (Exception $e) 39 { 40 $core->error->add($e->getMessage()); 41 } 42 } 43 $post_excerpt = $form->post_excerpt; 44 $post_content = $form->post_content; 45 $post_excerpt_xhtml = ''; 46 $post_content_xhtml = ''; 47 $core->blog->setPostContent( 48 $form->id,$form->post_format,$form->post_lang, 49 $post_excerpt,$post_excerpt_xhtml,$post_content,$post_content_xhtml 50 ); 51 $form->post_excerpt = $post_excerpt; 52 $form->post_content = $post_content; 53 $form->post_excerpt_xhtml = $post_excerpt_xhtml; 54 $form->post_content_xhtml = $post_content_xhtml; 55 56 $cur = $core->con->openCursor($core->prefix.'post'); 57 58 $cur->post_title = $form->post_title; 59 $cur->cat_id = $form->cat_id ? $form->cat_id : null; 60 $cur->post_dt = $form->post_dt ? date('Y-m-d H:i:00',strtotime($form->post_dt)) : ''; 61 $cur->post_format = $form->post_format; 62 $cur->post_password = $form->post_password; 63 $cur->post_lang = $form->post_lang; 64 $cur->post_title = $form->post_title; 65 $cur->post_excerpt = $form->post_excerpt; 66 $cur->post_excerpt_xhtml = $form->post_excerpt_xhtml; 67 $cur->post_content = $form->post_content; 68 $cur->post_content_xhtml = $form->post_content_xhtml; 69 $cur->post_notes = $form->post_notes; 70 $cur->post_status = $form->post_status; 71 $cur->post_selected = (integer) $form->post_selected; 72 $cur->post_open_comment = (integer) $form->post_open_comment; 73 $cur->post_open_tb = (integer) $form->post_open_tb; 74 75 if (!empty($form->post_url)) { 76 $cur->post_url = $form->post_url; 77 } 78 79 # Update post 80 if ($form->id) 81 { 82 # --BEHAVIOR-- adminBeforePostUpdate 83 $core->callBehavior('adminBeforePostUpdate',$cur,$form->id); 84 85 $core->blog->updPost($form->id,$cur); 86 87 # --BEHAVIOR-- adminAfterPostUpdate 88 $core->callBehavior('adminAfterPostUpdate',$cur,$form->id); 89 http::redirect('post.php?id='.$form->id.'&upd=1'); 90 } 91 else 92 { 93 $cur->user_id = $core->auth->userID(); 94 # --BEHAVIOR-- adminBeforePostCreate 95 $core->callBehavior('adminBeforePostCreate',$cur); 96 97 $return_id = $core->blog->addPost($cur); 98 99 # --BEHAVIOR-- adminAfterPostCreate 100 $core->callBehavior('adminAfterPostCreate',$cur,$return_id); 101 102 http::redirect('post.php?id='.$return_id.'&crea=1'); 103 } 104 105 } catch (Exception $e) { 106 $_ctx->addError($e->getMessage()); 107 } 108 } 109 public static function deletePost($form) { 110 global $core,$_ctx; 111 if ($form->can_delete) { 112 try { 113 $post_id = $form->id; 114 $core->callBehavior('adminBeforePostDelete',$post_id); 115 $core->blog->delPost($post_id); 116 http::redirect('posts.php'); 117 exit; 118 } catch (Exception $e) { 119 $_ctx->addError($e->getMessage()); 120 } 121 } 122 } 123 } 34 124 35 125 $page_title = __('New entry'); 36 126 $post_id=''; 37 127 $can_view_page = true; 38 128 $can_edit_post = $core->auth->check('usage,contentadmin',$core->blog->id); … … 47 137 # If user can't publish 48 138 if (!$can_publish) { 49 $ post_status = -2;139 $form->post_status = -2; 50 140 } 51 141 52 142 # Getting categories 53 $categories_combo = dcAdminCombos::getCategoriesCombo( 54 $core->blog->getCategories(array('post_type'=>'post')) 55 ); 56 57 $status_combo = dcAdminCombos::getPostStatusesCombo(); 58 59 $img_status_pattern = '<img class="img_select_option" alt="%1$s" title="%1$s" src="images/%2$s" />'; 143 $categories_combo = array(' ' => ''); 144 try { 145 $categories = $core->blog->getCategories(array('post_type'=>'post')); 146 while ($categories->fetch()) { 147 $categories_combo[$categories->cat_id] = 148 str_repeat(' ',$categories->level-1). 149 ($categories->level-1 == 0 ? '' : '• '). 150 html::escapeHTML($categories->cat_title); 151 } 152 } catch (Exception $e) { } 153 154 # Status combo 155 foreach ($core->blog->getAllPostStatus() as $k => $v) { 156 $status_combo[$k] = $v; 157 } 60 158 61 159 # Formaters combo 62 $formaters_combo = dcAdminCombos::getFormatersCombo(); 160 foreach ($core->getFormaters() as $v) { 161 $formaters_combo[$v] = $v; 162 } 63 163 64 164 # Languages combo 65 165 $rs = $core->blog->getLangs(array('order'=>'asc')); 66 $lang_combo = dcAdminCombos::getLangsCombo($rs,true); 67 68 # Validation flag 69 $bad_dt = false; 70 71 # Trackbacks 72 $TB = new dcTrackback($core); 73 $tb_urls = $tb_excerpt = ''; 74 166 $all_langs = l10n::getISOcodes(0,1); 167 $lang_combo = array('' => '', __('Most used') => array(), __('Available') => l10n::getISOcodes(0,1)); 168 while ($rs->fetch()) { 169 if (isset($all_langs[$rs->post_lang])) { 170 $lang_combo[__('Most used')][$rs->post_lang] = $all_langs[$rs->post_lang]; 171 unset($lang_combo[__('Available')][$rs->post_lang]); 172 } else { 173 $lang_combo[__('Most used')][$rs->post_lang] = $all_langs[$rs->post_lang]; 174 } 175 } 176 unset($all_langs); 177 unset($rs); 178 179 $form = new dcForm($core,'post','post.php'); 180 $form 181 ->addField( 182 new dcFieldText('post_title','', array( 183 'maxlength' => 255, 184 'required' => true, 185 'label' => __('Title:')))) 186 ->addField( 187 new dcFieldTextArea('post_excerpt','', array( 188 'cols' => 50, 189 'rows' => 5, 190 'label' => __("Excerpt:").'<span class="form-note">'. 191 __('Add an introduction to the post.').'</span>'))) 192 ->addField( 193 new dcFieldTextArea('post_content','', array( 194 'required' => true, 195 'label' => __("Content:")))) 196 ->addField( 197 new dcFieldTextArea('post_notes','', array( 198 'label' => __("Notes")))) 199 ->addField( 200 new dcFieldSubmit('save',__('Save'),array( 201 'action' => array('PostActions','savePost')))) 202 ->addField( 203 new dcFieldSubmit('delete',__('Delete'),array( 204 'action' => array('PostActions','deletePost')))) 205 ->addField( 206 new dcFieldCombo('post_status',$core->auth->getInfo('user_post_status'),$status_combo,array( 207 'disabled' => !$can_publish, 208 'label' => __('Entry status')))) 209 ->addField( 210 new dcFieldCombo('cat_id','',$categories_combo,array( 211 "label" => __('Category')))) 212 ->addField( 213 new dcFieldCombo('new_cat_parent','',$categories_combo,array( 214 "label" => __('Parent:')))) 215 ->addField( 216 new dcFieldText('new_cat_title','', array( 217 'maxlength' => 255, 218 'label' => __('Title')))) 219 220 ->addField( 221 new dcFieldText('post_dt','',array( 222 "label" => __('Publication date and hour')))) 223 ->addField( 224 new dcFieldCombo('post_format',$core->auth->getOption('post_format'),$formaters_combo,array( 225 "label" => __('Text formating')))) 226 ->addField( 227 new dcFieldCheckbox ('post_open_comment',$core->blog->settings->system->allow_comments,array( 228 "label" => __('Accept comments')))) 229 ->addField( 230 new dcFieldCheckbox ('post_open_tb',$core->blog->settings->system->allow_trackbacks,array( 231 "label" => __('Accept trackbacks')))) 232 ->addField( 233 new dcFieldCheckbox ('post_selected',array(1=>false),array( 234 "label" => __('Selected entry')))) 235 ->addField( 236 new dcFieldCombo ('post_lang',$core->auth->getInfo('user_lang'),$lang_combo, array( 237 "label" => __('Entry lang:')))) 238 ->addField( 239 new dcFieldText('post_password','',array( 240 "maxlength" => 32, 241 "label" => __('Entry password:')))) 242 ->addField( 243 new dcFieldText('post_url','',array( 244 "maxlength" => 255, 245 "label" => __('Basename:')))) 246 ->addField( 247 new dcFieldHidden ('id','')) 248 ; 75 249 # Get entry informations 76 250 if (!empty($_REQUEST['id'])) 77 251 { 78 $page_title = __('Edit entry');79 80 252 $params['post_id'] = $_REQUEST['id']; 81 253 … … 89 261 else 90 262 { 91 $post_id = $post->post_id; 92 $cat_id = $post->cat_id; 93 $post_dt = date('Y-m-d H:i',strtotime($post->post_dt)); 94 $post_format = $post->post_format; 95 $post_password = $post->post_password; 96 $post_url = $post->post_url; 97 $post_lang = $post->post_lang; 98 $post_title = $post->post_title; 99 $post_excerpt = $post->post_excerpt; 100 $post_excerpt_xhtml = $post->post_excerpt_xhtml; 101 $post_content = $post->post_content; 102 $post_content_xhtml = $post->post_content_xhtml; 103 $post_notes = $post->post_notes; 104 $post_status = $post->post_status; 105 $post_selected = (boolean) $post->post_selected; 106 $post_open_comment = (boolean) $post->post_open_comment; 107 $post_open_tb = (boolean) $post->post_open_tb; 108 109 $can_edit_post = $post->isEditable(); 110 $can_delete= $post->isDeletable(); 111 263 $form->id = $post_id = $post->post_id; 264 $form->cat_id = $post->cat_id; 265 $form->post_dt = date('Y-m-d H:i',strtotime($post->post_dt)); 266 $form->post_format = $post->post_format; 267 $form->post_password = $post->post_password; 268 $form->post_url = $post->post_url; 269 $form->post_lang = $post->post_lang; 270 $form->post_title = $post->post_title; 271 $form->post_excerpt = $post->post_excerpt; 272 $form->post_excerpt_xhtml = $post->post_excerpt_xhtml; 273 $form->post_content = $post->post_content; 274 $form->post_content_xhtml = $post->post_content_xhtml; 275 $form->post_notes = $post->post_notes; 276 $form->post_status = $post->post_status; 277 $form->post_selected = (boolean) $post->post_selected; 278 $form->post_open_comment = (boolean) $post->post_open_comment; 279 $form->post_open_tb = (boolean) $post->post_open_tb; 280 $form->can_edit_post = $post->isEditable(); 281 $form->can_delete= $post->isDeletable(); 112 282 $next_rs = $core->blog->getNextPost($post,1); 113 283 $prev_rs = $core->blog->getNextPost($post,-1); 114 284 115 285 if ($next_rs !== null) { 116 $next_link = sprintf($post_link,$next_rs->post_id, 117 html::escapeHTML($next_rs->post_title),__('Next entry').' »'); 118 $next_headlink = sprintf($post_headlink,'next', 119 html::escapeHTML($next_rs->post_title),$next_rs->post_id); 120 } 286 $_ctx->next_post = array('id' => $next_rs->post_id,'title' => $next_rs->post_title); 287 } 288 if ($prev_rs !== null) { 289 $_ctx->prev_post = array('id' => $prev_rs->post_id,'title' => $prev_rs->post_title); 290 } 291 $page_title = __('Edit entry'); 292 293 } 294 } 295 if ($post_id) { 296 $_ctx->post_id = $post->post_id; 297 298 $_ctx->preview_url = 299 $core->blog->url.$core->url->getURLFor('preview',$core->auth->userID().'/'. 300 http::browserUID(DC_MASTER_KEY.$core->auth->userID().$core->auth->getInfo('user_pwd')). 301 '/'.$post->post_url); 121 302 122 if ($prev_rs !== null) { 123 $prev_link = sprintf($post_link,$prev_rs->post_id, 124 html::escapeHTML($prev_rs->post_title),'« '.__('Previous entry')); 125 $prev_headlink = sprintf($post_headlink,'previous', 126 html::escapeHTML($prev_rs->post_title),$prev_rs->post_id); 127 } 128 129 try { 130 $core->media = new dcMedia($core); 131 } catch (Exception $e) { 132 $core->error->add($e->getMessage()); 133 } 134 135 # Sanitize trackbacks excerpt 136 $tb_excerpt = empty($_POST['tb_excerpt']) ? 137 $post_excerpt_xhtml.' '.$post_content_xhtml : 138 $_POST['tb_excerpt']; 139 $tb_excerpt = html::decodeEntities(html::clean($tb_excerpt)); 140 $tb_excerpt = text::cutString(html::escapeHTML($tb_excerpt), 255); 141 $tb_excerpt = preg_replace('/\s+/ms', ' ', $tb_excerpt); 142 } 143 } 144 if (isset($_REQUEST['section']) && $_REQUEST['section']=='trackbacks') { 145 $anchor = 'trackbacks'; 146 } else { 147 $anchor = 'comments'; 148 } 149 150 $comments_actions_page = new dcCommentsActionsPage($core,'post.php',array('id' => $post_id, '_ANCHOR'=>$anchor,'section' => $anchor)); 151 152 if ($comments_actions_page->process()) { 153 return; 154 } 155 156 # Ping blogs 157 if (!empty($_POST['ping'])) 158 { 159 if (!empty($_POST['tb_urls']) && $post_id && $post_status == 1 && $can_edit_post) 160 { 161 $tb_urls = $_POST['tb_urls']; 162 $tb_urls = str_replace("\r", '', $tb_urls); 163 $tb_post_title = html::escapeHTML(trim(html::clean($post_title))); 164 165 foreach (explode("\n", $tb_urls) as $tb_url) 166 { 167 try { 168 $TB->ping($tb_url, $post_id, $tb_post_title, $tb_excerpt, $post_url); 169 } catch (Exception $e) { 170 $core->error->add($e->getMessage()); 171 } 172 } 173 174 if (!$core->error->flag()) { 175 dcPage::addSuccessNotice(__('All pings sent.')); 176 http::redirect('post.php?id='.$post_id.'&tb=1'); 177 } 178 } 179 } 180 181 # Format excerpt and content 182 elseif (!empty($_POST) && $can_edit_post) 183 { 184 $post_format = $_POST['post_format']; 185 $post_excerpt = $_POST['post_excerpt']; 186 $post_content = $_POST['post_content']; 187 188 $post_title = $_POST['post_title']; 189 190 $cat_id = (integer) $_POST['cat_id']; 191 192 if (isset($_POST['post_status'])) { 193 $post_status = (integer) $_POST['post_status']; 194 } 195 196 if (empty($_POST['post_dt'])) { 197 $post_dt = ''; 198 } else { 199 try 200 { 201 $post_dt = strtotime($_POST['post_dt']); 202 if ($post_dt == false || $post_dt == -1) { 203 $bad_dt = true; 204 throw new Exception(__('Invalid publication date')); 205 } 206 $post_dt = date('Y-m-d H:i',$post_dt); 207 } 208 catch (Exception $e) 209 { 210 $core->error->add($e->getMessage()); 211 } 212 } 213 214 $post_open_comment = !empty($_POST['post_open_comment']); 215 $post_open_tb = !empty($_POST['post_open_tb']); 216 $post_selected = !empty($_POST['post_selected']); 217 $post_lang = $_POST['post_lang']; 218 $post_password = !empty($_POST['post_password']) ? $_POST['post_password'] : null; 219 220 $post_notes = $_POST['post_notes']; 221 222 if (isset($_POST['post_url'])) { 223 $post_url = $_POST['post_url']; 224 } 225 226 $core->blog->setPostContent( 227 $post_id,$post_format,$post_lang, 228 $post_excerpt,$post_excerpt_xhtml,$post_content,$post_content_xhtml 229 ); 230 } 231 232 # Delete post 233 if (!empty($_POST['delete']) && $can_delete) 234 { 235 try { 236 # --BEHAVIOR-- adminBeforePostDelete 237 $core->callBehavior('adminBeforePostDelete',$post_id); 238 $core->blog->delPost($post_id); 239 http::redirect('posts.php'); 240 } catch (Exception $e) { 241 $core->error->add($e->getMessage()); 242 } 243 } 244 245 # Create or update post 246 if (!empty($_POST) && !empty($_POST['save']) && $can_edit_post && !$bad_dt) 247 { 248 # Create category 249 if (!empty($_POST['new_cat_title']) && $core->auth->check('categories', $core->blog->id)) { 250 251 $cur_cat = $core->con->openCursor($core->prefix.'category'); 252 $cur_cat->cat_title = $_POST['new_cat_title']; 253 $cur_cat->cat_url = ''; 254 255 $parent_cat = !empty($_POST['new_cat_parent']) ? $_POST['new_cat_parent'] : ''; 256 257 # --BEHAVIOR-- adminBeforeCategoryCreate 258 $core->callBehavior('adminBeforeCategoryCreate', $cur_cat); 259 260 $cat_id = $core->blog->addCategory($cur_cat, (integer) $parent_cat); 261 262 # --BEHAVIOR-- adminAfterCategoryCreate 263 $core->callBehavior('adminAfterCategoryCreate', $cur_cat, $cat_id); 264 } 265 266 $cur = $core->con->openCursor($core->prefix.'post'); 267 268 $cur->post_title = $post_title; 269 $cur->cat_id = ($cat_id ? $cat_id : null); 270 $cur->post_dt = $post_dt ? date('Y-m-d H:i:00',strtotime($post_dt)) : ''; 271 $cur->post_format = $post_format; 272 $cur->post_password = $post_password; 273 $cur->post_lang = $post_lang; 274 $cur->post_title = $post_title; 275 $cur->post_excerpt = $post_excerpt; 276 $cur->post_excerpt_xhtml = $post_excerpt_xhtml; 277 $cur->post_content = $post_content; 278 $cur->post_content_xhtml = $post_content_xhtml; 279 $cur->post_notes = $post_notes; 280 $cur->post_status = $post_status; 281 $cur->post_selected = (integer) $post_selected; 282 $cur->post_open_comment = (integer) $post_open_comment; 283 $cur->post_open_tb = (integer) $post_open_tb; 284 285 if (isset($_POST['post_url'])) { 286 $cur->post_url = $post_url; 287 } 288 289 # Update post 290 if ($post_id) 291 { 292 try 293 { 294 # --BEHAVIOR-- adminBeforePostUpdate 295 $core->callBehavior('adminBeforePostUpdate',$cur,$post_id); 296 297 $core->blog->updPost($post_id,$cur); 298 299 # --BEHAVIOR-- adminAfterPostUpdate 300 $core->callBehavior('adminAfterPostUpdate',$cur,$post_id); 301 dcPage::addSuccessNotice (sprintf(__('The post "%s" has been successfully updated'),html::escapeHTML($cur->post_title))); 302 http::redirect('post.php?id='.$post_id); 303 } 304 catch (Exception $e) 305 { 306 $core->error->add($e->getMessage()); 307 } 308 } 309 else 310 { 311 $cur->user_id = $core->auth->userID(); 312 313 try 314 { 315 # --BEHAVIOR-- adminBeforePostCreate 316 $core->callBehavior('adminBeforePostCreate',$cur); 317 318 $return_id = $core->blog->addPost($cur); 319 320 # --BEHAVIOR-- adminAfterPostCreate 321 $core->callBehavior('adminAfterPostCreate',$cur,$return_id); 322 323 dcPage::addSuccessNotice(__('Entry has been successfully created.')); 324 http::redirect('post.php?id='.$return_id); 325 } 326 catch (Exception $e) 327 { 328 $core->error->add($e->getMessage()); 329 } 330 } 331 } 332 333 # Getting categories 334 $categories_combo = dcAdminCombos::getCategoriesCombo( 335 $core->blog->getCategories(array('post_type'=>'post')) 336 ); 303 304 $form_comment = new dcForm($core,'add-comment','comment.php'); 305 $form_comment 306 ->addField( 307 new dcFieldText('comment_author','', array( 308 'maxlength' => 255, 309 'required' => true, 310 'label' => __('Name:')))) 311 ->addField( 312 new dcFieldText('comment_email','', array( 313 'maxlength' => 255, 314 'required' => true, 315 'label' => __('Email:')))) 316 ->addField( 317 new dcFieldText('comment_site','', array( 318 'maxlength' => 255, 319 'label' => __('Web site:')))) 320 ->addField( 321 new dcFieldTextArea('comment_content','', array( 322 'required' => true, 323 'label' => __('Comment:')))) 324 ->addField( 325 new dcFieldHidden('post_id',$post_id)) 326 ->addField( 327 new dcFieldSubmit('add',__('Save'),array( 328 'action' => 'addComment'))) 329 ; 330 331 332 } 333 334 $form->setup(); 335 336 $sidebar_blocks = new ArrayObject(array( 337 'status-box' => array( 338 'title' => __('Status'), 339 'items' => array('post_status','post_dt','post_lang','post_format')), 340 'metas-box' => array( 341 'title' => __('Ordering'), 342 'items' => array('post_selected','cat_id')), 343 'options-box' => array( 344 'title' => __('Options'), 345 'items' => array('post_open_comment','post_open_tb','post_password','post_url')) 346 )); 347 348 $main_blocks = new ArrayObject(array( 349 "post_title","post_excerpt","post_content","post_notes" 350 )); 351 352 353 $_ctx->sidebar_blocks = $sidebar_blocks; 354 $_ctx->main_blocks = $main_blocks; 355 337 356 /* DISPLAY 338 357 -------------------------------------------------------- */ … … 344 363 $default_tab = 'comments'; 345 364 } 346 elseif (!empty($_GET['tb'])) { 347 $default_tab = 'trackbacks'; 348 } 349 350 if ($post_id) { 351 switch ($post_status) { 352 case 1: 353 $img_status = sprintf($img_status_pattern,__('Published'),'check-on.png'); 354 break; 355 case 0: 356 $img_status = sprintf($img_status_pattern,__('Unpublished'),'check-off.png'); 357 break; 358 case -1: 359 $img_status = sprintf($img_status_pattern,__('Scheduled'),'scheduled.png'); 360 break; 361 case -2: 362 $img_status = sprintf($img_status_pattern,__('Pending'),'check-wrn.png'); 363 break; 364 default: 365 $img_status = ''; 366 } 367 $edit_entry_str = __('“%s”'); 368 $page_title_edit = sprintf($edit_entry_str, html::escapeHTML($post_title)).' '.$img_status; 369 } else { 370 $img_status = ''; 371 } 372 373 374 dcPage::open($page_title.' - '.__('Entries'), 375 dcPage::jsDatePicker(). 376 dcPage::jsToolBar(). 377 dcPage::jsModal(). 378 dcPage::jsMetaEditor(). 379 dcPage::jsLoad('js/_post.js'). 380 dcPage::jsConfirmClose('entry-form','comment-form'). 381 # --BEHAVIOR-- adminPostHeaders 382 $core->callBehavior('adminPostHeaders'). 383 dcPage::jsPageTabs($default_tab). 384 $next_headlink."\n".$prev_headlink, 385 dcPage::breadcrumb( 365 $page_title_edit = __('Edit entry'); 366 $_ctx 367 ->setBreadCrumb( 386 368 array( 387 369 html::escapeHTML($core->blog->name) => '', 388 370 __('Entries') => 'posts.php', 389 371 ($post_id ? $page_title_edit : $page_title) => '' 390 )) 391 ); 372 )) 373 ->default_tab = $default_tab; 374 $_ctx->post_status = $form->post_status; 375 $_ctx->post_title = $form->post_title; 376 if ($form->post_status == 1) { 377 $_ctx->post_url = $post->getURL(); 378 } 392 379 393 380 if (!empty($_GET['upd'])) { 394 dcPage::success(__('Entry has been successfully updated.'));381 $_ctx->setAlert(__('Entry has been successfully updated.')); 395 382 } 396 383 elseif (!empty($_GET['crea'])) { 397 dcPage::success(__('Entry has been successfully created.'));384 $_ctx->setAlert(__('Entry has been successfully created.')); 398 385 } 399 386 elseif (!empty($_GET['attached'])) { 400 dcPage::success(__('File has been successfully attached.'));387 $_ctx->setAlert(__('File has been successfully attached.')); 401 388 } 402 389 elseif (!empty($_GET['rmattach'])) { 403 dcPage::success(__('Attachment has been successfully removed.')); 404 } 405 390 $_ctx->setAlert(__('Attachment has been successfully removed.')); 391 } 406 392 if (!empty($_GET['creaco'])) { 407 dcPage::success(__('Comment has been successfully created.')); 408 } 409 if (!empty($_GET['tbsent'])) { 410 dcPage::success(__('All pings sent.')); 411 } 412 413 # XHTML conversion 414 if (!empty($_GET['xconv'])) 415 { 416 $post_excerpt = $post_excerpt_xhtml; 417 $post_content = $post_content_xhtml; 418 $post_format = 'xhtml'; 419 420 dcPage::message(__('Don\'t forget to validate your XHTML conversion by saving your post.')); 421 } 422 423 if ($post_id && $post->post_status == 1) { 424 echo '<p><a class="onblog_link outgoing" href="'.$post->getURL().'" title="'.$post_title.'">'.__('Go to this entry on the site').' <img src="images/outgoing-blue.png" alt="" /></a></p>'; 425 } 426 if ($post_id) 427 { 428 echo '<p class="nav_prevnext">'; 429 if ($prev_link) { echo $prev_link; } 430 if ($next_link && $prev_link) { echo ' | '; } 431 if ($next_link) { echo $next_link; } 432 433 # --BEHAVIOR-- adminPostNavLinks 434 $core->callBehavior('adminPostNavLinks',isset($post) ? $post : null); 435 436 echo '</p>'; 437 } 438 439 # Exit if we cannot view page 440 if (!$can_view_page) { 441 dcPage::helpBlock('core_post'); 442 dcPage::close(); 443 exit; 444 } 445 /* Post form if we can edit post 446 -------------------------------------------------------- */ 447 if ($can_edit_post) 448 { 449 $sidebar_items = new ArrayObject(array( 450 'status-box' => array( 451 'title' => __('Status'), 452 'items' => array( 453 'post_status' => 454 '<p class="entry-status"><label for="post_status">'.__('Entry status').' '.$img_status.'</label>'. 455 form::combo('post_status',$status_combo,$post_status,'maximal','',!$can_publish). 456 '</p>', 457 'post_dt' => 458 '<p><label for="post_dt">'.__('Publication date and hour').'</label>'. 459 form::field('post_dt',16,16,$post_dt,($bad_dt ? 'invalid' : '')). 460 '</p>', 461 'post_lang' => 462 '<p><label for="post_lang">'.__('Entry language').'</label>'. 463 form::combo('post_lang',$lang_combo,$post_lang). 464 '</p>', 465 'post_format' => 466 '<div>'. 467 '<h5 id="label_format"><label for="post_format" class="classic">'.__('Text formatting').'</label></h5>'. 468 '<p>'.form::combo('post_format',$formaters_combo,$post_format,'maximal'). 469 '</p>'. 470 '<p class="format_control control_no_xhtml">'. 471 '<a id="convert-xhtml" class="button'.($post_id && $post_format != 'wiki' ? ' hide' : '').'" href="post.php?id='.$post_id.'&xconv=1">'. 472 __('Convert to XHTML').'</a></p></div>')), 473 'metas-box' => array( 474 'title' => __('Filing'), 475 'items' => array( 476 'post_selected' => 477 '<p><label for="post_selected" class="classic">'. 478 form::checkbox('post_selected',1,$post_selected).' '. 479 __('Selected entry').'</label></p>', 480 'cat_id' => 481 '<div>'. 482 '<h5 id="label_cat_id">'.__('Category').'</h5>'. 483 '<p><label for="cat_id">'.__('Category:').'</label>'. 484 form::combo('cat_id',$categories_combo,$cat_id,'maximal'). 485 '</p>'. 486 ($core->auth->check('categories', $core->blog->id) ? 487 '<div>'. 488 '<h5 id="create_cat">'.__('Add a new category').'</h5>'. 489 '<p><label for="new_cat_title">'.__('Title:').' '. 490 form::field('new_cat_title',30,255,'','maximal').'</label></p>'. 491 '<p><label for="new_cat_parent">'.__('Parent:').' '. 492 form::combo('new_cat_parent',$categories_combo,'','maximal'). 493 '</label></p>'. 494 '</div>' 495 : ''). 496 '</div>')), 497 'options-box' => array( 498 'title' => __('Options'), 499 'items' => array( 500 'post_open_comment_tb' => 501 '<div>'. 502 '<h5 id="label_comment_tb">'.__('Comments and trackbacks list').'</h5>'. 503 '<p><label for="post_open_comment" class="classic">'. 504 form::checkbox('post_open_comment',1,$post_open_comment).' '. 505 __('Accept comments').'</label></p>'. 506 ($core->blog->settings->system->allow_comments ? 507 (isContributionAllowed($post_id,strtotime($post_dt),true) ? 508 '' : 509 '<p class="form-note warn">'. 510 __('Warning: Comments are not more accepted for this entry.').'</p>') : 511 '<p class="form-note warn">'. 512 __('Comments are not accepted on this blog so far.').'</p>'). 513 '<p><label for="post_open_tb" class="classic">'. 514 form::checkbox('post_open_tb',1,$post_open_tb).' '. 515 __('Accept trackbacks').'</label></p>'. 516 ($core->blog->settings->system->allow_trackbacks ? 517 (isContributionAllowed($post_id,strtotime($post_dt),false) ? 518 '' : 519 '<p class="form-note warn">'. 520 __('Warning: Trackbacks are not more accepted for this entry.').'</p>') : 521 '<p class="form-note warn">'.__('Trackbacks are not accepted on this blog so far.').'</p>'). 522 '</div>', 523 'post_password' => 524 '<p><label for="post_password">'.__('Password').'</label>'. 525 form::field('post_password',10,32,html::escapeHTML($post_password),'maximal'). 526 '</p>', 527 'post_url' => 528 '<div class="lockable">'. 529 '<p><label for="post_url">'.__('Edit basename').'</label>'. 530 form::field('post_url',10,255,html::escapeHTML($post_url),'maximal'). 531 '</p>'. 532 '<p class="form-note warn">'. 533 __('Warning: If you set the URL manually, it may conflict with another entry.'). 534 '</p></div>' 535 )))); 536 537 $main_items = new ArrayObject(array( 538 "post_title" => 539 '<p class="col">'. 540 '<label class="required no-margin bold"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label>'. 541 form::field('post_title',20,255,html::escapeHTML($post_title),'maximal'). 542 '</p>', 543 544 "post_excerpt" => 545 '<p class="area" id="excerpt-area"><label for="post_excerpt" class="bold">'.__('Excerpt:').' <span class="form-note">'. 546 __('Introduction to the post.').'</span></label> '. 547 form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)). 548 '</p>', 549 550 "post_content" => 551 '<p class="area" id="content-area"><label class="required bold" '. 552 'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '. 553 form::textarea('post_content',50,$core->auth->getOption('edit_size'),html::escapeHTML($post_content)). 554 '</p>', 555 556 "post_notes" => 557 '<p class="area" id="notes-area"><label for="post_notes" class="bold">'.__('Personal notes:').' <span class="form-note">'. 558 __('Unpublished notes.').'</span></label>'. 559 form::textarea('post_notes',50,5,html::escapeHTML($post_notes)). 560 '</p>' 561 ) 562 ); 563 564 # --BEHAVIOR-- adminPostFormItems 565 $core->callBehavior('adminPostFormItems',$main_items,$sidebar_items, isset($post) ? $post : null); 566 567 echo '<div class="multi-part" title="'.($post_id ? __('Edit entry') : __('New entry')).'" id="edit-entry">'; 568 echo '<form action="post.php" method="post" id="entry-form">'; 569 echo '<div id="entry-wrapper">'; 570 echo '<div id="entry-content"><div class="constrained">'; 571 572 echo '<h3 class="out-of-screen-if-js">'.__('Edit post').'</h3>'; 573 574 foreach ($main_items as $id => $item) { 575 echo $item; 576 } 577 578 # --BEHAVIOR-- adminPostForm (may be deprecated) 579 $core->callBehavior('adminPostForm',isset($post) ? $post : null); 580 581 echo 582 '<p class="border-top">'. 583 ($post_id ? form::hidden('id',$post_id) : ''). 584 '<input type="submit" value="'.__('Save').' (s)" '. 585 'accesskey="s" name="save" /> '; 586 if ($post_id) { 587 $preview_url = 588 $core->blog->url.$core->url->getURLFor('preview',$core->auth->userID().'/'. 589 http::browserUID(DC_MASTER_KEY.$core->auth->userID().$core->auth->getInfo('user_pwd')). 590 '/'.$post->post_url); 591 echo '<a id="post-preview" href="'.$preview_url.'" class="button" accesskey="p">'.__('Preview').' (p)'.'</a> '; 592 } else { 593 echo 594 '<a id="post-cancel" href="index.php" class="button" accesskey="c">'.__('Cancel').' (c)</a>'; 595 } 596 597 echo 598 ($can_delete ? '<input type="submit" class="delete" value="'.__('Delete').'" name="delete" />' : ''). 599 $core->formNonce(). 600 '</p>'; 601 602 echo '</div></div>'; // End #entry-content 603 echo '</div>'; // End #entry-wrapper 604 605 echo '<div id="entry-sidebar">'; 606 607 foreach ($sidebar_items as $id => $c) { 608 echo '<div id="'.$id.'" class="sb-box">'. 609 '<h4>'.$c['title'].'</h4>'; 610 foreach ($c['items'] as $e_name=>$e_content) { 611 echo $e_content; 612 } 613 echo '</div>'; 614 } 615 616 617 # --BEHAVIOR-- adminPostFormSidebar (may be deprecated) 618 $core->callBehavior('adminPostFormSidebar',isset($post) ? $post : null); 619 echo '</div>'; // End #entry-sidebar 620 621 echo '</form>'; 622 623 # --BEHAVIOR-- adminPostForm 624 $core->callBehavior('adminPostAfterForm',isset($post) ? $post : null); 625 626 echo '</div>'; 627 } 628 629 if ($post_id) 630 { 631 /* Comments 632 -------------------------------------------------------- */ 633 634 $params = array('post_id' => $post_id, 'order' => 'comment_dt ASC'); 635 636 $comments = $core->blog->getComments(array_merge($params,array('comment_trackback'=>0))); 637 638 echo 639 '<div id="comments" class="clear multi-part" title="'.__('Comments').'">'; 640 $combo_action = $comments_actions_page->getCombo(); 641 $has_action = !empty($combo_action) && !$comments->isEmpty(); 642 echo 643 '<p class="top-add"><a class="button add" href="#comment-form">'.__('Add a comment').'</a></p>'; 644 645 if ($has_action) { 646 echo '<form action="post.php" id="form-comments" method="post">'; 647 } 648 649 echo '<h3>'.__('Comments').'</h3>'; 650 if (!$comments->isEmpty()) { 651 showComments($comments,$has_action); 652 } else { 653 echo '<p>'.__('No comment').'</p>'; 654 } 655 656 if ($has_action) { 657 echo 658 '<div class="two-cols">'. 659 '<p class="col checkboxes-helpers"></p>'. 660 661 '<p class="col right"><label for="action" class="classic">'.__('Selected comments action:').'</label> '. 662 form::combo('action',$combo_action). 663 form::hidden(array('section'),'comments'). 664 form::hidden(array('id'),$post_id). 665 $core->formNonce(). 666 '<input type="submit" value="'.__('ok').'" /></p>'. 667 '</div>'. 668 '</form>'; 669 } 670 /* Add a comment 671 -------------------------------------------------------- */ 672 673 echo 674 '<div class="fieldset clear">'. 675 '<h3>'.__('Add a comment').'</h3>'. 676 677 '<form action="comment.php" method="post" id="comment-form">'. 678 '<div class="constrained">'. 679 '<p><label for="comment_author" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Name:').'</label>'. 680 form::field('comment_author',30,255,html::escapeHTML($core->auth->getInfo('user_cn'))). 681 '</p>'. 682 683 '<p><label for="comment_email">'.__('Email:').'</label>'. 684 form::field('comment_email',30,255,html::escapeHTML($core->auth->getInfo('user_email'))). 685 '</p>'. 686 687 '<p><label for="comment_site">'.__('Web site:').'</label>'. 688 form::field('comment_site',30,255,html::escapeHTML($core->auth->getInfo('user_url'))). 689 '</p>'. 690 691 '<p class="area"><label for="comment_content" class="required"><abbr title="'.__('Required field').'">*</abbr> '. 692 __('Comment:').'</label> '. 693 form::textarea('comment_content',50,8,html::escapeHTML('')). 694 '</p>'. 695 696 '<p>'. 697 form::hidden('post_id',$post_id). 698 $core->formNonce(). 699 '<input type="submit" name="add" value="'.__('Save').'" /></p>'. 700 '</div>'. #constrained 701 702 '</form>'. 703 '</div>'. #add comment 704 '</div>'; #comments 705 } 706 707 if ($post_id && $post_status == 1) 708 { 709 /* Trackbacks 710 -------------------------------------------------------- */ 711 712 $params = array('post_id' => $post_id, 'order' => 'comment_dt ASC'); 713 $trackbacks = $core->blog->getComments(array_merge($params, array('comment_trackback' => 1))); 714 715 # Actions combo box 716 $combo_action = $comments_actions_page->getCombo(); 717 $has_action = !empty($combo_action) && !$trackbacks->isEmpty(); 718 719 if (!empty($_GET['tb_auto'])) { 720 $tb_urls = implode("\n", $TB->discover($post_excerpt_xhtml.' '.$post_content_xhtml)); 721 } 722 723 # Display tab 724 echo 725 '<div id="trackbacks" class="clear multi-part" title="'.__('Trackbacks').'">'; 726 727 # tracbacks actions 728 if ($has_action) { 729 echo '<form action="post.php" id="form-trackbacks" method="post">'; 730 } 731 732 echo '<h3>'.__('Trackbacks received').'</h3>'; 733 734 if (!$trackbacks->isEmpty()) { 735 showComments($trackbacks, $has_action, true); 736 } else { 737 echo '<p>'.__('No trackback').'</p>'; 738 } 739 740 if ($has_action) { 741 echo 742 '<div class="two-cols">'. 743 '<p class="col checkboxes-helpers"></p>'. 744 745 '<p class="col right"><label for="action" class="classic">'.__('Selected trackbacks action:').'</label> '. 746 form::combo('action', $combo_action). 747 form::hidden('id',$post_id). 748 form::hidden(array('section'),'trackbacks'). 749 $core->formNonce(). 750 '<input type="submit" value="'.__('ok').'" /></p>'. 751 '</div>'. 752 '</form>'; 753 } 754 755 /* Add trackbacks 756 -------------------------------------------------------- */ 757 if ($can_edit_post && $post->post_status) { 758 echo 759 '<div class="fieldset clear">'; 760 761 echo 762 '<h3>'.__('Ping blogs').'</h3>'. 763 '<form action="post.php?id='.$post_id.'" id="trackback-form" method="post">'. 764 '<p><label for="tb_urls" class="area">'.__('URLs to ping:').'</label>'. 765 form::textarea('tb_urls', 60, 5, $tb_urls). 766 '</p>'. 767 768 '<p><label for="tb_excerpt" class="area">'.__('Excerpt to send:').'</label>'. 769 form::textarea('tb_excerpt', 60, 5, $tb_excerpt).'</p>'. 770 771 '<p>'. 772 $core->formNonce(). 773 '<input type="submit" name="ping" value="'.__('Ping blogs').'" />'. 774 (empty($_GET['tb_auto']) ? 775 ' <a class="button" href="'. 776 'post.php?id='.$post_id.'&tb_auto=1&tb=1'. 777 '">'.__('Auto discover ping URLs').'</a>' 778 : ''). 779 '</p>'. 780 '</form>'; 781 782 $pings = $TB->getPostPings($post_id); 783 784 if (!$pings->isEmpty()) 785 { 786 echo '<h3>'.__('Previously sent pings').'</h3>'; 787 788 echo '<ul class="nice">'; 789 while ($pings->fetch()) { 790 echo 791 '<li>'.dt::dt2str(__('%Y-%m-%d %H:%M'), $pings->ping_dt).' - '. 792 $pings->ping_url.'</li>'; 793 } 794 echo '</ul>'; 795 } 796 797 echo '</div>'; 798 } 799 800 echo '</div>'; #trackbacks 801 } 802 803 # Controls comments or trakbacks capabilities 804 function isContributionAllowed($id,$dt,$com=true) 805 { 806 global $core; 807 808 if (!$id) { 809 return true; 810 } 811 if ($com) { 812 if (($core->blog->settings->system->comments_ttl == 0) || 813 (time() - $core->blog->settings->system->comments_ttl*86400 < $dt)) { 814 return true; 815 } 816 } else { 817 if (($core->blog->settings->system->trackbacks_ttl == 0) || 818 (time() - $core->blog->settings->system->trackbacks_ttl*86400 < $dt)) { 819 return true; 820 } 821 } 822 return false; 823 } 824 825 # Show comments or trackbacks 826 function showComments($rs,$has_action,$tb=false) 827 { 828 echo 829 '<div class="table-outer">'. 830 '<table class="comments-list"><tr>'. 831 '<th colspan="2" class="first">'.__('Author').'</th>'. 832 '<th>'.__('Date').'</th>'. 833 '<th class="nowrap">'.__('IP address').'</th>'. 834 '<th>'.__('Status').'</th>'. 835 '<th>'.__('Edit').'</th>'. 836 '</tr>'; 837 $comments = array(); 838 if (isset($_REQUEST['comments'])) { 839 foreach ($_REQUEST['comments'] as $v) { 840 $comments[(integer)$v]=true; 841 } 842 } 843 844 while($rs->fetch()) 845 { 846 $comment_url = 'comment.php?id='.$rs->comment_id; 847 848 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 849 switch ($rs->comment_status) { 850 case 1: 851 $img_status = sprintf($img,__('Published'),'check-on.png'); 852 break; 853 case 0: 854 $img_status = sprintf($img,__('Unpublished'),'check-off.png'); 855 break; 856 case -1: 857 $img_status = sprintf($img,__('Pending'),'check-wrn.png'); 858 break; 859 case -2: 860 $img_status = sprintf($img,__('Junk'),'junk.png'); 861 break; 862 } 863 864 echo 865 '<tr class="line'.($rs->comment_status != 1 ? ' offline' : '').'"'. 866 ' id="c'.$rs->comment_id.'">'. 867 868 '<td class="nowrap">'. 869 ($has_action ? form::checkbox(array('comments[]'),$rs->comment_id,isset($comments[$rs->comment_id]),'','',0,'title="'.($tb ? __('select this trackback') : __('select this comment')).'"') : '').'</td>'. 870 '<td class="maximal">'.html::escapeHTML($rs->comment_author).'</td>'. 871 '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$rs->comment_dt).'</td>'. 872 '<td class="nowrap"><a href="comments.php?ip='.$rs->comment_ip.'">'.$rs->comment_ip.'</a></td>'. 873 '<td class="nowrap status">'.$img_status.'</td>'. 874 '<td class="nowrap status"><a href="'.$comment_url.'">'. 875 '<img src="images/edit-mini.png" alt="" title="'.__('Edit this comment').'" /> '.__('Edit').'</a></td>'. 876 877 '</tr>'; 878 } 879 880 echo '</table></div>'; 881 } 882 883 dcPage::helpBlock('core_post','core_trackbacks','core_wiki'); 884 dcPage::close(); 393 $_ctx->setAlert(__('Comment has been successfully created.')); 394 } 395 396 $core->tpl->display('post.html.twig'); 885 397 ?> -
admin/style/default.css
r2313 r2468 16 16 */ 17 17 /* --------------------------------------------------------------------------- 18 START 19 ---------------------------------------------------------------------------- */ 20 html { 21 font-size: 62.5%; 22 } 23 body { 24 font-size: 12px; /* ie < 9 sucks */ 25 font-size: 1.2rem; 26 line-height: 1.5; 27 font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; 28 margin: 0; 29 padding: 0; 30 } 31 /* --------------------------------------------------------------------------- 18 32 LAYOUTS 19 33 ---------------------------------------------------------------------------- */ 34 *, *:before, *:after { 35 -webkit-box-sizing: border-box; 36 -moz-box-sizing: border-box; 37 box-sizing: border-box; 38 } 20 39 #header { 21 40 background: #676e78; … … 24 43 width: 100%; 25 44 display: table; 45 position: relative; 26 46 } 27 47 #wrapper { … … 69 89 top: 0; 70 90 left: 14em; 71 width: 1 em;91 width: 15px; 72 92 height: 100%; 73 93 overflow: hidden; … … 123 143 } 124 144 .two-cols .col:first-child, 125 145 .two-cols .col30.first-col { 126 146 margin-left: 0; 127 147 margin-right: 2%; 128 148 } 129 149 .two-cols .col:last-child, 130 150 .two-cols .col70.last-col { 131 151 margin-left: 2%; 132 152 margin-right: 0; … … 145 165 } 146 166 .three-cols .col:first-child { 147 width: 33.3%;148 167 margin-left: 0; 149 168 } … … 153 172 } 154 173 .two-boxes { 155 width: 4 7%;174 width: 48.5%; 156 175 } 157 176 .three-boxes { … … 162 181 vertical-align: top; 163 182 margin: 0 1.5% 1em; 164 -moz-box-sizing: border-box;165 -webkit-box-sizing: border-box;166 box-sizing: border-box;167 183 text-align: left; 184 } 185 .two-boxes:nth-of-type(odd), .three-boxes:nth-of-type(3n+1) { 186 margin-left: 0; 187 } 188 .two-boxes:nth-of-type(even), .three-boxes:nth-of-type(3n) { 189 margin-right: 0; 168 190 } 169 191 /* ---------------------------------------------------------------- layout: popups */ … … 244 266 display: inline-block; 245 267 vertical-align: top; 246 margin: 0 1.5% 1em; 247 -moz-box-sizing: border-box; 248 -webkit-box-sizing: border-box; 249 box-sizing: border-box; 268 margin: 0 10px 10px; 250 269 text-align: left; 251 270 } 252 271 .box.small { 253 width: 3 20px;272 width: 312px; 254 273 } 255 274 .box.medium { 256 width: 6 60px;275 width: 644px; 257 276 } 258 277 .box.large { … … 268 287 HTML TAGS 269 288 ---------------------------------------------------------------------------- */ 270 html {271 font-size: 62.5%;272 }273 289 body { 274 font-size: 12px; /* ie < 9 sucks */275 font-size: 1.2rem;276 line-height: 1.5;277 font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;278 290 color: #333; 279 291 background: #fff; 280 margin: 0;281 padding: 0;282 292 } 283 293 /* ------------------------------------------------------------------ titres */ … … 291 301 padding: 0 0 1.5em; 292 302 font-weight: normal; 303 line-height: 1.25; 293 304 } 294 305 /* fil d'ariane */ 295 306 #content > h2 { 296 307 padding: 0 1em .5em 1em; 297 margin: 0 -1em .5em -1em;308 margin: 0 -1em 1em -1em; 298 309 background: #fff url(bg_h2.png) repeat-x center bottom; 299 310 } … … 321 332 } 322 333 h4, .as_h4 { 323 font-size: 14px; /* ie < 9 sucks */ 324 font-size: 1.4rem; 334 font-size: 1.16em; 325 335 color: #676e78; 326 336 } … … 341 351 } 342 352 h5 { 343 font-size: 12px; /* ie < 9 sucks */ 344 font-size: 1.2rem; 353 font-size: 1em; 345 354 font-weight: bold; 346 355 color: #676e78; … … 368 377 } 369 378 table { 370 font-size: 12px; /* ie < 9 sucks */ 371 font-size: 1.2rem; 379 font-size: 1em; 372 380 border-collapse: collapse; 373 381 margin: 0 0 1em 0; … … 419 427 white-space: pre; 420 428 white-space: -moz-pre-wrap; 421 white-space: -hp-pre-wrap;422 white-space: -o-pre-wrap;423 white-space: -pre-wrap;424 429 white-space: pre-wrap; 425 430 white-space: pre-line; … … 456 461 input[type=button], input[type=reset], a.button, button, textarea, select, legend { 457 462 border-radius: 3px; 463 max-width: 100%; 458 464 } 459 465 form { … … 496 502 } 497 503 input:focus, textarea:focus, select:focus { 498 -webkit-box-sizing: border-box;499 -moz-box-sizing: border-box;500 box-sizing: border-box;501 504 border-color: #9bca1c; 502 505 } … … 594 597 color: #900; 595 598 font-size: 1.3em; 599 } 600 label.bold { 601 text-transform: uppercase; 602 font-weight: bold; 603 margin-top: 2em; 596 604 } 597 605 label.area, p.area { … … 730 738 text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); 731 739 font-weight: normal; 732 font-size: 14px; /* ie < 9 sucks */ 733 font-size: 1.4rem; 740 font-size: 1.16em; 734 741 } 735 742 .button.add:hover, .button.add:active, .button.add:focus { 736 743 background-color: #9BCA1C; 737 744 background-image: -webkit-gradient(linear, left top, left bottom, from(#9BCA1C), to(#bee74b)); 738 background-image: linear-gradient( top,#9BCA1C, #bee74b);745 background-image: linear-gradient(#9BCA1C, #bee74b); 739 746 border-color: #9BCA1C; 740 747 } … … 799 806 padding-top: 1em; 800 807 padding-bottom: 1em; 808 margin-top: .5em; 801 809 } 802 810 .error { … … 879 887 } 880 888 #prelude li a { 881 padding: 3px 16px 3px 8px; /* ie < 9 sucks */ 882 padding: 3px 1.6rem 3px .8rem; 889 padding: 3px 16px 3px 8px; 883 890 background: #A2CBE9; 884 891 color: #000; … … 912 919 /* h1 */ 913 920 h1 { 914 text-indent: -1000px;921 text-indent: 100%; 915 922 width: 16.5em; 916 923 } … … 919 926 top: 0; 920 927 left: 0; 921 width: 15em; 922 height: 36px; 923 /* ie < 9 sucks */ 924 height: 3.6rem; 928 width: 150px; 929 height: 3em; 925 930 color: #fff; 926 931 background: transparent url(dc_logos/b-dotclear120.png) no-repeat 0 6px; … … 979 984 padding: 10px 0 10px 8px; 980 985 color: #676e78; 981 font-size: 14px; /* ie < 9 sucks */ 982 font-size: 1.4rem; 986 font-size: 1.15em; 983 987 } 984 988 #favorites-menu h3 { … … 1025 1029 } 1026 1030 #search-menu * { 1027 height: 22px; /* ie < 9 sucks */ 1028 height: 2.2rem; 1031 height: 2em; 1029 1032 display: inline-block; 1030 1033 vertical-align: top; 1031 line-height: 2 2px;1034 line-height: 24px; 1032 1035 } 1033 1036 #search-menu p { … … 1035 1038 border-radius: .3em; 1036 1039 position: relative; 1040 width: 95%; 1037 1041 overflow: hidden; 1038 1042 } 1039 1043 #qx { 1040 width: 124px; /* ie < 9 sucks */ 1041 width: 12.4rem; 1044 width: 80%; 1042 1045 border-bottom-left-radius: .3em; 1043 1046 border-top-left-radius: .3em; … … 1046 1049 padding: 0; 1047 1050 border: none; 1048 height: 22px; 1049 height: 2.2rem; 1051 height: 2em; 1050 1052 } 1051 1053 #qx:focus { … … 1053 1055 } 1054 1056 #search-menu input[type="submit"] { 1055 padding: 0 3px; 1056 padding: 0 .3rem; 1057 margin-left: -4px; 1057 padding: 0 .25em; 1058 margin-left: .33em; 1058 1059 background: #dfdfdf; 1059 1060 border-color: #999; … … 1066 1067 border: none; 1067 1068 border-left: 1px solid #999; 1068 font-size: 10px; /* ie < 9 sucks */1069 f ont-size: 1rem;1069 font-size: .91em; 1070 float: right; 1070 1071 } 1071 1072 #search-menu input[type="submit"]:hover, … … 1077 1078 .part-tabs ul { 1078 1079 padding: .5em 0 0 1em; 1079 border-bottom: 1px solid # dfdfdf;1080 line-height: 2;1080 border-bottom: 1px solid #ccc; 1081 line-height: 1.8; 1081 1082 } 1082 1083 .part-tabs li { … … 1085 1086 display: inline; 1086 1087 } 1088 .part-tabs li:first-child a { 1089 border-top-left-radius: 3px; 1090 } 1091 .part-tabs li:last-child a { 1092 border-top-right-radius: 3px; 1093 } 1087 1094 .part-tabs li a { 1088 padding: . 5em 2em;1095 padding: .33em 1.5em; 1089 1096 margin-right: -1px; 1090 1097 border: 1px solid #ccc; … … 1108 1115 padding-left: 1em; 1109 1116 } 1117 .pseudo-tabs { 1118 margin: -.75em 0 2em 0; 1119 border-bottom: 1px solid #bbb; 1120 display: table; 1121 width: 100%; 1122 padding: 0; 1123 line-height: 24px; 1124 border-collapse: collapse; 1125 } 1126 .pseudo-tabs li { 1127 display: table-cell; 1128 border-width: 0 1px; 1129 border-style: solid; 1130 border-color: #ccc; 1131 padding: 0; 1132 margin: 0; 1133 text-align: center; 1134 } 1135 .pseudo-tabs a { 1136 display: block; 1137 font-weight: bold; 1138 padding: 0 24px; 1139 border-bottom: none; 1140 } 1141 .pseudo-tabs a:hover, .pseudo-tabs a:focus { 1142 background-color: #ecf0f1; 1143 color: #333; 1144 } 1145 .pseudo-tabs a.active { 1146 background-color: #ecf0f1; 1147 color: #d30e60; 1148 } 1110 1149 /* contextual help */ 1111 1150 #help { … … 1121 1160 top: 0; 1122 1161 right: 0; 1123 width: 280px; /* ie < 9 sucks */ 1124 width: 28rem; 1162 width: 24em; 1125 1163 border-left: 2px solid #FFD478; 1126 1164 border-top: 2px solid #FFD478; … … 1137 1175 cursor: pointer; 1138 1176 color: #2373A8; 1139 line-height: 36px; /* ie < 9 sucks */ 1140 line-height: 3.6rem; 1177 line-height: 3; 1141 1178 } 1142 1179 #help-button.floatable { … … 1149 1186 position: fixed; 1150 1187 top: 10px; 1188 -webkit-transform:translateZ(0); /* Let GPU doing his job */ 1151 1189 } 1152 1190 .no-js #help-button { … … 1157 1195 } 1158 1196 #content.with-help #help-button { 1159 right: 280px; /* ie < 9 sucks */ 1160 right: 28rem; 1197 right: 24em; 1161 1198 background-color: #f5f5f5; 1162 1199 position: fixed; … … 1371 1408 width: 20em; 1372 1409 margin: 1.5em auto 0; 1373 font-size: 14px; /* ie < 9 sucks */ 1374 font-size: 1.4rem; 1410 font-size: 1.16em; 1375 1411 } 1376 1412 #login-screen h1 { … … 1386 1422 padding: 1em 1em 0 1em; 1387 1423 background: #fff; 1424 margin-bottom: 0; 1388 1425 } 1389 1426 #login-screen input[type=text], #login-screen input[type=password], #login-screen input[type=submit], … … 1392 1429 margin: 0; 1393 1430 padding: 5px 3px; 1394 -webkit-box-sizing: border-box;1395 -moz-box-sizing: border-box;1396 box-sizing: border-box;1397 1431 } 1398 1432 #login-screen input.login, #login-screen input.login:focus { … … 1403 1437 #login-screen #issue { 1404 1438 margin-left: 1.33em; 1405 font-size: 12px; /* ie < 9 sucks */ 1406 font-size: 1.2rem; 1439 font-size: .91em; 1440 } 1441 #issue p:first-child { 1442 text-align: right; 1407 1443 } 1408 1444 #login-screen #issue strong { … … 1411 1447 /* ------------------------------------------------------------------------- index.php */ 1412 1448 #dashboard-main { 1413 padding: 1em 0; 1449 padding: 1em; 1450 text-align: center; 1414 1451 } 1415 1452 /* raccourcis */ … … 1420 1457 } 1421 1458 #icons p { 1422 width: 1 70px;1459 width: 14em; 1423 1460 text-align: center; 1424 1461 margin: 1em 0 2em; … … 1454 1491 /* billet rapide */ 1455 1492 #quick { 1456 margin-top: 1em; 1457 padding-top: 1em; 1493 padding: 1em; 1494 max-width: 976px; 1495 margin: 0 auto; 1496 background: #f5f5f5; 1497 box-shadow: 0 1px 2px rgba(0, 0, 0, .2); 1498 text-align: left; 1458 1499 } 1459 1500 #quick h3 { … … 1482 1523 /* modules additionnels */ 1483 1524 #dashboard-boxes { 1484 margin: 2em auto 1em;1525 margin: 1em auto 1em; 1485 1526 padding-top: 2em; 1486 1527 } … … 1569 1610 } 1570 1611 /* ------------------------------------------------------------------- blog_theme.php */ 1612 /* pour les alignements verticaux */ 1613 #theme-new, #theme-activate, #theme-deactivate { 1614 margin-left: -10px; 1615 margin-right: -10px; 1616 } 1571 1617 .box.theme { 1572 margin: .5em;1618 margin: 5px; 1573 1619 padding: 10px 10px 5px 10px; 1574 1620 border: 1px solid #dfdfdf; 1575 min-height: 295px;1576 1621 position: relative; 1577 1622 } … … 1579 1624 background: #ecf0f1 url(texture.png); 1580 1625 } 1581 #theme-new .box.theme {1582 width: 280px;1583 }1584 #theme-activate .box.theme {1585 min-height: 330px;1586 }1587 1626 .module-name { 1588 1627 margin-bottom: .5em; … … 1592 1631 } 1593 1632 .module-sshot img { 1594 padding: .5em;1633 padding: 5px; 1595 1634 background: #f7f7f7; 1596 1635 box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); 1597 1636 border: 3px solid #fff; 1598 padding: .5em; 1599 } 1600 .theme .module-sshot img { 1601 max-width: 280px; /* pour ceux qui n'ont pas de miniature */ 1602 } 1603 #theme-new .theme .module-sshot img { 1604 max-width: 240px; /* pour ceux qui n'ont pas de miniature */ 1637 max-width: 100%; 1638 } 1639 .module-actions { 1640 margin-top: 1em; 1641 } 1642 .bloc-toggler { 1643 text-align: right; 1644 } 1645 .bloc-toggler img { 1646 opacity: .4; 1647 } 1648 .bloc-toggler img:hover { 1649 opacity: 1; 1650 } 1651 .bloc-toggler a:focus img { 1652 opacity: 1; 1653 } 1654 span.module-version:before { 1655 content: "- "; 1656 } 1657 .toggle-bloc .mod-more { 1658 display: block; 1659 margin-left: 0; 1660 } 1661 .box.theme input { 1662 margin-bottom: 1em; 1663 } 1664 /** 1665 Les screenshots des thèmes ont deux tailles possibles : 1666 - dans Ajouter des thèmes : 240px (+ 10 padding image + 20 padding boîte + 6 bordure + 2 ombrage = 278) 1667 - dans Thèmes installés : 280px (+ 10 padding-image + 20 padding-boîte + 2 ombrage = 318) 1668 On adapte largeur et hauteur en fonction 1669 */ 1670 #theme-new .box.theme { /* Ajouter un thème */ 1671 width: 278px; 1672 min-height: 275px; 1673 } 1674 #theme-new .module-sshot img { /* Pour ceux qui n'ont pas de miniature on contraint l'image */ 1675 max-width: 240px; 1605 1676 max-height: 210px; 1606 1677 overflow: hidden; 1607 1678 } 1608 .module-actions { 1609 margin-top: 1em; 1610 } 1611 .bloc-toggler { 1612 text-align: right; 1613 } 1614 .bloc-toggler img { 1615 opacity: .4; 1616 } 1617 .bloc-toggler img:hover { 1618 opacity: 1; 1619 } 1620 .bloc-toggler a:focus img { 1621 opacity: 1; 1622 } 1623 span.module-version:before { 1624 content: "- "; 1625 } 1679 #theme-deactivate .box.theme { /* Thèmes désactivés */ 1680 width: 278px; 1681 } 1682 #theme-activate .box.theme { /* Thèmes installés */ 1683 width: 318px; 1684 min-height: 304px; 1685 max-width: 100%; 1686 } 1687 #theme-deactivate .box.theme:hover { 1688 background: transparent url(dc_logos/sq-logo-32.png) no-repeat top right; 1689 } 1690 /* si js est là, les infos viennent par dessus le screenshot */ 1626 1691 .with-js #theme-new .module-infos.toggle-bloc, 1627 1692 .with-js #theme-new .module-actions.toggle-bloc { 1628 1693 position: absolute; 1629 top: 138px;1630 1694 left: 10px; 1631 1695 width: 239px; 1696 margin: 0; 1632 1697 padding: 10px; 1633 1698 background: rgba(250, 250, 250, .95); 1634 1699 } 1635 1700 .with-js #theme-new .module-infos.toggle-bloc { 1636 top: 1 38px;1701 top: 128px; 1637 1702 height: 80px; 1638 1703 border-top: 1px solid #e3e3e3; 1639 1704 } 1640 1705 .with-js #theme-new .module-actions.toggle-bloc { 1641 top: 228px; 1642 height: 18px; 1643 margin: 0; 1706 top: 208px; 1707 height: 40px; 1644 1708 border-bottom: 1px solid #e3e3e3; 1645 1709 } 1646 . toggle-bloc .mod-more{1647 display: block;1648 margin-left: 0;1649 } 1650 .box.current-theme { 1651 width: 6 52px;1652 margin: .5em;1653 padding: 10px 18px;1710 .with-js .module-sshot:hover { 1711 cursor: pointer; 1712 } 1713 /* mise en forme pour la boîte du thème courant */ 1714 .box.current-theme { /* Thème courant */ 1715 width: 646px; 1716 margin: 5px; 1717 padding: 20px 18px 6px; 1654 1718 background: #fff url(texture.png); 1655 1719 border: 1px solid #eee; 1656 1720 border-radius: .5em; 1657 min-height: 3 30px;1721 min-height: 326px; 1658 1722 box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); 1723 position: relative; 1724 } 1725 .current-theme .module-sshot:hover { 1726 cursor: auto; 1659 1727 } 1660 1728 .current-theme .module-sshot img { 1661 1729 float: left; 1662 1730 margin-right: 2em; 1663 margin-bottom: 1em; 1664 border: 3px solid #fff; 1665 padding: .5em; 1731 border: 9px solid #fff; 1732 padding: 5px; 1733 max-width: 308px; 1734 max-height: 273px; 1666 1735 } 1667 1736 .current-theme .module-name { 1668 1737 color: #D33800; 1669 font-size: 1.33em; 1670 } 1671 .box.theme input { 1738 font-size: 1.5em; 1672 1739 margin-bottom: 1em; 1673 1740 } … … 1675 1742 width: auto; 1676 1743 overflow: hidden; 1677 padding-top: 3em;1744 padding-top: 2em; 1678 1745 margin: 1.5em 0 2em; 1679 1746 background: transparent url(../images/minus-theme.png) no-repeat left top; 1747 } 1748 .current-theme .actions-buttons { 1749 position: absolute; 1750 bottom: 0; 1751 right: 18px; 1680 1752 } 1681 1753 /* ------------------------------------------------------------------ categories.php */ … … 1721 1793 float: right; 1722 1794 margin-top: -.2em; 1723 font-size: 11px;1795 font-size: .91em; 1724 1796 } 1725 1797 .cat-buttons select { … … 1750 1822 margin: 9px; 1751 1823 padding: 10px 12px 6px; 1752 width: 3 00px;1824 width: 320px; 1753 1825 display: inline-block; 1754 1826 vertical-align: top; … … 1794 1866 li.media-action a { 1795 1867 border: none; 1868 } 1869 li.media-action a.attach-media { 1870 margin-right: 5px; 1796 1871 } 1797 1872 li.media-action form { … … 1931 2006 .upload-progress div { 1932 2007 width: 0; 1933 height: 1em; 1934 padding: .2em 0; 1935 font-size: 0.8em; 2008 height: 1.2em; 1936 2009 font-weight: bold; 1937 line-height: 1 em;2010 line-height: 1.2em; 1938 2011 text-align: right; 1939 2012 background: green url(loader.png) repeat-x left top; … … 1997 2070 padding: 4px 4px 0 20px; 1998 2071 } 2072 .modules a.module-config { 2073 /* todo: add icon here */ 2074 padding: 4px 4px 0 20px; 2075 } 1999 2076 #m_search { 2000 2077 background: transparent url(search.png) no-repeat 4px center; … … 2036 2113 margin-left: 0; 2037 2114 } 2038 #entry-content label {2039 text-transform: uppercase;2040 font-weight: bold;2041 margin-top: 2em;2042 display: inline-block;2043 }2044 #entry-content label:first-child {2045 margin-top: 0;2046 }2047 2115 #entry-sidebar { 2048 2116 width: 16em; … … 2050 2118 } 2051 2119 #entry-sidebar h4 { 2052 font-size: 13px; 2053 font-size: 1.3rem; 2120 font-size: 1.08em; 2054 2121 margin-top: .3em; 2055 2122 } … … 2137 2204 /* --------------------------------------------------------------------- user.php */ 2138 2205 .blog-perm { 2206 padding-top: 2em; 2207 } 2208 .blog-perm { 2139 2209 margin-top: 2em; 2140 2210 font-weight: bold; … … 2158 2228 font-size: 2em; 2159 2229 } 2230 .guideline #content h2:first-child { 2231 margin-top: 0; 2232 padding-top: .5em; 2233 } 2160 2234 .guideline h3 { 2161 2235 margin-top: 2em; … … 2168 2242 padding: 2px .5em; 2169 2243 } 2244 .guideline #main-menu ul { 2245 margin: 0; 2246 padding: 0; 2247 font-weight: normal; 2248 } 2249 .guideline #main-menu li { 2250 padding-left: 1em; 2251 } 2170 2252 /* ------------------------------------------------------------------------------------ 2171 2253 CLASSES … … 2331 2413 font-variant: small-caps; 2332 2414 } 2415 .index li {margin-bottom: 3px;} 2333 2416 .index a { 2334 2417 font-weight: bold; … … 2513 2596 UN POIL DE MEDIA QUERIES 2514 2597 ------------------------------------------------------------------------------------ */ 2515 @media screen and (max-width: 1000px) { 2598 @media screen and (min-width: 117em) { 2599 body { 2600 border: 1px solid #ccc; 2601 border-top-width: 0; 2602 } 2603 } 2604 @media screen and (min-width: 80em) { 2605 html { 2606 background: #fff; 2607 } 2608 body { 2609 max-width: 140em; 2610 margin: 0 auto; 2611 } 2612 #wrapper { 2613 background: #F7F7F7 url(bg_wrapper.png) repeat-y 18em; 2614 } 2615 #main { 2616 margin-left: -17em; 2617 } 2618 #content { 2619 margin: 0 0 0 17em; 2620 } 2621 #main-menu { 2622 width: 17em; 2623 } 2624 #collapser { 2625 left: 17em; 2626 } 2627 h1 { 2628 width: 19.5em; 2629 } 2630 } 2631 @media screen and (max-width: 61em) { 2516 2632 #top-info-blog #switchblog { 2517 2633 max-width: 16em; … … 2520 2636 margin-left: 2em; 2521 2637 } 2522 }2523 @media screen and (max-width: 960px) {2524 2638 #header { 2525 2639 display: block; … … 2561 2675 } 2562 2676 } 2563 @media screen and (max-width: 700px) { 2677 @media screen and (max-width: 48em) { 2678 #dashboard-boxes .box.medium, .box.medium, 2679 #dashboard-boxes .box.small, .box.small, 2680 #dashboard-boxes .box.large, .box.large { 2681 width: 95%; 2682 margin: 10px auto; 2683 } 2684 } 2685 @media screen and (max-width: 44em) { 2564 2686 #help-button { 2565 2687 height: 26px; … … 2568 2690 padding: 0; 2569 2691 margin: 0; 2570 font-size: 10px; 2571 font-size: 1rem; 2692 font-size: .83em; 2572 2693 line-height: 68px; 2573 2694 overflow: hidden; … … 2576 2697 top: 77px; 2577 2698 } 2578 .one-box, .two-boxes, . two-boxes.odd, .two-boxes.even, .box,2699 .one-box, .two-boxes, .box, 2579 2700 .two-cols .col { 2580 width: 100%;2701 width: 96%; 2581 2702 margin-left: 0; 2582 2703 margin-right: 0; 2583 2704 } 2705 #entry-wrapper { 2706 float: none; 2707 width: 100%; 2708 margin-right: 0; 2709 } 2710 #entry-content { 2711 margin-right: 0; 2712 margin-left: 0; 2713 } 2714 #entry-sidebar { 2715 width: 100%; 2716 float: none; 2717 } 2584 2718 } 2585 @media screen and (max-width: 600px) {2719 @media screen and (max-width: 38em) { 2586 2720 #header h1, #header h1 a { 2587 2721 width: 42px !important; … … 2589 2723 } 2590 2724 h1 a:link { 2591 background: transparent url(dc_logos/b-dotclear120.png) no-repeat - 180px 6px;2725 background: transparent url(dc_logos/b-dotclear120.png) no-repeat -270px 6px; 2592 2726 border-right: 1px solid #ccc; 2593 2727 } 2594 2728 h1 a:hover, h1 a:focus { 2595 background: url(dc_logos/b-dotclear120.png) no-repeat - 180px -94px;2729 background: url(dc_logos/b-dotclear120.png) no-repeat -270px -94px; 2596 2730 border-right: 1px solid #A2CBE9; 2597 2731 } … … 2601 2735 width: 100%; 2602 2736 margin: 0; 2737 } 2738 #dashboard-main { 2739 padding: 0; 2603 2740 } 2604 2741 #main-menu a { … … 2617 2754 } 2618 2755 #main #content > h2 { 2619 margin: 0 ;2620 padding: 6px 30px 6px 0;2621 } 2622 #dashboard-boxes .box.medium, 2623 #dashboard-boxes .box.small, 2624 #dashboard-boxes .box.large {2625 width: 100%;2756 margin: 0 -.5em 1em; 2757 padding: 6px 30px 4px .5em; 2758 } 2759 #dashboard-boxes .box.medium, .box.medium, 2760 #dashboard-boxes .box.small, .box.small, 2761 #dashboard-boxes .box.large, .box.large { 2762 width: 95%; 2626 2763 margin: 10px auto; 2627 2764 } 2765 .cell, #filters-form .cell { 2766 display: inline-block; 2767 border: none; 2768 padding: 1em; 2769 vertical-align: bottom; 2770 } 2628 2771 } 2629 @media screen and (max-width: 420px) {2772 @media screen and (max-width: 26.5em) { 2630 2773 h1, h1 a { 2631 2774 padding: 0; … … 2642 2785 margin-bottom: .5em; 2643 2786 } 2787 #wrapper { 2788 font-size: 1.4em; 2789 } 2790 #content.with-help #help-button { 2791 top: 120px; 2792 right: 20.5em; 2793 } 2794 #content.with-help #help { 2795 font-size: 12px; 2796 } 2797 p.top-add { 2798 margin-bottom: .5em; 2799 text-align: center; 2800 } 2801 .multi-part { 2802 padding-left: 0; 2803 } 2804 .part-tabs ul { 2805 margin: 1em 0; 2806 padding: 0 .5em; 2807 } 2808 .part-tabs li a { 2809 display: block; 2810 width: 100%; 2811 } 2644 2812 #icons p { 2645 width: 150px; 2646 } 2647 #content.with-help #help-button { 2648 top: 101px; 2813 width: 9em; 2814 padding: 1em .25em; 2815 } 2816 .media-item { 2817 width: 90%; 2818 } 2819 #theme-new, #theme-activate, #theme-deactivate { 2820 margin-left: 0; 2821 margin-right: 0; 2822 } 2823 .box.current-theme { 2824 margin: 5px; 2825 padding: 10px; 2826 width: 100%; 2827 } 2828 .current-theme .module-sshot img { 2829 margin: 0; 2830 float: none; 2831 max-width: 100%; 2832 } 2833 table .maximal { 2834 min-width: 14em; 2835 } 2836 th, td { 2837 padding: 0.3em 1em 0.3em 0; 2649 2838 } 2650 2839 }
Note: See TracChangeset
for help on using the changeset viewer.