From: Honza M. <hon...@ec...> - 2003-04-17 11:19:39
|
On =C8t, 2003-04-17 at 10:18, Mitra wrote: > If I want to add a new constant type, how would I go about it - what=20 > are the set of places that need it implementing. Add "all slices" to $constants array in /admin/se_inputform.php3 (row about 155). Right now there are listed two kinds of "constants": 1) real constants and=20 2) slices.=20 The only difference in field setting in database is, that slices have '#sLiCe-' prefix before its ID. We then look for '#sLiCe-' prefix in show_fnc_*() functions (like show_fnc_rio() - all in /include/itemfunc.php3). If we find the '#sLiCe-' prefix, we call GetItemHeadlines() function, if not, we call GetConstants() function. So, you probably will add new prefix for 'slices' in /admin/se_inputform.php3 and then you will modify all functions in=20 /include/itemfunc.php3, which uses constants (just search for '#sLiCe-'). It will be probably best to cteate special function FillArrayFromConstants(), which then will be called from all show_fnc_*() functions. It could looks like: function FillArrayFromConstants($constgroup) { switch( substr($constgroup,0,7) ) { case '#sLiCe-':=20 return GetItemHeadlines( substr($constgroup, 7), "" ); case '#mItRa-': // your prefix for slices selectbox 7 char long return YourFunctionToGetSlices( substr($constgroup, 7), "" ); default:=20 return GetConstants( $constgroup ); } } I'm not sure, how you plan to restrict listed slices, or if you want to show here all slices, but it's up to you. Honza > Specifically what I need is a constant type which is the list of=20 > slices. Obviously I'd like to reuse as much of the existing code as=20 > possible - so for example it could be the code from the existing=20 > Select box. >=20 > In case you are interested .... the reason I want to do this, is that=20 > I have a web site which has a number of almost identical=20 > sub-sections, each of which has its own set of slices for different=20 > applications ... So I have a "Sustainable Agriculture" section and a=20 > "Event organizers" section. So in the item that relates to=20 > Sustainable Agriculture - gives a short summary, and a pointer to its=20 > icon etc, I also want to put the SliceID of the slices that contain=20 > those applications - e.g. a Directory, a Blog, a collection of=20 > Imported News, etc. Which means that in the Fields of my main=20 > slice, I want to be able to say that a specific field is selected=20 > from the Constant Group "Slices" >=20 > - Mitra >=20 > --=20 > Mitra Technology Consulting - www.mitra.biz - mi...@mi... > 02-6684-8096 or 0414-648-0722 >=20 > Life is a Mystery to be Lived, not a Problem to be Solved >=20 >=20 >=20 > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Apc-aa-coders mailing list > Apc...@li... > https://lists.sourceforge.net/lists/listinfo/apc-aa-coders >=20 |