コード例 #1
0
 $NavLinkViewer = new RowManager_NavLinkViewerManager();
 $NavLinkViewer->dropTable();
 $NavLinkViewer->createTable();
 /*
  * NavBarCache Table
  *
  * Stores the generated nav bar information for a user.
  *
  * navbarcache_id [INTEGER]  Primary Key for this table.
  * viewer_id [INTEGER]  Foreign Key linking this cache entry to a viewer.
  * language_id [INTEGER]  Foreign Key linking this cache entry to a particular language version. (each viewer can have a cache entry for each language)
  * navbarcache_cacheMain [STRING]  Holds the main nav bar data.
  * navbarcache_cacheSub [STRING]  Holds the sub menu data cache
  * navbarcache_isValid [BOOL]  BOOL flag indicating if this cache info is valid.
  */
 $NavBarCache = new RowManager_NavBarCacheManager();
 $NavBarCache->dropTable();
 $NavBarCache->createTable();
 /*
  * NavBarContentData Table
  *
  * Holds the multilingual content (labels) for the nav bar information.
  *
  * navbarcontent_id [INTEGER]  Primary Key for this table
  * language_id [INTEGER]  Foriegn Key linking this content to a language
  * navbarcontent_key [STRING]  The content key for this content data.  Values are usually either "[group[ID#]]" or "[label[ID#]]"
  * navbarcontent_data [STRING]  The actual content to be displayed on the page.
  */
 //    $NavBarContentData = new RowManager_NavBarContentDataManager();
 //    $NavBarContentData->dropTable();
 //    $NavBarContentData->createTable();
コード例 #2
0
 /**
  * function processData
  * <pre>
  * Processes the data for this form.
  * </pre>
  * @return [void]
  */
 function processData()
 {
     // if this is a delete operation then
     if ($this->opType == 'D') {
         if ($this->shouldDelete) {
             $this->dataManager->deleteEntry();
         }
     } else {
         // else
         // save the value of the Foriegn Key(s)
         /*[RAD_ADMINBOX_FOREIGNKEY]*/
         // Store values in dataManager object
         $this->dataManager->loadFromArray($this->formValues);
         // Save the values into the Table.
         if (!$this->dataManager->isLoaded()) {
             $this->dataManager->createNewEntry();
         } else {
             $this->dataManager->updateDBTable();
         }
     }
     // end if
     // now tell Cache Manager to reset the cache entries...
     $cacheManager = new RowManager_NavBarCacheManager();
     $cacheManager->flushCacheEntries();
     // now Clear out dataManager & FormValues
     $this->dataManager->clearValues();
     $this->formValues = $this->dataManager->getArrayOfValues();
     // on a successful update return navbargroup_id to ''
     $this->navbargroup_id = '';
 }
コード例 #3
0
 /**
  * function processData
  * <pre>
  * Processes the data for this form.
  * </pre>
  * @return [void]
  */
 function processData()
 {
     // now get list of NEW Groups added to this Account
     $addedList = array();
     for ($indx = 0; $indx < count($this->submittedGroups); $indx++) {
         $id = $this->submittedGroups[$indx];
         // if id not in currentGroupList then add to addList
         if (!isset($this->currentGroupList[$id])) {
             $addedList[] = $id;
         }
     }
     // foreach added group
     $viewerAccessGroup = new RowManager_ViewerAccessGroupManager();
     $accessGroupManager = new RowManager_AccessGroupManager();
     $adminAccessGroupID = $accessGroupManager->getAdminAccessGroupID();
     //print($adminAccessGroupID . "<br>");
     for ($indx = 0; $indx < count($addedList); $indx++) {
         // create new entry
         $viewerAccessGroup->createNewEntry();
         // load values
         $values = array();
         $values['viewer_id'] = $this->viewer_id;
         $values['accessgroup_id'] = $addedList[$indx];
         $viewerAccessGroup->loadFromArray($values);
         // update DB Table
         $viewerAccessGroup->updateDBTable();
         //add to table accountadmin_accountadminaccess if acces group is adminAccesGroup
         if ($values['accessgroup_id'] == $adminAccessGroupID) {
             $aam = new RowManager_AccountAdminAccessManager();
             $aam->setViewerID($this->viewer_id);
             $aam->setGroupPrivilege();
             $aam->createNewEntry();
         }
     }
     // next group
     $languageManager = new RowManager_LanguageManager();
     $languageList = $languageManager->getListIterator();
     $languageList->setFirst();
     while ($language = $languageList->getNext()) {
         $navbar = new RowManager_NavBarCacheManager();
         $navbar->loadByViewerID($this->viewer_id, $language->getID());
         if ($navbar->getID() != -1) {
             $navbar->setCacheInvalid();
             $navbar->updateDBTable();
         }
     }
     // get list of DELETED Groups from this account
     $deletedList = array();
     foreach ($this->currentGroupList as $key => $value) {
         if (!in_array($key, $this->submittedGroups)) {
             $deletedList[] = $key;
         }
     }
     // foreach deleted group
     for ($indx = 0; $indx < count($deletedList); $indx++) {
         // if we can load a manager for this account with this group then
         if ($viewerAccessGroup->loadByViewerAccessGroup($this->viewer_id, $deletedList[$indx])) {
             // delete
             $viewerAccessGroup->deleteEntry();
             if ($deletedList[$indx] == $adminAccessGroupID) {
                 $aam = new RowManager_AccountAdminAccessManager();
                 $aam->setViewerID($this->viewer_id);
                 //$aam->setGroupPrivilege();
                 //print("before delete");
                 $aam->deleteEntry();
             }
         }
     }
     // next group
     // update currentGroupList with submittedGroupList
     $groupList = new ViewerAccessGroupList($this->viewer_id, $this->sortBy);
     $this->currentGroupList = $groupList->getAccessGroupArray();
 }