public function render_inputs($details = array()) { $mode = 'select'; if ($this->Tag->display_as() && $this->Tag->display_as() == 'checkboxes') { $mode = 'checkboxes'; } $setSlug = $this->Tag->set(); if (!$setSlug) { $setSlug = 'default'; } $Categories = new PerchCategories_Categories(); $cats = $Categories->get_for_set($setSlug); $opts = array(); if (PerchUtil::count($cats)) { foreach ($cats as $Category) { $opts[] = array('label' => $Category->catDisplayPath(), 'value' => $Category->id()); } } switch ($mode) { case 'checkboxes': return $this->render_checkboxes($details, $opts); break; default: return $this->render_select($details, $opts); break; } }
<?php $HTML = $API->get('HTML'); // Try to update $Settings = $API->get('Settings'); if ($Settings->get('perch_blog_update')->val() != '5.0') { PerchUtil::redirect($API->app_path() . '/update/'); } $Blog = new PerchBlog_Posts($API); $Paging = $API->get('Paging'); $Paging->set_per_page(15); $Categories = new PerchCategories_Categories(); $categories = $Categories->get_for_set('blog'); $Sections = new PerchBlog_Sections($API); $sections = $Sections->all(); $Lang = $API->get('Lang'); $posts = array(); $filter = 'all'; if (isset($_GET['category']) && $_GET['category'] != '') { $filter = 'category'; $category = $_GET['category']; } if (isset($_GET['section']) && $_GET['section'] != '') { $filter = 'section'; $section = $_GET['section']; } if (isset($_GET['status']) && $_GET['status'] != '') { $filter = 'status'; $status = $_GET['status']; } switch ($filter) {
$Posts->attempt_install(); $blogs = $Blogs->all(); } $Paging = $API->get('Paging'); $Paging->set_per_page(15); $Blog = false; if (PERCH_RUNWAY) { if (PerchUtil::get('blog')) { $Blog = $Blogs->get_one_by('blogSlug', PerchUtil::get('blog')); } } if (!$Blog) { $Blog = $Blogs->find(1); } $Categories = new PerchCategories_Categories(); $categories = $Categories->get_for_set($Blog->setSlug()); $Sections = new PerchBlog_Sections($API); $sections = $Sections->get_by('blogID', (int) $Blog->id()); $Lang = $API->get('Lang'); $posts = array(); $filter = 'all'; if (isset($_GET['category']) && $_GET['category'] != '') { $filter = 'category'; $category = $_GET['category']; } if (isset($_GET['section']) && $_GET['section'] != '') { $filter = 'section'; $section = $_GET['section']; } if (isset($_GET['status']) && $_GET['status'] != '') { $filter = 'status';