In the simplest case, you can float-charge a lead-acid battery using a 7812 with a green (1.8V forward voltage) LED in series with the GND pin of the regulator, which will give you a 1A-current-limited 13.8V output. That can remain connected to a lead-acid battery indefinitely without harm and the battery will remain full.
Regardless of which charge-controller circuit you use, you can supply that charging circuit from multiple power sources just by putting a diode in series with each power source. The diodes prevent the sources from trying to drive each other, and the source with the highest voltage will supply power to the load (charger).
I would suggest that you run it by default from the solar panel and have it fall back to mains charging when there is no sun. If you're feeling fancy, google up MPPT (maximum power point tracking) converters, which will get the most out of your panel. There are a few DIY designs.