diff --git a/bl-kernel/archives.class.php b/bl-kernel/archives.class.php index 5b5c79d1..c1e487d5 100644 --- a/bl-kernel/archives.class.php +++ b/bl-kernel/archives.class.php @@ -46,4 +46,19 @@ class Archives extends dbList { return $this->save(); } + public function getLinkList($month, $class = "", $classActive = "active") + { + $listLink = array(); + foreach ($this->db as $pageKey=>$pageFields) { + if ( + ($month && strlen($pageKey) != 4) + || (!$month && strlen($pageKey) == 4) + ) { + $link = DOMAIN_ARCHIVES . $pageKey; + $listLink[] = new Link($pageFields['name'], $link, $class, $classActive); + } + } + return $listLink; + } + } \ No newline at end of file diff --git a/bl-kernel/boot/init.php b/bl-kernel/boot/init.php index d9df020f..5fa6acaa 100644 --- a/bl-kernel/boot/init.php +++ b/bl-kernel/boot/init.php @@ -41,6 +41,7 @@ define('PATH_CONTENT', PATH_ROOT . 'bl-content' . DS); define('PATH_ABSTRACT', PATH_KERNEL . 'abstract' . DS); define('PATH_RULES', PATH_KERNEL . 'boot' . DS . 'rules' . DS); define('PATH_HELPERS', PATH_KERNEL . 'helpers' . DS); +define('PATH_CLASSES', PATH_KERNEL . 'class' . DS); define('PATH_AJAX', PATH_KERNEL . 'ajax' . DS); define('PATH_CORE_JS', PATH_KERNEL . 'js' . DS); @@ -116,6 +117,9 @@ include(PATH_KERNEL . 'social.class.php'); // Include functions include(PATH_KERNEL . 'functions.php'); +// Include classes +include(PATH_CLASSES . 'link.class.php'); + // Include Helpers Classes include(PATH_HELPERS . 'text.class.php'); include(PATH_HELPERS . 'log.class.php'); @@ -131,6 +135,7 @@ include(PATH_HELPERS . 'alert.class.php'); include(PATH_HELPERS . 'paginator.class.php'); include(PATH_HELPERS . 'image.class.php'); include(PATH_HELPERS . 'media.class.php'); +include(PATH_HELPERS . 'menus.class.php'); include(PATH_HELPERS . 'tcp.class.php'); include(PATH_HELPERS . 'dom.class.php'); include(PATH_HELPERS . 'cookie.class.php'); diff --git a/bl-kernel/class/link.class.php b/bl-kernel/class/link.class.php new file mode 100644 index 00000000..f2c6ba68 --- /dev/null +++ b/bl-kernel/class/link.class.php @@ -0,0 +1,40 @@ +label = $label; + $this->href = $href; + $this->class = $class; + $this->classActive = $classActive; + } + + function isActive() + { + return false; + } + + function haveClass() + { + return ($this->getClasses() != ""); + } + + function getClasses() + { + return $this->class . ($this->isActive() ? " " . $this->classActive : ""); + } + + function toHTML() + { + return "haveClass() ? "class='" . $this->getClasses() . "'" : "" ) . " >".$this->label.""; + } +} \ No newline at end of file diff --git a/bl-kernel/helpers/menus.class.php b/bl-kernel/helpers/menus.class.php new file mode 100644 index 00000000..feecc03c --- /dev/null +++ b/bl-kernel/helpers/menus.class.php @@ -0,0 +1,21 @@ +getLinkList($monthly, $classLink, $classActive), $classUl); + } + + private static function toMenu($links, $classUl) + { + $html = '