本文整理汇总了PHP中uniStrReplace函数的典型用法代码示例。如果您正苦于以下问题:PHP uniStrReplace函数的具体用法?PHP uniStrReplace怎么用?PHP uniStrReplace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uniStrReplace函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: installOrUpdate
/**
* Generic implementation, triggers the update or the install method, depending on the parts already installed.
* @return string
*/
public function installOrUpdate()
{
$strReturn = "";
$objModule = null;
if ($this->objMetadata->getStrType() == class_module_packagemanager_manager::STR_TYPE_ELEMENT) {
if (class_module_system_module::getModuleByName("pages") !== null && is_dir(class_resourceloader::getInstance()->getCorePathForModule("module_pages", true))) {
$objModule = class_module_pages_element::getElement(uniStrReplace("element_", "", $this->objMetadata->getStrTitle()));
}
} else {
$objModule = class_module_system_module::getModuleByName($this->objMetadata->getStrTitle());
}
if ($objModule === null) {
class_logger::getInstance("triggering installation of " . $this->objMetadata->getStrTitle(), class_logger::$levelInfo);
$strReturn .= $this->install();
} else {
$strVersionInstalled = $objModule->getStrVersion();
$strVersionAvailable = $this->objMetadata->getStrVersion();
if (version_compare($strVersionAvailable, $strVersionInstalled, ">")) {
class_logger::getInstance("triggering update of " . $this->objMetadata->getStrTitle(), class_logger::$levelInfo);
$strReturn .= $this->update();
}
}
class_carrier::getInstance()->flushCache(class_carrier::INT_CACHE_TYPE_DBTABLES);
return $strReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:29,代码来源:class_installer_base.php
示例2: uploadForm
/**
* @param string $formErrors
*
* @return string
*/
private function uploadForm($formErrors = "")
{
$strReturn = "";
//validate the rights
$objFilemanagerRepo = new class_module_mediamanager_repo($this->arrElementData["char2"]);
if ($objFilemanagerRepo->rightRight1()) {
$strTemplateID = $this->objTemplate->readTemplate("/element_portalupload/" . $this->arrElementData["char1"], "portalupload_uploadform");
$strDlFolderId = "";
if ($this->getParam("action") == "mediaFolder") {
$strDlFolderId = $this->getParam("systemid");
}
$arrTemplate = array();
$arrTemplate["portaluploadDlfolder"] = $strDlFolderId;
// check if there was an successfull upload before
if ($this->getParam("uploadSuccess") == "1") {
$arrTemplate["portaluploadSuccess"] = $this->getLang("portaluploadSuccess");
}
$arrTemplate["formErrors"] = $formErrors;
$strAllowedFileRegex = uniStrReplace(array(".", ","), array("", "|"), $objFilemanagerRepo->getStrUploadFilter());
$arrTemplate["formAction"] = class_link::getLinkPortalHref($this->getPagename(), "", $this->getAction(), "", $strDlFolderId);
$arrTemplate["maxFileSize"] = class_carrier::getInstance()->getObjConfig()->getPhpMaxUploadSize();
$arrTemplate["acceptFileTypes"] = $strAllowedFileRegex != "" ? "/(\\.|\\/)(" . $strAllowedFileRegex . ")\$/i" : "''";
$arrTemplate["elementId"] = $this->arrElementData["content_id"];
$arrTemplate["mediamanagerRepoId"] = $objFilemanagerRepo->getSystemid();
$strReturn .= $this->fillTemplate($arrTemplate, $strTemplateID);
} else {
$strReturn .= $this->getLang("commons_error_permissions");
}
return $strReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:35,代码来源:class_element_portalupload_portal.php
示例3: doPortalSearch
/**
* Calls the single search-functions, sorts the results and creates the output.
* Method for portal-searches.
*
* @param class_module_search_search $objSearch
*
* @return class_search_result[]
*/
public function doPortalSearch($objSearch)
{
$objSearch->setStrQuery(trim(uniStrReplace("%", "", $objSearch->getStrQuery())));
if (uniStrlen($objSearch->getStrQuery()) == 0) {
return array();
}
//create a search object
$objSearch->setBitPortalObjectFilter(true);
$arrHits = $this->doIndexedSearch($objSearch);
$arrReturn = array();
foreach ($arrHits as $objOneResult) {
$objInstance = $objOneResult->getObjObject();
if ($objInstance instanceof class_module_pages_pageelement) {
$objInstance = $objInstance->getConcreteAdminInstance();
if ($objInstance != null) {
$objInstance->loadElementData();
} else {
continue;
}
}
$arrUpdatedResults = $objInstance->updateSearchResult($objOneResult);
if (is_array($arrUpdatedResults)) {
$arrReturn = array_merge($arrReturn, $arrUpdatedResults);
} else {
if ($objOneResult != null && $objOneResult instanceof class_search_result) {
$arrReturn[] = $objOneResult;
}
}
}
//log the query
class_module_search_log::generateLogEntry($objSearch->getStrQuery());
$arrReturn = $this->mergeDuplicates($arrReturn);
return $arrReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:42,代码来源:class_module_search_commons.php
示例4: actionGetReport
/**
* Triggers the "real" creation of the report and wraps the code inline into a xml-structure
*
* @return string
* @permissions view
*/
protected function actionGetReport()
{
$strPlugin = $this->getParam("plugin");
$strReturn = "";
$objPluginManager = new class_pluginmanager(class_module_stats_admin::$STR_PLUGIN_EXTENSION_POINT, "/admin/statsreports");
$objPlugin = null;
foreach ($objPluginManager->getPlugins(array(class_carrier::getInstance()->getObjDB(), $this->objToolkit, $this->getObjLang())) as $objOneReport) {
if (uniStrReplace("class_stats_report_", "", get_class($objOneReport)) == $strPlugin) {
$objPlugin = $objOneReport;
break;
}
}
if ($objPlugin !== null && $objPlugin instanceof interface_admin_statsreports) {
//get date-params as ints
$intStartDate = mktime(0, 0, 0, $this->objDateStart->getIntMonth(), $this->objDateStart->getIntDay(), $this->objDateStart->getIntYear());
$intEndDate = mktime(0, 0, 0, $this->objDateEnd->getIntMonth(), $this->objDateEnd->getIntDay(), $this->objDateEnd->getIntYear());
$objPlugin->setEndDate($intEndDate);
$objPlugin->setStartDate($intStartDate);
$objPlugin->setInterval($this->intInterval);
$arrImage = $objPlugin->getReportGraph();
if (!is_array($arrImage)) {
$arrImage = array($arrImage);
}
foreach ($arrImage as $strImage) {
if ($strImage != "") {
$strReturn .= $this->objToolkit->getGraphContainer($strImage);
}
}
$strReturn .= $objPlugin->getReport();
$strReturn = "<content><![CDATA[" . $strReturn . "]]></content>";
}
return $strReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:39,代码来源:class_module_stats_admin_xml.php
示例5: processContent
/**
* Processes the content.
* Make sure to return the string again, otherwise the output will remain blank.
*
* @param string $strContent
*
* @return string
*/
public function processContent($strContent)
{
$objLang = class_carrier::getInstance()->getObjLang();
$arrTemp = array();
preg_match_all("#\\[lang,([A-Za-z0-9_]+),([0-9A-Za-z_]+)\\]#i", $strContent, $arrTemp);
foreach ($arrTemp[0] as $intKey => $strSearchString) {
$strContent = uniStrReplace($strSearchString, $objLang->getLang($arrTemp[1][$intKey], $arrTemp[2][$intKey]), $strContent);
}
return $strContent;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:18,代码来源:class_scriptlet_lang.php
示例6: loadData
/**
* Loads the navigation-class and passes control
*
* @throws class_exception
* @return string
*/
public function loadData()
{
$strPath = class_resourceloader::getInstance()->getPathForFile("/portal/forms/" . $this->arrElementData["formular_class"]);
if ($strPath === false) {
throw new class_exception("failed to load form-class " . $this->arrElementData["formular_class"], class_exception::$level_ERROR);
}
require_once _realpath_ . $strPath;
$strClassname = uniStrReplace(".php", "", $this->arrElementData["formular_class"]);
$objForm = new $strClassname($this->arrElementData);
$strReturn = $objForm->action();
return $strReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:18,代码来源:class_element_formular_portal.php
示例7: sendHeaders
/**
*
*/
public function sendHeaders()
{
if ($this->strRedirectUrl != "") {
$this->strStatusCode = class_http_statuscodes::SC_REDIRECT;
$this->arrAdditionalHeaders[] = "Location: " . uniStrReplace("&", "&", $this->strRedirectUrl);
}
header($this->getStrStatusCode());
header($this->getStrResponseType());
foreach ($this->arrAdditionalHeaders as $strOneHeader) {
header($strOneHeader);
}
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:15,代码来源:class_response_object.php
示例8: getFASomeImage
/**
* @param string $strImage
* @param string $strTooltip
*
* @return null|string
*/
private function getFASomeImage($strImage, $strTooltip)
{
$strName = uniStrReplace(array(".png", ".gif"), "", $strImage);
if (isset(self::$arrFAImages[$strName])) {
if ($strTooltip == "") {
return self::$arrFAImages[$strName];
} else {
return "<span rel=\"tooltip\" title=\"" . $strTooltip . "\" data-kajona-icon='" . $strName . "' >" . self::$arrFAImages[$strName] . "</span>";
}
}
return null;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:18,代码来源:class_adminskin_imageresolver.php
示例9: addFile
/**
* Adds a file to the zip-archive.
* The second, optional param indicates the filename inside the archive
*
* @param string $strSourceFile
* @param string $strTargetFile
*
* @return bool
*/
public function addFile($strSourceFile, $strTargetFile = "")
{
$strSourceFile = uniStrReplace(_realpath_, "", $strSourceFile);
if ($strTargetFile == "") {
$strTargetFile = $strSourceFile;
}
$strTargetFile = ltrim($strTargetFile, "/");
if (file_exists(_realpath_ . $strSourceFile)) {
return $this->objArchive->addFile(_realpath_ . $strSourceFile, $strTargetFile);
} else {
return false;
}
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:22,代码来源:class_zip.php
示例10: processContent
/**
* Processes the content.
* Make sure to return the string again, otherwise the output will remain blank.
*
* @param string $strContent
*
* @return string
*/
public function processContent($strContent)
{
$arrTemp = array();
preg_match_all("#\\[img,([ \\-+%A-Za-z0-9_\\./\\\\(\\)]+),([0-9]+),([0-9]+)(,fixed|,max|)\\]#i", $strContent, $arrTemp);
foreach ($arrTemp[0] as $intKey => $strSearchString) {
if (isset($arrTemp[4][$intKey]) && $arrTemp[4][$intKey] == ",fixed") {
$strContent = uniStrReplace($strSearchString, _webpath_ . "/image.php?image=" . urlencode($arrTemp[1][$intKey]) . "&fixedWidth=" . $arrTemp[2][$intKey] . "&fixedHeight=" . $arrTemp[3][$intKey], $strContent);
} else {
$strContent = uniStrReplace($strSearchString, _webpath_ . "/image.php?image=" . urlencode($arrTemp[1][$intKey]) . "&maxWidth=" . $arrTemp[2][$intKey] . "&maxHeight=" . $arrTemp[3][$intKey], $strContent);
}
}
//fast way, no urlencode required
//$strContent = preg_replace("#\[img,([A-Za-z0-9_\./\\\]+),([0-9]+),([0-9]+)\]#i", _webpath_."/image.php?image=\${1}&maxWidth=\${2}&maxHeight=\${3}", $strContent);
return $strContent;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:23,代码来源:class_scriptlet_imagehelper.php
示例11: processContent
/**
* Processes the content.
* Make sure to return the string again, otherwise the output will remain blank.
*
* @param string $strContent
*
* @return string
*/
public function processContent($strContent)
{
$arrTemp = array();
preg_match_all("#\\[qrcode,([ \\?\\&\\-=:+%;A-Za-z0-9_\\./\\\\]+)(,[1-3])\\]#i", $strContent, $arrTemp);
foreach ($arrTemp[0] as $intKey => $strSearchString) {
$intSize = 1;
$strSubstr = isset($arrTemp[2][$intKey]) ? (int) substr($arrTemp[2][$intKey], 1) : 1;
if ($strSubstr >= 1 && $strSubstr <= 3) {
$intSize = $strSubstr;
}
$objQrCode = new class_qrcode();
$objQrCode->setIntSize($intSize);
$strImage = $objQrCode->getImageForString($arrTemp[1][$intKey]);
$strContent = uniStrReplace($strSearchString, _webpath_ . "/" . $strImage, $strContent);
}
return $strContent;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:25,代码来源:class_scriptlet_qrcode.php
示例12: testPerformanceTest
public function testPerformanceTest()
{
$objLang = class_lang::getInstance();
$arrParameters = array("lorem", "ipsum", "dolor", "sit", "amet");
$strPropertyRaw = "lorem {0} ipsum {1} dolor {2} sit {3} amet {4} {0}";
$intStart = microtime(true);
for ($intI = 0; $intI <= 100; $intI++) {
$strProperty = $strPropertyRaw;
foreach ($arrParameters as $intKey => $strParameter) {
$strProperty = uniStrReplace("{" . $intKey . "}", $strParameter, $strProperty);
}
$this->assertEquals($strProperty, "lorem lorem ipsum ipsum dolor dolor sit sit amet amet lorem");
}
$intEnd = microtime(true);
echo "uniStrReplace: " . ($intEnd - $intStart) . " sec\n";
$intStart = microtime(true);
for ($intI = 0; $intI <= 100; $intI++) {
$strProperty = uniStrReplace(array_map(function ($i) {
return "{" . $i . "}";
}, array_keys($arrParameters)), $arrParameters, $strPropertyRaw);
$this->assertEquals($strProperty, "lorem lorem ipsum ipsum dolor dolor sit sit amet amet lorem");
}
$intEnd = microtime(true);
echo "array based uniStrReplace: " . ($intEnd - $intStart) . " sec\n";
$intStart = microtime(true);
for ($intI = 0; $intI <= 100; $intI++) {
$strProperty = preg_replace_callback("/{(\\d)}/", function ($hit) use($arrParameters) {
return $arrParameters[$hit[1]];
}, $strPropertyRaw);
$this->assertEquals($strProperty, "lorem lorem ipsum ipsum dolor dolor sit sit amet amet lorem");
}
$intEnd = microtime(true);
echo "preg_replace based : " . ($intEnd - $intStart) . " sec\n";
$intStart = microtime(true);
for ($intI = 0; $intI <= 100; $intI++) {
$strProperty = $objLang->replaceParams($strPropertyRaw, $arrParameters);
$this->assertEquals($strProperty, "lorem lorem ipsum ipsum dolor dolor sit sit amet amet lorem");
}
$intEnd = microtime(true);
echo "current implementation : " . ($intEnd - $intStart) . " sec\n";
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:41,代码来源:test_langTest.php
示例13: actionList
/**
* 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 . "";
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:42,代码来源:class_module_guestbook_portal.php
示例14: renderTagAction
/**
* Renders the icon to edit a records tags
* @param class_model|interface_model $objListEntry
* @return string
*/
protected function renderTagAction(class_model $objListEntry)
{
if ($objListEntry->getIntRecordDeleted() == 1) {
return "";
}
if ($objListEntry->rightView()) {
//the tag list is more complex and wrapped by a js-logic to load the tags by ajax afterwards
// @codingStandardsIgnoreStart
$strOnClick = "KAJONA.admin.folderview.dialog.setContentIFrame('" . class_link::getLinkAdminHref("tags", "genericTagForm", "&systemid=" . $objListEntry->getSystemid()) . "'); KAJONA.admin.folderview.dialog.setTitle('" . uniStrReplace(array("\r", "\n"), "", strip_tags(nl2br($objListEntry->getStrDisplayName()))) . "'); KAJONA.admin.folderview.dialog.init(); return false;";
$strLink = "<a href=\"#\" onclick=\"" . $strOnClick . "\" title=\"" . $this->getLang("commons_edit_tags") . "\" rel=\"tagtooltip\" data-systemid=\"" . $objListEntry->getSystemid() . "\">" . class_adminskin_helper::getAdminImage("icon_tag", $this->getLang("commons_edit_tags"), true) . "</a>";
// @codingStandardsIgnoreEnd
return $this->objToolkit->listButton($strLink);
}
return "";
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:20,代码来源:class_admin_simple.php
示例15: createFilename
/**
* Creates a filename valid for filesystems
*
* @param string $strName
* @param bool $bitFolder
*
* @return string
*/
function createFilename($strName, $bitFolder = false)
{
$strName = uniStrtolower($strName);
if (!$bitFolder) {
$strEnding = uniSubstr($strName, uniStrrpos($strName, ".") + 1);
} else {
$strEnding = "";
}
if (!$bitFolder) {
$strReturn = uniSubstr($strName, 0, uniStrrpos($strName, "."));
} else {
$strReturn = $strName;
}
//Filter non allowed chars
$arrSearch = array(" ", ".", ":", "ä", "ö", "ü", "/", "ß", "!");
$arrReplace = array("_", "_", "_", "ae", "oe", "ue", "_", "ss", "_");
$strReturn = uniStrReplace($arrSearch, $arrReplace, $strReturn);
//and the ending
if (!$bitFolder) {
$strEnding = uniStrReplace($arrSearch, $arrReplace, $strEnding);
}
//remove all other special characters
$strTemp = preg_replace("/[^A-Za-z0-9_-]/", "", $strReturn);
//do a replacing in the ending, too
if ($strEnding != "") {
//remove all other special characters
$strEnding = "." . preg_replace("/[^A-Za-z0-9_-]/", "", $strEnding);
}
$strReturn = $strTemp . $strEnding;
return $strReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:39,代码来源:functions.php
示例16: createElementData
private function createElementData($strPageId, XMLWriter $objWriter)
{
$arrElements = class_module_pages_pageelement::getAllElementsOnPage($strPageId);
foreach ($arrElements as $objOneElement) {
$objWriter->startElement("element");
//elements metadata
$objWriter->startElement("metadata");
$objWriter->startElement("systemid");
$objWriter->text($objOneElement->getSystemid());
$objWriter->endElement();
$objWriter->startElement("placeholder");
$objWriter->text($objOneElement->getStrPlaceholder());
$objWriter->endElement();
$objWriter->startElement("name");
$objWriter->text($objOneElement->getStrName());
$objWriter->endElement();
$objWriter->startElement("element");
$objWriter->text($objOneElement->getStrElement());
$objWriter->endElement();
$objWriter->startElement("title");
$objWriter->text($objOneElement->getStrTitle(false));
$objWriter->endElement();
$objWriter->startElement("language");
$objWriter->text($objOneElement->getStrLanguage());
$objWriter->endElement();
$objWriter->endElement();
//the elements-content itself
$objElement = $objOneElement->getConcreteAdminInstance();
//Fetch the table
$strElementTable = $objElement->getTable();
$objWriter->startElement("foreignTable");
$objWriter->startAttribute("table");
$objWriter->text(uniStrReplace(_dbprefix_, "", $strElementTable));
$objWriter->endAttribute();
//content-row
$arrContentRow = class_carrier::getInstance()->getObjDB()->getPRow("SELECT * FROM " . $strElementTable . " WHERE content_id = ? ", array($objOneElement->getSystemid()));
$arrColumns = class_carrier::getInstance()->getObjDB()->getColumnsOfTable($strElementTable);
foreach ($arrColumns as $arrOneCol) {
$objWriter->startElement("column");
$objWriter->startAttribute("name");
$objWriter->text($arrOneCol["columnName"]);
$objWriter->endAttribute();
$objWriter->startCdata();
$objWriter->text($arrContentRow[$arrOneCol["columnName"]]);
$objWriter->endCdata();
//column
$objWriter->endElement();
}
//foreignTable
$objWriter->endElement();
//element
$objWriter->endElement();
}
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:54,代码来源:class_systemtask_pageexport.php
示例17: params2Array
/**
* Converts the string of params into an associative array e.g.
* the string (param1=0, param2="abc", param3={"0", 123, 456}, param4=999, param5="hans im glück") is converted into an array of
*
* array(
* "param1" => "0",
* "param2" => "abc",
* "param3" => array("0", "123", "456"),
* "param4" => "999",
* "param5" => "hans im glück",
* )
*
*
* @param $strParams
*
* @return array ["paramname" => "value"]
*/
private function params2Array($strParams)
{
$arrParams = array();
if ($strParams == "") {
return $arrParams;
}
$strPatternParams = "/(\\w+)=(\\d+?)|(\\w+)=\"(.*)\"|(\\w+)=(\\{.*\\})/U";
if (preg_match_all($strPatternParams, $strParams, $arrMatches, PREG_SET_ORDER) !== false) {
foreach ($arrMatches as $arrOneMatch) {
//GetParam name
$strParamName = "";
if (isset($arrOneMatch[1]) && $arrOneMatch[1] != "") {
$strParamName = $arrOneMatch[1];
} else {
if (isset($arrOneMatch[3]) && $arrOneMatch[3] != "") {
$strParamName = $arrOneMatch[3];
} else {
if (isset($arrOneMatch[5]) && $arrOneMatch[5] != "") {
$strParamName = $arrOneMatch[5];
}
}
}
//Get param value(s)
$strParamValue = "";
if (isset($arrOneMatch[2]) && $arrOneMatch[2] != "") {
$strParamValue = $arrOneMatch[2];
} else {
if (isset($arrOneMatch[4]) && $arrOneMatch[4] != "") {
$strParamValue = $arrOneMatch[4];
} else {
if (isset($arrOneMatch[6]) && $arrOneMatch[6] != "") {
$strParamValue = $arrOneMatch[6];
$strParamValue = uniStrReplace(array("{"), "[", $strParamValue);
$strParamValue = uniStrReplace(array("}"), "]", $strParamValue);
$strParamValue = json_decode($strParamValue);
}
}
}
$arrParams[$strParamName] = $strParamValue;
}
}
return $arrParams;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:60,代码来源:class_reflection.php
示例18: getReport
/**
* @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;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:30,代码来源:class_stats_report_searchqueries.php
示例19: parseParamsString
/**
* Internal helper to transform the passed params string into an array.
* Extracts the systemid out of the string and updates the passed reference with the
* systemid.
*
* @param string $strParams
* @param string &$strSystemid
* @return array
*/
private static function parseParamsString($strParams, &$strSystemid = "")
{
$strParams = uniStrReplace("&", "&", $strParams);
//if given, remove first ampersand from params
if (substr($strParams, 0, 1) == "&") {
$strParams = substr($strParams, 1);
}
$arrParams = explode("&", $strParams);
foreach ($arrParams as $strKey => &$strValue) {
$arrEntry = explode("=", $strValue);
if (count($arrEntry) == 2 && $arrEntry[0] == "systemid") {
//encoded and sanitized systemid param TODO: add cve number or other identifier
$strSystemid = $arrEntry[1];
if (!validateSystemid($strSystemid) && $strSystemid != "%systemid%") {
$strSystemid = "";
}
unset($arrParams[$strKey]);
} else {
if ($strValue == "") {
unset($arrParams[$strKey]);
}
}
if (count($arrEntry) == 2) {
$arrEntry[1] = urlencode($arrEntry[1]);
}
$strValue = implode("=", $arrEntry);
}
return $arrParams;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:38,代码来源:class_link.php
示例20: getParsedStatement
/**
* Does as cache-lookup for prepared statements.
* Reduces the number of recompiles at the db-side.
*
* @param string $strQuery
*
* @return resource
* @since 3.4
*/
private function getParsedStatement($strQuery)
{
if (uniStripos($strQuery, "select") !== false) {
$strQuery = uniStrReplace(array(" as ", " AS "), array(" ", " "), $strQuery);
}
$objStatement = oci_parse($this->linkDB, $strQuery);
return $objStatement;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:17,代码来源:class_db_oci8.php
注:本文中的uniStrReplace函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论