Thread: [Phphtmllib-devel] howdy
Status: Beta
Brought to you by:
hemna
From: Walter A. B. I. <wb...@qu...> - 2002-06-05 00:30:09
|
Hey folks, I just wanted to say hi, and see if this list was working, since some folks have signed up. I am currently working on version 2.0.0 of the libs, which is a small rewrite of the base class HTMLTagClass to be based off of XMLTagclass, which in turn is a child of Container. This will let everyone build xml/html/xhtml with the same exact api. It is 100% compatible w/ the 1.x series of the libs, and should have a few more bells n whistles. I will probably be putting the CVS repository for phphtmllib up on sourceforge in the next week or so, so folks can check out the latest and greatest at any time. Also, if you would like to contribute to the libs, you can feel free to send me patches for review, and eventually I will give some folks write access to the cvs repository. I would eventually like to see more widget classes built that add more value to the libs other then just building xml/html/xhtml tags. I have a bunch of widgets that I have built over time for various web applications. I personally feel the long term value of the libs is in the widgets. Widgets are nothing more then classes that help build some html "widget", such as a table with a border, title, and rows of data. The purpose of these widgets is to make it much easier to build complex html structures. So all the php programmer has to do is worry about getting the data, and stuffing that data into the object. HTMLPageClass is a widget that helps the programmer build a fully qualified html page. Anyways, I'm rambling, so I'll shut the f up :) Walt |
From: Tim M. <mo...@mr...> - 2002-06-05 01:39:06
|
Walter A. Boring IV wrote: > Hey folks, > I just wanted to say hi, and see if this list was working, since some > folks have signed up. It appears to be working just fine. =) > [...] > > I would eventually like to see more widget classes built that add more > value to the libs other then just building xml/html/xhtml tags. I have > a bunch of widgets that I have built over time for various web > applications. I personally feel the long term value of the libs is in > the widgets. > Widgets are nothing more then classes that help build some html > "widget", such as a table with a border, title, and rows of data. > The purpose of these widgets is to make it much easier to build complex > html structures. So all the php programmer has to do is worry about > getting the data, and stuffing that data into the object. > HTMLPageClass is a widget that helps the programmer build a fully > qualified html page. This may be an ambitious desire... Along the widget lines, I would like to see the idea of themes implemented in PhpHtmlLib. I really like the the idea of themes that PHPnuke, PostNuke, et al. offer but I don't want or need their idea of users, articles, surveys, ad naseum. I just want flexible, easy to use themes. -- Tim Moloney ManTech Real-time Systems Laboratory 2015 Cattlemen Road \ / Sarasota, FL 34232 .________\(O)/________. (941) 377-6775 x208 ' ' O(.)O ' ' |
From: Walter A. B. I. <wab...@bu...> - 2002-06-05 05:24:07
|
> Along the widget lines, I would like to see the idea of themes > implemented in PhpHtmlLib. I really like the the idea of themes > that PHPnuke, PostNuke, et al. offer but I don't want or need their > idea of users, articles, surveys, ad naseum. I just want flexible, > easy to use themes. ---There is some form of widget theming built in to the BaseWidget class. I kinda threw it together one night as a hack, so I know its not perfect, but it works for the most part. How it works is this. Any widget that you want to be "themable", it has to have a css file, which is a .php file. The .php file contains mostly all css definitions. Take a look at phphtmllib/widgets/css/TextNav.php. It's a simple example. What you do is to just make the values of the css items you want to be changeable on the fly into php variables. So for example, in widgets/css/TextNav.php, you will see A.textnavlist:hover { color: $fonthover; } where the value for the color is a php global var. In widgets/TextNav.inc you will see a member variable called $_css_colors, which is an array of name=>value pairs. The name should be the name of the var you use in the css php file. You will also see the $_css_file var which is the name of the css file that is used for the widget. What the hell is this crap? :) Well, there is a method in the BaseWidget class called get_css_file(). This method returns a string which is the path to the css file used by the widget, along with a query string of the name=value pairs of the themed items. So at some point in a script when u create the particular widget, you add the css link to the page, and it will automatically create the link to the php css file with the name=value pairs in the query string, which will set the values of the global variables in the php css file. Its a hacked way of dynamic theming. You can manage the values of the $_css_colors array with the methods: set_css_item_color( $name, $value ) and get_css_item_color( $name ) So if you want to use this, when u create a widget, all you have to do is build the css file as php, and add the $_css_file member variable, as well as the $_css_colors array with the names, and default values. example? <?php $page = new HTMLPageClass("some lame name"); $textnav = new TextNav(400); //you can change the themed values here BEFORE //you add the css link to the page. //uncomment these next 3 lines to override //the default themed colors for the widget. //$textnav->css_set_item_color("background", "#CC0000"); //$textnav->css_set_item_color("font", "#00FF00"); //$textnav->css_set_item_color("fonthover", "#FFFFFF"); //add the css link to the page w/ the themed values $page->push_css_link( $textnav->get_css_file() ); $textnav->push("http://www.amazon.com", "Amazon", 200 ); $textnav->push("http://www.ebay.com", "Ebay", 200 ); $page->push( $textnav ); print $page->render(); ?> I hope this made SOME sense at least. I know its not a perfect solution, but it worked for me at the time I needed it. I'd like a more flexible and elegant solution if possible, but this does work. Walt |