Started port the gallery to the new structure

parent a95d4d7c
...@@ -510,38 +510,10 @@ if(!class_exists('SexHackVideoGallery')) { ...@@ -510,38 +510,10 @@ if(!class_exists('SexHackVideoGallery')) {
} }
function gallery_adminpage()
{
global $SEXHACK_GALLERY_DEFAULTSLUG;
$DEFAULTSLUG = $SEXHACK_GALLERY_DEFAULTSLUG;
?>
<div class="wrap">
<?php do_settings_sections( 'sexhackme-gallery-settings' ); ?>
<form method="post" action="/wp-admin/options.php">
<?php settings_fields( 'sexhackme-gallery-settings' ); ?>
<table class="form-table">
<tr align="top">
<td>
<label>Slug for gallery</label>
<input type="text" name="sexhack_gallery_slug" value="<?php echo get_option( 'sexhack_gallery_slug', "$DEFAULTSLUG" ) ?>" />
</td>
</tr>
</table>
<?php submit_button(); ?>
</form>
</div>
<?php
}
$SEXHACK_SECTION = array( $SEXHACK_SECTION = array(
'class' => 'SexHackVideoGallery', 'class' => 'SexHackVideoGallery',
'description' => 'Create Video galleries for Sexhack Video products', 'description' => 'Create Video galleries for Sexhack Video products',
//'require-page' => true, //'require-page' => true,
'adminmenu' => array(
array('title' => 'Gallery',
'slug' => 'gallery',
'callback' => 'wp_SexHackMe\gallery_adminpage')
),
'name' => 'sexhackme_videogallery' 'name' => 'sexhackme_videogallery'
); );
......
...@@ -60,6 +60,13 @@ if(!class_exists('SH_Admin')) { ...@@ -60,6 +60,13 @@ if(!class_exists('SH_Admin')) {
register_setting('sexhackme-advert-settings', 'sexadv_video_top'); register_setting('sexhackme-advert-settings', 'sexadv_video_top');
register_setting('sexhackme-advert-settings', 'sexadv_video_bot'); register_setting('sexhackme-advert-settings', 'sexadv_video_bot');
} }
// Gallery settings
if( file_exists(SH_PLUGIN_DIR_PATH . 'includes/admin/functions-gallery.php') )
{
include_once SH_PLUGIN_DIR_PATH . 'includes/admin/functions-gallery.php';
register_setting('sexhackme-gallery-settings', 'sexhack_gallery_slug');
}
} }
public static function menu() public static function menu()
...@@ -96,6 +103,17 @@ if(!class_exists('SH_Admin')) { ...@@ -96,6 +103,17 @@ if(!class_exists('SH_Admin')) {
} }
// Add Gallery settings page
if( file_exists(SH_PLUGIN_DIR_PATH . 'includes/admin/functions-gallery.php') )
{
add_submenu_page( 'sexhackme-settings', // root slug
'Gallery', // title
'Gallery', // title
'manage_options', // capabilities
'gallery', // slug
'wp_SexHackMe\gallery_adminpage'); // callback
}
} }
......
...@@ -22,4 +22,19 @@ ...@@ -22,4 +22,19 @@
// Exit if accessed directly // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit; if ( ! defined( 'ABSPATH' ) ) exit;
?> ?>
<div class="wrap">
<?php do_settings_sections( 'sexhackme-gallery-settings' ); ?>
<form method="post" action="/wp-admin/options.php">
<?php settings_fields( 'sexhackme-gallery-settings' ); ?>
<table class="form-table">
<tr align="top">
<td>
<label>Slug for gallery</label>
<input type="text" name="sexhack_gallery_slug" value="<?php echo get_option( 'sexhack_gallery_slug', "v" ) ?>" />
</td>
</tr>
</table>
<?php submit_button(); ?>
</form>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment