public function recordpicker_fs($crits, $cols, $order, $filters, $path) { self::$browsed_records = array(); $this->init(); $theme = $this->init_module('Base/Theme'); Base_ThemeCommon::load_css($this->get_type(),'Browsing_records'); $this->set_module_variable('rp_fs_path',$path); $selected = Module::static_get_module_variable($path,'selected',array()); $theme->assign('filters', $this->show_filters($filters)); $theme->assign('disabled', ''); foreach ($crits as $k=>$v) { if (!is_array($v)) $v = array($v); if (isset($this->crits[$k]) && !empty($v)) { foreach ($v as $w) if (!in_array($w, $this->crits[$k])) $this->crits[$k][] = $w; } else $this->crits[$k] = $v; } $theme->assign('table', $this->show_data($this->crits, $cols, $order, false, true)); if ($this->amount_of_records>=10000) { $theme->assign('disabled', '_disabled'); $theme->assign('select_all', array('js'=>'', 'label'=>__('Select all'))); $theme->assign('deselect_all', array('js'=>'', 'label'=>__('Deselect all'))); } else { load_js('modules/Utils/RecordBrowser/RecordPickerFS/select_all.js'); $theme->assign('select_all', array('js'=>'RecordPicker_select_all(1,\''.$this->get_path().'\',\''.__('Processing...').'\');', 'label'=>__('Select all'))); $theme->assign('deselect_all', array('js'=>'RecordPicker_select_all(0,\''.$this->get_path().'\',\''.__('Processing...').'\');', 'label'=>__('Deselect all'))); } load_js('modules/Utils/RecordBrowser/rpicker_fs.js'); if (isset(self::$browsed_records['records'])) { foreach(self::$browsed_records['records'] as $id=>$i) { eval_js('rpicker_fs_init('.$id.','.(isset($selected[$id]) && $selected[$id]?1:0).',\''.$this->get_path().'\')'); } } /* $rpicker_ind = $this->get_module_variable('rpicker_ind'); $init_func = 'init_all_rpicker_'.$element.' = function(id, cstring){'; foreach($rpicker_ind as $v) $init_func .= 'rpicker_init(\''.$element.'\','.$v.');'; $init_func .= '}'; eval_js($init_func.';init_all_rpicker_'.$element.'();');*/ $theme->display('Record_picker'); }