Date post: | 22-Dec-2015 |
Category: |
Documents |
Upload: | phillip-griffin |
View: | 214 times |
Download: | 0 times |
V 1.0
Structure of a CRUD module• Actions:
– MOD– EDIT– DEL– SHOW– LIST
• Every action modifies $output (or redirects)• Main CMS approach: this $output is not the full page!
OE NIK, 2013 7
V 1.0
THE GOD OF <DIV>• Easier to design/change• Easier to separate the style and the content using CSS• By default a block-level element, but this can be changed• float: none, left, right• clear:both
10OE NIK, 2014
V 1.0
CMS basic requirements• mod_rewrite to create SEO URLs• For every page: ID, code, name, module, html, default
OE NIK, 2013 11
V 1.0
Songs module – modifications in the HTML• <form action='index.php?action=EDIT&id=[song_id]' method='POST'>
<form action='[page_code]?action=EDIT&id=[song_id]' method='POST'>
• Instead of http://localhost/dir/ index.php?action=EDIT&id=42 , the form will submit to http://localhost/dir/songs?action=EDIT&id=42
• We should change the same references in the PHP file too
OE NIK, 2013 12
V 1.0
Songs module – modifications in the PHP• $page should always contain the page code• Move import(), designer_replace(),
create_select_from_array(), addlink() to general.php• (Add isloggedin(), draw_menu() to general.php)
• Check for CMSMOD comments in the html and php files– Changed every addlink(“index.php?action=xxx”) code
to addlink(“{$page}?action=xxx”)– Changed every header(“location: index.php”) code to
header(“location: {$page}”)– $module_html="html/song_form.html";
OE NIK, 2013 13
V 1.0
CMS Tasks• Download 10_lcms_part.zip• Structure??? Files??? .htaccess???• We should implement the index.php ( CMS
organization) and sample.module.inc.php (login/logout)• Songs module: WORKS out-of-the-box
OE NIK, 2013 14