本文整理汇总了PHP中class_module_system_module::getModuleByName方法的典型用法代码示例。如果您正苦于以下问题:PHP class_module_system_module::getModuleByName方法的具体用法?PHP class_module_system_module::getModuleByName怎么用?PHP class_module_system_module::getModuleByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类class_module_system_module
的用法示例。
在下文中一共展示了class_module_system_module::getModuleByName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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"));
}
}
示例2: remove
/**
* Removes the elements / modules handled by the current installer.
* Use the reference param to add a human readable logging.
*
* @param string &$strReturn
*
* @return bool
*/
public function remove(&$strReturn)
{
/** @var class_module_rating_rate $objOneObject */
foreach (class_module_rating_rate::getObjectList() as $objOneObject) {
$strReturn .= "Deleting object '" . $objOneObject->getStrDisplayName() . "' ...\n";
if (!$objOneObject->deleteObjectFromDatabase()) {
$strReturn .= "Error deleting object, aborting.\n";
return false;
}
}
//delete the module-node
$strReturn .= "Deleting the module-registration...\n";
$objModule = class_module_system_module::getModuleByName($this->objMetadata->getStrTitle(), true);
if (!$objModule->deleteObjectFromDatabase()) {
$strReturn .= "Error deleting module, aborting.\n";
return false;
}
//delete the tables
foreach (array("rating", "rating_history") as $strOneTable) {
$strReturn .= "Dropping table " . $strOneTable . "...\n";
if (!$this->objDB->_pQuery("DROP TABLE " . $this->objDB->encloseTableName(_dbprefix_ . $strOneTable) . "", array())) {
$strReturn .= "Error deleting table, aborting.\n";
return false;
}
}
return true;
}
示例3: 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;
}
示例4: testFileSync
public function testFileSync()
{
echo "test mediamanager...\n";
if (class_module_system_module::getModuleByName("samplecontent") == null || !is_file(_realpath_ . "/files/images/samples/IMG_3000.JPG")) {
return;
}
$objFilesystem = new class_filesystem();
$objFilesystem->folderCreate(_filespath_ . "/images/autotest");
$objFilesystem->fileCopy(_filespath_ . "/images/samples/IMG_3000.JPG", _filespath_ . "/images/autotest/IMG_3000.jpg");
$objFilesystem->fileCopy(_filespath_ . "/images/samples/IMG_3000.JPG", _filespath_ . "/images/autotest/IMG_3000.png");
$objFilesystem->fileCopy(_filespath_ . "/images/samples/IMG_3000.JPG", _filespath_ . "/images/autotest/PA021805.JPG");
$objFilesystem->fileCopy(_filespath_ . "/images/samples/IMG_3000.JPG", _filespath_ . "/images/autotest/test.txt");
$objRepo = new class_module_mediamanager_repo();
$objRepo->setStrPath(_filespath_ . "/images/autotest");
$objRepo->setStrTitle("autotest repo");
$objRepo->setStrViewFilter(".jpg,.png");
$objRepo->updateObjectToDb();
$objRepo->syncRepo();
$arrFiles = class_module_mediamanager_file::loadFilesDB($objRepo->getSystemid());
$this->assertEquals(3, count($arrFiles));
foreach ($arrFiles as $objOneFile) {
$objOneFile->deleteObjectFromDatabase();
}
$objRepo->deleteObjectFromDatabase();
$arrFiles = $objFilesystem->getFilelist(_filespath_ . "/images/autotest");
$this->assertEquals(1, count($arrFiles));
$this->assertEquals("test.txt", array_values($arrFiles)[0]);
}
示例5: actionBrowserChooser
/**
* @return string
* @autoTestable
* @permissions view
*/
protected function actionBrowserChooser()
{
$strReturn = "";
if ($this->getParam("CKEditorFuncNum") != "") {
$strReturn .= "<script type=\"text/javascript\">window.opener.KAJONA.admin.folderview.selectCallbackCKEditorFuncNum = " . (int) $this->getParam("CKEditorFuncNum") . ";</script>";
}
$intCounter = 1;
$strReturn .= $this->objToolkit->listHeader();
if (class_module_system_module::getModuleByName("pages") !== null) {
$strAction = $this->objToolkit->listButton(class_link::getLinkAdmin("pages", "pagesFolderBrowser", "&pages=1&form_element=" . $this->getParam("form_element") . "&bit_link=1", $this->getLang("wysiwygPagesBrowser"), $this->getLang("wysiwygPagesBrowser"), "icon_folderActionOpen"));
$strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("wysiwygPagesBrowser"), "", $strAction, $intCounter++);
}
$strRepoId = class_module_system_setting::getConfigValue("_mediamanager_default_filesrepoid_");
if (validateSystemid($strRepoId) && class_module_system_module::getModuleByName("mediamanager") !== null && class_objectfactory::getInstance()->getObject($strRepoId) !== null) {
$strAction = $this->objToolkit->listButton(class_link::getLinkAdmin("mediamanager", "folderContentFolderviewMode", "&systemid=" . $strRepoId . "&form_element=" . $this->getParam("form_element") . "&bit_link=1", $this->getLang("wysiwygFilesBrowser"), $this->getLang("wysiwygFilesBrowser"), "icon_folderActionOpen"));
$strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("wysiwygFilesBrowser"), "", $strAction, $intCounter++);
}
$strRepoId = class_module_system_setting::getConfigValue("_mediamanager_default_imagesrepoid_");
if (validateSystemid($strRepoId) && class_module_system_module::getModuleByName("mediamanager") !== null && class_objectfactory::getInstance()->getObject($strRepoId) !== null) {
$strAction = $this->objToolkit->listButton(class_link::getLinkAdmin("mediamanager", "folderContentFolderviewMode", "&systemid=" . $strRepoId . "&form_element=" . $this->getParam("form_element") . "&bit_link=1", $this->getLang("wysiwygImagesBrowser"), $this->getLang("wysiwygImagesBrowser"), "icon_folderActionOpen"));
$strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("wysiwygImagesBrowser"), "", $strAction, $intCounter++);
}
if (class_module_system_module::getModuleByName("mediamanager") !== null) {
$strAction = $this->objToolkit->listButton(class_link::getLinkAdmin("mediamanager", "folderContentFolderviewMode", "&form_element=" . $this->getParam("form_element") . "&bit_link=1", $this->getLang("wysiwygRepoBrowser"), $this->getLang("wysiwygRepoBrowser"), "icon_folderActionOpen"));
$strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("wysiwygRepoBrowser"), "", $strAction, $intCounter++);
}
$strReturn .= $this->objToolkit->listFooter();
return $strReturn;
}
示例6: install
public function install()
{
$strReturn = "";
$objManager = new class_orm_schemamanager();
$strReturn .= "Installing table templatepacks...\n";
$objManager->createTable("class_module_packagemanager_template");
//register the module
$this->registerModule("packagemanager", _packagemanager_module_id_, "", "class_module_packagemanager_admin.php", $this->objMetadata->getStrVersion(), true);
$strReturn .= "Registering system-constants...\n";
$this->registerConstant("_packagemanager_defaulttemplate_", "default", class_module_system_setting::$int_TYPE_STRING, _packagemanager_module_id_);
$strReturn .= "Initial templatepack sync...\n";
class_module_packagemanager_template::syncTemplatepacks();
$arrPacks = class_module_packagemanager_template::getObjectList();
if (count($arrPacks) > 0) {
//search the default package
foreach ($arrPacks as $objOnePack) {
if ($objOnePack->getStrName() == "default") {
$objOnePack->setIntRecordStatus(1);
$objOnePack->updateObjectToDb();
}
}
}
$strReturn .= "Setting aspect assignments...\n";
if (class_module_system_aspect::getAspectByName("management") != null) {
$objModule = class_module_system_module::getModuleByName($this->objMetadata->getStrTitle());
$objModule->setStrAspect(class_module_system_aspect::getAspectByName("management")->getSystemid());
$objModule->updateObjectToDb();
}
return $strReturn;
}
示例7: install
public function install()
{
$strReturn = "";
if (class_module_system_module::getModuleByName("mediamanager") == null) {
return "Mediamanger not installed, skipping element\n";
}
//Table for page-element
$strReturn .= "Installing downloads-element table...\n";
$objManager = new class_orm_schemamanager();
$objManager->createTable("class_element_downloads_admin");
//Register the element
$strReturn .= "Registering downloads-element...\n";
if (class_module_system_module::getModuleByName("pages") !== null && class_module_pages_element::getElement("downloads") == null) {
$objElement = new class_module_pages_element();
$objElement->setStrName("downloads");
$objElement->setStrClassAdmin("class_element_downloads_admin.php");
$objElement->setStrClassPortal("class_element_downloads_portal.php");
$objElement->setIntCachetime(3600);
$objElement->setIntRepeat(1);
$objElement->setStrVersion($this->objMetadata->getStrVersion());
$objElement->updateObjectToDb();
$strReturn .= "Element registered...\n";
} else {
$strReturn .= "Element already installed or pages module not installed!...\n";
}
return $strReturn;
}
示例8: testObjectValidator
/**
* Checks if the references of the source object is correctly set after validation
*/
public function testObjectValidator()
{
$objModule = class_module_system_module::getModuleByName("news");
if ($objModule == null) {
return;
}
$objNews = new class_module_news_news();
$objForm = new class_admin_formgenerator("news", $objNews);
$objForm->generateFieldsFromObject();
$objSourceObjectBefore = $objForm->getObjSourceobject();
$arrFieldsBefore = $objForm->getArrFields();
$objForm->validateForm();
$objSourceObjectAfter = $objForm->getObjSourceobject();
$arrFieldsAfter = $objForm->getArrFields();
//Now check if the reference to the source object before validation is the same as after
foreach ($objForm->getArrFields() as $intIndex => $objField) {
if ($arrFieldsAfter != null) {
$this->assertTrue($arrFieldsBefore[$intIndex]->getObjSourceObject() === $arrFieldsAfter[$intIndex]->getObjSourceObject());
if ($arrFieldsBefore[$intIndex]->getObjSourceObject() != null) {
$this->assertTrue($arrFieldsBefore[$intIndex]->getObjSourceObject() === $objSourceObjectBefore);
$this->assertTrue($arrFieldsBefore[$intIndex]->getObjSourceObject() === $objSourceObjectAfter);
}
if ($arrFieldsAfter[$intIndex]->getObjSourceObject() != null) {
$this->assertTrue($arrFieldsAfter[$intIndex]->getObjSourceObject() === $objSourceObjectBefore);
$this->assertTrue($arrFieldsAfter[$intIndex]->getObjSourceObject() === $objSourceObjectAfter);
}
}
}
$this->assertTrue($objSourceObjectAfter === $objSourceObjectBefore);
}
示例9: executeTask
/**
* @see interface_admin_systemtast::executeTask()
* @return string
*/
public function executeTask()
{
if (!class_module_system_module::getModuleByName("stats")->rightEdit()) {
return $this->getLang("commons_error_permissions");
}
$objBrowscap = new class_browscap();
$objBrowscap->updateBrowscap();
return $this->objToolkit->getTextRow($this->getLang("browscapupdate_end"));
}
示例10: loadData
/**
* Loads the navigation-class and passes control
*
* @return string
*/
public function loadData()
{
$strReturn = "";
$objNaviModule = class_module_system_module::getModuleByName("navigation");
if ($objNaviModule != null) {
$objNavigation = $objNaviModule->getPortalInstanceOfConcreteModule($this->arrElementData);
$strReturn = $objNavigation->action();
}
return $strReturn;
}
示例11: executeTask
/**
* @see interface_admin_systemtask::executeTask()
* @return string
*/
public function executeTask()
{
if (!class_module_system_module::getModuleByName("workflows")->rightRight1()) {
return $this->getLang("commons_error_permissions");
}
$objWorkflowController = new class_workflows_controller();
$objWorkflowController->scheduleWorkflows();
$objWorkflowController->runWorkflows();
return "";
}
示例12: executeTask
/**
* @see interface_admin_systemtast::executeTask()
* @return string
*/
public function executeTask()
{
if (!class_module_system_module::getModuleByName("stats")->rightEdit()) {
return $this->getLang("commons_error_permissions");
}
$strReturn = "";
$objWorker = new class_module_stats_worker("");
$objWorker->hostnameLookupResetHostnames();
$strReturn .= $this->objToolkit->getTextRow($this->getLang("worker_lookupReset_end"));
return $strReturn;
}
示例13: testObjectIndexerPerformance
public function testObjectIndexerPerformance()
{
if (class_module_system_module::getModuleByName("news") === null) {
return;
}
$arrNewsIds = array();
echo "Indexing without deferred indexer...\n";
class_module_system_changelog::$bitChangelogEnabled = false;
$intTimeStart = microtime(true);
$intQueriesStart = class_db::getInstance()->getNumber();
for ($intI = 0; $intI < 15; $intI++) {
$objNews = new class_module_news_news();
$objNews->setStrTitle("demo 1");
$objNews->setStrIntro("intro demo news");
$objNews->setStrText("text demo news");
$objNews->updateObjectToDb();
$arrNewsIds[] = $objNews->getSystemid();
}
echo "Queries pre indexing: ", class_db::getInstance()->getNumber() - $intQueriesStart . " \n";
$objHandler = new class_module_search_request_endprocessinglistener();
$objHandler->handleEvent(class_system_eventidentifier::EVENT_SYSTEM_REQUEST_AFTERCONTENTSEND, array());
$intTimeEnd = microtime(true);
$time = $intTimeEnd - $intTimeStart;
echo "Object updates: ", sprintf('%f', $time), " sec.\n";
echo "Queries total: ", class_db::getInstance()->getNumber() - $intQueriesStart . " \n";
echo "\nIndexing with deferred indexer...\n";
$objConfig = class_module_system_setting::getConfigByName("_search_deferred_indexer_");
$objConfig->setStrValue("true");
$objConfig->updateObjectToDb();
$intTimeStart = microtime(true);
$intQueriesStart = class_db::getInstance()->getNumber();
for ($intI = 0; $intI < 15; $intI++) {
$objNews = new class_module_news_news();
$objNews->setStrTitle("demo 1");
$objNews->setStrIntro("intro demo news");
$objNews->setStrText("text demo news");
$objNews->updateObjectToDb();
$arrNewsIds[] = $objNews->getSystemid();
}
echo "Queries pre indexing: ", class_db::getInstance()->getNumber() - $intQueriesStart . " \n";
echo "Triggering queue update event...\n";
$objHandler = new class_module_search_request_endprocessinglistener();
$objHandler->handleEvent(class_system_eventidentifier::EVENT_SYSTEM_REQUEST_AFTERCONTENTSEND, array());
$intTimeEnd = microtime(true);
$time = $intTimeEnd - $intTimeStart;
echo "Object updates: ", sprintf('%f', $time), " sec.\n";
echo "Queries total: ", class_db::getInstance()->getNumber() - $intQueriesStart . " \n";
$objConfig = class_module_system_setting::getConfigByName("_search_deferred_indexer_");
$objConfig->setStrValue("false");
$objConfig->updateObjectToDb();
foreach ($arrNewsIds as $strNewsId) {
class_objectfactory::getInstance()->getObject($strNewsId)->deleteObjectFromDatabase();
}
}
示例14: onFistLogin
/**
* This callback is triggered on a users' first login into the system.
* You may use this method to install a widget as a default widget to
* a users dashboard.
*
* @param string $strUserid
*
* @return bool
*/
public function onFistLogin($strUserid)
{
if (class_module_system_module::getModuleByName("system") !== null && class_module_system_aspect::getAspectByName("content") !== null) {
$objDashboard = new class_module_dashboard_widget();
$objDashboard->setStrColumn("column2");
$objDashboard->setStrUser($strUserid);
$objDashboard->setStrClass(__CLASS__);
return $objDashboard->updateObjectToDb(class_module_dashboard_widget::getWidgetsRootNodeForUser($strUserid, class_module_system_aspect::getAspectByName("content")->getSystemid()));
}
return true;
}
示例15: __construct
/**
* Constructor doing the usual setup things
*/
private function __construct()
{
$this->objDb = class_carrier::getInstance()->getObjDb();
$this->objSession = class_carrier::getInstance()->getObjSession();
if (count($this->objDb->getTables()) > 0) {
$objModule = class_module_system_module::getModuleByName("system");
if ($objModule !== null && version_compare($objModule->getStrVersion(), "4.3.1") < 0) {
$this->bitChangelog = false;
}
}
}