From: <dj...@us...> - 2012-01-16 17:22:14
|
Revision: 8745 http://xoops.svn.sourceforge.net/xoops/?rev=8745&view=rev Author: djculex Date: 2012-01-16 17:22:07 +0000 (Mon, 16 Jan 2012) Log Message: ----------- Updated register and templates to use admin selected forms Modified Paths: -------------- XoopsModules/smallworld/trunk/editprofile.php XoopsModules/smallworld/trunk/register.php XoopsModules/smallworld/trunk/templates/smallworld_userprofile_regtemplate.html Modified: XoopsModules/smallworld/trunk/editprofile.php =================================================================== --- XoopsModules/smallworld/trunk/editprofile.php 2012-01-16 16:22:06 UTC (rev 8744) +++ XoopsModules/smallworld/trunk/editprofile.php 2012-01-16 17:22:07 UTC (rev 8745) @@ -201,7 +201,7 @@ $xoopsTpl->assign('show_city','no'); } - if (smallworldGetValfromArray ('presentcity', 'smallworldusethesefields') == 0) { + if (smallworldGetValfromArray ('website', 'smallworldusethesefields') == 0) { $xoopsTpl->assign('show_website','no'); } Modified: XoopsModules/smallworld/trunk/register.php =================================================================== --- XoopsModules/smallworld/trunk/register.php 2012-01-16 16:22:06 UTC (rev 8744) +++ XoopsModules/smallworld/trunk/register.php 2012-01-16 17:22:07 UTC (rev 8745) @@ -53,126 +53,216 @@ if (smallworldGetValfromArray ('realname', 'smallworldusethesefields') != 0) { $realname = $item->input('realname', 'realname', 'realname',$size=30, $preset=$xoopsUser->getVar('name')); $xoopsTpl->append('realname',$realname); + } else { + $xoopsTpl->assign('show_realname','no'); } if (smallworldGetValfromArray ('gender', 'smallworldusethesefields') != 0) { // Dropdown for gender $gender = $item->dropdown('gender',$arr0,0); $xoopsTpl->append('gender', $gender); + } else { + $xoopsTpl->assign('show_gender','no'); } // Selectbox for "interested in gender(s)" - $intInGender = $item->radio('intingender',$arr01,0); + if (smallworldGetValfromArray ('interestedin', 'smallworldusethesefields') != 0) { + $intInGender = $item->radio('intingender',$arr01,0); $xoopsTpl->append('intingender',$intInGender); + } else { + $xoopsTpl->assign('show_interestedin','no'); + } // Dropdown for marital status - $relationshipstatus = $item->dropdown('relationship',$arr02,0); + if (smallworldGetValfromArray ('relationshipstatus', 'smallworldusethesefields') != 0) { + $relationshipstatus = $item->dropdown('relationship',$arr02,0); $xoopsTpl->append('relationshipstatus',$relationshipstatus); - // Partner. Only shown if marital status is married, it's complicated, engaged) - $partner = $item->input('partner', 'partner', 'partner',$size='30', $preset=null); - $xoopsTpl->append('partner',$partner); + // Partner. Only shown if marital status is married, it's complicated, engaged) + $partner = $item->input('partner', 'partner', 'partner',$size='30', $preset=null); + $xoopsTpl->append('partner',$partner); + } else { + $xoopsTpl->assign('show_relationshipstatus','no'); + } // Checkbox for searchin for - $searchrelat = $item->radio('searchrelat',$arr03,0); + if (smallworldGetValfromArray ('lookingfor', 'smallworldusethesefields') != 0) { + $searchrelat = $item->radio('searchrelat',$arr03,0); $xoopsTpl->append('searchrelat',$searchrelat); + } else { + $xoopsTpl->assign('show_lookingfor','no'); + } // Select Birthday dd-mm-Y - $birthday = $item->input('birthday', 'birthday', 'birthday',$size='12', $preset=null); + if (smallworldGetValfromArray ('birthday', 'smallworldusethesefields') != 0) { + $birthday = $item->input('birthday', 'birthday', 'birthday',$size='12', $preset=null); $xoopsTpl->append('birthdaydate',$birthday); + } else { + $xoopsTpl->assign('show_birthday','no'); + } // Select Hometown or Enter new - $birthplace = $item->input('birthplace', 'birthplace', 'birthplace',$size='50', $preset=null); + if (smallworldGetValfromArray ('birthplace', 'smallworldusethesefields') != 0) { + $birthplace = $item->input('birthplace', 'birthplace', 'birthplace',$size='50', $preset=null); $xoopsTpl->append('birthplace',$birthplace); + } else { + $xoopsTpl->assign('show_birthplace','no'); + } // Dropdown politics - $politic = $item->dropdown('politic',$arr04,0); + if (smallworldGetValfromArray ('politicalview', 'smallworldusethesefields') != 0) { + $politic = $item->dropdown('politic',$arr04,0); $xoopsTpl->append('politic',$politic); + } else { + $xoopsTpl->assign('show_political','no'); + } // Dropdown Religion - $religion = $item->dropdown('religion',$arr05,0); + if (smallworldGetValfromArray ('religiousview', 'smallworldusethesefields') != 0) { + $religion = $item->dropdown('religion',$arr05,0); $xoopsTpl->append('religion',$religion); + } else { + $xoopsTpl->assign('show_religion','no'); + } // ------------ CONTACT INFO ------------ // // Add email test //function input_add($class, $name, $name2, $rel, $size, $textmore, $preset=null) { //$emailtext = $item->input('email','email','email',$size='12',$preset=null); - $emailtext = $item->input_add('smallworld_add2','email','emailtype','.smallworld_clone2',20,_SMALLWORLD_ADDMORE,$preset=$xoopsUser->getVar('email'),"email-0"); + if (smallworldGetValfromArray ('emails', 'smallworldusethesefields') != 0) { + $emailtext = $item->input_add('smallworld_add2','email','emailtype','.smallworld_clone2',20,_SMALLWORLD_ADDMORE,$preset=$xoopsUser->getVar('email'),"email-0"); $emailtext .= "<span class='smallworld_remove' id='emailremove'><a href='javascript:removelnk (\"#emailremovelnk\",\"input#email\",\"email\");' id='emailremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>"; $emailtext .= "<a class='smallworld_addemail' href='javascript:void(0);' id='emailAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>"; - $xoopsTpl->append('emailtext',$emailtext); + $xoopsTpl->append('emailtext',$emailtext); + } else { + $xoopsTpl->assign('show_emails','no'); + } // Drop down for screen names /*dropdown_add ($name, $name2, $rel, array $options, $textmore, $selected=null) {*/ - $screenname = $item->dropdown_add('smallworld_add','screenname', 'screenname_type', '.smallworld_clone',$arr06,_SMALLWORLD_ADDMORE,$selected=null, $preset=null); - $screenname .= "<span class='smallworld_remove' id='screennameremove'>"; + if (smallworldGetValfromArray ('screennames', 'smallworldusethesefields') != 0) { + $screenname = $item->dropdown_add('smallworld_add','screenname', 'screenname_type', '.smallworld_clone',$arr06,_SMALLWORLD_ADDMORE,$selected=null, $preset=null); + $screenname .= "<span class='smallworld_remove' id='screennameremove'>"; $screenname .= "<a href='javascript:removelnk (\"#screennameremovelnk\",\"span#screenname\",\"screenname\");' id='screennameremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>"; $screenname .= "<a class='smallworld_addscreenname' href='javascript:void(0);' id='screennameAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>"; - $xoopsTpl->append('screenname',$screenname); - + $xoopsTpl->append('screenname',$screenname); + } else { + $xoopsTpl->assign('show_screennames','no'); + } + // Mobilephone - $mobile = $item->input('mobile','mobile','mobile',12,$preset=null); - $xoopsTpl->append('mobile',$mobile); + if (smallworldGetValfromArray ('mobile', 'smallworldusethesefields') != 0) { + $mobile = $item->input('mobile','mobile','mobile',12,$preset=null); + $xoopsTpl->append('mobile',$mobile); + } else { + $xoopsTpl->assign('show_mobile','no'); + } // Landphone - $phone = $item->input('phone','phone','phone',12,$preset=null); - $xoopsTpl->append('phone',$phone); + if (smallworldGetValfromArray ('landphone', 'smallworldusethesefields') != 0) { + $phone = $item->input('phone','phone','phone',12,$preset=null); + $xoopsTpl->append('phone',$phone); + } else { + $xoopsTpl->assign('show_landphone','no'); + } // Adress - $adress = $item->input('adress','adress','adress',$size='50',$preset=null); - $xoopsTpl->append('adress',$adress); - - $present_city = $item->input('present_city', 'present_city', 'present_city',50, $preset=null); - $xoopsTpl->append('present_city',$present_city); - - $present_country = $item->input('present_country', 'present_country', 'present_country',$size='50', $preset=null); - $xoopsTpl->append('present_country',$present_country); + if (smallworldGetValfromArray ('streetadress', 'smallworldusethesefields') != 0) { + $adress = $item->input('adress','adress','adress',$size='50',$preset=null); + $xoopsTpl->append('adress',$adress); + } else { + $xoopsTpl->assign('show_adress','no'); + } + if (smallworldGetValfromArray ('presentcity', 'smallworldusethesefields') != 0) { + $present_city = $item->input('present_city', 'present_city', 'present_city',50, $preset=null); + $xoopsTpl->append('present_city',$present_city); + $present_country = $item->input('present_country', 'present_country', 'present_country',$size='50', $preset=null); + $xoopsTpl->append('present_country',$present_country); + } else { + $xoopsTpl->assign('show_city','no'); + } + + if (smallworldGetValfromArray ('website', 'smallworldusethesefields') == 0) { + $xoopsTpl->assign('show_website','no'); + } + // ------------ INTERESTS ------------ // // Textarea for interests //textarea($name, $id, $title, $rows, $cols, $class) - $interests = $item->textarea('interests','interests',_SMALLWORLD_INTERESTS,1,20,'favourites'); - $xoopsTpl->append('interests',$interests); + if (smallworldGetValfromArray ('interests', 'smallworldusethesefields') != 0) { + $interests = $item->textarea('interests','interests',_SMALLWORLD_INTERESTS,1,20,'favourites'); + $xoopsTpl->append('interests',$interests); + } else { + $xoopsTpl->assign('show_interests','no'); + } // Textarea for Music - $music = $item->textarea('music','music',_SMALLWORLD_MUSIC,1,20,'favourites'); - $xoopsTpl->append('music',$music); + if (smallworldGetValfromArray ('favouritemusic', 'smallworldusethesefields') != 0) { + $music = $item->textarea('music','music',_SMALLWORLD_MUSIC,1,20,'favourites'); + $xoopsTpl->append('music',$music); + } else { + $xoopsTpl->assign('show_music','no'); + } // Textarea for Tvshow - $tvshow = $item->textarea('tvshow','tvshow',_SMALLWORLD_TVSHOW,1,20,'favourites'); - $xoopsTpl->append('tvshow',$tvshow); + if (smallworldGetValfromArray ('favouritetvshows', 'smallworldusethesefields') != 0) { + $tvshow = $item->textarea('tvshow','tvshow',_SMALLWORLD_TVSHOW,1,20,'favourites'); + $xoopsTpl->append('tvshow',$tvshow); + } else { + $xoopsTpl->assign('show_tv','no'); + } // Textarea for Movie - $movie = $item->textarea('movie','movie',_SMALLWORLD_MOVIE,1,20,'favourites'); - $xoopsTpl->append('movie',$movie); + if (smallworldGetValfromArray ('favouritemovies', 'smallworldusethesefields') != 0) { + $movie = $item->textarea('movie','movie',_SMALLWORLD_MOVIE,1,20,'favourites'); + $xoopsTpl->append('movie',$movie); + } else { + $xoopsTpl->assign('show_movies','no'); + } // Textarea for Books - $books = $item->textarea('books','books',_SMALLWORLD_BOOKS,1,20,'favourites'); - $xoopsTpl->append('books',$books); + if (smallworldGetValfromArray ('favouritebooks', 'smallworldusethesefields') != 0) { + $books = $item->textarea('books','books',_SMALLWORLD_BOOKS,1,20,'favourites'); + $xoopsTpl->append('books',$books); + } else { + $xoopsTpl->assign('show_books','no'); + } // Textarea for About me - $aboutme = $item->textarea('aboutme','aboutme',_SMALLWORLD_ABOUTME,2,20,'favourites'); - $xoopsTpl->append('aboutme',$aboutme); + if (smallworldGetValfromArray ('aboutme', 'smallworldusethesefields') != 0) { + $aboutme = $item->textarea('aboutme','aboutme',_SMALLWORLD_ABOUTME,2,20,'favourites'); + $xoopsTpl->append('aboutme',$aboutme); + } else { + $xoopsTpl->assign('show_aboutme','no'); + } // ------------ SCHOOL ------------ // - //School name - $school = $item->school_add ('smallworld_add3', 'school', 'school_type', '.smallworld_clone3', $arr7, _SMALLWORLD_ADDMORE, $selected=null,$preset=null,$selectedstart=null,$selectedstop=null); - $school .= "<span class='smallworld_remove2' id='schoolremove'>"; - $school .= "<a href='javascript:removelnk (\"#schoolremovelnk\",\"div#school\",\"school\");' id='schoolremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>"; + if (smallworldGetValfromArray ('education', 'smallworldusethesefields') != 0) { + $school = $item->school_add ('smallworld_add3', 'school', 'school_type', '.smallworld_clone3', $arr7, _SMALLWORLD_ADDMORE, $selected=null,$preset=null,$selectedstart=null,$selectedstop=null); + $school .= "<span class='smallworld_remove2' id='schoolremove'>"; + $school .= "<a href='javascript:removelnk (\"#schoolremovelnk\",\"div#school\",\"school\");' id='schoolremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>"; $school .= "<a class='smallworld_addschool' href='javascript:void(0);' id='schoolAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>"; - $xoopsTpl->append('school',$school); + $xoopsTpl->append('school',$school); + } else { + $xoopsTpl->assign('show_school','no'); + } //Jobs //function job ($class, $name,$name2, $rel, array$options, $textmore, $selected=null, $preset=null, $selectedstart=null, $selectedstop=null) { - $job = $item->job('smallworld_add4', 'job', 'job_type', '.smallworld_clone4', _SMALLWORLD_ADDMORE, $selected=null, $preset=null, $selectedstart=null, $selectedstop=null); - $job .= "<span class='smallworld_remove3' id='jobremove'>"; + if (smallworldGetValfromArray ('employment', 'smallworldusethesefields') != 0) { + $job = $item->job('smallworld_add4', 'job', 'job_type', '.smallworld_clone4', _SMALLWORLD_ADDMORE, $selected=null, $preset=null, $selectedstart=null, $selectedstop=null); + $job .= "<span class='smallworld_remove3' id='jobremove'>"; $job .= "<a href='javascript:removelnk (\"#jobremovelnk\",\"div#job\",\"job\");' id='jobremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>"; - $job .= "<a class='smallworld_addjob' href='javascript:void(0);' id='jobAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>"; - $xoopsTpl->append('job',$job); + $job .= "<a class='smallworld_addjob' href='javascript:void(0);' id='jobAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>"; + $xoopsTpl->append('job',$job); + } else { + $xoopsTpl->assign('show_jobs','no'); + } // Create hidden forms for birthcity $birthplace_lat = $item->hidden('birthplace_lat','birthplace_lat',$preset=null); Modified: XoopsModules/smallworld/trunk/templates/smallworld_userprofile_regtemplate.html =================================================================== --- XoopsModules/smallworld/trunk/templates/smallworld_userprofile_regtemplate.html 2012-01-16 16:22:06 UTC (rev 8744) +++ XoopsModules/smallworld/trunk/templates/smallworld_userprofile_regtemplate.html 2012-01-16 17:22:07 UTC (rev 8745) @@ -8,6 +8,7 @@ <label for="smallworld_realname"><{$smarty.const._SMALLWORLD_PERSONALINFO}></label> <table border="0" class="smallworld_table" cellspacing="0" cellpadding="0"> + <{if $show_realname != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_REALNAME}></p></td> <td><label for="Realname"></label> @@ -16,7 +17,9 @@ <{/section}> </td> </tr> + <{/if}> + <{if $show_gender != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_GENDER}></p></td> <td><label for="select"></label> @@ -25,7 +28,9 @@ <{/section}> </td> </tr> + <{/if}> + <{if $show_interestedin != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_INTERESTEDIN}></p></td> <td><label for="select"></label> @@ -36,7 +41,9 @@ </span> </td> </tr> + <{/if}> + <{if $show_relationshipstatus != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_RELATIONSHIPSTATUS}></p></td> <td><label for="select"></label> @@ -56,7 +63,9 @@ </td> </tr> </div> + <{/if}> + <{if $show_lookingfor != 'no'}> <tr> <td valign="top"><p><{$smarty.const._SMALLWORLD_LOOKINGFOR}></p></td> <td><label for="select"></label> @@ -68,7 +77,9 @@ <br/> </td> </tr> + <{/if}> + <{if $show_birthday != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_BIRTHDAY}></p></td> <td> @@ -77,7 +88,9 @@ <{/section}> </td> </tr> + <{/if}> + <{if $show_birthplace != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_BIRTHPLACE}></p></td> <div class="ui-widget"> @@ -98,11 +111,11 @@ <{$birthplace_country_img[i]}> <{/section}> </td> - </div> - + </div> </tr> + <{/if}> - + <{if $show_political != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_POLITICALVIEW}></p></td> <td><label for="select"></label> @@ -111,7 +124,9 @@ <{/section}> </td> </tr> + <{/if}> + <{if $show_religion != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_RELIGIOUSVIEW}></p></td> <td><lable for="select"></lable> @@ -120,12 +135,14 @@ <{/section}> </td> </tr> + <{/if}> </table> </fieldset> <fieldset> <legend><{$smarty.const._SMALLWORLD_STEP2}></legend> <table border="0" class="smallworld_table" cellspacing="0" cellpadding="0"> + <{if $show_emails != 'no'}> <tr> <td valign="top"><p><{$smarty.const._SMALLWORLD_EMAILS}></p></td> <td><label for="email"></label> @@ -134,6 +151,9 @@ <{/section}> </td> </tr> + <{/if}> + + <{if $show_screennames != 'no'}> <tr> <td valign="top"><p><{$smarty.const._SMALLWORLD_SCREENNAMES}></p></td> <td><label for="Screenname"></label> @@ -143,6 +163,9 @@ </td> </tr> + <{/if}> + + <{if $show_mobile != 'no'}> <tr> <td valign="top"><p><{$smarty.const._SMALLWORLD_MOBILEPHONE}></p></td> @@ -153,6 +176,9 @@ </td> </tr> + <{/if}> + + <{if $show_landphone != 'no'}> <tr> <td valign="top"><p><{$smarty.const._SMALLWORLD_LANDPHONE}></p></td> <td> @@ -161,7 +187,9 @@ <{/section}> </td> </tr> - + <{/if}> + + <{if $show_adress != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_ADRESS}></p></td> <td> @@ -170,6 +198,9 @@ <{/section}> </td> </tr> + <{/if}> + + <{if $show_city != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_CITY}></p></td> <div class="ui-widget"> @@ -199,12 +230,16 @@ </td> </tr> + <{/if}> + + <{if $show_website != 'no'}> <tr> <td valign="top"><p><{$smarty.const._SMALLWORLD_WEBSITE}></p></td> <td><textarea name="website" id="website">http://</textarea> </td> </tr> + <{/if}> </table><br/> </fieldset> @@ -212,6 +247,7 @@ <fieldset> <legend><{$smarty.const._SMALLWORLD_STEP3}></legend> <table border="0" class="smallworld_table" cellspacing="0" cellpadding="0"> + <{if $show_interests != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_INTERESTS}></p></td> <td> @@ -220,8 +256,10 @@ <{/section}> </td> </tr> + <{/if}> + + <{if $show_music != 'no'}> <tr> - <td><p><{$smarty.const._SMALLWORLD_FAVOURITEMUSIC}></p></td> <td> <{section name=i loop=$music}> @@ -229,6 +267,9 @@ <{/section}> </td> </tr> + <{/if}> + + <{if $show_tv != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_FAVOURITETVSHOW}></p></td> <td> @@ -237,6 +278,9 @@ <{/section}> </textarea></td> </tr> + <{/if}> + + <{if $show_movies != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_FAVOURITEMOVIES}></p></td> @@ -246,6 +290,9 @@ <{/section}> </td> </tr> + <{/if}> + + <{if $show_books != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_FAVOURITEBOOKS}></p></td> <td> @@ -254,7 +301,9 @@ <{/section}> </td> </tr> + <{/if}> + <{if $show_aboutme != 'no'}> <tr> <td><p><{$smarty.const._SMALLWORLD_ABOUTME}></p></td> <td> @@ -263,6 +312,7 @@ <{/section}> </td> </tr> + <{/if}> <tr> <td ></td> </tr><br/> @@ -273,7 +323,7 @@ <fieldset> <legend><{$smarty.const._SMALLWORLD_STEP4}></legend> <table border="0" class="smallworld_table" cellspacing="0" cellpadding="0"> - + <{if $show_school != 'no'}> <tr> <label for="School"></label> <td> @@ -283,6 +333,7 @@ <{/section}> </td> </tr> + <{/if}> </table> </fieldset> @@ -290,6 +341,7 @@ <legend><{$smarty.const._SMALLWORLD_STEP5}></legend> <table border="0" class="smallworld_table" cellspacing="0" cellpadding="0"> <tr> + <{if $show_jobs != 'no'}> <label for="Job"></label> <td> <p class="smallworld_clone4"> @@ -298,6 +350,7 @@ <{/section}> </td> </tr> + <{/if}> </table> </fieldset> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |