Пример #1
0
<?php

/**
 * This is the base list template used by nearly every module within the
 *   system. It provides a simple table layout with headers, support for our
 *   System Lookup Values, and it handles all the row generation.
 *
 * Like any template, this can be overridden by creating a list.php file
 *   within the root of your custom theme.
 *
 * The modules which use this template also include their own list templates
 *   which are included.. but are empty except for an include to this file.
 *   This is on purpose in case you just want to customize some of the list
 *   screens in certain modules instead of all of them at once.
 */
global $m;
$page = (int) w2PgetParam($_GET, 'page', 1);
$paginator = new w2p_Utilities_Paginator($items);
$items = $paginator->getItemsOnPage($page);
echo $paginator->buildNavigation($AppUI, $m, $tab);
$listTable = new w2p_Output_ListTable($AppUI);
echo $listTable->startTable();
echo $listTable->buildHeader($fields, $sortable, $m);
echo $listTable->buildRows($items, $customLookups);
echo $listTable->endTable();
echo $paginator->buildNavigation($AppUI, $m, $tab);
Пример #2
0
$fieldNames = array();
$module = new w2p_System_Module();
$fields = $module->loadSettings('projects', 'index_list');
if (0 == count($fields)) {
    // TODO: This is only in place to provide an pre-upgrade-safe
    //   state for versions earlier than v2.3
    //   At some point at/after v4.0, this should be deprecated
    $fieldList = array('project_color_identifier', 'project_priority', 'project_name', 'project_company', 'project_start_date', 'project_end_date', 'project_actual_end_date', 'project_owner', 'project_task_count');
    $fieldNames = array('%', 'P', 'Project Name', 'Company', 'Start', 'End', 'Actual', 'Owner', 'Tasks');
    $module->storeSettings('projects', 'index_list', $fieldList, $fieldNames);
    $fields = array_combine($fieldList, $fieldNames);
}
$fieldList = array_keys($fields);
$fieldNames = array_values($fields);
$page = (int) w2PgetParam($_GET, 'page', 1);
$paginator = new w2p_Utilities_Paginator($projects);
$items = $paginator->getItemsOnPage($page);
?>

<form action="./index.php?m=projects" method="post" accept-charset="utf-8">
    <table id="tblProjects-list" class="tbl list">
        <tr>
            <td colspan="<?php 
echo count($fieldNames) + 1;
?>
">
                <?php 
echo $paginator->buildNavigation($AppUI, $m, $tab, array('orderby' => $orderby));
?>
            </td>
        </tr>