Skip to content

Commit

Permalink
factorized signature in admin menus, added again plugin version in si…
Browse files Browse the repository at this point in the history
…gnature
  • Loading branch information
jcvignoli committed Feb 27, 2024
1 parent d6dfbdb commit cd3cf4a
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 28 deletions.
18 changes: 16 additions & 2 deletions dist/class/admin/class-admin-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ private function lumiere_admin_menu(): void {
// The class.
$general_class = new General();
$general_class->display_general_options( new Cache_Tools() );

$this->lumiere_add_signature_menus();
}

/**
Expand All @@ -408,6 +410,8 @@ private function lumiere_admin_menu_data(): void {
// The class.
$data_class = new Data();
$data_class->display_data_options();

$this->lumiere_add_signature_menus();
}

/**
Expand All @@ -420,8 +424,7 @@ private function lumiere_admin_menu_cache(): void {
$cache_class = new Cache();
$cache_class->display_cache_options( new Cache_Tools() );

// Signature.
$this->include_with_vars( 'admin-menu-signature', [ $this->page_general_help_support ] /** Add in an array all vars to send in the template */ );
$this->lumiere_add_signature_menus();
}

/**
Expand All @@ -433,6 +436,17 @@ private function lumiere_admin_menu_help(): void {
// The class.
$help_class = new Help();
$help_class->display_help_layout();

$this->lumiere_add_signature_menus();
}

/**
* Display the end of page signature for Lumiere
* All pages have it
*/
private function lumiere_add_signature_menus(): void {
// Signature.
$this->include_with_vars( 'admin-menu-signature', [ $this->page_general_help_support, $this->config_class->lumiere_version ] /** Add in an array all vars to send in the template */ );
}

/**
Expand Down
3 changes: 0 additions & 3 deletions dist/class/admin/submenu/class-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ protected function display_data_options(): void {
// The template will retrieve the args. In parent class.
$this->include_with_vars( 'data/admin-data-order', [ $this ] );
}

// Signature.
$this->include_with_vars( 'admin-menu-signature', [ $this->page_general_help_support ] /** Add an array with vars to send in the template */ );
}

/**
Expand Down
3 changes: 0 additions & 3 deletions dist/class/admin/submenu/class-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ protected function display_general_options( Cache_Tools $cache_tools_class ): vo
) {
$this->include_with_vars( self::PAGES_NAMES['advanced_options'], [] /** Add an array with vars to send in the template */ );
}

// Signature.
$this->include_with_vars( self::PAGES_NAMES['signature'], [ $this->page_general_help_support ] /** Add an array with vars to send in the template */ );
}
}

3 changes: 0 additions & 3 deletions dist/class/admin/submenu/class-help.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ public function display_help_layout(): void {
}

echo "\n\t" . '</div>';

// Signature.
$this->include_with_vars( 'admin-menu-signature', [ $this->page_general_help_support ] /** Add in an array all vars to send in the template */ );
}

/**
Expand Down
8 changes: 5 additions & 3 deletions dist/class/templates/admin/admin-menu-signature.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@

// Get transients vars from the calling class.
$lumiere_helpage = get_transient( 'admin_template_pass_vars' )[0];
$lumiere_version = get_transient( 'admin_template_pass_vars' )[1];
?>

<div class="soustitre lumiere_signature">
<div><?php
/* translators: %1$s and %2$s are replaced with an html strong tag, %3$s and %4$s are html ahref tags */
echo wp_kses( wp_sprintf( __( '%1$sLicensing Info:%2$s Under a GPL licence, on various libraries. However, much work was required to implement it in WordPress and maintain it; check the support page for %3$smore information%4$s.', 'lumiere-movies' ), '<strong>', '</strong>', '<a href="' . esc_url( $lumiere_helpage ) . '">', '</a>' ), $lumiere_esc_html );
/* translators: %1$s and %2$s are replaced with an html strong tag, %3$s and %4$s are html ahref tags */
echo wp_kses( wp_sprintf( __( '%1$sLicensing Info:%2$s Under a GPL licence, on various libraries. However, much work was required to implement it in WordPress and maintain it; check the support page for %3$smore information%4$s.', 'lumiere-movies' ), '<strong>', '</strong>', '<a href="' . esc_url( $lumiere_helpage ) . '">', '</a>' ), $lumiere_esc_html );
?></div>
<br />
<div> &copy; 2005-<?php echo esc_html( gmdate( 'Y' ) ); ?> <a href="<?php echo esc_html( Settings::IMDBABOUTENGLISH ); ?>" target="_blank">Lost Highway</a>, <a href="<?php echo esc_html( Settings::IMDBHOMEPAGE ); ?>" target="_blank">Lumière! WordPress plugin</a>
<div>
&copy; 2005-<?php echo esc_html( gmdate( 'Y' ) ); ?> <a href="<?php echo esc_html( Settings::IMDBABOUTENGLISH ); ?>" target="_blank">Lost Highway</a>, <a href="<?php echo esc_html( Settings::IMDBHOMEPAGE ); ?>" target="_blank">Lumière! WordPress plugin</a> version <?php echo esc_html( $lumiere_version ); ?>.
</div>
</div>
18 changes: 16 additions & 2 deletions src/class/admin/class-admin-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ private function lumiere_admin_menu(): void {
// The class.
$general_class = new General();
$general_class->display_general_options( new Cache_Tools() );

$this->lumiere_add_signature_menus();
}

/**
Expand All @@ -408,6 +410,8 @@ private function lumiere_admin_menu_data(): void {
// The class.
$data_class = new Data();
$data_class->display_data_options();

$this->lumiere_add_signature_menus();
}

/**
Expand All @@ -420,8 +424,7 @@ private function lumiere_admin_menu_cache(): void {
$cache_class = new Cache();
$cache_class->display_cache_options( new Cache_Tools() );

// Signature.
$this->include_with_vars( 'admin-menu-signature', [ $this->page_general_help_support ] /** Add in an array all vars to send in the template */ );
$this->lumiere_add_signature_menus();
}

/**
Expand All @@ -433,6 +436,17 @@ private function lumiere_admin_menu_help(): void {
// The class.
$help_class = new Help();
$help_class->display_help_layout();

$this->lumiere_add_signature_menus();
}

/**
* Display the end of page signature for Lumiere
* All pages have it
*/
private function lumiere_add_signature_menus(): void {
// Signature.
$this->include_with_vars( 'admin-menu-signature', [ $this->page_general_help_support, $this->config_class->lumiere_version ] /** Add in an array all vars to send in the template */ );
}

/**
Expand Down
3 changes: 0 additions & 3 deletions src/class/admin/submenu/class-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ protected function display_data_options(): void {
// The template will retrieve the args. In parent class.
$this->include_with_vars( 'data/admin-data-order', [ $this ] );
}

// Signature.
$this->include_with_vars( 'admin-menu-signature', [ $this->page_general_help_support ] /** Add an array with vars to send in the template */ );
}

/**
Expand Down
3 changes: 0 additions & 3 deletions src/class/admin/submenu/class-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ protected function display_general_options( Cache_Tools $cache_tools_class ): vo
) {
$this->include_with_vars( self::PAGES_NAMES['advanced_options'], [] /** Add an array with vars to send in the template */ );
}

// Signature.
$this->include_with_vars( self::PAGES_NAMES['signature'], [ $this->page_general_help_support ] /** Add an array with vars to send in the template */ );
}
}

3 changes: 0 additions & 3 deletions src/class/admin/submenu/class-help.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ public function display_help_layout(): void {
}

echo "\n\t" . '</div>';

// Signature.
$this->include_with_vars( 'admin-menu-signature', [ $this->page_general_help_support ] /** Add in an array all vars to send in the template */ );
}

/**
Expand Down
8 changes: 5 additions & 3 deletions src/class/templates/admin/admin-menu-signature.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@

// Get transients vars from the calling class.
$lumiere_helpage = get_transient( 'admin_template_pass_vars' )[0];
$lumiere_version = get_transient( 'admin_template_pass_vars' )[1];
?>

<div class="soustitre lumiere_signature">
<div><?php
/* translators: %1$s and %2$s are replaced with an html strong tag, %3$s and %4$s are html ahref tags */
echo wp_kses( wp_sprintf( __( '%1$sLicensing Info:%2$s Under a GPL licence, on various libraries. However, much work was required to implement it in WordPress and maintain it; check the support page for %3$smore information%4$s.', 'lumiere-movies' ), '<strong>', '</strong>', '<a href="' . esc_url( $lumiere_helpage ) . '">', '</a>' ), $lumiere_esc_html );
/* translators: %1$s and %2$s are replaced with an html strong tag, %3$s and %4$s are html ahref tags */
echo wp_kses( wp_sprintf( __( '%1$sLicensing Info:%2$s Under a GPL licence, on various libraries. However, much work was required to implement it in WordPress and maintain it; check the support page for %3$smore information%4$s.', 'lumiere-movies' ), '<strong>', '</strong>', '<a href="' . esc_url( $lumiere_helpage ) . '">', '</a>' ), $lumiere_esc_html );
?></div>
<br />
<div> &copy; 2005-<?php echo esc_html( gmdate( 'Y' ) ); ?> <a href="<?php echo esc_html( Settings::IMDBABOUTENGLISH ); ?>" target="_blank">Lost Highway</a>, <a href="<?php echo esc_html( Settings::IMDBHOMEPAGE ); ?>" target="_blank">Lumière! WordPress plugin</a>
<div>
&copy; 2005-<?php echo esc_html( gmdate( 'Y' ) ); ?> <a href="<?php echo esc_html( Settings::IMDBABOUTENGLISH ); ?>" target="_blank">Lost Highway</a>, <a href="<?php echo esc_html( Settings::IMDBHOMEPAGE ); ?>" target="_blank">Lumière! WordPress plugin</a> version <?php echo esc_html( $lumiere_version ); ?>.
</div>
</div>

0 comments on commit cd3cf4a

Please sign in to comment.