Changeset 3874:ab8368569446 for admin/services.php
- Timestamp:
- 09/14/18 12:16:17 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/services.php
r3833 r3874 10 10 require dirname(__FILE__) . '/../inc/admin/prepend.php'; 11 11 12 $core->rest->addFunction('getPostsCount', array('dcRestMethods', 'getPostsCount'));13 $core->rest->addFunction('getCommentsCount', array('dcRestMethods', 'getCommentsCount'));14 $core->rest->addFunction('checkNewsUpdate', array('dcRestMethods', 'checkNewsUpdate'));15 $core->rest->addFunction('checkCoreUpdate', array('dcRestMethods', 'checkCoreUpdate'));16 $core->rest->addFunction('getPostById', array('dcRestMethods', 'getPostById'));17 $core->rest->addFunction('getCommentById', array('dcRestMethods', 'getCommentById'));18 $core->rest->addFunction('quickPost', array('dcRestMethods', 'quickPost'));19 $core->rest->addFunction('validatePostMarkup', array('dcRestMethods', 'validatePostMarkup'));20 $core->rest->addFunction('getZipMediaContent', array('dcRestMethods', 'getZipMediaContent'));21 $core->rest->addFunction('getMeta', array('dcRestMethods', 'getMeta'));22 $core->rest->addFunction('delMeta', array('dcRestMethods', 'delMeta'));23 $core->rest->addFunction('setPostMeta', array('dcRestMethods', 'setPostMeta'));24 $core->rest->addFunction('searchMeta', array('dcRestMethods', 'searchMeta'));25 $core->rest->addFunction('setSectionFold', array('dcRestMethods', 'setSectionFold'));26 $core->rest->addFunction('getModuleById', array('dcRestMethods', 'getModuleById'));27 $core->rest->addFunction('setDashboardPositions', array('dcRestMethods', 'setDashboardPositions'));12 $core->rest->addFunction('getPostsCount', ['dcRestMethods', 'getPostsCount']); 13 $core->rest->addFunction('getCommentsCount', ['dcRestMethods', 'getCommentsCount']); 14 $core->rest->addFunction('checkNewsUpdate', ['dcRestMethods', 'checkNewsUpdate']); 15 $core->rest->addFunction('checkCoreUpdate', ['dcRestMethods', 'checkCoreUpdate']); 16 $core->rest->addFunction('getPostById', ['dcRestMethods', 'getPostById']); 17 $core->rest->addFunction('getCommentById', ['dcRestMethods', 'getCommentById']); 18 $core->rest->addFunction('quickPost', ['dcRestMethods', 'quickPost']); 19 $core->rest->addFunction('validatePostMarkup', ['dcRestMethods', 'validatePostMarkup']); 20 $core->rest->addFunction('getZipMediaContent', ['dcRestMethods', 'getZipMediaContent']); 21 $core->rest->addFunction('getMeta', ['dcRestMethods', 'getMeta']); 22 $core->rest->addFunction('delMeta', ['dcRestMethods', 'delMeta']); 23 $core->rest->addFunction('setPostMeta', ['dcRestMethods', 'setPostMeta']); 24 $core->rest->addFunction('searchMeta', ['dcRestMethods', 'searchMeta']); 25 $core->rest->addFunction('setSectionFold', ['dcRestMethods', 'setSectionFold']); 26 $core->rest->addFunction('getModuleById', ['dcRestMethods', 'getModuleById']); 27 $core->rest->addFunction('setDashboardPositions', ['dcRestMethods', 'setDashboardPositions']); 28 28 29 29 $core->rest->serve(); … … 40 40 public static function getPostsCount($core, $get) 41 41 { 42 $count = $core->blog->getPosts( array(), true)->f(0);42 $count = $core->blog->getPosts([], true)->f(0); 43 43 $str = sprintf(__('%d post', '%d posts', $count), $count); 44 44 … … 57 57 public static function getCommentsCount($core, $get) 58 58 { 59 $count = $core->blog->getComments( array(), true)->f(0);59 $count = $core->blog->getComments([], true)->f(0); 60 60 $str = sprintf(__('%d comment', '%d comments', $count), $count); 61 61 … … 135 135 '<div class="dc-update" id="ajax-update"><h3>' . sprintf(__('Dotclear %s is available!'), $new_v) . '</h3> ' . 136 136 '<p><a class="button submit" href="' . $core->adminurl->get("admin.update") . '">' . sprintf(__('Upgrade now'), $new_v) . '</a> ' . 137 '<a class="button" href="' . $core->adminurl->get("admin.update", array('hide_msg' => 1)) . '">' . __('Remind me later') . '</a>' .137 '<a class="button" href="' . $core->adminurl->get("admin.update", ['hide_msg' => 1]) . '">' . __('Remind me later') . '</a>' . 138 138 ($version_info ? ' </p>' . 139 139 '<p class="updt-info"><a href="' . $version_info . '">' . __('Information about this version') . '</a>' : '') . '</p>' . … … 166 166 } 167 167 168 $params = array('post_id' => (integer) $get['id']);168 $params = ['post_id' => (integer) $get['id']]; 169 169 170 170 if (isset($get['post_type'])) { … … 232 232 } 233 233 234 $rs = $core->blog->getComments( array('comment_id' => (integer) $get['id']));234 $rs = $core->blog->getComments(['comment_id' => (integer) $get['id']]); 235 235 236 236 if ($rs->isEmpty()) { … … 308 308 $rsp->id = $return_id; 309 309 310 $post = $core->blog->getPosts( array('post_id' => $return_id));310 $post = $core->blog->getPosts(['post_id' => $return_id]); 311 311 312 312 $rsp->post_status = $post->post_status; … … 392 392 $sortby = !empty($get['sortby']) ? $get['sortby'] : 'meta_type,asc'; 393 393 394 $rs = $core->meta->getMetadata( array(394 $rs = $core->meta->getMetadata([ 395 395 'meta_type' => $metaType, 396 396 'limit' => $limit, 397 397 'meta_id' => $metaId, 398 'post_id' => $postid ));398 'post_id' => $postid]); 399 399 $rs = $core->meta->computeMetaStats($rs); 400 400 … … 451 451 452 452 # Get previous meta for post 453 $post_meta = $core->meta->getMetadata( array(453 $post_meta = $core->meta->getMetadata([ 454 454 'meta_type' => $post['metaType'], 455 'post_id' => $post['postId'] ));456 $pm = array();455 'post_id' => $post['postId']]); 456 $pm = []; 457 457 while ($post_meta->fetch()) { 458 458 $pm[] = $post_meta->meta_id; … … 494 494 $sortby = !empty($get['sortby']) ? $get['sortby'] : 'meta_type,asc'; 495 495 496 $rs = $core->meta->getMetadata( array('meta_type' => $metaType));496 $rs = $core->meta->getMetadata(['meta_type' => $metaType]); 497 497 $rs = $core->meta->computeMetaStats($rs); 498 498 … … 549 549 $toggles = explode(',', trim($core->auth->user_prefs->toggles->unfolded_sections)); 550 550 } else { 551 $toggles = array();551 $toggles = []; 552 552 } 553 553 $k = array_search($section, $toggles); … … 598 598 $id = $get['id']; 599 599 $list = $get['list']; 600 $module = array();600 $module = []; 601 601 602 602 if ($list == 'plugin-activate') {
Note: See TracChangeset
for help on using the changeset viewer.