- Timestamp:
- Nov 20, 2009, 2:52:16 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/XPressMU/xpressme_integration_kit/blocks/widget_block.php
r339 r451 20 20 $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_widget_block.html' : trim( $options[1] ); 21 21 $title_show = empty( $options[2] ) ? false : true ; 22 $selected = array_slice($options,3); // get allowed cats 22 $widget_select = empty( $options[3] ) ? '' : $options[3] ; 23 24 $selected = explode(',' , $widget_select); 23 25 24 26 if ($mydirname == 'wordpress'){ … … 48 50 $form .= "<br />"; 49 51 $form .= _MB_XP2_SELECT_WIDGET .":<br />\n"; 50 $select = " <select name='options[]' multiple=\"multiple\">\n"; 52 $form .= "<input type='hidden' name='options[3]' value='$widget_select' />\n"; 53 54 $select = " <select name='widget_sel' multiple=\"multiple\" onclick=\"WidgetSelect()\">\n"; 51 55 $found = false; 52 56 foreach ( (array) $sidebars_widgets as $index => $sidebar ){ … … 67 71 68 72 $select .= "</select><br/>\n"; 73 $select .= ' 74 <script type="text/javascript"> 75 function WidgetSelect(){ 76 var idx=new Array(); 77 var sel=document.forms["blockform"].elements["widget_sel"].options; 78 for(var i=0, n=0; i<sel.length; i++){ 79 if(sel[i].selected){ idx[n++]=sel[i].value; } 80 } 81 if(idx.length>0){ 82 document.forms["blockform"].elements["options[3]"].value = idx; 83 } 84 } 85 </script> 86 '; 87 69 88 if ($found){ 70 89 $form = $form . $select;
Note: See TracChangeset
for help on using the changeset viewer.