function modifyEntry() { global $_ARRAYLANG, $_CORELANG; $this->_objTpl->setTemplate($this->pageContent, true, true); parent::getSettings(); $bolFileSizesStatus = true; $strOkMessage = ''; $strErrMessage = ''; $strOnSubmit = ''; //count forms $objForms = new MediaDirectoryForm(null, $this->moduleName); $arrActiveForms = array(); foreach ($objForms->arrForms as $intFormId => $arrForm) { if ($arrForm['formActive'] == 1) { $arrActiveForms[] = $intFormId; } } //check id and form if (!empty($_REQUEST['eid']) || !empty($_REQUEST['entryId'])) { if (!empty($_REQUEST['eid'])) { $intEntryId = intval($_REQUEST['eid']); } if (!empty($_REQUEST['entryId'])) { $intEntryId = intval($_REQUEST['entryId']); } $intFormId = intval(substr($_GET['cmd'], 4)); } else { $intEntryId = null; $intFormId = intval(substr($_GET['cmd'], 3)); } $intCountForms = count($arrActiveForms); if ($intCountForms > 0) { //check form if (intval($intEntryId) == 0 && empty($_REQUEST['selectedFormId']) && empty($_POST['formId']) && $intCountForms > 1 && $intFormId == 0) { $intFormId = null; //get form selector $objForms = new MediaDirectoryForm(null, $this->moduleName); $objForms->listForms($this->_objTpl, 3, $intFormId); //parse blocks $this->_objTpl->hideBlock($this->moduleNameLC . 'Inputfields'); } else { //save entry data if (isset($_POST['submitEntryModfyForm'])) { $objEntry = new MediaDirectoryEntry($this->moduleName); $strStatus = $objEntry->saveEntry($_POST, intval($_POST['entryId'])); if (!empty($_POST['entryId'])) { $objEntry->getEntries(intval($_POST['entryId'])); if ($strStatus == true) { if (intval($_POST['readyToConfirm']) == 1) { if ($objEntry->arrEntries[intval($_POST['entryId'])]['entryConfirmed'] == 1) { $bolReadyToConfirmMessage = false; $bolSaveOnlyMessage = false; } else { $bolReadyToConfirmMessage = true; $bolSaveOnlyMessage = false; } } else { $bolReadyToConfirmMessage = false; $bolSaveOnlyMessage = true; } $strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_EDITED']; } else { $strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_EDITED']; } } else { if ($strStatus == true) { if (intval($_POST['readyToConfirm']) == 1) { $bolReadyToConfirmMessage = true; $bolSaveOnlyMessage = false; } else { $bolReadyToConfirmMessage = false; $bolSaveOnlyMessage = true; } $strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_ADDED']; } else { $strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_ADDED']; } } if (!empty($_POST['entryId'])) { if ($strStatus == true) { $strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_EDITED']; } else { $strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_EDITED']; } } else { if ($strStatus == true) { $strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_ADDED']; } else { $strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_ADDED']; } } } else { //get form id if (intval($intEntryId) != 0) { //get entry data $objEntry = new MediaDirectoryEntry($this->moduleName); if ($this->arrSettings['settingsReadyToConfirm'] == 1) { $objEntry->getEntries($intEntryId, null, null, null, null, null, true, null, 'n', null, null, null, true); } else { $objEntry->getEntries($intEntryId); } $intFormId = $objEntry->arrEntries[$intEntryId]['entryFormId']; } else { //set form id if ($intCountForms == 1) { $intFormId = intval($arrActiveForms[0]); } else { if ($intFormId == 0) { $intFormId = intval($_REQUEST['selectedFormId']); } } } //get inputfield object $objInputfields = new MediaDirectoryInputfield($intFormId, false, null, $this->moduleName); //list inputfields $objInputfields->listInputfields($this->_objTpl, 2, $intEntryId); //get translation status date if ($this->arrSettings['settingsTranslationStatus'] == 1) { foreach ($this->arrFrontendLanguages as $key => $arrLang) { if ($arrLang['id'] == 2) { $strLangStatus = 'checked="checked" disabled="disabled"'; } elseif ($intEntryId != 0) { if (in_array($arrLang['id'], $objEntry->arrEntries[$intEntryId]['entryTranslationStatus'])) { $strLangStatus = 'checked="checked"'; } else { $strLangStatus = ''; } } else { $strLangStatus = ''; } $this->_objTpl->setVariable(array('TXT_' . $this->moduleLangVar . '_TRANSLATION_LANG_NAME' => htmlspecialchars($arrLang['name'], ENT_QUOTES, CONTREXX_CHARSET), $this->moduleLangVar . '_TRANSLATION_LANG_ID' => intval($arrLang['id']), $this->moduleLangVar . '_TRANSLATION_LANG_STATUS' => $strLangStatus)); $this->_objTpl->parse($this->moduleNameLC . 'TranslationLangList'); } } else { $this->_objTpl->hideBlock($this->moduleNameLC . 'TranslationStatus'); } //get ready to confirm if ($this->arrSettings['settingsReadyToConfirm'] == 1 && empty($objEntry->arrEntries[$intEntryId]['entryReadyToConfirm']) && empty($objEntry->arrEntries[$intEntryId]['entryConfirmed'])) { $objForm = new MediaDirectoryForm($intFormId, $this->moduleName); if ($objForm->arrForms[$intFormId]['formUseReadyToConfirm'] == 1) { $strReadyToConfirm = '<p><input class="' . $this->moduleNameLC . 'InputfieldCheckbox" name="readyToConfirm" id="' . $this->moduleNameLC . 'Inputfield_ReadyToConfirm" value="1" type="checkbox"> ' . $_ARRAYLANG['TXT_MEDIADIR_READY_TO_CONFIRM'] . '</p>'; } else { $strReadyToConfirm = '<input type="hidden" name="readyToConfirm" value="1" />'; } } else { $strReadyToConfirm = '<input type="hidden" name="readyToConfirm" value="1" />'; } $this->_objTpl->setVariable(array($this->moduleLangVar . '_READY_TO_CONFIRM' => $strReadyToConfirm)); //generate javascript parent::setJavascript($this->getSelectorJavascript()); parent::setJavascript($objInputfields->getInputfieldJavascript()); //parent::setJavascript("\$J().ready(function(){ \$J('.mediadirInputfieldHint').inputHintBox({className:'mediadirInputfieldInfobox',incrementLeft:3,incrementTop:-6}); });"); //get form onsubmit $strOnSubmit = parent::getFormOnSubmit($objInputfields->arrJavascriptFormOnSubmit); //parse blocks $this->_objTpl->hideBlock($this->moduleNameLC . 'Forms'); } } if (!empty($_SESSION[$this->moduleNameLC]) && empty($_SESSION[$this->moduleNameLC]['bolFileSizesStatus'])) { $strFileMessage = '<div class="' . $this->moduleNameLC . 'FileErrorMessage">' . $_ARRAYLANG['TXT_MEDIADIR_IMAGE_ERROR_MESSAGE'] . '</div>'; unset($_SESSION[$this->moduleNameLC]['bolFileSizesStatus']); } else { $strFileMessage = ''; } //parse global variables $this->_objTpl->setVariable(array($this->moduleLangVar . '_ENTRY_ID' => $intEntryId, $this->moduleLangVar . '_FORM_ID' => $intFormId, 'TXT_' . $this->moduleLangVar . '_SUBMIT' => $_ARRAYLANG['TXT_' . $this->moduleLangVar . '_SUBMIT'], $this->moduleLangVar . '_FORM_ONSUBMIT' => $strOnSubmit, 'TXT_' . $this->moduleLangVar . '_PLEASE_CHECK_INPUT' => $_ARRAYLANG['TXT_MEDIADIR_PLEASE_CHECK_INPUT'], 'TXT_' . $this->moduleLangVar . '_OK_MESSAGE' => $strOkMessage . $strFileMessage, 'TXT_' . $this->moduleLangVar . '_ERROR_MESSAGE' => $strErrMessage . $strFileMessage, $this->moduleLangVar . '_MAX_CATEGORY_SELECT' => $strErrMessage, 'TXT_' . $this->moduleLangVar . '_TRANSLATION_STATUS' => $_ARRAYLANG['TXT_MEDIADIR_TRANSLATION_STATUS'])); if (!empty($strOkMessage)) { $this->_objTpl->touchBlock($this->moduleNameLC . 'EntryOkMessage'); $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryErrMessage'); $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryModifyForm'); if ($bolReadyToConfirmMessage) { $this->_objTpl->touchBlock($this->moduleNameLC . 'EntryReadyToConfirmMessage'); $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryOkMessage'); } if ($bolSaveOnlyMessage) { $this->_objTpl->touchBlock($this->moduleNameLC . 'EntrySaveOnlyMessage'); $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryOkMessage'); } } else { if (!empty($strErrMessage)) { $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryOkMessage'); $this->_objTpl->touchBlock($this->moduleNameLC . 'EntryErrMessage'); $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryModifyForm'); } else { $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryOkMessage'); $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryErrMessage'); $this->_objTpl->parse($this->moduleNameLC . 'EntryModifyForm'); $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryReadyToConfirmMessage'); $this->_objTpl->hideBlock($this->moduleNameLC . 'EntrySaveOnlyMessage'); } } } else { header("Location: index.php?section=" . $_GET['section']); exit; } }
function showExport($step, $objTpl) { global $_ARRAYLANG, $_CORELANG, $_LANGID, $objDatabase; $objTpl->addBlockfile($this->moduleLangVar . '_INTERFACES_CONTENT', 'interfaces_content', 'module_' . $this->moduleNameLC . '_interfaces_export.html'); if ($this->arrSettings['settingsShowLevels'] == 1) { $strFormOnSubmit = "selectAll(document.interfacesExportForm.elements['selectedCategories']); "; $strFormOnSubmit .= "selectAll(document.interfacesExportForm.elements['selectedLevels']); "; $objLevels = new MediaDirectoryLevel(null, null, true, $this->moduleName); $arrLevels = $objLevels->listLevels($objTpl, 4); $objTpl->parse($this->moduleNameLC . 'InterfacesExportSelectLevels'); } else { $strFormOnSubmit = "selectAll(document.interfacesExportForm.elements['selectedCategories']); "; $objTpl->hideBlock($this->moduleNameLC . 'InterfacesExportSelectLevels'); } $objCategories = new MediaDirectoryCategory(null, null, true, $this->moduleName); $arrCategories = $objCategories->listCategories($objTpl, 4); $objForms = new MediaDirectoryForm(null, $this->moduleName); $strForms = $objForms->listForms($objTpl, 4); $strMasks = '<option value="0">' . $_ARRAYLANG['TXT_MEDIADIR_NO_EXPORT_MASK'] . '</option>'; $objResultMasks = $objDatabase->Execute("SELECT\n id,title,form_id \n FROM\n " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_masks \n WHERE active = '1' \n ORDER BY title ASC \n "); if ($objResultMasks !== false) { while (!$objResultMasks->EOF) { $objForm = new MediaDirectoryForm($objResultMasks->fields['form_id'], $this->moduleName); $strFormName = $objForm->arrForms[$objResultMasks->fields['form_id']]['formName'][0]; $strMasks .= '<option value="' . $objResultMasks->fields['id'] . '">' . $objResultMasks->fields['title'] . ' (' . $strFormName . ')</option>'; $objResultMasks->MoveNext(); } } $objTpl->setVariable(array($this->moduleLangVar . '_INTERFACES_EXPORT_DESELECTED_CATEGORIES' => $arrCategories['not_selected'], $this->moduleLangVar . '_INTERFACES_EXPORT_DESELECTED_LEVELS' => $arrLevels['not_selected'], $this->moduleLangVar . '_INTERFACES_EXPORT_FORMS' => $strForms, $this->moduleLangVar . '_INTERFACES_EXPORT_MASKS' => $strMasks, $this->moduleLangVar . '_FORM_ONSUBMIT' => $strFormOnSubmit, 'TXT_' . $this->moduleLangVar . '_EXPORT_FORMAT' => $_ARRAYLANG['TXT_MEDIADIR_EXPORT_FORMAT'], 'TXT_' . $this->moduleLangVar . '_FORM_TEMPLATE' => $_ARRAYLANG['TXT_MEDIADIR_FORM_TEMPLATE'], 'TXT_' . $this->moduleLangVar . '_EXPORT_MASK' => $_ARRAYLANG['TXT_MEDIADIR_EXPORT_MASK'], 'TXT_' . $this->moduleLangVar . '_CATEGORIES' => $_ARRAYLANG['TXT_MEDIADIR_CATEGORIES'], 'TXT_' . $this->moduleLangVar . '_LEVELS' => $_ARRAYLANG['TXT_MEDIADIR_LEVELS'])); $objTpl->parse('interfaces_content'); }
function manageEntries() { global $_ARRAYLANG, $_CORELANG, $objDatabase, $_LANGID; $this->_objTpl->loadTemplateFile('module_' . $this->moduleNameLC . '_manage_entries.html', true, true); $this->pageTitle = $_ARRAYLANG['TXT_MEDIADIR_MANAGE_ENTRIES']; $this->initFilterSession(); if (isset($_REQUEST['cat_id'])) { $_SESSION[$this->moduleName]['searchFilter']['cat_id'] = intval($_REQUEST['cat_id']); } if (isset($_REQUEST['level_id'])) { $_SESSION[$this->moduleName]['searchFilter']['level_id'] = intval($_REQUEST['level_id']); } if (isset($_REQUEST['form_id'])) { $_SESSION[$this->moduleName]['searchFilter']['form_id'] = intval($_REQUEST['form_id']); } if (isset($_REQUEST['term'])) { $_SESSION[$this->moduleName]['searchFilter']['term'] = $_REQUEST['term'] != $_ARRAYLANG['TXT_MEDIADIR_ID_OR_SEARCH_TERM'] ? $_REQUEST['term'] : null; } //assign the searchFilter session values to corresponding variables $intCategoryId = $_SESSION[$this->moduleName]['searchFilter']['cat_id']; $intLevelId = $_SESSION[$this->moduleName]['searchFilter']['level_id']; $intFormId = $_SESSION[$this->moduleName]['searchFilter']['form_id']; $strTerm = $_SESSION[$this->moduleName]['searchFilter']['term']; $objCategories = new MediaDirectoryCategory(null, null, 1, $this->moduleName); $catDropdown = $objCategories->listCategories(null, 3, $intCategoryId); $objLevels = new MediaDirectoryLevel(null, null, 1, $this->moduleName); $levelDropdown = $objLevels->listLevels(null, 3, $intLevelId); $objForms = new MediaDirectoryForm(null, $this->moduleName); $formDropdown = $objForms->listForms(null, 4, $intFormId); //parse global variables $this->_objTpl->setGlobalVariable(array('TXT_' . $this->moduleLangVar . '_PAGE_TITLE' => $this->pageTitle, 'TXT_' . $this->moduleLangVar . '_SUBMIT' => $_ARRAYLANG['TXT_' . $this->moduleLangVar . '_SUBMIT'], 'TXT_EDIT' => $_ARRAYLANG['TXT_MEDIADIR_EDIT'], 'TXT_SEARCH' => $_CORELANG['TXT_SEARCH'], 'TXT_MEDIADIR_STATUS' => $_CORELANG['TXT_STATUS'], 'TXT_SELECT_ALL' => $_CORELANG['TXT_SELECT_ALL'], 'TXT_DESELECT_ALL' => $_CORELANG['TXT_DESELECT_ALL'], 'TXT_SELECT_ACTION' => $_CORELANG['TXT_MULTISELECT_SELECT'], 'TXT_FUNCTIONS' => $_ARRAYLANG['TXT_MEDIADIR_FUNCTIONS'], 'TXT_DELETE' => $_ARRAYLANG['TXT_MEDIADIR_DELETE'], 'TXT_DELETE_ALL' => $_CORELANG['TXT_MULTISELECT_DELETE'], 'TXT_' . $this->moduleLangVar . '_VOTING' => $_ARRAYLANG['TXT_MEDIADIR_VOTING'], 'TXT_' . $this->moduleLangVar . '_COMMENTS' => $_ARRAYLANG['TXT_MEDIADIR_COMMENTS'], 'TXT_' . $this->moduleLangVar . '_NAME' => $_CORELANG['TXT_NAME'], 'TXT_' . $this->moduleLangVar . '_DATE' => $_CORELANG['TXT_DATE'], 'TXT_' . $this->moduleLangVar . '_AUTHOR' => $_ARRAYLANG['TXT_MEDIADIR_AUTHOR'], 'TXT_' . $this->moduleLangVar . '_HITS' => $_ARRAYLANG['TXT_MEDIADIR_HITS'], 'TXT_' . $this->moduleLangVar . '_ACTION' => $_CORELANG['TXT_HISTORY_ACTION'], $this->moduleLangVar . '_SEARCH_TERM' => $strTerm != null ? $strTerm : $_ARRAYLANG['TXT_MEDIADIR_ID_OR_SEARCH_TERM'], 'TXT_' . $this->moduleLangVar . '_ID_OR_SEARCH_TERM' => $_ARRAYLANG['TXT_MEDIADIR_ID_OR_SEARCH_TERM'], $this->moduleLangVar . '_SEARCH_CATEGORY_ID' => $intCategoryId, $this->moduleLangVar . '_SEARCH_LEVEL_ID' => $intLevelId, 'TXT_' . $this->moduleLangVar . '_MOVE_ALL' => $_ARRAYLANG['TXT_MEDIADIR_MOVE_ALL'], 'TXT_' . $this->moduleLangVar . '_RESTORE_VOTING_ALL' => $_ARRAYLANG['TXT_MEDIADIR_RESTORE_VOTING_ALL'], 'TXT_' . $this->moduleLangVar . '_RESTORE_COMMENTS_ALL' => $_ARRAYLANG['TXT_MEDIADIR_RESTORE_COMMENTS_ALL'], 'TXT_' . $this->moduleLangVar . '_CONFIRM_DELETE_DATA' => $_ARRAYLANG['TXT_MEDIADIR_CONFIRM_DELETE_DATA'], 'TXT_' . $this->moduleLangVar . '_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_MEDIADIR_ACTION_IS_IRREVERSIBLE'], 'TXT_' . $this->moduleLangVar . '_MAKE_SELECTION' => $_ARRAYLANG['TXT_MEDIADIR_MAKE_SELECTION'], 'TXT_SELECT_ALL' => $_CORELANG['TXT_SELECT_ALL'], 'TXT_DESELECT_ALL' => $_CORELANG['TXT_DESELECT_ALL'], 'TXT_SELECT_ACTION' => $_CORELANG['TXT_MULTISELECT_SELECT'], 'TXT_DELETE_ALL' => $_CORELANG['TXT_MULTISELECT_DELETE'], 'TXT_' . $this->moduleLangVar . '_MOVE_ALL' => $_ARRAYLANG['TXT_MEDIADIR_MOVE_ALL'], 'TXT_' . $this->moduleLangVar . '_ALL_LEVELS' => $_ARRAYLANG['TXT_MEDIADIR_ALL_LEVELS'], 'TXT_' . $this->moduleLangVar . '_ALL_CATEGORIES' => $_ARRAYLANG['TXT_MEDIADIR_ALL_CATEGORIES'], 'TXT_' . $this->moduleLangVar . '_ALL_FORMS' => $_ARRAYLANG['TXT_MEDIADIR_ALL_FORMS'], $this->moduleLangVar . '_CATEGORIES_DROPDOWN_OPTIONS' => $catDropdown, $this->moduleLangVar . '_LEVELS_DROPDOWN_OPTIONS' => $levelDropdown, $this->moduleLangVar . '_FORMS_DROPDOWN_OPTIONS' => $formDropdown, 'TXT_' . $this->moduleLangVar . '_FORM' => $_ARRAYLANG['TXT_MEDIADIR_FORM'])); //get seting values parent::getSettings(); if ($this->arrSettings['settingsShowLevels'] == 1) { $this->_objTpl->touchBlock($this->moduleNameLC . 'LevelDropdown'); } else { $this->_objTpl->hideBlock($this->moduleNameLC . 'LevelDropdown'); } if (count($objForms->arrForms) > 1) { $this->_objTpl->touchBlock($this->moduleNameLC . 'FormDropdown'); } else { $this->_objTpl->hideBlock($this->moduleNameLC . 'FormDropdown'); } $objEntries = new MediaDirectoryEntry($this->moduleName); if (isset($_POST['submitEntriesOrderForm'])) { if ($objEntries->saveOrder($_POST)) { $this->strOkMessage = $_CORELANG['TXT_SETTINGS_UPDATED']; } 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'); } }
function settings_forms($objTpl) { global $_ARRAYLANG, $_CORELANG, $objDatabase, $_LANGID; switch ($_GET['tpl']) { case 'delete_form': if (!empty($_GET['id'])) { $objForms = new MediaDirectoryForm(null, $this->moduleName); $strStatus = $objForms->deleteForm(intval($_GET['id'])); if ($strStatus == true) { $this->strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_FORM_TEMPLATE'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_DELETED']; } else { $this->strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_FORM_TEMPLATE'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_DELETED']; } } break; } $objTpl->addBlockfile($this->moduleLangVar . '_SETTINGS_CONTENT', 'settings_content', 'module_' . $this->moduleNameLC . '_settings_forms.html'); $objTpl->setGlobalVariable(array('TXT_' . $this->moduleLangVar . '_NEW_FORM_TEMPLATE' => $_ARRAYLANG['TXT_MEDIADIR_NEW_FORM_TEMPLATE'], 'TXT_' . $this->moduleLangVar . '_STATUS' => $_CORELANG['TXT_STATUS'], 'TXT_' . $this->moduleLangVar . '_TITLE' => $_ARRAYLANG['TXT_MEDIADIR_TITLE'], 'TXT_' . $this->moduleLangVar . '_DESCRIPTION' => $_CORELANG['TXT_DESCRIPTION'], 'TXT_' . $this->moduleLangVar . '_ACTION' => $_CORELANG['TXT_HISTORY_ACTION'], 'TXT_' . $this->moduleLangVar . '_ORDER' => $_CORELANG['TXT_CORE_SORTING_ORDER'], 'TXT_' . $this->moduleLangVar . '_CONFIRM_DELETE_DATA' => $_ARRAYLANG['TXT_MEDIADIR_CONFIRM_DELETE_DATA'], 'TXT_' . $this->moduleLangVar . '_FORM_DEL_INFO' => $_ARRAYLANG['TXT_MEDIADIR_FORM_DEL_INFO'], 'TXT_' . $this->moduleLangVar . '_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_MEDIADIR_ACTION_IS_IRREVERSIBLE'], 'TXT_EDIT' => $_ARRAYLANG['TXT_MEDIADIR_EDIT'], 'TXT_DELETE' => $_ARRAYLANG['TXT_MEDIADIR_DELETE'], 'TXT_' . $this->moduleLangVar . '_SUBMIT' => $_ARRAYLANG['TXT_' . $this->moduleLangVar . '_SUBMIT'])); $objForms = new MediaDirectoryForm(null, $this->moduleName); $objForms->listForms($objTpl, 1, null); $objTpl->parse('settings_content'); }