function __construct($arrRemoteResponse, $intPageNumber, $intStart, $intEnd, $strProviderName, $strPagerAddon)
 {
     $intNumberOfTotalItems = (int) $arrRemoteResponse['numberOfTotalItems'];
     $arrPackages = $arrRemoteResponse['items'];
     $objIterator = new class_array_section_iterator($intNumberOfTotalItems);
     $objIterator->setPageNumber($intPageNumber);
     $objIterator->setArraySection($arrPackages, $intStart, $intEnd);
     $objToolkit = class_carrier::getInstance()->getObjToolkit("admin");
     $this->arrPageViews["pageview"] = $objToolkit->getPageview($objIterator, "packagemanager", "addPackage", "&provider=" . $strProviderName . $strPagerAddon);
     $this->arrPageViews["elements"] = array();
     foreach ($objIterator as $objOneEntry) {
         $this->arrPageViews["elements"][] = $objOneEntry;
     }
 }
 /**
  * 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("&lt;br /&gt;", "<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 . "";
 }
 /**
  * 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
  */
 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;
 }
 /**
  * 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;
 }
 /**
  * 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;
 }
 /**
  * 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;
 }
 /**
  * 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);
     }
 }
 /**
  * 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);
 }
 /**
  * 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;
 }
示例#15
0
 /**
  * Creates a forward / backward pager out of the passed array
  *
  * @param class_array_section_iterator $objArraySectionIterator
  * @param string $strForward text for the forwardlink
  * @param string $strBack text for the backwardslink
  * @param string $strAction action on the targetpage
  * @param string $strPage title of the targetpage
  * @param string $strAdd additional params
  * @param string $strPvParam the param used to create the pagenumber-entries
  * @param string $strTemplate if passed, the pager will render all links using the passed template (if the sections are present). Expected sections: pager_fwd, pager_back, pager_entry, pager_entry_active
  *
  * @return mixed array containing the created data:
  *                         return => [strForward] = link to the next page
  *                                   [strBack]    = link to the previous page
  *                                   [strPages] = Pager ( [0][1] ...)
  */
 public function simplePager($objArraySectionIterator, $strForward = "next", $strBack = "back", $strAction = "list", $strPage = "", $strAdd = "", $strPvParam = "pv", $strTemplate = "")
 {
     $arrReturn = array("arrData" => array(), "strForward" => "", "strBack" => "", "strPages" => "");
     //read the template-sections, of given
     $bitTemplate = false;
     $strFwdId = "";
     $strBackId = "";
     $strEntryId = "";
     $strEntryActiveId = "";
     if ($strTemplate != "") {
         $strTemplateIdentifier = $this->objTemplate->readTemplate($strTemplate);
         $bitTemplate = $this->objTemplate->containsSection($strTemplateIdentifier, "pager_fwd") && $this->objTemplate->containsSection($strTemplateIdentifier, "pager_back") && $this->objTemplate->containsSection($strTemplateIdentifier, "pager_entry") && $this->objTemplate->containsSection($strTemplateIdentifier, "pager_entry_active");
         $strFwdId = $this->objTemplate->readTemplate($strTemplate, "pager_fwd");
         $strBackId = $this->objTemplate->readTemplate($strTemplate, "pager_back");
         $strEntryId = $this->objTemplate->readTemplate($strTemplate, "pager_entry");
         $strEntryActiveId = $this->objTemplate->readTemplate($strTemplate, "pager_entry_active");
     }
     $strLinkPages = "";
     $strLinkForward = "";
     $strLinkBack = "";
     $arrReturn["arrData"] = array();
     $intPage = $objArraySectionIterator->getPageNumber();
     //FowardLink
     if ($intPage < $objArraySectionIterator->getNrOfPages()) {
         if ($bitTemplate) {
             $strLinkForward = $this->objTemplate->fillTemplate(array("pageHref" => class_link::getLinkPortalHref($strPage, "", $strAction, "&" . $strPvParam . "=" . ($intPage + 1) . $strAdd)), $strFwdId);
         } else {
             $strLinkForward = class_link::getLinkPortal($strPage, "", null, $strForward, $strAction, "&" . $strPvParam . "=" . ($intPage + 1) . $strAdd);
         }
     }
     //BackLink
     if ($intPage > 1) {
         if ($bitTemplate) {
             $strLinkBack = $this->objTemplate->fillTemplate(array("pageHref" => class_link::getLinkPortalHref($strPage, "", $strAction, "&" . $strPvParam . "=" . ($intPage - 1) . $strAdd)), $strBackId);
         } else {
             $strLinkBack = class_link::getLinkPortal($strPage, "", null, $strBack, $strAction, "&" . $strPvParam . "=" . ($intPage - 1) . $strAdd);
         }
     }
     //just load the current +-6 pages and the first/last +-3
     $intCounter2 = 1;
     for ($intI = 1; $intI <= $objArraySectionIterator->getNrOfPages(); $intI++) {
         $bitDisplay = false;
         if ($intCounter2 <= 3) {
             $bitDisplay = true;
         } elseif ($intCounter2 >= $objArraySectionIterator->getNrOfPages() - 3) {
             $bitDisplay = true;
         } elseif ($intCounter2 >= $intPage - 6 && $intCounter2 <= $intPage + 6) {
             $bitDisplay = true;
         }
         if ($bitDisplay) {
             if ($bitTemplate) {
                 if ($intI == $intPage) {
                     $strLinkPages .= $this->objTemplate->fillTemplate(array("pageHref" => class_link::getLinkPortalHref($strPage, "", $strAction, "&" . $strPvParam . "=" . $intI . $strAdd), "pageNumber" => $intI), $strEntryActiveId);
                 } else {
                     $strLinkPages .= $this->objTemplate->fillTemplate(array("pageHref" => class_link::getLinkPortalHref($strPage, "", $strAction, "&" . $strPvParam . "=" . $intI . $strAdd), "pageNumber" => $intI), $strEntryId);
                 }
             } else {
                 if ($intI == $intPage) {
                     $strLinkPages .= "  <strong>" . class_link::getLinkPortal($strPage, "", null, "[" . $intI . "]", $strAction, "&" . $strPvParam . "=" . $intI . $strAdd) . "</strong>";
                 } else {
                     $strLinkPages .= "  " . class_link::getLinkPortal($strPage, "", null, "[" . $intI . "]", $strAction, "&" . $strPvParam . "=" . $intI . $strAdd);
                 }
             }
         }
         $intCounter2++;
     }
     if ($objArraySectionIterator->getNrOfPages() > 1) {
         $arrReturn["strForward"] = $strLinkForward;
         $arrReturn["strBack"] = $strLinkBack;
         $arrReturn["strPages"] = $strLinkPages;
     }
     return $arrReturn;
 }
 /**
  * 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;
 }
示例#17
0
 /**
  * Creates a pageview
  *
  * @param class_array_section_iterator $objArraySectionIterator
  * @param string $strModule
  * @param string $strAction
  * @param string $strLinkAdd
  *
  * @return mixed a two-dimensional array: ["elements"] and ["pageview"]
  * @since 3.3.0
  *
  * @deprecated use getPageview instead
  */
 public function getSimplePageview($objArraySectionIterator, $strModule, $strAction, $strLinkAdd = "")
 {
     $arrReturn = array();
     $intCurrentpage = $objArraySectionIterator->getPageNumber();
     $intNrOfPages = $objArraySectionIterator->getNrOfPages();
     $intNrOfElements = $objArraySectionIterator->getNumberOfElements();
     $arrReturn["elements"] = array();
     //read templates
     $strTemplateBodyID = $this->objTemplate->readTemplate("/elements.tpl", "pageview_body");
     $strTemplateForwardID = $this->objTemplate->readTemplate("/elements.tpl", "pageview_link_forward");
     $strTemplateBackwardID = $this->objTemplate->readTemplate("/elements.tpl", "pageview_link_backward");
     $strTemplateListID = $this->objTemplate->readTemplate("/elements.tpl", "pageview_page_list");
     $strTemplateListItemActiveID = $this->objTemplate->readTemplate("/elements.tpl", "pageview_list_item_active");
     $strTemplateListItemID = $this->objTemplate->readTemplate("/elements.tpl", "pageview_list_item");
     //build layout
     $arrTemplate = array();
     $strListItems = "";
     //just load the current +-4 pages and the first/last +-2
     $intCounter2 = 1;
     for ($intI = 1; $intI <= $intNrOfPages; $intI++) {
         $bitDisplay = false;
         if ($intCounter2 <= 2) {
             $bitDisplay = true;
         } elseif ($intCounter2 >= $intNrOfPages - 1) {
             $bitDisplay = true;
         } elseif ($intCounter2 >= $intCurrentpage - 2 && $intCounter2 <= $intCurrentpage + 2) {
             $bitDisplay = true;
         }
         if ($bitDisplay) {
             $arrLinkTemplate = array();
             $arrLinkTemplate["href"] = class_link::getLinkAdminHref($strModule, $strAction, $strLinkAdd . "&pv=" . $intI);
             $arrLinkTemplate["pageNr"] = $intI;
             if ($intI == $intCurrentpage) {
                 $strListItems .= $this->objTemplate->fillTemplate($arrLinkTemplate, $strTemplateListItemActiveID);
             } else {
                 $strListItems .= $this->objTemplate->fillTemplate($arrLinkTemplate, $strTemplateListItemID);
             }
         }
         $intCounter2++;
     }
     $arrTemplate["pageList"] = $this->objTemplate->fillTemplate(array("pageListItems" => $strListItems), $strTemplateListID);
     $arrTemplate["nrOfElementsText"] = class_carrier::getInstance()->getObjLang()->getLang("pageview_total", "system");
     $arrTemplate["nrOfElements"] = $intNrOfElements;
     if ($intCurrentpage < $intNrOfPages) {
         $arrTemplate["linkForward"] = $this->objTemplate->fillTemplate(array("linkText" => class_carrier::getInstance()->getObjLang()->getLang("pageview_forward", "system"), "href" => class_link::getLinkAdminHref($strModule, $strAction, $strLinkAdd . "&pv=" . ($intCurrentpage + 1))), $strTemplateForwardID);
     }
     if ($intCurrentpage > 1) {
         $arrTemplate["linkBackward"] = $this->objTemplate->fillTemplate(array("linkText" => class_carrier::getInstance()->getObjLang()->getLang("commons_back", "commons"), "href" => class_link::getLinkAdminHref($strModule, $strAction, $strLinkAdd . "&pv=" . ($intCurrentpage - 1))), $strTemplateBackwardID);
     }
     $arrReturn["pageview"] = $this->objTemplate->fillTemplate($arrTemplate, $strTemplateBodyID);
     $arrReturn["elements"] = $objArraySectionIterator->getArrayExtended(true);
     return $arrReturn;
 }
 /**
  * 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;
 }
 /**
  * @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);
 }
示例#21
0
 /**
  * Renders a list of items, target is the common admin-list.
  * Please be aware, that the combination of paging and sortable-lists may result in unpredictable ordering.
  * As soon as the list is sortable, the page-size should be at least the same as the number of elements. Optional
  * it is possible to provide a filter callback which is called for each entry. If the callback returns false the
  * entry gets skipped.
  *
  * @param class_array_section_iterator $objArraySectionIterator
  * @param bool $bitSortable
  * @param string $strListIdentifier an internal identifier to check the current parent-list
  * @param bool $bitAllowTreeDrop
  * @param string $strPagerAddon
  * @param Closure $objFilter
  *
  * @throws class_exception
  * @return string
  */
 protected final function renderList(class_array_section_iterator $objArraySectionIterator, $bitSortable = false, $strListIdentifier = "", $bitAllowTreeDrop = false, $strPagerAddon = "", Closure $objFilter = null)
 {
     $strReturn = "";
     $intI = 0;
     $strListId = generateSystemid();
     if (!$objArraySectionIterator->valid()) {
         $strReturn .= $this->objToolkit->getTextRow($this->getLang("commons_list_empty"));
     }
     if ($bitSortable) {
         $strReturn .= $this->objToolkit->dragableListHeader($strListId, false, $bitAllowTreeDrop, $objArraySectionIterator->getIntElementsPerPage(), $objArraySectionIterator->getPageNumber());
     } else {
         $strReturn .= $this->objToolkit->listHeader();
     }
     if ($this->renderLevelUpAction($strListIdentifier) != "") {
         $strReturn .= $this->objToolkit->genericAdminList("", "", "", $this->objToolkit->listButton($this->renderLevelUpAction($strListIdentifier)), $intI++);
     }
     $arrMassActions = $this->getBatchActionHandlers($strListIdentifier);
     $intTotalNrOfElements = $objArraySectionIterator->getNumberOfElements();
     /** @var $objOneIterable class_model|interface_model|interface_admin_listable */
     foreach ($objArraySectionIterator as $objOneIterable) {
         // if we have a filter Closure call it else use the standard rightView method
         if ($objFilter !== null) {
             if ($objFilter($objOneIterable) === false) {
                 if ($bitSortable) {
                     //inject hidden dummy row for a proper sorting
                     $strReturn .= $this->objToolkit->genericAdminList($objOneIterable->getSystemid(), "", "", "", 0, "", "", false, "hidden");
                 }
                 $intTotalNrOfElements--;
                 continue;
             }
         } else {
             if (!$objOneIterable->rightView()) {
                 if ($bitSortable) {
                     //inject hidden dummy row for a proper sorting
                     $strReturn .= $this->objToolkit->genericAdminList($objOneIterable->getSystemid(), "", "", "", 0, "", "", false, "hidden");
                 }
                 $intTotalNrOfElements--;
                 continue;
             }
         }
         $strActions = $this->getActionIcons($objOneIterable, $strListIdentifier);
         $strReturn .= $this->objToolkit->simpleAdminList($objOneIterable, $strActions, $intI++, count($arrMassActions) > 0);
     }
     $strNewActions = $this->mergeNewEntryActions($this->getNewEntryAction($strListIdentifier));
     $strBatchActions = "";
     if (count($arrMassActions) > 0) {
         $strBatchActions .= $this->objToolkit->renderBatchActionHandlers($arrMassActions);
     }
     if ($strNewActions != "" || $strBatchActions != "") {
         $strReturn .= $this->objToolkit->genericAdminList("batchActionSwitch", $strBatchActions, "", $strNewActions, $intI, "", "", $strBatchActions != "");
     }
     if ($bitSortable) {
         $strReturn .= $this->objToolkit->dragableListFooter($strListId);
     } else {
         $strReturn .= $this->objToolkit->listFooter();
     }
     $objArraySectionIterator->setIntTotalElements($intTotalNrOfElements);
     $strReturn .= $this->objToolkit->getPageview($objArraySectionIterator, $this->getArrModule("modul"), $this->getAction(), "&systemid=" . $this->getSystemid() . $this->strPeAddon . $strPagerAddon);
     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;
 }
 /**
  * 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;
 }
 /**
  * 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");
 }