config.php index.php

Zulfirman Tanjung : Perancangan Sistem E-Learning Amik Harapan Medan, 2010. LAMPIRAN I Listing Program

6.1 config.php

?php Moodle Configuration File unsetCFG; CFG-dbtype = mysql; CFG-dbhost = localhost; CFG-dbname = harapan; CFG-dbuser = root; CFG-dbpass = 1221; CFG-dbpersist = false; CFG-prefix = harapan_; CFG-wwwroot = http:localhostharapan.com; CFG-dirroot = D:\\AppServ\\www\\harapan.com; CFG-dataroot = D:\\AppServ\\wwwharapandata; CFG-admin = admin; CFG-directorypermissions = 00777; try 02777 on a server in Safe Mode require_onceCFG-dirrootlibsetup.php; MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES, Zulfirman Tanjung : Perancangan Sistem E-Learning Amik Harapan Medan, 2010. RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE. ?

6.2 index.php

?php Id: index.php,v 1.156.2.2 20060208 04:19:56 patrickslee Exp index.php - the front page. if file_exists.config.php { headerLocation: install.php; die; } Bounds for block widths on this page defineBLOCK_L_MIN_WIDTH, 160; defineBLOCK_L_MAX_WIDTH, 210; defineBLOCK_R_MIN_WIDTH, 160; defineBLOCK_R_MAX_WIDTH, 210; require_onceconfig.php; require_onceCFG-dirroot .courselib.php; require_onceCFG-dirroot .libblocklib.php; if emptySITE { redirectCFG-wwwroot .. CFG-admin .index.php; } if CFG-forcelogin { require_login; } Zulfirman Tanjung : Perancangan Sistem E-Learning Amik Harapan Medan, 2010. if isadmin { if moodle_needs_upgrading { redirectCFG-wwwroot .. CFG-admin .index.php; } } if get_moodle_cookie == { set_moodle_cookienobody; To help search for cookies on login page } if emptyUSER-id { add_to_logSITEID, course, view, view.php?id=.SITEID, SITEID; } if emptyCFG-langmenu { langmenu = ; } else { currlang = current_language; langs = get_list_of_languages; langmenu = popup_form CFG-wwwroot .index.php?lang=, langs, chooselang, currlang, , , , true; } PAGE = page_create_objectPAGE_COURSE_VIEW, SITEID; pageblocks = blocks_setupPAGE; Zulfirman Tanjung : Perancangan Sistem E-Learning Amik Harapan Medan, 2010. editing = PAGE-user_is_editing; preferred_width_left = bounded_numberBLOCK_L_MIN_WIDTH, blocks_preferred_widthpageblocks[BLOCK_POS_LEFT], BLOCK_L_MAX_WIDTH; preferred_width_right = bounded_numberBLOCK_R_MIN_WIDTH, blocks_preferred_widthpageblocks[BLOCK_POS_RIGHT], BLOCK_R_MAX_WIDTH; print_headerstrip_tagsSITE-fullname, SITE- fullname, home, , meta name=description content=. sstrip_tagsSITE-summary . , true, , user_login_stringSITE.langmenu; ? table id=layout-table tr ?php if blocks_have_contentpageblocks, BLOCK_POS_LEFT || editing { echo td style=width: .preferred_width_left.px; id=left-column; Zulfirman Tanjung : Perancangan Sistem E-Learning Amik Harapan Medan, 2010. blocks_print_groupPAGE, pageblocks, BLOCK_POS_LEFT; echo td; } echo td id=middle-column; Print Section if SITE-numsections 0 { if section = get_recordcourse_sections, course, SITE-id, section, 1 { delete_recordscourse_sections, course, SITE-id, section, 1; Just in case section-course = SITE-id; section-section = 1; section-summary = ; section-sequence = ; section-visible = 1; section-id = insert_recordcourse_sections, section; } if emptysection-sequence or emptysection- summary or editing { print_simple_box_startcenter, 100, , 5, sitetopic; If currently moving a file then show the current clipboard Zulfirman Tanjung : Perancangan Sistem E-Learning Amik Harapan Medan, 2010. if ismovingSITE-id { stractivityclipboard = strip_tagsget_stringactivityclipboard, , addslashesUSER-activitycopyname; echo pfont size=2; echo stractivityclipboardnbsp;nbsp;a href=\coursemod.php?cancelcopy=trueamp;sesskey=USER- sesskey\. get_stringcancel .a; echo fontp; } options = NULL; options-noclean = true; echo format_textsection-summary, FORMAT_HTML, options; if editing { streditsummary = get_stringeditsummary; echo a title=\streditsummary\ . href=\courseeditsection.php?id=section-id\img src=\CFG-pixpathtedit.gif\ . height=\11\ width=\11\ border=\0\ alt=\streditsummary\ abr br ; } get_all_modsSITE-id, mods, modnames, modnamesplural, modnamesused; print_sectionSITE, section, mods, modnamesused, true; Zulfirman Tanjung : Perancangan Sistem E-Learning Amik Harapan Medan, 2010. if editing { print_section_add_menusSITE, section- section, modnames; } print_simple_box_end; } } switch CFG-frontpage { Display the main part of the front page. case FRONTPAGENEWS: if SITE-newsitems { Print forums only when needed require_onceCFG-dirroot .modforumlib.php; if newsforum = forum_get_course_forumSITE-id, news { errorCould not find or create a main news forum for the site; } if issetUSER-id { SESSION-fromdiscussion = CFG- wwwroot; if forum_is_subscribedUSER-id, newsforum-id { subtext = get_stringunsubscribe, forum; } else { Zulfirman Tanjung : Perancangan Sistem E-Learning Amik Harapan Medan, 2010. subtext = get_stringsubscribe, forum; } headertext = table width=100 border=0 cellspacing=0 cellpadding=0tr. tddiv class=title.newsforum-name.divtd. tddiv class=linka href=modforumsubscribe.php?id=.newsforum- id..subtext.adivtd. trtable; } else { headertext = newsforum-name; } print_heading_blockheadertext; forum_print_latest_discussionsSITE, newsforum, SITE-newsitems; } break; case FRONTPAGECOURSELIST: case FRONTPAGECATEGORYNAMES: if isloggedin issetUSER-admin emptyCFG-disablemycourses { print_heading_blockget_stringmycourses; print_my_moodle; } else { Zulfirman Tanjung : Perancangan Sistem E-Learning Amik Harapan Medan, 2010. countcategories = count_recordscourse_categories; if countcategories 1 || countcategories == 1 count_recordscourse 200 { if CFG-frontpage == FRONTPAGECOURSELIST { print_heading_blockget_stringavailablecourses; } else { print_heading_blockget_stringcategories; } print_simple_box_startcenter, 100, , 5, categorybox; print_whole_category_list; print_simple_box_end; print_course_search, false, short; } else { print_heading_blockget_stringavailablecourses; print_courses0, 100; } } break; case FRONTPAGETOPICONLY: Do nothing :- break; } echo td; Zulfirman Tanjung : Perancangan Sistem E-Learning Amik Harapan Medan, 2010. The right column if blocks_have_contentpageblocks, BLOCK_POS_RIGHT || editing || isadmin { echo td style=width: .preferred_width_right.px; id=right-column; if isadmin { echo div align=center.update_course_iconSITE-id.div; echo br ; } blocks_print_groupPAGE, pageblocks, BLOCK_POS_RIGHT; echo td; } ? tr table ?php print_footerhome; Please do not modify this line ? Zulfirman Tanjung : Perancangan Sistem E-Learning Amik Harapan Medan, 2010.

6.3 admin.html