Changeset 1722:63591a096fb3 for plugins/simpleMenu/index.php
- Timestamp:
- 09/04/13 15:48:57 (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/simpleMenu/index.php
r1636 r1722 23 23 24 24 # Liste des catégories 25 $categories_combo = array();26 25 $categories_label = array(); 27 try { 28 $rs = $core->blog->getCategories(array('post_type'=>'post')); 29 while ($rs->fetch()) { 30 $categories_combo[] = new formSelectOption( 31 str_repeat(' ',$rs->level-1).($rs->level-1 == 0 ? '' : '• ').html::escapeHTML($rs->cat_title), 32 $rs->cat_url 33 ); 34 $categories_label[$rs->cat_url] = html::escapeHTML($rs->cat_title); 35 } 36 } catch (Exception $e) { } 37 26 $rs = $core->blog->getCategories(array('post_type'=>'post')); 27 $categories_combo = dcAdminCombos::getCategoriesCombo($rs); 28 unset($categories_combo[__('(No cat)')]); 29 $rs->moveStart(); 30 while ($rs->fetch()) { 31 $categories_label[$rs->cat_id] = html::escapeHTML($rs->cat_title); 32 } 38 33 # Liste des langues utilisées 39 $langs_combo = array(); 40 try { 41 $rs = $core->blog->getLangs(array('order'=>'asc')); 42 if ($rs->count() > 1) 43 { 44 $all_langs = l10n::getISOcodes(0,1); 45 while ($rs->fetch()) { 46 $lang_name = isset($all_langs[$rs->post_lang]) ? $all_langs[$rs->post_lang] : $rs->post_lang; 47 $langs_combo[$lang_name] = $rs->post_lang; 48 } 49 unset($all_langs); 50 } 51 unset($rs); 52 } catch (Exception $e) { } 34 $langs_combo = dcAdminCombos::getLangscombo( 35 $core->blog->getLangs(array('order'=>'asc')) 36 ); 53 37 54 38 # Liste des mois d'archive 55 $ months_combo = array();56 try { 57 $rs = $core->blog->getDates(array('type'=>'month'));58 $months_combo[__('All months')] = '-';59 $first_year = $last_year = 0;60 while ($rs->fetch()) { 61 $months_combo[dt::str('%B %Y',$rs->ts())] = $rs->year().$rs->month();62 if (($first_year == 0) || ($rs->year() < $first_year)) $first_year = $rs->year(); 63 if (($last_year == 0) || ($rs->year() > $last_year)) $last_year = $rs->year();64 }65 unset($rs); 66 } catch (Exception $e) { } 39 $rs = $core->blog->getDates(array('type'=>'month')); 40 $months_combo = array_merge( 41 array(__('All months') => '-'), 42 dcAdmincombos::getDatesCombo($rs) 43 ); 44 45 $first_year = $last_year = 0; 46 while ($rs->fetch()) { 47 if (($first_year == 0) || ($rs->year() < $first_year)) $first_year = $rs->year(); 48 if (($last_year == 0) || ($rs->year() > $last_year)) $last_year = $rs->year(); 49 } 50 unset($rs); 67 51 68 52 # Liste des pages -- Doit être pris en charge plus tard par le plugin ? … … 395 379 dcPage::success(__('Menu items have been successfully updated.')); 396 380 } 397 398 381 if ($step) 399 382 {
Note: See TracChangeset
for help on using the changeset viewer.