public function buttons($controller, $actions = array(), $title = false) { $class = get_class($this); if (count($actions)) { ?> <ul class="buttons buttons-<?php echo MasterPress::$action ?>"> <?php foreach ($actions as $action) { switch ($action) { case "create" : if ($title) { echo '<li class="create">'. MPV::title_create_button( $controller ).'</li>'; } else { echo '<li class="create">'. MPV::create_button( $controller, call_user_func( array( $class, "__s" ) ) ).'</li>'; } break; case "edit" : echo '<li class="edit">'. MPV::edit_button( $controller, call_user_func( array( $class, "__s" ) ) ).'</li>'; break; case "save" : if ($title) { echo '<li class="save">'. MPV::title_save_button( $controller ).'</li>'; } else { echo '<li class="save">'. MPV::save_button( $controller, call_user_func( array( $class, "__s" ) ) ).'</li>'; } break; case "update" : if ($title) { echo '<li class="update">'. MPV::title_update_button( $controller ).'</li>'; } else { echo '<li class="update">'. MPV::update_button( $controller, call_user_func( array( $class, "__s" ) ) ).'</li>'; } break; default: echo '<li>'.$action.'</li>'; } ?><?php } ?> </ul> <?php } }