/** * function __construct * <pre> * Initialize the Class ... * </pre> * @param $module_id [INTEGER] value used to initialize the list. * @param $sortBy [STRING] the field name to sort list by * @param $page_id [INTEGER] optional page_id used to initialize the list. * @return [void] */ function __construct($module_id = -1, $sortBy = '', $page_id = '') { $searchManager = new RowManager_TransitionsManager(); // NOTE: if you need to narrow the field of the search then uncommnet // the following and set the proper search criteria. $searchManager->setValueByFieldName("module_id", $module_id); $searchManager->setValueByFieldName("transition_fromObjID", $page_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; $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->transition_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: $moduleManager = new RowManager_ModuleManager($this->module_id); $name = $moduleManager->getModuleName(); $this->labels->setLabelTag('[Title]', '[moduleName]', $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_Transitions::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); /* * List related Template variables : */ // Store the XML Node name for the Data Access Field List $xmlNodeName = RowManager_TransitionsManager::XML_NODE_NAME; $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'transition_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 TransitionsList($this->module_id, $this->sortBy); $this->template->setXML('dataList', $this->dataList->getXML()); // store the field names being displayed $fieldNames = explode(',', FormProcessor_Transitions::DISPLAY_FIELDS); $this->template->set('dataFieldList', $fieldNames); /* * Add any additional data required by the template here */ $transitionTypeArray = RowManager_TransitionsManager::getTransitionTypeArray(); $this->template->set('list_transition_type', $transitionTypeArray); $pages = new PageList($this->module_id); $pageArray = $pages->getDropListArray(); $this->template->set('list_transition_fromObjID', $pageArray); $this->template->set('list_transition_toObjID', $pageArray); $templateName = 'siteAdminBox.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_Transitions.php'; return $this->template->fetch($templateName); }