Пример #1
0
 /**
  * function getHTML
  * <pre>
  * This method returns the HTML data generated by this object.
  * </pre>
  * @return [STRING] HTML Display data.
  */
 function getHTML()
 {
     // Make a new Template object
     $path = SITE_PATH_TEMPLATES;
     // Replace $path with the following line if you want to create a
     // template tailored for this page:
     //$path = $this->pathModuleRoot.'templates/';
     $this->template = new Template($path);
     // store the Row Manager's XML Node Name
     $this->template->set('rowManagerXMLNodeName', RowManager_ViewerManager::XML_NODE_NAME);
     // store the field names being displayed
     $fieldNames = explode(',', page_AccountList::DISPLAY_FIELDS);
     $this->template->set('dataFieldList', $fieldNames);
     // store the primary key field name for the data being displayed
     $this->template->set('primaryKeyFieldName', 'viewer_id');
     // store the link values
     // $this->linkValues[ 'view' ] = 'add/new/href/data/here';
     $this->template->set('linkValues', $this->linkValues);
     // store the link labels
     $this->linkLabels['add'] = $this->labels->getLabel('[Add]');
     $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_passWord]');
     $columnLabel = $this->labels->getLabel('[change]');
     $link = $this->linkValues['passWord'];
     $fieldName = 'viewer_id';
     $this->addLinkColumn($title, $columnLabel, $link, $fieldName);
     $title = $this->labels->getLabel('[title_access]');
     $columnLabel = $this->labels->getLabel('[change]');
     $link = $this->linkValues['accessLink'];
     $fieldName = 'viewer_id';
     $this->addLinkColumn($title, $columnLabel, $link, $fieldName);
     $this->template->set('linkColumns', $this->linkColumns);
     // store the page labels
     // 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 XML List of Applicants ...
     $this->template->setXML('dataList', $this->listManager->getXML());
     /*
      *  Set up any additional data transfer to the Template here...
      */
     // NOTE: Here we tell the templat to NOT display the Title & Instr
     // fields.  So we can display them in our own template later on...
     $this->template->set('disableHeading', true);
     // store language list for display
     //$languageList = new LanguageList();
     $languageManager = new RowManager_LanguageManager();
     $seriesKey = moduleAccountAdmin::MULTILINGUAL_SERIES_KEY;
     $pageKey = $languageManager->getXMLNodeName();
     $multiLingualManager = new MultilingualManager($this->viewer->getLanguageID(), $seriesKey, $pageKey);
     $bridgeManager = new LanguageLabelBridge($languageManager, $multiLingualManager);
     $languageList = $bridgeManager->getListIterator();
     $languageArray = $languageList->getDropListArray();
     $this->template->set('list_language_id', $languageArray);
     $isActiveList = array();
     $isActiveList['1'] = $this->labels->getLabel('[yes]');
     $isActiveList['0'] = '&nbsp;';
     //$this->labels->getLabel( '[no]' );
     $this->template->set('list_viewer_isActive', $isActiveList);
     $templateName = 'siteDataList.php';
     // if you are creating a custom template for this page then
     // replace $templateName with the following:
     //$templateName = 'page_AccountList.php';
     $pageAccountList = $this->template->fetch($templateName);
     // Now create an instance of the page_AccountList template
     // and add the account List to it.
     $path = $this->pathModuleRoot . 'templates/';
     $template = new Template($path);
     $template->setXML('pageLabels', $this->labels->getLabelXML());
     $template->set('pageContent', $pageAccountList);
     // now add the data for the Account Group JumpList
     $groupMgr = new RowManager_AccountGroupManager();
     $seriesKey = moduleAccountAdmin::MULTILINGUAL_SERIES_KEY;
     $pageKey = $groupMgr->getXMLNodeName();
     $groupMultiLingualManager = new MultilingualManager($this->viewer->getLanguageID(), $seriesKey, $pageKey);
     $bridgeManager = new RowLabelBridge($groupMgr, $groupMultiLingualManager);
     $groupList = $bridgeManager->getListIterator();
     $jumpLink = $this->linkValues['jumpLink'];
     $list = $groupList->getDropListArray(null, $jumpLink);
     $template->set('jumpList', $list);
     $template->set('accountGroup', $jumpLink . $this->accountgroup_id);
     // return template data.
     $templateName = 'page_AccountList.php';
     return $template->fetch($templateName);
 }