本文整理汇总了PHP中uniStrpos函数的典型用法代码示例。如果您正苦于以下问题:PHP uniStrpos函数的具体用法?PHP uniStrpos怎么用?PHP uniStrpos使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uniStrpos函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: writeToHistoryArray
private function writeToHistoryArray($strSessionKey)
{
$strQueryString = getServer("QUERY_STRING");
//Clean querystring of empty actions
if (uniSubstr($strQueryString, -8) == "&action=") {
$strQueryString = substr_replace($strQueryString, "", -8);
}
//Just do s.th., if not in the rights-mgmt
if (uniStrpos($strQueryString, "module=right") !== false) {
return;
}
$arrHistory = $this->objSession->getSession($strSessionKey);
//And insert just, if different to last entry
if ($strQueryString == $this->getHistoryEntry(0, $strSessionKey)) {
return;
}
//If we reach up here, we can enter the current query
if ($arrHistory !== false) {
array_unshift($arrHistory, $strQueryString);
while (count($arrHistory) > 10) {
array_pop($arrHistory);
}
} else {
$arrHistory = array($strQueryString);
}
//saving the new array to session
$this->objSession->setSession($strSessionKey, $arrHistory);
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:28,代码来源:class_history.php
示例2: installOrUpdate
/**
* Invokes the installer, if given.
* The installer itself is capable of detecting whether an update or a plain installation is required.
*
* @throws class_exception
* @return string
*/
public function installOrUpdate()
{
$strReturn = "";
if (uniStrpos($this->getObjMetadata()->getStrPath(), "core") === false) {
throw new class_exception("Current module not located at /core*.", class_exception::$level_ERROR);
}
if (!$this->isInstallable()) {
throw new class_exception("Current module isn't installable, not all requirements are given", class_exception::$level_ERROR);
}
//search for an existing installer
$objFilesystem = new class_filesystem();
$arrInstaller = $objFilesystem->getFilelist($this->objMetadata->getStrPath() . "/installer/", array(".php"));
if ($arrInstaller === false) {
$strReturn .= "Updating default template pack...\n";
$this->updateDefaultTemplate();
class_cache::flushCache();
return $strReturn;
}
//proceed with elements
foreach ($arrInstaller as $strOneInstaller) {
//skip samplecontent files
if (uniStrpos($strOneInstaller, "element") !== false) {
class_logger::getInstance(class_logger::PACKAGEMANAGEMENT)->addLogRow("triggering updateOrInstall() on installer " . $strOneInstaller . ", all requirements given", class_logger::$levelInfo);
//trigger update or install
$strName = uniSubstr($strOneInstaller, 0, -4);
/** @var $objInstaller interface_installer */
$objInstaller = new $strName();
$strReturn .= $objInstaller->installOrUpdate();
}
}
$strReturn .= "Updating default template pack...\n";
$this->updateDefaultTemplate();
return $strReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:41,代码来源:class_module_packagemanager_packagemanager_element.php
示例3: getPlugins
/**
* This method returns all plugins registered for the current extension point searching at the predefined path.
* By default, new instances of the classes are returned. If the implementing
* class requires specific constructor arguments, pass them as the second argument and they will be
* used during instantiation.
*
* @param array $arrConstructorArguments
*
* @static
* @return interface_generic_plugin[]
*/
public function getPlugins($arrConstructorArguments = array())
{
//load classes in passed-folders
$strKey = md5($this->strSearchPath . $this->strPluginPoint);
if (!array_key_exists($strKey, self::$arrPluginClasses)) {
$strPluginPoint = $this->strPluginPoint;
$arrClasses = class_resourceloader::getInstance()->getFolderContent($this->strSearchPath, array(".php"), false, function ($strOneFile) use($strPluginPoint) {
$strOneFile = uniSubstr($strOneFile, 0, -4);
if (uniStripos($strOneFile, "class_") === false || uniStrpos($strOneFile, "class_testbase") !== false) {
return false;
}
$objReflection = new ReflectionClass($strOneFile);
if (!$objReflection->isAbstract() && $objReflection->implementsInterface("interface_generic_plugin")) {
$objMethod = $objReflection->getMethod("getExtensionName");
if ($objMethod->invoke(null) == $strPluginPoint) {
return true;
}
}
return false;
}, function (&$strOneFile) {
$strOneFile = uniSubstr($strOneFile, 0, -4);
});
self::$arrPluginClasses[$strKey] = $arrClasses;
}
$arrReturn = array();
foreach (self::$arrPluginClasses[$strKey] as $strOneClass) {
$objReflection = new ReflectionClass($strOneClass);
if (count($arrConstructorArguments) > 0) {
$arrReturn[] = $objReflection->newInstanceArgs($arrConstructorArguments);
} else {
$arrReturn[] = $objReflection->newInstance();
}
}
return $arrReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:46,代码来源:class_pluginmanager.php
示例4: actionDownload
/**
* Sends the requested file to the browser
* @return string
*/
public function actionDownload()
{
//Load filedetails
if (validateSystemid($this->getSystemid())) {
/** @var $objFile class_module_mediamanager_file */
$objFile = class_objectfactory::getInstance()->getObject($this->getSystemid());
//Succeeded?
if ($objFile instanceof class_module_mediamanager_file && $objFile->getIntRecordStatus() == "1" && $objFile->getIntType() == class_module_mediamanager_file::$INT_TYPE_FILE) {
//Check rights
if ($objFile->rightRight2()) {
//Log the download
class_module_mediamanager_logbook::generateDlLog($objFile);
//Send the data to the browser
$strBrowser = getServer("HTTP_USER_AGENT");
//Check the current browsertype
if (uniStrpos($strBrowser, "IE") !== false) {
//Internet Explorer
class_response_object::getInstance()->addHeader("Content-type: application/x-ms-download");
class_response_object::getInstance()->addHeader("Content-type: x-type/subtype\n");
class_response_object::getInstance()->addHeader("Content-type: application/force-download");
class_response_object::getInstance()->addHeader("Content-Disposition: attachment; filename=" . preg_replace('/\\./', '%2e', saveUrlEncode(trim(basename($objFile->getStrFilename()))), substr_count(basename($objFile->getStrFilename()), '.') - 1));
} else {
//Good: another browser vendor
class_response_object::getInstance()->addHeader("Content-Type: application/octet-stream");
class_response_object::getInstance()->addHeader("Content-Disposition: attachment; filename=" . saveUrlEncode(trim(basename($objFile->getStrFilename()))));
}
//Common headers
class_response_object::getInstance()->addHeader("Expires: Mon, 01 Jan 1995 00:00:00 GMT");
class_response_object::getInstance()->addHeader("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
class_response_object::getInstance()->addHeader("Pragma: no-cache");
class_response_object::getInstance()->addHeader("Content-description: JustThum-Generated Data\n");
class_response_object::getInstance()->addHeader("Content-Length: " . filesize(_realpath_ . $objFile->getStrFilename()));
//End Session
$this->objSession->sessionClose();
class_response_object::getInstance()->sendHeaders();
//Loop the file
$ptrFile = @fopen(_realpath_ . $objFile->getStrFilename(), 'rb');
fpassthru($ptrFile);
@fclose($ptrFile);
ob_flush();
flush();
return "";
} else {
class_response_object::getInstance()->setStrStatusCode(class_http_statuscodes::SC_FORBIDDEN);
}
} else {
class_response_object::getInstance()->setStrStatusCode(class_http_statuscodes::SC_NOT_FOUND);
}
} else {
class_response_object::getInstance()->setStrStatusCode(class_http_statuscodes::SC_NOT_FOUND);
}
//if we reach up here, something gone wrong :/
class_response_object::getInstance()->setStrRedirectUrl(str_replace(array("_indexpath_", "&"), array(_indexpath_, "&"), class_link::getLinkPortalHref(class_module_system_setting::getConfigValue("_pages_errorpage_"))));
class_response_object::getInstance()->sendHeaders();
class_response_object::getInstance()->sendContent();
return "";
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:61,代码来源:download.php
示例5: getMessageproviders
/**
* @return interface_messageprovider[]
*/
public function getMessageproviders()
{
return class_resourceloader::getInstance()->getFolderContent("/system/messageproviders", array(".php"), false, function ($strOneFile) {
if (uniStrpos($strOneFile, "interface") !== false) {
return false;
}
return true;
}, function (&$strOneFile) {
$strOneFile = uniSubstr($strOneFile, 0, -4);
$strOneFile = new $strOneFile();
});
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:15,代码来源:class_module_messaging_messagehandler.php
示例6: getTotalUniquePackagesererSystems
function getTotalUniquePackagesererSystems()
{
$strQuery = "SELECT log_hostname, count(*) AS ANZ\n FROM " . _dbprefix_ . "packageserver_log\n GROUP BY log_hostname\n ORDER BY ANZ DESC ";
$intI = 0;
foreach (class_carrier::getInstance()->getObjDB()->getPArray($strQuery, array()) as $arrOneRow) {
if (uniStrpos($arrOneRow["log_hostname"], "localhost/") === false && uniStrpos($arrOneRow["log_hostname"], "kajona.de") === false && uniStrpos($arrOneRow["log_hostname"], "kajonabase") === false && uniStrpos($arrOneRow["log_hostname"], "aquarium") === false && uniStrpos($arrOneRow["log_hostname"], "stb400s") === false && $arrOneRow["log_hostname"] != "") {
echo sprintf("%4d", $arrOneRow["ANZ"]) . " => " . $arrOneRow["log_hostname"] . "<br />";
$intI++;
}
}
echo "Total: " . $intI . " systems<br />";
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:12,代码来源:statssimpletrend.php
示例7: getAvailablePackages
/**
* Queries the local filesystem in order to find all packages available.
* This may include packages of all providers.
* Optionally you may reduce the list of packages using a simple filter-string
*
* @param string $strFilterText
*
* @return class_module_packagemanager_metadata[]
*/
public function getAvailablePackages($strFilterText = "")
{
$arrReturn = array();
$objModuleProvider = new class_module_packagemanager_packagemanager_module();
$arrReturn = array_merge($arrReturn, $objModuleProvider->getInstalledPackages());
$objPackageProvider = new class_module_packagemanager_packagemanager_template();
$arrReturn = array_merge($objPackageProvider->getInstalledPackages(), $arrReturn);
if ($strFilterText != "") {
$arrReturn = array_filter($arrReturn, function ($objOneMetadata) use($strFilterText) {
return uniStrpos($objOneMetadata->getStrTitle(), $strFilterText) !== false;
});
}
return $arrReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:23,代码来源:class_module_packagemanager_manager.php
示例8: bootstrapIncludeModuleIds
/**
* Helper to load and scan all module-ids available. Triggered by the bootloader.
* Change with care
*
* @return void
*/
function bootstrapIncludeModuleIds()
{
//Module-Constants
foreach (scandir(_realpath_) as $strRootFolder) {
if (uniStrpos($strRootFolder, "core") === false) {
continue;
}
foreach (scandir(_realpath_ . "/" . $strRootFolder) as $strDirEntry) {
if (is_dir(_realpath_ . "/" . $strRootFolder . "/" . $strDirEntry) && is_dir(_realpath_ . "/" . $strRootFolder . "/" . $strDirEntry . "/system/") && is_dir(_realpath_ . "/" . $strRootFolder . "/" . $strDirEntry . "/system/config/")) {
foreach (scandir(_realpath_ . "/" . $strRootFolder . "/" . $strDirEntry . "/system/config/") as $strModuleEntry) {
if (preg_match("/module\\_([a-z0-9\\_])+\\_id\\.php/", $strModuleEntry)) {
@(include_once _realpath_ . "/" . $strRootFolder . "/" . $strDirEntry . "/system/config/" . $strModuleEntry);
}
}
}
}
}
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:24,代码来源:functions.php
示例9: testZipFileread
public function testZipFileread()
{
$objFileSystem = new class_filesystem();
echo "\ttesting class_zip file-reading...\n";
$objZip = new class_zip();
echo "\topening " . _realpath_ . "/test.zip\n";
$this->assertTrue($objZip->openArchiveForWriting("/files/cache/test.zip"), __FILE__ . " openArchive");
$this->assertTrue($objZip->addFile(class_resourceloader::getInstance()->getCorePathForModule("module_system") . "/module_system/metadata.xml"), __FILE__ . " addFile");
$this->assertTrue($objZip->closeArchive(), __FILE__ . " closeArchive");
$this->assertFileExists(_realpath_ . "/files/cache/test.zip", __FILE__ . " checkFileExists");
echo "\treading files\n";
$strContent = $objZip->getFileFromArchive("/files/cache/test.zip", class_resourceloader::getInstance()->getCorePathForModule("module_system") . "/module_system/metadata.xml");
$this->assertTrue(uniStrpos($strContent, "xsi:noNamespaceSchemaLocation=\"https://apidocs.kajona.de/xsd/package.xsd\"") !== false);
echo "\tremoving testfile\n";
$this->assertTrue($objFileSystem->fileDelete("/files/cache/test.zip"), __FILE__ . " deleteFile");
$this->assertFileNotExists(_realpath_ . "/files/cache/test.zip", __FILE__ . " checkFileNotExists");
$objFileSystem->folderDeleteRecursive("/files/cache/zipextract");
$this->assertFileNotExists(_realpath_ . "/files/cache/zipextract", __FILE__ . " checkFileNotExists");
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:19,代码来源:test_zipTest.php
示例10: getAdminForm
/**
* @see interface_admin_systemtask::getAdminForm()
* @return string
*/
public function getAdminForm()
{
$strReturn = "";
//show dropdown to select db-dump
$objFilesystem = new class_filesystem();
$arrFiles = $objFilesystem->getFilelist(_projectpath_ . "/dbdumps/", array(".sql", ".gz"));
$arrOptions = array();
foreach ($arrFiles as $strOneFile) {
$arrDetails = $objFilesystem->getFileDetails(_projectpath_ . "/dbdumps/" . $strOneFile);
$strTimestamp = "";
if (uniStrpos($strOneFile, "_") !== false) {
$strTimestamp = uniSubstr($strOneFile, uniStrrpos($strOneFile, "_") + 1, uniStrpos($strOneFile, ".") - uniStrrpos($strOneFile, "_"));
}
if (uniStrlen($strTimestamp) > 9 && is_numeric($strTimestamp)) {
$arrOptions[$strOneFile] = $strOneFile . " (" . bytesToString($arrDetails["filesize"]) . ")" . "<br />" . $this->getLang("systemtask_dbimport_datefilename") . " " . timeToString($strTimestamp) . "<br />" . $this->getLang("systemtask_dbimport_datefileinfo") . " " . timeToString($arrDetails['filechange']);
} else {
$arrOptions[$strOneFile] = $strOneFile . " (" . bytesToString($arrDetails["filesize"]) . ")" . "<br />" . $this->getLang("systemtask_dbimport_datefileinfo") . " " . timeToString($arrDetails['filechange']);
}
}
$strReturn .= $this->objToolkit->formInputRadiogroup("dbImportFile", $arrOptions, $this->getLang("systemtask_dbimport_file"));
return $strReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:26,代码来源:class_systemtask_dbimport.php
示例11: getWidgetOutput
/**
* This method is called, when the widget should generate it's content.
* Return the complete content using the methods provided by the base class.
* Do NOT use the toolkit right here!
*
* @return string
*/
public function getWidgetOutput()
{
$strReturn = "";
if ($this->getFieldValue("location") == "") {
return "Please set up a location";
}
if (uniStrpos($this->getFieldValue("location"), "GM") !== false) {
return "This widget changed, please update your location by editing the widget";
}
//request the xml...
try {
$strFormat = "metric";
if ($this->getFieldValue("unit") == "f") {
$strFormat = "imperial";
}
$objRemoteloader = new class_remoteloader();
$objRemoteloader->setStrHost("api.openweathermap.org");
$objRemoteloader->setStrQueryParams("/data/2.5/forecast/daily?APPID=4bdceecc2927e65c5fb712d1222c5293&q=" . $this->getFieldValue("location") . "&units=" . $strFormat . "&cnt=4");
$strContent = $objRemoteloader->getRemoteContent();
} catch (class_exception $objExeption) {
$strContent = "";
}
if ($strContent != "" && json_decode($strContent, true) !== null) {
$arrResponse = json_decode($strContent, true);
$strReturn .= $this->widgetText($this->getLang("weather_location_string") . $arrResponse["city"]["name"] . ", " . $arrResponse["city"]["country"]);
foreach ($arrResponse["list"] as $arrOneForecast) {
$objDate = new class_date($arrOneForecast["dt"]);
$strReturn .= "<div>";
$strReturn .= $this->widgetText("<div style='float: left;'>" . dateToString($objDate, false) . ": " . round($arrOneForecast["temp"]["day"], 1) . "°</div>");
$strReturn .= $this->widgetText("<img src='http://openweathermap.org/img/w/" . $arrOneForecast["weather"][0]["icon"] . ".png' style='float: right;' />");
$strReturn .= "</div><div style='clear: both;'></div>";
}
} else {
$strReturn .= $this->getLang("weather_errorloading");
}
return $strReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:44,代码来源:class_adminwidget_weather.php
示例12: setStrPath
public function setStrPath($strPath)
{
if (uniStrpos(uniSubstr($strPath, 0, 7), "files") === false) {
$strPath = "/files" . $strPath;
}
$this->strPath = $strPath;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:7,代码来源:class_module_mediamanager_repo.php
示例13: getLinkPortalHref
/**
* 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("&", $arrParams);
}
// add anchor if given
if ($strAnchor != "") {
$strHref .= "#" . $strAnchor;
}
//plus the domain as a prefix
//.........这里部分代码省略.........
开发者ID:jinshana,项目名称:kajonacms,代码行数:101,代码来源:class_link.php
示例14: kajonaTestTrigger
public function kajonaTestTrigger()
{
//setUp
$this->setUp();
//loop test methods
$objReflection = new ReflectionClass($this);
$arrMethods = $objReflection->getMethods();
foreach ($arrMethods as $objOneMethod) {
if (uniStrpos($objOneMethod->getName(), "test") !== false) {
echo "calling " . $objOneMethod->getName() . "...\n";
$objOneMethod->invoke($this);
}
}
//tearDown
$this->tearDown();
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:16,代码来源:autotest.php
示例15: getAdditionalProviders
/**
* Returns a list of objects implementing the changelog-provider-interface
* @return interface_changelog_provider[]
*/
public static function getAdditionalProviders()
{
if (self::$arrCachedProviders != null) {
return self::$arrCachedProviders;
}
$arrReturn = class_resourceloader::getInstance()->getFolderContent("/system", array(".php"), false, function ($strOneFile) {
if (uniStrpos($strOneFile, "class_changelog_provider") === false) {
return false;
}
$objReflection = new ReflectionClass(uniSubstr($strOneFile, 0, -4));
if ($objReflection->implementsInterface("interface_changelog_provider")) {
return true;
}
return false;
}, function (&$strOneFile) {
$objReflection = new ReflectionClass(uniSubstr($strOneFile, 0, -4));
$strOneFile = $objReflection->newInstance();
});
self::$arrCachedProviders = $arrReturn;
return $arrReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:25,代码来源:class_module_system_changelog.php
示例16: isRateableByCurrentUser
/**
* Checks, if the record is already rated by the current user to avoid double-ratings
*
* @return bool
*/
public function isRateableByCurrentUser()
{
$bitReturn = true;
//sql-check - only if user is not a guest
$arrRow = array();
$arrRow["COUNT(*)"] = 0;
if ($this->objSession->getUserID() != "") {
$strQuery = "SELECT COUNT(*) FROM " . $this->objDB->encloseTableName(_dbprefix_ . "rating_history") . "\n\t \t WHERE rating_history_rating = ?\n\t \t AND rating_history_user = ?";
$arrRow = $this->objDB->getPRow($strQuery, array($this->getSystemid(), $this->objSession->getUserID()));
}
if ($arrRow["COUNT(*)"] == 0) {
//cookie available?
$objCookie = new class_cookie();
if ($objCookie->getCookie(class_module_rating_rate::RATING_COOKIE) != "") {
$strRatingCookie = $objCookie->getCookie(class_module_rating_rate::RATING_COOKIE);
if (uniStrpos($strRatingCookie, $this->getSystemid()) !== false) {
$bitReturn = false;
}
}
} else {
$bitReturn = false;
}
return $bitReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:29,代码来源:class_module_rating_rate.php
示例17: getAllPackages
/**
* Internal helper, loads all files available including a traversal
* of the nested folders.
*
* @param $strParentId
* @param int|bool $strCategoryFilter
* @param int $intStart
* @param int $intEnd
* @param bool $strNameFilter
*
* @return class_module_mediamanager_file[]
*/
private function getAllPackages($strParentId, $strCategoryFilter = false, $intStart = null, $intEnd = null, $strNameFilter = false)
{
$arrReturn = array();
if (validateSystemid($strParentId)) {
$arrSubfiles = class_module_mediamanager_file::loadFilesDB($strParentId, false, true, null, null, true);
foreach ($arrSubfiles as $objOneFile) {
if ($objOneFile->getIntType() == class_module_mediamanager_file::$INT_TYPE_FILE) {
//filename based check if the file should be included
if ($strNameFilter !== false) {
if (uniStrpos($strNameFilter, ",") !== false) {
if (in_array($objOneFile->getStrName(), explode(",", $strNameFilter))) {
$arrReturn[] = $objOneFile;
}
} else {
if (uniSubstr($objOneFile->getStrName(), 0, uniStrlen($strNameFilter)) == $strNameFilter) {
$arrReturn[] = $objOneFile;
}
}
} else {
$arrReturn[] = $objOneFile;
}
} else {
$arrReturn = array_merge($arrReturn, $this->getAllPackages($objOneFile->getSystemid()));
}
}
if ($intStart !== null && $intEnd !== null && $intStart > 0 && $intEnd > $intStart) {
if ($intEnd > count($arrReturn)) {
$intEnd = count($arrReturn);
}
$arrTemp = array();
for ($intI = $intStart; $intI <= $intEnd; $intI++) {
$arrTemp[] = $arrReturn[$intI];
}
$arrReturn = $arrTemp;
}
//sort them by filename
usort($arrReturn, function (class_module_mediamanager_file $objA, class_module_mediamanager_file $objB) {
return strcmp($objA->getStrName(), $objB->getStrName());
});
} else {
$arrReturn = class_module_mediamanager_file::getFlatPackageList($strCategoryFilter, true, $intStart, $intEnd, $strNameFilter);
}
return $arrReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:56,代码来源:class_module_packageserver_portal.php
示例18: actionInsertGuestbook
/**
* Creates a form to handle a new post
*
* @param array $arrTemplateOld
*
* @internal param mixed $arrTemplate values to fill in
* @return string
*/
protected function actionInsertGuestbook($arrTemplateOld = array())
{
$strReturn = "";
$strTemplateID = $this->objTemplate->readTemplate("/module_guestbook/" . $this->arrElementData["guestbook_template"], "entry_form");
$strErrors = "";
if (count($this->arrErrors) > 0) {
$strErrorTemplateID = $this->objTemplate->readTemplate("/module_guestbook/" . $this->arrElementData["guestbook_template"], "error_row");
foreach ($this->arrErrors as $strOneError) {
$strErrors .= $this->fillTemplate(array("error" => $strOneError), $strErrorTemplateID);
}
}
//update elements
$arrTemplate = array();
$arrTemplate["eintragen_fehler"] = $this->getParam("eintragen_fehler") . $strErrors;
$arrTemplate["gb_post_name"] = $this->getParam("gb_post_name");
$arrTemplate["gb_post_email"] = $this->getParam("gb_post_email");
$arrTemplate["gb_post_text"] = $this->getParam("gb_post_text");
$arrTemplate["gb_post_page"] = $this->getParam("gb_post_page");
foreach ($arrTemplate as $strKey => $strValue) {
if (uniStrpos($strKey, "gb_post_") !== false) {
$arrTemplate[$strKey] = htmlspecialchars($strValue, ENT_QUOTES, "UTF-8", false);
}
}
$arrTemplate["action"] = getLinkPortalHref($this->getPagename(), "", "saveGuestbook");
$strReturn .= $this->fillTemplate($arrTemplate, $strTemplateID);
return $strReturn;
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:35,代码来源:class_module_guestbook_portal.php
示例19: getValidatorInstance
/**
* Loads the validator identified by the passed name.
*
* @param string $strClassname
*
* @throws class_exception
* @return interface_validator
*/
private function getValidatorInstance($strClassname)
{
if (uniStrpos($strClassname, "class_") === false) {
$strClassname = "class_" . $strClassname . "_validator";
}
if (class_resourceloader::getInstance()->getPathForFile("/system/validators/" . $strClassname . ".php")) {
return new $strClassname();
} else {
throw new class_exception("failed to load validator of type " . $strClassname, class_exception::$level_ERROR);
}
}
开发者ID:jinshana,项目名称:kajonacms,代码行数:19,代码来源:class_admin_formgenerator.php
示例20: actionList
/**
* 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->getFloatRatin
|
请发表评论