$filter_sort = '<p><select size="1" name="sort" onchange="document.location=\'index.php?a=3&id=' . $id . '&dir=' . $dir . '&sort=\'+this.options[this.selectedIndex].value">' . '<option value="createdon"' . ($sort == 'createdon' ? ' selected' : '') . '>' . $_lang['createdon'] . '</option>' . '<option value="pub_date"' . ($sort == 'pub_date' ? ' selected' : '') . '>' . $_lang["page_data_publishdate"] . '</option>' . '<option value="pagetitle"' . ($sort == 'pagetitle' ? ' selected' : '') . '>' . $_lang['pagetitle'] . '</option>' . '<option value="menuindex"' . ($sort == 'menuindex' ? ' selected' : '') . '>' . $_lang['resource_opt_menu_index'] . '</option>' . '<option value="published"' . ($sort == 'published' ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . '</select>';
 $filter_dir = '<select size="1" name="dir" onchange="document.location=\'index.php?a=3&id=' . $id . '&sort=' . $sort . '&dir=\'+this.options[this.selectedIndex].value">' . '<option value="DESC"' . ($dir == 'DESC' ? ' selected' : '') . '>' . $_lang['sort_desc'] . '</option>' . '<option value="ASC"' . ($dir == 'ASC' ? ' selected' : '') . '>' . $_lang['sort_asc'] . '</option>' . '</select></p>';
 $resource = $modx->db->makeArray($rs);
 // CSS style for table
 $tableClass = 'grid';
 $rowHeaderClass = 'gridHeader';
 $rowRegularClass = 'gridItem';
 $rowAlternateClass = 'gridAltItem';
 $childsTable->setTableClass($tableClass);
 $childsTable->setRowHeaderClass($rowHeaderClass);
 $childsTable->setRowRegularClass($rowRegularClass);
 $childsTable->setRowAlternateClass($rowAlternateClass);
 // Table header
 $listTableHeader = array('docid' => $_lang['id'], 'title' => $_lang['resource_title'], 'createdon' => $_lang['createdon'], 'pub_date' => $_lang['page_data_publishdate'], 'status' => $_lang['page_data_status'], 'edit' => $_lang['mgrlog_action']);
 $tbWidth = array('2%', '', '10%', '10%', '90', '150');
 $childsTable->setColumnWidths($tbWidth);
 $sd = isset($_REQUEST['dir']) ? '&amp;dir=' . $_REQUEST['dir'] : '&amp;dir=DESC';
 $sb = isset($_REQUEST['sort']) ? '&amp;sort=' . $_REQUEST['sort'] : '&amp;sort=createdon';
 $pg = isset($_REQUEST['page']) ? '&amp;page=' . (int) $_REQUEST['page'] : '';
 $add_path = $sd . $sb . $pg;
 $listDocs = array();
 foreach ($resource as $k => $children) {
     /*
     $listDocs[] = array(
     	'docid' =>  $children['id'],
     	'title' =>  (($children['deleted'] ? ('<s>'.$children['pagetitle'].'</s>') : ( ($modx->hasPermission('edit_document')) ? ('<a href="index.php?a=27&amp;id='.$children['id'].'">' . $children['pagetitle'] . '</a>') : $children['pagetitle'] ))),
     	'createdon' =>  ($modx->toDateFormat($children['createdon']+$server_offset_time,'dateOnly')),
     	'pub_date' =>  ($children['pub_date']? ($modx->toDateFormat($children['pub_date']+$server_offset_time,'dateOnly')) : ''),
     	'status' => ($children['published'] == 0) ? '<span class="unpublishedDoc">'.$_lang['page_data_unpublished'].'</span>' : '<span class="publishedDoc">'.$_lang['page_data_published'].'</span>',
     	'edit' =>   (($modx->hasPermission('edit_document')) ? '&nbsp;<a href="index.php?a=27&amp;id='.$children['id'].'" title="'.$_lang['edit'].'"><img src="' . $_style["icons_save"] .'" /></a>&nbsp;<a href="index.php?a=51&amp;id='.$children['id'].'" title="'.$_lang['move'].'"><img 
     	src="' . $_style["icons_move_document"] .'" /></a>&nbsp;<a href="index.php?a=61&amp;id='.$children['id'].'" title="'.$_lang["publish_resource"].'"><img src="' . $_style["icons_publish_document"] .'" /></a>&nbsp;<a