[CS-Project-svn_notify] SF.net SVN: cs-project: [811] trunk/1.2
Brought to you by:
crazedsanity
From: <cra...@us...> - 2008-02-09 03:49:57
|
Revision: 811 http://cs-project.svn.sourceforge.net/cs-project/?rev=811&view=rev Author: crazedsanity Date: 2008-02-08 19:49:54 -0800 (Fri, 08 Feb 2008) Log Message: ----------- Updates to completely parse sample config (doesn't handle dependent items). Modified Paths: -------------- trunk/1.2/includes/content/settings.inc trunk/1.2/templates/content/settings/admin.content.tmpl Modified: trunk/1.2/includes/content/settings.inc =================================================================== --- trunk/1.2/includes/content/settings.inc 2008-02-09 03:48:05 UTC (rev 810) +++ trunk/1.2/includes/content/settings.inc 2008-02-09 03:49:54 UTC (rev 811) @@ -130,9 +130,12 @@ if(count($page->ftsSections) == 3 && $page->ftsSections[2] == 'admin') { if($user->is_admin() == 1) { + //read the sample config. - $xmlObj = new XMLParser(file_get_contents(dirname(__FILE__) .'/../../docs/samples/sample_config.xml')); - $myData = $xmlObj->get_path('/CONFIG'); + require_once(dirname(__FILE__) .'/../../lib/config.class.php'); + $config = new config(dirname(__FILE__) .'/../../docs/samples/sample_config.xml', FALSE); + $myData = $config->get_config_contents(FALSE); + $mainAttributes = $myData['attributes']; unset($myData['type'], $myData['attributes']); @@ -151,10 +154,24 @@ $rowName = $defaultRowName; if(strlen($attributes['TYPE'])) { $rowName = 'setting_'. $attributes['TYPE']; + + $optionList = NULL; + if($attributes['TYPE'] == 'select' && isset($attributes['OPTIONS'])) { + #debug_print(explode('|', $attributes['OPTIONS'])); + $tmpOptionList = explode('|', $attributes['OPTIONS']); + debug_print("parsing (". $indexName .")"); + debug_print($tmpOptionList); + $optionList = array(); + foreach($tmpOptionList as $optionInfo) { + $x = explode('=', $optionInfo); + $optionList[$x[0]] = $x[1]; + } + debug_print($optionList); + $optionList = $page->gfObj->array_as_option_list($optionList, $attributes['DEFAULT']); + debug_print($optionList); + } } - debug_print("Parsing (". $indexName .") using rowName=(". $rowName .")"); - if(!isset($page->templateRows[$rowName])) { throw new exception(__METHOD__ .": failed to retrieve block row named (". $rowName .")"); } @@ -167,6 +184,9 @@ 'description' => $attributes['DESCRIPTION'], 'value' => $value ); + if(!is_null($optionList)) { + $repArr['setting_select__normal'] = $optionList; + } $parsedRows .= $page->mini_parser($page->templateRows[$rowName], $repArr); } #debug_print($parsedRows); Modified: trunk/1.2/templates/content/settings/admin.content.tmpl =================================================================== --- trunk/1.2/templates/content/settings/admin.content.tmpl 2008-02-09 03:48:05 UTC (rev 810) +++ trunk/1.2/templates/content/settings/admin.content.tmpl 2008-02-09 03:49:54 UTC (rev 811) @@ -38,12 +38,7 @@ <td> <select name="%%index%%" %%disabled%%> - <!-- BEGIN xsetting_select__normal --> - <option value="%%value%%">%%displayValue%%</option> - <!-- END setting_select__normal --> - <!-- BEGIN xsetting_select__onSelect --> - <option value="%%value%%" onSelect="enableInput(%%namedSection%%);">%%displayValue%%</option> - <!-- END setting_select__onSelect --> + %%setting_select__normal%% </select> </td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |