Connecting to a third party database
Permalink
I am not 100% certain how to do this. I am trying to create a custom block that connects to a database, then I want to be able to take that information and put it in a drop down from where I make a selection from the list and information is displayed. Here is the controller.php file:
And here is the form.php file where I am trying to display the drop down.
Any help with this would be greatly appreciated, thanks in advance.
<?php defined('C5_EXECUTE') or die("Access Denied."); class PeopleListBlockController extends BlockController { protected $btTable = 'btPeopleList'; protected $btInterfaceWidth = "500"; protected $btInterfaceHeight = "350"; protected $btExportPageColumns = array('cParentID'); protected $btExportPageTypeColumns = array('ctID'); protected $btCacheBlockRecord = true; /** * Used for localization. If we want to localize the name/description we have to include this */ public function getBlockTypeDescription() { return t("List people based on group."); }
Viewing 15 lines of 87 lines. View entire code block.
And here is the form.php file where I am trying to display the drop down.
<?php defined('C5_EXECUTE') or die("Access Denied."); ?> <input type="hidden" name="pageListToolsDir" value="<?php echo $uh->getBlockTypeToolsURL($bt)?>/" /> <div id="ccm-pagelistPane-add" class="ccm-pagelistPane"> <div class="ccm-block-field-group"> <h2><?php echo t('Group to Display')?></h2> <?php $ctArray = CollectionType::getList(); if (is_array($ctArray)) { ?> <select name="group" id="groupList"> <?php foreach ($ctArray as $ct) { ?> <option value="<?php echo $ct->getCollectionTypeID()?>" <?php if ($ctID == $ct->getCollectionTypeID()) { ?> selected <?php } ?>> <?php echo $ct->getCollectionTypeName()?> </option> <?php } ?> </select>
Viewing 15 lines of 18 lines. View entire code block.
Any help with this would be greatly appreciated, thanks in advance.