protected function build(PageBody &$body, SubMenu &$submenu) { $this->pageName = "Event List"; $submenu->addLink("Add new Event", "#"); $submenu->addLink("Show Event", "#"); $submenu->addLink("Edit", "#"); $submenu->addLink("Delete", "#"); // show a list of events on a table $events = Database::get("Event"); if (isset($events)) { $table = new HtmlTable(); $table->setHead(["#", "Name", "Info"]); foreach ($events as $id => $event) { $table->addRow([$id, '<a href="?page=Event&event=' . $id . '">' . $event->name . '</a>', $event->address]); } $body->addToCenter($table); } else { $body->addToCenter(new Message("There is no event to show", Message::INFO)); } }
$arrValidColumns[] = $columnHeader; } elseif ($getMode === 'html' || $getMode === 'print') { $columnValues[] = $columnHeader; } } } // End-For if ($getMode === 'csv') { $str_csv = $str_csv . "\n"; } elseif ($getMode === 'html' || $getMode === 'print') { $table->setColumnAlignByArray($columnAlign); $table->addRowHeadingByArray($columnValues); } elseif ($getMode === 'pdf') { $table->setColumnAlignByArray($columnAlign); $table->addTableHeader(); $table->addRow(); $table->addAttribute('align', 'center'); $table->addColumn($headline, array('colspan' => count($arrValidColumns))); $table->addRow(); // Write valid column headings for ($column = 0; $column < count($arrValidColumns); ++$column) { $table->addColumn($arrValidColumns[$column], array('style' => 'text-align: ' . $columnAlign[$column] . ';font-size:14;background-color:#C7C7C7;'), 'th'); } } else { $table->addTableBody(); } $lastGroupHead = -1; // Mark for change between leader and member $listRowNumber = 1; foreach ($membersList as $member) { if ($getMode !== 'csv') {
$table->addRowHeadingByArray($columnHeading); $categoryId = 0; $userField = new TableUserField($gDb); // Intialize variables $description = ''; $hidden = ''; $disable = ''; $mandatory = ''; $usfSystem = ''; while ($row = $statement->fetch()) { $userField->clear(); $userField->setArray($row); if ($categoryId != $userField->getValue('cat_id')) { $block_id = 'admCategory' . $userField->getValue('usf_cat_id'); $table->addTableBody(); $table->addRow('', array('class' => 'admidio-group-heading')); $table->addColumn('<span id="caret_' . $block_id . '" class="caret"></span>' . $userField->getValue('cat_name'), array('id' => 'group_' . $block_id, 'colspan' => '8'), 'td'); $table->addTableBody('id', $block_id); $categoryId = $userField->getValue('usf_cat_id'); } // cut long text strings and provide tooltip if (strlen($userField->getValue('usf_description')) > 22) { $description = substr($userField->getValue('usf_description', 'database'), 0, 22) . ' <a data-toggle="modal" data-target="#admidio_modal" href="' . $g_root_path . '/adm_program/system/msg_window.php?message_id=user_field_description&message_var1=' . $userField->getValue('usf_name_intern') . '&inline=true"><span data-html="true" data-toggle="tooltip" data-original-title="' . str_replace('"', '\'', $userField->getValue('usf_description')) . '">[..]</span></a>'; } elseif ($userField->getValue('usf_description') === '') { $description = ' '; } else { $description = $userField->getValue('usf_description'); } if ($userField->getValue('usf_hidden') == 1) {
$memberDisabled = ' disabled="disabled" '; } // if user is flagged as leader than check the ckeckbox ;) if ($row['mem_leader'] > 0) { $leaderChecked = ' checked="checked" '; } // the leader of webmaster role can only be set by a webmaster if ($role->getValue('rol_webmaster') == 1 && !$gCurrentUser->isWebmaster()) { $leaderDisabled = ' disabled="disabled" '; } $columnValues = array('<input type="checkbox" id="role-' . $role->getValue('rol_id') . '" name="role-' . $role->getValue('rol_id') . '" ' . $memberChecked . $memberDisabled . ' onclick="javascript:profileJS.unMarkLeader(this);" value="1" />', '<label for="role-' . $role->getValue('rol_id') . '">' . $role->getValue('rol_name') . '</label>', $role->getValue('rol_description')); // if new category than display a category header if ($category != $role->getValue('cat_id')) { $block_id = 'admCategory' . $role->getValue('cat_id'); $table->addTableBody(); $table->addRow('', array('class' => 'admidio-group-heading', 'id' => 'group_' . $block_id)); $table->addColumn(); $table->addAttribute('colspan', '4', 'td'); $table->addData('<span id="caret_' . $block_id . '" class="caret"></span>' . $role->getValue('cat_name')); $table->addTableBody('id', $block_id); $category = $role->getValue('cat_id'); } $leaderRights = '<input type="checkbox" id="leader-' . $role->getValue('rol_id') . '" name="leader-' . $role->getValue('rol_id') . '" ' . $leaderChecked . $leaderDisabled . ' onclick="javascript:profileJS.markLeader(this);" value="1" />'; // show icon that leaders have no additional rights if ($role->getValue('rol_leader_rights') == ROLE_LEADER_NO_RIGHTS) { $leaderRights .= '<img class="admidio-icon-info" src="' . THEME_PATH . '/icons/info.png" alt="' . $gL10n->get('ROL_LEADER_NO_ADDITIONAL_RIGHTS') . '" title="' . $gL10n->get('ROL_LEADER_NO_ADDITIONAL_RIGHTS') . '" /> <img class="admidio-icon-link" src="' . THEME_PATH . '/icons/dummy.png" alt="dummy" />'; } // show icon with edit user right if leader has this right if ($role->getValue('rol_leader_rights') == ROLE_LEADER_MEMBERS_EDIT || $role->getValue('rol_leader_rights') == ROLE_LEADER_MEMBERS_ASSIGN_EDIT) {