I have been working trying to make the app-filemanager so that we can access files per app/entry.
Thinks were going really smooth until I got to the next match widget. I created a widget call app_filemanager which has copied the etemplates from the filemanager so the ui is the same.
I planned on mounting (hope I used the right term mounting) mounting it to the specific app/intry id folder in default/apps/app/id/. I started a new stream wrapper for this purpose.
My problem is that I cannot initialize the nextmatch widget used within the new widget called app_filemanager. I initialize an array in the $value parameter with the get_rows call back but the nextmatch widget never gets the data.
I have not seen a widget use the nextmtath widget before for an example. The etamplate NM widget is caleed NM so there are no naming issues.
class app_filemanager_widget
{
/**
* @var array exported methods of this class
/
var $public_functions = array(
‘get_rows’ => True,
‘pre_process’ => True,
‘post_process’ => True,
//‘ajax_search’ => True,
);
/*
* @var array availible extensions and there names for the editor
*/
var $human_name = array(
‘app_filemanager’ => ‘AppFilemanager’,
);
/**
* @var boolean $debug switches debug-messages on and off
*/
var $debug = true;
/**
* Constructor of the extension
*
* @param string $ui '' for html
*/
function app_filemanager_widget($ui='')
{
}
function pre_process($name,&$value,&$cell,&$readonlys,&$extension_data,&$tmpl)
{
//$extension_data['type'] = $type = $cell['type'] ='template';
$extension_data['type'] = $type = $cell['type'];
$extension_data['needed'] = $cell['needed'];
//$extension_data=$value;
if ($this->debug)
{
echo "<p>app-file_widget::pre_process($name,$value,".print_r($cell,true).",$readonlys,,)</p>\n";
echo "<p>start: $cell[type][$name]::pre_process: value ="; _debug_array($value);
echo "extension_data[$cell[type]][$name] ="; _debug_array($extension_data);
}
$GLOBALS['egw_info']['flags']['include_xajax'] = true;
//print_r($tpl);die();
if (!is_array($value['nm']))
{
$value = array(
'nm' => $GLOBALS['egw']->session->appsession('index','etemplate-app-filemanager'),
);
//$this->get_rows();
if (!is_array($value[‘nm’]))
{
$value[‘nm’] = array(
‘get_rows’ => ‘etemplate.app_filemanager_widget.get_rows’, // I method/callback to request the data for the rows eg. ‘notes.bo.get_rows’
‘filter’ => ‘1’, // current dir only
’no_filter2’ => True, // I disable the 2. filter (params are the same as for filter)
‘no_cat’ => True, // I disable the cat-selectbox
’lettersearch’ => True, // I show a lettersearch
’searchletter’ => false, // I0 active letter of the lettersearch or false for [all]
‘start’ => 0, // IO position in list
’order’ => ‘name’, // IO name of the column to sort after (optional for the sortheaders)
‘sort’ => ‘ASC’, // IO direction of the sort: ‘ASC’ or ‘DESC’
‘default_cols’ => ‘!comment,ctime’, // I columns to use if there’s no user or default pref (! as first char uses all but the named columns), default all columns
’csv_fields’ => false, // I false=disable csv export, true or unset=enable it with auto-detected fieldnames,
//or array with name=>label or name=>array(‘label’=>label,‘type’=>type) pairs (type is a eT widget-type)
‘path’ => ‘/home/’.$GLOBALS[‘egw_info’][‘user’][‘account_lid’],
);
}
//$tmpl->content=array_merge($tmpl->content,$value);
}
$tpl =& new etemplate(‘etemplate.filemanager.index’);
//$tpl->exec(‘etemplate.filemanager.index’,$content,$sel_options,$readonlys,array(‘nm’ => $content[‘nm’]),0,’’,’’,0);
$cell[‘size’] = $cell[‘name’];
$cell[‘type’] = ‘template’;
$cell[‘name’] = $tpl->name;
$cell[‘obj’] =& $tpl;
//print_r($cell);die();
// keep the editor away from the generated tmpls
$tpl->no_onclick = true;
if ($this->debug)
{
echo "<p>end: $type"."[$name]::pre_process: value ="; _debug_array($value);
}
return True; // extra Label is ok
}// function pree_process
function get_rows (){
print("finally the get row function is called");die();
}
}//class