$group->createNewEntry(); /* * NavBarLinks Table * * Manages the actual links on the NavBar * * navbarlink_id [INTEGER] Primary Key for this table * navbargroup_id [INTEGER] Foreign Key relating this Link to a group * navbarlink_textKey [STRING] the key for the multilingual content to display the name of this link. "[link_[textKey]]" * navbarlink_url [STRING] the url of a link not tied to a site module. * module_id [INTEGER] Foreign Key relating this link to a built in module for the site. * navbarlink_isActive [BOOL] Bool flag turning link on or off. * navbarlink_isModule [BOOL] Bool flag indicating if this link uses a module key or url. * navbarlink_order [INTEGER] used for specifying which order this link should be displayed in the nav bar menu. */ $NavBarLinks = new RowManager_NavBarLinksManager(); $NavBarLinks->dropTable(); $NavBarLinks->createTable(); $seriesKey = moduleNavBar::MULTILINGUAL_SERIES_KEY; $pageKey = RowManager_NavBarLinksManager::XML_NODE_NAME; $multiLingualContext = new MultilingualManager(1, $seriesKey, $pageKey); $link = $NavBarLinks->getRowLabelBridge($multiLingualContext); $values = array(); $values['label_label'] = 'Site Administration'; $values['navbargroup_id'] = $group->getID(); if (!defined('moduleAccountAdmin::MODULE_KEY')) { require_once $extension . 'modules/site_AccountAdmin/app_AccountAdmin.php'; require_once $extension . 'modules/site_AccountAdmin/incl_AccountAdmin.php'; } $module = new RowManager_siteModuleManager(); $module->loadByKey(moduleAccountAdmin::MODULE_KEY);
/** * function getHTML * <pre> * This method returns the HTML data generated by this object. * </pre> * @return [STRING] HTML Display data. */ function getHTML() { // Uncomment the following line if you want to create a template // tailored for this page: //$path = $this->pathModuleRoot.'templates/'; // Otherwise use the standard Templates for the site: $path = SITE_PATH_TEMPLATES; /* * store the link values */ // example: // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; // store the link labels $this->linkLabels['edit'] = $this->labels->getLabel('[Edit]'); $this->linkLabels['del'] = $this->labels->getLabel('[Delete]'); $this->linkLabels['cont'] = $this->labels->getLabel('[Continue]'); // $this->linkLabels[ 'view' ] = 'new link label here'; /* * store any additional link Columns */ // example: //$title = $this->labels->getLabel( '[title_groups]'); //$columnLabel = $this->labels->getLabel( '[groups]'); //$link = $this->linkValues[ 'groups' ]; //$fieldName = 'accessgroup_id'; //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName); /* * Update any label tags ... */ // example: $linkManager = new RowManager_NavBarLinksManager($this->navbarlink_id); $seriesKey = moduleNavBar::MULTILINGUAL_SERIES_KEY; $pageKey = $linkManager->getXMLNodeName(); $groupMultiLingual = new MultilingualManager($this->viewer->getLanguageID(), $seriesKey, $pageKey); $bridgeManager = new RowLabelBridge($linkManager, $groupMultiLingual); $name = $bridgeManager->getLabel(); $this->labels->setLabelTag('[Title]', '[linkName]', $name); // NOTE: this parent method prepares the $this->template with the // common AdminBox data. $this->prepareTemplate($path); // store the statevar id to edit $this->template->set('editEntryID', $this->navlinkaccessgroup_id); // store all the fields to the template $this->setFormFieldsToTemplate(); /* * Form related Template variables: */ /* * Insert the date start/end values for the following date fields: */ // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /* * List related Template variables : */ // Store the XML Node name for the Data Access Field List $xmlNodeName = $this->dataManager->getXMLNodeName(); $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'navlinkaccessgroup_id'); // store data list to the template // NOTE: we initialize it here to make sure we capture any new data // from a recent processData() call. // $this->dataList = new NavLinkAccessGroupList( $this->navbarlink_id, $this->sortBy ); $groupManager = new RowManager_NavLinkAccessGroupManager(); $groupManager->setLinkID($this->navbarlink_id); $this->dataList = $groupManager->getListIterator(); $this->template->setXML('dataList', $this->dataList->getXML()); /* * Add any additional data required by the template here */ $accountGroupMgr = new RowManager_AccessGroupManager(); $multiLingualContext = new MultilingualManager($this->viewer->getLanguageID()); $rowLabelBridge = $accountGroupMgr->getRowLabelBridge($multiLingualContext); $accountList = $rowLabelBridge->getListIterator(); $this->template->set("list_accessgroup_id", $accountList->getDropListArray()); $templateName = TEMPLATE_ADMIN_BOX; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_LinkGroups.php'; return $this->template->fetch($templateName); }
/** * function getViewerLinks * <pre> * Returns an array of links linked directly to this viewer. * </pre> * @param $viewerID [INTEGER] the viewer_id of the person to make a cache * entry for. * @param $languageID [INTEGER] the language_id of the cache entry * @return [ARRAY] */ function getViewerLinks($viewerID, $languageID) { $resultArray = array(); // create Link RowLabelBridge $linkManager = new RowManager_NavBarLinksManager(); $multiLingualContext = new MultilingualManager($languageID, 'moduleNavBar', 'navBarLinks'); $bridgeManager = $linkManager->getRowLabelBridge($multiLingualContext); $bridgeManager->setSortOrder('navbargroup_id'); // add to it the LinkViewer table $linkViewer = new RowManager_NavLinkViewerManager(); $linkViewer->setViewerID($viewerID); $joinPair = new JoinPair($linkViewer->getJoinOnLinkID(), $linkManager->getJoinOnLinkID()); $bridgeManager->addRowManager($linkViewer, $joinPair); // get list of entries $list = $bridgeManager->getListIterator(); // for each item $list->setFirst(); while ($link = $list->getNext()) { // add to resultArray $resultArray[] = $link->getArrayOfValues(); } // next item return $resultArray; }