/** * function __construct * <pre> * Initialize the Class ... * </pre> * @param $accountgroup_id [INTEGER] value used to initialize the list. * @param $sortBy [STRING] the field name to sort list by * @return [void] */ function __construct($accountgroup_id = -1, $sortBy = '') { $searchManager = new RowManager_ViewerManager(); // NOTE: if you need to narrow the field of the search then uncommnet // the following and set the proper search criteria. $searchManager->setValueByFieldName("accountgroup_id", $accountgroup_id); //$searchManager->setValueByFieldName('module_isCommonLook', '1' ); $searchManager->setSortOrder($sortBy); $this->resultSet = $searchManager->find(); }
/** * 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: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $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->superadmin_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 = RowManager_SuperAdminAssignmentManager::XML_NODE_NAME; $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'superadmin_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. $dataAccessManager = new RowManager_SuperAdminAssignmentManager(); $dataAccessManager->setSortOrder($this->sortBy); // $this->dataList = new SuperAdminAssignmentList( $this->sortBy ); $this->dataList = $dataAccessManager->getListIterator(); $this->template->setXML('dataList', $this->dataList->getXML()); /* * Add any additional data required by the template here */ // get a list of all viewer_id's $viewer = new RowManager_ViewerManager(); $viewer->setSortOrder('viewer_userID'); $viewerList = new ListIterator($viewer); $viewerArray = $viewerList->getDropListArray(); // set the two arrays (making sure they are properly fliped back to // normal) // $viewerArray = array(); // $viewerArray['812'] = "Russ"; // $viewerArray['2878'] = "Hobbe"; // $viewerArray['2931'] = "DC"; $this->template->set('list_viewer_id', $viewerArray); //array_flip( $templateName = 'siteAdminBox.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_AddSuperAdmin.php'; return $this->template->fetch($templateName); }
/** * 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.'[RAD_PATH_TEMPLATES]'; // Otherwise use the standard Templates for the site: $path = SITE_PATH_TEMPLATES; $this->template = new Template($path); // store the form action information $this->template->set('formAction', $this->formAction); // store the link values // example: // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; $this->template->set('linkValues', $this->linkValues); // 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'; $this->template->set('linkLabels', $this->linkLabels); // 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); $this->template->set('linkColumns', $this->linkColumns); // store the statevar id to edit $this->template->set('editEntryID', $this->accountadminaccess_id); // store the current op type $this->template->set('opType', $this->opType); // store the page labels in XML format... // NOTE: use this location to update any label tags ... // example: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); $this->template->setXML('pageLabels', $this->labels->getLabelXML()); // store all the fields to the template $this->setFormFieldsToTemplate(); /* * Form related Template variables: */ // save the list of form fields $this->template->set('formFieldList', $this->formFields); // store the field types being displayed $fieldTypes = explode(',', FormProcessor_AdminPriv::FORM_FIELD_TYPES); $this->template->set('formFieldType', $fieldTypes); // Insert the date start/end values for the following date fields: // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /*[RAD_DAOBJ_FIELD_DATE_PARAM]*/ /* * List related Template variables : */ // Store the XML Node name for the Data Access Field List $this->dataList = $this->accessPrivilegeManager->getListAccountPriviledgeAccess($this->sortBy); $xmlNodeName = $this->dataList->getRowManagerXMLNodeName(); $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'accountadminaccess_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->template->setXML('dataList', $this->dataList->getXML()); // store the field names being displayed $fieldNames = explode(',', FormProcessor_AdminPriv::DISPLAY_FIELDS); $this->template->set('dataFieldList', $fieldNames); /* * Add any additional data required by the template here */ // get a list of viewer_id's that are currently in the table $this->dataList = new AccountAdminAccessList($this->sortBy); $entryArray = $this->dataList->getDropListArray(); // get a list of all viewer_id's $viewer = new RowManager_ViewerManager(); $viewer->setSortOrder('viewer_userID'); $viewerList = $this->accessPrivilegeManager->getListViewerAccounts('viewer_userID'); $viewerArray = $viewerList->getDropListArray(); // since list from dataList has viewer_id as value we need to // flip the array from the viewerList so that viewer_id is also // in values (we'll return the resulting array's back to the // proper positions later) $flippedArray = array_flip($viewerArray); // The difference between the two arrays defines the droplist box // e.g. we remove the entries already in the table from the // whole list of viewers $dropListArray = array_diff($flippedArray, $entryArray); // The intersection of the 2 arrays defines the list for displaying // the account names for the entries in the list. $rowListArray = array_intersect($flippedArray, $entryArray); // set the two arrays (making sure they are properly fliped back to // normal) $this->template->set('list_viewer_id', array_flip($rowListArray)); // if there is an entry to edit/delete then if ($this->accountadminaccess_id != '') { // pass the row list for the dropList $this->template->set('list_account', array_flip($rowListArray)); } else { // else pass the dropList array $this->template->set('list_account', array_flip($dropListArray)); } // get Access Privilege List $privList = $this->dataManager->getAccessPrivilegeArray($this->labels, $this->accessPrivilegeManager->getAccessPrivilege()); $this->template->set('list_accountadminaccess_privilege', $privList); $templateName = 'siteAdminBox.php'; return $this->template->fetch($templateName); }