Changeset 437
- Timestamp:
- Nov 13, 2009, 11:07:29 PM (15 years ago)
- Location:
- trunk/xpressme_integration_kit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/blocks/widget_block.php
r339 r437 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; -
trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/widget_block_theme.php
r339 r437 5 5 $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_block_widget.html' : trim( $options[1] ); 6 6 $title_show = empty( $options[2] ) ? false : true ; 7 $selected = array_slice($options,3); // get allowed cats 7 $widget_select = empty( $options[3] ) ? '' : $options[3] ; 8 9 $selected = explode(',' , $widget_select); 8 10 9 11 $output = '';
Note: See TracChangeset
for help on using the changeset viewer.