__('Events','dbem') ); } echo $before_widget; echo $before_title; echo $options['title']; echo $after_title; $events_list = dbem_get_events_list($options['limit'],$options['scope'],$options['order'] ,$options['format'], false); if ($events_list == __('No events', 'dbem')) $events_list = "
  • $events_list
  • "; echo ""; echo $after_widget; } function dbem_list_control() { $options = get_option("widget_dbem_list"); if (!is_array( $options )) { $options = array( 'title' => __('Events', 'dbem'), 'limit' => '5', 'scope' => 'future', 'order' => 'ASC', 'format' => DEFAULT_WIDGET_EVENT_LIST_ITEM_FORMAT ); } if ($_POST['dbem_list-Submit']) { $options['title'] = htmlspecialchars($_POST['dbem_list-WidgetTitle']); $options['limit'] = $_POST['dbem_list-WidgetLimit']; $options['scope'] = $_POST['dbem_list-WidgetScope']; $options['order'] = $_POST['dbem_list-WidgetOrder']; $options['format'] = $_POST['dbem_list-WidgetFormat']; update_option("widget_dbem_list", $options); } if ($options['scope'] == "all" ) $allSelected = "selected='selected'"; else $allSelected = ""; if ($options['scope'] == "past" ) $pastSelected = "selected='selected'"; else $pastSelected = ""; if ($options['scope'] == "future" ) $futureSelected = "selected='selected'"; else $futureSelected = ""; if ($options['order'] == "ASC" ) $ASCSelected = "selected='selected'"; else $ASCSelected = ""; if ($options['order'] == "DESC" ) $DESCSelected = "selected='selected'"; else $DESCSelected = ""; ?>



    _e('calendar','dbem') ); } echo $before_widget; echo $before_title; echo $options['title']; echo $after_title; //Our Widget Content $current_month = date("m"); dbem_get_calendar($current_month); echo $after_widget; } function dbem_calendar_control() { $options = get_option("widget_dbem_calendar"); if (!is_array( $options )) { $options = array( 'title' => 'Calendar', ); } if ($_POST['dbem_calendar-Submit']) { $options['title'] = htmlspecialchars($_POST['dbem_calendar-WidgetTitle']); update_option("widget_dbem_calendar", $options); } ?>

    'widget_dbem_list', 'description' => __( "A list of the events") ); // wp_register_sidebar_widget('widget_dbem_list', __('Events List'), 'widget_dbem_list', $widget_ops); register_sidebar_widget(__('Events List', 'dbem'), 'widget_dbem_list'); register_widget_control(__('Events List', 'dbem'), 'dbem_list_control', 200, 200 ); register_sidebar_widget(__('Events Calendar','dbem'), 'widget_dbem_calendar'); register_widget_control(__('Events Calendar','dbem'), 'dbem_calendar_control', 300, 200 ); } add_action("plugins_loaded", "dbem_list_init"); ?>