/** * Returns a list of the languages * * @return string * @autoTestable * @permissions view */ protected function actionList() { $objArraySectionIterator = new class_array_section_iterator(class_module_languages_language::getNumberOfLanguagesAvailable()); $objArraySectionIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1)); $objArraySectionIterator->setArraySection(class_module_languages_language::getObjectList(false, $objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); return $this->renderList($objArraySectionIterator); }
/** * Returns a list of all categories and all faqs * The list can be filtered by categories * * @return string * @autoTestable * @permissions view */ protected function actionList() { $this->setStrCurObjectTypeName("Cat"); $this->setCurObjectClassName("class_module_faqs_cat"); $objIterator = new class_array_section_iterator(class_module_faqs_category::getObjectCount()); $objIterator->setIntElementsPerPage(class_module_faqs_category::getObjectCount()); $objIterator->setPageNumber(1); $objIterator->setArraySection(class_module_faqs_category::getObjectList("", $objIterator->calculateStartPos(), $objIterator->calculateEndPos())); $strReturn = $this->renderList($objIterator, false, class_module_faqs_admin::STR_CAT_LIST); $this->setStrCurObjectTypeName("Faq"); $this->setCurObjectClassName("class_module_faqs_faq"); $objIterator = new class_array_section_iterator(class_module_faqs_faq::getObjectCount($this->getParam("filterId"))); $objIterator->setPageNumber($this->getParam("pv")); $objIterator->setArraySection(class_module_faqs_faq::getObjectList($this->getParam("filterId"), $objIterator->calculateStartPos(), $objIterator->calculateEndPos())); $strReturn .= $this->renderList($objIterator, false, class_module_faqs_admin::STR_FAQ_LIST); return $strReturn; }
/** * Returns a list of all categories and all postacomment * The list could be filtered by categories * * @return string * @permissions view * @autoTestable */ protected function actionList() { //a small filter would be nice... $strReturn = $this->objToolkit->formHeader(getLinkAdminHref($this->arrModule["modul"], "list")); $arrPages = array(); $arrPages[""] = "---"; foreach (class_module_pages_page::getAllPages() as $objOnePage) { $arrPages[$objOnePage->getSystemid()] = $objOnePage->getStrName(); } $strReturn .= $this->objToolkit->formInputDropdown("filterId", $arrPages, $this->getLang("postacomment_filter"), $this->getParam("filterId")); $strReturn .= $this->objToolkit->formInputSubmit($this->getLang("postacomment_dofilter")); $strReturn .= $this->objToolkit->formClose(); $strReturn .= $this->objToolkit->divider(); $objArraySectionIterator = new class_array_section_iterator(class_module_postacomment_post::getNumberOfPostsAvailable(false, $this->getParam("filterId"))); $objArraySectionIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1)); $objArraySectionIterator->setArraySection(class_module_postacomment_post::loadPostList(false, $this->getParam("filterId"), false, "", $objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); $strReturn .= $this->renderList($objArraySectionIterator); return $strReturn; }
/** * Returns a list of the current level * * @return string * @autoTestable * @permissions view */ protected function actionList() { $strReturn = ""; //Decide, whether to return the list of navigation or the layer of a navigation if ($this->getSystemid() == "" || $this->getSystemid() == $this->getObjModule()->getSystemid()) { $objIterator = new class_array_section_iterator(class_module_navigation_tree::getObjectCount(class_module_system_module::getModuleIdByNr(_navigation_modul_id_))); $objIterator->setPageNumber($this->getParam("pv")); $objIterator->setArraySection(class_module_navigation_tree::getObjectList("", $objIterator->calculateStartPos(), $objIterator->calculateEndPos())); return $this->renderList($objIterator); } else { $objIterator = new class_array_section_iterator(class_module_navigation_point::getObjectCount($this->getSystemid())); $objIterator->setPageNumber($this->getParam("pv")); $objIterator->setArraySection(class_module_navigation_point::getNaviLayer($this->getSystemid(), false, $objIterator->calculateStartPos(), $objIterator->calculateEndPos())); $strReturn .= $this->renderList($objIterator, true, "naviPoints", true); if ($this->strPeAddon == "") { $strReturn = $this->generateTreeView($strReturn); } return $strReturn; } }
/** * Returns a list of all posts in the current gb * * @return string * @permissions view */ protected function actionList() { $strReturn = ""; $arrTemplate = array(); $arrTemplate["liste_posts"] = ""; //Load all posts $objArraySectionIterator = new class_array_section_iterator(class_module_guestbook_post::getPostsCount($this->arrElementData["guestbook_id"], true)); $objArraySectionIterator->setIntElementsPerPage($this->arrElementData["guestbook_amount"]); $objArraySectionIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1)); $objArraySectionIterator->setArraySection(class_module_guestbook_post::getPosts($this->arrElementData["guestbook_id"], true, $objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); $arrObjPosts = $this->objToolkit->simplePager($objArraySectionIterator, $this->getLang("commons_next"), $this->getLang("commons_back"), "", $this->getPagename()); //and put posts into a template /** @var class_module_guestbook_post $objOnePost */ foreach ($objArraySectionIterator as $objOnePost) { if ($objOnePost->rightView()) { $strTemplatePostID = $this->objTemplate->readTemplate("/module_guestbook/" . $this->arrElementData["guestbook_template"], "post"); $arrTemplatePost = array(); $arrTemplatePost["post_name"] = "<a href=\"mailto:" . $objOnePost->getStrGuestbookPostEmail() . "\">" . $objOnePost->getStrGuestbookPostName() . "</a>"; $arrTemplatePost["post_name_plain"] = $objOnePost->getStrGuestbookPostName(); $arrTemplatePost["post_email"] = $objOnePost->getStrGuestbookPostEmail(); $arrTemplatePost["post_page"] = "<a href=\"http://" . $objOnePost->getStrGuestbookPostPage() . "\">" . $objOnePost->getStrGuestbookPostPage() . "</a>"; //replace encoded newlines $arrTemplatePost["post_text"] = uniStrReplace("<br />", "<br />", $objOnePost->getStrGuestbookPostText()); $arrTemplatePost["post_date"] = timeToString($objOnePost->getIntGuestbookPostDate()); $arrTemplate["liste_posts"] .= $this->objTemplate->fillTemplate($arrTemplatePost, $strTemplatePostID, false); } } //link to the post-form & pageview links $arrTemplate["link_newentry"] = getLinkPortal($this->getParam("page") ? $this->getParam("page") : "", "", "", $this->getLang("eintragen"), "insertGuestbook"); $arrTemplate["link_forward"] = $arrObjPosts["strForward"]; $arrTemplate["link_pages"] = $arrObjPosts["strPages"]; $arrTemplate["link_back"] = $arrObjPosts["strBack"]; $strTemplateID = $this->objTemplate->readTemplate("/module_guestbook/" . $this->arrElementData["guestbook_template"], "list"); $strReturn .= $this->fillTemplate($arrTemplate, $strTemplateID); return $strReturn . ""; }
/** * Renders the list of favorites created by the current user * * @return string * @autoTestable * @permissions right1 */ protected function actionListFavorites() { $objArraySectionIterator = new class_array_section_iterator(class_module_tags_favorite::getNumberOfFavoritesForUser($this->objSession->getUserID())); $objArraySectionIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1)); $objArraySectionIterator->setArraySection(class_module_tags_favorite::getAllFavoritesForUser($this->objSession->getUserID(), $objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); return $this->renderList($objArraySectionIterator); }
/** * Show a log of all queries * * @return string * @permissions edit * @autoTestable */ protected function actionLogs() { $strReturn = ""; $intNrOfRecordsPerPage = 25; $objLog = new class_module_packageserver_log(); $objArraySectionIterator = new class_array_section_iterator($objLog->getLogDataCount()); $objArraySectionIterator->setIntElementsPerPage($intNrOfRecordsPerPage); $objArraySectionIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1)); $objArraySectionIterator->setArraySection($objLog->getLogData($objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); $arrLogs = array(); foreach ($objArraySectionIterator as $intKey => $arrOneLog) { $arrLogs[$intKey][0] = dateToString(new class_date($arrOneLog["log_date"])); $arrLogs[$intKey][1] = $arrOneLog["log_ip"]; $arrLogs[$intKey][2] = $arrOneLog["log_hostname"]; $arrLogs[$intKey][3] = $arrOneLog["log_query"]; } //Create a data-table $arrHeader = array(); $arrHeader[0] = $this->getLang("commons_date"); $arrHeader[1] = $this->getLang("header_ip"); $arrHeader[2] = $this->getLang("header_hostname"); $arrHeader[3] = $this->getLang("header_query"); $strReturn .= $this->objToolkit->dataTable($arrHeader, $arrLogs); $strReturn .= $this->objToolkit->getPageview($objArraySectionIterator, $this->getArrModule("modul"), "logs"); return $strReturn; }
/** * Returns a list of comments. * * @return string * @permissions view */ protected function actionList() { $strReturn = ""; $strPosts = ""; $strForm = ""; $strNewButton = ""; //pageid or systemid to filter? $strSystemidfilter = ""; $strPagefilter = $this->strPagefilter; if ($this->getSystemid() != "") { $strSystemidfilter = $this->getSystemid(); } if ($strPagefilter === null && class_module_pages_page::getPageByName($this->getPagename()) !== null) { $strPagefilter = class_module_pages_page::getPageByName($this->getPagename())->getSystemid(); } $intNrOfPosts = isset($this->arrElementData["int1"]) ? $this->arrElementData["int1"] : 0; //Load all posts $objArraySectionIterator = new class_array_section_iterator(class_module_postacomment_post::getNumberOfPostsAvailable(true, $strPagefilter, $strSystemidfilter, $this->getStrPortalLanguage())); $objArraySectionIterator->setIntElementsPerPage($intNrOfPosts); $objArraySectionIterator->setPageNumber((int) ($this->getParam("pvPAC") != "" ? $this->getParam("pvPAC") : 1)); $objArraySectionIterator->setArraySection(class_module_postacomment_post::loadPostList(true, $strPagefilter, $strSystemidfilter, $this->getStrPortalLanguage(), $objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); //params to add? $strAdd = ""; if ($this->getParam("action") != "") { $strAdd .= "&action=" . $this->getParam("action"); } if ($this->getParam("systemid") != "") { $strAdd .= "&systemid=" . $this->getParam("systemid"); } if ($this->getParam("pv") != "") { $strAdd .= "&pv=" . $this->getParam("pv"); } $arrComments = $this->objToolkit->simplePager($objArraySectionIterator, $this->getLang("commons_next"), $this->getLang("commons_back"), "", $this->getPagename(), $strAdd, "pvPAC"); $strTemplateID = $this->objTemplate->readTemplate("/module_postacomment/" . $this->arrElementData["char1"], "postacomment_post"); if (!$objArraySectionIterator->valid()) { $strPosts .= $this->getLang("postacomment_empty"); } //Check rights /** @var class_module_postacomment_post $objOnePost */ foreach ($objArraySectionIterator as $objOnePost) { if ($objOnePost->rightView()) { $strOnePost = ""; $arrOnePost = array(); $arrOnePost["postacomment_post_name"] = $objOnePost->getStrUsername(); $arrOnePost["postacomment_post_subject"] = $objOnePost->getStrTitle(); $arrOnePost["postacomment_post_message"] = $objOnePost->getStrComment(); $arrOnePost["postacomment_post_systemid"] = $objOnePost->getSystemid(); $arrOnePost["postacomment_post_date"] = timeToString($objOnePost->getIntDate(), true); //ratings available? if ($objOnePost->getFloatRating() !== null) { /** @var $objRating class_module_rating_portal */ $objRating = class_module_system_module::getModuleByName("rating")->getPortalInstanceOfConcreteModule(); $arrOnePost["postacomment_post_rating"] = $objRating->buildRatingBar($objOnePost->getFloatRating(), $objOnePost->getIntRatingHits(), $objOnePost->getSystemid(), $objOnePost->isRateableByUser(), $objOnePost->rightRight2()); } $strOnePost .= $this->objTemplate->fillTemplate($arrOnePost, $strTemplateID, false); //Add pe code $arrPeConfig = array("pe_module" => "postacomment", "pe_action_edit" => "edit", "pe_action_edit_params" => "&systemid=" . $objOnePost->getSystemid(), "pe_action_new" => "", "pe_action_new_params" => "", "pe_action_delete" => "delete", "pe_action_delete_params" => "&systemid=" . $objOnePost->getSystemid()); $strPosts .= class_element_portal::addPortalEditorCode($strOnePost, $objOnePost->getSystemid(), $arrPeConfig); } } //Create form if ($this->getObjModule()->rightRight1()) { $strTemplateID = $this->objTemplate->readTemplate("/module_postacomment/" . $this->arrElementData["char1"], "postacomment_form"); $arrForm = array(); if ($this->getParam("comment_name") == "" && $this->objSession->isLoggedin()) { $this->setParam("comment_name", $this->objSession->getUsername()); } $arrForm["formaction"] = class_link::getLinkPortalHref($this->getPagename(), "", "postComment", "", $this->getSystemid()); $arrForm["comment_name"] = $this->getParam("comment_name"); $arrForm["comment_subject"] = $this->getParam("comment_subject"); $arrForm["comment_message"] = $this->getParam("comment_message"); $arrForm["comment_template"] = $this->arrElementData["char1"]; $arrForm["comment_systemid"] = $this->getSystemid(); $arrForm["comment_page"] = $this->getPagename(); $arrForm["validation_errors"] = $this->strErrors; foreach ($arrForm as $strKey => $strValue) { if (uniStrpos($strKey, "comment_") !== false) { $arrForm[$strKey] = htmlspecialchars($strValue, ENT_QUOTES, "UTF-8", false); } } $strForm .= $this->objTemplate->fillTemplate($arrForm, $strTemplateID, false); //button to show the form $strTemplateNewButtonID = $this->objTemplate->readTemplate("/module_postacomment/" . $this->arrElementData["char1"], "postacomment_new_button"); $strNewButton = $this->objTemplate->fillTemplate(array("comment_systemid" => $this->getSystemid()), $strTemplateNewButtonID, false); } //add sourrounding list template $strTemplateID = $this->objTemplate->readTemplate("/module_postacomment/" . $this->arrElementData["char1"], "postacomment_list"); //link to the post-form & pageview links $arrTemplate = array(); $arrTemplate["postacomment_forward"] = $arrComments["strForward"]; $arrTemplate["postacomment_pages"] = $arrComments["strPages"]; $arrTemplate["postacomment_back"] = $arrComments["strBack"]; $arrTemplate["postacomment_form"] = $strForm; $arrTemplate["postacomment_new_button"] = $strNewButton; $arrTemplate["postacomment_systemid"] = $this->getSystemid(); $arrTemplate["postacomment_list"] = $strPosts; $strReturn .= $this->fillTemplate($arrTemplate, $strTemplateID); return $strReturn; }
/** * @return string * @autoTestable * @permissions view */ protected function actionListTemplates() { class_module_packagemanager_template::syncTemplatepacks(); $objArraySectionIterator = new class_array_section_iterator(class_module_packagemanager_template::getObjectCount()); $objArraySectionIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1)); $objArraySectionIterator->setArraySection(class_module_packagemanager_template::getObjectList("", $objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); return $this->renderList($objArraySectionIterator); }
/** * Renders the search form with results * * @permissions view * @return string * @autoTestable */ protected function actionSearch() { $strReturn = ""; $objSearch = new class_module_search_search($this->getParam("systemid")); $objForm = $this->getSearchAdminForm($objSearch); $objForm->updateSourceObject(); if ($this->getParam("filtermodules") != "") { $objSearch->setStrInternalFilterModules($this->getParam("filtermodules")); } if ($this->getParam("search_filter_all") != "") { $objSearch->setStrInternalFilterModules("-1"); } // Search Form $objForm = $this->getSearchAdminForm($objSearch); $strReturn .= $objForm->renderForm(class_link::getLinkAdminHref($this->getArrModule("modul"), "search"), class_admin_formgenerator::BIT_BUTTON_SUBMIT); // Execute Search $objSearchCommons = new class_module_search_commons(); $arrResult = $objSearchCommons->doAdminSearch($objSearch); $objArraySectionIterator = new class_array_section_iterator($objSearchCommons->getIndexedSearchCount($objSearch)); $objArraySectionIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1)); $objArraySectionIterator->setArraySection($objSearchCommons->doIndexedSearch($objSearch, $objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); //convert entries to real objects $arrObjects = array(); /** @var $objSearchResult class_search_result */ foreach ($arrResult as $objSearchResult) { $arrObjects[] = $objSearchResult->getObjObject(); } $objArraySectionIterator->setArrElements($arrObjects); $objArraySectionIterator->setArraySection($objArraySectionIterator->getElementsOnPage(1)); $strQueryAppend = "&filtermodules=" . $objSearch->getStrInternalFilterModules(); if ($objSearch->getObjChangeStartdate() != null) { $strQueryAppend .= "&search_changestartdate=" . $objSearch->getObjChangeStartdate()->getLongTimestamp(); } if ($objSearch->getObjChangeEnddate() != null) { $strQueryAppend .= "&search_changeenddate=" . $objSearch->getObjChangeEnddate()->getLongTimestamp(); } $strReturn .= $this->renderList($objArraySectionIterator, false, "searchResultList", false, "&search_query=" . $objSearch->getStrQuery() . $strQueryAppend); return $strReturn; }
/** * @return string */ public function getReport() { $strReturn = ""; //showing a list using the pageview $objArraySectionIterator = new class_array_section_iterator($this->getTopQueriesCount()); $objArraySectionIterator->setPageNumber((int) (getGet("pv") != "" ? getGet("pv") : 1)); $objArraySectionIterator->setArraySection($this->getTopQueries($objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); $intI = 0; $arrLogs = array(); $objUser = new class_module_user_user(class_session::getInstance()->getUserID()); foreach ($objArraySectionIterator as $intKey => $arrOneLog) { if ($intI++ >= $objUser->getIntItemsPerPage()) { break; } $arrLogs[$intKey][0] = $intI; $arrLogs[$intKey][1] = $arrOneLog["search_log_query"]; $arrLogs[$intKey][2] = $arrOneLog["hits"]; } //Create a data-table $arrHeader = array(); $arrHeader[0] = "#"; $arrHeader[1] = $this->objLang->getLang("header_query", "search"); $arrHeader[2] = $this->objLang->getLang("header_amount", "search"); $strReturn .= $this->objToolkit->dataTable($arrHeader, $arrLogs); $strReturn .= $this->objToolkit->getPageview($objArraySectionIterator, "stats", uniStrReplace("class_stats_report_", "", get_class($this))); return $strReturn; }
/** * Lists all handlers available to the system * * @return string * @autoTestable * @permissions right1 */ protected function actionListHandlers() { class_module_workflows_handler::synchronizeHandlerList(); $strReturn = $this->objToolkit->formHeadline($this->getLang("action_list_handlers")); $objIterator = new class_array_section_iterator(class_module_workflows_handler::getObjectCount()); $objIterator->setPageNumber($this->getParam("pv")); $objIterator->setArraySection(class_module_workflows_handler::getObjectList("", $objIterator->calculateStartPos(), $objIterator->calculateEndPos())); $strReturn .= $this->renderList($objIterator, false, self::STR_LIST_HANDLER); return $strReturn; }
/** * returns a list of the last logins * * @return string * @autoTestable * @permissions right1 */ protected function actionLoginLog() { $strReturn = ""; //fetch log-rows $objLogbook = new class_module_user_log(); $objIterator = new class_array_section_iterator($objLogbook->getLoginLogsCount()); $objIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1)); $objIterator->setArraySection(class_module_user_log::getLoginLogs($objIterator->calculateStartPos(), $objIterator->calculateEndPos())); $arrRows = array(); foreach ($objIterator as $arrLogRow) { $arrSingleRow = array(); $arrSingleRow[] = $arrLogRow["user_log_sessid"]; $arrSingleRow[] = $arrLogRow["user_username"] != "" ? $arrLogRow["user_username"] : $arrLogRow["user_log_userid"]; $arrSingleRow[] = dateToString(new class_date($arrLogRow["user_log_date"])); $arrSingleRow[] = $arrLogRow["user_log_enddate"] != "" ? dateToString(new class_date($arrLogRow["user_log_enddate"])) : ""; $arrSingleRow[] = $arrLogRow["user_log_status"] == 0 ? $this->getLang("login_status_0") : $this->getLang("login_status_1"); $arrSingleRow[] = $arrLogRow["user_log_ip"]; $strUtraceLinkMap = "href=\"http://www.utrace.de/ip-adresse/" . $arrLogRow["user_log_ip"] . "\" target=\"_blank\""; $strUtraceLinkText = "href=\"http://www.utrace.de/whois/" . $arrLogRow["user_log_ip"] . "\" target=\"_blank\""; if ($arrLogRow["user_log_ip"] != "127.0.0.1" && $arrLogRow["user_log_ip"] != "::1") { $arrSingleRow[] = $this->objToolkit->listButton(class_link::getLinkAdminManual($strUtraceLinkMap, "", $this->getLang("login_utrace_showmap"), "icon_earth")) . " " . $this->objToolkit->listButton(class_link::getLinkAdminManual($strUtraceLinkText, "", $this->getLang("login_utrace_showtext"), "icon_text")); } else { $arrSingleRow[] = $this->objToolkit->listButton(class_adminskin_helper::getAdminImage("icon_earthDisabled", $this->getLang("login_utrace_noinfo"))) . " " . $this->objToolkit->listButton(class_adminskin_helper::getAdminImage("icon_textDisabled", $this->getLang("login_utrace_noinfo"))); } $arrRows[] = $arrSingleRow; } //Building the surrounding table $arrHeader = array(); $arrHeader[] = $this->getLang("login_sessid"); $arrHeader[] = $this->getLang("login_user"); $arrHeader[] = $this->getLang("login_logindate"); $arrHeader[] = $this->getLang("login_logoutdate"); $arrHeader[] = $this->getLang("login_status"); $arrHeader[] = $this->getLang("login_ip"); $arrHeader[] = $this->getLang("login_utrace"); //and fetch the table $strReturn .= $this->objToolkit->dataTable($arrHeader, $arrRows); $strReturn .= $this->objToolkit->getPageview($objIterator, "user", "loginlog"); return $strReturn; }
/** * Returns a list of all categories and all news * The list could be filtered by categories * * @return string * @autoTestable * @permissions view */ protected function actionListNewsAndCategories() { $objIterator = new class_array_section_iterator(class_module_news_category::getObjectCount()); $objIterator->setIntElementsPerPage(class_module_news_category::getObjectCount()); $objIterator->setPageNumber(1); $objIterator->setArraySection(class_module_news_category::getObjectList("", $objIterator->calculateStartPos(), $objIterator->calculateEndPos())); $strReturn = $this->renderList($objIterator, false, class_module_news_admin::STR_CAT_LIST); $objIterator = new class_array_section_iterator(class_module_news_news::getObjectCount($this->getParam("filterId"))); $objIterator->setPageNumber($this->getParam("pv")); $objIterator->setArraySection(class_module_news_news::getObjectList($this->getParam("filterId"), $objIterator->calculateStartPos(), $objIterator->calculateEndPos())); $strReturn .= $this->renderList($objIterator, false, class_module_news_admin::STR_NEWS_LIST, false, "&filterId=" . $this->getParam("filterId")); return $strReturn; }
/** * Creates a list of thumbnails * * @return string * @permissions view */ protected function actionList() { $strReturn = ""; //Determin the prev_id to load if (!validateSystemid($this->getSystemid()) || !$this->checkIfRequestedIdIsInElementsTree()) { $this->setSystemid($this->arrElementData["repo_id"]); } $bitPageview = true; if ($this->arrElementData["repo_elementsperpage"] <= 0) { $this->arrElementData["repo_elementsperpage"] = $this->getNumberOfEntriesOnLevel(); $bitPageview = false; } $objArraySectionIterator = new class_array_section_iterator($this->getNumberOfEntriesOnLevel()); $objArraySectionIterator->setIntElementsPerPage($this->arrElementData["repo_elementsperpage"]); $objArraySectionIterator->setPageNumber($this->getParam("pv")); $objArraySectionIterator->setArraySection($this->getArrFiles($objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); $arrPagerContent = $this->objToolkit->simplePager($objArraySectionIterator, $this->getLang("commons_next"), $this->getLang("commons_back"), $this->getParam("action"), $this->getPagename(), "&systemid=" . $this->getSystemid(), "pv", "/module_mediamanager/" . $this->arrElementData["repo_template"]); //Loop over every item and collect them $arrWrappingTemplate = array(); $arrWrappingTemplate["systemid"] = $this->arrElementData["content_id"]; $arrWrappingTemplate["folderlist"] = ""; $arrWrappingTemplate["filelist"] = ""; if ($objArraySectionIterator->getNumberOfElements() == 0) { $strReturn = $this->getLang("commons_list_empty"); } $intFileCounter = 0; $arrRemainingFiles = array(); //calc number of images outside the loop $intNrOfFilesPerRow = $this->getFilesPerRow($this->arrElementData["repo_template"]); /** @var class_module_mediamanager_file $objOneFile */ foreach ($objArraySectionIterator as $objOneFile) { //Check rights and the existance of placeholders if ($intNrOfFilesPerRow > 0 && $objOneFile->rightView()) { //Folder or file? //file if ($objOneFile->getIntType() == class_module_mediamanager_file::$INT_TYPE_FILE) { $arrWrappingTemplate["filelist"] .= $this->renderFileListEntry($objOneFile, $intFileCounter++, $intNrOfFilesPerRow, $arrRemainingFiles); } //Folder if ($objOneFile->getIntType() == class_module_mediamanager_file::$INT_TYPE_FOLDER) { $arrWrappingTemplate["folderlist"] .= $this->renderFolderListEntry($objOneFile); } } } //Print remaining files if (count($arrRemainingFiles) > 0) { $strTemplateID = $this->objTemplate->readTemplate("/module_mediamanager/" . $this->arrElementData["repo_template"], "filelist"); $arrWrappingTemplate["filelist"] .= $this->objTemplate->fillTemplate($arrRemainingFiles, $strTemplateID, false); } //and load the sourrounding template if ($bitPageview) { $arrWrappingTemplate["link_forward"] = $arrPagerContent["strForward"]; $arrWrappingTemplate["link_pages"] = $arrPagerContent["strPages"]; $arrWrappingTemplate["link_back"] = $arrPagerContent["strBack"]; } $strTemplateID = $this->objTemplate->readTemplate("/module_mediamanager/" . $this->arrElementData["repo_template"], "list"); $arrWrappingTemplate["pathnavigation"] = $this->generatePathnavi(); $strReturn .= $this->fillTemplate($arrWrappingTemplate, $strTemplateID); $strReturn = $this->addPortaleditorCode($strReturn); return $strReturn; }
/** * Returns a list of all installed Elements * * @return string * @autoTestable * @permissions right1 */ protected function actionListElements() { $strReturn = ""; $objArraySectionIterator = new class_array_section_iterator(class_module_pages_element::getObjectCount()); $objArraySectionIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1)); $objArraySectionIterator->setArraySection(class_module_pages_element::getObjectList("", $objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); $strReturn .= $this->renderList($objArraySectionIterator, false, class_module_pages_admin::STR_LIST_ELEMENTS); return $strReturn; }
/** * Renders the list of aspects available * * @return string * @autoTestable * @permissions right5 */ protected function actionAspects() { $objIterator = new class_array_section_iterator(class_module_system_aspect::getObjectCount()); $objIterator->setPageNumber($this->getParam("pv")); $objIterator->setArraySection(class_module_system_aspect::getObjectList("", $objIterator->calculateStartPos(), $objIterator->calculateEndPos())); return $this->renderList($objIterator, false, "aspectList"); }
/** * Renders the general list of records * * @throws class_exception * @return string * @permissions view */ protected function actionList() { /** @var $strType interface_model|class_model */ $strType = $this->getCurObjectClassName(); if (!is_null($strType)) { $objArraySectionIterator = new class_array_section_iterator($strType::getObjectCount($this->getSystemid())); $objArraySectionIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1)); $objArraySectionIterator->setArraySection($strType::getObjectList($this->getSystemid(), $objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); //pass the internal action in order to get a proper paging $strOriginalAction = $this->getAction(); $this->setAction($this->strOriginalAction); $strList = $this->renderList($objArraySectionIterator, false, "list" . $this->getStrCurObjectTypeName()); $this->setAction($strOriginalAction); return $strList; } else { throw new class_exception("error loading list current object type not known ", class_exception::$level_ERROR); } }
/** * Show a logbook of all downloads * * @return string * @permissions edit * @autoTestable */ protected function actionLogbook() { $strReturn = ""; $intNrOfRecordsPerPage = 25; $strReturn .= $this->objToolkit->getTextRow(class_link::getLinkAdmin($this->getArrModule("modul"), "logbookFlush", "", $this->getLang("action_logbook_flush"), "") . "<br />"); $objLogbook = new class_module_mediamanager_logbook(); $objArraySectionIterator = new class_array_section_iterator($objLogbook->getLogbookDataCount()); $objArraySectionIterator->setIntElementsPerPage($intNrOfRecordsPerPage); $objArraySectionIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1)); $objArraySectionIterator->setArraySection($objLogbook->getLogbookData($objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); $arrLogs = array(); foreach ($objArraySectionIterator as $intKey => $arrOneLog) { $arrLogs[$intKey][0] = $arrOneLog["downloads_log_id"]; $arrLogs[$intKey][1] = timeToString($arrOneLog["downloads_log_date"]); $arrLogs[$intKey][2] = $arrOneLog["downloads_log_file"]; $arrLogs[$intKey][3] = $arrOneLog["downloads_log_user"]; $arrLogs[$intKey][4] = $arrOneLog["downloads_log_ip"]; $strUtraceLinkMap = "href=\"http://www.utrace.de/ip-adresse/" . $arrOneLog["downloads_log_ip"] . "\" target=\"_blank\""; $strUtraceLinkText = "href=\"http://www.utrace.de/whois/" . $arrOneLog["downloads_log_ip"] . "\" target=\"_blank\""; if ($arrOneLog["downloads_log_ip"] != "127.0.0.1" && $arrOneLog["downloads_log_ip"] != "::1") { $arrLogs[$intKey][5] = class_link::getLinkAdminManual($strUtraceLinkMap, "", $this->getLang("login_utrace_showmap", "user"), "icon_earth") . " " . class_link::getLinkAdminManual($strUtraceLinkText, "", $this->getLang("login_utrace_showtext", "user"), "icon_text"); } else { $arrLogs[$intKey][5] = class_adminskin_helper::getAdminImage("icon_earthDisabled", $this->getLang("login_utrace_noinfo", "user")) . " " . class_adminskin_helper::getAdminImage("icon_textDisabled", $this->getLang("login_utrace_noinfo", "user")); } } //Create a data-table $arrHeader = array(); $arrHeader[0] = $this->getLang("header_id"); $arrHeader[1] = $this->getLang("commons_date"); $arrHeader[2] = $this->getLang("header_file"); $arrHeader[3] = $this->getLang("header_user"); $arrHeader[4] = $this->getLang("header_ip"); $arrHeader[5] = $this->getLang("login_utrace", "user"); $strReturn .= $this->objToolkit->dataTable($arrHeader, $arrLogs); $strReturn .= $this->objToolkit->getPageview($objArraySectionIterator, $this->getArrModule("modul"), "logbook"); return $strReturn; }
/** * Returns a list of news. * As defined in the element, this could be an archive or a normal list * * @return string */ protected function actionNewsList() { $strReturn = ""; //Load news using the correct filter if ($this->getParam("filterid") != "") { $strFilterId = $this->getParam("filterid"); } else { $strFilterId = $this->arrElementData["news_category"]; } $strPageview = 1; if ($this->getParam("pv") != 1 && $this->getSystemid() == $this->arrElementData["content_id"]) { $strPageview = $this->getParam("pv"); } //Load all posts $objArraySectionIterator = new class_array_section_iterator(class_module_news_news::getNewsCountPortal($this->arrElementData["news_mode"], $strFilterId)); $objArraySectionIterator->setIntElementsPerPage($this->arrElementData["news_amount"]); $objArraySectionIterator->setPageNumber((int) $strPageview); $objArraySectionIterator->setArraySection(class_module_news_news::loadListNewsPortal($this->arrElementData["news_mode"], $strFilterId, $this->arrElementData["news_order"], $objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); $arrNews = $this->objToolkit->simplePager($objArraySectionIterator, $this->getLang("commons_next"), $this->getLang("commons_back"), "", $this->getPagename(), "&systemid=" . $this->arrElementData["content_id"], "pv", "/module_news/" . $this->arrElementData["news_template"]); //Check rights if (!$objArraySectionIterator->valid()) { $strReturn .= $this->getLang("news_list_empty"); } foreach ($objArraySectionIterator as $objOneNews) { /** @var $objOneNews class_module_news_news */ if ($objOneNews instanceof class_module_news_news && $objOneNews->rightView()) { $objMapper = new class_template_mapper($objOneNews); //generate a link to the details $objMapper->addPlaceholder("news_more_link", class_link::getLinkPortal($this->arrElementData["news_detailspage"], "", "", $this->getLang("news_mehr"), "newsDetail", "", $objOneNews->getSystemid(), "", "", $objOneNews->getStrTitle())); $objMapper->addPlaceholder("news_more_link_href", class_link::getLinkPortalHref($this->arrElementData["news_detailspage"], "", "newsDetail", "", $objOneNews->getSystemid(), "", $objOneNews->getStrTitle())); $objMapper->addPlaceholder("news_start_date", dateToString($objOneNews->getObjStartDate(), false)); $objMapper->addPlaceholder("news_id", $objOneNews->getSystemid()); $objMapper->addPlaceholder("news_title", $objOneNews->getStrTitle()); $objMapper->addPlaceholder("news_intro", $objOneNews->getStrIntro()); $objMapper->addPlaceholder("news_text", $objOneNews->getStrText()); //reset more link? -> no text, no image and no redirect page if (uniStrlen(htmlStripTags($objOneNews->getStrText())) == 0 && uniStrlen($objOneNews->getStrImage()) == 0 && ($objOneNews->getIntRedirectEnabled() == "0" || $objOneNews->getStrRedirectPage() == "")) { $objMapper->addPlaceholder("news_more_link", ""); } //postacomment $arrPAC = $this->loadPostacomments($objOneNews->getSystemid(), $objOneNews->getStrImage() != "" ? "news_list_image" : "news_list"); if ($arrPAC != null) { $objMapper->addPlaceholder("news_nrofcomments", $arrPAC["nrOfComments"]); $objMapper->addPlaceholder("news_commentlist", $arrPAC["commentList"]); } //ratings if ($objOneNews->getFloatRating() !== null) { /** @var $objRating class_module_rating_portal */ $objRating = class_module_system_module::getModuleByName("rating")->getPortalInstanceOfConcreteModule(); $objMapper->addPlaceholder("news_rating", $objRating->buildRatingBar($objOneNews->getFloatRating(), $objOneNews->getIntRatingHits(), $objOneNews->getSystemid(), $objOneNews->isRateableByUser(), $objOneNews->rightRight3())); } //categories $objMapper->addPlaceholder("news_categories", $this->renderCategoryTitles($objOneNews)); //load template section with or without image? if ($objOneNews->getStrImage() != "") { $objMapper->addPlaceholder("news_image", urlencode($objOneNews->getStrImage())); $strOneNews = $objMapper->writeToTemplate("/module_news/" . $this->arrElementData["news_template"], "news_list_image"); } else { $strOneNews = $objMapper->writeToTemplate("/module_news/" . $this->arrElementData["news_template"], "news_list"); } //Add pe code $arrPeConfig = array("pe_module" => "news", "pe_action_edit" => "editNews", "pe_action_edit_params" => "&systemid=" . $objOneNews->getSystemid(), "pe_action_new" => "newNews", "pe_action_new_params" => "", "pe_action_delete" => "delete", "pe_action_delete_params" => "&systemid=" . $objOneNews->getSystemid()); $strReturn .= class_element_portal::addPortalEditorCode($strOneNews, $objOneNews->getSystemid(), $arrPeConfig); } } $arrWrapperTemplate = array(); $arrWrapperTemplate["news"] = $strReturn; $arrWrapperTemplate["link_forward"] = $arrNews["strForward"]; $arrWrapperTemplate["link_pages"] = $arrNews["strPages"]; $arrWrapperTemplate["link_back"] = $arrNews["strBack"]; $strReturn = $this->fillTemplate($arrWrapperTemplate, $this->objTemplate->readTemplate("/module_news/" . $this->arrElementData["news_template"], "news_list_wrapper")); return $strReturn; }