<?php } ?> <h2 class="heading">Custom Order</h2> <div class="actions"> <a class="btn btn-primary" href="/site-admin/custom/create_step/">Add Step</a> </div> <ul> <?php $stepids = array(); $i = 1; while ($Step->is_loaded()) { $stepids[] = $Step->id(); display_step($Step, $i > 1, $AllSteps); $i++; $Step = $Step->next_step; } //Get other steps not displayed $DB = new mStep(); if (count($stepids) > 0) { $DB->db->where_not_in($DB->_id(), $stepids); } $Steps = $DB->get(); foreach ($Steps as $Step) { $i++; display_step($Step, $i > 1, $AllSteps); } ?> </ul>
function delete_step($StepID) { $Step = new mStep($StepID); if ($Step->is_loaded()) { $Step->delete(); $this->output->delete_cache('/'); } redirect('/site-admin/custom/'); }