fix framework lost on search in Stylite/Pixelegg template

This commit is contained in:
Ralf Becker 2014-01-24 11:24:14 +00:00
parent 5b586c4687
commit fc18f4d1ab
3 changed files with 16 additions and 10 deletions

View File

@ -566,11 +566,7 @@ class calendar_ui
*/
function sidebox_menu()
{
$base_hidden_vars = $link_vars = array();
if (@$_POST['keywords'])
{
$base_hidden_vars['keywords'] = $_POST['keywords'];
}
$link_vars = array();
// Magic etemplate2 favorites menu (from nextmatch widget)
display_sidebox('calendar',lang('Favorites'),array(
array(
@ -698,12 +694,9 @@ class calendar_ui
$file[++$n] = $this->_select_box('displayed view','view',$options,egw::link('/index.php','',false));
// Search
$blur = addslashes(html::htmlspecialchars(lang('Search').'...'));
$value = @$_POST['keywords'] ? html::htmlspecialchars($_POST['keywords']) : '';
$file[++$n] = array(
'text' => html::form('<input name="keywords" value="'.$value.'" style="width: 97.5%;"'.
' placeholder="'.$blur.'" title="'.lang('Search').'">',
'','/index.php',array('menuaction'=>'calendar.calendar_uilist.listview','ajax'=>'true')),
'text' => html::input('keywords', '', 'text',
'id="calendar_keywords" style="width: 97.5%;" placeholder="'.html::htmlspecialchars(lang('Search').'...').'"'),
'no_lang' => True,
'link' => False,
'icon' => false,

View File

@ -173,6 +173,16 @@ class calendar_uilist extends calendar_ui
{
$content['nm']['search'] = $_GET['search'];
}
// search via jdots ajax_exec uses $_REQUEST['json_data'] instead of regular GET parameters
if (isset($_REQUEST['json_data']) && ($json_data = json_decode($_REQUEST['json_data'], true)) &&
!empty($json_data['request']['parameters'][0]))
{
parse_str(substr($json_data['request']['parameters'][0], 10), $params); // cut off "/index.php?"
if (isset($params['keywords'])) // new search => set filters so every match is shown
{
$this->adjust_for_search($params['keywords'], $content['nm']);
}
}
if (isset($_REQUEST['keywords'])) // new search => set filters so every match is shown
{
$this->adjust_for_search($_REQUEST['keywords'],$content['nm']);

View File

@ -148,6 +148,9 @@
selectBox.multiple=true;
}
});
$j('#calendar_keywords').change(function(){
egw.open_link('calendar.calendar_uilist.listview&keywords='+encodeURIComponent(this.value)+'&ajax=true', 'calendar');
});
});
Calendar.setup({
flat : "calendar-container",