adminurl->get('admin.plugin.simpleMenu'); # Url du blog $blog_url = html::stripHostURL($core->blog->url); # Liste des catégories $categories_label = array(); $rs = $core->blog->getCategories(array('post_type' => 'post')); $categories_combo = dcAdminCombos::getCategoriesCombo($rs, false, true); $rs->moveStart(); while ($rs->fetch()) { $categories_label[$rs->cat_url] = html::escapeHTML($rs->cat_title); } # Liste des langues utilisées $langs_combo = dcAdminCombos::getLangscombo( $core->blog->getLangs(array('order' => 'asc')) ); # Liste des mois d'archive $rs = $core->blog->getDates(array('type' => 'month')); $months_combo = array_merge( array(__('All months') => '-'), dcAdmincombos::getDatesCombo($rs) ); $first_year = $last_year = 0; while ($rs->fetch()) { if (($first_year == 0) || ($rs->year() < $first_year)) { $first_year = $rs->year(); } if (($last_year == 0) || ($rs->year() > $last_year)) { $last_year = $rs->year(); } } unset($rs); # Liste des pages -- Doit être pris en charge plus tard par le plugin ? $pages_combo = array(); try { $rs = $core->blog->getPosts(array('post_type' => 'page')); while ($rs->fetch()) { $pages_combo[$rs->post_title] = $rs->getURL(); } unset($rs); } catch (Exception $e) {} # Liste des tags -- Doit être pris en charge plus tard par le plugin ? $tags_combo = array(); try { $rs = $core->meta->getMetadata(array('meta_type' => 'tag')); $tags_combo[__('All tags')] = '-'; while ($rs->fetch()) { $tags_combo[$rs->meta_id] = $rs->meta_id; } unset($rs); } catch (Exception $e) {} # Liste des types d'item de menu $items = new ArrayObject(); $items['home'] = new ArrayObject(array(__('Home'), false)); if (count($langs_combo) > 1) { $items['lang'] = new ArrayObject(array(__('Language'), true)); } if (count($categories_combo)) { $items['category'] = new ArrayObject(array(__('Category'), true)); } if (count($months_combo) > 1) { $items['archive'] = new ArrayObject(array(__('Archive'), true)); } if ($core->plugins->moduleExists('pages')) { if (count($pages_combo)) { $items['pages'] = new ArrayObject(array(__('Page'), true)); } } if ($core->plugins->moduleExists('tags')) { if (count($tags_combo) > 1) { $items['tags'] = new ArrayObject(array(__('Tags'), true)); } } # --BEHAVIOR-- adminSimpleMenuAddType # Should add an item to $items[] as an array(