/**
  * @param $strSearchterm
  * @param class_search_result[] $arrResults
  *
  * @return string
  */
 private function createSearchXML($strSearchterm, $arrResults)
 {
     $strReturn = "";
     $strReturn .= "<search>\n" . "    <searchterm>" . xmlSafeString($strSearchterm) . "</searchterm>\n" . "    <nrofresults>" . count($arrResults) . "</nrofresults>\n";
     //And now all results
     $intI = 0;
     $strReturn .= "    <resultset>\n";
     foreach ($arrResults as $objOneResult) {
         $objPage = class_module_pages_page::getPageByName($objOneResult->getStrPagename());
         if ($objPage === null || !$objPage->rightView() || $objPage->getIntRecordStatus() != 1) {
             continue;
         }
         if (++$intI > self::$INT_MAX_NR_OF_RESULTS) {
             break;
         }
         //create a correct link
         if ($objOneResult->getStrPagelink() == "") {
             $objOneResult->setStrPagelink(getLinkPortal($objOneResult->getStrPagename(), "", "_self", $objOneResult->getStrPagename(), "", "&highlight=" . $strSearchterm . "#" . $strSearchterm));
         }
         $strReturn .= "        <item>\n" . "            <pagename>" . $objOneResult->getStrPagename() . "</pagename>\n" . "            <pagelink>" . $objOneResult->getStrPagelink() . "</pagelink>\n" . "            <score>" . $objOneResult->getIntHits() . "</score>\n" . "            <description>" . xmlSafeString(uniStrTrim($objOneResult->getStrDescription(), 200)) . "</description>\n" . "        </item>\n";
     }
     $strReturn .= "    </resultset>\n";
     $strReturn .= "</search>";
     return $strReturn;
 }
 /**
  * Processes the internal change-array and creates all related records.
  *
  * @param array $arrChanges
  * @param interface_versionable|class_model $objSourceModel
  * @param string $strAction
  * @param bool $bitForceEntry
  * @param bool $bitDeleteAction
  *
  * @return bool
  */
 private function processChangeArray(array $arrChanges, interface_versionable $objSourceModel, $strAction, $bitForceEntry = false, $bitDeleteAction = null)
 {
     $bitReturn = true;
     if (is_array($arrChanges)) {
         $arrReducedChanges = array();
         $this->createReducedChangeSet($arrReducedChanges, $arrChanges, $strAction, $bitForceEntry, $bitDeleteAction);
         //collect all values in order to create a batch query
         foreach ($arrReducedChanges as $arrChangeSet) {
             $strOldvalue = $arrChangeSet["oldvalue"];
             $strNewvalue = $arrChangeSet["newvalue"];
             $strProperty = $arrChangeSet["property"];
             class_logger::getInstance()->addLogRow("change in class " . get_class($objSourceModel) . "@" . $strAction . " systemid: " . $objSourceModel->getSystemid() . " property: " . $strProperty . " old value: " . uniStrTrim($strOldvalue, 60) . " new value: " . uniStrTrim($strNewvalue, 60), class_logger::$levelInfo);
             $arrValues = array(generateSystemid(), class_date::getCurrentTimestamp(), $objSourceModel->getSystemid(), $objSourceModel->getPrevid(), class_carrier::getInstance()->getObjSession()->getUserID(), get_class($objSourceModel), $strAction, $strProperty, $strOldvalue, $strNewvalue);
             self::$arrInsertCache[self::getTableForClass(get_class($objSourceModel))][] = $arrValues;
         }
     }
     return $bitReturn;
 }
 /**
  * Returns an abstract of the current element
  *
  * @return string
  */
 public function getContentTitle()
 {
     $this->loadElementData();
     if ($this->getStrTitle() != "") {
         return htmlStripTags($this->getStrTitle());
     } else {
         if ($this->getStrTextContent() != "") {
             return uniStrTrim(htmlStripTags($this->getStrTextContent()), 120);
         } else {
             return parent::getContentTitle();
         }
     }
 }
 /**
  * Calls the single search-functions, sorts the results an creates the output
  *
  * @return string
  * @permissions view
  */
 protected function actionSearch()
 {
     $strReturn = "";
     //Read the config
     $arrTemplate = array();
     $arrTemplate["hitlist"] = "";
     $strReturn .= $this->actionList();
     $objSearchCommons = new class_module_search_commons();
     $this->objSearchSearch->setBitPortalObjectFilter(true);
     $this->objSearchSearch->setStrPortalLangFilter($this->getStrPortalLanguage());
     /** @var $arrHitsSorted class_search_result[] */
     $arrHitsSorted = $objSearchCommons->doPortalSearch($this->objSearchSearch);
     //Resize Array to wanted size
     $arrHitsFilter = $this->objToolkit->pager($this->arrElementData["search_amount"], $this->getParam("pv") != "" ? (int) $this->getParam("pv") : 1, $this->getLang("commons_next"), $this->getLang("commons_back"), "search", $this->arrElementData["search_page"] != "" ? $this->arrElementData["search_page"] : $this->getPagename(), $arrHitsSorted, "&searchterm=" . urlencode(html_entity_decode($this->objSearchSearch->getStrQuery(), ENT_COMPAT, "UTF-8")));
     $strRowTemplateID = $this->objTemplate->readTemplate("/module_search/" . $this->arrElementData["search_template"], "search_hitlist_hit");
     /** @var $objHit class_search_result */
     foreach ($arrHitsFilter["arrData"] as $objHit) {
         if ($objHit->getStrPagename() == "master") {
             continue;
         }
         $objPage = class_module_pages_page::getPageByName($objHit->getStrPagename());
         if ($objPage === null || !$objPage->rightView() || $objPage->getIntRecordStatus() != 1) {
             continue;
         }
         $arrRow = array();
         if ($objHit->getStrPagelink() == "") {
             $arrRow["page_link"] = getLinkPortal($objHit->getStrPagename(), "", "_self", $objHit->getStrPagename(), "", "&highlight=" . urlencode(html_entity_decode($this->objSearchSearch->getStrQuery(), ENT_QUOTES, "UTF-8")) . "#" . uniStrtolower(urlencode(html_entity_decode($this->objSearchSearch->getStrQuery(), ENT_QUOTES, "UTF-8"))));
         } else {
             $arrRow["page_link"] = $objHit->getStrPagelink();
         }
         $arrRow["page_description"] = uniStrTrim($objHit->getStrDescription(), 200);
         $arrTemplate["hitlist"] .= $this->objTemplate->fillTemplate($arrRow, $strRowTemplateID, false);
     }
     //Collect global data
     $arrTemplate["search_term"] = $this->objSearchSearch->getStrQuery();
     $arrTemplate["search_nrresults"] = count($arrHitsSorted);
     $arrTemplate["link_forward"] = $arrHitsFilter["strForward"];
     $arrTemplate["link_back"] = $arrHitsFilter["strBack"];
     $arrTemplate["link_overview"] = $arrHitsFilter["strPages"];
     $strTemplateID = $this->objTemplate->readTemplate("/module_search/" . $this->arrElementData["search_template"], "search_hitlist");
     return $strReturn . $this->fillTemplate($arrTemplate, $strTemplateID);
 }
 /**
  * If not empty, the returned string is rendered below the common title.
  *
  * @return string
  */
 public function getStrLongDescription()
 {
     return uniStrTrim($this->getStrGuestbookPostText(), 70);
 }
Example #6
0
 /**
  * Crreates an object of type '$strClassType'.
  * Only properties which are annotated with @var will be considered
  *
  * @param string $strClassType - the name of the class as a string
  * @param string $strParentId - the parent id of the object to be created
  * @param array $arrExcludeFillProperty - array of poperty names which will not be set
  * @param array $arrPropertyValues - assoziative array which has as key the property name and as value the to be set for the property
  * @param boolean $bitAutofillProperties - if true all properties which have annotation @tablecolumn will be filled with random values
  *
  * @return class_model
  */
 protected function createObject($strClassType, $strParentId, array $arrExcludeFillProperty = array(), array $arrPropertyValues = array(), $bitAutofillProperties = true)
 {
     //get properties with an tablecolumn annotation
     $objObject = new $strClassType();
     $objReflection = new class_reflection($strClassType);
     $arrProperties = $objReflection->getPropertiesWithAnnotation(class_orm_base::STR_ANNOTATION_TABLECOLUMN);
     $arrProperties = array_merge($objReflection->getPropertiesWithAnnotation(class_orm_base::STR_ANNOTATION_OBJECTLIST), $arrProperties);
     //exclude class_root properties
     $objRootReflection = new class_reflection("class_root");
     $arrExcludeFillProperty = array_merge($arrExcludeFillProperty, array_keys($objRootReflection->getPropertiesWithAnnotation(class_orm_base::STR_ANNOTATION_TABLECOLUMN)));
     foreach ($arrProperties as $strPropName => $strValue) {
         //Exclude properties to be set
         if (in_array($strPropName, $arrExcludeFillProperty)) {
             continue;
         }
         //Set properties from array $arrPropertyValues
         if (array_key_exists($strPropName, $arrPropertyValues)) {
             $strSetterMethod = $objReflection->getSetter($strPropName);
             if ($strSetterMethod !== null) {
                 $objValue = $arrPropertyValues[$strPropName];
                 $objObject->{$strSetterMethod}($objValue);
                 continue;
             }
         }
         //check if the property is annotated with @tablecolumn
         if ($bitAutofillProperties) {
             if ($objReflection->hasPropertyAnnotation($strPropName, class_orm_base::STR_ANNOTATION_TABLECOLUMN)) {
                 $strSetterMethod = $objReflection->getSetter($strPropName);
                 if ($strSetterMethod !== null) {
                     //determine the field type
                     $strDataType = $objReflection->getAnnotationValueForProperty($strPropName, "@var");
                     $strFieldType = $objReflection->getAnnotationValueForProperty($strPropName, "@fieldType");
                     $objMethodValue = null;
                     if ($strDataType == "string") {
                         if ($strFieldType == "text" || $strFieldType == "textarea") {
                             $objMethodValue = $strPropName . "_" . $objObject->getStrSystemid();
                             if (uniStrlen($objMethodValue) > 10) {
                                 $objMethodValue = uniStrTrim($objMethodValue, 10, "");
                             }
                         }
                     } else {
                         if ($strDataType == "int" || $strDataType == "numeric") {
                             if ($strFieldType != "dropdown") {
                                 $objMethodValue = 1;
                             }
                         } else {
                             if ($strDataType == "class_date") {
                                 $objMethodValue = new class_date();
                             } else {
                                 if ($strDataType == "bool") {
                                     $objMethodValue = false;
                                 } else {
                                     continue;
                                     //continue with foreach
                                 }
                             }
                         }
                     }
                     $objObject->{$strSetterMethod}($objMethodValue);
                 }
             }
         }
     }
     //save it
     $objObject->updateObjectToDb($strParentId);
     return $objObject;
 }
 /**
  * @param string $strLasturl
  * @return void
  */
 public function setStrLasturl($strLasturl)
 {
     //limit to 255 chars
     $this->strLasturl = uniStrTrim($strLasturl, 450, "");
 }
 /**
  * Returns the name to be used when rendering the current object, e.g. in admin-lists.
  *
  * @return string
  */
 public function getStrDisplayName()
 {
     if ($this->getStrTitle() != "") {
         return uniStrTrim($this->getStrTitle(), 70);
     }
     return uniStrTrim($this->getStrBody(), 70);
 }
 /**
  * @see interface_admin_systemtask::executeTask()
  * @return string
  */
 public function executeTask()
 {
     if (!class_module_system_module::getModuleByName("system")->rightRight2()) {
         return $this->getLang("commons_error_permissions");
     }
     $intI = 0;
     $strReturn = "";
     $objWorker = new class_module_system_worker();
     //chec 1.level nodes
     $arrCorruptedRecords = $objWorker->checkFirstLevelNodeConsistency();
     //create the output tables
     if (count($arrCorruptedRecords) > 0) {
         //ohoh. errors found. create tow tables
         $strReturn .= $this->objToolkit->listHeader();
         $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("systemtask_dbconsistency_firstlevel_error"), getImageAdmin("icon_disabled"), "", ++$intI);
         foreach ($arrCorruptedRecords as $arrRow) {
             $objRecord = class_objectfactory::getInstance()->getObject($arrRow["system_id"]);
             $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $arrRow["system_id"] . " (" . uniStrTrim($objRecord != null ? $objRecord->getStrDisplayName() : $arrRow["system_comment"], 20) . ")", "", "", $intI);
         }
         $strReturn .= $this->objToolkit->listFooter();
     } else {
         //no errors found
         $strReturn .= $this->objToolkit->listHeader();
         $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("systemtask_dbconsistency_firstlevel_ok"), getImageAdmin("icon_enabled"), "", ++$intI);
         $strReturn .= $this->objToolkit->listFooter();
     }
     //Check system_prev_id => system_id relations
     $arrCorruptedRecords = $objWorker->checkSystemTableCurPrevRelations();
     //create the output tables
     if (count($arrCorruptedRecords) > 0) {
         //ohoh. errors found. create tow tables
         $strReturn .= $this->objToolkit->listHeader();
         $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("systemtask_dbconsistency_curprev_error"), getImageAdmin("icon_disabled"), "", ++$intI);
         foreach ($arrCorruptedRecords as $strID => $strComment) {
             $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $strID . " (" . $strComment . ")", "", "", $intI);
         }
         $strReturn .= $this->objToolkit->listFooter();
     } else {
         //no errors found
         $strReturn .= $this->objToolkit->listHeader();
         $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("systemtask_dbconsistency_curprev_ok"), getImageAdmin("icon_enabled"), "", ++$intI);
         $strReturn .= $this->objToolkit->listFooter();
     }
     //check if every right-record has a system-record
     $arrCorruptedRecords = $objWorker->chekRightSystemRelations();
     //create the output tables
     if (count($arrCorruptedRecords) > 0) {
         //ohoh. errors found. create tow tables
         $strReturn .= $this->objToolkit->listHeader();
         $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("systemtask_dbconsistency_right_error"), getImageAdmin("icon_disabled"), "", ++$intI);
         foreach ($arrCorruptedRecords as $arrOneRecords) {
             $objRecord = class_objectfactory::getInstance()->getObject($arrOneRecords["system_id"]);
             $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $arrOneRecords["right_id"] . " (" . uniStrTrim($objRecord != null ? $objRecord->getStrDisplayName() : $arrOneRecords["system_comment"], 20) . ")", "", "", $intI);
         }
         $strReturn .= $this->objToolkit->listFooter();
     } else {
         //no errors found
         $strReturn .= $this->objToolkit->listHeader();
         $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("systemtask_dbconsistency_right_ok"), getImageAdmin("icon_enabled"), "", ++$intI);
         $strReturn .= $this->objToolkit->listFooter();
     }
     //check if every date-record has a system-record
     $arrCorruptedRecords = $objWorker->checkDateSystemRelations();
     //create the output tables
     if (count($arrCorruptedRecords) > 0) {
         //ohoh. errors found. create tow tables
         $strReturn .= $this->objToolkit->listHeader();
         $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("systemtask_dbconsistency_date_error"), getImageAdmin("icon_disabled"), "", ++$intI);
         foreach ($arrCorruptedRecords as $arrOneRecords) {
             $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $arrOneRecords["system_date_id"], "", "", $intI);
         }
         $strReturn .= $this->objToolkit->listFooter();
     } else {
         //no errors found
         $strReturn .= $this->objToolkit->listHeader();
         $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("systemtask_dbconsistency_date_ok"), getImageAdmin("icon_enabled"), "", ++$intI);
         $strReturn .= $this->objToolkit->listFooter();
     }
     return $strReturn;
 }
 /**
  * Renders the list of changes for the passed systemrecord.
  * May be called from other modules in order to get the rendered list for a single record.
  * In most cases rendered as a overlay, so in folderview mode
  *
  * @param string $strSystemid sytemid to filter
  * @param string $strSourceModule source-module, required for a working pageview
  * @param string $strSourceAction source-action, required for a working pageview
  * @param bool $bitBlockFolderview
  *
  * @return string
  * @since 3.4.0
  * @autoTestable
  * @permissions changelog
  */
 public function actionGenericChangelog($strSystemid = "", $strSourceModule = "system", $strSourceAction = "genericChangelog", $bitBlockFolderview = false)
 {
     if (!$bitBlockFolderview && $this->getParam("bitBlockFolderview") == "") {
         $this->setArrModuleEntry("template", "/folderview.tpl");
     }
     if ($strSystemid == "") {
         $strSystemid = $this->getSystemid();
     }
     if (!validateSystemid($strSystemid) && $this->getObjModule()->rightChangelog()) {
         $strReturn = $this->objToolkit->warningBox($this->getLang("generic_changelog_no_systemid"));
         $strReturn .= $this->objToolkit->formHeader(getLinkAdminHref("system", "genericChangeLog", "bitBlockFolderview=1"));
         $strReturn .= $this->objToolkit->formInputText("systemid", "systemid");
         $strReturn .= $this->objToolkit->formInputSubmit();
         $strReturn .= $this->objToolkit->formClose();
         return $strReturn;
         //            return "asd";
     }
     $strReturn = "";
     //        check needed rights - done twice since public and callable by not only the controller
     //        if(!class_carrier::getInstance()->getObjRights()->validatePermissionString(class_rights::$STR_RIGHT_CHANGELOG, $this->getObjModule()))
     //            return $this->getLang("commons_error_permissions");
     //showing a list using the pageview
     $objArraySectionIterator = new class_array_section_iterator(class_module_system_changelog::getLogEntriesCount($strSystemid));
     $objArraySectionIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1));
     $objArraySectionIterator->setArraySection(class_module_system_changelog::getLogEntries($strSystemid, $objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos()));
     $arrData = array();
     $arrHeader = array();
     $arrHeader[] = $this->getLang("commons_date");
     $arrHeader[] = $this->getLang("change_user");
     if ($strSystemid == "") {
         $arrHeader[] = $this->getLang("change_module");
     }
     if ($strSystemid == "") {
         $arrHeader[] = $this->getLang("change_record");
     }
     $arrHeader[] = $this->getLang("change_action");
     $arrHeader[] = $this->getLang("change_property");
     $arrHeader[] = $this->getLang("change_oldvalue");
     $arrHeader[] = $this->getLang("change_newvalue");
     /** @var $objOneEntry class_changelog_container */
     foreach ($objArraySectionIterator as $objOneEntry) {
         $arrRowData = array();
         /** @var interface_versionable|class_model $objTarget */
         $objTarget = $objOneEntry->getObjTarget();
         $strOldValue = $objOneEntry->getStrOldValue();
         $strNewValue = $objOneEntry->getStrNewValue();
         if ($objTarget != null) {
             $strOldValue = $objTarget->renderVersionValue($objOneEntry->getStrProperty(), $strOldValue);
             $strNewValue = $objTarget->renderVersionValue($objOneEntry->getStrProperty(), $strNewValue);
         }
         $strOldValue = htmlStripTags($strOldValue);
         $strNewValue = htmlStripTags($strNewValue);
         $arrRowData[] = dateToString($objOneEntry->getObjDate());
         $arrRowData[] = $this->objToolkit->getTooltipText(uniStrTrim($objOneEntry->getStrUsername(), 15), $objOneEntry->getStrUsername());
         if ($strSystemid == "") {
             $arrRowData[] = $objTarget != null ? $objTarget->getArrModule("modul") : "";
         }
         if ($strSystemid == "") {
             $arrRowData[] = $objTarget != null ? $this->objToolkit->getTooltipText(uniStrTrim($objTarget->getVersionRecordName(), 20), $objTarget->getVersionRecordName() . " " . $objOneEntry->getStrSystemid()) : "";
         }
         $arrRowData[] = $objTarget != null ? $this->objToolkit->getTooltipText(uniStrTrim($objTarget->getVersionActionName($objOneEntry->getStrAction()), 15), $objTarget->getVersionActionName($objOneEntry->getStrAction())) : "";
         $arrRowData[] = $objTarget != null ? $this->objToolkit->getTooltipText(uniStrTrim($objTarget->getVersionPropertyName($objOneEntry->getStrProperty()), 20), $objTarget->getVersionPropertyName($objOneEntry->getStrProperty())) : "";
         $arrRowData[] = $this->objToolkit->getTooltipText(uniStrTrim($strOldValue, 20), $strOldValue);
         $arrRowData[] = $this->objToolkit->getTooltipText(uniStrTrim($strNewValue, 20), $strNewValue);
         $arrData[] = $arrRowData;
     }
     $objManager = new class_module_packagemanager_manager();
     if ($objManager->getPackage("phpexcel") != null) {
         $strReturn .= $this->objToolkit->getContentToolbar(array(class_link::getLinkAdmin($this->getArrModule("modul"), "genericChangelogExportExcel", "&systemid=" . $strSystemid, class_adminskin_helper::getAdminImage("icon_excel") . " " . $this->getLang("change_export_excel"), "", "", false)));
     }
     $strReturn .= $this->objToolkit->dataTable($arrHeader, $arrData);
     $strReturn .= $this->objToolkit->getPageview($objArraySectionIterator, $strSourceModule, $strSourceAction, "&systemid=" . $strSystemid . "&bitBlockFolderview=" . $this->getParam("bitBlockFolderview"));
     return $strReturn;
 }
Example #11
0
$arrHeader = array();
$objText = class_carrier::getInstance()->getObjLang();
$arrHeader[] = "Leasetime";
$arrHeader[] = "Source";
$arrHeader[] = "Language";
$arrHeader[] = "Hash 1";
$arrHeader[] = "Hash 2";
$arrHeader[] = "Hits";
$arrHeader[] = "Size";
foreach ($arrEntries as $objOneEntry) {
    $arrRowData = array();
    $arrRowData[] = timeToString($objOneEntry->getIntLeasetime());
    $arrRowData[] = $objOneEntry->getStrSourceName();
    $arrRowData[] = $objOneEntry->getStrLanguage();
    $arrRowData[] = uniStrTrim($objOneEntry->getStrHash1(), 40);
    $arrRowData[] = uniStrTrim($objOneEntry->getStrHash2(), 40);
    if (_cache_ === true) {
        $arrRowData[] = $objOneEntry->getIntEntryHits();
    } else {
        $arrRowData[] = "n.a.";
    }
    $arrRowData[] = uniStrlen($objOneEntry->getStrContent());
    $arrData[] = $arrRowData;
}
echo "<table border=\"1\">";
echo "<tr>";
foreach ($arrHeader as $strOneHeader) {
    echo "<th>" . $strOneHeader . "</th>";
}
echo "</tr>";
foreach ($arrData as $arrOneRow) {
 /**
  * In nearly all cases, the additional info is rendered left to the action-icons.
  *
  * @return string
  */
 public function getStrAdditionalInfo()
 {
     if ($this->getIntType() == self::$INT_TYPE_ALIAS) {
         return "-> " . uniStrTrim($this->getStrAlias(), 20);
     } else {
         return $this->getStrName();
     }
 }
 /**
  * @see interface_calendarsource_admin::getArrCalendarEntries()
  */
 public function getArrCalendarEntries(class_date $objStartDate, class_date $objEndDate)
 {
     $arrEntries = array();
     if ($this->objSession->getSession(self::STR_CALENDAR_FILTER_NEWS) != "disabled") {
         $arrNews = class_module_news_news::getObjectList("", null, null, $objStartDate, $objEndDate);
         foreach ($arrNews as $objOneNews) {
             $objEntry = new class_calendarentry();
             $objEntry->setStrClass("calendarEvent calendarNews");
             $strAlt = $this->getLang("calendar_type_news");
             $strTitle = $objOneNews->getStrTitle();
             if (uniStrlen($strTitle) > 15) {
                 $strAlt = $strTitle . "<br />" . $strAlt;
                 $strTitle = uniStrTrim($strTitle, 14);
             }
             $strName = class_link::getLinkAdmin($this->getArrModule("modul"), "edit", "&systemid=" . $objOneNews->getSystemid(), $strTitle, $strAlt);
             $objEntry->setStrName($strName);
             $arrEntries[] = $objEntry;
         }
     }
     return $arrEntries;
 }
 /**
  * If not empty, the returned string is rendered below the common title.
  *
  * @return string
  */
 public function getStrLongDescription()
 {
     return uniStrTrim($this->strComment, 120);
 }
 /**
  * @param string $strSearchterm
  * @param class_search_result[] $arrResults
  *
  * @return string
  */
 private function createSearchXML($strSearchterm, $arrResults)
 {
     $strReturn = "";
     $strReturn .= "<search>\n" . "  <searchterm>" . xmlSafeString($strSearchterm) . "</searchterm>\n" . "  <nrofresults>" . count($arrResults) . "</nrofresults>\n";
     //And now all results
     $strReturn .= "    <resultset>\n";
     foreach ($arrResults as $objOneResult) {
         //create a correct link
         if ($objOneResult->getObjObject() == null || !$objOneResult->getObjObject()->rightView()) {
             continue;
         }
         $strIcon = "";
         if ($objOneResult->getObjObject() instanceof interface_admin_listable) {
             $strIcon = $objOneResult->getObjObject()->getStrIcon();
             if (is_array($strIcon)) {
                 $strIcon = $strIcon[0];
             }
         }
         $strLink = $objOneResult->getStrPagelink();
         if ($strLink == "") {
             $strLink = class_link::getLinkAdminHref($objOneResult->getObjObject()->getArrModule("modul"), "edit", "&systemid=" . $objOneResult->getStrSystemid());
         }
         $strReturn .= "        <item>\n" . "            <systemid>" . $objOneResult->getStrSystemid() . "</systemid>\n" . "            <icon>" . xmlSafeString($strIcon) . "</icon>\n" . "            <score>" . $objOneResult->getIntHits() . "</score>\n" . "            <description>" . xmlSafeString(uniStrTrim($objOneResult->getObjObject()->getStrDisplayName(), 200)) . "</description>\n" . "            <link>" . xmlSafeString($strLink) . "</link>\n" . "        </item>\n";
     }
     $strReturn .= "    </resultset>\n";
     $strReturn .= "</search>";
     return $strReturn;
 }
Example #16
0
 /**
  * Creates a raw Link for the portal (just the href)
  *
  * @param string $strPageI
  * @param string $strPageE
  * @param string $strAction
  * @param string $strParams
  * @param string $strSystemid
  * @param string $strLanguage
  * @param string $strSeoAddon Only used if using mod_rewrite
  * @return string
  */
 public static function getLinkPortalHref($strPageI, $strPageE = "", $strAction = "", $strParams = "", $strSystemid = "", $strLanguage = "", $strSeoAddon = "")
 {
     $strReturn = "";
     $bitInternal = true;
     //return "#" if neither an internal nor an external page is set
     if ($strPageI == "" && $strPageE == "") {
         return "#";
     }
     //Internal links are more important than external links!
     if ($strPageI == "" && $strPageE != "") {
         $bitInternal = false;
     }
     //create an array out of the params
     if ($strSystemid != "") {
         $strParams .= "&systemid=" . $strSystemid;
         $strSystemid = "";
     }
     $arrParams = self::parseParamsString($strParams, $strSystemid);
     // any anchors set to the page?
     $strAnchor = "";
     if (uniStrpos($strPageI, "#") !== false) {
         //get anchor, remove anchor from link
         $strAnchor = urlencode(uniSubstr($strPageI, uniStrpos($strPageI, "#") + 1));
         $strPageI = uniSubstr($strPageI, 0, uniStrpos($strPageI, "#"));
     }
     //urlencoding
     $strPageI = urlencode($strPageI);
     $strAction = urlencode($strAction);
     //more than one language installed?
     if ($strLanguage == "" && self::getIntNumberOfPortalLanguages() > 1) {
         $strLanguage = self::getStrPortalLanguage();
     } else {
         if ($strLanguage != "" && self::getIntNumberOfPortalLanguages() <= 1) {
             $strLanguage = "";
         }
     }
     $strHref = "";
     if ($bitInternal) {
         //check, if we could use mod_rewrite
         $bitRegularLink = true;
         if (class_module_system_setting::getConfigValue("_system_mod_rewrite_") == "true") {
             $strAddKeys = "";
             //used later to add seo-relevant keywords
             $objPage = class_module_pages_page::getPageByName($strPageI);
             if ($objPage !== null) {
                 if ($strLanguage != "") {
                     $objPage->setStrLanguage($strLanguage);
                     $objPage->initObject();
                 }
                 $strAddKeys = $objPage->getStrSeostring() . ($strSeoAddon != "" && $objPage->getStrSeostring() != "" ? "-" : "") . urlSafeString($strSeoAddon);
                 if (uniStrlen($strAddKeys) > 0 && uniStrlen($strAddKeys) <= 2) {
                     $strAddKeys .= "__";
                 }
                 //trim string
                 $strAddKeys = uniStrTrim($strAddKeys, 100, "");
                 if ($strLanguage != "") {
                     $strHref .= $strLanguage . "/";
                 }
                 $strPath = $objPage->getStrPath();
                 if ($strPath == "") {
                     $objPage->updatePath();
                     $strPath = $objPage->getStrPath();
                     $objPage->updateObjectToDb();
                 }
                 if ($strPath != "") {
                     $strHref .= $strPath . "/";
                 }
             }
             //ok, here we go. schema for rewrite_links: pagename.addKeywords.action.systemid.language.html
             //but: special case: just pagename & language
             if ($strAction == "" && $strSystemid == "" && $strAddKeys == "") {
                 $strHref .= $strPageI . ".html";
             } elseif ($strAction == "" && $strSystemid == "") {
                 $strHref .= $strPageI . ($strAddKeys == "" ? "" : "." . $strAddKeys) . ".html";
             } elseif ($strAction != "" && $strSystemid == "") {
                 $strHref .= $strPageI . "." . $strAddKeys . "." . $strAction . ".html";
             } else {
                 $strHref .= $strPageI . "." . $strAddKeys . "." . $strAction . "." . $strSystemid . ".html";
             }
             //params?
             if (count($arrParams) > 0) {
                 $strHref .= "?" . implode("&amp;", $arrParams);
             }
             // add anchor if given
             if ($strAnchor != "") {
                 $strHref .= "#" . $strAnchor;
             }
             //plus the domain as a prefix
             $strHref = "_webpath_" . "/" . $strHref;
             $bitRegularLink = false;
         }
         if ($bitRegularLink) {
             $strHref = "_indexpath_" . "?" . ($strPageI != "" ? "page=" . $strPageI : "") . "" . ($strSystemid != "" ? "&amp;systemid=" . $strSystemid : "") . ($strAction != "" ? "&amp;action=" . $strAction : "") . ($strLanguage != "" ? "&amp;language=" . $strLanguage : "") . (count($arrParams) > 0 ? "&amp;" . implode("&amp;", $arrParams) : "") . ($strAnchor != "" ? "#" . $strAnchor : "") . "";
         }
     } else {
         $strHref = $strPageE;
     }
     $strReturn .= $strHref;
     return $strReturn;
 }
 /**
  * @see interface_calendarsource_admin::getArrCalendarEntries()
  */
 public function getArrCalendarEntries(class_date $objStartDate, class_date $objEndDate)
 {
     $arrEntries = array();
     if ($this->objSession->getSession(self::STR_CALENDAR_FILTER_EVENT) != "disabled") {
         $arrEvents = class_module_eventmanager_event::getAllEvents(null, null, $objStartDate, $objEndDate);
         foreach ($arrEvents as $objOneEvent) {
             $objEntry = new class_calendarentry();
             $strAlt = $this->getLang("calendar_type_event");
             $strTitle = $objOneEvent->getStrTitle();
             if (uniStrlen($strTitle) > 15) {
                 $strAlt = $strTitle . "<br />" . $strAlt;
                 $strTitle = uniStrTrim($strTitle, 14);
             }
             $strName = getLinkAdmin($this->arrModule["modul"], "edit", "&systemid=" . $objOneEvent->getSystemid(), $strTitle, $strAlt);
             $objEntry->setStrName($strName);
             $arrEntries[] = $objEntry;
         }
     }
     return $arrEntries;
 }
Example #18
0
 /**
  * @param string $strRecordComment
  * @return void
  */
 public function setStrRecordComment($strRecordComment)
 {
     if (uniStrlen($strRecordComment) > 254) {
         $strRecordComment = uniStrTrim($strRecordComment, 250);
     }
     $this->strRecordComment = $strRecordComment;
 }
 /**
  * @return string
  */
 public function getReport()
 {
     $strReturn = "";
     //Create Data-table
     $arrHeader = array();
     $arrValues = array();
     //Fetch data
     $arrStats = $this->getTopReferer();
     //calc a few values
     $intSum = 0;
     foreach ($arrStats as $arrOneStat) {
         $intSum += $arrOneStat["anzahl"];
     }
     $intI = 0;
     $objUser = new class_module_user_user(class_session::getInstance()->getUserID());
     foreach ($arrStats as $arrOneStat) {
         //Escape?
         if ($intI >= $objUser->getIntItemsPerPage()) {
             break;
         }
         if ($arrOneStat["refurl"] == "") {
             $arrOneStat["refurl"] = $this->objTexts->getLang("referer_direkt", "stats");
         } else {
             $arrOneStat["refurl"] = class_link::getLinkPortal("", $arrOneStat["refurl"], "_blank", uniStrTrim($arrOneStat["refurl"], 45));
         }
         $arrValues[$intI] = array();
         $arrValues[$intI][] = $intI + 1;
         $arrValues[$intI][] = $arrOneStat["refurl"];
         $arrValues[$intI][] = $arrOneStat["anzahl"];
         $arrValues[$intI][] = $this->objToolkit->percentBeam($arrOneStat["anzahl"] / $intSum * 100);
         $intI++;
     }
     //HeaderRow
     $arrHeader[] = "#";
     $arrHeader[] = $this->objTexts->getLang("top_referer_titel", "stats");
     $arrHeader[] = $this->objTexts->getLang("top_referer_gewicht", "stats");
     $arrHeader[] = $this->objTexts->getLang("anteil", "stats");
     $strReturn .= $this->objToolkit->dataTable($arrHeader, $arrValues);
     return $strReturn;
 }