本文整理汇总了PHP中Cx\Core\Csrf\Controller\Csrf::enhanceURI方法的典型用法代码示例。如果您正苦于以下问题:PHP Csrf::enhanceURI方法的具体用法?PHP Csrf::enhanceURI怎么用?PHP Csrf::enhanceURI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cx\Core\Csrf\Controller\Csrf
的用法示例。
在下文中一共展示了Csrf::enhanceURI方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showThread
//.........这里部分代码省略.........
if ($this->_arrSettings['wysiwyg_editor'] == 1) {
//IF WYSIWIG enabled..
$strMessageInputHTML = new \Cx\Core\Wysiwyg\Wysiwyg('message', $content, 'bbcode');
} else {
//plain textarea
$strMessageInputHTML = '<textarea style="width: 400px; height: 150px;" rows="5" cols="10" name="message">' . contrexx_raw2xhtml($content) . '</textarea>';
}
$this->_objTpl->setGlobalVariable(array('FORUM_JAVASCRIPT_GOTO' => $this->getJavascript('goto'), 'FORUM_JAVASCRIPT_DELETE' => $this->getJavascript('deletePost'), 'FORUM_JAVASCRIPT_SCROLLTO' => $this->getJavascript('scrollto'), 'FORUM_SCROLLPOS' => !empty($_REQUEST['scrollpos']) ? intval($_REQUEST['scrollpos']) : '0', 'FORUM_JAVASCRIPT_INSERT_TEXT' => $this->getJavascript('insertText', array($intCatId, $intThreadId, $firstPost)), 'FORUM_NAME' => $this->_shortenString($firstPost['subject'], $this->_maxStringlength), 'FORUM_TREE' => $this->_createNavTree($intCatId) . '<a title="' . $this->_arrTranslations[$intCatId][$this->_intLangId]['name'] . '" href="index.php?section=Forum&cmd=board&id=' . $intCatId . '">' . $this->_shortenString($this->_arrTranslations[$intCatId][$this->_intLangId]['name'], $this->_maxStringlength) . '</a> > ', 'FORUM_DROPDOWN' => $this->createForumDD('forum_quickaccess', $intCatId, 'onchange="gotoForum(this);"', ''), 'TXT_FORUM_COMMA_SEPARATED_KEYWORDS' => $_ARRAYLANG['TXT_FORUM_COMMA_SEPARATED_KEYWORDS'], 'TXT_FORUM_KEYWORDS' => $_ARRAYLANG['TXT_FORUM_KEYWORDS'], 'TXT_FORUM_FILE_ATTACHMENT' => $_ARRAYLANG['TXT_FORUM_FILE_ATTACHMENT'], 'TXT_FORUM_RATING' => $_ARRAYLANG['TXT_FORUM_RATING'], 'TXT_FORUM_ADD_POST' => $_ARRAYLANG['TXT_FORUM_ADD_POST'], 'TXT_FORUM_SUBJECT' => $_ARRAYLANG['TXT_FORUM_SUBJECT'], 'TXT_FORUM_MESSAGE' => $_ARRAYLANG['TXT_FORUM_MESSAGE'], 'TXT_FORUM_RESET' => $_ARRAYLANG['TXT_FORUM_RESET'], 'TXT_FORUM_CREATE_POST' => $_ARRAYLANG['TXT_FORUM_CREATE_POST'], 'TXT_FORUM_ICON' => $_ARRAYLANG['TXT_FORUM_ICON'], 'TXT_FORUM_QUOTE' => $_ARRAYLANG['TXT_FORUM_QUOTE'], 'TXT_FORUM_EDIT' => $_ARRAYLANG['TXT_FORUM_EDIT'], 'TXT_FORUM_DELETE' => $_ARRAYLANG['TXT_FORUM_DELETE'], 'TXT_FORUM_PREVIEW' => $_ARRAYLANG['TXT_FORUM_PREVIEW'], 'TXT_FORUM_UPDATE_POST' => $_ARRAYLANG['TXT_FORUM_UPDATE_POST'], 'TXT_FORUM_NOTIFY_NEW_POSTS' => $_ARRAYLANG['TXT_FORUM_NOTIFY_NEW_POSTS'], 'TXT_FORUM_QUICKACCESS' => $_ARRAYLANG['TXT_FORUM_QUICKACCESS'], 'TXT_FORUM_UPDATE_NOTIFICATION' => $_ARRAYLANG['TXT_FORUM_UPDATE_NOTIFICATION'], 'TXT_FORUM_THREAD_ACTION_DESC' => $_ARRAYLANG['TXT_FORUM_THREAD_ACTION_DESC'], 'TXT_FORUM_THREAD_ACTION_MOVE' => $_ARRAYLANG['TXT_FORUM_THREAD_ACTION_MOVE'], 'TXT_FORUM_THREAD_ACTION_CLOSE' => $_ARRAYLANG['TXT_FORUM_THREAD_ACTION_CLOSE_' . $firstPost['is_locked']], 'TXT_FORUM_THREAD_ACTION_STICKY' => $_ARRAYLANG['TXT_FORUM_THREAD_ACTION_STICKY_' . $firstPost['is_sticky']], 'TXT_FORUM_THREAD_ACTION_DELETE' => $_ARRAYLANG['TXT_FORUM_THREAD_ACTION_DELETE'], 'TXT_FORUM_CHOOSE_FILE' => $_ARRAYLANG['TXT_FORUM_CHOOSE_FILE'], 'FORUM_NOTIFICATION_CHECKBOX_CHECKED' => $this->_hasNotification($intThreadId) ? 'checked="checked"' : '', 'FORUM_SUBJECT' => stripslashes($subject), 'FORUM_KEYWORDS' => stripslashes($keywords), 'FORUM_ATTACHMENT_OLDNAME' => $attachment, 'FORUM_MESSAGE_INPUT' => $strMessageInputHTML, 'FORUM_CAPTCHA_CODE' => \Cx\Core_Modules\Captcha\Controller\Captcha::getInstance()->getCode(), 'FORUM_THREAD_ID' => $intThreadId, 'FORUM_CATEGORY_ID' => $intCatId, 'FORUM_POSTS_PAGING' => getPaging($this->_postCount, $pos, '§ion=Forum&cmd=thread&id=' . $intThreadId, $_ARRAYLANG['TXT_FORUM_OVERVIEW_POSTINGS'], true, $this->_arrSettings['posting_paging'])));
if ($objFWUser->objUser->login()) {
$this->_objTpl->hideBlock('captcha');
} else {
$this->_objTpl->touchBlock('captcha');
}
$this->_setIcons($this->_getIcons());
if (!$this->_checkAuth($intCatId, 'read')) {
$this->_objTpl->setVariable('TXT_FORUM_ERROR', '<br />' . $_ARRAYLANG['TXT_FORUM_NO_ACCESS']);
return false;
}
$intCounter = 0;
foreach ($arrPosts as $postId => $arrValues) {
$strRating = '<span id="forum_current_rating_' . $postId . '" class="rating_%s">%s</span>';
if ($arrValues['rating'] == 0) {
$class = 'none';
} elseif ($arrValues['rating'] > 0) {
$class = 'pos';
} else {
$class = 'neg';
}
$strRating = sprintf($strRating, $class, $arrValues['rating']);
$strUserProfileLink = $arrValues['user_id'] > 0 ? '<a title="' . $arrValues['user_name'] . '" href="index.php?section=Access&cmd=user&id=' . $arrValues['user_id'] . '">' . $arrValues['user_name'] . '</a>' : $this->_anonymousName;
$arrAttachment = $this->_getAttachment($arrValues['attachment']);
$this->_objTpl->setGlobalVariable(array('FORUM_POST_ROWCLASS' => $intCounter++ % 2 + 1));
$quoteLink = "id=" . $intThreadId . "&act=quote&postid=" . $postId;
$quoteLinkLoggedIn = "location.href='" . \Cx\Core\Csrf\Controller\Csrf::enhanceURI("index.php?section=Forum") . "&cmd=thread&" . htmlentities($quoteLink) . "';";
$quoteLinkNotLoggedIn = "location.href='" . \Cx\Core\Csrf\Controller\Csrf::enhanceURI("index.php?section=Login") . "&redirect=" . base64_encode("index.php?section=Forum&cmd=thread&" . $quoteLink) . "';";
$this->_objTpl->setVariable(array('FORUM_POST_DATE' => $arrValues['time_created'], 'FORUM_POST_LAST_EDITED' => $arrValues['time_edited'] != date(ASCMS_DATE_FORMAT, 0) ? $_ARRAYLANG['TXT_FORUM_LAST_EDITED'] . $arrValues['time_edited'] : '', 'FORUM_USER_ID' => $arrValues['user_id'], 'FORUM_USER_NAME' => $strUserProfileLink, 'FORUM_USER_IMAGE' => !empty($arrValues['user_image']) ? '<img border="0" width="60" height="60" src="' . $arrValues['user_image'] . '" title="' . $arrValues['user_name'] . '\'s avatar" alt="' . $arrValues['user_name'] . '\'s avatar" />' : '', 'FORUM_USER_GROUP' => '', 'FORUM_USER_RANK' => '', 'FORUM_USER_REGISTERED_SINCE' => '', 'FORUM_USER_POSTING_COUNT' => '', 'FORUM_USER_CONTACTS' => '', 'FORUM_POST_NUMBER' => '#' . $arrValues['post_number'], 'FORUM_POST_ICON' => $arrValues['post_icon'], 'FORUM_POST_SUBJECT' => $arrValues['subject'], 'FORUM_POST_MESSAGE' => $arrValues['content'], 'FORUM_POST_RATING' => $strRating, 'FORUM_POST_ATTACHMENT_LINK' => $arrAttachment['webpath'], 'FORUM_POST_ATTACHMENT_FILENAME' => $arrAttachment['name'], 'FORUM_POST_ATTACHMENT_ICON' => $arrAttachment['icon'], 'FORUM_POST_ATTACHMENT_FILESIZE' => $arrAttachment['size'], 'FORUM_QUOTE_ONCLICK' => $this->_checkAuth($intCatId, 'write') ? $quoteLinkLoggedIn : $quoteLinkNotLoggedIn));
if (!$objFWUser->objUser->login() && !$this->_checkAuth($intCatId, 'write')) {
$button = '<input type="button" value="' . $_ARRAYLANG['TXT_FORUM_CREATE_POST'] . '" onclick="location.href=\'' . \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?section=Login') . '&redirect=' . base64_encode($_SERVER['REQUEST_URI']) . '\';" />';
$this->_objTpl->setVariable(array('FORUM_POST_REPLY_REDIRECT' => $button));
}
$this->_objTpl->setVariable(array('FORUM_POST_ID' => $postId, 'FORUM_RATING_POST_ID' => $postId));
if ($firstPost['is_locked'] != 1 && ($this->_checkAuth($intCatId, 'edit') || $objFWUser->objUser->login() && $arrValues['user_id'] == $objFWUser->objUser->getId())) {
$this->_objTpl->touchBlock('postEdit');
} else {
$this->_objTpl->hideBlock('postEdit');
}
if ($firstPost['is_locked'] != 1 && ($this->_checkAuth($intCatId, 'write') || !$firstPost['is_locked'])) {
$this->_objTpl->touchBlock('postQuote');
} else {
$this->_objTpl->hideBlock('postQuote');
}
if ($this->_checkAuth($intCatId, 'delete') && $arrValues['post_number'] != 1) {
$this->_objTpl->setVariable(array('FORUM_POST_ID' => $postId));
$this->_objTpl->touchBlock('postDelete');
} else {
$this->_objTpl->hideBlock('postDelete');
}
if ($this->_objTpl->blockExists('rating')) {
if ($objFWUser->objUser->login() && !$this->_hasRated($postId)) {
$this->_objTpl->parse('rating');
} else {
$this->_objTpl->hideBlock('rating');
}
}
if ($this->_objTpl->blockExists('attachment')) {
if (!empty($arrValues['attachment'])) {
示例2: showGroupDetails
/**
* Show all banners of a group
*
* @global object $objDatabase
* @global array $_ARRAYLANG
* @param integer $intGid: The group with this id will be shown
*/
function showGroupDetails($intGid = 0)
{
global $objDatabase, $_ARRAYLANG;
switch ($_POST['frmShowBanner_MultiAction']) {
case 'delete':
if (isset($_POST['selectedBannerId'])) {
foreach ($_POST['selectedBannerId'] as $intBannerId) {
$this->deleteBanner($intBannerId);
}
}
break;
case 'activate':
if (isset($_POST['selectedBannerId'])) {
foreach ($_POST['selectedBannerId'] as $intBannerId) {
$this->changeBannerStatus($intBannerId, 1);
}
}
break;
case 'deactivate':
if (isset($_POST['selectedBannerId'])) {
foreach ($_POST['selectedBannerId'] as $intBannerId) {
$this->changeBannerStatus($intBannerId, 0);
}
}
break;
default:
//do nothing
}
if (!empty($_POST['saveDefault'])) {
$this->setDefaultBanner($intGid, $_POST['defaultBanner']);
}
$intGid = intval($intGid);
$objContentTree = new ContentTree();
$this->_objTpl->loadTemplateFile('module_banner_group_details.html', true, true);
$this->pageTitle = $_ARRAYLANG['TXT_BANNER_GROUP_DETAILS_TITLE'];
$this->_objTpl->setVariable(array('BANNER_GROUP_ID' => $intGid, 'TXT_BANNER_GROUP_DETAILS_STATUS' => $_ARRAYLANG['TXT_BANNER_ADD_STATUS'], 'TXT_BANNER_GROUP_DETAILS_STATUS_2' => $_ARRAYLANG['TXT_BANNER_ADD_STATUS'], 'TXT_BANNER_GROUP_DETAILS_DEFAULT' => $_ARRAYLANG['TXT_BANNER_GROUP_DETAILS_DEFAULT'], 'TXT_BANNER_GROUP_DETAILS_NAME' => $_ARRAYLANG['TXT_BANNER_ADD_NAME'], 'TXT_BANNER_GROUP_DETAILS_RELATION_CONTENT' => $_ARRAYLANG['TXT_BANNER_ADD_RELATION_CONTENT'], 'TXT_BANNER_GROUP_DETAILS_RELATION_NEWS' => $_ARRAYLANG['TXT_BANNER_ADD_RELATION_NEWS'], 'TXT_BANNER_GROUP_DETAILS_RELATION_TEASER' => $_ARRAYLANG['TXT_BANNER_ADD_RELATION_TEASER'], 'TXT_BANNER_GROUP_DETAILS_FUNCTIONS' => $_ARRAYLANG['TXT_BANNER_GROUP_DETAILS_FUNCTIONS'], 'TXT_BANNER_GROUP_DETAILS_DELETE' => $_ARRAYLANG['TXT_BANNER_GROUP_DETAILS_DELETE'], 'TXT_BANNER_GROUP_DETAILS_DELETE_JS' => $_ARRAYLANG['TXT_BANNER_GROUP_DETAILS_DELETE_JS'], 'TXT_BANNER_GROUP_DETAILS_DELETE_ALL_JS' => $_ARRAYLANG['TXT_BANNER_GROUP_DETAILS_DELETE_ALL_JS'], 'TXT_BANNER_GROUP_DETAILS_EDIT' => $_ARRAYLANG['TXT_BANNER_GROUP_DETAILS_EDIT'], 'TXT_BANNER_GROUP_DETAILS_SAVE' => $_ARRAYLANG['TXT_BANNER_ADD_RELATION_SAVE'], 'TXT_BANNER_GROUP_DETAILS_SELECT_ALL' => $_ARRAYLANG['TXT_BANNER_SELECT_ALL'], 'TXT_BANNER_GROUP_DETAILS_DESELECT_ALL' => $_ARRAYLANG['TXT_BANNER_DESELECT_ALL'], 'TXT_BANNER_GROUP_DETAILS_SUBMIT_SELECT' => $_ARRAYLANG['TXT_BANNER_SUBMIT_SELECT'], 'TXT_BANNER_GROUP_DETAILS_SUBMIT_EXPAND' => $_ARRAYLANG['TXT_BANNER_SUBMIT_EXPAND'], 'TXT_BANNER_GROUP_DETAILS_SUBMIT_COMPRESS' => $_ARRAYLANG['TXT_BANNER_SUBMIT_COMPRESS'], 'TXT_BANNER_GROUP_DETAILS_SUBMIT_DELETE' => $_ARRAYLANG['TXT_BANNER_SUBMIT_DELETE'], 'TXT_BANNER_GROUP_DETAILS_SUBMIT_ACTIVATE' => $_ARRAYLANG['TXT_BANNER_SUBMIT_ACTIVATE'], 'TXT_BANNER_GROUP_DETAILS_SUBMIT_DEACTIVATE' => $_ARRAYLANG['TXT_BANNER_SUBMIT_DEACTIVATE']));
$objResult = $objDatabase->Execute('SELECT id,
name
FROM ' . DBPREFIX . 'module_banner_groups
ORDER BY id ASC
');
if ($objResult->RecordCount() > 0) {
$strDropDown = '<select name="ddGroup" onChange="window.location=this.options[this.selectedIndex].value">';
while (!$objResult->EOF) {
$strDropDown .= '<option value="' . \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=banner') . '&act=group_details&id=' . $objResult->fields['id'] . '"' . ($objResult->fields['id'] == $intGid ? ' selected' : '') . '>' . $objResult->fields['name'] . '</option>';
$objResult->MoveNext();
}
$strDropDown .= '</select>';
}
$this->_objTpl->setVariable('BANNER_GROUP_DROPDOWN', $strDropDown);
//create news-cat-array
$objResult = $objDatabase->Execute('SELECT catid,
name
FROM ' . DBPREFIX . 'module_news_categories
ORDER BY name ASC
');
if ($objResult->RecordCount() > 0) {
while (!$objResult->EOF) {
$arrNewsCategories[$objResult->fields['catid']] = $objResult->fields['name'];
$objResult->MoveNext();
}
}
//create teaser-cat-array ($arrTeaserCategories)
$objResult = $objDatabase->Execute('SELECT id,
name
FROM ' . DBPREFIX . 'module_news_teaser_frame
ORDER BY name ASC
');
if ($objResult->RecordCount() > 0) {
while (!$objResult->EOF) {
$arrTeaserCategories[$objResult->fields['id']] = $objResult->fields['name'];
$objResult->MoveNext();
}
}
$objResult = $objDatabase->Execute('SELECT id,
name,
banner_code,
status,
is_default
FROM ' . DBPREFIX . 'module_banner_system
WHERE parent_id=' . $intGid . '
ORDER BY is_default DESC,
name ASC
');
$i = 0;
if ($objResult->RecordCount() > 0) {
while (!$objResult->EOF) {
$objSubResult = $objDatabase->Execute(' SELECT page_id,
type
FROM ' . DBPREFIX . 'module_banner_relations
WHERE banner_id=' . $objResult->fields['id'] . '
');
$strRelationsContent = '';
//.........这里部分代码省略.........
示例3: getJavaScriptCode
private function getJavaScriptCode($objCategory)
{
global $_ARRAYLANG;
$fileDeleteTxt = preg_replace('#\\n#', '\\n', addslashes($_ARRAYLANG['TXT_DOWNLOADS_CONFIRM_DELETE_DOWNLOAD']));
$fileDeleteLink = \Cx\Core\Csrf\Controller\Csrf::enhanceURI(CONTREXX_SCRIPT_PATH . $this->moduleParamsJs) . '&category=' . $objCategory->getId() . '&delete_file=';
$categoryDeleteTxt = preg_replace('#\\n#', '\\n', addslashes($_ARRAYLANG['TXT_DOWNLOADS_CONFIRM_DELETE_CATEGORY']));
$categoryDeleteLink = \Cx\Core\Csrf\Controller\Csrf::enhanceURI(CONTREXX_SCRIPT_PATH . $this->moduleParamsJs) . '&category=' . $objCategory->getId() . '&delete_category=';
$javascript = <<<JS_CODE
<script type="text/javascript">
// <![CDATA[
function downloadsDeleteFile(id,name)
{
msg = '{$fileDeleteTxt}'
if (confirm(msg.replace('%s',name))) {
window.location.href='{$fileDeleteLink}'+id;
}
}
function downloadsDeleteCategory(id,name)
{
msg = '{$categoryDeleteTxt}'
if (confirm(msg.replace('%s',name))) {
window.location.href='{$categoryDeleteLink}'+id;
}
}
// ]]>
</script>
JS_CODE;
return $javascript;
}
示例4: _setNavigation
/**
* Set the navigation with the media type drop-down menu in the file browser
* @access private
* @see FileBrowser::_getMediaTypeMenu, _objTpl, _mediaType, _arrDirectories
*/
function _setNavigation()
{
global $_ARRAYLANG;
$ckEditorFuncNum = isset($_GET['CKEditorFuncNum']) ? '&CKEditorFuncNum=' . contrexx_raw2xhtml($_GET['CKEditorFuncNum']) : '';
$ckEditor = isset($_GET['CKEditor']) ? '&CKEditor=' . contrexx_raw2xhtml($_GET['CKEditor']) : '';
$this->_objTpl->addBlockfile('FILEBROWSER_NAVIGATION', 'fileBrowser_navigation', 'module_fileBrowser_navigation.html');
$this->_objTpl->setVariable(array('FILEBROWSER_MEDIA_TYPE_MENU' => $this->_getMediaTypeMenu('fileBrowserType', $this->_mediaType, 'onchange="window.location.replace(\'' . \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=FileBrowser') . '&standalone=true&langId=' . $this->_frontendLanguageId . '&type=\'+this.value+\'' . $ckEditorFuncNum . '\')"'), 'TXT_FILEBROWSER_PREVIEW' => $_ARRAYLANG['TXT_FILEBROWSER_PREVIEW']));
if ($this->_mediaType != 'webpages') {
// only show directories if the files should be displayed
if (count($this->_arrDirectories) > 0) {
foreach ($this->_arrDirectories as $arrDirectory) {
$this->_objTpl->setVariable(array('FILEBROWSER_FILE_PATH' => "index.php?cmd=FileBrowser&standalone=true&langId={$this->_frontendLanguageId}&type={$this->_mediaType}&path={$arrDirectory['path']}" . $ckEditor . $ckEditorFuncNum, 'FILEBROWSER_FILE_NAME' => $arrDirectory['name'], 'FILEBROWSER_FILE_ICON' => $arrDirectory['icon']));
$this->_objTpl->parse('navigation_directories');
}
}
}
$this->_objTpl->parse('fileBrowser_navigation');
}
示例5: 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($objUser->getUsername(), ENT_QUOTES, CONTREXX_CHARSET), 'ACCESS_USER_COMPANY' => !empty($company) ? htmlentities($company, ENT_QUOTES, CONTREXX_CHARSET) : ' ', 'ACCESS_USER_FIRSTNAME' => !empty($firstname) ? htmlentities($firstname, ENT_QUOTES, CONTREXX_CHARSET) : ' ', 'ACCESS_USER_LASTNAME' => !empty($lastname) ? htmlentities($lastname, ENT_QUOTES, CONTREXX_CHARSET) : ' ', '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'], '«' . $groupName . '»'));
$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');
}
示例6: taskTypesoverview
/**
* task type overview
*
* @global object $objDatabase
* @global array $_ARRAYLANG
* @return true
*/
public function taskTypesoverview()
{
global $objDatabase, $_ARRAYLANG;
//For task type Upload
$options = array('id' => 'taskUploader', 'style' => 'display:none;', 'upload-limit' => 1);
$uploaderCodeTaskType = $this->initUploader('taskUploadFinished', 'taskCallbackJs', '', $_ARRAYLANG['TXT_BROWSE'], $options);
$redirectUrl = \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Crm&act=getImportFilename');
$this->_objTpl->setVariable(array('COMBO_UPLOADER_CODE_TASK_TYPE' => $uploaderCodeTaskType, 'REDIRECT_URL' => $redirectUrl));
$fn = isset($_REQUEST['fn']) ? $_REQUEST['fn'] : '';
if (!empty($fn)) {
switch ($fn) {
case 'editTaskType':
$this->editTaskType();
break;
}
return;
}
$objTpl = $this->_objTpl;
$objTpl->addBlockfile('CRM_SETTINGS_FILE', 'settings_block', 'module_' . $this->moduleNameLC . '_settings_task_types.html');
$this->_pageTitle = $_ARRAYLANG['TXT_CRM_SETTINGS'];
$objTpl->setGlobalVariable(array('MODULE_NAME' => $this->moduleName, 'TXT_CRM_IMAGE_EDIT' => $_ARRAYLANG['TXT_CRM_IMAGE_EDIT'], 'TXT_CRM_IMAGE_DELETE' => $_ARRAYLANG['TXT_CRM_IMAGE_DELETE']));
\JS::activate("jquery");
$msg = base64_decode($_REQUEST['msg']);
switch ($msg) {
case 'taskUpdated':
$_SESSION['strOkMessage'] = $_ARRAYLANG['TXT_CRM_TASK_TYPE_UPDATED_SUCCESSFULLY'];
break;
default:
break;
}
$action = isset($_REQUEST['actionType']) ? $_REQUEST['actionType'] : '';
$tasktypeIds = isset($_REQUEST['taskTypeId']) ? array_map('intval', $_REQUEST['taskTypeId']) : 0;
$tasktypeSorting = isset($_REQUEST['sorting']) ? array_map('intval', $_REQUEST['sorting']) : 0;
$ajax = isset($_REQUEST['ajax']);
switch ($action) {
case 'changestatus':
$this->activateTaskType((int) $_GET['taskTypeId']);
if ($ajax) {
exit;
}
case 'activate':
$this->activateTaskTypes($tasktypeIds);
break;
case 'deactivate':
$this->activateTaskTypes($tasktypeIds, true);
break;
case 'delete':
$this->deleteTaskTypes($tasktypeIds);
break;
case 'deletecatalog':
$this->deleteTaskType((int) $_GET['taskTypeId']);
if ($ajax) {
exit;
}
break;
default:
break;
}
if (!empty($action)) {
$this->saveSortingTaskType($tasktypeSorting);
if ($action == 'savesorting' || $action == 'Save') {
$_SESSION['strOkMessage'] = $_ARRAYLANG['TXT_CRM_PROJECTSTATUS_SORTING_COMPLETE'];
}
}
if ($_POST['saveTaskType']) {
$this->saveTaskTypes();
$_SESSION['strOkMessage'] = $_ARRAYLANG['TXT_CRM_TASK_TYPE_ADDED_SUCCESSFULLY'];
}
$this->getModifyTaskTypes();
$this->showTaskTypes();
$objTpl->setVariable(array('TXT_CRM_ICON' => $_ARRAYLANG['TXT_CRM_ICON'], 'TXT_CRM_ICON_PATH' => \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteImagesCrmWebPath() . '/', 'TXT_CRM_TASK_TYPES' => $_ARRAYLANG['TXT_CRM_TASK_TYPES'], 'TXT_CRM_ADD_TASK_TYPE' => $_ARRAYLANG['TXT_CRM_ADD_TASK_TYPE'], 'TXT_CRM_TASK_TYPE_STATUS' => $_ARRAYLANG['TXT_CRM_TASK_TYPE_STATUS'], 'TXT_CRM_FUNCTIONS' => $_ARRAYLANG['TXT_CRM_FUNCTIONS'], 'TXT_CRM_NO_TASKTYPES' => $_ARRAYLANG['TXT_CRM_NO_TASKTYPES'], 'TXT_CRM_SAVE' => $_ARRAYLANG['TXT_CRM_SAVE'], 'TXT_CRM_SELECT_ALL' => $_ARRAYLANG['TXT_CRM_SELECT_ALL'], 'TXT_CRM_DESELECT_ALL' => $_ARRAYLANG['TXT_CRM_REMOVE_SELECTION'], 'TXT_CRM_SELECT_ACTION' => $_ARRAYLANG['TXT_CRM_SELECT_ACTION'], 'TXT_CRM_DELETE_SELECTED' => $_ARRAYLANG['TXT_CRM_DELETE_SELECTED'], 'TXT_CRM_ACTIVATE_SELECTED' => $_ARRAYLANG['TXT_CRM_ACTIVATE_SELECTED'], 'TXT_CRM_DEACTIVATE_SELECTED' => $_ARRAYLANG['TXT_CRM_DEACTIVATE_SELECTED'], 'TXT_CRM_SAVE_SORTING' => $_ARRAYLANG['TXT_CRM_SAVE_SORTING'], 'TXT_SELECT_ENTRIES' => $_ARRAYLANG['TXT_CRM_NO_OPERATION'], 'TXT_CRM_STATUS_SUCCESSFULLY_CHANGED' => $_ARRAYLANG['TXT_CRM_TASK_TYPE_STATUS_CHANGED_SUCCESSFULLY'], 'TXT_CRM_ARE_YOU_SURE_DELETE_ENTRIES' => $_ARRAYLANG['TXT_CRM_ARE_YOU_SURE_DELETE_ENTRIES'], 'TXT_CRM_MANDATORY_FIELDS_NOT_FILLED_OUT' => $_ARRAYLANG['TXT_CRM_MANDATORY_FIELDS_NOT_FILLED_OUT']));
}
示例7: showImport
/**
* It displayes the import menu
*
* @return customer import screen
*/
function showImport()
{
global $_ARRAYLANG, $objDatabase;
\JS::activate('cx');
\JS::activate('jqueryui');
\JS::registerCSS('modules/Crm/View/Style/main.css');
\JS::registerJS('modules/Crm/View/Script/contactexport.js');
\JS::registerJS('lib/javascript/jquery.form.js');
\JS::registerJS('lib/javascript/jquery.tmpl.min.js');
\JS::registerJS('lib/javascript/jquery.base64.js');
\JS::registerJS('lib/javascript/jquery.format.js');
$objTpl = $this->_objTpl;
$objTpl->addBlockfile('CRM_SETTINGS_FILE', 'settings_block', "module_{$this->moduleNameLC}_interface_import_options.html");
$objTpl->setGlobalVariable(array('MODULE_NAME' => $this->moduleName));
foreach ($this->_delimiter as $key => $value) {
$objTpl->setVariable(array('CRM_DELIMITER_VALUE' => $key, 'CRM_DELIMITER_TITLE' => $_ARRAYLANG[$value['placeholder']]));
$objTpl->parse('crm_delimiter');
}
foreach ($this->_enclosure as $key => $value) {
$objTpl->setVariable(array('CRM_ENCLOSURE_VALUE' => $key, 'CRM_ENCLOSURE_TITLE' => $_ARRAYLANG[$value['placeholder']]));
$objTpl->parse('crm_enclosure');
}
$options = array('upload-limit' => 1, 'id' => 'importUploader', 'style' => 'display:none;', 'allowed-extensions' => array('csv'));
$uploaderCode = $this->initUploader('uploadFinished', 'importCallbackJs', '', '', $options);
$redirectUrl = \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Crm&act=getImportFilename');
$this->_objTpl->setVariable(array('COMBO_UPLOADER_CODE' => $uploaderCode, 'REDIRECT_URL' => $redirectUrl));
$objTpl->setVariable(array('TXT_CRM_TITLE_IMPORT_CONTACTS' => $_ARRAYLANG['TXT_CRM_TITLE_IMPORT_CONTACTS'], 'TXT_CRM_IMPORT_HEADER' => $_ARRAYLANG['TXT_CRM_IMPORT_HEADER'], 'TXT_CRM_IMPORT_NOTE' => $_ARRAYLANG['TXT_CRM_IMPORT_NOTE'], 'TXT_CRM_IMPORT_NOTE_DESCRIPTION' => $_ARRAYLANG['TXT_CRM_IMPORT_NOTE_DESCRIPTION'], 'TXT_CRM_CSV_SETTINGS' => $_ARRAYLANG['TXT_CRM_CSV_SETTINGS'], 'TXT_CRM_SKIP' => $_ARRAYLANG['TXT_CRM_SKIP'], 'TXT_CRM_OVERWRITE' => $_ARRAYLANG['TXT_CRM_OVERWRITE'], 'TXT_CRM_DUPLICATE' => $_ARRAYLANG['TXT_CRM_DUPLICATE'], 'TXT_CRM_CHOOSE_FILE' => $_ARRAYLANG['TXT_CRM_CHOOSE_FILE'], 'TXT_CRM_CSV_SEPARATOR' => $_ARRAYLANG['TXT_CRM_CSV_SEPARATOR'], 'TXT_CRM_CSV_ENCLOSURE' => $_ARRAYLANG['TXT_CRM_CSV_ENCLOSURE'], 'TXT_CRM_ON_DUPLICATES' => $_ARRAYLANG['TXT_CRM_ON_DUPLICATES'], 'TXT_CRM_CHOOSE_CSV' => $_ARRAYLANG['TXT_CRM_CHOOSE_CSV'], 'TXT_CRM_ON_DUPLICATES_INFO' => $_ARRAYLANG['TXT_CRM_ON_DUPLICATES_INFO'], 'TXT_CRM_ON_DUPLICATE_SKIP_INFO' => $_ARRAYLANG['TXT_CRM_ON_DUPLICATE_SKIP_INFO'], 'TXT_CRM_ON_DUPLICATE_OVERWRITE_INFO' => $_ARRAYLANG['TXT_CRM_ON_DUPLICATE_OVERWRITE_INFO'], 'TXT_CRM_ON_DUPLICATE_INFO' => $_ARRAYLANG['TXT_CRM_ON_DUPLICATE_INFO'], 'TXT_CRM_IGNORE_FIRST_ROW' => $_ARRAYLANG['TXT_CRM_IGNORE_FIRST_ROW'], 'TXT_CRM_CONTINUE' => $_ARRAYLANG['TXT_CRM_CONTINUE'], 'TXT_CRM_CANCEL' => $_ARRAYLANG['TXT_CRM_CANCEL'], 'TXT_CRM_VERIFY_FIELDS' => $_ARRAYLANG['TXT_CRM_VERIFY_FIELDS'], 'TXT_CRM_VERIFY_INFO' => $_ARRAYLANG['TXT_CRM_VERIFY_INFO'], 'TXT_CRM_FILE_COLUMN' => $_ARRAYLANG['TXT_CRM_FILE_COLUMN'], 'TXT_CRM_CORRESPONDING_FIELD' => $_ARRAYLANG['TXT_CRM_CORRESPONDING_FIELD'], 'TXT_CRM_CSV_VALUE' => $_ARRAYLANG['TXT_CRM_CSV_VALUE'], 'TXT_CRM_CHANGE' => $_ARRAYLANG['TXT_CRM_CHANGE'], 'TXT_CRM_LOADING' => $_ARRAYLANG['TXT_CRM_LOADING'], 'TXT_CRM_PREVIOUS_RECORD' => $_ARRAYLANG['TXT_CRM_PREVIOUS_RECORD'], 'TXT_CRM_NEXT_RECORD' => $_ARRAYLANG['TXT_CRM_NEXT_RECORD'], 'TXT_CRM_TITLE_SAVING_CONTACTS' => $_ARRAYLANG['TXT_CRM_TITLE_SAVING_CONTACTS'], 'TXT_CRM_INTERFACE_FINAL_INFO' => $_ARRAYLANG['TXT_CRM_INTERFACE_FINAL_INFO'], 'TXT_CRM_RECORD_DONE' => $_ARRAYLANG['TXT_CRM_RECORD_DONE'], 'TXT_CRM_RECORD_SKIPPED' => $_ARRAYLANG['TXT_CRM_RECORD_SKIPPED'], 'TXT_CRM_RECORD_IMPORT' => $_ARRAYLANG['TXT_CRM_RECORD_IMPORT'], 'TXT_CRM_RECORD_PROCESS' => $_ARRAYLANG['TXT_CRM_RECORD_PROCESS'], 'TXT_CRM_IMPORT_NAME' => $_ARRAYLANG['TXT_CRM_IMPORT_NAME'], 'TXT_CRM_EXPORT_NAME' => $_ARRAYLANG['TXT_CRM_EXPORT_NAME']));
}
示例8: download
private function download()
{
global $_ARRAYLANG, $_LANGID;
$objFWUser = \FWUser::getFWUserObject();
$objDownload = new Download();
$objDownload->load(isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0);
if ($objDownload->getId() && !\Permission::checkAccess(143, 'static', true) && (($objFWUser = \FWUser::getFWUserObject()) == false || !$objFWUser->objUser->login() || $objDownload->getOwnerId() != $objFWUser->objUser->getId())) {
$this->arrStatusMsg['error'][] = $_ARRAYLANG['TXT_DOWNLOADS_MODIFY_DOWNLOAD_PROHIBITED'];
return $this->downloads();
}
$arrAssociatedGroupOptions = array();
$arrNotAssociatedGroupOptions = array();
$arrAssociatedGroups = array();
$arrAssociatedCategoryOptions = array();
$arrNotAssociatedCategoryOptions = array();
$arrAssociatedCategories = array();
$arrAssociatedDownloadOptions = array();
$arrNotAssociatedDownloadOptions = array();
if (isset($_POST['downloads_download_save'])) {
$objDownload->setNames(isset($_POST['downloads_download_name']) ? array_map('trim', array_map('contrexx_stripslashes', $_POST['downloads_download_name'])) : array());
$objDownload->setDescriptions(isset($_POST['downloads_download_description']) ? array_map('trim', array_map('contrexx_stripslashes', $_POST['downloads_download_description'])) : array());
$this->arrConfig['use_attr_metakeys'] ? $objDownload->setMetakeys(isset($_POST['downloads_download_metakeys']) ? array_map('trim', array_map('contrexx_stripslashes', $_POST['downloads_download_metakeys'])) : array()) : null;
$objDownload->setType(isset($_POST['downloads_download_type']) ? contrexx_stripslashes($_POST['downloads_download_type']) : '');
$objDownload->setSources(isset($_POST['downloads_download_' . $objDownload->getType() . '_source']) ? array_map('trim', array_map('contrexx_stripslashes', $_POST['downloads_download_' . $objDownload->getType() . '_source'])) : array());
$objDownload->setActiveStatus(!empty($_POST['downloads_download_is_active']));
$objDownload->setMimeType(isset($_POST['downloads_download_mime_type']) ? contrexx_stripslashes($_POST['downloads_download_mime_type']) : '');
$this->arrConfig['use_attr_size'] ? $objDownload->setSize(isset($_POST['downloads_download_size']) ? intval($_POST['downloads_download_size']) : '') : null;
$this->arrConfig['use_attr_license'] ? $objDownload->setLicense(isset($_POST['downloads_download_license']) ? contrexx_stripslashes($_POST['downloads_download_license']) : '') : null;
$this->arrConfig['use_attr_version'] ? $objDownload->setVersion(isset($_POST['downloads_download_version']) ? contrexx_stripslashes($_POST['downloads_download_version']) : '') : null;
$this->arrConfig['use_attr_author'] ? $objDownload->setAuthor(isset($_POST['downloads_download_author']) ? contrexx_stripslashes($_POST['downloads_download_author']) : '') : null;
$this->arrConfig['use_attr_website'] ? $objDownload->setWebsite(isset($_POST['downloads_download_website']) ? contrexx_stripslashes($_POST['downloads_download_website']) : '') : null;
$objDownload->setImage(isset($_POST['downloads_download_image']) ? contrexx_stripslashes($_POST['downloads_download_image']) : '');
$objDownload->setValidityTimePeriod(!empty($_POST['downloads_download_validity']) ? intval($_POST['downloads_download_validity']) : 0);
$objDownload->setVisibility(!empty($_POST['downloads_download_visibility']));
$objDownload->setProtection(!empty($_POST['downloads_download_access']));
$objDownload->setGroups($objDownload->getProtection() && !empty($_POST['downloads_download_access_associated_groups']) ? array_map('intval', $_POST['downloads_download_access_associated_groups']) : array());
$objDownload->setCategories(!empty($_POST['downloads_download_associated_categories']) ? array_map('intval', $_POST['downloads_download_associated_categories']) : array(0));
$objDownload->setDownloads(!empty($_POST['downloads_download_associated_downloads']) ? array_map('intval', $_POST['downloads_download_associated_downloads']) : array());
$objDownload->updateMTime();
if ($objDownload->store()) {
if (!empty($this->parentCategoryId)) {
header('location: ' . \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Downloads&act=categories&parent_id=' . $this->parentCategoryId));
} else {
return $this->downloads();
}
} else {
$this->arrStatusMsg['error'] = array_merge($this->arrStatusMsg['error'], $objDownload->getErrorMsg());
}
}
$this->_pageTitle = $objDownload->getId() ? $_ARRAYLANG['TXT_DOWNLOADS_EDIT_DOWNLOAD'] : $_ARRAYLANG['TXT_DOWNLOADS_ADD_DOWNLOAD'];
$this->objTemplate->addBlockFile('DOWNLOADS_DOWNLOAD_TEMPLATE', 'module_downloads_downloads', 'module_downloads_download_modify.html');
$this->objTemplate->setVariable(array('TXT_DOWNLOADS_GENERAL' => $_ARRAYLANG['TXT_DOWNLOADS_GENERAL'], 'TXT_DOWNLOADS_PERMISSIONS' => $_ARRAYLANG['TXT_DOWNLOADS_PERMISSIONS'], 'TXT_DOWNLOADS_DOWNLOAD_VISIBILITY_DESC' => $_ARRAYLANG['TXT_DOWNLOADS_DOWNLOAD_VISIBILITY_DESC'], 'TXT_DOWNLOADS_NAME' => $_ARRAYLANG['TXT_DOWNLOADS_NAME'], 'TXT_DOWNLOADS_DESCRIPTION' => $_ARRAYLANG['TXT_DOWNLOADS_DESCRIPTION'], 'TXT_DOWNLOADS_SOURCE' => $_ARRAYLANG['TXT_DOWNLOADS_SOURCE'], 'TXT_DOWNLOADS_LOCAL_FILE' => $_ARRAYLANG['TXT_DOWNLOADS_LOCAL_FILE'], 'TXT_DOWNLOADS_URL' => $_ARRAYLANG['TXT_DOWNLOADS_URL'], 'TXT_DOWNLOADS_BROWSE' => $_ARRAYLANG['TXT_DOWNLOADS_BROWSE'], 'TXT_DOWNLOADS_STATUS' => $_ARRAYLANG['TXT_DOWNLOADS_STATUS'], 'TXT_DOWNLOADS_VALIDITY_EXPIRATION' => $_ARRAYLANG['TXT_DOWNLOADS_VALIDITY_EXPIRATION'], 'TXT_DOWNLOADS_ACTIVE' => $_ARRAYLANG['TXT_DOWNLOADS_ACTIVE'], 'TXT_DOWNLOADS_TYPE' => $_ARRAYLANG['TXT_DOWNLOADS_TYPE'], 'TXT_DOWNLOADS_METAKEYS' => $_ARRAYLANG['TXT_DOWNLOADS_METAKEYS'], 'TXT_DOWNLOADS_SIZE' => $_ARRAYLANG['TXT_DOWNLOADS_SIZE'], 'TXT_DOWNLOADS_LICENSE' => $_ARRAYLANG['TXT_DOWNLOADS_LICENSE'], 'TXT_DOWNLOADS_VERSION' => $_ARRAYLANG['TXT_DOWNLOADS_VERSION'], 'TXT_DOWNLOADS_AUTHOR' => $_ARRAYLANG['TXT_DOWNLOADS_AUTHOR'], 'TXT_DOWNLOADS_WEBSITE' => $_ARRAYLANG['TXT_DOWNLOADS_WEBSITE'], 'TXT_DOWNLOADS_IMAGE' => $_ARRAYLANG['TXT_DOWNLOADS_IMAGE'], 'TXT_DOWNLOADS_CATEGORIES' => $_ARRAYLANG['TXT_DOWNLOADS_CATEGORIES'], 'TXT_DOWNLOADS_AVAILABLE_CATEGORIES' => $_ARRAYLANG['TXT_DOWNLOADS_AVAILABLE_CATEGORIES'], 'TXT_DOWNLOADS_ASSIGNED_CATEGORIES' => $_ARRAYLANG['TXT_DOWNLOADS_ASSIGNED_CATEGORIES'], 'TXT_DOWNLOADS_RELATED_DOWNLOADS' => $_ARRAYLANG['TXT_DOWNLOADS_RELATED_DOWNLOADS'], 'TXT_DOWNLOADS_AVAILABLE_DOWNLOADS' => $_ARRAYLANG['TXT_DOWNLOADS_AVAILABLE_DOWNLOADS'], 'TXT_DOWNLOADS_ASSIGNED_DOWNLOADS' => $_ARRAYLANG['TXT_DOWNLOADS_ASSIGNED_DOWNLOADS'], 'TXT_DOWNLOADS_DOWNLOAD_ALL_ACCESS_DESC' => $_ARRAYLANG['TXT_DOWNLOADS_DOWNLOAD_ALL_ACCESS_DESC'], 'TXT_DOWNLOADS_DOWNLOAD_SELECTED_ACCESS_DESC' => $_ARRAYLANG['TXT_DOWNLOADS_DOWNLOAD_SELECTED_ACCESS_DESC'], 'TXT_DOWNLOADS_AVAILABLE_USER_GROUPS' => $_ARRAYLANG['TXT_DOWNLOADS_AVAILABLE_USER_GROUPS'], 'TXT_DOWNLOADS_ASSIGNED_USER_GROUPS' => $_ARRAYLANG['TXT_DOWNLOADS_ASSIGNED_USER_GROUPS'], 'TXT_DOWNLOADS_CHECK_ALL' => $_ARRAYLANG['TXT_DOWNLOADS_CHECK_ALL'], 'TXT_DOWNLOADS_UNCHECK_ALL' => $_ARRAYLANG['TXT_DOWNLOADS_UNCHECK_ALL'], 'TXT_DOWNLOADS_CANCEL' => $_ARRAYLANG['TXT_DOWNLOADS_CANCEL'], 'TXT_DOWNLOADS_SAVE' => $_ARRAYLANG['TXT_DOWNLOADS_SAVE']));
// parse sorting & paging of the categories overview section
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_CATEGORY_SORT' => !empty($_GET['category_sort']) ? $_GET['category_sort'] : '', 'DOWNLOADS_DOWNLOAD_CATEGORY_SORT_BY' => !empty($_GET['category_by']) ? $_GET['category_by'] : '', 'DOWNLOADS_DOWNLOAD_DOWNLOAD_SORT' => !empty($_GET['download_sort']) ? $_GET['download_sort'] : '', 'DOWNLOADS_DOWNLOAD_DOWNLOAD_BY' => !empty($_GET['download_by']) ? $_GET['download_by'] : '', 'DOWNLOADS_DOWNLOAD_CATEGORY_OFFSET' => !empty($_GET['category_pos']) ? intval($_GET['category_pos']) : 0, 'DOWNLOADS_DOWNLOAD_DOWNLOAD_OFFSET' => !empty($_GET['download_pos']) ? intval($_GET['download_pos']) : 0));
// parse id
$this->objTemplate->setVariable('DOWNLOADS_DOWNLOAD_ID', $objDownload->getId());
// parse name and description attributres
$arrLanguages = \FWLanguage::getLanguageArray();
foreach ($arrLanguages as $langId => $arrLanguage) {
if ($arrLanguage['frontend'] == 1) {
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_NAME' => htmlentities($objDownload->getName($langId), ENT_QUOTES, CONTREXX_CHARSET), 'DOWNLOADS_DOWNLOAD_LANG_ID' => $langId, 'DOWNLOADS_DOWNLOAD_LANG_NAME' => htmlentities($arrLanguage['name'], ENT_QUOTES, CONTREXX_CHARSET)));
$this->objTemplate->parse('downloads_download_name_list');
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_DESCRIPTION' => htmlentities($objDownload->getDescription($langId), ENT_QUOTES, CONTREXX_CHARSET), 'DOWNLOADS_DOWNLOAD_LANG_ID' => $langId, 'DOWNLOADS_DOWNLOAD_LANG_DESCRIPTION' => htmlentities($arrLanguage['name'], ENT_QUOTES, CONTREXX_CHARSET)));
$this->objTemplate->parse('downloads_download_description_list');
if ($this->arrConfig['use_attr_metakeys']) {
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_METAKEYS' => htmlentities($objDownload->getMetakeys($langId), ENT_QUOTES, CONTREXX_CHARSET), 'DOWNLOADS_DOWNLOAD_LANG_ID' => $langId, 'DOWNLOADS_DOWNLOAD_LANG_METAKEYS' => htmlentities($arrLanguage['name'], ENT_QUOTES, CONTREXX_CHARSET)));
$this->objTemplate->parse('downloads_download_metakeys_list');
}
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_LANG_ID' => $langId, 'DOWNLOADS_DOWNLOAD_FILE_SOURCE' => $objDownload->getType() == 'file' ? htmlentities($objDownload->getSource($langId), ENT_QUOTES, CONTREXX_CHARSET) : '', 'TXT_DOWNLOADS_BROWSE' => $_ARRAYLANG['TXT_DOWNLOADS_BROWSE'], 'DOWNLOADS_DOWNLOAD_LANG_NAME' => htmlentities($arrLanguage['name'], ENT_QUOTES, CONTREXX_CHARSET)));
$this->objTemplate->parse('downloads_download_file_source_list');
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_LANG_ID' => $langId, 'DOWNLOADS_DOWNLOAD_URL_SOURCE' => $objDownload->getType() == 'url' ? htmlentities($objDownload->getSource($langId), ENT_QUOTES, CONTREXX_CHARSET) : 'http://', 'TXT_DOWNLOADS_BROWSE' => $_ARRAYLANG['TXT_DOWNLOADS_BROWSE'], 'DOWNLOADS_DOWNLOAD_LANG_NAME' => htmlentities($arrLanguage['name'], ENT_QUOTES, CONTREXX_CHARSET)));
$this->objTemplate->parse('downloads_download_url_source_list');
}
}
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_NAME' => htmlentities($objDownload->getName(), ENT_QUOTES, CONTREXX_CHARSET), 'TXT_DOWNLOADS_EXTENDED' => $_ARRAYLANG['TXT_DOWNLOADS_EXTENDED']));
$this->objTemplate->parse('downloads_download_name');
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_DESCRIPTION' => htmlentities($objDownload->getDescription(), ENT_QUOTES, CONTREXX_CHARSET), 'TXT_DOWNLOADS_EXTENDED' => $_ARRAYLANG['TXT_DOWNLOADS_EXTENDED']));
$this->objTemplate->parse('downloads_download_description');
// parse metakeys
if ($this->arrConfig['use_attr_metakeys']) {
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_METAKEYS' => htmlentities($objDownload->getMetakeys(), ENT_QUOTES, CONTREXX_CHARSET), 'TXT_DOWNLOADS_EXTENDED' => $_ARRAYLANG['TXT_DOWNLOADS_EXTENDED']));
$this->objTemplate->parse('downloads_download_metakeys');
$this->objTemplate->parse('downloads_download_attr_metakeys');
} else {
$this->objTemplate->hideBlock('downloads_download_attr_metakeys');
}
// parse type
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_TYPE_FILE_CHECKED' => $objDownload->getType() == 'file' ? 'checked="checked"' : '', 'DOWNLOADS_DOWNLOAD_TYPE_URL_CHECKED' => $objDownload->getType() == 'url' ? 'checked="checked"' : '', 'DOWNLOADS_DOWNLOAD_TYPE_FILE_CONFIG_DISPLAY' => $objDownload->getType() == 'file' ? 'block' : 'none', 'DOWNLOADS_DOWNLOAD_TYPE_URL_CONFIG_DISPLAY' => $objDownload->getType() == 'url' ? 'block' : 'none', 'DOWNLOADS_DOWNLOAD_FILE_SOURCE' => $objDownload->getType() == 'file' ? $objDownload->getSource() : '', 'DOWNLOADS_DOWNLOAD_URL_SOURCE' => $objDownload->getType() == 'url' ? $objDownload->getSource() : 'http://', 'TXT_DOWNLOADS_BROWSE' => $_ARRAYLANG['TXT_DOWNLOADS_BROWSE'], 'TXT_DOWNLOADS_EXTENDED' => $_ARRAYLANG['TXT_DOWNLOADS_EXTENDED']));
foreach (Download::$arrMimeTypes as $mimeType => $arrMimeType) {
if (!count($arrMimeType['extensions'])) {
continue;
}
$this->objTemplate->setVariable(array('DOWNLOADS_MIME_TYPE' => $mimeType, 'DOWNLOADS_FILE_EXTENSION_REGEXP' => implode('|', $arrMimeType['extensions'])));
$this->objTemplate->parse('downloads_download_file_ext_regexp');
}
// parse mime type
$this->objTemplate->setVariable('DOWNLOADS_DOWNLOAD_MIME_TYPE_MENU', $this->getDownloadMimeTypeMenu($objDownload->getMimeType()));
$attrRow = 0;
// parse size
if ($this->arrConfig['use_attr_size']) {
//.........这里部分代码省略.........
示例9: notesOverview
/**
* notes overview page
*
* @global array $_ARRAYLANG
* @global object $objDatabase
* @return true
*/
function notesOverview()
{
global $_CORELANG, $_ARRAYLANG, $objDatabase, $objJs;
//For notes type Upload
$options = array('id' => 'notesUploader', 'upload-limit' => 1, 'style' => 'display:none;');
$uploaderCodeTaskType = $this->initUploader('notesUploadFinished', 'notesCallbackJs', '', $_ARRAYLANG['TXT_BROWSE'], $options);
$redirectUrl = \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Crm&act=getImportFilename');
$this->_objTpl->setVariable(array('COMBO_UPLOADER_CODE_NOTES' => $uploaderCodeTaskType, 'REDIRECT_URL' => $redirectUrl));
$fn = isset($_REQUEST['fn']) ? $_REQUEST['fn'] : '';
if (!empty($fn)) {
switch ($fn) {
case 'editnotestype':
$this->editnotes();
break;
}
return;
}
$this->_objTpl->addBlockfile('CRM_SETTINGS_FILE', 'settings_block', 'module_' . $this->moduleNameLC . '_settings_notes.html');
$this->_pageTitle = $_ARRAYLANG['TXT_CRM_SETTINGS'];
$this->_objTpl->setGlobalVariable(array('MODULE_NAME' => $this->moduleName));
if (!isset($_GET['message'])) {
$_GET['message'] = '';
}
switch ($_GET['message']) {
case 'updatenotes':
$this->_strOkMessage = $_ARRAYLANG['TXT_CRM_NOTES_UPDATED'];
break;
}
$name = isset($_POST['name']) ? contrexx_input2db($_POST['name']) : '';
$status = isset($_POST['status']) ? intval($_POST['status']) : '';
$icon = isset($_POST['icon']) ? contrexx_input2db($_POST['icon']) : '';
$position = isset($_POST['sorting']) ? intval($_POST['sorting']) : '';
$id = isset($_GET['idr']) ? intval($_GET['idr']) : '';
if (isset($_GET['idr'])) {
$objComment = $objDatabase->Execute("SELECT notes_type_id FROM " . DBPREFIX . "module_" . $this->moduleNameLC . "_customer_comment WHERE notes_type_id = '{$id}'");
if ($objComment->fields['notes_type_id'] != $id) {
$objResult = $objDatabase->Execute("DELETE FROM " . DBPREFIX . "module_" . $this->moduleNameLC . "_notes WHERE id = '{$id}'");
$this->_strOkMessage = $_ARRAYLANG['TXT_CRM_NOTES_DELETED'];
} else {
$this->_strErrMessage = $_ARRAYLANG['TXT_CRM_NOTES_ERROR'];
}
}
if (isset($_GET['chg']) and $_GET['chg'] == 1 and isset($_POST['selected']) and is_array($_POST['selected'])) {
if ($_POST['form_activate'] != '' or $_POST['form_deactivate'] != '') {
$ids = $_POST['selected'];
$to = $_POST['form_activate'] ? 1 : 0;
foreach ($ids as $id) {
$query = "UPDATE " . DBPREFIX . "module_" . $this->moduleNameLC . "_notes\n SET status = '" . $to . "'\n WHERE id = '" . intval($id) . "'";
$objDatabase->SelectLimit($query, 1);
}
$this->_strOkMessage = $to == 1 ? $_ARRAYLANG['TXT_CRM_ACTIVATED_SUCCESSFULLY'] : $_ARRAYLANG['TXT_CRM_DEACTIVATED_SUCCESSFULLY'];
}
if ($_POST['form_delete'] != '') {
$ids = $_POST['selected'];
$x = 0;
foreach ($ids as $id) {
$objComment = $objDatabase->Execute("SELECT notes_type_id FROM " . DBPREFIX . "module_" . $this->moduleNameLC . "_customer_comment WHERE notes_type_id = '{$id}'");
if ($objComment->fields['notes_type_id'] != $id) {
$query = "DELETE FROM " . DBPREFIX . "module_" . $this->moduleNameLC . "_notes\n WHERE system_defined != 1 AND id = '" . intval($id) . "'";
$objDelete = $objDatabase->SelectLimit($query, 1);
if ($objDelete) {
$this->_strOkMessage = $_ARRAYLANG['TXT_CRM_NOTES_DELETED'];
}
} else {
$this->_strErrMessage = $_ARRAYLANG['TXT_CRM_NOTES_ERROR'];
}
}
}
}
if (isset($_GET['chg']) and $_GET['chg'] == 1 and $_POST['form_sort'] == 1) {
for ($x = 0; $x < count($_POST['form_id']); $x++) {
$query = "UPDATE " . DBPREFIX . "module_" . $this->moduleNameLC . "_notes\n SET pos = '" . intval($_POST['form_pos'][$x]) . "'\n WHERE id = '" . intval($_POST['form_id'][$x]) . "'";
$objDatabase->Execute($query);
}
$this->_strOkMessage = $_POST['form_sort'] == 1 ? $_ARRAYLANG['TXT_CRM_SORTING_COMPLETE'] : '';
}
if (isset($_POST['save'])) {
$validate = $this->validation($name);
if ($validate) {
$objResult = $objDatabase->Execute("INSERT " . DBPREFIX . "module_" . $this->moduleNameLC . "_notes SET name ='{$name}',\n status = '{$status}',\n icon = '{$icon}',\n pos = '{$position}'");
$this->_strOkMessage = $_ARRAYLANG['TXT_CRM_NOTES_INSERTED'];
} else {
$this->_strErrMessage = $_ARRAYLANG['TXT_CRM_ERROR'];
}
}
if (isset($_POST['notes_save'])) {
for ($x = 0; $x < count($_POST['form_id']); $x++) {
$query = "UPDATE " . DBPREFIX . "module_" . $this->moduleNameLC . "_notes\n SET pos = '" . intval($_POST['form_pos'][$x]) . "'\n WHERE id = '" . intval($_POST['form_id'][$x]) . "'";
$objDatabase->Execute($query);
}
$this->_strOkMessage = $_ARRAYLANG['TXT_CRM_SORTING_COMPLETE'];
}
$sortf = isset($_GET['sortf']) && isset($_GET['sorto']) ? $_GET['sortf'] == 1 ? 'pos' : 'name' : 'pos';
//.........这里部分代码省略.........
示例10: showUploadForm
/**
* Shows the UploadForm
*
* @global ADONewConnection
* @global array
*/
function showUploadForm()
{
global $objDatabase, $_ARRAYLANG, $_CORELANG;
/**
* Uploader button handling
*/
//paths we want to remember for handling the uploaded files
$paths = array('path' => ASCMS_GALLERY_PATH, 'webPath' => ASCMS_GALLERY_WEB_PATH);
$uploader = new Uploader();
// $comboUp = \Cx\Core_Modules\Upload\Controller\UploadFactory::getInstance()->newUploader('exposedCombo');
$uploader->setFinishedCallback(array(ASCMS_MODULE_PATH . '/Gallery/Controller/GalleryManager.class.php', '\\Cx\\Modules\\Gallery\\Controller\\GalleryManager', 'uploadFinished'));
$uploader->setData($paths);
$uploader->addClass('uploadbutton');
$uploader->setOptions(array('allowed-extensions' => array('jpg', 'gif', 'png')));
$uploader->setCallback('finishedGalleryUpload');
//set instance name to combo_uploader so we are able to catch the instance with js
// $comboUp->setJsInstanceName('exposed_combo_uploader');
$redirectUrl = \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Gallery&act=validate_form');
$this->_objTpl->loadTemplateFile('module_gallery_upload_images.html', true, true);
$this->_objTpl->setVariable(array('COMBO_UPLOADER_CODE' => $uploader->getXHtml($_ARRAYLANG['TXT_GALLERY_MENU_UPLOAD_FORM_SUBMIT']), 'REDIRECT_URL' => $redirectUrl));
//end of uploader button handling
//get enabled filetypes
$strEnabledTypes = '';
if ($this->boolGifEnabled == true) {
$strEnabledTypes .= 'GIF ';
}
if ($this->boolJpgEnabled == true) {
$strEnabledTypes .= 'JPG ';
}
if ($this->boolPngEnabled == true) {
$strEnabledTypes .= 'PNG ';
}
$objResult = $objDatabase->Execute('SELECT *
FROM ' . DBPREFIX . 'module_gallery_pictures
WHERE validated="0"
ORDER BY lastedit ASC');
while (!$objResult->EOF) {
$this->_objTpl->setVariable('GALLERY_UPLOADED_IMAGE', '<img src="' . $this->strImageWebPath . $objResult->fields['path'] . '" class="galleryImageVisible" />');
$this->_objTpl->parse('uploadedImages');
$objResult->MoveNext();
}
if ($objResult->_numOfRows == 0) {
$this->_objTpl->setVariable('GALLERY_ALREADY_UPLOADED_IMAGES', 'confirmImages');
}
$this->_objTpl->setVariable(array('TXT_TITLE' => $_ARRAYLANG['TXT_GALLERY_MENU_UPLOAD_FORM'], 'TXT_GALLERY_UPLOAD_CONFIRM_IMAGES' => $_ARRAYLANG['TXT_GALLERY_UPLOAD_CONFIRM_IMAGES'], 'TXT_GALLERY_UPLOAD_IMAGES' => $_ARRAYLANG['TXT_GALLERY_UPLOAD_IMAGES'], 'TXT_GALLERY_UPLOAD_HELP' => $_ARRAYLANG['TXT_GALLERY_UPLOAD_HELP'], 'TXT_IMAGENUMBER' => $_ARRAYLANG['TXT_GALLERY_UPLOAD_FORM_IMAGE_NUMBER'], 'TXT_ENABLED_IMAGE_TYPE' => $_ARRAYLANG['TXT_GALLERY_FORMAT_SUPPORT'] . ' ' . $strEnabledTypes . '. ' . $_ARRAYLANG['TXT_GALLERY_NO_UPLOAD'], 'TXT_BUTTON_SUBMIT' => $_ARRAYLANG['TXT_GALLERY_MENU_UPLOAD_FORM_SUBMIT']));
}
示例11: showUploadForm
/**
* Shows the UploadForm
*
* @global ADONewConnection
* @global array
*/
function showUploadForm()
{
global $objDatabase, $_ARRAYLANG, $_CORELANG;
/**
* Uploader button handling
*/
//paths we want to remember for handling the uploaded files
$paths = array('path' => ASCMS_GALLERY_PATH, 'webPath' => ASCMS_GALLERY_WEB_PATH);
$uploader = new Uploader();
// $comboUp = \Cx\Core_Modules\Upload\Controller\UploadFactory::getInstance()->newUploader('exposedCombo');
$uploader->setFinishedCallback(array(ASCMS_MODULE_PATH . '/Gallery/Controller/GalleryManager.class.php', '\\Cx\\Modules\\Gallery\\Controller\\GalleryManager', 'uploadFinished'));
$uploader->setData($paths);
$uploader->addClass('uploadbutton');
$uploader->setCallback('finishedGalleryUpload');
//set instance name to combo_uploader so we are able to catch the instance with js
// $comboUp->setJsInstanceName('exposed_combo_uploader');
$redirectUrl = \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Gallery&act=validate_form');
$this->_objTpl->loadTemplateFile('module_gallery_upload_images.html', true, true);
$this->_objTpl->setVariable(array('COMBO_UPLOADER_CODE' => $uploader->getXHtml($_ARRAYLANG['TXT_GALLERY_MENU_UPLOAD_FORM_SUBMIT']), 'REDIRECT_URL' => $redirectUrl));
//end of uploader button handling
//get enabled filetypes
$strEnabledTypes = '';
if ($this->boolGifEnabled == true) {
$strEnabledTypes .= 'GIF ';
}
if ($this->boolJpgEnabled == true) {
$strEnabledTypes .= 'JPG ';
}
if ($this->boolPngEnabled == true) {
$strEnabledTypes .= 'PNG ';
}
$this->_objTpl->setVariable(array('TXT_TITLE' => $_ARRAYLANG['TXT_GALLERY_MENU_UPLOAD_FORM'], 'TXT_GALLERY_UPLOAD_CONFIRM_IMAGES' => $_ARRAYLANG['TXT_GALLERY_UPLOAD_CONFIRM_IMAGES'], 'TXT_GALLERY_UPLOAD_IMAGES' => $_ARRAYLANG['TXT_GALLERY_UPLOAD_IMAGES'], 'TXT_GALLERY_UPLOAD_HELP' => $_ARRAYLANG['TXT_GALLERY_UPLOAD_HELP'], 'TXT_IMAGENUMBER' => $_ARRAYLANG['TXT_GALLERY_UPLOAD_FORM_IMAGE_NUMBER'], 'TXT_ENABLED_IMAGE_TYPE' => $_ARRAYLANG['TXT_GALLERY_FORMAT_SUPPORT'] . ' ' . $strEnabledTypes . '. ' . $_ARRAYLANG['TXT_GALLERY_NO_UPLOAD'], 'TXT_BUTTON_SUBMIT' => $_ARRAYLANG['TXT_GALLERY_MENU_UPLOAD_FORM_SUBMIT']));
}