Compare commits
7 Commits
0cab0ac4a9
...
9b68b2b706
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b68b2b706 | |||
| 63e98db1df | |||
| 737d9e0708 | |||
| b499ca0a00 | |||
| 5ba98aaef2 | |||
| 4bcbd10b0f | |||
| 7245cf779c |
|
|
@ -19,3 +19,4 @@ require_once(__DIR__ . '/includes/factories.php');
|
|||
require_once(__DIR__ . '/includes/export-datas.php');
|
||||
require_once(__DIR__ . '/includes/dashboard-widget.php');
|
||||
require_once(__DIR__ . '/includes/gestion.php');
|
||||
// require_once(__DIR__ . '/includes/admin-theme.php');
|
||||
|
|
|
|||
49
includes/admin-theme.php
Normal file
49
includes/admin-theme.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Enregistre le thème d'administration personnalisé "Metiers du patrimoine"
|
||||
*/
|
||||
function register_metier_patrimoine_admin_theme()
|
||||
{
|
||||
// Enregistrer le thème d'administration personnalisé
|
||||
wp_admin_css_color(
|
||||
'metier_patrimoine',
|
||||
__('Métiers du patrimoine', 'metiers-du-patrimoine'),
|
||||
get_stylesheet_directory_uri() . '/metier_patrimoine.css',
|
||||
array('#282a34', '#8b2ff7', '#e14d43', '#f1f2f3')
|
||||
);
|
||||
}
|
||||
add_action('admin_init', 'register_metier_patrimoine_admin_theme');
|
||||
|
||||
/**
|
||||
* Applique le thème d'administration personnalisé aux nouveaux utilisateurs
|
||||
*/
|
||||
function set_default_admin_color($user_id)
|
||||
{
|
||||
update_user_meta($user_id, 'admin_color', 'metier_patrimoine');
|
||||
}
|
||||
add_action('user_register', 'set_default_admin_color');
|
||||
|
||||
/**
|
||||
* Empêche les utilisateurs de changer leur thème d'administration
|
||||
*/
|
||||
function lock_admin_color($all_colors)
|
||||
{
|
||||
// Récupérer l'utilisateur actuel
|
||||
$user = wp_get_current_user();
|
||||
|
||||
// Si l'utilisateur n'est pas administrateur, supprimer tous les thèmes sauf metier_patrimoine
|
||||
if (!in_array('administrator', (array) $user->roles, true)) {
|
||||
unset($all_colors);
|
||||
$all_colors = array(
|
||||
'metier_patrimoine' => array(
|
||||
'name' => __('Métiers du patrimoine', 'metiers-du-patrimoine'),
|
||||
'url' => get_stylesheet_directory_uri() . '/metier_patrimoine.css',
|
||||
'colors' => array('#282a34', '#8b2ff7', '#e14d43', '#f1f2f3')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $all_colors;
|
||||
}
|
||||
add_filter('admin_color_scheme_picker', 'lock_admin_color');
|
||||
|
|
@ -135,9 +135,9 @@ add_action('edit_form_after_title', function () {
|
|||
?>
|
||||
<div id="post-custom-superior-toolbar">
|
||||
<?php if ($return_to) : ?>
|
||||
<a href="<?php echo esc_url($return_to) ?>" class="edit-fiche-artisan-link"><img src='<?php echo get_stylesheet_directory_uri() . '/resources/img/icons/tools.svg' ?>' /> Voir la fiche de l'artisan </a>
|
||||
<a href="<?php echo esc_url($return_to) ?>" class="edit-fiche-artisan-link"><img src='<?php echo get_stylesheet_directory_uri() . '/resources/img/icons/tools.svg' ?>' /> Retour vers la fiche de l’artisan </a>
|
||||
<?php elseif ($linked_artisan_id) : ?>
|
||||
<a href="<?php echo esc_url($edit_artisan_link) ?>" class="edit-fiche-artisan-link"><img src='<?php echo get_stylesheet_directory_uri() . '/resources/img/icons/tools.svg' ?>' /> Voir la fiche de l'artisan </a>
|
||||
<a href="<?php echo esc_url($edit_artisan_link) ?>" class="edit-fiche-artisan-link"><img src='<?php echo get_stylesheet_directory_uri() . '/resources/img/icons/tools.svg' ?>' /> Retour vers la fiche de l’artisan </a>
|
||||
<?php endif; ?>
|
||||
<div id="save-post-custom">
|
||||
<button class="">Sauvegarder</button>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
function create_conseiller_role()
|
||||
{
|
||||
// Récupérer les capacités du rôle author
|
||||
$author_role = get_role('author');
|
||||
$author_role = get_role('editor');
|
||||
$capabilities = $author_role->capabilities;
|
||||
|
||||
$capabilities['export_artisans_datas'] = false;
|
||||
|
|
@ -15,17 +15,23 @@ function create_conseiller_role()
|
|||
$capabilities['read'] = true;
|
||||
$capabilities['upload_files'] = true;
|
||||
|
||||
// Capacités pour la gestion des médias
|
||||
// $capabilities['edit_posts'] = true;
|
||||
// $capabilities['delete_posts'] = true;
|
||||
// $capabilities['edit_published_posts'] = true;
|
||||
// $capabilities['delete_published_posts'] = true;
|
||||
// $capabilities['edit_others_posts'] = false; // Ne peut pas éditer les posts des autres
|
||||
// $capabilities['delete_others_posts'] = false; // Ne peut pas supprimer les posts des autres
|
||||
// $capabilities['edit_attachments'] = true; // Peut éditer ses propres médias
|
||||
// $capabilities['delete_attachments'] = true; // Peut supprimer ses propres médias
|
||||
// $capabilities['edit_others_attachments'] = false; // Ne peut pas éditer les médias des autres
|
||||
// $capabilities['delete_others_attachments'] = false; // Ne peut pas supprimer les médias des autres
|
||||
// Capacités WPML pour la traduction
|
||||
$capabilities['wpml_manage_translations'] = true;
|
||||
$capabilities['wpml_manage_string_translation'] = true;
|
||||
$capabilities['wpml_manage_woocommerce_translation'] = true;
|
||||
$capabilities['wpml_manage_navigation'] = true;
|
||||
$capabilities['wpml_manage_media_translation'] = true;
|
||||
$capabilities['wpml_manage_taxonomy_translation'] = true;
|
||||
$capabilities['wpml_manage_languages'] = true;
|
||||
$capabilities['wpml_manage_theme_and_plugin_strings'] = true;
|
||||
$capabilities['wpml_manage_translation_management'] = true;
|
||||
$capabilities['wpml_manage_translation_priorities'] = true;
|
||||
$capabilities['wpml_manage_translation_services'] = true;
|
||||
$capabilities['wpml_manage_translation_workflows'] = true;
|
||||
$capabilities['wpml_manage_translation_jobs'] = true;
|
||||
$capabilities['wpml_manage_translation_assignments'] = true;
|
||||
|
||||
|
||||
|
||||
add_role('conseiller', 'Conseiller', $capabilities);
|
||||
}
|
||||
|
|
@ -70,3 +76,17 @@ function hide_dashboard_widgets_for_conseiller()
|
|||
}
|
||||
}
|
||||
add_action('wp_dashboard_setup', 'hide_dashboard_widgets_for_conseiller');
|
||||
|
||||
|
||||
function apply_admin_color_to_all_users()
|
||||
{
|
||||
$users = get_users();
|
||||
|
||||
foreach ($users as $user) {
|
||||
wp_update_user([
|
||||
'ID' => $user->ID,
|
||||
'admin_color' => 'metier_patrimoine' // Thème personnalisé Metiers du patrimoine
|
||||
]);
|
||||
}
|
||||
}
|
||||
add_action('after_switch_theme', 'apply_admin_color_to_all_users');
|
||||
|
|
|
|||
|
|
@ -57,8 +57,16 @@ body.post-type-artisans {
|
|||
}
|
||||
}
|
||||
|
||||
.column-status .status-state {
|
||||
@apply !border-none;
|
||||
.column-state {
|
||||
.status-state {
|
||||
@apply !border-none;
|
||||
}
|
||||
.status-state--offline {
|
||||
@apply !bg-zinc-400 !text-white;
|
||||
}
|
||||
.status-state--publish {
|
||||
@apply !bg-green-700 !text-white;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1600px) {
|
||||
#lastmodified,
|
||||
|
|
@ -418,11 +426,25 @@ ul.striped > :nth-child(odd) {
|
|||
@apply bg-neutral-50;
|
||||
background-color: #efeef04d;
|
||||
}
|
||||
#rank_math_seo_details {
|
||||
@apply !hidden;
|
||||
}
|
||||
#the-list {
|
||||
.column-rank_math_seo_details,
|
||||
.rank-math-column-display.seo-score,
|
||||
.rank-math-column-display.schema-type {
|
||||
@apply !hidden;
|
||||
.rank-math-column-display.schema-type,
|
||||
th.column-rank_math_seo_details,
|
||||
td.column-rank_math_seo_details,
|
||||
.rank-math-column-display,
|
||||
.rank-math-column-display * {
|
||||
@apply !hidden !w-0 !p-0 !m-0 !border-0;
|
||||
width: 0 !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
border: 0 !important;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.rank_math_seo_details.column-rank_math_seo_details > *,
|
||||
.date.column-date {
|
||||
@apply !text-neutral-500;
|
||||
|
|
@ -455,8 +477,11 @@ ul.striped > :nth-child(odd) {
|
|||
@apply text-neutral-400 pl-2;
|
||||
}
|
||||
|
||||
#rank-math-seo-filter {
|
||||
@apply hidden;
|
||||
#rank-math-seo-filter,
|
||||
.rank-math-seo-filter,
|
||||
.rank-math-seo-filter * {
|
||||
@apply !hidden;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* .tablenav select[name='metiers'] {
|
||||
|
|
@ -649,6 +674,7 @@ select[data-enpassusermodified='yes'] {
|
|||
@apply !mr-12 2xl:!mr-32 !max-w-screen-2xl;
|
||||
}
|
||||
}
|
||||
|
||||
#dashboard_activity {
|
||||
@apply !hidden;
|
||||
}
|
||||
|
|
@ -749,3 +775,58 @@ li a[href='my-sites.php'] {
|
|||
.acf-gallery-add {
|
||||
@apply !bg-patrimoine-sante-securite !text-white !border-none !rounded-xl !px-4 !py-1 ml-auto;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------
|
||||
USERS PROFILE PAGE
|
||||
-----------------------------------------------------------*/
|
||||
.profile-php {
|
||||
.user-profile-picture,
|
||||
.user-rich-editing-wrap,
|
||||
.user-url-wrap,
|
||||
.user-description-wrap,
|
||||
.user-url-wrap + tr,
|
||||
.user-twitter-wrap,
|
||||
.user-twitter-wrap,
|
||||
.user-facebook-wrap,
|
||||
.user-comment-shortcuts-wrap,
|
||||
.user-additional_profile_urls-wrap,
|
||||
.user-language-wrap,
|
||||
.rank-math-metabox-wrap,
|
||||
table:has(.user-display-name-wrap) + h2,
|
||||
table:has(.user-email-wrap) + h2,
|
||||
.application-passwords {
|
||||
@apply !hidden;
|
||||
}
|
||||
|
||||
&.role-conseiller,
|
||||
&.role-editor,
|
||||
&.role-author {
|
||||
table:has(.user-admin-color-wrap),
|
||||
.show-admin-bar,
|
||||
.rank-math-metabox-wrap + h2,
|
||||
table:has(.user-capabilities-wrap) {
|
||||
@apply hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wp-list-table {
|
||||
th.column-rank_math_seo_details,
|
||||
td.column-rank_math_seo_details {
|
||||
@apply !hidden;
|
||||
display: none !important;
|
||||
width: 0 !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
border: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.tablenav.top,
|
||||
.tablenav.bottom {
|
||||
.rank-math-seo-filter,
|
||||
.rank-math-seo-filter * {
|
||||
@apply !hidden;
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,15 +12,27 @@
|
|||
}
|
||||
|
||||
.filters {
|
||||
@apply flex gap-1 items-center pt-4 mb-12;
|
||||
@apply grid grid-cols-2 gap-0 items-end pt-4 mb-12;
|
||||
|
||||
a {
|
||||
border: none !important;
|
||||
@apply !text-xl;
|
||||
border-top: none !important;
|
||||
border-left: none !important;
|
||||
border-right: none !important;
|
||||
border-radius: 0 !important;
|
||||
@apply !bg-transparent;
|
||||
|
||||
&.filter-active {
|
||||
@apply bg-neutral-500 text-white opacity-20 pointer-events-none;
|
||||
@apply text-patrimoine-sante-securite border border-b-4 border-patrimoine-sante-securite !cursor-not-allowed pointer-events-none;
|
||||
border-bottom: 6px solid theme('colors.patrimoine-sante-securite') !important;
|
||||
}
|
||||
&:not(.filter-active) {
|
||||
@apply bg-patrimoine-sante-securite text-white;
|
||||
@apply text-neutral-500 text-neutral-500 opacity-50;
|
||||
border-bottom: 1px solid theme('colors.neutral.500') !important;
|
||||
transition: border-bottom 0.3s ease-in-out;
|
||||
&:hover {
|
||||
border-bottom: 6px solid theme('colors.neutral.500') !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,9 @@ $queryAllUnaffectedArtisansByStatus = array(
|
|||
'compare' => '='
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
'orderby' => 'title',
|
||||
'order' => 'ASC'
|
||||
);
|
||||
|
||||
$queryConseillerRelatedArtisansByStatus = array(
|
||||
|
|
@ -55,7 +57,9 @@ $queryConseillerRelatedArtisansByStatus = array(
|
|||
'value' => $status,
|
||||
'compare' => '='
|
||||
),
|
||||
)
|
||||
),
|
||||
'orderby' => 'title',
|
||||
'order' => 'ASC'
|
||||
);
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user