public function create_inc_files($copyright_holder) { if ($this->get_type() == 'html') { $body_div_content_inc_filename = $this->get_name() . '/body.div.content.inc.php'; if (file_exists($body_div_content_inc_filename)) { #echo "$body_div_content_inc_filename already exists!\n"; } else { $body_div_content_inc_file = new HaddockProjectOrganisation_PHPIncFile($body_div_content_inc_filename); $body_div_content_inc_file->set_title_line('Content of the "' . $this->get_page_name() . '" page.'); $body_div_content_inc_file->set_copyright_holder($copyright_holder); $content_div_content = ''; $content_div_content .= '$content_div = new HTMLTags_Div();' . "\n"; $content_div_content .= '$content_div->set_attribute_str(\'id\', \'content\');' . "\n"; $content_div_content .= "\n"; $content_div_content .= 'echo $content_div->get_as_string();' . "\n"; $body_div_content_inc_file->set_body($content_div_content); $body_div_content_inc_file->save(); } } else { $main_inc_filename = $this->get_name() . '/main.inc.php'; if (file_exists($main_inc_filename)) { #echo "$main_inc_filename already exists!\n"; } else { $main_inc_file = new HaddockProjectOrganisation_PHPIncFile($main_inc_filename); $main_inc_file->set_title_line('Main code for the "' . $this->get_page_name() . '" page.'); $main_inc_file->set_copyright_holder($copyright_holder); $main_inc_file->save(); } } }
public function create_inc_files($copyright_holder) { $pre_html_inc_filename = $this->get_name() . '/pre-html.inc.php'; if (file_exists($pre_html_inc_filename)) { #echo "$pre_html_inc_filename already exists!\n"; } else { $pre_html_inc_file = new HaddockProjectOrganisation_PHPIncFile($pre_html_inc_filename); $pre_html_inc_file->set_title_line('Pre-html code for the "' . $this->get_page_name() . '" admin page.'); $pre_html_inc_file->set_copyright_holder($copyright_holder); $pre_html_inc_file->save(); } $body_div_content_inc_filename = $this->get_name() . '/body.div.content.inc.php'; if (file_exists($body_div_content_inc_filename)) { #echo "$body_div_content_inc_filename already exists!\n"; } else { $body_div_content_inc_file = new HaddockProjectOrganisation_PHPIncFile($body_div_content_inc_filename); $body_div_content_inc_file->set_title_line('Content of the "' . $this->get_page_name() . '" admin page.'); $body_div_content_inc_file->set_copyright_holder($copyright_holder); $content_div_content = ''; $content_div_content .= '$content_div = new HTMLTags_Div();' . "\n"; $content_div_content .= '$content_div->set_attribute_str(\'id\', \'content\');' . "\n"; $content_div_content .= "\n"; $content_div_content .= 'echo $content_div->get_as_string();' . "\n"; $body_div_content_inc_file->set_body($content_div_content); $body_div_content_inc_file->save(); } $redirect_script_inc_filename = $this->get_name() . '/redirect-script.inc.php'; if (file_exists($redirect_script_inc_filename)) { #echo "$redirect_script_inc_filename already exists!\n"; } else { $redirect_script_inc_file = new HaddockProjectOrganisation_PHPIncFile($redirect_script_inc_filename); $redirect_script_inc_file->set_title_line('Redirect script for the "' . $this->get_page_name() . '" admin page.'); $redirect_script_inc_file->set_copyright_holder($copyright_holder); $redirect_script_inc_file->save(); } }