Difference between revisions of "SAC:Setup OCS Custom Additions"
m (typo) |
m (→Starting Template: add schedconfhandler) |
||
| Line 66: | Line 66: | ||
</pre> | </pre> | ||
| + | Add section to: | ||
| + | <pre> | ||
| + | /pages/schedConf/SchedConfHandler.inc.php: | ||
| + | /** | ||
| + | * Display conference transportation page | ||
| + | */ | ||
| + | function transportation() { | ||
| + | list($conference, $schedConf) = SchedConfHandler::validate(true, true); | ||
| + | |||
| + | $templateMgr = &TemplateManager::getManager(); | ||
| + | $templateMgr->assign('pageHierarchy', array( | ||
| + | array(Request::url(null, 'index', 'index'), $conference->getConferenceTitle(), true), | ||
| + | array(Request::url(null, null, 'index'), $schedConf->getSchedConfTitle(), true))); | ||
| + | SchedConfHandler::setupSchedConfTemplate($conference,$schedConf); | ||
| + | |||
| + | $templateMgr->assign('transportationDescription', $schedConf->getLocalizedSetting('transportationDescription')); | ||
| + | $templateMgr->assign('transportationFiles', $schedConf->getLocalizedSetting('transportationFiles')); | ||
| + | |||
| + | $templateMgr->assign('helpTopicId', 'schedConf.transportation'); | ||
| + | $templateMgr->display('schedConf/transportation.tpl'); | ||
| + | } | ||
| + | </pre> | ||
[[Category:Infrastructure]] | [[Category:Infrastructure]] | ||
[[Category:OCS]] | [[Category:OCS]] | ||
Revision as of 18:25, 13 February 2008
For capturing some notes about trying to create a custom new set of forms for use in OCS Open Conference System. These tests are done on me local PC but will be merged into OSGeo code if/when ready.
These improvements attempt to address some of the system needs discussed in FOSS4G2008 Committee Issues
This is also a journal chronicling the adaptations.
Starting Template
To keep it as simple as possible I will take the existing Accommodations functions, make a copy and modify them from there. (At time of writing this was only available in CVS for upcoming OCS 2.2 release) My new functions will be for presenting a link to Transportation items in the sidebar menu.
cd OCSROOT/classes/manager/form cp AccommodationSettingsForm.inc.php TransportationSettingsForm.inc.php
Replace all references to Accommodations and accommodations with Transportation:
sed -i .bak 's/Accommodation/Transportation/g' TransportationSettingsForm.inc.php sed -i .bak 's/accommodation/transportation/g' TransportationSettingsForm.inc.php
cd OCSROOT/pages/manager cp ManagerAccommodationHandler.inc.php ManagerTransportationHandler.inc.php sed -i .bak 's/Accommodation/Transportation/g' ManagerTransportationHandler.inc.php sed -i .bak 's/accommodation/transportation/g' ManagerTransportationHandler.inc.php
cd OCSROOT/templates/manager cp accommodationSettings.tpl transportationSettings.tpl sed -i .bak 's/Accommodation/Transportation/g' transportationSettings.tpl sed -i .bak 's/accommodation/transportation/g' transportationSettings.tpl
cd OCSROOT/templates/schedConf cp accommodation.tpl transportation.tpl sed -i .bak 's/Accommodation/Transportation/g' accommodation.tpl sed -i .bak 's/accommodation/transportation/g' accommodation.tpl
Update locale.xml file to populate UI:
locale/en_US/locale.xml:
<message key="schedConf.accommodation">Accommodation</message>
<message key="schedConf.accommodation.title">{$schedConfAbbrev} Accommodation</message>
<!-- Accommodation settings --> --- Whole section
<message key="manager.accommodation">Accommodation</message>
Update ManagerHandler so options appear:
pages/manager/ManagerHandler.inc.php:
//
// Accommodation
//
... entire section (2 functions)
ADDED:
//
// Transportation
//
function transportation() {
import('pages.manager.ManagerTransportationHandler');
ManagerTransportationHandler::transportation();
}
function saveTransportationSettings() {
import('pages.manager.ManagerTransportationHandler');
ManagerTransportationHandler::saveTransportationSettings();
}
Add section to:
/pages/schedConf/SchedConfHandler.inc.php:
/**
* Display conference transportation page
*/
function transportation() {
list($conference, $schedConf) = SchedConfHandler::validate(true, true);
$templateMgr = &TemplateManager::getManager();
$templateMgr->assign('pageHierarchy', array(
array(Request::url(null, 'index', 'index'), $conference->getConferenceTitle(), true),
array(Request::url(null, null, 'index'), $schedConf->getSchedConfTitle(), true)));
SchedConfHandler::setupSchedConfTemplate($conference,$schedConf);
$templateMgr->assign('transportationDescription', $schedConf->getLocalizedSetting('transportationDescription'));
$templateMgr->assign('transportationFiles', $schedConf->getLocalizedSetting('transportationFiles'));
$templateMgr->assign('helpTopicId', 'schedConf.transportation');
$templateMgr->display('schedConf/transportation.tpl');
}