Skip to content

Commit

Permalink
2.0.0.5-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
stiofan committed Mar 30, 2018
1 parent 3eb42c9 commit f856be5
Show file tree
Hide file tree
Showing 8 changed files with 1,671 additions and 1,089 deletions.
2 changes: 2 additions & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Post badge feature implemented - CHANGED
Post images CSS and lightbox added - ADDED
New images not being added to current listings - FIXED
WP dashboard recent GD reviews block - FIXED
Ninja Forms can now be used to create contact fomrs and more (install wizard step remains) - ADDED
KLEO theme deprecated_function problem - FIXED

v2.0.0.4-beta
Tooltips on CPT settings can become stuck when adding a new field - FIXED
Expand Down
4 changes: 2 additions & 2 deletions geodirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: GeoDirectory
* Plugin URI: https://wpgeodirectory.com/
* Description: GeoDirectory plugin for WordPress.
* Version: 2.0.0.4-beta
* Version: 2.0.0.5-beta
* Author: AyeCode Ltd
* Author URI: https://wpgeodirectory.com
* Text Domain: geodirectory
Expand Down Expand Up @@ -60,7 +60,7 @@ final class GeoDirectory {
*
* @var string
*/
public $version = '2.0.0.4-beta';
public $version = '2.0.0.5-beta';

/**
* GeoDirectory instance.
Expand Down
21 changes: 20 additions & 1 deletion includes/admin/class-geodir-admin-addons.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function get_tabs(){
$tabs = array(
'addons' => __("Addons", "geodirectory"),
'themes' => __("Themes", "geodirectory"),
'recommended_plugins' => __("Recommended plugins", "geodirectory"),
' recommended_plugins' => __("Recommended plugins", "geodirectory"),
);

return $tabs;
Expand Down Expand Up @@ -275,4 +275,23 @@ public static function output() {
$current_tab = empty( $_GET['tab'] ) ? 'addons' : sanitize_title( $_GET['tab'] );
include_once( dirname( __FILE__ ) . '/views/html-admin-page-addons.php' );
}

public static function get_recommend_wp_plugins(){
$plugins = array(
'ninja-forms' => array(
'url' => 'https://wordpress.org/plugins/ninja-forms/',
'slug' => 'ninja-forms',
'name' => 'Ninja Forms',
'desc' => __('Setup forms such as contact or booking forms for your listings.','geodirectory'),
),
'userswp' => array(
'url' => 'https://wordpress.org/plugins/userswp/',
'slug' => 'userswp',
'name' => 'UsersWP',
'desc' => __('Allow frontend user login and registration as well as slick profile pages.','geodirectory'),
)
);

return $plugins;
}
}
198 changes: 198 additions & 0 deletions includes/admin/class-geodir-admin-setup-wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public function setup_wizard() {
'view' => array( $this, 'setup_default_location' ),
'handler' => array( $this, 'setup_default_location_save' ),
),
// 'recommend' => array(
// 'name' => __( 'Recommend', 'geodirectory' ),
// 'view' => array( $this, 'setup_recommend' ),
// 'handler' => array( $this, 'setup_recommend_save' ),
// ),
'content' => array(
'name' => __( 'Content', 'geodirectory' ),
'view' => array( $this, 'setup_content' ),
Expand Down Expand Up @@ -572,6 +577,199 @@ public function setup_content_save() {
exit;
}

/**
* Dummy Data setup.
*/
public function setup_recommend() {
?>
<form method="post">

<h2 class="gd-settings-title "><?php _e("Recommend Plugins","geodirectory");?></h2>

<p><?php _e("Below are a few recommend plugins that will help you with your directory.","geodirectory");?></p>

<?php

$recommend_wp_plugins = GeoDir_Admin_Addons::get_recommend_wp_plugins();

if(!empty($recommend_wp_plugins)){
echo "<ul>";
foreach ($recommend_wp_plugins as $plugin){
echo "<li>";
echo $plugin['name'];
echo "</li>";

}
echo "</ul>";
}
?>
<ul>
<li>x</li>
<li>x</li>
<li>x</li>
<li>x</li>
<li>x</li>
<li>x</li>
<li>x</li>
<li>x</li>
<li>x</li>
<li>x</li>
</ul>


<?php
//$settings = array();

$generalSettings = new GeoDir_Settings_General();
$settings = $generalSettings->get_settings('dummy_data');

// Change the description
$settings[0]['title'] = '';//__("Demo content","geodirectory");
$settings[0]['desc'] = '';//__( 'Drag the map or the marker to set the city/town you wish to use as the default location.', 'geodirectory' );
GeoDir_Admin_Settings::output_fields($settings);
?>





<table class="form-table gd-dummy-table gd-dummy-widgets">
<tbody>
<tr>
<td><strong><?php _e("xSelect the theme sidebar","geodirectory");?></strong></td>
<td><strong><?php _e("Action","geodirectory");?></strong></td>
</tr>

<tr>
<td>
<select id='geodir-wizard-widgets' class="geodir-select" >
<?php
$is_sidebar = '';
$maybe_sidebar = '';
// get the sidebars
foreach ( $GLOBALS['wp_registered_sidebars'] as $sidebar ) {
// Check if its called 'sidebar' by name or id.
if(strtolower($sidebar['id'])=='sidebar' || strtolower($sidebar['name'])==__('sidebar','geodirectory')){
$is_sidebar = $sidebar['id'];
}

if(!$maybe_sidebar && strpos(strtolower($sidebar['name']), __('sidebar','geodirectory')) !== false){
$maybe_sidebar = $sidebar['id'];
}

if(strpos(strtolower($sidebar['name']), __('sidebar page','geodirectory')) !== false){
$maybe_sidebar = $sidebar['id'];
}
}

// set if we have a guess
if(!$is_sidebar && $maybe_sidebar){
$is_sidebar = $maybe_sidebar;
}

foreach ( $GLOBALS['wp_registered_sidebars'] as $sidebar ) { ?>
<option value="<?php echo esc_attr( $sidebar['id'] ); ?>" <?php selected( $is_sidebar, $sidebar['id'] );?>>
<?php echo esc_attr( ucwords( $sidebar['name'] )); if($is_sidebar== $sidebar['id']){echo ' '; _e('( Auto detected )','geodirectory');} ?>
</option>
<?php }

?>
</select>
<?php echo geodir_notification( array('geodir-wizard-widgets-result' => '') );?>
</td>
<td><input type="button" value="<?php _e("Insert widgets","geodirectory");?>" class="button-primary geodir_dummy_button" onclick="gd_wizard_add_widgets('<?php echo wp_create_nonce( "geodir-wizard-widgets" );?>');return false;"></td>
</tr>
</tbody>
</table>


<!-- <h2 class="gd-settings-title ">--><?php //_e("Menu items","geodirectory");?><!--</h2>-->

<table class="form-table gd-dummy-table gd-dummy-widgets gd-dummy-posts">
<tbody>
<tr>
<td><strong><?php _e("Select the theme main menu","geodirectory");?></strong></td>
<td><strong><?php _e("Action","geodirectory");?></strong></td>
</tr>

<tr>
<td>
<?php

$set_menus = get_nav_menu_locations();
$set_menus = array_filter($set_menus );
//echo '##';
//print_r($set_menus);

if(!empty($set_menus)){
//echo '##1';
echo "<select id='geodir-wizard-menu-id' data-type='add' class='geodir-select' >";

foreach($set_menus as $menu_location => $menu_id){
$selected = '';

if(strpos(strtolower($menu_location), 'primary') !== false || strpos(strtolower($menu_location), 'main') !== false){
$selected = 'selected="selected"';
}

$menu_item = wp_get_nav_menus($menu_id)[0];

?>
<option value="<?php echo esc_attr( $menu_id ); ?>" <?php echo $selected;?>>
<?php echo esc_attr( $menu_item->name); if($selected){echo ' '; _e('( Auto detected )','geodirectory');} ?>
</option>
<?php
}

echo "</select>";


}else{//echo '##2';
// add new menu to a menu location.
$menus = get_registered_nav_menus();

//print_r($menus );

if(!empty($menus)){
echo "<select id='geodir-wizard-menu-location' data-type='create' class='geodir-select' >";

foreach($menus as $menu_slug => $menu_name){
$selected = '';

if(strpos(strtolower($menu_slug), 'primary') !== false || strpos(strtolower($menu_slug), 'main') !== false){
$selected = 'selected="selected"';
}
?>
<option value="<?php echo esc_attr( $menu_slug ); ?>" <?php echo $selected;?>>
<?php _e('Create new menu in:','geodirectory'); echo ' '. esc_attr( $menu_name ); if($selected){echo ' '; _e('( Auto detected )','geodirectory');} ?>
</option>
<?php
}
echo "</select>";

}

//print_r($menus);
}

echo geodir_notification( array('geodir-wizard-menu-result' => '') );

?>
</td>
<td><input type="button" value="<?php _e("Insert menu items","geodirectory");?>" class="button-primary geodir_dummy_button" onclick="gd_wizard_setup_menu('<?php echo wp_create_nonce( "geodir-wizard-setup-menu" );?>');return false;"></td>
</tr>
</tbody>
</table>

<p class="gd-setup-actions step">
<input type="submit" class="button-primary button button-large button-next" value="<?php esc_attr_e( 'Continue', 'geodirectory' ); ?>" name="save_step" />
<a href="<?php echo esc_url( $this->get_next_step_link() ); ?>" class="button button-large button-next"><?php esc_html_e( 'Skip this step', 'geodirectory' ); ?></a>
<?php wp_nonce_field( 'gd-setup' ); ?>
</p>
</form>
<?php
}

/**
* Final step.
*/
Expand Down
5 changes: 4 additions & 1 deletion includes/class-geodir-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static function add_ajax_events() {
'bestof' => true,
'cpt_categories' => true,
'json_search_users' => false,
'ninja_forms' => false,
'ninja_forms' => true,
);

foreach ( $ajax_events as $ajax_event => $nopriv ) {
Expand Down Expand Up @@ -88,12 +88,15 @@ public static function ninja_forms(){
add_action('wp_print_styles', function () {global $wp_styles; $wp_styles->queue = array('font-awesome');}, 1000);
add_action('wp_print_scripts', function () {global $wp_scripts; $wp_scripts->queue = array('jquery');}, 1000);

echo '<!DOCTYPE html><html lang="en-US"><head>';
wp_head();
echo "<style>body { background: #fff;padding: 20px 50px;}</style>";
echo '</head><body>';
//echo "<div class='lity-show'>";
echo do_shortcode( "[ninja_form id=$form_id]" );
//echo "</div>";
wp_footer();
echo '</body></html>';
wp_die();
}

Expand Down
Binary file modified languages/geodirectory-en_US.mo
Binary file not shown.
Loading

0 comments on commit f856be5

Please sign in to comment.