optionsMessage = ""; $this->wpdb = $wpdb; add_action( 'init', array($this,'AWM_init_hook' )); add_action( 'admin_init', array($this,'AWM_addmin_hook' )); add_action('admin_menu', array($this,'AWM_add_option_pages')); global $wp_version; if((float)$wp_version>=2.8){ include_once WP_PLUGIN_DIR.'/allwebmenus-wordpress-menu-plugin/widgetClass.php'; add_action('widgets_init', create_function('', 'return register_widget("Widget_AllWebMenus");')); } } /* * Initialization of plugin. */ function AWM_init_hook(){ global $dataArray,$awm_table_name, $awm_total_tabs, $AWM_ver, $dataArray, $awm_is_yarpp_enabled; /* * Load the include files */ include_once WP_PLUGIN_DIR.'/allwebmenus-wordpress-menu-plugin/menu_helper.php'; include_once WP_PLUGIN_DIR.'/allwebmenus-wordpress-menu-plugin/include.php'; $this->awm_table_name = $awm_table_name = $this->wpdb->prefix . "awm"; $this->dataArray = $dataArray = array(); $this->AWM_ver = $AWM_ver = '1.1.2'; $this->awm_total_tabs = $awm_total_tabs = get_option("AWM_total_menus",(int) 0); //if ($_POST["AWM_selected_tab"]=="") $_POST["AWM_selected_tab"]="1"; // set the first time options (if they do not already exist) awm_set_first_time_options(); // add linking code to header.php file if (!awm_add_code()){ $this->optionsMessage = "

Linking code could not be added automatically. You have to add it by yourself. Open the \"header.php\" file (found at \"SITEROOT/wp-content/themes/YourSiteTheme\") and add this code

right after the <body> tag.

"; } // Check if already had the plugin when it was single-tab and convert values awm_convert_from_single_to_multi_tab(); awm_convert_to_database(); $this->awm_total_tabs = $awm_total_tabs; $this->awm_is_yarpp_enabled = $awm_is_yarpp_enabled = in_array('yet-another-related-posts-plugin/yarpp.php', get_option('active_plugins')); $awm_plugin = plugin_basename(__FILE__); add_filter("plugin_action_links_$awm_plugin", array($this, 'awm_wp_settings_link' )); // Check if you need to check for updates if ((get_option('AWM_Checked_Date') <= (date('d') - 15)) || (get_option('AWM_Checked_Date') === '00')) { update_option('AWM_Check_Show', TRUE); } } /* * Adds link to settings page */ function awm_wp_settings_link($awm_links) { $awm_settings_link = 'Settings'; array_unshift($awm_links, $awm_settings_link); return $awm_links; } /* * Initialization of the admin panel. */ function AWM_addmin_hook(){ if (!session_id()){ session_start(); } /* Register our stylesheet. */ wp_register_script( 'AWMScript', plugins_url('/script.js', __FILE__) ); wp_register_style( 'AWMStylesheet', plugins_url('/stylesheet.css',__FILE__ )); } /* * Add admin panel styles AND scripts */ function AWM_admin_styles() { /* * It will be called only on your plugin admin page, enqueue our stylesheet here */ wp_enqueue_style( 'AWMStylesheet' ); wp_enqueue_script( 'AWMScript' ); } /* * Add options page */ function AWM_add_option_pages() { if (function_exists('add_options_page')) { $page = add_options_page('AllWebMenus WordPress Menu Plugin', 'AllWebMenus-WP-Menu', 8, __FILE__, array($this,'AWM_options_page')); } add_action( 'admin_print_styles-' . $page, array($this,'AWM_admin_styles' )); } /* * Generate options page */ function AWM_options_page() { echo $this->optionsMessage; $locations = array(); if (function_exists('get_registered_nav_menus')) $locations = (array) get_registered_nav_menus(); ?> wpdb->get_results( "SELECT * FROM $this->awm_table_name ORDER BY id ASC" ); if (isset($_GET['generated'])){ $awm_str_code = AWM_create_menu_structure($myrows[get_option('AWM_selected_tab')]); $awm_up_path = get_bloginfo('url') . get_option('AWM_menu_path'); echo <<

Menu Structure Code generated!

Menu Structure Code
- Press Ctrl+C to copy the above code
- Switch to the AllWebMenus desktop application
- Open the "Add-ins -> WordPress Menu -> Import/Update Menu Structure from WordPress" form
- Paste the above copied "Menu Structure Code"
- Configure further your menu (styles, etc.) through the AllWebMenus properties
- Compile your menu from "Add-ins -> WordPress Menu -> Compile WordPress Menu"
- Make sure that you upload the compiled menu ZIP file on your server (Note: you need to have AllWebMenus version 5.3.862 or above to create a ZIP file for WordPress). To upload the ZIP file please use the related button below in this page.
STR; }?>

AllWebMenus WordPress Menu Plugin vAWM_ver; ?>

For information and updates, please visit: http://www.likno.com/addins/wordpress-menu.html



Upload ZIP of your menu "": "/>
  Select the ZIP file produced by AllWebMenus software containing the files of your menu. Then by simply clicking "Upload ZIP file" your menu files will be uploaded.
" > "/>
Online folder for menu files:   (relative to blog's root folder)
  Every time you compile your local AllWebMenus project you get a ZIP file which you then upload online. This is the online folder where the menu files are extracted when you upload this ZIP file. (note: you may need to create this online folder yourself)
      
awm_total_tabs; $awm_t++) { echo "
".$myrows[$awm_t]->name."
"; } ?>
awm_total_tabs; $awm_t++) { ?>
active) echo "checked='checked'"; ?> /> Show "name;?>" in blog    active) { ?>Unchecked! (this menu will not appear in your blog)(this menu will appear in your blog)
Menu name:
Please make sure that the "Menu name" value matches the value in the "Compiled Menu Name" property of the AllWebMenus project file (Tools > Project Properties > Folders). show me

Menu Structure
 
custom_menu) echo "checked='checked'"; ?> /> Menu is populated from an existing "Wordpress menu" (check to choose menu, Wordpress 3+ only)
Which WordPress menu do you want to use?     Add/Edit WordPress menus
 
custom_menu) echo "checked='checked'"; ?> /> Menu is populated with specific "pages", "posts", "categories", etc. (check to choose items)

Please select the items you want to include/exclude in your menu structure:

 
include_home) echo "checked='checked'"; ?> /> "Home" A "Home" item that opens the blog's Home Page.
 
 
pages) echo "checked='checked'"; ?> /> Pagespages):?>: ...
pages)echo 'style="display:none"';?>> Show all Pages except the following:

Page IDs, separated by commas (their sub-pages will also be excluded). Example: 34, 59, 140

pages_ms == 'main') echo "checked='checked'"; ?> /> Show Pages as Main Menu items
pages_ms != 'main') echo "checked='checked'"; ?> /> Show a Main Menu item named pages_ms == 'main') echo "disabled='disabled'"; ?> id="awm_pages_name_" name="AWM_pages_name_" type="text" size="10" value="pages_name ?>"/> and show Pages as its submenu items


posts) echo "checked='checked'"; ?> /> Postsposts):?>: ...
posts)echo 'style="display:none"';?>> Show the following Posts:
Post IDs, separated by commas. Example: 34, 59, 140

posts_ms == 'main') echo "checked='checked'"; ?> /> Show Posts as Main Menu items
posts_ms != 'main') echo "checked='checked'"; ?> /> Show a Main Menu item named posts_ms == 'main') echo "disabled='disabled'"; ?> id="awm_posts_name_" name="AWM_posts_name_" type="text" size="10" value="posts_name ?>"/> and show Posts as its submenu items


categories) echo "checked='checked'"; ?> /> Categoriescategories):?>: ...
categories)echo 'style="display:none"';?>> Show all Categories except the following:

Category IDs, separated by commas (their sub-categories will also be excluded). Example: 34, 59, 140
categories_subitems) echo "checked='checked'"; ?> /> Also show (up to) the categories_subitems) echo "disabled='disabled'"; ?> id="awm_categories_subitems_no_" name="AWM_categories_subitems_no_" type="text" size="2" value="categories_subitems_no ?>"/> newest posts of each Category as its submenu items
Value must be between 1 and 50.

categories_ms == 'main') echo "checked='checked'"; ?> /> Show Categories as Main Menu items
categories_ms != 'main') echo "checked='checked'"; ?> /> Show a Main Menu item named categories_ms == 'main') echo "disabled='disabled'"; ?> id="awm_categories_name_" name="AWM_categories_name_" type="text" size="10" value="categories_name ?>"/> and show Categories as its submenu items


 
Other

Here you can select other options regarding the menu items:

hide_future) echo "checked='checked'"; ?>/> Hide future-dated posts hide_protected) echo "checked='checked'"; ?>/> Hide password-protected items hide_private) echo "checked='checked'"; ?>/> Hide private items
Menu Type

Please select how you want your menu to behave:

 
 
type == 'Dynamic') echo "checked='checked'"; ?> /> "Dynamic" Menu Type
type == 'Mixed') echo "checked='checked'"; ?> /> "Mixed" Menu Type
type == 'Static') echo "checked='checked'"; ?> /> "Static" Menu Type
type=='Dynamic'?'':'style="display:none;"'; ?>>

You have selected to create a menu structure of "Dynamic Type".

This means that the menu items in AllWebMenus will only be used for preview/styling purposes.

In your actual blog these items will be ignored and the menu will be populated "dynamically" based on the plugin settings.

The styles in AllWebMenus Style Editor will be used to form the actual menu items.

View short video explaining all your settings

type =='Mixed'?'':'style="display:none;"'; ?>>

You have selected to create a menu structure of "Mixed Type".

This means that your menu will contain both the items you create within AllWebMenus ("static") and the items you import from WordPress ("dynamic").

The imported Wordpress items will use the styles of the AllWebMenus Style Editor but their actual content will be populated "dynamically" based on the plugin settings.

The static items you create within AllWebMenus will be shown as is.

View short video explaining all your settings

type=='Static'?'':'style="display:none;"'; ?>>

You have selected to create a menu structure of "Static Type".

Your menu will be edited (addition/removal/customization of items) within AllWebMenus only.

Any changes on your online blog will not affect its items until you perform the "Save settings & Generate Menu Structure Code" action and re-import to AllWebMenus.

This allows for maximum customization, as your online menu will show all items and styles customized within AllWebMenus.

View short video explaining all your settings

 
 
Menu Positioning Method
Please select a menu position that your menu wants to appear:
position != '0') echo 'style="display: none;"';?>>You have selected the Custom positioning method. This means that you should manually add a positioning DIV element (or image) into your blog's HTML code, based on the settings that you specified within AllWebMenus ("Positioning" property). In case you selected the "Relative to Window" option there, no positioning element needs to be added to your blog's HTML.
position !="awm_widget") echo 'style="display: none;"';?>>You have selected the Widget positioning method. ***Note: this method applies ONLY when you ALSO use the "Relative to Element" positioning option within your AllWebMenus project (without changing its "Default ID" selection)***
A widget instance for this menu is initially created and found in the widgets administration page, under the "Inactive Widgets" section. Just drag this widget instance and drop it inside the Widget Area that you want.
position =="awm_widget" || $myrows[$awm_t]->position == '0') echo 'style="display: none;"';?>> You have selected the Theme Menu Location positioning method. ***Note: this method applies ONLY when you ALSO use the "Relative to Element" positioning option within your AllWebMenus project (without changing its "Default ID" selection)***
This means that your menu will be positioned based on the "Menu Location" that your Blog's Theme provides.
Collaboration with external plugins
 
Related Posts (YARPP): awm_is_yarpp_enabled) {?>
Currently not installed and activated
get it here
related) echo "checked='checked'"; if (!$this->awm_is_yarpp_enabled) echo "disabled='disabled'";else echo "onclick=\"awm_disable_input(this.checked,$awm_t,'related');\""; ?>/> Show a "Related Posts" item when viewing a post
  awm_is_yarpp_enabled) { ?>
related) echo "disabled='disabled'"; ?>/>

This feature uses the 3rd-party "Related Posts (YARPP)" plugin, which needs to be installed separately.

It dynamically adds a "Related Posts" item at the end of the Main Menu, with a submenu that contains posts related to the post you are currently viewing, regardless of the menu type you have selected.

The "Related Posts" item appears only when viewing a single post.

Note! It seems that the "Related Posts (YARPP)" Plugin is not installed and activated so this option is disabled.

This feature uses the 3rd-party "Related Posts (YARPP)" plugin, which needs to be installed separately.

It dynamically adds a "Related Posts" item at the end of the Main Menu, with a submenu that contains posts related to the post you are currently viewing, regardless of the menu type you have selected.

The "Related Posts" item appears only when viewing a single post.

 
 


Note: Always click the "Save settings" button below to apply your changes. If you leave this page without saving you will lose your unsaved changes.
      
awm_total_tabs) :?>
awm_wp_nav_array[$args->theme_location])) return $items."
 
"; else return $items; } function awm_print_menu_position($args){ $myrows = $this->wpdb->get_results("SELECT name FROM $this->awm_table_name WHERE position LIKE '". $args['theme_location']."' && active = 1 ORDER BY id ASC" ); foreach ($myrows as $myrow) echo "
name."> 
"; } function awm_menu_args($args){ $args = (object) $args; $args->fallback_cb = 'AWM_print_menu_position'; return $args; } /* * Generate Linking Code */ function AWM_generate_linking_code() { $i=0; $filter_flag = false; $myrows = $this->wpdb->get_results( "SELECT * FROM $this->awm_table_name WHERE active=1 order by id ASC" ); for ($awm_t=0; $awm_tposition != "0" && $myrows[$awm_t]->position != "awm_widget"){ $this->awm_wp_nav_array[$myrows[$awm_t]->position] = "awmAnchor-".$myrows[$awm_t]->name; $filter_flag = true; } $awm_name = $myrows[$awm_t]->name; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n\n"; } if ($filter_flag){ add_filter('wp_nav_menu', array($this,'awm_menu_position'), 10, 2); add_filter('wp_nav_menu_args',array($this,'awm_menu_args'), 10 ,1); } } /* * Initialize query var for sitemap permalinks */ function AWM_query_vars ( $awm_vars ) { $awm_vars[] = "pg"; return $awm_vars; } //add_filter('query_vars', 'AWM_query_vars'); } //this functions calls the object's generate linking code function AWM_generate_linking_code(){ global $awmPluginInstance; $awmPluginInstance->AWM_generate_linking_code(); } //this functions is the callback function that calls the function that prints the div at the Menu Position function AWM_print_menu_position($args){ global $awmPluginInstance; $awmPluginInstance->awm_print_menu_position($args); } ?>