本文整理汇总了PHP中class_module_system_module::getAllModules方法的典型用法代码示例。如果您正苦于以下问题:PHP class_module_system_module::getAllModules方法的具体用法?PHP class_module_system_module::getAllModules怎么用?PHP class_module_system_module::getAllModules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类class_module_system_module
的用法示例。
在下文中一共展示了class_module_system_module::getAllModules方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPossibleModulesForFilter
/**
* Returns all modules available in the module-table.
* Limited to those with a proper title, so
* a subset of getModuleIds() / all module-entries
* @return array
*/
public function getPossibleModulesForFilter()
{
$arrFilterModules = array();
$arrModules = class_module_system_module::getAllModules();
$arrNrs = $this->getModuleNumbers();
foreach ($arrModules as $objOneModule) {
if (in_array($objOneModule->getIntNr(), $arrNrs) && $objOneModule->rightView()) {
$strName = $this->getLang("modul_titel", $objOneModule->getStrName());
if ($strName != "!modul_titel!") {
$arrFilterModules[$objOneModule->getIntNr()] = $strName;
}
}
}
return $arrFilterModules;
}
示例2: actionModuleList
/**
* Generates the list of modules installed.
* Returned structure:
* <modules>
* <module>
* <name></name>
* <version></version>
* <module>
* </modules>
*
* @return string
* @permissions view
*/
protected function actionModuleList()
{
$strReturn = "";
$strReturn .= "<modules>";
//Loading the modules
$arrModules = class_module_system_module::getAllModules();
foreach ($arrModules as $objSingleModule) {
$strReturn .= "<module>";
$strReturn .= "<name>" . xmlSafeString($objSingleModule->getStrName()) . "</name>";
$strReturn .= "<version>" . xmlSafeString($objSingleModule->getStrVersion()) . "</version>";
$strReturn .= "</module>";
}
$strReturn .= "</modules>";
return $strReturn;
}
示例3: testInheritanceForObjects
public function testInheritanceForObjects()
{
if (class_module_system_module::getModuleByName("pages") === null) {
return;
}
echo "\tRIGHTS INHERITANCE...\n";
$objRights = class_carrier::getInstance()->getObjRights();
$this->objRights = class_carrier::getInstance()->getObjRights();
//create a new user & group to be used during testing
echo "\tcreating a test user\n";
$objUser = new class_module_user_user();
$strUsername = "user_" . generateSystemid();
$objUser->setStrUsername($strUsername);
$objUser->updateObjectToDb();
echo "\tid of user: " . $objUser->getSystemid() . "\n";
$this->strUserId = $objUser->getSystemid();
echo "\tcreating a test group\n";
$objGroup = new class_module_user_group();
$strName = "name_" . generateSystemid();
$objGroup->setStrName($strName);
$objGroup->updateObjectToDb();
echo "\tid of group: " . $objGroup->getSystemid() . "\n";
echo "\tadding user to group\n";
$objGroup->getObjSourceGroup()->addMember($objUser->getObjSourceUser());
$strModuleId = $this->createObject("class_module_system_module", "0")->getSystemid();
class_carrier::getInstance()->flushCache(class_carrier::INT_CACHE_TYPE_MODULES);
class_module_system_module::getAllModules();
echo "\tcreating node-tree\n";
$strRootId = $this->createObject("class_module_pages_page", $strModuleId)->getSystemid();
echo "\tid of root-node: " . $strRootId . "\n";
echo "\tcreating child nodes...\n";
$strSecOne = $this->createObject("class_module_pages_page", $strRootId)->getSystemid();
$strSecTwo = $this->createObject("class_module_pages_page", $strRootId)->getSystemid();
$strThirdOne1 = $this->createObject("class_module_pages_page", $strSecOne)->getSystemid();
$strThirdOne2 = $this->createObject("class_module_pages_page", $strSecOne)->getSystemid();
$strThirdTwo1 = $this->createObject("class_module_pages_page", $strSecTwo)->getSystemid();
$strThirdTwo2 = $this->createObject("class_module_pages_page", $strSecTwo)->getSystemid();
$strThird111 = $this->createObject("class_module_pages_page", $strThirdOne1)->getSystemid();
$strThird112 = $this->createObject("class_module_pages_page", $strThirdOne1)->getSystemid();
$strThird121 = $this->createObject("class_module_pages_page", $strThirdOne2)->getSystemid();
$strThird122 = $this->createObject("class_module_pages_page", $strThirdOne2)->getSystemid();
$strThird211 = $this->createObject("class_module_pages_page", $strThirdTwo1)->getSystemid();
$strThird212 = $this->createObject("class_module_pages_page", $strThirdTwo1)->getSystemid();
$strThird221 = $this->createObject("class_module_pages_page", $strThirdTwo2)->getSystemid();
$strThird222 = $this->createObject("class_module_pages_page", $strThirdTwo2)->getSystemid();
$arrThirdLevelNodes = array($strThird111, $strThird112, $strThird121, $strThird122, $strThird211, $strThird212, $strThird221, $strThird222);
echo "\tchecking leaf nodes for initial rights\n";
foreach ($arrThirdLevelNodes as $strOneRootNode) {
$this->checkNodeRights($strOneRootNode, false, false);
}
echo "\tadding group with right view & edit\n";
$objRights->addGroupToRight($objGroup->getSystemid(), $strModuleId, "view");
$objRights->addGroupToRight($objGroup->getSystemid(), $strModuleId, "edit");
echo "\tchecking leaf nodes for inherited rights\n";
foreach ($arrThirdLevelNodes as $strOneRootNode) {
$this->checkNodeRights($strOneRootNode, true, true);
}
echo "\tremoving right view from node secTwo\n";
$objRights->removeGroupFromRight($objGroup->getSystemid(), $strSecTwo, "view");
echo "\tchecking node rights\n";
$this->checkNodeRights($strRootId, true, true);
$this->checkNodeRights($strSecOne, true, true);
$this->checkNodeRights($strSecTwo, false, true);
$this->checkNodeRights($strThirdOne1, true, true);
$this->checkNodeRights($strThirdOne2, true, true);
$this->checkNodeRights($strThirdTwo1, false, true);
$this->checkNodeRights($strThirdTwo2, false, true);
$this->checkNodeRights($strThird111, true, true);
$this->checkNodeRights($strThird112, true, true);
$this->checkNodeRights($strThird121, true, true);
$this->checkNodeRights($strThird122, true, true);
$this->checkNodeRights($strThird211, false, true);
$this->checkNodeRights($strThird212, false, true);
$this->checkNodeRights($strThird221, false, true);
$this->checkNodeRights($strThird222, false, true);
echo "\tmove SecOne as child to 221\n";
$objTempCommons = class_objectfactory::getInstance()->getObject($strSecOne);
$objTempCommons->setStrPrevId($strThird221);
$objTempCommons->updateObjectToDb();
//$objSystemCommon->setPrevId($strThird221, $strSecOne);
echo "\tchecking node rights\n";
$this->checkNodeRights($strRootId, true, true);
$this->checkNodeRights($strSecOne, false, true);
$this->checkNodeRights($strSecTwo, false, true);
$this->checkNodeRights($strThirdOne1, false, true);
$this->checkNodeRights($strThirdOne2, false, true);
$this->checkNodeRights($strThirdTwo1, false, true);
$this->checkNodeRights($strThirdTwo2, false, true);
$this->checkNodeRights($strThird111, false, true);
$this->checkNodeRights($strThird112, false, true);
$this->checkNodeRights($strThird121, false, true);
$this->checkNodeRights($strThird122, false, true);
$this->checkNodeRights($strThird211, false, true);
$this->checkNodeRights($strThird212, false, true);
$this->checkNodeRights($strThird221, false, true);
$this->checkNodeRights($strThird222, false, true);
echo "\tsetting rights of third21 to only view\n";
$objRights->removeGroupFromRight($objGroup->getSystemid(), $strThirdTwo1, "edit");
$objRights->addGroupToRight($objGroup->getSystemid(), $strThirdTwo1, "view");
echo "\tchecking node rights\n";
//.........这里部分代码省略.........
示例4: getModuleDataID
/**
* Loads the data for one module
*
* @param int $intModuleID
* @param bool $bitZeroIsSystem
*
* @return class_module_system_module
*/
private function getModuleDataID($intModuleID, $bitZeroIsSystem = false)
{
$arrModules = class_module_system_module::getAllModules();
if ($intModuleID != 0 || !$bitZeroIsSystem) {
foreach ($arrModules as $objOneModule) {
if ($objOneModule->getIntNr() == $intModuleID) {
return $objOneModule;
}
}
} elseif ($intModuleID == 0 && $bitZeroIsSystem) {
foreach ($arrModules as $objOneModule) {
if ($objOneModule->getStrName() == "system") {
return $objOneModule;
}
}
}
return null;
}
示例5: actionRenderCalendar
/**
* @return string
* @permissions view
*/
protected function actionRenderCalendar()
{
$strReturn = "";
$strContent = "";
$arrJsHighlights = array();
$strReturn .= "<content><![CDATA[";
/** @var interface_calendarsource_admin[] $arrRelevantModules */
$arrRelevantModules = array();
//fetch modules relevant for processing
$arrModules = class_module_system_module::getAllModules();
foreach ($arrModules as $objSingleModule) {
if ($objSingleModule->getIntRecordStatus() == 1 && $objSingleModule->getAdminInstanceOfConcreteModule() instanceof interface_calendarsource_admin) {
$arrRelevantModules[] = $objSingleModule->getAdminInstanceOfConcreteModule();
}
}
//the header row
$arrWeekdays = explode(",", $this->getLang("calendar_weekday"));
foreach ($arrWeekdays as $intKey => $strValue) {
$arrWeekdays[$intKey] = trim(uniStrReplace("\"", "", $strValue));
}
$strContent .= $this->objToolkit->getCalendarHeaderRow($arrWeekdays);
//render the single rows. calculate the first day of the row
$objDate = new class_date();
$objDate->setIntDay(1);
//set to interval stored in session
if ($this->objSession->getSession($this->strStartMonthKey) != "") {
$objDate->setIntMonth($this->objSession->getSession($this->strStartMonthKey));
}
if ($this->objSession->getSession($this->strStartYearKey) != "") {
$objDate->setIntYear($this->objSession->getSession($this->strStartYearKey));
}
$intCurMonth = $objDate->getIntMonth();
$intCurYear = $objDate->getIntYear();
$objToday = new class_date();
//start by monday
while ($objDate->getIntDayOfWeek() != 1) {
$objDate->setPreviousDay();
}
$strEntries = "";
$intRowEntryCount = 0;
while ($objDate->getIntMonth() <= $intCurMonth && $objDate->getIntYear() <= $intCurYear || $objDate->getIntMonth() == 12 && $objDate->getIntYear() < $intCurYear || $intRowEntryCount % 7 != 0) {
$intRowEntryCount++;
$strDate = $objDate->getIntDay();
$arrEvents = array();
if ($objDate->getIntMonth() == $intCurMonth) {
//Query modules for dates
$objStartDate = clone $objDate;
$objStartDate->setIntHour(0)->setIntMin(0)->setIntSec(0);
$objEndDate = clone $objDate;
$objEndDate->setIntHour(23)->setIntMin(59)->setIntSec(59);
foreach ($arrRelevantModules as $objOneModule) {
$arrEvents = array_merge($objOneModule->getArrCalendarEntries($objStartDate, $objEndDate), $arrEvents);
}
}
while (count($arrEvents) <= 3) {
$objDummy = new class_calendarentry();
$objDummy->setStrClass("spacer");
$objDummy->setStrName(" ");
$arrEvents[] = $objDummy;
}
$strEvents = "";
/** @var class_calendarentry $objOneEvent */
foreach ($arrEvents as $objOneEvent) {
$strName = $objOneEvent->getStrName();
$strSecondLine = $objOneEvent->getStrSecondLine();
if ($strSecondLine != "") {
$strSecondLine = "<br />" . $strSecondLine;
}
//register mouse-over highlight relations
if ($objOneEvent->getStrHighlightId() != "" && $objOneEvent->getStrSystemid() != "") {
if (!isset($arrJsHighlights[$objOneEvent->getStrHighlightId()])) {
$arrJsHighlights[$objOneEvent->getStrHighlightId()] = array();
}
$arrJsHighlights[$objOneEvent->getStrHighlightId()][] = $objOneEvent->getStrSystemid();
}
$strEvents .= $this->objToolkit->getCalendarEvent($strName . $strSecondLine, $objOneEvent->getStrSystemid(), $objOneEvent->getStrHighlightId(), $objOneEvent->getStrClass());
}
$bitBlocked = false;
if ($objDate->getIntDayOfWeek() == 0 || $objDate->getIntDayOfWeek() == 6) {
$bitBlocked = true;
}
$strToday = "";
if ($objToday->getIntYear() == $objDate->getIntYear() && $objToday->getIntMonth() == $objDate->getIntMonth() && $objToday->getIntDay() == $objDate->getIntDay()) {
$strToday = " calendarDateToday";
}
if ($objDate->getIntMonth() != $intCurMonth) {
$strEntries .= $this->objToolkit->getCalendarEntry($strEvents, $strDate, "calendarEntryOutOfRange" . $strToday);
} else {
if ($bitBlocked) {
$strEntries .= $this->objToolkit->getCalendarEntry($strEvents, $strDate, "calendarEntryBlocked" . $strToday);
} else {
$strEntries .= $this->objToolkit->getCalendarEntry($strEvents, $strDate, "calendarEntry" . $strToday);
}
}
if ($intRowEntryCount % 7 == 0) {
$strContent .= $this->objToolkit->getCalendarRow($strEntries);
//.........这里部分代码省略.........
示例6: actionCalendar
/**
* Creates a calendar-based view of the current month.
* Single objects may register themselves to be rendered within the calendar.
* The calendar-view consists of a view single elements:
* +---------------------------+
* | control-elements (pager) |
* +---------------------------+
* | wrapper |
* +---------------------------+
* | the column headers |
* +---------------------------+
* | a row for each week (4x) |
* +---------------------------+
* | wrapper |
* +---------------------------+
* | legend |
* +---------------------------+
*
* The calendar internally is loaded via ajax since fetching all events
* may take some time.
*
* @return string
* @since 3.4
* @autoTestable
* @permissions view
*/
protected function actionCalendar()
{
$strReturn = "";
//save dates to session
if ($this->getParam("month") != "") {
$this->objSession->setSession($this->strStartMonthKey, $this->getParam("month"));
}
if ($this->getParam("year") != "") {
$this->objSession->setSession($this->strStartYearKey, $this->getParam("year"));
}
$strContainerId = generateSystemid();
$strContent = "<script type=\"text/javascript\">";
$strContent .= <<<JS
\$(document).ready(function() {
KAJONA.admin.ajax.genericAjaxCall("dashboard", "renderCalendar", "{$strContainerId}", function(data, status, jqXHR) {
if(status == 'success') {
var intStart = data.indexOf("[CDATA[")+7;
\$("#{$strContainerId}").html(data.substr(
intStart, data.indexOf("]]")-intStart
));
if(data.indexOf("[CDATA[") < 0) {
var intStart = data.indexOf("<error>")+7;
\$("#{$strContainerId}").html(o.responseText.substr(
intStart, data.indexOf("</error>")-intStart
));
}
KAJONA.util.evalScript(data);
KAJONA.admin.tooltip.initTooltip();
}
else {
KAJONA.admin.statusDisplay.messageError("<b>Request failed!</b><br />" + data);
}
})
});
JS;
$strContent .= "</script>";
//fetch modules relevant for processing
$arrLegendEntries = array();
$arrFilterEntries = array();
$arrModules = class_module_system_module::getAllModules();
foreach ($arrModules as $objSingleModule) {
/** @var $objAdminInstance interface_calendarsource_admin|class_module_system_module */
$objAdminInstance = $objSingleModule->getAdminInstanceOfConcreteModule();
if ($objSingleModule->getIntRecordStatus() == 1 && $objAdminInstance instanceof interface_calendarsource_admin) {
//TODO: switch to plugin manager
$arrLegendEntries = array_merge($arrLegendEntries, $objAdminInstance->getArrLegendEntries());
$arrFilterEntries = array_merge($arrFilterEntries, $objAdminInstance->getArrFilterEntries());
}
}
if ($this->getParam("doCalendarFilter") != "") {
//update filter-criteria
foreach (array_keys($arrFilterEntries) as $strOneId) {
if ($this->getParam($strOneId) != "") {
$this->objSession->sessionUnset($strOneId);
} else {
$this->objSession->setSession($strOneId, "disabled");
}
}
}
//render the single rows. calculate the first day of the row
$objDate = new class_date();
$objDate->setIntDay(1);
if ($this->objSession->getSession($this->strStartMonthKey) != "") {
$objDate->setIntMonth($this->objSession->getSession($this->strStartMonthKey));
}
if ($this->objSession->getSession($this->strStartYearKey) != "") {
$objDate->setIntYear($this->objSession->getSession($this->strStartYearKey));
}
//pager-setup
$objEndDate = clone $objDate;
$objEndDate->setNextMonth();
$objEndDate->setPreviousDay();
$strCenter = dateToString($objDate, false) . " - " . dateToString($objEndDate, false);
$objEndDate->setNextDay();
//.........这里部分代码省略.........