function create_tree_select($tree, $ParentID, $lvl, $c_parent = "", $c_id = "") { if (!isset($tree[$ParentID])) { return; } foreach ($tree[$ParentID] as $item) { if ($c_id != "" && $c_id == $item->id) { continue; } if ($lvl > 0) { echo '<option value="' . $item->id . '"'; if ($c_parent == $item->id) { echo ' selected="selected" '; } echo '>'; for ($i = 0; $i < $lvl * 2; $i++) { echo " "; } echo "- "; echo $item->title . '</option>'; } else { echo '<option value="' . $item->id . '"'; if ($c_parent == $item->id) { echo ' selected="selected" '; } echo '>' . $item->title . '</option>'; } create_tree_select($tree, $item->id, $lvl + 1, $c_parent, $c_id); } }
<label for="module_name">Module</label> <?php echo form_dropdown('module_name', array('-- Select --') + $modules_select, $navigation_link->module_name); ?> </div> <div class="field float-left"> <label for="uri">Site Link (URI)</label> <input type="text" id="uri" name="uri" value="<?php echo $navigation_link->uri; ?> " /> </div> <div class="field float-left"> <label for="page_id">Page</label> <select name="page_id"> <option value="">-- Select --</option> <?php create_tree_select($pages_select, 0, 0, $navigation_link->page_id); ?> </select> </div> </fieldset> <?php $this->load->view('admin/layout_fragments/table_buttons', array('buttons' => array('save', 'cancel'))); ?> <?php echo form_close();
?> <div class="field"> <label for="title">Title</label> <input type="text" id="title" name="title" maxlength="100" value="<?php echo $gallery->title; ?> " class="text" /> </div> <div class="field width-two-thirds"> <label for="parent">Parent gallery</label> <select name="parent" size="1"> <option value="">-- None --</option> <?php create_tree_select($galleries, 0, 0, $gallery->parent, $gallery->id); ?> </select> </div> <div class="field width-full"> <label for="body">Content</label> <?php echo $this->spaw->show(); ?> </div> <?php $this->load->view('admin/layout_fragments/table_buttons', array('buttons' => array('save', 'cancel'))); ?>
?> <h3>Edit Page "<?php echo $page->title; ?> "</h3> <?php } ?> </div> <div class="tabs"> <ul class="clear-box"> <li><a href="#fieldset1" title="Write post"><span>Page Content</span></a></li> <li><a href="#fieldset2" title="Post date"><span>Meta data</span></a></li> </ul> <!-- Page content tab --> <fieldset id="fieldset1" > <legend>Page content</legend> <div class="field"> <label for="title">Title</label> <input type="text" id="title" name="title" maxlength="60" value="<?php echo $page->title; ?> " class="text" /> <span class="required-icon tooltip">Required</span> </div> <div class="field"> <label for="slug">URL</label>
?> </span> </li> <li> <label for="parent"><?php echo lang('photo_albums.parent_album_label'); ?> </label> <select name="parent" size="1"> <option value="0"><?php echo lang('photo_albums.no_parent_select_label'); ?> </option> <?php create_tree_select($albums, 0, 0, $album->parent, @$album->id); ?> </select> </li> <li class="even"> <label for="enable_comments"><?php echo lang('photo_albums.comments_label'); ?> </label> <?php echo form_checkbox('enable_comments', '1', $album->enable_comments); ?> </li> <li>