Пример #1
0
 /**
  * Fetches the list of actions for a single module, saved to the session for performance reasons
  *
  * @param class_module_system_module $objModule
  * @static
  *
  * @return array
  */
 public static function getModuleActionNaviHelper(class_module_system_module $objModule)
 {
     if (class_carrier::getInstance()->getObjSession()->isLoggedin()) {
         $strKey = __CLASS__ . "adminNaviEntries" . $objModule->getSystemid() . class_module_system_aspect::getCurrentAspectId();
         $arrFinalItems = class_carrier::getInstance()->getObjSession()->getSession($strKey);
         if ($arrFinalItems !== false) {
             return $arrFinalItems;
         }
         $objAdminInstance = $objModule->getAdminInstanceOfConcreteModule();
         $arrItems = $objAdminInstance->getOutputModuleNavi();
         $arrItems = array_merge($arrItems, $objAdminInstance->getModuleRightNaviEntry());
         $arrFinalItems = array();
         //build array of final items
         $intI = 0;
         foreach ($arrItems as $arrOneItem) {
             if ($arrOneItem[0] == "") {
                 $bitAdd = true;
             } else {
                 $bitAdd = class_carrier::getInstance()->getObjRights()->validatePermissionString($arrOneItem[0], $objModule);
             }
             if ($bitAdd || $arrOneItem[1] == "") {
                 if ($arrOneItem[1] != "" || (!isset($arrFinalItems[$intI - 1]) || $arrFinalItems[$intI - 1] != "")) {
                     $arrFinalItems[] = $arrOneItem[1];
                     $intI++;
                 }
             }
         }
         //if the last one is a divider, remove it
         if ($arrFinalItems[count($arrFinalItems) - 1] == "") {
             unset($arrFinalItems[count($arrFinalItems) - 1]);
         }
         class_carrier::getInstance()->getObjSession()->setSession($strKey, $arrFinalItems);
         return $arrFinalItems;
     }
     return array();
 }
Пример #2
0
 /**
  * Writes the data of a module to the database
  *
  * @param string $strName
  * @param int $intModuleNr
  * @param string $strFilePortal
  * @param string $strFileAdmin
  * @param string $strVersion
  * @param bool $bitNavi
  * @param string $strXmlPortal
  * @param string $strXmlAdmin
  * @return string the new SystemID of the record
  */
 protected function registerModule($strName, $intModuleNr, $strFilePortal, $strFileAdmin, $strVersion, $bitNavi, $strXmlPortal = "", $strXmlAdmin = "")
 {
     $this->objDB->flushQueryCache();
     //The previous id is the the id of the Root-Record -> 0
     $strPrevId = "0";
     $objModule = new class_module_system_module();
     $objModule->setStrName($strName);
     $objModule->setIntNr($intModuleNr);
     $objModule->setStrNamePortal($strFilePortal);
     $objModule->setStrNameAdmin($strFileAdmin);
     $objModule->setStrVersion($strVersion);
     $objModule->setIntNavigation($bitNavi ? 1 : 0);
     $objModule->setStrXmlNamePortal($strXmlPortal);
     $objModule->setStrXmlNameAdmin($strXmlAdmin);
     $objModule->setIntDate(time());
     $objModule->setIntModuleNr($intModuleNr);
     $objModule->setArrModuleEntry("moduleId", $intModuleNr);
     $objModule->updateObjectToDb($strPrevId);
     class_logger::getInstance()->addLogRow("New module registered: " . $objModule->getSystemid() . "(" . $strName . ")", class_logger::$levelInfo);
     //flush db-cache afterwards
     class_carrier::getInstance()->flushCache(class_carrier::INT_CACHE_TYPE_DBQUERIES | class_carrier::INT_CACHE_TYPE_DBTABLES | class_carrier::INT_CACHE_TYPE_MODULES | class_carrier::INT_CACHE_TYPE_ORMCACHE | class_carrier::INT_CACHE_TYPE_OBJECTFACTORY);
     return $objModule->getSystemid();
 }