}
        }
        if ($serport_count > $port_count) {
            $port_count = $serport_count;
        }
    }
    return $linklist;
}
if ($input_errors) {
    print_input_errors($input_errors);
}
$linkparamstr = gettext('Bandwidth is set only for MLPPP connections and when links have different bandwidths' . '<br />' . 'MTU defaults to 1492' . '<br />' . 'MRU will be auto-negotiated by default' . '<br />' . 'Set only for MLPPP connections. MRRU will be auto-negotiated by default.');
$form = new Form();
$section = new Form_Section('PPP Configuration');
$section->addInput(new Form_Select('type', 'Link Type', $pconfig['type'], $types));
$linklist = build_link_list();
$section->addInput(new Form_Select('interfaces', 'Link Interface(s)', $linklist['selected'], $linklist['list'], true))->addClass('interfaces')->setHelp('Select at least two interfaces for Multilink (MLPPP) connections.');
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('A description may be entered here for administrative reference. Description will appear in the "Interfaces Assign" select lists.');
$section->addInput(new Form_Select('country', 'Country', $pconfig['country'], build_country_list()));
$section->addInput(new Form_Select('provider', 'Provider', $pconfig['provider'], []));
$section->addInput(new Form_Select('providerplan', 'Plan', $pconfig['providerplan'], []))->setHelp('Select to fill in service provider data.');
$section->addInput(new Form_Input('username', 'Username', 'text', $pconfig['username']));
$section->addPassword(new Form_Input('passwordfld', 'Password', 'password', $pconfig['password']));
// These elements are hidden by default, and un-hidden in Javascript
if ($pconfig['type'] == 'pptp' || $pconfig['type'] == 'l2tp') {
    $j = 0;
    foreach ($linklist['list'] as $ifnm => $nm) {
        $group = new Form_Group('IP/Gateway (' . $ifnm . ')');
        $group->add(new Form_IpAddress('localiplabel' . $j, null, $pconfig['localip'][$j]))->addMask('subnet' . $j, $pconfig['subnet'][$j], 31)->setHelp('IP Address');
        $group->add(new Form_Input('gateway' . $j, null, 'text', $pconfig['gateway'][$j]))->setHelp('IP or Hostname');
        $j++;
        ?>
</td>			
			<td>
			<?php 
        $link_list = array(array('title' => 'Edit', 'ctrl' => 'stories', 'action' => 'modify_widget', 'id' => $widget['id']), array('title' => 'Add to story', 'ctrl' => 'stories', 'action' => 'add_story_widget', 'id' => $widget['id']), array('title' => 'Place in other location', 'ctrl' => 'stories', 'action' => 'place_widget', 'id' => $widget['id']), array('title' => 'Remove from all stories', 'ctrl' => 'stories', 'action' => 'remove_widget_from_stories', 'id' => $widget['id']), array('title' => 'Delete', 'ctrl' => 'stories', 'action' => 'destroy_widget', 'id' => $widget['id'], 'onclick' => "if(!confirm('Are you sure you want to remove this item?')) return false"));
        if ($links = build_link_list($link_list)) {
            echo $links;
        }
        ?>
			</td>
		</tr>
		<?php 
    }
    ?>
	</table>
<?php 
} else {
    ?>
<h2>Sorry no widgets currently</h2>
<?php 
}
?>
<div class="spacer"></div><br /><br />
<?php 
$bottom_link_lists = array(array('title' => 'Create a new Widget', 'ctrl' => 'stories', 'action' => 'new_widget'), array('title' => 'Reset cover feature', 'ctrl' => 'stories', 'action' => 'reset_widget_cover'), array('title' => 'Reset cover sidebar', 'ctrl' => 'stories', 'action' => 'reset_widget_sidebar'));
if ($bottom_links = build_link_list($bottom_link_lists)) {
    echo $bottom_links;
}
?>
</div>
</p>
<div class="spacer"></div>

<p id="card[shortCaption]">Short Caption:<br /> <?php 
echo htmlentities($card['shortCaption']);
?>
</p>
<div class="spacer"></div>

<p id="card[longCaption]">Long Caption:<br /> <?php 
echo htmlentities($card['longCaption']);
?>
</p>
<div class="spacer"></div>

<p id="card[dateAvailable]">Width: <?php 
echo htmlentities($card['dateAvailable']);
?>
</p>
<div class="spacer"></div>

<br /><br />
<p>Actions:</p>
<?php 
$link_list = array(array('title' => 'Create a new card', 'ctrl' => 'members', 'action' => 'new_card'), array('title' => 'Edit this card', 'ctrl' => 'members', 'action' => 'modify_card', 'id' => $card['id']), array('title' => 'Delete this card', 'ctrl' => 'members', 'action' => 'destroy_card', 'id' => $card['id'], 'onclick' => "if(!confirm('Are you sure you want to remove this item?')) return false"), array('title' => 'Back to cards', 'ctrl' => 'members', 'action' => 'cards'));
if ($links = build_link_list($link_list)) {
    echo $links;
}
?>
</div>
 /**
  * Format link list
  *
  * @return string output - <li> formatted collection
  */
 protected function formatLinkList()
 {
     $list = $this->db->orderBy('sort_order', 'ASC')->get('link_list', null);
     $this->pageInfo['links'] = build_link_list($list);
     return $this->pageInfo['links'];
 }