getColumns() public static method

Parses the 'columns' preference.
public static getColumns ( $backend ) : array
return array The list of columns to be displayed.
示例#1
0
 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     $sources = array();
     foreach (Gollem_Auth::getBackend() as $source => $info) {
         $selected = $unselected = array();
         $selected_list = array_flip(Gollem::getColumns($source));
         foreach ($info['attributes'] as $column) {
             if (isset($selected_list[$column])) {
                 $selected[$column] = $column;
             } else {
                 $unselected[$column] = $column;
             }
         }
         $sources[$source] = array('label' => $info['name'], 'selected' => $selected, 'unselected' => $unselected);
     }
     return Horde_Core_Prefs_Ui_Widgets::source(array('mainlabel' => _("Choose which columns to display, and in what order:"), 'selectlabel' => _("These columns will display in this order:"), 'sourcelabel' => _("Select a backend:"), 'sources' => $sources, 'unselectlabel' => _("Columns that will not be displayed:")));
 }
示例#2
0
文件: manager.php 项目: horde/horde
        $refresh_url->remove('searchfield');
    }
    $page = 0;
} else {
    $page = $vars->get('page', 0);
}
$session->set('gollem', 'filter', strval($vars->searchfield));
/* Get the list of copy/cut files in this directory. */
$clipboard_files = array();
foreach ($clipboard as $val) {
    if ($backkey == $val['backend'] && $val['path'] == Gollem::$backend['dir']) {
        $clipboard_files[$val['name']] = 1;
    }
}
/* Read the columns to display from the preferences. */
$columns = Gollem::getColumns($backkey);
/* Prepare the template. */
$template = $injector->createInstance('Horde_View');
$attrib = $gollem_vfs->getModifiablePermissions();
foreach (array('owner', 'group', 'all') as $val) {
    foreach (array('read', 'write', 'execute') as $val2) {
        if (isset($attrib[$val][$val2])) {
            $template->{$val . '_' . $val2} = !$attrib[$val][$val2];
        }
    }
}
$all_columns = array('type', 'name', 'share', 'edit', 'download', 'modified', 'size', 'permission', 'owner', 'group');
foreach ($all_columns as $column) {
    $template->{'columns_' . $column} = in_array($column, $columns);
}
$template->action = $refresh_url;