Automad = $Automad; $this->collection = $this->Automad->getCollection(); } /** * Generate breadcrumbs to the current page, if the page's level is > 0 (not homepage / search results / page not found). * * Options: * - class: false (class of '; return $html; } /** * Configure the filelist to be used in foreach loops. * * @param array $options */ public function filelist(array $options = array()): void { $this->Automad->getFilelist()->config($options); } /** * Place an image. * * Options: * - file: false (filepath or glob pattern - when using a glob pattern, the first match is used) * - width: false (width in pixels) * - height: false (height in pixels) * - crop: false (crop image) * - class: false (class for the element) * * @param array $options - (file: path/to/file (or glob pattern), width: px, height: px, crop: 1) * @return string The HTML for the image output */ public function img(array $options = array()): string { $defaults = array( 'file' => false, 'width' => 0, 'height' => 0, 'crop' => false, 'class' => false ); // Merge options with defaults $options = array_merge($defaults, $options); if ($options['file']) { $files = FileUtils::fileDeclaration($options['file'], $this->Automad->Context->get()); $file = reset($files); $img = new Image($file, $options['width'], $options['height'], $options['crop']); if ($img->file) { if ($options['class']) { $class = ' class="' . $options['class'] . '"'; } else { $class = ''; } return ''; } } return ''; } /** * Generate a list for the navigation below a given URL. * * Options: * - context: '/' (The parent URL) * - hompage: false (include homepage to first-level nav) * - excludeHidden: true (exclude hidden pages) * - class: false (class of the '; return $html; } /** * Generate a list for the navigation below the current page. * Options are the same like those for nav() except the 'context' option. * * @param array $options * @return string The HTML of the navigation list */ public function navChildren(array $options = array()): string { return $this->nav(array_merge($options, array('context' => $this->Automad->Context->get()->url))); } /** * Generate a list for the navigation below the current page's parent. * Options are the same like those for nav() except the 'context' option. * * @param array $options * @return string The HTML of the navigation list */ public function navSiblings(array $options = array()): string { return $this->nav(array_merge($options, array('context' => $this->Automad->Context->get()->parentUrl))); } /** * Generate a list for the navigation at the top level including the home page (level 0 & 1). * Options are the same like those for nav() except the 'context' option. * * @param array $options * @return string The HTML of the navigation list */ public function navTop(array $options = array()): string { return $this->nav(array_merge($options, array('context' => '/'))); } /** * Generate full navigation tree. * * Options: * - all: true (expand all pages or only in current path) * - context: '' (parent URL) * - rootLevel: false (a kind of flexible context page at a given level) * - excludeHidden: true (exclude hidden pages) * - class: false (class of the '; return $html; } } return ''; } /** * Alias for calling the pagelist() method with the default options merged with the specified ones * to override all previous configurations. * * @param array $options */ public function newPagelist(array $options = array()): void { $this->pagelist(array_merge($this->Automad->getPagelist()->getDefaults(), $options)); } /** * Change of configuration for Automad's Pagelist object. * * Options: * * - context: an optionally fixed URL for the context of a pagelist of type breadcrumbs or children. In case this parameter is false, within a loop the context always changes dynamically to the current page. * - excludeCurrent: default false * - excludeHidden: default true * - filter: filter pages by tags * - limit: limit the object's array of relevant pages * - offset: offset the within the array of all relevant pages * - page: false (the current page in the pagination - to be used with the limit parameter) * - search: filter pages by search string * - sort: sorting options string, like "date desc, title asc" * - template: include only pages matching that template * - type: sets the type of pagelist (default is false) - valid types are false (all), "children", "related", "siblings" and "breadcrumbs" * * @param array $options */ public function pagelist(array $options = array()): void { $this->Automad->getPagelist()->config($options); } /** * Merge passed key-value pairs ($options) with current query string. * * @param array $options * @return string The merged query string */ public function queryStringMerge(array $options) { return http_build_query(array_merge($_GET, $options)); } /** * Redirect page. * * @param array $options */ public function redirect(array $options): void { $options = array_merge(array( 'url' => '', 'code' => 302 ), $options); $url = Resolve::absoluteUrlToRoot(Resolve::relativeUrlToBase($options['url'], $this->Automad->Context->get())); header('Location: ' . $url, true, $options['code']); exit(); } /** * Set shared or session data variables by passing an array of key/value pairs. * * @param array $options */ public function set(array $options): void { foreach ($options as $key => $value) { if (preg_match('/' . PatternAssembly::CHAR_CLASS_ALL_VARS . '/', $key)) { if (strpos($key, '%') === 0) { SessionData::set($key, $value); } else { $this->Automad->Shared->set($key, $value); } } } } } __halt_compiler();----SIGNATURE:----C9FbjIyYpge7fHm2wqbqhhqNh6VSe8gxxAg1vID0axnsE5VJVVIl0DiLzh+bBiDIzT63Pab3yRrIz6/enjKSXxfguCNRuZ64atJYKBt+FZQFZz4SCHFVcCtjxqxwOQgUe/kNdBXS17gEUZpvs/5+VI7ZGc6dAqeMhBhRqQKQkFVvfHtcFrDiskNMaqwv++9KQX+D6Z1E7rw7uJuMmOpokmE1LzzSFbIQTZQ77PhQK+20+6keOnxHjI52l9/lor/jVS50tJSVbkxO66OlPEbxwv0SdAdjrZ/qWMW8fJTfjKPoEKX/fKbwFoh8iWwERioNQECrO+U95Z1GuIWHc4VWbs7knpp32UwYGMWQ/xOdPYYGJl0kUKXn+cProzr8VtXvpZpo2ixldsi+vnTNtkWcZ6ruAqtQYoOCYOCu8DL0LKEpWkla3yeutjCEfuR7P5LLkxXSBtAT1FaKnie1XmifOb77wmTiAcppcfCF5HX8AqFQ9hvA4YIpim6xDdDKBhf/lbdmBI6jmYEESEukmgfLjathghhazH38l+sEcjeRrWyJU0uwVPFl50Uto017tP44u0XyRT/qWyKXqTXsD0Q9r8Zl4VHYcc1a8qZf1lyKgcukL3MgNoq5AqRge9XwpImlgZ4Qj/wHWkhtUu7jWqeqOXNYMYyJ3BIUf6yawa01hKc=----ATTACHMENT:----ODU1MDk1MDM3NTQzNTA1MSA1OTk0ODc4Nzk1MDExMzM5IDY1MDgxODA4NDc5NzMyNTg=