function content_block() { $container = container(); $content = new FlipTurnOptionMeta(); // Account for no data in the options table if ($content->existOptionMetaByKey(FT_HOME_PAGE_OPTION)) { $content->loadOptionMetaByKey(FT_HOME_PAGE_OPTION); $container->add(htmlspecialchars_decode($content->getOptionMetaValue())); } else { $container->add(FT_HOME_PAGE_OPTION_DEFAULT_CONTENT); } // Allow the Admin to Edit the page content if ($this->user_is_logged_in()) { $container->add(div_font8bold(html_a('home_edit.php', 'Edit'))); } return $container; }
/** * This method is called only the first time the form * page is hit. This enables u to query a DB and * pre populate the FormElement objects with data. * */ function form_init_data() { $content = new FlipTurnOptionMeta(); // Account for no data in the options table if ($content->existOptionMetaByKey(FT_HOME_PAGE_OPTION)) { $content->loadOptionMetaByKey(FT_HOME_PAGE_OPTION); $this->set_element_value($this->getEditPageLabel(), $content->getOptionMetaValue()); } else { $this->set_element_value($this->getEditPageLabel(), FT_HOME_PAGE_OPTION_DEFAULT_CONTENT); } }