Пример #1
0
		</div>
		<?php 
if ($group_list) {
    foreach ($group_list as $group) {
        ?>
		<div id="groupholder-<?php 
        print $group['id'];
        ?>
" class="group">
			<div class="legend">
				<a id="group_<?php 
        print $group['id'];
        ?>
" class="toggle-group open" href="#">Show</a>
				<strong><?php 
        print DataDisplay::truncateString($group['name'], 25);
        ?>
</strong>
			</div>
			<div id="group_<?php 
        print $group['id'];
        ?>
_details" class="group-info clearfix">
				<ul class="group-list" id="group_<?php 
        print $group['id'];
        ?>
_list">
				<?php 
        if ($group['Contacts']) {
            foreach ($group['Contacts'] as $contact) {
                ?>
Пример #2
0
 /**
  * @abstract Displays a page, and calls itself for any page children
  * @param array $pages An array of a page and its children
  * @param string $ul The ul string to use for the current level
  * @return string
  * @access public
  */
 public function pageOptionGroups($pages = false, $group = false, $opt_selected = false, $editing_page_id = false, $parents = array())
 {
     $pages = $pages ? $pages : $this->loadPages();
     if (is_array($pages)) {
         $html = $group ? '<optgroup>' : '';
         foreach ($pages as $page) {
             if (isset($page['page'])) {
                 // unavailable parents
                 if ($page['page']['parent_id']) {
                     $parents = array_merge(array($page['page']['parent_id']), $parents);
                 }
                 if ($editing_page_id !== $page['page']['page_id'] && !in_array($editing_page_id, $parents)) {
                     $selected = $opt_selected == $page['page']['page_id'] ? ' selected="selected"' : '';
                     $html .= sprintf('<option value="%d"%s>%s</option>', $page['page']['page_id'], $selected, DataDisplay::truncateString($page['page']['page_title'], 35));
                 }
                 if (isset($page['children'])) {
                     $html .= $this->pageOptionGroups($page['children'], true, $opt_selected, $editing_page_id, $parents);
                 }
             }
         }
         $html .= $group ? '</optgroup>' : '';
         return $html;
     }
 }