Changeset 3745:452015a1fe20 for admin/posts.php
- Timestamp:
- 03/30/18 11:37:23 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/posts.php
r3731 r3745 41 41 42 42 # Creating filter combo boxes 43 if (!$core->error->flag()) { 44 # Filter form we'll put in html_block 45 $users_combo = dcAdminCombos::getUsersCombo($users); 46 dcUtils::lexicalKeySort($users_combo); 47 $users_combo = array_merge( 48 array('-' => ''), 49 $users_combo 50 ); 51 52 $categories_combo = array_merge( 53 array( 54 new formSelectOption('-', ''), 55 new formSelectOption(__('(No cat)'), 'NULL')), 56 dcAdminCombos::getCategoriesCombo($categories, false) 57 ); 58 $categories_values = array(); 59 foreach ($categories_combo as $cat) { 60 if (isset($cat->value)) { 61 $categories_values[$cat->value] = true; 62 } 63 } 64 65 $status_combo = array_merge( 66 array('-' => ''), 67 dcAdminCombos::getPostStatusesCombo() 68 ); 69 70 $selected_combo = array( 71 '-' => '', 72 __('Selected') => '1', 73 __('Not selected') => '0' 74 ); 75 76 $comment_combo = array( 77 '-' => '', 78 __('Opened') => '1', 79 __('Closed') => '0' 80 ); 81 82 $trackback_combo = array( 83 '-' => '', 84 __('Opened') => '1', 85 __('Closed') => '0' 86 ); 87 88 $attachment_combo = array( 89 '-' => '', 90 __('With attachments') => '1', 91 __('Without attachments') => '0' 92 ); 93 94 $password_combo = array( 95 '-' => '', 96 __('With password') => '1', 97 __('Without password') => '0' 98 ); 99 100 # Months array 101 $dt_m_combo = array_merge( 102 array('-' => ''), 103 dcAdminCombos::getDatesCombo($dates) 104 ); 105 106 $lang_combo = array_merge( 107 array('-' => ''), 108 dcAdminCombos::getLangsCombo($langs, false) 109 ); 110 111 # Post formats 112 $core_formaters = $core->getFormaters(); 113 $available_formats = array(); 114 foreach ($core_formaters as $editor => $formats) { 115 foreach ($formats as $format) { 116 $available_formats[$format] = $format; 117 } 118 } 119 $format_combo = array_merge( 120 array('-' => ''), 121 $available_formats 122 ); 123 124 $sortby_combo = array( 125 __('Date') => 'post_dt', 126 __('Title') => 'post_title', 127 __('Category') => 'cat_title', 128 __('Author') => 'user_id', 129 __('Status') => 'post_status', 130 __('Selected') => 'post_selected', 131 __('Number of comments') => 'nb_comment', 132 __('Number of trackbacks') => 'nb_trackback' 133 ); 134 135 $sortby_lex = array( 136 // key in sorty_combo (see above) => field in SQL request 137 'post_title' => 'post_title', 138 'cat_title' => 'cat_title', 139 'user_id' => 'P.user_id'); 140 141 $order_combo = array( 142 __('Descending') => 'desc', 143 __('Ascending') => 'asc' 144 ); 145 } 43 $users_combo = dcAdminCombos::getUsersCombo($users); 44 dcUtils::lexicalKeySort($users_combo); 45 $users_combo = array_merge( 46 array('-' => ''), 47 $users_combo 48 ); 49 50 $categories_combo = array_merge( 51 array( 52 new formSelectOption('-', ''), 53 new formSelectOption(__('(No cat)'), 'NULL')), 54 dcAdminCombos::getCategoriesCombo($categories, false) 55 ); 56 $categories_values = array(); 57 foreach ($categories_combo as $cat) { 58 if (isset($cat->value)) { 59 $categories_values[$cat->value] = true; 60 } 61 } 62 63 $status_combo = array_merge( 64 array('-' => ''), 65 dcAdminCombos::getPostStatusesCombo() 66 ); 67 68 $selected_combo = array( 69 '-' => '', 70 __('Selected') => '1', 71 __('Not selected') => '0' 72 ); 73 74 $comment_combo = array( 75 '-' => '', 76 __('Opened') => '1', 77 __('Closed') => '0' 78 ); 79 80 $trackback_combo = array( 81 '-' => '', 82 __('Opened') => '1', 83 __('Closed') => '0' 84 ); 85 86 $attachment_combo = array( 87 '-' => '', 88 __('With attachments') => '1', 89 __('Without attachments') => '0' 90 ); 91 92 $password_combo = array( 93 '-' => '', 94 __('With password') => '1', 95 __('Without password') => '0' 96 ); 97 98 # Months array 99 $dt_m_combo = array_merge( 100 array('-' => ''), 101 dcAdminCombos::getDatesCombo($dates) 102 ); 103 104 $lang_combo = array_merge( 105 array('-' => ''), 106 dcAdminCombos::getLangsCombo($langs, false) 107 ); 108 109 # Post formats 110 $core_formaters = $core->getFormaters(); 111 $available_formats = array(); 112 foreach ($core_formaters as $editor => $formats) { 113 foreach ($formats as $format) { 114 $available_formats[$format] = $format; 115 } 116 } 117 $format_combo = array_merge( 118 array('-' => ''), 119 $available_formats 120 ); 121 122 $sortby_combo = array( 123 __('Date') => 'post_dt', 124 __('Title') => 'post_title', 125 __('Category') => 'cat_title', 126 __('Author') => 'user_id', 127 __('Status') => 'post_status', 128 __('Selected') => 'post_selected', 129 __('Number of comments') => 'nb_comment', 130 __('Number of trackbacks') => 'nb_trackback' 131 ); 132 133 $sortby_lex = array( 134 // key in sorty_combo (see above) => field in SQL request 135 'post_title' => 'post_title', 136 'cat_title' => 'cat_title', 137 'user_id' => 'P.user_id'); 138 139 $order_combo = array( 140 __('Descending') => 'desc', 141 __('Ascending') => 'asc' 142 ); 146 143 147 144 # Actions combo box
Note: See TracChangeset
for help on using the changeset viewer.