当前位置: 首页>>代码示例>>PHP>>正文


PHP getPaging函数代码示例

本文整理汇总了PHP中getPaging函数的典型用法代码示例。如果您正苦于以下问题:PHP getPaging函数的具体用法?PHP getPaging怎么用?PHP getPaging使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getPaging函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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, "&section=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, "&section=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&amp;act=showdir&amp;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, "&amp;cmd=MemberDir&amp;act=showdir&amp;sort={$sort}&amp;id={$dirid}&amp;search={$_GET['search']}&amp;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) ? '&amp;categoryId=' . $categoryId : '';
         $pagingTerm = !empty($searchTerm) ? '&amp;term=' . $searchTerm : '';
         $pagingList = !empty($_GET['list']) ? '&amp;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, '&section=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&amp;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, "&section=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 . "&amp;cmd={$cmd}&amp;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') . '&amp;act=user&amp;groupId=\'+this.value+\'&amp;sort=' . htmlspecialchars($orderDirection) . '&amp;by=' . htmlspecialchars($orderBy) . '&amp;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') . '&amp;act=user&amp;groupId=' . $groupId . '&amp;sort=' . htmlspecialchars($orderDirection) . '&amp;by=' . htmlspecialchars($orderBy) . '&amp;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') . '&amp;act=user&amp;groupId=' . $groupId . '&amp;sort=' . htmlspecialchars($orderDirection) . '&amp;by=' . htmlspecialchars($orderBy) . '&amp;user_status_filter=\'+this.value+\'&amp;user_role_filter=' . $userRoleFilter . '&amp;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') . '&amp;act=user&amp;groupId=' . $groupId . '&amp;sort=' . htmlspecialchars($orderDirection) . '&amp;by=' . htmlspecialchars($orderBy) . '&amp;user_status_filter=' . $userStatusFilter . '&amp;user_role_filter=\'+this.value+\'&amp;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&amp;act=user&amp;groupId=' . $groupId . '&amp;user_status_filter=' . $userStatusFilter . '&amp;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' ? ' &uarr;' : ' &darr;' : ''), 'ACCESS_STATUS' => $_ARRAYLANG['TXT_ACCESS_STATUS'] . ($orderBy == 'active' ? $orderDirection == 'asc' ? ' &uarr;' : ' &darr;' : ''), 'ACCESS_USERNAME' => $_ARRAYLANG['TXT_ACCESS_USERNAME'] . ($orderBy == 'username' ? $orderDirection == 'asc' ? ' &uarr;' : ' &darr;' : ''), 'ACCESS_COMPANY' => $_CORELANG['TXT_ACCESS_COMPANY'] . ($orderBy == 'company' ? $orderDirection == 'asc' ? ' &uarr;' : ' &darr;' : ''), 'ACCESS_FIRSTNAME' => $_CORELANG['TXT_ACCESS_FIRSTNAME'] . ($orderBy == 'firstname' ? $orderDirection == 'asc' ? ' &uarr;' : ' &darr;' : ''), 'ACCESS_LASTNAME' => $_CORELANG['TXT_ACCESS_LASTNAME'] . ($orderBy == 'lastname' ? $orderDirection == 'asc' ? ' &uarr;' : ' &darr;' : ''), 'ACCESS_EMAIL' => $_ARRAYLANG['TXT_ACCESS_EMAIL'] . ($orderBy == 'email' ? $orderDirection == 'asc' ? ' &uarr;' : ' &darr;' : ''), 'ACCESS_REGISTERED_SINCE' => $_ARRAYLANG['TXT_ACCESS_REGISTERED_SINCE'] . ($orderBy == 'regdate' ? $orderDirection == 'asc' ? ' &uarr;' : ' &darr;' : ''), 'ACCESS_LAST_ACTIVITY' => $_ARRAYLANG['TXT_ACCESS_LAST_ACTIVITY'] . ($orderBy == 'last_activity' ? $orderDirection == 'asc' ? ' &uarr;' : ' &darr;' : ''), 'ACCESS_EXPIRATION' => $_ARRAYLANG['TXT_ACCESS_VALIDITY_EXPIRATION'] . ($orderBy == 'expiration' ? $orderDirection == 'asc' ? ' &uarr;' : ' &darr;' : ''), '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($objUser->getUsername(), ENT_QUOTES, CONTREXX_CHARSET), 'ACCESS_USER_COMPANY' => !empty($company) ? htmlentities($company, ENT_QUOTES, CONTREXX_CHARSET) : '&nbsp;', 'ACCESS_USER_FIRSTNAME' => !empty($firstname) ? htmlentities($firstname, ENT_QUOTES, CONTREXX_CHARSET) : '&nbsp;', 'ACCESS_USER_LASTNAME' => !empty($lastname) ? htmlentities($lastname, ENT_QUOTES, CONTREXX_CHARSET) : '&nbsp;', 'ACCESS_USER_EMAIL' => htmlentities($objUser->getEmail(), ENT_QUOTES, CONTREXX_CHARSET), 'ACCESS_SEND_EMAIL_TO_USER' => sprintf($_ARRAYLANG['TXT_ACCESS_SEND_EMAIL_TO_USER'], htmlentities($objUser->getUsername(), ENT_QUOTES, CONTREXX_CHARSET)), 'ACCESS_USER_ADMIN_IMG' => $objUser->getAdminStatus() ? 'admin.png' : 'no_admin.png', 'ACCESS_USER_ADMIN_TXT' => $objUser->getAdminStatus() ? $_ARRAYLANG['TXT_ACCESS_ADMINISTRATOR'] : $_ARRAYLANG['TXT_ACCESS_NO_ADMINISTRATOR'], 'ACCESS_DELETE_USER_ACCOUNT' => sprintf($_ARRAYLANG['TXT_ACCESS_DELETE_USER_ACCOUNT'], htmlentities($objUser->getUsername(), ENT_QUOTES, CONTREXX_CHARSET)), 'ACCESS_USER_REGDATE' => date(ASCMS_DATE_FORMAT_DATE, $objUser->getRegistrationDate()), 'ACCESS_USER_LAST_ACTIVITY' => $objUser->getLastActivityTime() ? date(ASCMS_DATE_FORMAT_DATE, $objUser->getLastActivityTime()) : '-', 'ACCESS_USER_EXPIRATION' => $objUser->getExpirationDate() ? date(ASCMS_DATE_FORMAT_DATE, $objUser->getExpirationDate()) : '-', 'ACCESS_USER_EXPIRATION_STYLE' => $objUser->getExpirationDate() && $objUser->getExpirationDate() < time() ? 'color:#f00; font-weight:bold;' : null, 'ACCESS_CHANGE_ACCOUNT_STATUS_MSG' => sprintf($objUser->getActiveStatus() ? $_ARRAYLANG['TXT_ACCESS_DEACTIVATE_USER'] : $_ARRAYLANG['TXT_ACCESS_ACTIVATE_USER'], htmlentities($objUser->getUsername(), ENT_QUOTES, CONTREXX_CHARSET))));
             $license = \Env::get('cx')->getLicense();
             if (($crmUserId = $objUser->getCrmUserId()) && $license->isInLegalComponents('Crm')) {
                 if ($this->_objTpl->blockExists('access_user_crm_account')) {
                     $this->_objTpl->setVariable(array('ACCESS_USER_CRM_ACCOUNT_ID' => $crmUserId, 'TXT_ACCESS_USER_CRM_ACCOUNT' => $_ARRAYLANG['TXT_ACCESS_USER_CRM_ACCOUNT']));
                     $this->_objTpl->parse('access_user_crm_account');
                 }
             }
             $rowNr++;
             $this->_objTpl->parseCurrentBlock();
             $objUser->next();
         }
         $this->_objTpl->parse('access_has_users');
         $this->_objTpl->hideBlock('access_no_user');
         $this->_objTpl->setVariable(array('TXT_ACCESS_CHECK_ALL' => $_ARRAYLANG['TXT_ACCESS_CHECK_ALL'], 'TXT_ACCESS_UNCHECK_ALL' => $_ARRAYLANG['TXT_ACCESS_UNCHECK_ALL'], 'TXT_ACCESS_SELECT_ACTION' => $_ARRAYLANG['TXT_ACCESS_SELECT_ACTION'], 'TXT_ACCESS_DELETE' => $_ARRAYLANG['TXT_ACCESS_DELETE'], 'ACCESS_CONFIRM_DELETE_USERS_TXT' => preg_replace('#\\n#', '\\n', addslashes($_ARRAYLANG['TXT_ACCESS_CONFIRM_DELETE_USERS'])), 'ACCESS_SEARCH_VALUE_ESCAPED' => urlencode(implode(' ', $search))));
         $this->_objTpl->parse('access_user_action_dropdown');
     } else {
         $groupName = $groupId == 'groupless' ? $_ARRAYLANG['TXT_ACCESS_GROUPLESS_USERS'] : htmlentities($objGroup->getName(), ENT_QUOTES, CONTREXX_CHARSET);
         $this->_objTpl->setVariable('ACCESS_STATUS_MSG', count($search) || $usernameFilter != '' ? $_ARRAYLANG['TXT_ACCESS_NO_USERS_FOUND'] : sprintf($_ARRAYLANG['TXT_ACCESS_NO_USER_IN_GROUP'], '&laquo;' . $groupName . '&raquo;'));
         $this->_objTpl->parse('access_no_user');
         $this->_objTpl->hideBlock('access_has_users');
         $this->_objTpl->hideBlock('access_user_action_dropdown');
     }
     $this->_objTpl->parse('module_access_user_overview');
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:90,代码来源:AccessManager.class.php

示例9: showSearch

 function showSearch()
 {
     global $_ARRAYLANG, $_CORELANG;
     $this->_objTpl->setTemplate($this->pageContent, true, true);
     //get searchform
     if ($this->_objTpl->blockExists($this->moduleNameLC . 'Searchform')) {
         $objSearch = new MediaDirectorySearch($this->moduleName);
         $objSearch->getSearchform($this->_objTpl);
     }
     $_GET['term'] = trim($_GET['term']);
     $cmd = isset($_GET['cmd']) ? contrexx_input2raw($_GET['cmd']) : '';
     $intLimitEnd = intval($this->arrSettings['settingsPagingNumEntries']);
     if (!empty($cmd)) {
         $objForms = new MediaDirectoryForm(null, $this->moduleName);
         foreach ($objForms->arrForms as $intFormId => $arrForm) {
             if (!empty($arrForm['formCmd']) && $arrForm['formCmd'] === $cmd && !empty($arrForm['formEntriesPerPage'])) {
                 $intLimitEnd = $arrForm['formEntriesPerPage'];
                 break;
             }
         }
     }
     $intLimitStart = isset($_GET['pos']) ? intval($_GET['pos']) : 0;
     if (!empty($_GET['term']) || $_GET['type'] == 'exp') {
         $objSearch = new MediaDirectorySearch($this->moduleName);
         $objSearch->searchEntries($_GET);
         $objEntries = new MediaDirectoryEntry($this->moduleName);
         if (!empty($objSearch->arrFoundIds)) {
             $intNumEntries = count($objSearch->arrFoundIds);
             for ($i = $intLimitStart; $i < $intLimitStart + $intLimitEnd; $i++) {
                 $intEntryId = isset($objSearch->arrFoundIds[$i]) ? $objSearch->arrFoundIds[$i] : 0;
                 if (intval($intEntryId) != 0) {
                     $objEntries->getEntries($intEntryId, null, null, null, null, null, 1, 0, 1, null, null);
                 }
             }
             $objEntries->listEntries($this->_objTpl, 2);
             $urlParams = $_GET;
             unset($urlParams['pos']);
             unset($urlParams['section']);
             if ($intNumEntries > $intLimitEnd) {
                 $strPaging = getPaging($intNumEntries, $intLimitStart, $urlParams, "<b>" . $_ARRAYLANG['TXT_MEDIADIR_ENTRIES'] . "</b>", true, $intLimitEnd);
                 $this->_objTpl->setGlobalVariable(array($this->moduleLangVar . '_PAGING' => $strPaging));
             }
         } else {
             $this->_objTpl->setVariable(array('TXT_' . $this->moduleLangVar . '_SEARCH_MESSAGE' => $_ARRAYLANG['TXT_MEDIADIR_NO_ENTRIES_FOUND']));
         }
     } else {
         $this->_objTpl->setVariable(array('TXT_' . $this->moduleLangVar . '_SEARCH_MESSAGE' => $_ARRAYLANG['TXT_MEDIADIR_NO_SEARCH_TERM']));
     }
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:49,代码来源:MediaDirectory.class.php

示例10: manageEntries


//.........这里部分代码省略.........
         } else {
             $this->strErrMessage = $_CORELANG['TXT_DATABASE_QUERY_ERROR'];
         }
     }
     $objSettings = new MediaDirectorySettings($this->moduleName);
     if ($this->_objTpl->blockExists('mediadirTableHeaderComments')) {
         if ($objSettings->arrSettings['settingsAllowComments']) {
             $this->_objTpl->touchBlock('mediadirTableHeaderComments');
         }
     }
     if ($this->_objTpl->blockExists('mediadirTableHeaderVotes')) {
         if ($objSettings->arrSettings['settingsAllowVotes']) {
             $this->_objTpl->touchBlock('mediadirTableHeaderVotes');
         }
     }
     switch ($_GET['act']) {
         case 'move_entry':
             $this->strErrMessage = "Diese Funktion ist zurzeit noch nicht implementiert.";
             break;
         case 'delete_entry':
             \Permission::checkAccess(MediaDirectoryAccessIDs::ModifyEntry, 'static');
             if (!isset($_GET['id'])) {
                 foreach ($_POST["entriesFormSelected"] as $intEntryId) {
                     $strStatus = $objEntries->deleteEntry(intval($intEntryId));
                 }
             } else {
                 $strStatus = $objEntries->deleteEntry(intval($_GET['id']));
             }
             if ($strStatus) {
                 $this->strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_DELETED'];
             } else {
                 $this->strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_DELETED'];
             }
             break;
         case 'restore_voting':
             \Permission::checkAccess(MediaDirectoryAccessIDs::ModifyEntry, 'static');
             $objVotes = new MediaDirectoryVoting($this->moduleName);
             if (!isset($_GET['id'])) {
                 foreach ($_POST["entriesFormSelected"] as $intEntryId) {
                     $strStatus = $objVotes->restoreVoting(intval($intEntryId));
                 }
             } else {
                 $strStatus = $objVotes->restoreVoting(intval($_GET['id']));
             }
             if ($strStatus) {
                 $this->strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_VOTING'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_DELETED'];
             } else {
                 $this->strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_VOTING'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_DELETED'];
             }
             break;
         case 'restore_comments':
             \Permission::checkAccess(MediaDirectoryAccessIDs::ModifyEntry, 'static');
             $objComments = new MediaDirectoryComment($this->moduleName);
             if (!isset($_GET['id'])) {
                 foreach ($_POST["entriesFormSelected"] as $intEntryId) {
                     $strStatus = $objComments->restoreComments(intval($intEntryId));
                 }
             } else {
                 $strStatus = $objComments->restoreComments(intval($_GET['id']));
             }
             if ($strStatus) {
                 $this->strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_COMMENTS'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_DELETED'];
             } else {
                 $this->strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_COMMENTS'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_DELETED'];
             }
             break;
             break;
         case 'confirm_entry':
             \Permission::checkAccess(MediaDirectoryAccessIDs::ModifyEntry, 'static');
             if (!isset($_GET['id'])) {
                 foreach ($_POST["entriesFormSelected"] as $intEntryId) {
                     $strStatus = $objEntries->confirmEntry(intval($intEntryId));
                 }
             } else {
                 $strStatus = $objEntries->confirmEntry(intval($_GET['id']));
             }
             if ($strStatus) {
                 $this->strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_CONFIRM'];
             } else {
                 $this->strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_CONFIRM'];
             }
             break;
     }
     $objEntries->getEntries(null, $intLevelId, $intCategoryId, $strTerm, null, null, null, null, 'n', null, null, $intFormId, null, $this->limit, $this->offset);
     $objEntries->listEntries($this->_objTpl, 1);
     // Paging
     $count = $objEntries->countEntries();
     $filter = (!empty($strTerm) ? '&term=' . $strTerm : '') . (!empty($intCategoryId) ? '&cat_id=' . $intCategoryId : '') . (!empty($intFormId) ? '&form_id=' . $intFormId : '') . (!empty($intLevelId) ? '&level_id=' . $intLevelId : '');
     $term = !empty($strTerm) ? '&term=' . $strTerm : '';
     $paging = getPaging($count, $this->offset, '&cmd=' . $this->moduleName . '&act=entries' . $filter, '', true);
     $this->_objTpl->setGlobalVariable($this->moduleLangVar . '_PAGING', $paging);
     if (!empty($strTerm)) {
         $this->_objTpl->setVariable($this->moduleLangVar . '_SEARCH_TERM_PARAMETER', '&term=' . $strTerm);
     }
     if (empty($objEntries->arrEntries)) {
         $this->_objTpl->hideBlock($this->moduleNameLC . 'EntriesSelectAction');
     } else {
         $this->_objTpl->touchBlock($this->moduleNameLC . 'EntriesSelectAction');
     }
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:101,代码来源:MediaDirectoryManager.class.php

示例11: parseDownloads

 private function parseDownloads($objCategory)
 {
     global $_CONFIG, $_ARRAYLANG;
     if (!$this->objTemplate->blockExists('downloads_file_list')) {
         return;
     }
     $limitOffset = isset($_GET['pos']) ? intval($_GET['pos']) : 0;
     $includeDownloadsOfSubcategories = false;
     // set downloads filter
     $filter = array('expiration' => array('=' => 0, '>' => time()));
     if ($objCategory->getId()) {
         $filter['category_id'] = $objCategory->getId();
         if (!empty($this->searchKeyword)) {
             $includeDownloadsOfSubcategories = true;
         }
     }
     $objDownload = new Download();
     $sortOrder = $this->downloadsSortingOptions[$this->arrConfig['downloads_sorting_order']];
     $objDownload->loadDownloads($filter, $this->searchKeyword, $sortOrder, null, $_CONFIG['corePagingLimit'], $limitOffset, $includeDownloadsOfSubcategories);
     $categoryId = $objCategory->getId();
     $allowdDeleteFiles = false;
     if (!$objCategory->EOF) {
         $allowdDeleteFiles = !$objCategory->getManageFilesAccessId() || \Permission::checkAccess($objCategory->getManageFilesAccessId(), 'dynamic', true) || $this->userId && $objCategory->getOwnerId() == $this->userId;
     } elseif (\Permission::hasAllAccess()) {
         $allowdDeleteFiles = true;
     }
     if ($objDownload->EOF) {
         $this->objTemplate->hideBlock('downloads_file_list');
     } else {
         $row = 1;
         while (!$objDownload->EOF) {
             // select category
             if ($objCategory->EOF) {
                 $arrAssociatedCategories = $objDownload->getAssociatedCategoryIds();
                 $categoryId = $arrAssociatedCategories[0];
             }
             // parse download info
             $this->parseDownloadAttributes($objDownload, $categoryId, $allowdDeleteFiles);
             $this->objTemplate->setVariable('DOWNLOADS_FILE_ROW_CLASS', 'row' . ($row++ % 2 + 1));
             $this->objTemplate->parse('downloads_file');
             $objDownload->next();
         }
         $downloadCount = $objDownload->getFilteredSearchDownloadCount();
         if ($downloadCount > $_CONFIG['corePagingLimit']) {
             if (\Env::get('cx')->getPage()->getModule() != 'Downloads') {
                 $this->objTemplate->setVariable('DOWNLOADS_FILE_PAGING', getPaging($downloadCount, $limitOffset, '', "<b>" . $_ARRAYLANG['TXT_DOWNLOADS_DOWNLOADS'] . "</b>"));
             } else {
                 $this->objTemplate->setVariable('DOWNLOADS_FILE_PAGING', getPaging($downloadCount, $limitOffset, '&' . substr($this->moduleParamsHtml, 1) . '&category=' . $objCategory->getId() . '&downloads_search_keyword=' . htmlspecialchars($this->searchKeyword), "<b>" . $_ARRAYLANG['TXT_DOWNLOADS_DOWNLOADS'] . "</b>"));
             }
         }
         $this->objTemplate->setVariable(array('TXT_DOWNLOADS_FILES' => $_ARRAYLANG['TXT_DOWNLOADS_FILES'], 'TXT_DOWNLOADS_DOWNLOAD' => $_ARRAYLANG['TXT_DOWNLOADS_DOWNLOAD'], 'TXT_DOWNLOADS_DOWNLOADS' => $_ARRAYLANG['TXT_DOWNLOADS_DOWNLOADS']));
         $this->objTemplate->parse('downloads_file_list');
     }
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:54,代码来源:Downloads.class.php

示例12: searchFeed

 /**
  * search feed with fulltext
  * @access   public
  * @return   string  $status
  * @global    ADONewConnection
  * @global    array
  */
 function searchFeed()
 {
     global $objDatabase, $_ARRAYLANG;
     $this->_objTpl->setTemplate($this->pageContent, true, true);
     //get position for paging
     if (!isset($_GET['pos'])) {
         $_GET['pos'] = '0';
     }
     $pos = intval($_GET['pos']);
     // TODO: Never used
     //        $searchTermOrg = contrexx_addslashes($_GET['term']);
     $searchTerm = contrexx_addslashes($_GET['term']);
     $searchTermGoogle = $searchTerm;
     $array = explode(' ', $searchTerm);
     $tmpTerm = '';
     for ($x = 0; $x < count($array); $x++) {
         $tmpTerm .= (empty($tmpTerm) ? '' : '%') . $array[$x];
     }
     //set tree
     $tree = "&nbsp;&raquo;&nbsp;<a href='" . CONTREXX_SCRIPT_PATH . "?section=Directory&amp;cmd=search'>" . $_ARRAYLANG['TXT_DIR_F_SEARCH'] . "</a>";
     //get search
     $this->getSearch();
     $searchTermExp = '';
     $objResult = $objDatabase->Execute("SELECT id, name, title FROM " . DBPREFIX . "module_directory_inputfields WHERE exp_search='1' ORDER BY sort");
     if ($objResult) {
         while (!$objResult->EOF) {
             if (!empty($_GET[$objResult->fields['name']]) && $_GET['check'] == 'exp') {
                 $query_search .= "AND " . $objResult->fields['name'] . " LIKE ('%" . contrexx_addslashes($_GET[$objResult->fields['name']]) . "%') ";
                 $searchTermGoogle .= "+" . contrexx_addslashes($_GET[$objResult->fields['name']]);
                 $searchTermExp .= "&amp;" . $objResult->fields['name'] . "=" . contrexx_addslashes($_GET[$objResult->fields['name']]);
             }
             $objResult->MoveNext();
         }
     }
     if ($_GET['cid'] != "" && $_GET['check'] == 'exp') {
         array_push($this->searchCategories, intval($_GET['cid']));
         $this->getCatIds(intval($_GET['cid']));
         if (!empty($this->searchCategories)) {
             foreach ($this->searchCategories as $catId) {
                 $categories .= "(rel_cat.cat_id='" . $catId . "' AND rel_cat.dir_id=files.id) OR ";
             }
         }
         $query_search .= " AND (" . $categories . "  (rel_cat.cat_id='" . intval($_GET['cid']) . "' AND rel_cat.dir_id=files.id))";
         $searchTermExp .= "&amp;cid=" . intval($_GET['cid']);
         $db .= DBPREFIX . "module_directory_rel_dir_cat AS rel_cat, ";
     }
     if ($_GET['lid'] != "" && $_GET['check'] == 'exp') {
         array_push($this->searchLevels, intval($_GET['lid']));
         $this->getLevelIds(intval($_GET['lid']));
         if (!empty($this->searchLevels)) {
             foreach ($this->searchLevels as $levelId) {
                 $levels .= "(rel_level.level_id='" . $levelId . "' AND rel_level.dir_id=files.id) OR ";
             }
         }
         $query_search .= " AND (" . $levels . "  (rel_level.level_id='" . intval($_GET['lid']) . "' AND rel_level.dir_id=files.id))";
         $searchTermExp .= "&amp;lid=" . intval($_GET['lid']);
         $db .= DBPREFIX . "module_directory_rel_dir_level AS rel_level, ";
     }
     if ($_GET['check'] == 'norm') {
         $query_search = "\n                OR files.date LIKE ('%{$searchTerm}%')\n                OR files.relatedlinks LIKE ('%{$searchTerm}%')\n                OR files.link LIKE ('%{$searchTerm}%')\n                OR files.platform LIKE ('%{$searchTerm}%')\n                OR files.language LIKE ('%{$searchTerm}%')\n                OR files.canton LIKE ('%{$searchTerm}%')\n                OR files.company_name LIKE ('%{$searchTerm}%')\n                OR files.street LIKE ('%{$searchTerm}%')\n                OR files.zip LIKE ('%{$searchTerm}%')\n                OR files.city LIKE ('%{$searchTerm}%')\n                OR files.phone LIKE ('%{$searchTerm}%')\n                OR files.contact LIKE ('%{$searchTerm}%')\n                OR files.information LIKE ('%{$searchTerm}%')\n                OR files.fax LIKE ('%{$searchTerm}%')\n                OR files.mobile LIKE ('%{$searchTerm}%')\n                OR files.mail LIKE ('%{$searchTerm}%')\n                OR files.homepage LIKE ('%{$searchTerm}%')\n                OR files.industry LIKE ('%{$searchTerm}%')\n                OR files.legalform LIKE ('%{$searchTerm}%')\n                OR files.employee LIKE ('%{$searchTerm}%')\n                OR files.foundation LIKE ('%{$searchTerm}%')\n                OR files.mwst LIKE ('%{$searchTerm}%')\n            ";
     }
     //internal search
     /*if ($searchTerm != "" && $_GET['check'] == 'norm') {*/
     //get feeds by searchterm
     $query = "\n                SELECT files.id, files.title, files.description, files.link,\n                 MATCH (files.description) AGAINST ('%{$searchTerm}%') AS score\n                  FROM " . $db . " " . DBPREFIX . "module_directory_dir AS files\n                 WHERE ((files.title LIKE ('%{$searchTerm}%') OR files.description LIKE ('%{$searchTerm}%') OR files.searchkeys LIKE ('%{$searchTerm}%'))\n                        {$query_search})\n                   AND files.status != 0\n                 GROUP BY files.id\n                 ORDER BY files.spezial DESC, score DESC\n            ";
     ////// paging start /////////
     $pagingLimit = intval($this->settings['pagingLimit']['value']);
     $objResult = $objDatabase->Execute($query);
     $count = $objResult->RecordCount();
     $pos = intval($_GET['pos']);
     // TODO: $term is not defined, possibly $searchTerm?
     // TODO: $check is not defined
     //            $paging = getPaging($count, $pos, "&amp;section=Directory&amp;cmd=search&amp;term=".$term."&amp;check=".$check.$searchTermExp, "<b>".$_ARRAYLANG['TXT_DIRECTORY_FEEDS']."</b>", true, $pagingLimit);
     $paging = getPaging($count, $pos, "&section=Directory&cmd=search&term=" . $searchTerm . $searchTermExp . "&check=" . $_GET['check'], "<b>" . $_ARRAYLANG['TXT_DIRECTORY_FEEDS'] . "</b>", true, $pagingLimit);
     ////// paging end /////////
     $objResult = $objDatabase->SelectLimit($query, $pagingLimit, $pos);
     //show Feeds
     if ($objResult) {
         $i = 0;
         while (!$objResult->EOF) {
             //get score
             // TODO: Never used
             //                    $score = $objResult->fields['score'];
             // TODO: Never used
             //                    $scorePercent = ($score >= 1 ? 100 : intval($score*100));
             //get votes
             $this->getVotes($objResult->fields['id']);
             //get voting
             $this->getVoting($objResult->fields['id']);
             //get content
             $this->getContent($objResult->fields['id'], intval($_GET['cid']), intval($_GET['lid']));
             //row class
             $this->_objTpl->setVariable('DIRECTORY_FEED_ROW', ++$i % 2 ? 'row1' : 'row2');
//.........这里部分代码省略.........
开发者ID:Niggu,项目名称:cloudrexx,代码行数:101,代码来源:Directory.class.php

示例13: showMedium

    function showMedium($blockFirst = false)
    {
        global $_ARRAYLANG, $_CONFIG, $_LANGID;
        $categoryId = isset($_REQUEST['cid']) ? intval($_REQUEST['cid']) == 0 ? false : intval($_REQUEST['cid']) : false;
        $mediumId = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
        if ($mediumId > 0) {
            $this->_updateViews($mediumId);
        }
        $this->_objTpl->setGlobalVariable(array('TXT_PODCAST_PLAY' => $_ARRAYLANG['TXT_PODCAST_PLAY'], 'TXT_PODCAST_MEDIA_VIEWS' => $_ARRAYLANG['TXT_PODCAST_MEDIA_VIEWS']));
        $maxSize = $this->_arrSettings['thumb_max_size'];
        $tmpOnload = $blockFirst ? 'try{tmp();}catch(e){}' : '';
        $embedCode = <<<EOF
<script type="text/javascript">
//<![CDATA[
    var thumbSizeMax = {$maxSize};
    var previewSizeMax = 180;

    tmp = window.onload;
    if(tmp == null){
        tmp = function(){};
    }
    window.onload = function(){
        try{
            elPodcastContainer = document.getElementById("podcast_container");
            elPodcastContainerLength = elPodcastContainer.childNodes.length;
            document.getElementById("podcast_container").innerHTML += '%s';
            for (childNr = elPodcastContainerLength - 1; childNr >= 0; childNr--) {
                elPodcastContainer.removeChild(elPodcastContainer.childNodes[childNr]);
            }

        }catch(e){}
        setSize(document.getElementById("podcast_preview"), previewSizeMax);
        mThumbnails = document.getElementsByName("podcast_thumbnails");
        for(i=0;i<mThumbnails.length;i++){
            setSize(mThumbnails[i], thumbSizeMax);
        }
        {$tmpOnload}
    }

//]]>
</script>
EOF;
        if (($arrMedium =& $this->_getMedium($mediumId, true)) !== false) {
            if ($this->_objTpl->blockExists('podcast_medium')) {
                $arrTemplate =& $this->_getTemplate($arrMedium['template_id']);
                $mediumCode = sprintf($embedCode, addcslashes($this->_getHtmlTag($arrMedium, $arrTemplate['template']), "\r\n'"));
                $this->_objTpl->setVariable(array('PODCAST_MEDIUM_ID' => $mediumId, 'PODCAST_MEDIUM_CATEGORY_ID' => $categoryId, 'PODCAST_MEDIUM_TITLE' => htmlentities($arrMedium['title'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIUM_AUTHOR' => empty($arrMedium['author']) ? '-' : htmlentities($arrMedium['author'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIUM_DESCRIPTION' => htmlentities($arrMedium['description'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIUM_CODE' => $mediumCode, 'PODCAST_MEDIUM_DATE' => date(ASCMS_DATE_FORMAT, $arrMedium['date_added']), 'PODCAST_MEDIUM_SHORT_DATE' => date(ASCMS_DATE_FORMAT_DATE, $arrMedium['date_added']), 'PODCAST_MEDIUM_THUMBNAIL' => htmlentities($arrMedium['thumbnail'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIUM_URL' => htmlentities($arrMedium['source'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIUM_PLAYLENGHT' => $this->_getPlaylengthFormatOfTimestamp($arrMedium['playlength']), 'PODCAST_MEDIUM_PLAYLENGTH' => $this->_getPlaylengthFormatOfTimestamp($arrMedium['playlength']), 'PODCAST_MEDIUM_VIEWS' => $this->_getViews($mediumId), 'PODCAST_MEDIUM_FILESIZE' => $this->_formatFileSize($arrMedium['size'])));
                $this->_objTpl->parse('podcast_medium');
            }
            if ($this->_objTpl->blockExists('podcast_no_medium')) {
                $this->_objTpl->hideBlock('podcast_no_medium');
            }
        } else {
            $podcastJavascript = sprintf($embedCode, '');
            if ($this->_objTpl->blockExists('podcast_no_medium')) {
                $this->_objTpl->touchBlock('podcast_no_medium');
            }
            if ($this->_objTpl->blockExists('podcast_medium')) {
                $this->_objTpl->hideBlock('podcast_medium');
            }
        }
        $menu = $this->_getCategoriesMenu($categoryId, 'id="podcast_category_menu"', true, true);
        if ($menu !== false) {
            $this->_objTpl->setVariable('PODCAST_CATEGORY_MENU', $menu . ' <input type="button" onclick="window.location.href=\'index.php?section=Podcast&amp;' . \Cx\Core\Csrf\Controller\Csrf::param() . '&amp;cid=\'+document.getElementById(\'podcast_category_menu\').value" value="' . $_ARRAYLANG['TXT_PODCAST_SHOW'] . '" />');
        }
        if (intval($categoryId) == 0) {
            $categories = array_keys($this->_getCategories(true, false, $_LANGID));
        } else {
            $categories = $categoryId;
        }
        if ($this->_objTpl->blockExists('podcast_media')) {
            $pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0;
            $arrMedia =& $this->_getMedia($categories, true, $_CONFIG['corePagingLimit'], $pos);
            if (count($arrMedia) > 0) {
                foreach ($arrMedia as $mediumId => $arrMedium) {
                    $this->_objTpl->setVariable(array('PODCAST_MEDIUM_ROW' => $i % 2 == 0 ? 'row1' : 'row2', 'PODCAST_MEDIA_ID' => $mediumId, 'PODCAST_MEDIA_CATEGORY_ID' => $categoryId, 'PODCAST_MEDIA_TITLE' => htmlentities($arrMedium['title'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIA_AUTHOR' => htmlentities($arrMedium['author'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIA_DESCRIPTION' => empty($arrMedium['description']) ? '-' : htmlentities($arrMedium['description'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIA_DATE' => date(ASCMS_DATE_FORMAT, $arrMedium['date_added']), 'PODCAST_MEDIA_SHORT_DATE' => date(ASCMS_DATE_FORMAT_DATE, $arrMedium['date_added']), 'PODCAST_MEDIA_URL' => htmlentities($arrMedium['source'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIA_THUMBNAIL' => htmlentities($arrMedium['thumbnail'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIA_VIEWS' => $this->_getViews($mediumId), 'PODCAST_MEDIA_PLAYLENGHT' => $this->_getPlaylengthFormatOfTimestamp($arrMedium['playlength']), 'PODCAST_MEDIA_PLAYLENGTH' => $this->_getPlaylengthFormatOfTimestamp($arrMedium['playlength']), 'PODCAST_MEDIA_SHORT_PLAYLENGHT' => $this->_getShortPlaylengthFormatOfTimestamp($arrMedium['playlength']), 'PODCAST_MEDIA_SHORT_PLAYLENGTH' => $this->_getShortPlaylengthFormatOfTimestamp($arrMedium['playlength'])));
                    $i++;
                    $this->_objTpl->parse('podcast_media');
                }
            }
            $mediaCount =& $this->_getMediaCount($categoryId, true);
            if ($mediaCount > $_CONFIG['corePagingLimit']) {
                $paging = getPaging($mediaCount, $pos, '&section=Podcast&cid=' . $categoryId, $_ARRAYLANG['TXT_PODCAST_MEDIA']);
                $this->_objTpl->setVariable('PODCAST_PAGING', $paging);
            }
        }
        $setSizeFunction = $this->_getSetSizeJS();
        $podcastJavascript .= <<<EOF
    <script type="text/javascript">
    //<![CDATA[
    if(typeof(setSize == 'undefined')){
        {$setSizeFunction}
    }
    //]]>
    </script>
EOF;
        $this->_objTpl->setVariable('PODCAST_JAVASCRIPT', $podcastJavascript);
    }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:98,代码来源:Podcast.class.php

示例14: _showDownloads

 /**
  * show protected link downloads
  *
  * @return void
  */
 function _showDownloads()
 {
     global $_ARRAYLANG, $objDatabase, $_CONFIG;
     JS::activate('jqueryui');
     //delete if $_GET['del'] is set
     $contactID = intval($_GET['del']);
     if (!empty($contactID)) {
         if ($objDatabase->Execute("DELETE FROM " . DBPREFIX . "module_immo_contact WHERE id = {$contactID}") !== false) {
             $this->_strOkMessage = $_ARRAYLANG['TXT_IMMO_SUCCESSFULLY_DELETED'];
             $this->_showStats();
             return true;
         }
     }
     $this->_pageTitle = $_ARRAYLANG['TXT_IMMO_DOWNLOADS'];
     $this->_objTpl->loadTemplateFile('module_immo_downloads.html');
     $immoID = !empty($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
     $_SESSION['immo']['startDate'] = !empty($_REQUEST['inputStartDate']) ? contrexx_addslashes($_REQUEST['inputStartDate']) : $_SESSION['immo']['startDate'];
     $_SESSION['immo']['endDate'] = !empty($_REQUEST['inputEndDate']) ? contrexx_addslashes($_REQUEST['inputEndDate']) : $_SESSION['immo']['endDate'];
     //paging data
     $limit = !empty($_REQUEST['limit']) ? intval($_REQUEST['limit']) : $_CONFIG['corePagingLimit'];
     $pos = !empty($_REQUEST['pos']) ? intval($_REQUEST['pos']) : 0;
     $field = !empty($_REQUEST['field']) ? contrexx_addslashes($_REQUEST['field']) : 'visits';
     $order = !empty($_REQUEST['order']) ? contrexx_addslashes($_REQUEST['order']) : 'asc';
     $hsearchField = !empty($_REQUEST['searchField']) ? $_REQUEST['searchField'] : '';
     $hsearch = !empty($_REQUEST['search']) ? contrexx_addslashes($_REQUEST['search']) : '';
     $this->_objTpl->setGlobalVariable(array('TXT_IMMO_EXPORT' => $_ARRAYLANG['TXT_IMMO_EXPORT'], 'TXT_IMMO_DOWNLOADS' => $_ARRAYLANG['TXT_IMMO_DOWNLOADS'], 'TXT_IMMO_OBJECT' => $_ARRAYLANG['TXT_IMMO_OBJECT'], 'TXT_IMMO_VISITS' => $_ARRAYLANG['TXT_IMMO_VISITS'], 'TXT_IMMO_HEADER' => $_ARRAYLANG['TXT_IMMO_HEADER'], 'TXT_IMMO_LOCATION' => $_ARRAYLANG['TXT_IMMO_LOCATION'], 'TXT_IMMO_SEARCH' => $_ARRAYLANG['TXT_IMMO_SEARCH'], 'TXT_IMMO_DOWNLOAD_SEARCH' => $_ARRAYLANG['TXT_IMMO_DOWNLOAD_SEARCH'], 'TXT_IMMO_SORT' => $_ARRAYLANG['TXT_IMMO_SORT'], 'TXT_IMMO_IMMO_ID' => $_ARRAYLANG['TXT_IMMO_IMMO_ID'], 'TXT_IMMO_EMAIL' => $_ARRAYLANG['TXT_IMMO_EMAIL'], 'TXT_IMMO_NAME' => $_ARRAYLANG['TXT_IMMO_NAME'], 'TXT_IMMO_FIRSTNAME' => $_ARRAYLANG['TXT_IMMO_FIRSTNAME'], 'TXT_IMMO_COMPANY' => $_ARRAYLANG['TXT_IMMO_COMPANY'], 'TXT_IMMO_STREET' => $_ARRAYLANG['TXT_IMMO_STREET'], 'TXT_IMMO_ZIP' => $_ARRAYLANG['TXT_IMMO_ZIP'], 'TXT_IMMO_LOCATION' => $_ARRAYLANG['TXT_IMMO_LOCATION'], 'TXT_IMMO_TELEPHONE' => $_ARRAYLANG['TXT_IMMO_TELEPHONE'], 'TXT_IMMO_TELEPHONE_OFFICE' => $_ARRAYLANG['TXT_IMMO_TELEPHONE_OFFICE'], 'TXT_IMMO_TELEPHONE_MOBILE' => $_ARRAYLANG['TXT_IMMO_TELEPHONE_MOBILE'], 'TXT_IMMO_PURCHASE' => $_ARRAYLANG['TXT_IMMO_PURCHASE'], 'TXT_IMMO_FUNDING' => $_ARRAYLANG['TXT_IMMO_FUNDING'], 'TXT_IMMO_COMMENT' => $_ARRAYLANG['TXT_IMMO_COMMENT'], 'TXT_IMMO_TIMESTAMP' => $_ARRAYLANG['TXT_IMMO_TIMESTAMP'], 'TXT_IMMO_EXPORT' => $_ARRAYLANG['TXT_IMMO_EXPORT'], 'TXT_IMMO_FUNCTIONS' => $_ARRAYLANG['TXT_IMMO_FUNCTIONS'], 'TXT_IMMO_SEPARATOR' => $_ARRAYLANG['TXT_IMMO_SEPARATOR'], 'TXT_IMMO_EDIT' => $_ARRAYLANG['TXT_IMMO_EDIT'], 'TXT_IMMO_DELETE' => $_ARRAYLANG['TXT_IMMO_DELETE'], 'TXT_IMMO_CONFIRM_DELETE_CONTACT' => $_ARRAYLANG['TXT_IMMO_CONFIRM_DELETE_CONTACT'], 'TXT_IMMO_CANNOT_UNDO_OPERATION' => $_ARRAYLANG['TXT_IMMO_CANNOT_UNDO_OPERATION'], 'TXT_IMMO_DETAILS' => $_ARRAYLANG['TXT_IMMO_DETAILS'], 'TXT_IMMO_TIMESPAN' => $_ARRAYLANG['TXT_IMMO_TIMESPAN'], 'TXT_IMMO_FROM' => $_ARRAYLANG['TXT_IMMO_FROM'], 'TXT_IMMO_TO' => $_ARRAYLANG['TXT_IMMO_TO'], 'TXT_IMMO_INTERESTS' => $_ARRAYLANG['TXT_IMMO_INTERESTS'], 'TXT_IMMO_DOWNLOAD_LIST' => $_ARRAYLANG['TXT_IMMO_DOWNLOAD_LIST'], 'TXT_IMMO_INTEREST_SEARCH' => $_ARRAYLANG['TXT_IMMO_INTEREST_SEARCH'], 'TXT_IMMO_SHOW_TIMESPAN_DETAILS' => $_ARRAYLANG['TXT_IMMO_SHOW_TIMESPAN_DETAILS'], 'TXT_IMMO_IGNORE_TIMESPAN' => $_ARRAYLANG['TXT_IMMO_IGNORE_TIMESPAN'], 'TXT_IMMO_REFRESH' => $_ARRAYLANG['TXT_IMMO_REFRESH'], 'CALENDAR_TODAY' => !empty($_SESSION['immo']['startDate']) ? $_SESSION['immo']['startDate'] : date('Y-m-d', strtotime('-1 month')), 'CALENDAR_NEXT_MONTH' => !empty($_SESSION['immo']['endDate']) ? $_SESSION['immo']['endDate'] : date('Y-m-d'), 'PATH_OFFSET' => ASCMS_PATH_OFFSET, 'IMMO_FORM_ACTION_ID' => $immoID, 'IMMO_ID' => $immoID, 'IMMO_PAGING_LIMIT' => $limit, 'IMMO_PAGING_POS' => $pos, 'IMMO_PAGING_FIELD' => $field, 'IMMO_HSEARCH_FIELD' => $hsearchField, 'IMMO_HSEARCH' => $hsearch));
     $rowclass = 2;
     //get contact and download stats
     $searchTerm = !empty($_REQUEST['search']) ? " LIKE '%" . contrexx_addslashes($_REQUEST['search']) . "%'" : ' TRUE';
     $searchField = !empty($_REQUEST['searchField']) && !empty($_REQUEST['search']) ? ' WHERE ' . contrexx_addslashes($_REQUEST['searchField']) : ' WHERE ';
     $query = "    SELECT     `contact`.`id` , `email` , `name` , `firstname` , `street` , `zip` , `location` ,\n                            `company` , `telephone` , `telephone_office` , `telephone_mobile` , `purchase` ,\n                            `funding` ,  `comment` , `contact`.`immo_id` , `timestamp`, content1.fieldvalue AS immo_header, content2.fieldvalue AS immo_address, content3.fieldvalue AS immo_location\n                    FROM `" . DBPREFIX . "module_immo_contact` AS contact\n                    LEFT JOIN `" . DBPREFIX . "module_immo_content` AS content1 ON content1.immo_id = contact.id\n                        AND content1.lang_id =1\n                        AND content1.field_id = (\n                            SELECT field_id\n                            FROM `" . DBPREFIX . "module_immo_fieldname` AS fname\n                            WHERE lower( name ) = '" . $this->_headline . "'\n                            AND fname.lang_id =1\n                        )\n                    LEFT JOIN `" . DBPREFIX . "module_immo_content` AS content2 ON content2.immo_id = contact.id\n                        AND content2.lang_id =1\n                        AND content2.field_id = (\n                            SELECT field_id\n                            FROM `" . DBPREFIX . "module_immo_fieldname` AS fname\n                            WHERE lower( name ) = 'adresse'\n                            AND fname.lang_id =1\n                        )\n                    LEFT JOIN `" . DBPREFIX . "module_immo_content` AS content3 ON content3.immo_id = contact.id\n                        AND content3.lang_id =1\n                        AND content3.field_id = (\n                            SELECT field_id\n                            FROM `" . DBPREFIX . "module_immo_fieldname` AS fname\n                            WHERE lower( name ) = 'ort'\n                            AND fname.lang_id =1\n                        )" . $searchField . " " . $searchTerm;
     if ($immoID > 0) {
         $query .= " AND contact.immo_id = {$immoID} ";
     }
     if (empty($_REQUEST['ignore_timespan']) && !empty($_SESSION['immo']['startDate'])) {
         $query .= " AND `timestamp` BETWEEN " . strtotime($_SESSION['immo']['startDate']) . " AND " . strtotime($_SESSION['immo']['endDate']) . " ORDER BY timestamp DESC";
     }
     if (($objRS = $objDatabase->Execute($query)) !== false) {
         $count = $objRS->RecordCount();
         $objRS = $objDatabase->SelectLimit($query, $limit, $pos);
         while (!$objRS->EOF) {
             $this->_objTpl->setVariable(array('IMMO_CONTACT_ID' => intval($objRS->fields['id']), 'IMMO_IMMO_ID' => htmlspecialchars($objRS->fields['immo_id']), 'IMMO_OBJECT_HEADER' => htmlspecialchars($objRS->fields['immo_header']), 'IMMO_OBJECT_ADDRESS' => htmlspecialchars($objRS->fields['immo_address']), 'IMMO_OBJECT_LOCATION' => htmlspecialchars($objRS->fields['immo_location']), 'IMMO_EMAIL' => htmlspecialchars($objRS->fields['email']), 'IMMO_NAME' => htmlspecialchars($objRS->fields['name']), 'IMMO_FIRSTNAME' => htmlspecialchars($objRS->fields['firstname']), 'IMMO_COMPANY' => htmlspecialchars($objRS->fields['company']), 'IMMO_STREET' => htmlspecialchars($objRS->fields['street']), 'IMMO_ZIP' => htmlspecialchars($objRS->fields['zip']), 'IMMO_LOCATION' => htmlspecialchars($objRS->fields['location']), 'IMMO_TELEPHONE' => htmlspecialchars($objRS->fields['telephone']), 'IMMO_TELEPHONE_OFFICE' => htmlspecialchars($objRS->fields['telephone_office']), 'IMMO_TELEPHONE_MOBILE' => htmlspecialchars($objRS->fields['telephone_mobile']), 'IMMO_PURCHASE' => htmlspecialchars($objRS->fields['purchase']), 'IMMO_FUNDING' => htmlspecialchars($objRS->fields['funding']), 'IMMO_COMMENT' => str_replace(array("\r\n", "\n"), '<br />', htmlspecialchars($objRS->fields['comment'])), 'IMMO_COMMENT_TEXT' => str_replace(array("\r\n", "\n"), '<br />', htmlspecialchars($objRS->fields['comment'])), 'IMMO_TIMESTAMP' => date(ASCMS_DATE_FORMAT, $objRS->fields['timestamp']), 'ROW_CLASS' => $rowclass++ % 2 == 0 ? 'row1' : 'row2'));
             $this->_objTpl->parse('downloads');
             $objRS->MoveNext();
         }
     }
     $this->_objTpl->setVariable(array('IMMO_STATS_DOWNLOADS_PAGING' => getPaging($count, $pos, '&amp;cmd=immo&amp;act=downloads&amp;limit=' . $limit, '', true)));
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:53,代码来源:admin.class.php

示例15: getFormEntries

 function getFormEntries($formId, &$arrCols, $pagingPos, &$paging, $limit = true)
 {
     global $objDatabase, $_CONFIG, $_ARRAYLANG;
     $arrEntries = array();
     $arrCols = array();
     $query = "SELECT `id`, `id_lang`, `time`, `host`, `lang`, `ipaddress`\n                      FROM " . DBPREFIX . "module_contact_form_data\n                      WHERE id_form = " . $formId . "\n                      ORDER BY `time` DESC";
     $objEntry = $objDatabase->Execute($query);
     $count = $objEntry->RecordCount();
     if ($limit && $count > intval($_CONFIG['corePagingLimit'])) {
         $paging = getPaging($count, $pagingPos, "&cmd=Contact&act=forms&tpl=entries&formId=" . $formId, $_ARRAYLANG['TXT_CONTACT_FORM_ENTRIES']);
         $objEntry = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pagingPos);
     }
     if ($objEntry !== false) {
         while (!$objEntry->EOF) {
             $arrData = array();
             $objResult = $objDatabase->SelectLimit("SELECT `id_field`, `formlabel`, `formvalue`\n                                                    FROM " . DBPREFIX . "module_contact_form_submit_data\n                                                    WHERE id_entry=" . $objEntry->fields['id'] . "\n                                                    ORDER BY id");
             while (!$objResult->EOF) {
                 $field_id = $objResult->fields['id_field'];
                 $arrData[$field_id] = $objResult->fields['formvalue'];
                 // TODO: What is this good for?
                 //                    if($field_id == 'unique_id') //skip unique id of each entry, we do not want to display this.
                 //                        continue;
                 if (!in_array($field_id, $arrCols)) {
                     array_push($arrCols, $field_id);
                 }
                 $objResult->MoveNext();
             }
             $arrEntries[$objEntry->fields['id']] = array('langId' => $objEntry->fields['id_lang'], 'time' => $objEntry->fields['time'], 'host' => $objEntry->fields['host'], 'lang' => $objEntry->fields['lang'], 'ipaddress' => $objEntry->fields['ipaddress'], 'data' => $arrData);
             $objEntry->MoveNext();
         }
     }
     return $arrEntries;
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:33,代码来源:ContactLib.class.php


注:本文中的getPaging函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。