public function output($post = null) { if (empty($this->params)) { return ''; } $output = ''; $is_empty = true; foreach ($this->params as $id => $template) { if (is_array($template)) { $template_button = new SPBTemplateMenuButton(); $output .= $template_button->setup($template)->setID($id)->output(); $is_empty = false; } } return $output; }
public function output($post = null) { if (empty($this->params)) { return ''; } $output = '<li class="nav-header">' . __('Save Template', 'swift-framework-admin') . '</li> <li id="spb_save_template"><a href="#">' . __('Save current page as a Template', 'swift-framework-admin') . '</a></li> <li class="divider"></li> <li class="nav-header">' . __('Load Template', 'swift-framework-admin') . '</li>'; $is_empty = true; foreach ($this->params as $id => $template) { if (is_array($template)) { $template_button = new SPBTemplateMenuButton(); $output .= $template_button->setup($template)->setID($id)->output(); $is_empty = false; } } if ($is_empty) { $output .= '<li class="spb_no_templates"><span>' . __('No custom templates yet.', 'swift-framework-admin') . '</span></li>'; } return $output; }