amll_general_settings = (array) get_option( $this->amll_general_settings_key );
$this->amll_advanced_settings = (array) get_option( $this->amll_advanced_settings_key );
// Merge with defaults
$this->amll_general_settings = array_merge( array(
'amll_general_option' => 'General value'
), $this->amll_general_settings );
$this->amll_advanced_settings = array_merge( array(
'amll_advanced_option' => 'Advanced value'
), $this->amll_advanced_settings );
}
/*
* Registers the general settings via the Settings API,
* appends the setting to the tabs array of the object.
*/
function amll_register_general_settings() {
$this->amll_plugin_settings_tabs[$this->amll_general_settings_key] = 'General';
register_setting( $this->amll_general_settings_key, $this->amll_general_settings_key );
add_settings_section( 'amll_section_general', '', array( &$this, 'amll_section_general_desc' ), $this->amll_general_settings_key );
}
/*
* Registers the advanced settings and appends the
* key to the plugin settings tabs array.
*/
function amll_register_advanced_settings() {
$this->amll_plugin_settings_tabs[$this->amll_advanced_settings_key] = 'Advanced';
register_setting( $this->amll_advanced_settings_key, $this->amll_advanced_settings_key );
add_settings_section( 'amll_section_advanced', '', array( &$this, 'amll_section_advanced_desc' ), $this->amll_advanced_settings_key );
}
/*
* The following methods provide descriptions
* for their respective sections, used as callbacks
* with amll_add_settings_section
*/
function amll_section_general_desc() {
echo '
';
}
function amll_section_advanced_desc() {
echo '';
}
/*
* Called during admin_menu, adds an options
* page under Settings called sett Settings, rendered
* using the amll_plugin_options_page method.
*/
function amll_add_admin_menus() {
add_menu_page( 'sett Settings', 'AM Plugins', 'manage_options', $this->amll_plugin_options_key, array( &$this, 'amll_plugin_options_page' ) );
}
/*
* Plugin Options page rendering goes here, checks
* for active tab and replaces key with the related
* settings key. Uses the amll_plugin_options_tabs method
* to render the tabs.
*/
function amll_plugin_options_page() {
$tab = isset( $_GET['tab'] ) ? $_GET['tab'] : $this->amll_general_settings_key;
$this->amll_plugin_options_tabs();
echo '
';
// wp_redirect(admin_url('options-general.php?page=my_plugin_options'));exit;
}
/*
* Renders our tabs in the plugin options page,
* walks through the object's tabs array and prints
* them one by one. Provides the heading for the
* amll_plugin_options_page method.
*/
function amll_plugin_options_tabs() {
$current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : $this->amll_general_settings_key;
screen_icon();
echo '
';
}
}
// Initialize the plugin
add_action( 'plugins_loaded', create_function( '', '$amll_featured_plugin = new amll_featured_plugin;' ) );
/* function to show howdy text */
function amll_change_howdy_text_toolbar($wp_admin_bar)
{
$amll_howdytext = get_option( 'wp_sett_howdytext' );
if($amll_howdytext){
$amll_getgreetings = $wp_admin_bar->get_node('my-account');
$amll_rpctitle = str_replace('Howdy',$amll_howdytext,$amll_getgreetings->title);
$wp_admin_bar->add_node(array("id"=>"my-account","title"=>$amll_rpctitle));
}
}
if(get_option('wp_sett_howdytext')){
add_filter('admin_bar_menu','amll_change_howdy_text_toolbar');
}
/* function to show login logo */
function amll_change_login_logo() {
$amll_loginlogoimage = get_option('wp_sett_loginlogo');
if($amll_loginlogoimage){
echo '';
}
}
if(get_option('wp_sett_loginlogo')){
add_filter('login_head', 'amll_change_login_logo');
}
/* function to show footer text */
function amll_change_footer_text() {
$amll_footertext = get_option( 'wp_sett_footertext' );
if($amll_footertext){
echo $amll_footertext;
}
}
if(get_option( 'wp_sett_footertext' )){
add_filter('admin_footer_text', 'amll_change_footer_text');
}
/* function to show navigation background color */
function amll_change_navigation_background_color() {
$amll_navigationbackgroundcolor = get_option('wp_sett_navigationbackgroundcolor');
if($amll_navigationbackgroundcolor){
echo '';
}
}
if(get_option('wp_sett_navigationbackgroundcolor')){
add_action('admin_head', 'amll_change_navigation_background_color');
}
/* function to show navigation font color */
function amll_change_navigation_font_color() {
$amll_navigationfontcolor = get_option('wp_sett_navigationfontcolor');
if($amll_navigationfontcolor){
echo '';
}
}
if(get_option('wp_sett_navigationfontcolor')){
add_action('admin_head', 'amll_change_navigation_font_color');
}
/* function to show navigation font hover color */
function amll_change_navigation_font_hover_color() {
$amll_navigationfonthovercolor = get_option('wp_sett_navigationfonthovercolor');
if($amll_navigationfonthovercolor){
echo '';
}
}
if(get_option('wp_sett_navigationfonthovercolor')){
add_action('admin_head', 'amll_change_navigation_font_hover_color');
}
/* function to show navigation hover background color */
function amll_change_navigation_hover_background_color() {
$amll_navigationhoverbackgroundcolor = get_option('wp_sett_navigationhoverbackgroundcolor');
if($amll_navigationhoverbackgroundcolor){
echo '';
}
}
if(get_option('wp_sett_navigationhoverbackgroundcolor')){
add_action('admin_head', 'amll_change_navigation_hover_background_color');
}
/* function to show sub navigation background color */
function amll_change_sub_navigation_background_color() {
$amll_subnavigationbackgroundcolor = get_option('wp_sett_subnavigationbackgroundcolor');
if($amll_subnavigationbackgroundcolor){
echo '';
}
}
if(get_option('wp_sett_subnavigationbackgroundcolor')){
add_action('admin_head', 'amll_change_sub_navigation_background_color');
}
/* function to show sub navigation font color */
function amll_change_sub_navigation_font_color() {
$amll_subnavigationfontcolor = get_option('wp_sett_subnavigationfontcolor');
if($amll_subnavigationfontcolor){
echo '';
}
}
if(get_option('wp_sett_subnavigationfontcolor')){
add_action('admin_head', 'amll_change_sub_navigation_font_color');
}
/* function to show icons color */
function amll_change_icons_color() {
$amll_iconscolor = get_option('wp_sett_iconscolor');
if($amll_iconscolor){
echo '';
}
}
if(get_option('wp_sett_iconscolor')){
add_action('admin_head', 'amll_change_icons_color');
}
/* function to show favicon image */
function amll_change_favicon_image(){
$amll_faviconimage = get_option('wp_sett_faviconimage');
if($amll_faviconimage){
echo '';
}
}
if(get_option('wp_sett_faviconimage')){
add_filter('admin_head', 'amll_change_favicon_image');
add_filter('wp_head', 'amll_change_favicon_image');
}
/* function to hide admin logo */
function amll_hide_admin_logo(){
$amll_hideadminlogo = get_option('wp_sett_hideadminlogo');
if($amll_hideadminlogo=='hide'){
echo '';
} else{
echo '';
}
}
if(get_option('wp_sett_hideadminlogo')){
add_filter('admin_head', 'amll_hide_admin_logo');
}
/* function to hide admin logo */
function amll_hide_admin_bar(){
$amll_hideadminbar = get_option('wp_sett_hideadminbar');
if($amll_hideadminbar=='hide'){
echo '';
} else{
echo '';
}
}
if(get_option('wp_sett_hideadminbar')){
add_filter('wp_head', 'amll_hide_admin_bar');
}
/* function to show login page background color */
function amll_change_login_page_background_color() {
$amll_loginpagebackgroundcolor = get_option('wp_sett_loginpagebackgroundcolor');
if($amll_loginpagebackgroundcolor){
echo '';
}
}
if(get_option('wp_sett_loginpagebackgroundcolor')){
add_action('login_head', 'amll_change_login_page_background_color');
}
/* function to increase upload file size */
function amll_increase_upload_file_size( $bytes )
{
$amll_uploadfilesize = get_option('wp_sett_uploadfilesize');
if($amll_uploadfilesize){
$amll_uploadfilesize = $amll_uploadfilesize * (1024 * 1024);
return $amll_uploadfilesize; // 32 megabytes
}
}
if(get_option('wp_sett_uploadfilesize')){
add_filter( 'upload_size_limit', 'amll_increase_upload_file_size' );
}
/* function to show login page background color */
function amll_change_login_page_background_image() {
$amll_loginpagebackgroundimage = get_option('wp_sett_loginpagebackgroundimage');
if($amll_loginpagebackgroundimage){
echo '';
}
}
if(get_option('wp_sett_loginpagebackgroundimage')){
add_action('login_head', 'amll_change_login_page_background_image');
}
/* function to show login page form background color */
function amll_change_login_page_form_background_color() {
$amll_loginpageformbackgroundcolor = get_option('wp_sett_loginpageformbackgroundcolor');
if($amll_loginpageformbackgroundcolor){
echo '';
}
}
if(get_option('wp_sett_loginpageformbackgroundcolor')){
add_action('login_head', 'amll_change_login_page_form_background_color');
}
/* function to show login page form field background color */
function amll_change_login_page_form_field_background_color() {
$amll_loginpageformfieldbackgroundcolor = get_option('wp_sett_loginpageformfieldbackgroundcolor');
if($amll_loginpageformfieldbackgroundcolor){
echo '';
}
}
if(get_option('wp_sett_loginpageformbackgroundcolor')){
add_action('login_head', 'amll_change_login_page_form_field_background_color');
}
/* function to show login page form field background color */
function amll_change_login_page_form_font_color() {
$amll_loginpageformfontcolor = get_option('wp_sett_loginpageformfontcolor');
if($amll_loginpageformfontcolor){
echo '';
}
}
if(get_option('wp_sett_loginpageformfontcolor')){
add_action('login_head', 'amll_change_login_page_form_font_color');
}
?>