/** * function deleteEntry * <pre> * Removes the child entries of Module objects before removing self. * (Poor Man's Referential Integrity) * </pre> * @return [void] */ function deleteEntry() { // first remove any associated State Variables $list = new StateVarList($this->getModuleID()); $list->setFirst(); while ($item = $list->getNext()) { $item->deleteEntry(); } // now remove any Data Access Objects $list = new DAObjList($this->getModuleID()); $list->setFirst(); while ($item = $list->getNext()) { $item->deleteEntry(); } // now remove any Page Objects $list = new PageList($this->getModuleID()); $list->setFirst(); while ($item = $list->getNext()) { $item->deleteEntry(); } // now remove any Transitions $list = new TransitionsList($this->getModuleID()); $list->setFirst(); while ($item = $list->getNext()) { $item->deleteEntry(); } // now call parent method parent::deleteEntry(); }
/** * function processPageInfo * <pre> * Takes the Page info and creates the proper objects_bl/ pages, updates * app_Module with the proper initialization info. * </pre> * @param $moduleID [INTEGER] The module id of the Pages to work with * @return [void] */ function processPageInfo($moduleID) { // open include file $key = ModuleCreator::KEY_PATH_INCLUDE_NAME; $includeFileName = $this->values[$key]; $includeFileContents = file_get_contents($includeFileName); // open app file $appFileName = $this->values[ModuleCreator::KEY_PATH_APP_NAME]; $appFileContents = file_get_contents($appFileName); $pageList = new PageList($moduleID); // for each page $pageList->setFirst(); while ($page = $pageList->getNext()) { // if page not already created if (!$page->isCreated()) { // open page template based on page type $templateContents = $this->getTemplate($page); // replace TAGS $this->replaceTemplateTags($page, $templateContents); // store data as new object bl file $blPath = $this->values[ModuleCreator::KEY_PATH_MODULE_PAGES]; $name = 'page_' . $page->getPageName() . '.php'; file_put_contents($blPath . $name, $templateContents); // include new file in include file $tag = ModuleCreator::TAG_INCLUDE_PAGES; $data = "require_once( '" . ModuleCreator::PATH_OBJECT_PAGES . $name . "' );\n"; $data .= $tag; $includeFileContents = str_replace($tag, $data, $includeFileContents); // update page info in app file $this->updatePageAppInfo($page, $appFileContents); // prepare the tool setup file to receive labels for this page. $this->preparePageLabels($page); // if page is a custom template then if ($page->isCustom()) { $this->transferCustomTemplate($page); } // end if // Mark this page as having been created $page->setCreated(); } // end if // NOTE: we update a page labels even if a page has already been // created. If there are new labels, they will be added to the // list. // update page labels $this->updatePageLabels($page); } // next page // save include file file_put_contents($includeFileName, $includeFileContents); // save app file file_put_contents($appFileName, $appFileContents); }