本文整理汇总了PHP中getPaging函数的典型用法代码示例。如果您正苦于以下问题:PHP getPaging函数的具体用法?PHP getPaging怎么用?PHP getPaging使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getPaging函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _showList
/**
* Gets the guestbook status
*
* @global ADONewConnection
* @global array
* @global array
* @access private
*/
function _showList()
{
global $objDatabase, $_CONFIG, $_ARRAYLANG;
$this->_objTpl->setTemplate($this->pageContent, true, true);
// initialize variables
$i = 1;
$paging = "";
$pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0;
/** start paging * */
$query = " SELECT id\n FROM " . DBPREFIX . "module_guestbook\n WHERE " . ($this->arrSettings['guestbook_only_lang_entries'] ? "lang_id='{$this->langId}' AND " : '') . "status = 1";
$objResult = $objDatabase->Execute($query);
$count = $objResult->RecordCount();
$paging = getPaging($count, $pos, "§ion=GuestBook", "<b>" . $_ARRAYLANG['TXT_GUESTBOOK_ENTRIES'] . "</b>", false);
/** end paging * */
$this->_objTpl->setVariable("GUESTBOOK_PAGING", $paging);
$this->_objTpl->setVariable("GUESTBOOK_TOTAL_ENTRIES", $count);
$query = " SELECT id,\n\t\t\t\t\t\t\t\tforename,\n\t\t\t\t\t\t\t\tname,\n gender,\n url,\n email,\n comment,\n ip,\n location,\n datetime\n FROM " . DBPREFIX . "module_guestbook\n WHERE " . ($this->arrSettings['guestbook_only_lang_entries'] ? "lang_id='{$this->langId}' AND " : '') . "status = 1\n ORDER BY id DESC";
$objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos);
while ($objResult !== false and !$objResult->EOF) {
$class = $i % 2 ? "row1" : "row2";
$gender = $objResult->fields["gender"] == "M" ? $_ARRAYLANG['guestbookGenderMale'] : $_ARRAYLANG['guestbookGenderFemale'];
// N/A
if ($objResult->fields['url'] != "") {
$this->_objTpl->setVariable('GUESTBOOK_URL', '<a href="' . $objResult->fields['url'] . '" target="_blank"><img alt="' . $objResult->fields['url'] . '" src=".' . ASCMS_MODULE_FOLDER . '/GuestBook/View/Media/www.gif" style="vertical-align:baseline" border="0" /></a>');
}
if ($objResult->fields['email'] != "") {
if ($this->arrSettings['guestbook_replace_at']) {
$email = $this->changeMail($objResult->fields['email']);
} else {
$email = $objResult->fields['email'];
}
$strMailTo = $this->createAsciiString('mailto:' . $email);
$strMailAdress = $this->createAsciiString($email);
$asciiStrGuestbookEmail = '<a href="' . $strMailTo . '"><img alt="' . $strMailAdress . '" src=".' . ASCMS_MODULE_FOLDER . '/GuestBook/View/Media/email.gif" style="vertical-align:baseline" border="0" /></a>';
$this->_objTpl->setVariable('GUESTBOOK_EMAIL', $asciiStrGuestbookEmail);
}
$this->_objTpl->setVariable(array('GUESTBOOK_ROWCLASS' => $class, 'GUESTBOOK_FORENAME' => htmlentities($objResult->fields["forename"], ENT_QUOTES, CONTREXX_CHARSET), 'GUESTBOOK_NAME' => htmlentities($objResult->fields["name"], ENT_QUOTES, CONTREXX_CHARSET), 'GUESTBOOK_GENDER' => $gender, 'GUESTBOOK_LOCATION' => htmlentities($objResult->fields["location"], ENT_QUOTES, CONTREXX_CHARSET), 'GUESTBOOK_DATE' => date(ASCMS_DATE_FORMAT, strtotime($objResult->fields['datetime'])), 'GUESTBOOK_COMMENT' => nl2br($objResult->fields["comment"]), 'GUESTBOOK_ID' => $objResult->fields["id"], 'GUESTBOOK_IP' => $objResult->fields["ip"]));
$this->_objTpl->parse('guestbook_row');
$i++;
$objResult->MoveNext();
}
$this->_objTpl->setVariable("GUESTBOOK_STATUS", $this->statusMessage);
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:51,代码来源:GuestBook.class.php
示例2: votingShowCurrent
/**
* Show current voting
*/
function votingShowCurrent($page_content)
{
global $objDatabase, $_CONFIG, $_ARRAYLANG, $_COOKIE;
$paging = '';
$objTpl = new \Cx\Core\Html\Sigma('.');
\Cx\Core\Csrf\Controller\Csrf::add_placeholder($objTpl);
$objTpl->setErrorHandling(PEAR_ERROR_DIE);
$objTpl->setTemplate($page_content);
if (!isset($_GET['vid'])) {
$_GET['vid'] = '';
}
if (!isset($_POST['votingemail'])) {
$_POST['votingemail'] = '';
}
$votingId = intval($_GET['vid']);
$msg = '';
$voted = false;
if ($_POST["votingoption"]) {
$voteId = intval($_POST["votingoption"]);
$query = "SELECT voting_system_id from " . DBPREFIX . "voting_results WHERE id=" . $voteId;
$objResult = $objDatabase->SelectLimit($query, 1);
if (!$objResult->EOF) {
$votingId = $objResult->fields["voting_system_id"];
}
$objVoting = $objDatabase->SelectLimit("SELECT submit_check FROM `" . DBPREFIX . "voting_system` WHERE `id`=" . $votingId, 1);
if ($objVoting !== false && $objVoting->RecordCount() == 1) {
if ($objVoting->fields['submit_check'] == 'email') {
$email = contrexx_addslashes($_POST['votingemail']);
$objValidator = new \FWValidator();
if ($objValidator->isEmail($email)) {
if (!_alreadyVotedWithEmail($votingId, $email)) {
if (($msg = VotingSubmitEmail($votingId, $voteId, $email)) === true) {
$msg = '';
$voted = true;
} else {
$msg = $_ARRAYLANG['TXT_VOTING_NONEXISTENT_EMAIL'] . '<br /><br />';
}
} else {
$msg = $_ARRAYLANG['TXT_VOTING_ALREADY_VOTED'] . '<br /><br />';
}
} else {
$msg = $_ARRAYLANG['TXT_VOTING_INVALID_EMAIL_ERROR'] . '<br /><br />';
}
} else {
VotingSubmit();
$voted = true;
}
}
}
if ($_GET['vid'] != '' && $_GET['act'] != 'delete') {
$query = "SELECT\n\t\t\tid, status,\n\t\t\tdate as datesec, question,\n\t\t\tvotes, submit_check,\n\t\t\tadditional_nickname, additional_forename,\n\t\t\tadditional_surname, additional_phone,\n\t\t\tadditional_street, additional_zip,\n additional_city, additional_email,\n additional_comment\n\n\t\t\tFROM " . DBPREFIX . "voting_system where id=" . intval($_GET['vid']);
} else {
$query = "SELECT\n\t\t\tid, status,\n\t\t\tdate as datesec, question,\n\t\t\tvotes, submit_check,\n\t\t\tadditional_nickname, additional_forename,\n\t\t\tadditional_surname, additional_phone,\n\t\t\tadditional_street, additional_zip,\n\t\t \tadditional_city, additional_email,\n additional_comment\n\n\t\t\tFROM " . DBPREFIX . "voting_system where status=1";
}
$objResult = $objDatabase->Execute($query);
if ($objResult->RecordCount() == 0) {
// Only show old records when no voting is set available
$objTpl->setVariable(array('VOTING_TITLE' => $_ARRAYLANG['TXT_VOTING_NOT_AVAILABLE'], 'VOTING_DATE' => '', 'VOTING_OLDER_TEXT' => '', 'VOTING_OLDER_DATE' => '', 'VOTING_PAGING' => '', 'TXT_DATE' => '', 'TXT_TITLE' => '', 'VOTING_RESULTS_TEXT' => '', 'VOTING_RESULTS_TOTAL_VOTES' => '', 'VOTING_OLDER_TITLE' => $_ARRAYLANG['TXT_VOTING_OLDER'], 'TXT_SUBMIT' => ''));
/** start paging **/
$query = "SELECT id, date as datesec, title, votes FROM " . DBPREFIX . "voting_system order by id desc";
$objResult = $objDatabase->SelectLimit($query, 5);
$count = $objResult->RecordCount();
$pos = intval($_GET[pos]);
if ($count > intval($_CONFIG['corePagingLimit'])) {
$paging = getPaging($count, $pos, "§ion=Voting", "<b>" . $_ARRAYLANG['TXT_VOTING_ENTRIES'] . "</b>", true);
}
/** end paging **/
$query = "SELECT id, date as datesec, title, votes FROM " . DBPREFIX . "voting_system order by id desc ";
$objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos);
while (!$objResult->EOF) {
$votingid = $objResult->fields['id'];
$votingTitle = stripslashes($objResult->fields['title']);
$votingVotes = $objResult->fields['votes'];
$votingDate = strtotime($objResult->fields['datesec']);
if ($i % 2 == 0) {
$class = "row2";
} else {
$class = "row1";
}
$objTpl->setVariable(array('VOTING_OLDER_TEXT' => '<a href="index.php?section=Voting&vid=' . $votingid . '" title="' . $votingTitle . '">' . $votingTitle . '</a>', 'VOTING_OLDER_DATE' => showFormattedDate($votingDate), 'VOTING_VOTING_ID' => $votingid, 'VOTING_LIST_CLASS' => $class, 'VOTING_PAGING' => $paging));
$objTpl->parse("votingRow");
$i++;
$objResult->MoveNext();
}
} else {
if (!$objResult->EOF) {
$votingId = $objResult->fields['id'];
$votingTitle = stripslashes($objResult->fields['question']);
$votingVotes = $objResult->fields['votes'];
$votingDate = strtotime($objResult->fields['datesec']);
$votingStatus = $objResult->fields['status'];
$votingMethod = $objResult->fields['submit_check'];
$additional_fields = _create_additional_input_fields($objResult);
$objResult->MoveNext();
} else {
errorHandling();
return false;
//.........这里部分代码省略.........
开发者ID:Niggu,项目名称:cloudrexx,代码行数:101,代码来源:Voting.class.php
示例3: showOverview
/**
* Show overview of all transactions.
*
* @access private
*/
private function showOverview()
{
global $objDatabase, $_ARRAYLANG, $_CONFIG;
$this->objTemplate->loadTemplateFile('module_checkout_overview.html');
//check the payment service provider configuration
$objSettingsGeneral = new SettingsGeneral($objDatabase);
if (!$objSettingsGeneral->getEpaymentStatus()) {
$this->arrStatusMessages['warning'][] = $_ARRAYLANG['TXT_CHECKOUT_EPAYMENT_DEACTIVATED'];
}
\JS::activate('cx');
$tableRow = '';
$pagingCount = $this->objTransaction->getRecordCount();
$pagingPosition = !empty($_GET['pos']) ? intval($_GET['pos']) : 0;
$this->objTemplate->setVariable(array('TXT_CHECKOUT_ALL_ENTRIES' => $_ARRAYLANG['TXT_CHECKOUT_ALL_ENTRIES'], 'TXT_CHECKOUT_ID' => $_ARRAYLANG['TXT_CHECKOUT_ID'], 'TXT_CHECKOUT_TIME' => $_ARRAYLANG['TXT_CHECKOUT_TIME'], 'TXT_CHECKOUT_STATUS' => $_ARRAYLANG['TXT_CHECKOUT_STATUS'], 'TXT_CHECKOUT_INVOICE_NUMBER' => $_ARRAYLANG['TXT_CHECKOUT_INVOICE_NUMBER'], 'TXT_CHECKOUT_INVOICE_AMOUNT' => $_ARRAYLANG['TXT_CHECKOUT_INVOICE_AMOUNT'], 'TXT_CHECKOUT_COMPANY' => $_ARRAYLANG['TXT_CHECKOUT_COMPANY'], 'TXT_CHECKOUT_NAME' => $_ARRAYLANG['TXT_CHECKOUT_NAME'], 'TXT_CHECKOUT_PHONE' => $_ARRAYLANG['TXT_CHECKOUT_PHONE'], 'TXT_CHECKOUT_EMAIL' => $_ARRAYLANG['TXT_CHECKOUT_EMAIL'], 'TXT_CHECKOUT_ACTIONS' => $_ARRAYLANG['TXT_CHECKOUT_ACTIONS'], 'TXT_CHECKOUT_DELETE' => $_ARRAYLANG['TXT_CHECKOUT_DELETE'], 'TXT_CHECKOUT_DETAIL' => $_ARRAYLANG['TXT_CHECKOUT_DETAIL']));
$arrTransactions = $this->objTransaction->get(array(), $pagingPosition, $_CONFIG['corePagingLimit']);
if (!empty($arrTransactions)) {
foreach ($arrTransactions as $arrTransaction) {
$arrTransaction['time'] = date('j.n.Y G:i:s', $arrTransaction['time']);
switch ($arrTransaction['status']) {
case self::WAITING:
$arrTransaction['status'] = $_ARRAYLANG['TXT_CHECKOUT_STATUS_WAITING'];
break;
case self::CONFIRMED:
$arrTransaction['status'] = $_ARRAYLANG['TXT_CHECKOUT_STATUS_CONFIRMED'];
break;
case self::CANCELLED:
$arrTransaction['status'] = $_ARRAYLANG['TXT_CHECKOUT_STATUS_CANCELLED'];
break;
}
$arrTransaction['invoice_currency'] = $this->arrCurrencies[$arrTransaction['invoice_currency']];
$arrTransaction['invoice_amount'] = number_format($arrTransaction['invoice_amount'], 2, '.', '\'') . ' ' . $arrTransaction['invoice_currency'];
$this->objTemplate->setVariable(array('CHECKOUT_ROW_CLASS' => $tableRow++ % 2 == 1 ? 'row1' : 'row2', 'CHECKOUT_ID' => $arrTransaction['id'], 'CHECKOUT_TIME' => contrexx_raw2xhtml($arrTransaction['time']), 'CHECKOUT_STATUS' => $arrTransaction['status'], 'CHECKOUT_INVOICE_NUMBER' => $arrTransaction['invoice_number'], 'CHECKOUT_INVOICE_AMOUNT' => contrexx_raw2xhtml($arrTransaction['invoice_amount']), 'CHECKOUT_COMPANY' => contrexx_raw2xhtml($arrTransaction['contact_company']), 'CHECKOUT_NAME' => contrexx_raw2xhtml($arrTransaction['contact_forename'] . ' ' . $arrTransaction['contact_surname']), 'CHECKOUT_PHONE' => contrexx_raw2xhtml($arrTransaction['contact_phone']), 'CHECKOUT_EMAIL' => contrexx_raw2xhtml($arrTransaction['contact_email'])));
$this->objTemplate->parse('transaction');
}
if ($pagingCount > $_CONFIG['corePagingLimit']) {
$this->objTemplate->setVariable('CHECKOUT_PAGING', getPaging($pagingCount, $pagingPosition, "&cmd=Checkout", $_ARRAYLANG['TXT_CHECKOUT_TRANSACTIONS']));
}
$this->objTemplate->parse('transactions');
} else {
if (empty($this->arrStatusMessages['warning'])) {
$this->arrStatusMessages['warning'][] = $_ARRAYLANG['TXT_CHECKOUT_NO_ENTRIES'];
}
$this->objTemplate->hideBlock('transactions');
}
}
开发者ID:Niggu,项目名称:cloudrexx,代码行数:50,代码来源:CheckoutManager.class.php
示例4: _overviewDir
/**
* Overview over a dir
*
* @global ADONewConnection
* @global array
* @global array
* @param int $highlight The entry which shall be shown green
* @access private
*/
function _overviewDir($highlight = null)
{
global $objDatabase, $_ARRAYLANG, $_CONFIG;
$this->_objTpl->loadTemplateFile('module_memberdir_overviewDir.html', true, true);
$this->pageTitle = $_ARRAYLANG['TXT_OVERVIEW'];
$dirid = isset($_GET['id']) ? $_GET['id'] : "";
if (isset($_POST['memberdir_update_sorting'])) {
if (!empty($_POST['userDefinedSortNumber']) && is_array($_POST['userDefinedSortNumber'])) {
foreach ($_POST['userDefinedSortNumber'] as $fieldId => $fieldSortNumber) {
$objDatabase->Execute("UPDATE " . DBPREFIX . "module_memberdir_values SET `0` = " . intval($fieldSortNumber) . " WHERE id = " . intval($fieldId));
}
}
}
$fieldnames = $this->getFieldData($dirid);
$this->_objTpl->setGlobalVariable(array("TXT_CONFIRM_DELETE_DATA" => $_ARRAYLANG['TXT_CONFIRM_DELETE_DATA'], 'TXT_MEMBERDIR_EXPORT_CONTACT_AS_VCARD' => $_ARRAYLANG['TXT_MEMBERDIR_EXPORT_CONTACT_AS_VCARD'], "TXT_ACTION_IS_IRREVERSIBLE" => $_ARRAYLANG['TXT_ACTION_IS_IRREVERSIBLE'], "TXT_DELETE_CATEGORY_ALL" => $_ARRAYLANG['TXT_DELETE_CATEGORY_ALL'], "TXT_MANAGE_ENTRIES" => $_ARRAYLANG['TXT_OVERVIEW'] . ": " . $this->directories[$dirid]['name'], "TXT_ID" => $_ARRAYLANG['TXT_MEMBERDIR_ID'], "TXT_ACTION" => $_ARRAYLANG['TXT_ACTION'], "TXT_SELECT_ALL" => $_ARRAYLANG['TXT_SELECT_ALL'], "TXT_DESELECT_ALL" => $_ARRAYLANG['TXT_DESELECT_ALL'], "TXT_SUBMIT_SELECT" => $_ARRAYLANG['TXT_SUBMIT_SELECT'], "TXT_SUBMIT_DELETE" => $_ARRAYLANG['TXT_SUBMIT_DELETE'], "TXT_SUBMIT_EXPORT" => $_ARRAYLANG['TXT_SUBMIT_EXPORT'], "TXT_LOCATION" => $_ARRAYLANG['TXT_LOCATION'], "TXT_FILTER" => $_ARRAYLANG['TXT_FILTER'], 'TXT_MEMBERDIR_SORTING' => $_ARRAYLANG['TXT_MEMBERDIR_SORTING'], "MEMBERDIR_CHARLIST" => $this->_getCharList("?cmd=MemberDir&act=showdir&id=" . $dirid), "DIRECTORY_LIST" => $this->dirList('id', $dirid, 100), "TXT_SEARCH" => $_ARRAYLANG['TXT_SEARCH'], "TXT_KEYWORD" => empty($_GET['keyword']) ? $_ARRAYLANG['TXT_KEYWORD'] : $_GET['keyword'], "DIRID" => $dirid));
for ($i = 1; $i <= 3; $i++) {
$index = $i;
while ($fieldnames[$index]['active'] == 0 && $index < 17) {
$index++;
}
$this->_objTpl->setVariable(array("TXT_FIELD_" . $i => $fieldnames[$index]['name']));
$indexed[$i] = $index;
}
$sort = empty($_GET['sort']) ? "" : contrexx_addslashes($_GET['sort']);
$_GET['search'] = empty($_GET['search']) ? "" : contrexx_addslashes($_GET['search']);
$keyword = empty($_GET['keyword']) ? "" : $_GET['keyword'];
if ($sort == "sc") {
/* Special Chars */
$query = "SELECT *\n FROM " . DBPREFIX . "module_memberdir_values\n WHERE `1` REGEXP '^[^a-zA-Z]'";
if (!empty($dirid)) {
$query .= " AND `dirid`= '{$dirid}'";
}
} elseif (preg_match("%^[a-z]\$%i", $sort)) {
/* Sort by char */
$query = "SELECT *\n FROM " . DBPREFIX . "module_memberdir_values\n WHERE `1` REGEXP '^" . $sort . "'";
if (!empty($dirid)) {
$query .= " AND `dirid`= '{$dirid}'";
}
} elseif ($_GET['search'] == "search") {
/* Search */
$query = "SELECT *\n FROM " . DBPREFIX . "module_memberdir_values\n WHERE (\n `1` LIKE '%{$keyword}%' OR\n `2` LIKE '%{$keyword}%' OR\n `3` LIKE '%{$keyword}%' OR\n `4` LIKE '%{$keyword}%' OR\n `5` LIKE '%{$keyword}%' OR\n `6` LIKE '%{$keyword}%' OR\n `7` LIKE '%{$keyword}%' OR\n `8` LIKE '%{$keyword}%' OR\n `9` LIKE '%{$keyword}%' OR\n `10` LIKE '%{$keyword}%' OR\n `11` LIKE '%{$keyword}%' OR\n `12` LIKE '%{$keyword}%' OR\n `13` LIKE '%{$keyword}%' OR\n `14` LIKE '%{$keyword}%' OR\n `15` LIKE '%{$keyword}%' OR\n `16` LIKE '%{$keyword}%' OR\n `17` LIKE '%{$keyword}%' OR\n `18` LIKE '%{$keyword}%'\n )";
if (!empty($dirid)) {
$query .= " AND `dirid`= '{$dirid}'";
}
} else {
/* All */
$query = "SELECT *\n FROM " . DBPREFIX . "module_memberdir_values\n WHERE";
if (!empty($dirid)) {
$query .= " `dirid` = '{$dirid}'";
}
$query .= " ORDER BY `0` ASC, id ASC";
}
$pos = empty($_GET['pos']) ? 0 : intval($_GET['pos']);
$objResult = $objDatabase->Execute($query);
if ($objResult) {
$count = $objResult->RecordCount();
$paging = getPaging($count, $pos, "&cmd=MemberDir&act=showdir&sort={$sort}&id={$dirid}&search={$_GET['search']}&keyword={$keyword}", "<b>" . $_ARRAYLANG['TXT_MEMBERDIR_ENTRIES'] . "</b>", true);
$this->_objTpl->setVariable("MEMBERDIR_PAGING", $paging);
}
$objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos);
if ($objResult) {
$rowid = 2;
while (!$objResult->EOF) {
$this->_objTpl->setVariable(array("MEMBERDIR_ROW" => $highlight == $objResult->fields['id'] ? "highlightedGreen" : "row" . $rowid, "MEMBERDIR_ID" => $objResult->fields['id'], "MEMBERDIR_USER_DEFINED_SORT_NUMBER" => $objResult->fields['0'], "MEMBERDIR_FIELD_1" => $objResult->fields[$indexed[1]], "MEMBERDIR_FIELD_2" => $objResult->fields[$indexed[2]], "MEMBERDIR_FIELD_3" => $objResult->fields[$indexed[3]]));
$rowid = $rowid == 2 ? 1 : 2;
$this->_objTpl->parse("memberdir_row");
$objResult->MoveNext();
}
} else {
$this->statusMessage = $_ARRAYLANG['TXT_DATABASE_READ_ERROR'];
echo $objDatabase->ErrorMsg();
echo $query;
}
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:83,代码来源:MemberDirManager.class.php
示例5: showOverview
//.........这里部分代码省略.........
$this->okMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_SUCCESSFULLY_EDITED'];
} else {
$this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_EDITED'];
}
}
if (isset($_GET['delete'])) {
\Permission::checkAccess(180, 'static');
$objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($_GET['delete']));
if ($objEvent->delete()) {
$this->okMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_SUCCESSFULLY_DELETED'];
} else {
$this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_DELETED'];
}
}
if (isset($_GET['confirm'])) {
\Permission::checkAccess(180, 'static');
$objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($_GET['confirm']));
if ($objEvent->confirm()) {
$this->okMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_SUCCESSFULLY_EDITED'];
} else {
$this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_EDITED'];
}
}
if (isset($_GET['export'])) {
$objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($_GET['export']));
$objEvent->export();
}
if (isset($_GET['multi'])) {
\Permission::checkAccess(180, 'static');
$status = true;
$messageVar = 'EDITED';
foreach ($_POST['selectedEventId'] as $key => $eventId) {
$objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($eventId));
switch ($_GET['multi']) {
case 'delete':
$status = $objEvent->delete() ? true : false;
$messageVar = 'DELETED';
break;
case 'activate':
$objEvent->status = 0;
$status = $objEvent->switchStatus() ? true : false;
$messageVar = 'EDITED';
break;
case 'deactivate':
$objEvent->status = 1;
$status = $objEvent->switchStatus() ? true : false;
$messageVar = 'EDITED';
break;
case 'export':
$objEvent->export();
break;
}
}
if ($status) {
$this->okMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_SUCCESSFULLY_' . $messageVar];
} else {
$this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_' . $messageVar];
}
}
$categoryId = intval($_REQUEST['categoryId']) != 0 ? $categoryId = intval($_REQUEST['categoryId']) : ($categoryId = null);
$searchTerm = isset($_REQUEST['term']) ? $_REQUEST['term'] : ($searchTerm = $_ARRAYLANG['TXT_CALENDAR_KEYWORD']);
$startPos = isset($_REQUEST['pos']) ? $_REQUEST['pos'] : 0;
$listType = 'all';
if ($_GET['list'] == 'actual' || !isset($_GET['list'])) {
$styleListActual = 'underline';
$styleListAll = '';
$startDate = new \DateTime();
$listType = 'upcoming';
} else {
$styleListActual = '';
$styleListAll = 'underline';
$startDate = null;
}
$this->_objTpl->setGlobalVariable(array('TXT_' . $this->moduleLangVar . '_OVERVIEW' => $this->_pageTitle, 'TXT_' . $this->moduleLangVar . '_UPCOMING_EVENTS' => $_ARRAYLANG['TXT_CALENDAR_UPCOMING_EVENTS'], 'TXT_' . $this->moduleLangVar . '_ALL_EVENTS' => $_ARRAYLANG['TXT_CALENDAR_ALL_EVENTS'], 'TXT_' . $this->moduleLangVar . '_FILTER' => $_ARRAYLANG['TXT_CALENDAR_FILTER'], 'TXT_' . $this->moduleLangVar . '_CONFIRMLIST' => $_ARRAYLANG['TXT_CALENDAR_CONFIRMLIST'], 'TXT_SEARCH' => $_CORELANG['TXT_USER_SEARCH'], 'TXT_' . $this->moduleLangVar . '_SEARCH' => $_CORELANG['TXT_USER_SEARCH'], 'TXT_' . $this->moduleLangVar . '_KEYWORD' => $searchTerm, 'TXT_' . $this->moduleLangVar . '_EVENTS' => $_ARRAYLANG['TXT_CALENDAR_EVENTS'], 'TXT_' . $this->moduleLangVar . '_STATUS' => $_ARRAYLANG['TXT_CALENDAR_STATUS'], 'TXT_' . $this->moduleLangVar . '_DATE' => $_ARRAYLANG['TXT_CALENDAR_DATE'], 'TXT_' . $this->moduleLangVar . '_TITLE' => $_ARRAYLANG['TXT_CALENDAR_TITLE'], 'TXT_' . $this->moduleLangVar . '_CATEGORY' => $_ARRAYLANG['TXT_CALENDAR_CATEGORY'], 'TXT_' . $this->moduleLangVar . '_SERIES' => $_ARRAYLANG['TXT_CALENDAR_SERIES'], 'TXT_' . $this->moduleLangVar . '_RE_DEREGISTRATIONS' => $_ARRAYLANG['TXT_CALENDAR_RE_DEGISTRATIONS'], 'TXT_' . $this->moduleLangVar . '_REGISTRATIONS' => $_ARRAYLANG['TXT_CALENDAR_REGISTRATIONS'], 'TXT_' . $this->moduleLangVar . '_WAITLIST' => $_ARRAYLANG['TXT_CALENDAR_WAITLIST'], 'TXT_' . $this->moduleLangVar . '_ACTION' => $_ARRAYLANG['TXT_CALENDAR_ACTION'], 'TXT_' . $this->moduleLangVar . '_EXPORT_ICAL_FORMAT' => $_ARRAYLANG['TXT_CALENDAR_EXPORT_ICAL_FORMAT'], 'TXT_' . $this->moduleLangVar . '_EDIT' => $_ARRAYLANG['TXT_CALENDAR_EDIT'], 'TXT_' . $this->moduleLangVar . '_COPY' => $_ARRAYLANG['TXT_CALENDAR_COPY'], 'TXT_' . $this->moduleLangVar . '_DELETE' => $_ARRAYLANG['TXT_CALENDAR_DELETE'], 'TXT_' . $this->moduleLangVar . '_LANGUAGES' => $_ARRAYLANG['TXT_CALENDAR_LANGUAGES'], 'TXT_SELECT_ALL' => $_ARRAYLANG['TXT_CALENDAR_MARK_ALL'], 'TXT_DESELECT_ALL' => $_ARRAYLANG['TXT_CALENDAR_REMOVE_CHOICE'], 'TXT_SUBMIT_SELECT' => $_ARRAYLANG['TXT_SUBMIT_SELECT'], 'TXT_SUBMIT_ACTIVATE' => $_ARRAYLANG['TXT_SUBMIT_ACTIVATE'], 'TXT_SUBMIT_DEACTIVATE' => $_ARRAYLANG['TXT_SUBMIT_DEACTIVATE'], 'TXT_SUBMIT_DELETE' => $_ARRAYLANG['TXT_SUBMIT_DELETE'], 'TXT_SUBMIT_EXPORT' => $_ARRAYLANG['TXT_SUBMIT_EXPORT'], 'TXT_' . $this->moduleLangVar . '_CONFIRM_DELETE_DATA' => $_ARRAYLANG['TXT_CALENDAR_CONFIRM_DELETE_DATA'], 'TXT_' . $this->moduleLangVar . '_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_CALENDAR_ACTION_IS_IRREVERSIBLE'], 'TXT_' . $this->moduleLangVar . '_MAKE_SELECTION' => $_ARRAYLANG['TXT_CALENDAR_MAKE_SELECTION'], 'TXT_' . $this->moduleLangVar . '_LIST_ACTUAL' => $_ARRAYLANG['TXT_CALENDAR_LIST_ACTUAL'], 'TXT_' . $this->moduleLangVar . '_LIST_ALL' => $_ARRAYLANG['TXT_CALENDAR_LIST_ALL'], $this->moduleLangVar . '_LINKSTYLE_LIST_ACTUAL' => $styleListActual, $this->moduleLangVar . '_LINKSTYLE_LIST_ALL' => $styleListAll));
$objCategoryManager = new \Cx\Modules\Calendar\Controller\CalendarCategoryManager(true);
$objCategoryManager->getCategoryList();
$this->_objTpl->setVariable(array('CALENDAR_CATEGORIES' => $objCategoryManager->getCategoryDropdown($categoryId, 1)));
$objConfirmEventManager = new \Cx\Modules\Calendar\Controller\CalendarEventManager(null, null, null, null, null, null, true, null, null, false, null);
$objConfirmEventManager->getEventList();
if (count($objConfirmEventManager->eventList) > 0) {
$objConfirmEventManager->showEventList($this->_objTpl, 'confirm');
} else {
$this->_objTpl->hideBlock('showConfirmList');
}
if ($this->arrSettings['rssFeedStatus'] == 1) {
$objFeedEventManager = new \Cx\Modules\Calendar\Controller\CalendarEventManager(time(), null, null, null, true);
$objFeed = new \Cx\Modules\Calendar\Controller\CalendarFeed($objFeedEventManager);
$objFeed->creatFeed();
}
$showSeries = $listType == 'upcoming';
$objEventManager = new \Cx\Modules\Calendar\Controller\CalendarEventManager($startDate, null, $categoryId, $searchTerm, $showSeries, null, null, $startPos, $this->arrSettings['numPaging'], 'ASC', true, null, $listType);
$objEventManager->getEventList();
if ($objEventManager->countEvents > $this->arrSettings['numPaging']) {
$pagingCategory = !empty($categoryId) ? '&categoryId=' . $categoryId : '';
$pagingTerm = !empty($searchTerm) ? '&term=' . $searchTerm : '';
$pagingList = !empty($_GET['list']) ? '&list=' . $_GET['list'] : '';
$this->_objTpl->setVariable(array($this->moduleLangVar . '_PAGING' => getPaging($objEventManager->countEvents, $startPos, "&cmd=" . $this->moduleName . $pagingCategory . $pagingTerm . $pagingList, "<b>" . $_ARRAYLANG['TXT_CALENDAR_EVENTS'] . "</b>", true, $this->arrSettings['numPaging'])));
}
$objEventManager->showEventList($this->_objTpl);
}
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:101,代码来源:CalendarManager.class.php
示例6: showCategoryOverview
/**
* Shows the Overview of categories
*
* @global ADONewConnection
* @global array
* @global array
* @param var $intParentId
*/
function showCategoryOverview($intParentId = 0)
{
global $objDatabase, $_ARRAYLANG, $_CONFIG, $_CORELANG;
$intParentId = intval($intParentId);
$this->_objTpl->setTemplate($this->pageContent, true, true);
// load source code if cmd value is integer
if ($this->_objTpl->placeholderExists('APPLICATION_DATA')) {
$page = new \Cx\Core\ContentManager\Model\Entity\Page();
$page->setVirtual(true);
$page->setType(\Cx\Core\ContentManager\Model\Entity\Page::TYPE_APPLICATION);
$page->setModule('Gallery');
// load source code
$applicationTemplate = \Cx\Core\Core\Controller\Cx::getContentTemplateOfPage($page);
\LinkGenerator::parseTemplate($applicationTemplate);
$this->_objTpl->addBlock('APPLICATION_DATA', 'application_data', $applicationTemplate);
}
$categoryProtected = $this->categoryIsProtected($intParentId);
if ($categoryProtected > 0) {
if (!\Permission::checkAccess($categoryProtected, 'dynamic', true)) {
$link = base64_encode($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']);
\Cx\Core\Csrf\Controller\Csrf::header("Location: " . CONTREXX_DIRECTORY_INDEX . "?section=Login&cmd=noaccess&redirect=" . $link);
exit;
}
}
// hide image detail block
// $this->_objTpl->hideBlock('galleryImage');
if ($this->arrSettings['header_type'] == 'hierarchy') {
$this->_objTpl->setVariable(array('GALLERY_CATEGORY_TREE' => $this->getCategoryTree(), 'TXT_GALLERY_CATEGORY_HINT' => $_ARRAYLANG['TXT_GALLERY_CATEGORY_HINT_HIERARCHY']));
} else {
$this->_objTpl->setVariable(array('GALLERY_CATEGORY_TREE' => $this->getSiblingList(), 'TXT_GALLERY_CATEGORY_HINT' => $_ARRAYLANG['TXT_GALLERY_CATEGORY_HINT_FLAT']));
}
$objResult = $objDatabase->Execute("SELECT id, catid, path FROM " . DBPREFIX . "module_gallery_pictures " . "ORDER BY catimg ASC, sorting ASC, id ASC");
$showImageSizeOverview = $this->arrSettings['show_image_size'] == 'on';
while (!$objResult->EOF) {
$arrImageSizes[$objResult->fields['catid']][$objResult->fields['id']] = $showImageSizeOverview ? round(filesize($this->strImagePath . $objResult->fields['path']) / 1024, 2) : '';
$arrstrImagePaths[$objResult->fields['catid']][$objResult->fields['id']] = $this->strThumbnailWebPath . $objResult->fields['path'];
$objResult->MoveNext();
}
if (isset($arrImageSizes) && isset($arrstrImagePaths)) {
foreach ($arrImageSizes as $keyCat => $valueCat) {
$arrCategorySizes[$keyCat] = 0;
foreach ($valueCat as $valueImageSize) {
$arrCategorySizes[$keyCat] = $arrCategorySizes[$keyCat] + $valueImageSize;
}
}
foreach ($arrstrImagePaths as $keyCat => $valueCat) {
$arrCategoryImages[$keyCat] = 0;
$arrCategoryImageCounter[$keyCat] = 0;
foreach ($valueCat as $valuestrImagePath) {
$arrCategoryImages[$keyCat] = $valuestrImagePath;
$arrCategoryImageCounter[$keyCat] = $arrCategoryImageCounter[$keyCat] + 1;
}
}
}
//$arrCategorySizes -> Sizes of all Categories
//$arrCategoryImages -> The First Picture of each category
//$arrCategoryImageCounter -> Counts all images in one group
//begin category-paging
$intPos = isset($_GET['pos']) ? intval($_GET['pos']) : 0;
$objResult = $objDatabase->Execute('SELECT count(id) AS countValue
FROM ' . DBPREFIX . 'module_gallery_categories
WHERE pid=' . $intParentId . ' AND
status="1"
');
$this->_objTpl->setVariable(array('GALLERY_CATEGORY_PAGING' => getPaging($objResult->fields['countValue'], $intPos, '§ion=Gallery&cid=' . $intParentId . $this->strCmd, '<b>' . $_ARRAYLANG['TXT_GALLERY'] . '</b>', false, intval($_CONFIG['corePagingLimit']))));
//end category-paging
$objResult = $objDatabase->SelectLimit('SELECT *
FROM ' . DBPREFIX . 'module_gallery_categories
WHERE pid=' . $intParentId . ' AND
status="1"
ORDER BY sorting ASC', intval($_CONFIG['corePagingLimit']), $intPos);
if ($objResult->RecordCount() == 0) {
// no categories in the database, hide the output
//$this->_objTpl->hideBlock('galleryCategoryList');
} else {
$i = 1;
while (!$objResult->EOF) {
$objSubResult = $objDatabase->Execute("SELECT name, value FROM " . DBPREFIX . "module_gallery_language " . "WHERE gallery_id=" . $objResult->fields['id'] . " AND " . "lang_id=" . intval($this->langId) . " ORDER BY name ASC");
unset($arrCategoryLang);
while (!$objSubResult->EOF) {
$arrCategoryLang[$objSubResult->fields['name']] = $objSubResult->fields['value'];
$objSubResult->MoveNext();
}
if (empty($arrCategoryImages[$objResult->fields['id']])) {
// no pictures in this gallery, show the empty-image
$strName = $arrCategoryLang['name'];
$strDesc = $arrCategoryLang['desc'];
$strImage = '<a href="' . CONTREXX_DIRECTORY_INDEX . '?section=Gallery&cid=' . $objResult->fields['id'] . $this->strCmd . '" target="_self">';
$strImage .= '<img border="0" alt="' . $arrCategoryLang['name'] . '" src="modules/Gallery/View/Media/no_images.gif" /></a>';
$strInfo = $_ARRAYLANG['TXT_IMAGE_COUNT'] . ': 0';
$strInfo .= $showImageSizeOverview ? '<br />' . $_CORELANG['TXT_SIZE'] . ': 0kB' : '';
} else {
//.........这里部分代码省略.........
开发者ID:Niggu,项目名称:cloudrexx,代码行数:101,代码来源:Gallery.class.php
示例7: getTitles
/**
* Gets the list with the headlines
* @global array
* @global ADONewConnection
* @global array
* @return string parsed content
*/
function getTitles()
{
global $_CONFIG, $objDatabase, $_ARRAYLANG;
$selectedId = null;
$paging = "";
$pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0;
if (!isset($_REQUEST['cmd'])) {
$_REQUEST['cmd'] = '';
}
$this->_objTpl->setTemplate($this->pageContent);
$this->_objTpl->setGlobalVariable('MODULE_INDEX', MODULE_INDEX);
$sortType = '';
if (!empty($_REQUEST['category'])) {
$selectedId = intval($_REQUEST['category']);
$query = "\n SELECT `sort_style`\n FROM `" . DBPREFIX . "module_docsys" . MODULE_INDEX . "_categories`\n WHERE `catid`={$selectedId}";
$objRS = $objDatabase->SelectLimit($query, 1);
if (!$objRS) {
die('database error. ' . $objDatabase->ErrorMsg());
}
$sortType = $objRS->fields['sort_style'];
}
$this->_objTpl->setVariable("DOCSYS_NO_CATEGORY", $_ARRAYLANG['TXT_CATEGORY']);
$this->_objTpl->setVariable("DOCSYS_CAT_MENU", $this->getCategoryMenu($this->langId, array($selectedId), $_REQUEST['cmd']));
$this->_objTpl->setVariable("TXT_PERFORM", $_ARRAYLANG['TXT_PERFORM']);
$count = $this->countOverviewEntries($selectedId);
$entries = $this->getOverviewTitles($pos, $selectedId, $sortType);
if ($count > intval($_CONFIG['corePagingLimit'])) {
$paging = getPaging($count, $pos, "§ion=DocSys" . MODULE_INDEX, $_ARRAYLANG['TXT_DOCUMENTS'], true);
}
$this->_objTpl->setVariable("DOCSYS_PAGING", $paging);
if ($count >= 1) {
$row = 1;
foreach ($entries as $entry) {
$cmd = (empty($_REQUEST['cmd']) ? '' : $_REQUEST['cmd'] . '_') . 'details';
$this->_objTpl->setVariable(array('DOCSYS_STYLE' => $row++ % 2 + 1, 'DOCSYS_LONG_DATE' => date($this->dateLongFormat, $entry['date']), 'DOCSYS_DATE' => date($this->dateFormat, $entry['date']), 'DOCSYS_LINK' => "<a href=\"" . CONTREXX_SCRIPT_PATH . "?section=DocSys" . MODULE_INDEX . "&cmd={$cmd}&id=" . $entry['id'] . "\" title=\"" . contrexx_raw2xhtml($entry['title']) . "\">" . contrexx_raw2xhtml($entry['title']) . "</a>", 'DOCSYS_CATEGORY' => contrexx_raw2xhtml(current($entry['categories'])), 'DOCSYS_AUTHOR' => contrexx_raw2xhtml($entry['author'])));
$this->_objTpl->parse("row");
}
if ($this->_objTpl->blockExists('table')) {
$this->_objTpl->parse("table");
}
if ($this->_objTpl->blockExists('nothing_found')) {
$this->_objTpl->hideBlock("nothing_found");
}
} else {
/*$this->_objTpl->setVariable(array(
'DOCSYS_STYLE' => 1,
'DOCSYS_DATE' => "",
'DOCSYS_LINK' => "",
'DOCSYS_CATEGORY' => $_ARRAYLANG['TXT_NO_DOCUMENTS_FOUND']
));
$this->_objTpl->parse("row");*/
$this->_objTpl->setVariable(array("TXT_NO_DOCUMENTS_FOUND" => $_ARRAYLANG['TXT_NO_DOCUMENTS_FOUND']));
if ($this->_objTpl->blockExists('nothing_found')) {
$this->_objTpl->parse("nothing_found");
}
if ($this->_objTpl->blockExists('table')) {
$this->_objTpl->hideBlock("table");
}
}
return $this->_objTpl->get();
}
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:68,代码来源:DocSys.class.php
示例8: userList
private function userList()
{
global $_ARRAYLANG, $_CORELANG, $_CONFIG;
// add this to a new section maybe named like "maintenance"
$this->removeUselessImages();
$arrSettings = \User_Setting::getSettings();
$templateFile = 'module_access_user_list';
if (!$arrSettings['use_usernames']['status']) {
$templateFile .= '_no_usernames';
}
$this->_objTpl->addBlockfile('ACCESS_USER_TEMPLATE', 'module_access_user_overview', $templateFile . '.html');
$this->_pageTitle = $_ARRAYLANG['TXT_ACCESS_USERS'];
$objFWUser = \FWUser::getFWUserObject();
$rowNr = 0;
$groupId = !empty($_REQUEST['groupId']) ? $_REQUEST['groupId'] : 0;
$accountType = !empty($_REQUEST['accountType']) ? intval($_REQUEST['accountType']) : 0;
$limitOffset = isset($_GET['pos']) ? intval($_GET['pos']) : 0;
$orderDirection = !empty($_GET['sort']) ? $_GET['sort'] : 'desc';
$orderBy = !empty($_GET['by']) ? $_GET['by'] : 'regdate';
$search = isset($_REQUEST['search']) && !empty($_REQUEST['search']) ? preg_split('#\\s+#', $_REQUEST['search']) : array();
$usernameFilter = isset($_REQUEST['username_filter']) && $_REQUEST['username_filter'] != '' && in_array(ord($_REQUEST['username_filter']), array_merge(array(48), range(65, 90))) ? $_REQUEST['username_filter'] : null;
$userStatusFilter = isset($_REQUEST['user_status_filter']) && $_REQUEST['user_status_filter'] != '' ? intval($_REQUEST['user_status_filter']) : null;
$userRoleFilter = isset($_REQUEST['user_role_filter']) && $_REQUEST['user_role_filter'] != '' ? intval($_REQUEST['user_role_filter']) : null;
$this->_objTpl->setVariable(array('TXT_ACCESS_CONFIRM_DELETE_USER' => $_ARRAYLANG['TXT_ACCESS_CONFIRM_DELETE_USER'], 'TXT_ACCESS_CONFIRM_USER_NOTIFY_ABOUT_ACCOUNT_STATUS_NAMED' => $_ARRAYLANG['TXT_ACCESS_CONFIRM_USER_NOTIFY_ABOUT_ACCOUNT_STATUS_NAMED'], 'TXT_ACCESS_OPERATION_IRREVERSIBLE' => $_ARRAYLANG['TXT_ACCESS_OPERATION_IRREVERSIBLE'], 'TXT_ACCESS_SEARCH' => $_ARRAYLANG['TXT_ACCESS_SEARCH'], 'TXT_ACCESS_USER_LIST' => $_ARRAYLANG['TXT_ACCESS_USER_LIST'], 'TXT_ACCESS_FILTER' => $_ARRAYLANG['TXT_ACCESS_FILTER'], 'ACCESS_GROUP_MENU' => $this->getGroupMenu($groupId, 'name="access_group_id" onchange="window.location.replace(\'' . \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Access') . '&act=user&groupId=\'+this.value+\'&sort=' . htmlspecialchars($orderDirection) . '&by=' . htmlspecialchars($orderBy) . '&accountType=' . $accountType . '\')"'), 'ACCESS_USER_ACCOUNT_MENU' => $this->getUserAccountMenu($accountType, 'name="access_user_account_type" onchange="window.location.replace(\'' . \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Access') . '&act=user&groupId=' . $groupId . '&sort=' . htmlspecialchars($orderDirection) . '&by=' . htmlspecialchars($orderBy) . '&accountType=\'+this.value)"'), 'ACCESS_USER_STATUS_MENU' => $this->getUserStatusMenu($userStatusFilter, 'name="user_status_filter" onchange="window.location.replace(\'' . \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Access') . '&act=user&groupId=' . $groupId . '&sort=' . htmlspecialchars($orderDirection) . '&by=' . htmlspecialchars($orderBy) . '&user_status_filter=\'+this.value+\'&user_role_filter=' . $userRoleFilter . '&accountType=' . $accountType . '\')"'), 'ACCESS_USER_ROLE_MENU' => $this->getUserRoleMenu($userRoleFilter, 'name="user_role_filter" onchange="window.location.replace(\'' . \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Access') . '&act=user&groupId=' . $groupId . '&sort=' . htmlspecialchars($orderDirection) . '&by=' . htmlspecialchars($orderBy) . '&user_status_filter=' . $userStatusFilter . '&user_role_filter=\'+this.value+\'&accountType=' . $accountType . '\')"'), 'ACCESS_GROUP_IP' => $groupId, 'ACCESS_ACCOUNT_TYPE' => $accountType, 'ACCESS_SEARCH_VALUE' => htmlentities(join(' ', $search), ENT_QUOTES, CONTREXX_CHARSET), 'ACCESS_SORT_DIRECTION' => $orderDirection, 'ACCESS_SORT_BY' => $orderBy, 'ACCESS_SEARCH_VALUE_ESCAPED' => urlencode(implode(' ', $search)), 'ACCESS_USER_USERNAME_FILTER_ESCAPED' => urlencode($usernameFilter), 'ACCESS_USER_STATUS_FILTER_ESCAPED' => urlencode($userStatusFilter), 'ACCESS_USER_ROLE_FILTER_ESCAPED' => urlencode($userRoleFilter)));
$cx = \Env::get('cx');
if ($cx->getLicense()->isInLegalComponents('Crm')) {
$this->_objTpl->touchBlock('access_crm_filter');
} else {
$this->_objTpl->hideBlock('access_crm_filter');
}
$this->parseLetterIndexList('index.php?cmd=Access&act=user&groupId=' . $groupId . '&user_status_filter=' . $userStatusFilter . '&user_role_filter=' . $userRoleFilter, 'username_filter', $usernameFilter);
$objGroup = $objFWUser->objGroup->getGroup($groupId);
$userCount = $objGroup->getUserCount();
$userFilter = array();
if ($groupId) {
$groupId = $groupId == 'groupless' ? 'groupless' : intval($groupId);
$userFilter['group_id'] = $groupId;
}
if ($accountType) {
$userFilter['crm'] = 1;
}
if ($usernameFilter !== null) {
$userFilter['username'] = array('REGEXP' => '^' . ($usernameFilter == '0' ? '[0-9]|-|_' : $usernameFilter));
}
if ($userStatusFilter !== null) {
$userFilter['active'] = $userStatusFilter;
}
if ($userRoleFilter !== null) {
$userFilter['is_admin'] = $userRoleFilter;
}
if ($orderBy == 'expiration') {
$arrOrder['special'] = 'field( tblU.`expiration`, 0' . ($orderDirection == 'desc' ? ', tblU.`expiration`' : null) . ')';
}
$arrOrder[$orderBy] = $orderDirection;
if ($userCount > 0 && ($objUser = $objFWUser->objUser->getUsers($userFilter, $search, $arrOrder, null, $_CONFIG['corePagingLimit'], $limitOffset)) && ($userCount = $objUser->getFilteredSearchUserCount())) {
if ($userCount > $_CONFIG['corePagingLimit']) {
$this->_objTpl->setVariable('ACCESS_USER_PAGING', getPaging($userCount, $limitOffset, "&cmd=Access&act=user&groupId=" . $groupId . "&sort=" . htmlspecialchars($orderDirection) . "&by=" . htmlspecialchars($orderBy) . "&search=" . urlencode(urlencode(implode(' ', $search))) . "&username_filter=" . $usernameFilter . "&user_status_filter=" . $userStatusFilter . "&user_role_filter=" . $userRoleFilter, "<b>" . $_ARRAYLANG['TXT_ACCESS_USER'] . "</b>"));
}
$this->_objTpl->setVariable(array('TXT_ACCESS_LANGUAGE' => $_ARRAYLANG['TXT_ACCESS_LANGUAGE'], 'TXT_ACCESS_ADMINISTRATOR' => $_ARRAYLANG['TXT_ACCESS_ADMINISTRATOR'], 'TXT_ACCESS_FUNCTIONS' => $_ARRAYLANG['TXT_ACCESS_FUNCTIONS'], 'TXT_ACCESS_CHANGE_SORT_DIRECTION' => $_ARRAYLANG['TXT_ACCESS_CHANGE_SORT_DIRECTION'], 'ACCESS_SORT_ID' => $orderBy == 'id' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_STATUS' => $orderBy == 'active' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_USERNAME' => $orderBy == 'username' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_COMPANY' => $orderBy == 'company' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_FIRSTNAME' => $orderBy == 'firstname' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_LASTNAME' => $orderBy == 'lastname' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_EMAIL' => $orderBy == 'email' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_REGDATE' => $orderBy == 'regdate' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_LAST_ACTIVITY' => $orderBy == 'last_activity' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_EXPIRATION' => $orderBy == 'expiration' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_ID' => $_ARRAYLANG['TXT_ACCESS_ID'] . ($orderBy == 'id' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_STATUS' => $_ARRAYLANG['TXT_ACCESS_STATUS'] . ($orderBy == 'active' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_USERNAME' => $_ARRAYLANG['TXT_ACCESS_USERNAME'] . ($orderBy == 'username' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_COMPANY' => $_CORELANG['TXT_ACCESS_COMPANY'] . ($orderBy == 'company' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_FIRSTNAME' => $_CORELANG['TXT_ACCESS_FIRSTNAME'] . ($orderBy == 'firstname' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_LASTNAME' => $_CORELANG['TXT_ACCESS_LASTNAME'] . ($orderBy == 'lastname' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_EMAIL' => $_ARRAYLANG['TXT_ACCESS_EMAIL'] . ($orderBy == 'email' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_REGISTERED_SINCE' => $_ARRAYLANG['TXT_ACCESS_REGISTERED_SINCE'] . ($orderBy == 'regdate' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_LAST_ACTIVITY' => $_ARRAYLANG['TXT_ACCESS_LAST_ACTIVITY'] . ($orderBy == 'last_activity' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_EXPIRATION' => $_ARRAYLANG['TXT_ACCESS_VALIDITY_EXPIRATION'] . ($orderBy == 'expiration' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_SEARCH_VALUE_ESCAPED' => urlencode(implode(' ', $search))));
$this->_objTpl->setGlobalVariable(array('TXT_ACCESS_MODIFY_USER_ACCOUNT' => $_ARRAYLANG['TXT_ACCESS_MODIFY_USER_ACCOUNT'], 'ACCESS_GROUP_ID' => $groupId, 'ACCESS_USER_USERNAME_FILTER' => $usernameFilter, 'ACCESS_USER_STATUS_FILTER' => $userStatusFilter, 'ACCESS_USER_ROLE_FILTER' => $userRoleFilter, 'ACCESS_SEARCH_VALUE' => contrexx_raw2xhtml(join(' ', $search))));
$this->_objTpl->setCurrentBlock('access_user_list');
while (!$objUser->EOF) {
$firstname = $objUser->getProfileAttribute('firstname');
$lastname = $objUser->getProfileAttribute('lastname');
$company = $objUser->getProfileAttribute('company');
$this->_objTpl->setVariable(array('ACCESS_ROW_CLASS_ID' => $rowNr % 2 ? 1 : 0, 'ACCESS_USER_ID' => $objUser->getId(), 'ACCESS_USER_STATUS_IMG' => $objUser->getActiveStatus() ? 'led_green.gif' : 'led_red.gif', 'ACCESS_USER_STATUS' => $objUser->getActiveStatus() ? $_ARRAYLANG['TXT_ACCESS_ACTIVE'] : $_ARRAYLANG['TXT_ACCESS_INACTIVE'], 'ACCESS_USER_USERNAME' => htmlentities($
|
请发表评论