本文整理汇总了PHP中class_carrier类 的典型用法代码示例。如果您正苦于以下问题:PHP class_carrier类的具体用法?PHP class_carrier怎么用?PHP class_carrier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了class_carrier类 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: test
public function test()
{
$objDB = class_carrier::getInstance()->getObjDB();
echo "\tmodul_guestbook...\n";
echo "creating a new guestbook, moderated...\n";
$objGuestbook = new class_module_guestbook_guestbook();
$objGuestbook->setStrGuestbookTitle("test guestbook");
$objGuestbook->setIntGuestbookModerated(1);
$objGuestbook->updateObjectToDb();
$strGBId = $objGuestbook->getSystemid();
echo "adding a new post...\n";
$objPost = new class_module_guestbook_post();
$objPost->setStrGuestbookPostName("subject");
$objPost->setStrGuestbookPostText("test");
$objPost->updateObjectToDb($strGBId);
$objDB->flushQueryCache();
$this->assertEquals(0, count(class_module_guestbook_post::getPosts($strGBId, true)), __FILE__ . " check nr of posts portal");
$this->assertEquals(1, count(class_module_guestbook_post::getPosts($strGBId)), __FILE__ . " check nr of posts total");
echo "setting guestbook non-moderated...\n";
$objGuestbook->setIntGuestbookModerated(0);
$objGuestbook->updateObjectToDb();
$objDB->flushQueryCache();
echo "adding a new post...\n";
$objPost = new class_module_guestbook_post();
$objPost->setStrGuestbookPostName("subject2");
$objPost->setStrGuestbookPostText("test2");
$objPost->updateObjectToDb($strGBId);
$this->assertEquals(1, count(class_module_guestbook_post::getPosts($strGBId, true)), __FILE__ . " check nr of posts portal");
$this->assertEquals(2, count(class_module_guestbook_post::getPosts($strGBId)), __FILE__ . " check nr of posts total");
$objDB->flushQueryCache();
echo "deleting the guestbook...\n";
$objGuestbook->deleteObjectFromDatabase();
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:33, 代码来源:test_guestbookTest.php
示例2: 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
示例3: execute
public function execute()
{
$objDB = class_carrier::getInstance()->getObjDB();
$objDB->dumpDb();
//trigger again
return false;
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:7, 代码来源:class_workflow_workflows_dbdump.php
示例4: updateValue
/**
* Overwritten in order to load key-value pairs declared by annotations
*/
protected function updateValue()
{
parent::updateValue();
if ($this->getObjSourceObject() != null && $this->getStrSourceProperty() != "") {
$objReflection = new class_reflection($this->getObjSourceObject());
//try to find the matching source property
$arrProperties = $objReflection->getPropertiesWithAnnotation(self::STR_DDVALUES_ANNOTATION);
$strSourceProperty = null;
foreach ($arrProperties as $strPropertyName => $strValue) {
if (uniSubstr(uniStrtolower($strPropertyName), uniStrlen($this->getStrSourceProperty()) * -1) == $this->getStrSourceProperty()) {
$strSourceProperty = $strPropertyName;
}
}
if ($strSourceProperty == null) {
return;
}
$strDDValues = $objReflection->getAnnotationValueForProperty($strSourceProperty, self::STR_DDVALUES_ANNOTATION);
if ($strDDValues !== null && $strDDValues != "") {
$arrDDValues = array();
foreach (explode(",", $strDDValues) as $strOneKeyVal) {
$strOneKeyVal = uniSubstr(trim($strOneKeyVal), 1, -1);
$arrOneKeyValue = explode("=>", $strOneKeyVal);
$strKey = trim($arrOneKeyValue[0]) == "" ? " " : trim($arrOneKeyValue[0]);
if (count($arrOneKeyValue) == 2) {
$strValue = class_carrier::getInstance()->getObjLang()->getLang(trim($arrOneKeyValue[1]), $this->getObjSourceObject()->getArrModule("modul"));
if ($strValue == "!" . trim($arrOneKeyValue[1]) . "!") {
$strValue = $arrOneKeyValue[1];
}
$arrDDValues[$strKey] = $strValue;
}
}
$this->setArrKeyValues($arrDDValues);
}
}
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:38, 代码来源:class_formentry_dropdown.php
示例5: handleEvent
/**
* Searches for tags assigned to the systemid to be deleted.
*
* @param string $strEventName
* @param array $arrArguments
*
* @return bool
*/
public function handleEvent($strEventName, array $arrArguments)
{
//unwrap arguments
list($strSystemid, $strSourceClass) = $arrArguments;
$bitReturn = true;
if ($strSourceClass == "class_module_tags_tag" && class_module_system_module::getModuleByName("tags") != null) {
//delete matching favorites
class_orm_base::setObjHandleLogicalDeletedGlobal(class_orm_deletedhandling_enum::INCLUDED());
$arrFavorites = class_module_tags_favorite::getAllFavoritesForTag($strSystemid);
foreach ($arrFavorites as $objOneFavorite) {
if ($strEventName == class_system_eventidentifier::EVENT_SYSTEM_RECORDDELETED_LOGICALLY) {
$bitReturn = $bitReturn && $objOneFavorite->deleteObject();
}
if ($strEventName == class_system_eventidentifier::EVENT_SYSTEM_RECORDDELETED) {
$bitReturn = $bitReturn && $objOneFavorite->deleteObjectFromDatabase();
$bitReturn = $bitReturn && class_carrier::getInstance()->getObjDB()->_pQuery("DELETE FROM " . _dbprefix_ . "tags_member WHERE tags_tagid=?", array($strSystemid));
}
}
class_orm_base::setObjHandleLogicalDeletedGlobal(class_orm_deletedhandling_enum::EXCLUDED());
}
//delete memberships. Fire a plain query, faster then searching.
if ($strEventName == class_system_eventidentifier::EVENT_SYSTEM_RECORDDELETED) {
$bitReturn = $bitReturn && class_carrier::getInstance()->getObjDB()->_pQuery("DELETE FROM " . _dbprefix_ . "tags_member WHERE tags_systemid=?", array($strSystemid));
}
return $bitReturn;
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:34, 代码来源:class_module_tags_recorddeletedlistener.php
示例6: debugHelper
public function debugHelper()
{
echo "<pre>";
echo "<b>Kajona V4 Debug Subsystem</b>\n\n";
if (getGet("debugfile") != "") {
echo "Loading path for " . getGet("debugfile") . "\n";
$strPath = array_search(getGet("debugfile"), class_resourceloader::getInstance()->getFolderContent("/debug", array(".php")));
if ($strPath !== false) {
echo "Passing request to " . $strPath . "\n\n";
include _realpath_ . $strPath;
}
} else {
echo "Searching for debug-scripts available...\n";
$arrFiles = class_resourceloader::getInstance()->getFolderContent("/debug", array(".php"));
echo "<ul>";
foreach ($arrFiles as $strPath => $strOneFile) {
echo "<li><a href='?debugfile=" . $strOneFile . "' >" . $strOneFile . "</a> <br />" . $strPath . "</li>";
}
echo "</ul>";
}
$arrTimestampEnde = gettimeofday();
$intTimeUsed = ($arrTimestampEnde['sec'] * 1000000 + $arrTimestampEnde['usec'] - ($this->arrTimestampStart['sec'] * 1000000 + $this->arrTimestampStart['usec'])) / 1000000;
echo "\n\n<b>PHP-Time:</b> " . number_format($intTimeUsed, 6) . " sec \n";
echo "<b>Queries db/cachesize/cached/fired:</b> " . class_carrier::getInstance()->getObjDB()->getNumber() . "/" . class_carrier::getInstance()->getObjDB()->getCacheSize() . "/" . class_carrier::getInstance()->getObjDB()->getNumberCache() . "/" . (class_carrier::getInstance()->getObjDB()->getNumber() - class_carrier::getInstance()->getObjDB()->getNumberCache()) . "\n";
echo "<b>Templates cached:</b> " . class_carrier::getInstance()->getObjTemplate()->getNumberCacheSize() . " \n";
echo "<b>Memory/Max Memory:</b> " . bytesToString(memory_get_usage()) . "/" . bytesToString(memory_get_peak_usage()) . " \n";
echo "<b>Classes Loaded:</b> " . class_classloader::getInstance()->getIntNumberOfClassesLoaded() . " \n";
echo "<b>Cache requests/hits/saves/cachesize:</b> " . class_cache::getIntRequests() . "/" . class_cache::getIntHits() . "/" . class_cache::getIntSaves() . "/" . class_cache::getIntCachesize() . " \n";
echo "</pre>";
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:30, 代码来源:debug.php
示例7: install
public function install()
{
$strReturn = "";
$strReturn .= "Installing table packageserver_log...\n";
$arrFields = array();
$arrFields["log_id"] = array("char20", false);
$arrFields["log_query"] = array("text", true);
$arrFields["log_ip"] = array("char254", true);
$arrFields["log_hostname"] = array("char254", true);
$arrFields["log_date"] = array("long", true);
if (!$this->objDB->createTable("packageserver_log", $arrFields, array("log_id"), array("log_date"), false)) {
$strReturn .= "An error occurred! ...\n";
}
//register the module
$this->registerModule("packageserver", _packageserver_module_id_, "class_module_packageserver_portal.php", "class_module_packageserver_admin.php", $this->objMetadata->getStrVersion(), true);
$strReturn .= "creating package-upload-repository...\n";
$objFilesytem = new class_filesystem();
$objFilesytem->folderCreate("/files/packages");
$objRepo = new class_module_mediamanager_repo();
$objRepo->setStrPath("/files/packages");
$objRepo->setStrViewFilter(".zip");
$objRepo->setStrUploadFilter(".zip");
$objRepo->setStrTitle("Packageserver packages");
$objRepo->updateObjectToDb();
class_carrier::getInstance()->getObjRights()->addGroupToRight(class_module_system_setting::getConfigValue("_guests_group_id_"), $objRepo->getSystemid(), class_rights::$STR_RIGHT_RIGHT2);
$strReturn .= "Registering system-constants...\n";
$this->registerConstant("_packageserver_repo_id_", "", class_module_system_setting::$int_TYPE_STRING, _packageserver_module_id_);
$strReturn .= "Setting aspect assignments...\n";
if (class_module_system_aspect::getAspectByName("content") != null) {
$objModule = class_module_system_module::getModuleByName($this->objMetadata->getStrTitle());
$objModule->setStrAspect(class_module_system_aspect::getAspectByName("content")->getSystemid());
$objModule->updateObjectToDb();
}
return $strReturn;
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:35, 代码来源:class_installer_packageserver.php
示例8: generateFieldsFromObject
/**
* @inheritDoc
*/
public function generateFieldsFromObject()
{
parent::generateFieldsFromObject();
$objNews = $this->getObjSourceobject();
if ($objNews->getSystemid() != class_module_system_module::getModuleByName("news")->getSystemid()) {
//search the languages maintained
$objLanguageManager = class_module_languages_languageset::getLanguagesetForSystemid($objNews->getSystemid());
if ($objLanguageManager != null) {
$arrMaintained = $objLanguageManager->getArrLanguageSet();
$arrDD = array();
foreach ($arrMaintained as $strLanguageId => $strSystemid) {
$objLanguage = new class_module_languages_language($strLanguageId);
$arrDD[$strSystemid] = $this->getLang("lang_" . $objLanguage->getStrName(), "languages");
}
class_module_languages_admin::enableLanguageSwitch();
class_module_languages_admin::setArrLanguageSwitchEntries($arrDD);
class_module_languages_admin::setStrOnChangeHandler("window.location='" . class_link::getLinkAdminHref("news", "editNews") . (class_module_system_setting::getConfigValue("_system_mod_rewrite_") == "true" ? "?" : "&") . "systemid='+this.value+'&pe=" . class_carrier::getInstance()->getParam("pe") . "';");
class_module_languages_admin::setStrActiveKey($objNews->getSystemid());
}
}
$arrCats = class_module_news_category::getObjectList();
if (count($arrCats) > 0) {
$arrKeyValues = array();
/** @var class_module_news_category $objOneCat */
foreach ($arrCats as $objOneCat) {
$arrKeyValues[$objOneCat->getSystemid()] = $objOneCat->getStrDisplayName();
}
$this->getField("cats")->setStrLabel($this->getLang("commons_categories"))->setArrKeyValues($arrKeyValues);
}
if (class_module_system_setting::getConfigValue("_news_news_datetime_") == "true") {
$this->addField(new class_formentry_datetime($this->getStrFormname(), "objDateStart", $objNews), "datestart")->setBitMandatory(true)->setStrLabel($this->getLang("form_news_datestart"));
$this->addField(new class_formentry_datetime($this->getStrFormname(), "objDateEnd", $objNews), "dateend")->setStrLabel($this->getLang("form_news_dateend"));
$this->addField(new class_formentry_datetime($this->getStrFormname(), "objDateSpecial", $objNews), "datespecial")->setStrLabel($this->getLang("form_news_datespecial"));
}
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:38, 代码来源:class_module_news_news_formgenerator.php
示例9: 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()
{
if (!class_module_system_module::getModuleByName("system")->rightView() || !class_carrier::getInstance()->getObjSession()->isSuperAdmin()) {
return $this->getLang("commons_error_permissions");
}
$strReturn = "<style type=\"text/css\">\n .adminwidget_systemcheck .ok {\n color: green;\n }\n .adminwidget_systemcheck .nok {\n color: red;\n font-weight: bold;\n }\n </style>";
//check wich infos to produce
if ($this->getFieldValue("php") == "checked") {
$strReturn .= $this->widgetText($this->getLang("systemcheck_php_safemode") . (ini_get("safe_mode") ? $this->getLang("commons_yes") : $this->getLang("commons_no")));
$strReturn .= $this->widgetText($this->getLang("systemcheck_php_urlfopen") . (ini_get("allow_url_fopen") ? $this->getLang("commons_yes") : $this->getLang("commons_no")));
$strReturn .= $this->widgetText($this->getLang("systemcheck_php_regglobal") . (ini_get("register_globals") ? "<span class=\"nok\">" . $this->getLang("commons_yes") . "</span>" : "<span class=\"ok\">" . $this->getLang("commons_no") . "</span>"));
$strReturn .= $this->widgetSeparator();
}
if ($this->getFieldValue("kajona") == "checked") {
$arrFilesAvailable = array("/installer.php", "/debug.php", "/v3_v4_postupdate.php");
foreach ($arrFilesAvailable as $strOneFile) {
$strReturn .= $this->widgetText($strOneFile . " " . $this->getLang("systemcheck_kajona_filepresent") . (is_file(_realpath_ . $strOneFile) ? " <span class=\"nok\">" . $this->getLang("commons_yes") . "</span>" : " <span class=\"ok\">" . $this->getLang("commons_no") . "</span>"));
}
$strReturn .= $this->widgetText($this->getLang("systemcheck_kajona_writeper") . " /project/system/config/config.php " . (is_writable(_realpath_ . "/project/system/config/config.php") ? "<span class=\"nok\">" . $this->getLang("commons_yes") . "</span>" : "<span class=\"ok\">" . $this->getLang("commons_no") . "</span>"));
$strReturn .= $this->widgetText($this->getLang("systemcheck_kajona_writeper") . " /project/log/ " . (is_writable(_realpath_ . "/project/log/") ? "<span class=\"ok\">" . $this->getLang("commons_yes") . "</span>" : "<span class=\"nok\">" . $this->getLang("commons_no") . "</span>"));
$strReturn .= $this->widgetText($this->getLang("systemcheck_kajona_writeper") . " /project/dbdumps/ " . (is_writable(_realpath_ . "/project/dbdumps/") ? "<span class=\"ok\">" . $this->getLang("commons_yes") . "</span>" : "<span class=\"nok\">" . $this->getLang("commons_no") . "</span>"));
$strReturn .= $this->widgetText($this->getLang("systemcheck_kajona_writeper") . " /project/temp " . (is_writable(_realpath_ . "/project/temp") ? "<span class=\"ok\">" . $this->getLang("commons_yes") . "</span>" : "<span class=\"nok\">" . $this->getLang("commons_no") . "</span>"));
$strReturn .= $this->widgetText($this->getLang("systemcheck_kajona_writeper") . " " . _images_cachepath_ . " " . (is_writable(_realpath_ . "/" . _images_cachepath_) ? "<span class=\"ok\">" . $this->getLang("commons_yes") . "</span>" : "<span class=\"nok\">" . $this->getLang("commons_no") . "</span>"));
foreach (class_classloader::getCoreDirectories() as $strOneCore) {
$strReturn .= $this->widgetText($this->getLang("systemcheck_kajona_writeper") . " /" . $strOneCore . " " . (is_writable(_realpath_ . "/" . $strOneCore) ? "<span class=\"ok\">" . $this->getLang("commons_yes") . "</span>" : "<span class=\"nok\">" . $this->getLang("commons_no") . "</span>"));
}
}
return "<div class=\"adminwidget_systemcheck\">" . $strReturn . "</div>";
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:36, 代码来源:class_adminwidget_systemcheck.php
示例10: validateObject
/**
* Validates a news start/end/archive date for a correct logical order.
*
*
* @param class_model $objObject - the model object to the given form
* @return bool
*/
public function validateObject(class_model $objObject)
{
$objLang = class_carrier::getInstance()->getObjLang();
$strModuleName = $objObject->getArrModule("modul");
if ($objObject instanceof class_module_news_news) {
//validate: $objStartDate < $objSpecialDate < $objEndDate
$objStartDate = $objObject->getObjStartDate();
$objEndDate = $objObject->getObjEndDate();
$objSpecialDate = $objObject->getObjSpecialDate();
$strLabelStartDate = $objLang->getLang("form_" . $objObject->getArrModule("modul") . "_datestart", $strModuleName);
$strLabelEndDate = $objLang->getLang("form_" . $objObject->getArrModule("modul") . "_dateend", $strModuleName);
$strLabelSpecialDate = $objLang->getLang("form_" . $objObject->getArrModule("modul") . "_datespecial", $strModuleName);
if ($objStartDate != null && $objEndDate != null) {
if (class_objectvalidator_helper::compareDates($objStartDate, $objEndDate) === 1) {
$this->addValidationError("startdate", $objLang->getLang("commons_object_validator_datecompare_validationmessage_before", $strModuleName, array($strLabelStartDate, $strLabelEndDate)));
}
}
if ($objSpecialDate != null && $objEndDate != null) {
if (class_objectvalidator_helper::compareDates($objSpecialDate, $objEndDate) === 1) {
$this->addValidationError("startdate", $objLang->getLang("commons_object_validator_datecompare_validationmessage_before", $strModuleName, array($strLabelSpecialDate, $strLabelEndDate)));
}
}
if ($objStartDate != null && $objSpecialDate != null) {
if (class_objectvalidator_helper::compareDates($objStartDate, $objSpecialDate) === 1) {
$this->addValidationError("startdate", $objLang->getLang("commons_object_validator_datecompare_validationmessage_before", $strModuleName, array($strLabelStartDate, $strLabelSpecialDate)));
}
}
} else {
return false;
}
return count($this->getArrValidationMessages()) == 0;
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:39, 代码来源:class_news_news_objectvalidator.php
示例11: install
public function install()
{
$strReturn = "";
$objManager = new class_orm_schemamanager();
$strReturn .= "Installing table votings_voting...\n";
$objManager->createTable("class_module_votings_voting");
$strReturn .= "Installing table votings_answer...\n";
$objManager->createTable("class_module_votings_answer");
//register the module
$strSystemID = $this->registerModule($this->objMetadata->getStrTitle(), _votings_module_id_, "class_module_votings_portal.php", "class_module_votings_admin.php", $this->objMetadata->getStrVersion(), true);
//modify default rights to allow guests to vote
$strReturn .= "Modifying modules' rights node...\n";
class_carrier::getInstance()->getObjRights()->addGroupToRight(class_module_system_setting::getConfigValue("_guests_group_id_"), $strSystemID, "right1");
$strReturn .= "Registering votings-element...\n";
if (class_module_pages_element::getElement("votings") == null) {
$objElement = new class_module_pages_element();
$objElement->setStrName("votings");
$objElement->setStrClassAdmin("class_element_votings_admin.php");
$objElement->setStrClassPortal("class_element_votings_portal.php");
$objElement->setIntCachetime(-1);
$objElement->setIntRepeat(1);
$objElement->setStrVersion($this->objMetadata->getStrVersion());
$objElement->updateObjectToDb();
$strReturn .= "Element registered...\n";
} else {
$strReturn .= "Element already installed!...\n";
}
$strReturn .= "Setting aspect assignments...\n";
if (class_module_system_aspect::getAspectByName("content") != null) {
$objModule = class_module_system_module::getModuleByName($this->objMetadata->getStrTitle());
$objModule->setStrAspect(class_module_system_aspect::getAspectByName("content")->getSystemid());
$objModule->updateObjectToDb();
}
return $strReturn;
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:35, 代码来源:class_installer_votings.php
示例12: __construct
/**
* Default constructor
*/
public function __construct()
{
// Try to overwrite PHP memory-limit so large images can be processed, too
if (class_carrier::getInstance()->getObjConfig()->getPhpIni("memory_limit") < 128) {
@ini_set("memory_limit", "128M");
}
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:10, 代码来源:class_image2.php
示例13: generateLogEntry
/**
* Generates a new entry in the log-table
*
* @param string $strSeachterm
*
* @return bool
* @static
*/
public static function generateLogEntry($strSeachterm)
{
$objLanguage = new class_module_languages_language();
$strLanguage = $objLanguage->getStrPortalLanguage();
$strQuery = "INSERT INTO " . _dbprefix_ . "search_log \n (search_log_id, search_log_date, search_log_query, search_log_language) VALUES\n (?, ?, ?, ? )";
return class_carrier::getInstance()->getObjDB()->_pQuery($strQuery, array(generateSystemid(), (int) time(), $strSeachterm, $strLanguage));
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:15, 代码来源:class_module_search_log.php
示例14: checkSingleLevel
private function checkSingleLevel($strParentId, &$arrReturn)
{
$objRights = class_carrier::getInstance()->getObjRights();
$arrParentRights = $objRights->getArrayRights($strParentId);
//load the sub-ordinate nodes
$objCommon = new class_module_system_common();
$arrChildNodes = $objCommon->getChildNodesAsIdArray($strParentId);
foreach ($arrChildNodes as $strOneChildId) {
if (!$objRights->isInherited($strOneChildId)) {
$arrChildRights = $objRights->getArrayRights($strOneChildId);
$bitIsDifferent = false;
foreach ($arrChildRights as $strPermission => $arrOneChildPermission) {
if ($strPermission == class_rights::$STR_RIGHT_INHERIT) {
continue;
}
if (count(array_diff($arrChildRights[$strPermission], $arrParentRights[$strPermission])) != 0) {
$bitIsDifferent = true;
break;
}
}
if (!$bitIsDifferent) {
$arrReturn[] = class_objectfactory::getInstance()->getObject($strOneChildId);
$objRights->setInherited(true, $strOneChildId);
}
}
$this->checkSingleLevel($strOneChildId, $arrReturn);
}
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:28, 代码来源:class_systemtask_rightsinheritcheck.php
示例15: handleEvent
/**
* Searches for languagesets containing the current systemid. either as a language or a referenced record.
* Called whenever a records was deleted using the common methods.
* Implement this method to be notified when a record is deleted, e.g. to to additional cleanups afterwards.
* There's no need to register the listener, this is done automatically.
* Make sure to return a matching boolean-value, otherwise the transaction may be rolled back.
*
* @param string $strEventName
* @param array $arrArguments
*
* @return bool
*/
public function handleEvent($strEventName, array $arrArguments)
{
//unwrap arguments
list($strSystemid, $strSourceClass) = $arrArguments;
if ($strSourceClass == "class_module_languages_language") {
//if we have just one language remaining, set this one as default
$arrObjLanguages = class_module_languages_language::getObjectList();
if (count($arrObjLanguages) == 1) {
$objOneLanguage = $arrObjLanguages[0];
$objOneLanguage->setBitDefault(1);
$objOneLanguage->updateObjectToDb();
}
//check if the current active one was deleted. if, then reset. #kajona trace id 613
$objLanguage = new class_module_languages_language();
$arrLangs = class_module_languages_language::getObjectList();
$arrFiltered = array_filter($arrLangs, function (class_module_languages_language $objSingleLang) use($objLanguage) {
return $objSingleLang->getStrName() == $objLanguage->getAdminLanguage();
});
if (count($arrFiltered) == 0 && count($arrLangs) > 0) {
$objLanguage->setStrAdminLanguageToWorkOn($arrLangs[0]->getStrName());
}
}
//fire a plain query on the database, much faster then searching for matching records
$strQuery = "DELETE FROM " . _dbprefix_ . "languages_languageset\n WHERE languageset_language = ?\n OR languageset_systemid = ?";
class_carrier::getInstance()->getObjDB()->_pQuery($strQuery, array($strSystemid, $strSystemid));
return true;
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:39, 代码来源:class_module_languages_recorddeletedlistener.php
示例16: testDateToString
/**
* @return void
*/
public function testDateToString()
{
class_carrier::getInstance()->getObjLang()->setStrTextLanguage("de");
if (class_carrier::getInstance()->getObjLang()->getLang("dateStyleShort", "system") != "d.m.Y") {
return;
}
$this->assertEquals("15.05.2013", dateToString(new class_date(20130515122324), false));
$this->assertEquals("15.05.2013 12:23:24", dateToString(new class_date(20130515122324), true));
$this->assertEquals("15.05.2013", dateToString(new class_date("20130515122324"), false));
$this->assertEquals("15.05.2013 12:23:24", dateToString(new class_date("20130515122324"), true));
$this->assertEquals("15.05.2013", dateToString(20130515122324, false));
$this->assertEquals("15.05.2013 12:23:24", dateToString(20130515122324, true));
$this->assertEquals("15.05.2013", dateToString("20130515122324", false));
$this->assertEquals("15.05.2013 12:23:24", dateToString("20130515122324", true));
$this->assertEquals("", dateToString(null));
$this->assertEquals("", dateToString(""));
$this->assertEquals("", dateToString("asdfsfdsfdsfds"));
class_carrier::getInstance()->getObjLang()->setStrTextLanguage("en");
if (class_carrier::getInstance()->getObjLang()->getLang("dateStyleShort", "system") != "m/d/Y") {
return;
}
$this->assertEquals("05/15/2013", dateToString(new class_date(20130515122324), false));
$this->assertEquals("05/15/2013 12:23:24", dateToString(new class_date(20130515122324), true));
$this->assertEquals("05/15/2013", dateToString(new class_date("20130515122324"), false));
$this->assertEquals("05/15/2013 12:23:24", dateToString(new class_date("20130515122324"), true));
$this->assertEquals("05/15/2013", dateToString(20130515122324, false));
$this->assertEquals("05/15/2013 12:23:24", dateToString(20130515122324, true));
$this->assertEquals("05/15/2013", dateToString("20130515122324", false));
$this->assertEquals("05/15/2013 12:23:24", dateToString("20130515122324", true));
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:33, 代码来源:test_functionsTest.php
示例17: 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
示例18: getValueAsText
/**
* Returns a textual representation of the formentries' value.
* May contain html, but should be stripped down to text-only.
*
* @return string
*/
public function getValueAsText()
{
if ($this->getStrValue()) {
return class_carrier::getInstance()->getObjLang()->getLang("commons_yes", "system");
} else {
return class_carrier::getInstance()->getObjLang()->getLang("commons_no", "system");
}
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:14, 代码来源:class_formentry_yesno.php
示例19: 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 = "";
$strReturn .= $this->widgetText($this->getLang("workflows_intro"));
$strReturn .= $this->widgetText(class_module_workflows_workflow::getPendingWorkflowsForUserCount(array_merge(array(class_carrier::getInstance()->getObjSession()->getUserID()), class_carrier::getInstance()->getObjSession()->getGroupIdsAsArray())));
$strReturn .= $this->widgetText(getLinkAdmin("workflows", "myList", "", $this->getLang("workflows_show")));
return $strReturn;
}
开发者ID:jinshana, 项目名称:kajonacms, 代码行数:15, 代码来源:class_adminwidget_workflows.php
NanoMichael/MicroTeX: A dynamic, cross-platform, and embeddable LaTeX rendering
阅读:882| 2022-08-12
bradtraversy/iweather: Ionic 3 mobile weather app
阅读:1583| 2022-08-30
joaomh/curso-de-matlab
阅读:1147| 2022-08-17
魔兽世界怀旧服已经开启两个多月了,但作为一个猎人玩家,抓到“断牙”,已经成为了一
阅读:1001| 2022-11-06
rugk/mastodon-simplified-federation: Simplifies following and interacting with r
阅读:1079| 2022-08-17
An issue was discovered in Inductive Automation Ignition before 7.9.20 and 8.x b
阅读:916| 2022-07-29
Tangshitao/Dense-Scene-Matching: Learning Camera Localization via Dense Scene Ma
阅读:759| 2022-08-16
json4s/json4s: JSON library
阅读:775| 2022-08-15
相信不少果粉在对自己的设备进行某些操作时,都会碰到Respring,但这个 Respring 到底
阅读:361| 2022-11-06
lightningtgc/MProgress.js: Material Progress —Google Material Design Progress l
阅读:405| 2022-08-17
请发表评论